## -*- coding: utf_8 -*- <% from fcp import fcpdefs from fcp import mlitem from fcutils import util from fcws.fcweb import webutil from cStringIO import StringIO import base64 %> <%namespace name="toolbar" file="toolbars.html" import="create"/> <% def spitRulesForm(): str = '"FORM":{"ID":20,"13800":{"t":"有効にする","v":1},"13801":"=-1;\u53d7\u4fe1=0;\u9001\u4fe1=1;\u4f5c\u6210=2;\u524a\u9664=3;\u79fb\u52d5=4;\u958b\u304f=5;\u671f\u9650\u5207\u308c=6;\u5909\u66f4=7;\u8fd4\u4fe1=8;\u8ee2\u9001=9;\u624b\u52d5=10;\u8aad\u307f\u53d6\u308a=11;\u9589\u3058\u308b=12;\u7de8\u96c6=13;\u30ea\u30de\u30a4\u30f3\u30c0=14;\u30b3\u30f3\u30c6\u30ca\u3092\u958b\u304f=15","13806":"\u7121\u52b9=0;1\u3068\u540c\u3058=1;1\u3068\u7570\u306a\u308b;2\u3068\u540c\u3058;2\u3068\u7570\u306a\u308b;3\u3068\u540c\u3058;3\u3068\u7570\u306a\u308b;1\u3088\u308a\u5927\u304d\u3044;1\u3088\u308a\u5c0f\u3055\u3044;2\u3088\u308a\u5927\u304d\u3044;2\u3088\u308a\u5c0f\u3055\u3044;3\u3088\u308a\u5927\u304d\u3044;3\u3088\u308a\u5c0f\u3055\u3044;\u30bb\u30c3\u30c8\u3057\u305f\u30e1\u30f3\u30d0\u30fc=21;\u30bb\u30c3\u30c8\u3057\u305f\u30e1\u30f3\u30d0\u30fc\u3067\u306f\u306a\u3044;\u5b58\u5728\u3059\u308b=31;\u5b58\u5728\u3057\u306a\u3044;\u6b21\u3092\u542b\u3080=41;\u6b21\u3092\u542b\u307e\u306a\u3044;\u6b21\u3067\u59cb\u307e\u308b= 51;\u6b21\u3067\u59cb\u307e\u3089\u306a\u3044;\u6b21\u3067\u7d42\u308f\u308b=61;\u6b21\u3067\u7d42\u308f\u3089\u306a\u3044;\u30e6\u30fc\u30b6\u8a2d\u5b9a1\u3068\u540c\u3058=101;\u30e6\u30fc\u30b6\u8a2d\u5b9a1\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a2\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a 2\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a3\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a3\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a4\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a4\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a5\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a5\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a6\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a6\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a7\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a7\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a8\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a8\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a9\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a9\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a10\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a10\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a11\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a11\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a12\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a12\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a13\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a13\u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a14\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a14 \u3068\u7570\u306a\u308b;\u30e6\u30fc\u30b6\u8a2d\u5b9a15\u3068\u540c\u3058;\u30e6\u30fc\u30b6\u8a2d\u5b9a15\u3068\u7570\u306a\u308b","13807":"\u3059\u3079\u3066\u306e\u6761\u4ef6;\u3044\u305a\u308c\u304b\u6761\u4ef6","13810":"----=0;\u5b9b\u5148\u306e\u5168\u53d7\u4fe1\u8005;CC\u306e\u5168\u53d7\u4fe1\u8005;BCC\u306e\u5168\u53d7\u4fe1\u8005;\u5168\u8ee2\u9001\u8005;\u5168\u53d7\u4fe1\u8005;\u5dee\u51fa\u4eba;\u8ee2\u9001\u8005;\u5b9b\u5148\u306e\u540d\u524d;CC\u306e\u540d\u524d;BCC\u306e\u540d\u524d;\u53d7\u4fe1\u8005;\u30aa\u30d6\u30b8\u30a7\u30af\u30c8;\u9001\u4fe1\u65e5;\u53d7\u4fe1\u65e5;\u4f5c\u6210\u65e5;\u6700\u7d42\u66f4\u65b0\u65e5;\u6709\u52b9\u671f\u9650\u65e5;\u30b5\u30a4\u30ba;\u540d\u524d;\u4ef6\u540d;\u5168\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb;\u6dfb\u4ed8\u30d5\u30a1\u30a4\u30eb;\u672c\u6587;\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u30d8\u30c3\u30c0;\u5c65\u6b74;\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e;\u30d5\u30a1\u30a4\u30eb\u306e\u7a2e\u985e;\u30d5\u30a9\u30fc\u30e0\u306e\u7a2e\u985e;\u30a2\u30a4\u30b3\u30f3;\u30e1\u30c7\u30a3\u30a2\u306e\u7a2e\u985e;\u30d5\u30a3\u30fc\u30eb\u30c9\u30c7\u30fc\u30bf;\u30d5\u30a3\u30fc\u30eb\u30c9;\u5e38\u306b\u9069\u7528\u3059\u308b;\u9069\u7528\u3057\u306a\u3044;\u78ba\u7387\u304c;\u30b9\u30d1\u30e0\u30b9\u30b3\u30a2\u304c;\u30b3\u30f3\u30c6\u30ca\u304c\u6b21\u306e\u6642;\u30e6\u30fc\u30b6\u304c\u6b21\u306e\u6642","13830":"=-1;\u4f55\u3082\u3057\u306a\u3044=0;\u79fb\u52d5\u3059\u308b=1;\u30b3\u30d4\u30fc\u3059\u308b=2;\u524a\u9664\u3059\u308b=3;\u81ea\u52d5\u8fd4\u4fe1\u3059\u308b=4;\u62d2\u5426\u3057\u3066\u4e0d\u9054\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b=5;\u6b21\u306e\u5b9b\u5148\u306b\u8ee2\u9001\u3059\u308b=6;\u6b21\u306e\u5b9b\u5148\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b=7;\u643a\u5e2f\u96fb\u8a71\u306b\u8ee2\u9001/\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b=8;\u6b21\u306e\u5b9b\u5148\u306b\u901a\u77e5\u3092\u9001\u4fe1\u3059\u308b=9;\u65b0\u898f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b=10;\u672a\u627f\u8a8d\u306b\u3059\u308b=11;\u672a\u8aad\u306b\u3059\u308b=12;\u81ea\u52d5\u7684\u306b\u958b\u304f=13;\u4fdd\u8b77\u3059\u308b=14;\u8aad\u307f\u53d6\u308a\u5c02\u7528\u306b\u3059\u308b=54;\u6b21\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u8a2d\u5b9a\u3059\u308b=15;\u6b21\u306e\u8272\u3092\u8a2d\u5b9a\u3059\u308b=16;\u6b21\u306e\u91cd\u8981\u5ea6\u3092\u8a2d\u5b9a\u3059\u308b=17;\u6b21\u306e\u79d8\u5bc6\u5ea6\u3092\u8a2d\u5b9a\u3059=18;\u6b21\u306e\u6709\u52b9\u671f\u9593\u3092\u8a2d\u5b9a\u3059\u308b=19;\u6b21\u306e\u6587\u5b57\u30bb\u30c3\u30c8\u3092\u8a2d\u5b9a\u3059\u308b=20;\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u3092\u7121\u52b9\u306b\u3059\u308b=21;\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u306b\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8a2d\u5b9a\u3059\u308b=22;\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u306b\u6570\u5024\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8a2d\u5b9a\u3059\u308b=23;\u3053\u306e\u30a2\u30a4\u30c6\u30e0\u306b\u65e5\u4ed8\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8a2d\u5b9a\u3059\u308b=24;\u97f3\u58f0\u3092\u518d\u751f\u3059\u308b=25;\u8b66\u544a\u30dc\u30c3\u30af\u30b9\u3092\u958b\u304f=26;\u51e6\u7406\u524d\u306b\u78ba\u8a8d\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b=27;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u6a29\u9650\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3059\u308b=28;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u6a29\u9650\u30ea\u30b9\u30c8\u304b\u3089\u524a\u9664\u3059\u308b=29;\u9078\u629e\u3057\u305f\u540d\u524d\u306b\u6a29\u9650\u3092\u4e0e\u3048\u308b=30;\u9078\u629e\u3057\u305f\u540d\u524d\u304b\u3089\u6a29\u9650\u3092\u53d6\u308a\u6d88\u3059=31;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u81ea\u5206\u306e\u30b3\u30f3\u30bf\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u306b\u767b\u9332\u3059\u308b=32;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u81ea\u5206\u306e\u30b3\u30f3\u30bf\u30af\u30c8\u30d5\u30a9\u30eb\u30c0\u304b\u3089\u524a\u9664\u3059\u308b=33;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u4f1a\u8b70\u5ba4\u306b\u53c2\u52a0\u8005\u3068\u3057\u3066\u767b\u9332\u3059\u308b=34;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u4f1a\u8b70\u5ba4\u306e\u53c2\u52a0\u8005\u304b\u3089\u9664\u5916\u3059\u308b=35;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u81ea\u5206\u306e\u30e1\u30fc\u30eb\u30ea\u30b9\u30c8\u306b\u767b\u9332\u3059\u308b=36;\u9078\u629e\u3057\u305f\u540d\u524d\u3092\u81ea\u5206\u306e\u30e1\u30fc\u30eb\u30ea\u30b9\u30c8\u304b\u3089\u524a\u9664\u3059\u308b=37;\u3053\u306e\u540d\u524d\u3092\u516c\u958b\u30e1\u30fc\u30eb\u30ea\u30b9\u30c8\u306b\u767b\u9332\u3059\u308b=38;\u3053\u306e\u540d\u524d\u3092\u516c\u958b\u30e1\u30fc\u30eb\u30ea\u30b9\u30c8\u304b\u3089\u9664\u5916\u3059\u308b=39;\u3053\u306e\u540d\u524d\u3092\u30e6\u30fc\u30b6\u30b0\u30eb\u30fc\u30d7\u306b\u8ffd\u52a0\u3059\u308b=40;\u3053\u306e\u540d\u524d\u3092\u30e6\u30fc\u30b6\u30b0\u30eb\u30fc\u30d7\u304b\u3089\u524a\u9664\u3059\u308b=41;Rules Log\u306b\u8ffd\u52a0\u3059\u308b=42;\u6b21\u306e\u4ef6\u540d\u3092\u8a2d\u5b9a\u3059\u308b=43;\u4ee5\u964d\u306e\u30eb\u30fc\u30eb\u306e\u5b9f\u884c\u3092\u505c\u6b62\u3059\u308b=44;\u30d0\u30c3\u30c1\u7ba1\u7406\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b=45;\u30d8\u30eb\u30d1\u30fc\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3059\u308b=46;\u30d5\u30a9\u30fc\u30e0\u306e\u7a2e\u985e\u3092\u5909\u66f4\u3059\u308b=47;\u6b21\u306e\u540d\u524d\u3092\u8a2d\u5b9a\u3059\u308b=48;\u30ea\u30f3\u30af\u3092\u4f5c\u6210\u3059\u308b=49;\u30ab\u30a6\u30f3\u30bf\u3092\u30b3\u30d4\u30fc\u3059\u308b=50;\u30e6\u30fc\u30b6\u306b\u30ea\u30f3\u30af\u3059\u308b=51;\u9078\u629e\u80a2\u3092\u958b\u304f=52;\u6b21\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u7a2e\u985e\u3092\u8a2d\u5b9a\u3059\u308b=53;\u8868\u793a\u3092\u8a2d\u5b9a\u3059\u308b=55"}' return str def spitManagedTasksForm(): str = '"FORM":{"ID":20508,"1012":"-=0;\u30a2\u30b5\u30a4\u30f3\u4e2d=6;\u4e86\u89e3\u6e08\u307f=7;\u9032\u884c\u4e2d=2;\u5b8c\u4e86=1;\u5f85\u3061=3;\u5ef6\u671f\uff4b=4;\u30ad\u30e3\u30f3\u30bb\u30eb=5"}' return str itemsStrIO = StringIO() jsonStr = '' myMLItem = fcp.MyMLItem thisWebID = myMLItem.WebID() type = myMLItem.Type() subType = myMLItem.SubType() fType,forceColumnarValue = fcp.GetEscapedFormField(13395,0) bForceColumnar = subType==20 or subType==77 or (forceColumnarValue==1 and type == fcpdefs.oMailBox) windowTitle = webutil.stripNone(fcp, fcpdefs.dObjName) nFiles = fcp.NFiles if nFiles==None: nFiles = 0 nFolders = fcp.NFolders if nFolders==None: nFolders = 0 view = fcp.view if view==None: view = 0 nUpperPaneItems = 0 # render for a new window or just add more records bFullPage = False if (Page=='NEXT' or Page=='PREVIOUS' or Page=='ALL') else True bIsThreadListing = True if Thread else False bShowingDeleted = True if Deleted=='' else False if subType==7 or subType==40 or type==fcpdefs.oMailBox: splitType = fcpdefs.viewInfo.splitVertical else: splitType, splitPos, splitPercent = fcp.GetSplitInfo() if Navigator=="1": bIsViewByIcon = True navigatorString = 'fcNavigator="1" ' else: bIsViewByIcon = fcp.IsViewByIcon() if (not bForceColumnar and not bShowingDeleted and subType!=7 and subType!=40 and subType!=66 and type!=fcpdefs.oMailBox) else False navigatorString = '' ratingType = fcp.solicitationMethod if not ratingType: ratingType = 0 parentWebID = myMLItem.ParentWebID() if parentWebID: parentWebIDStr = 'data-x-fcp-parentid="'+parentWebID+'"' else: parentWebIDStr = '' options = fcp.options if options==None: options = 0 if bForceColumnar: options = options | 0x0200 if subList!=None: nItems = len(subList) for i in range(nItems): item = subList[i] if item: itemsStrIO.write(item.AsJSONArrayItem(mlitem.sendAll,(client.serverTZ,client.clientTZ)) + ',') if not item.IsContainer() and item.IsUpperPaneItem(): nUpperPaneItems += 1 else: i = 0 item = fcp.GetNthMLItem(i) while item: itemsStrIO.write(item.AsJSONArrayItem(mlitem.sendAll,(client.serverTZ,client.clientTZ)) + ',') if not item.IsContainer() and item.IsUpperPaneItem(): nUpperPaneItems += 1 i = i + 1 item = fcp.GetNthMLItem(i) if bFullPage: jsonStr += '{"MYMLITEM":'+myMLItem.AsJSONArrayItem(mlitem.sendAll,(client.serverTZ,client.clientTZ))+',"NFILES":'+str(nFiles)+',"NFOLDERS":'+str(nFolders)+',"NUPPERPANEITEMS":'+str(nUpperPaneItems)+',"RIGHTS":'+str(fcp.rights) jsonStr += ',"VIEW":'+str(view)+',"OPTIONS":'+str(options)+',"RATINGTYPE":'+str(ratingType) if subType==29: jsonStr += ','+spitRulesForm() elif subType==77: jsonStr += ','+spitManagedTasksForm() formData = fcp.FormFieldDataAsJSON() if formData!=None: jsonStr += ','+formData else: fType,colLayout = fcp.GetEscapedFormField(13100) if colLayout==None or len(colLayout)==0: fType,colLayout = fcp.GetEscapedFormField(13000) if colLayout and len(colLayout): colLayoutBase64 = base64.standard_b64encode(colLayout) jsonStr += ',"FORMDATA":{"13100":{"b64":"'+colLayoutBase64+'"}}' jsonStr += ',"MLDS":[' else: jsonStr += '{"MLDS":[' strOut = itemsStrIO.getvalue() itemsStrIO.close() lenStrOut = len(strOut) if lenStrOut>0 and strOut[lenStrOut-1]==',': strOut = strOut[0:lenStrOut-1] jsonStr += strOut + ']}' if bFullPage: fldrStyle = '' if nFolders else ' style="display:none;"' upperPaneStyle = '' if nUpperPaneItems else ' style="display:none;"' bIsColumnView = True if Columnar=="1" and (((options & 0x200) != 0 and not (subType==67 or subType==66 or subType==33) and not bShowingDeleted) or (subType==40 or subType==32 or subType==42 or subType==29 or subType==20)) else False bLowerLayoutIsSet = fcp.UseLowerLayout() bUseLowerLayout = True if (bIsColumnView and bLowerLayoutIsSet) or (not bIsColumnView and bLowerLayoutIsSet) else False bSplitView = not bShowingDeleted and not bIsViewByIcon and not subType==16 bHideSplit = bSplitView and (bIsColumnView or subType==67 or subType==66 or subType==33 or subType==20 or type==19) if Retrieve=='SUMMARY': extraData = 'data-x-fc-viewitems="0x0008"' elif bShowingDeleted: extraData = 'data-x-fc-viewitems="0x0007" data-x-fcp-keepopen="true"' elif bIsViewByIcon and navigatorString == '': extraData = 'data-x-fc-viewitems="0x0003"' elif subType==42: extraData = 'data-x-fc-viewitems="0x0007"' elif splitType==fcpdefs.viewInfo.splitNone: extraData = 'data-x-fc-viewitems="0x0003"' else: extraData = '' containerClasses = '' listClasses = ' fc-servobj-view fc-scrolling-view' if bShowingDeleted or bIsThreadListing or subType==42 or type==19: extraData = extraData + ' data-x-fc-getting-more-items=1' wrapperClassList = 'fc-views-wrapper' if bShowingDeleted or subType==42: listClasses += ' fc-only-deleted' if not bShowingDeleted: tbOptions = {'bIsViewByIcon':bIsViewByIcon,'bSplitView':bSplitView,'bHideSplit':bHideSplit,'bShowingDeleted':(bShowingDeleted or subType==42),'nUpperPaneItems':nUpperPaneItems,'bIsColumnView':bIsColumnView,'bIsThreadListing':bIsThreadListing}; toolbar.create(fcp,tbOptions) if subType==66: wrapperData = 'data-x-fc-tab-name="cmd_ShowFeed"' elif subType==33: wrapperData = 'data-x-fc-tab-name="cmd_ShowBlogs"' elif type==19: wrapperData = 'data-x-fc-tab-name="cmd_ShowHitListContent"' extraData = extraData + ' data-x-fcp-updatehandler="FC.updateSearchStatus"' else: wrapperData = '' if fcp.solicitationMethod: extraData = extraData + ' data-x-fcp-ratingtype="'+str(fcp.solicitationMethod)+'"' context.write('