diff --git a/o2web/source/x_component_cms_ColumnManager/Main.js b/o2web/source/x_component_cms_ColumnManager/Main.js index fafc330f8b11810de479e9872ac3846ffe67e60e..bdc2ccda2e7f50f5b7cd9086cf6b4a916801f253 100644 --- a/o2web/source/x_component_cms_ColumnManager/Main.js +++ b/o2web/source/x_component_cms_ColumnManager/Main.js @@ -1022,6 +1022,8 @@ MWF.xApplication.cms.ColumnManager.ApplicationProperty = new Class({ html += ""+this.app.lp.application.ignoreTitle+""+(flag ? lp.ignoreTitleSelectText[0] : lp.ignoreTitleSelectText[1] )+""; var flag = typeOf(this.config.latest) === "boolean" ? this.config.latest : true; html += ""+this.app.lp.application.latest+""+(flag ? lp.checkDraftSelectText[0] : lp.checkDraftSelectText[1] )+""; + var flag = typeOf(this.data.allowWaitPublish) === "boolean" ? this.data.allowWaitPublish : false; + html += ""+this.app.lp.application.delayView+""+(flag ? lp.showDelayDocumentSelectText[0] : lp.showDelayDocumentSelectText[1] )+""; var flag = typeOf(this.data.showAllDocuments) === "boolean" ? this.data.showAllDocuments : true; html += ""+this.app.lp.application.showAllDocumentViews+""+(flag ? lp.showAllDocumentSelectText[0] : lp.showAllDocumentSelectText[1] )+""; // html += ""+this.app.lp.application.type+""; @@ -1067,6 +1069,14 @@ MWF.xApplication.cms.ColumnManager.ApplicationProperty = new Class({ selectText : lp.checkDraftSelectText }); + this.delaySelect = new MDomItem( this.propertyContentNode.getElement("#formApplicationDelay"), { + type : "select", + defaultValue : "true", + value : ( typeOf(this.data.allowWaitPublish) === "boolean" ? this.data.allowWaitPublish : false ).toString(), + selectValue : [ "true", "false" ], + selectText : lp.showDelayDocumentSelectText + }); + this.allDocumentViewSelect = new MDomItem( this.propertyContentNode.getElement("#showAllDocumentViews"), { type : "select", defaultValue : "true", @@ -1143,6 +1153,7 @@ MWF.xApplication.cms.ColumnManager.ApplicationProperty = new Class({ this.typeSelect.editMode(); this.latestSelect.editMode(); + this.delaySelect.editMode(); this.ignoreTitleSelect.editMode(); this.allDocumentViewSelect.editMode(); this.defaultEditForm.editMode(); @@ -1158,6 +1169,7 @@ MWF.xApplication.cms.ColumnManager.ApplicationProperty = new Class({ this.sortInput.readMode(); this.typeSelect.readMode(); this.latestSelect.readMode(); + this.delaySelect.readMode(); this.ignoreTitleSelect.readMode(); this.allDocumentViewSelect.readMode(); this.defaultEditForm.readMode(); @@ -1223,6 +1235,8 @@ MWF.xApplication.cms.ColumnManager.ApplicationProperty = new Class({ this.config.ignoreTitle = this.ignoreTitleSelect.getValue() !== "false"; this.config.latest = this.latestSelect.getValue() !== "false"; + this.data.allowWaitPublish = this.delaySelect.getValue() === "true"; + this.data.config = JSON.stringify( this.config ); //this.data.applicationCategory = this.appTypeInput.input.get("value"); @@ -1237,6 +1251,7 @@ MWF.xApplication.cms.ColumnManager.ApplicationProperty = new Class({ this.sortInput.save(); this.typeSelect.save(); this.latestSelect.save(); + this.delaySelect.save(); this.ignoreTitleSelect.save(); this.allDocumentViewSelect.save(); this.defaultEditForm.save(); diff --git a/o2web/source/x_component_cms_ColumnManager/lp/en.js b/o2web/source/x_component_cms_ColumnManager/lp/en.js index 59edc28cf36d5831b73eea7bfcaa52209c867a99..7c718331606fd55ca12c3f3d66f3ec8ef7f6413b 100644 --- a/o2web/source/x_component_cms_ColumnManager/lp/en.js +++ b/o2web/source/x_component_cms_ColumnManager/lp/en.js @@ -175,6 +175,7 @@ MWF.xApplication.cms.ColumnManager.LP = { "appType": "AppInfo Type", "ignoreTitle": "Ignore Title", "latest": "Check Draft", + "delayView": "Delayed View", "defaultEditForm": "Default Edit Form", "defaultReadForm": "Default Read Form", "editformNote": "Note: The default edit form when creating a category", @@ -224,6 +225,8 @@ MWF.xApplication.cms.ColumnManager.LP = { "loadFiles": "Batch upload attachments" }, + "enable": "enable", + "disable": "disable", "name": "Name", "alias": "Alias", "attachment": "Attachment", @@ -297,6 +300,7 @@ MWF.xApplication.cms.ColumnManager.LP = { "ignoreTitleSelectText": ["Do not fill in the title of the new interface", "The title of the new interface needs to be filled in"], "checkDraftSelectText": ["New interface check draft","New interface does not check draft"], "showAllDocumentSelectText": ["Show all document views","Hide all document views"], + "showDelayDocumentSelectText": ["Show timed release document view","Hide timed release document view"], "selectRelateFormNotice": "Please select the related form of the view to be pasted", diff --git a/o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js b/o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js index 5d3a15ec1e92d4c0de256a0936b1674c11b15827..2fa32242cc33e00fdd31500ad712ce9ece8853f8 100644 --- a/o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js +++ b/o2web/source/x_component_cms_ColumnManager/lp/zh-cn.js @@ -176,6 +176,7 @@ MWF.xApplication.cms.ColumnManager.LP = { "appType" : "栏目类型", "ignoreTitle" : "忽略标题", "latest" : "检查草稿", + "delayView": "定时视图", "defaultEditForm": "默认编辑表单", "defaultReadForm": "默认阅读表单", "editformNote": "注:创建分类时的默认编辑表单", @@ -225,6 +226,8 @@ MWF.xApplication.cms.ColumnManager.LP = { "loadFiles": "批量上传附件" }, + "enable": "启用", + "disable": "禁用", "name": "名称", "alias": "别名", "attachment": "附件", @@ -297,6 +300,7 @@ MWF.xApplication.cms.ColumnManager.LP = { "ignoreTitleSelectText": ["新建界面不填写标题","新建界面需要填写标题"], "checkDraftSelectText": ["新建界面检查草稿","新建界面不检查草稿"], "showAllDocumentSelectText": ["显示所有文档视图","隐藏所有文档视图"], + "showDelayDocumentSelectText": ["显示定时发布文档视图","隐藏定时发布文档视图"], "selectRelateFormNotice": "请选择需粘贴视图的关联表单", diff --git a/o2web/source/x_component_cms_Document/$Processor/default/cancel-18.png b/o2web/source/x_component_cms_Document/$Processor/default/cancel-18.png deleted file mode 100644 index 8974b8adb6158cdef22d0f72ecfe69948789918e..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/default/cancel-18.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/default/cancel.png b/o2web/source/x_component_cms_Document/$Processor/default/cancel.png deleted file mode 100644 index 03d8bfeb87e42e8abe083dbc718a4e94cf905153..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/default/cancel.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/default/checked.png b/o2web/source/x_component_cms_Document/$Processor/default/checked.png deleted file mode 100644 index fe937fff13b7281351026c228ff1b1f2f2330258..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/default/checked.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/default/css.wcss b/o2web/source/x_component_cms_Document/$Processor/default/css.wcss deleted file mode 100644 index d56c63d436ccc4beb688428573545770966115c5..0000000000000000000000000000000000000000 --- a/o2web/source/x_component_cms_Document/$Processor/default/css.wcss +++ /dev/null @@ -1,148 +0,0 @@ -{ - "routeSelectorTile": { - "overflow": "hidden", - "height": "30px", - "line-height": "30px", - "font-size": "14px", - "font-weight": "bold", - "background-color": "#6681a5", - "color": "#FFF", - "padding-left": "20px" - }, - "routeSelectorArea": { - "overflow": "hidden", - "min-height": "40px", - "padding": "0xp 20px" - }, - "routeNode": { - "float": "left", - "margin-left": "20px", - "border-radius": "5px", - "background-color": "#E3E3E3", - "height": "24px", - "line-height": "24px", - "margin-top": "8px", - "padding-right": "8px", - "cursor": "pointer" - }, - "routeIconNode": { - "width": "24px", - "height": "24px", - "float": "left", - "background": "url("+"../x_component_cms_Document/$Processor/default/nocheck.png) no-repeat center center" - }, - "routeTextNode": { - "margin-left": "24px", - "line-height": "24px", - "color": "#000" - }, - - "routeOpinionTile": { - "overflow": "hidden", - "height": "30px", - "line-height": "30px", - "font-size": "14px", - "font-weight": "bold", - "background-color": "#6681a5", - "color": "#FFF", - "padding-left": "20px" - }, - "routeOpinionArea": { - "height": "129px", - "border-bottom": "1px solid #6681a5" - }, - - "inputOpinionNode": { - "height": "129px", - "width": "358px", - "float": "left", - "border-left": "1px solid #6681a5", - "border-right": "1px solid #6681a5", - "background-color": "#EEE" - }, - "selectIdeaNode": { - "height": "129px", - "width": "112px", - "float": "right", - "background-color": "#FFF", - "overflow": "hidden" - }, - "selectIdeaScrollNode": { - "height": "129px", - "margin-right": "6px", - "overflow": "hidden" - }, - "selectIdeaItemNode": { - "height": "20px", - "line-height": "20px", - "font-size": "12px", - "cursor": "pointer", - "background-color": "#FFF", - "overflow": "hidden" - }, - "selectIdeaItemNode_over": { - "background-color": "#e6ecf8" - }, - - "buttonsArea": { - "height": "50px", - "overflow": "hidden" - }, - - "okButton": { - "height": "30px", - "width": "100px", - "border-radius": "5px", - "background-color": "#6681a5", - "color": "#FFF", - "float": "right", - "margin-right": "20px", - "margin-top": "10px", - "cursor": "pointer" - }, - "okIconNode": { - "height": "30px", - "width": "40px", - "float": "left", - "background": "url("+"../x_component_cms_Document/$Processor/default/ok-18.png) no-repeat center center" - }, - "okTextNode": { - "font-size": "14px", - "margin-left": "40px", - "line-height": "28px" - }, - - "cancelButton": { - "height": "28px", - "width": "78px", - "border": "1px solid #999", - "border-radius": "5px", - "background-color": "#fff", - "color": "#999", - "float": "right", - "margin-right": "20px", - "margin-top": "10px", - "cursor": "pointer" - }, - "cancelIconNode": { - "height": "28px", - "width": "33px", - "float": "left", - "background": "url("+"../x_component_cms_Document/$Processor/default/cancel-18.png) no-repeat center center" - }, - "cancelTextNode": { - "font-size": "14px", - "margin-left": "33px", - "line-height": "26px" - }, - "inputTextarea": { - "font-family": "Microsoft YaHei", - "border": "0px", - "overflow": "auto", - "width": "352px", - "height": "120px", - "padding": "3px", - "color": "#666" - } - -} \ No newline at end of file diff --git a/o2web/source/x_component_cms_Document/$Processor/default/nocheck.png b/o2web/source/x_component_cms_Document/$Processor/default/nocheck.png deleted file mode 100644 index 563b92e49db59a4eb6204c282eb3bdc14e95a42c..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/default/nocheck.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/default/ok-18.png b/o2web/source/x_component_cms_Document/$Processor/default/ok-18.png deleted file mode 100644 index 03b62514bec904ec798dd323d269d14df77bdb76..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/default/ok-18.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/default/ok.png b/o2web/source/x_component_cms_Document/$Processor/default/ok.png deleted file mode 100644 index 35f96854e612935dac33135d5324e25a92fd4626..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/default/ok.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/task/cancel-18.png b/o2web/source/x_component_cms_Document/$Processor/task/cancel-18.png deleted file mode 100644 index 8974b8adb6158cdef22d0f72ecfe69948789918e..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/task/cancel-18.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/task/cancel.png b/o2web/source/x_component_cms_Document/$Processor/task/cancel.png deleted file mode 100644 index 03d8bfeb87e42e8abe083dbc718a4e94cf905153..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/task/cancel.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/task/checked.png b/o2web/source/x_component_cms_Document/$Processor/task/checked.png deleted file mode 100644 index fe937fff13b7281351026c228ff1b1f2f2330258..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/task/checked.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/task/css.wcss b/o2web/source/x_component_cms_Document/$Processor/task/css.wcss deleted file mode 100644 index 8525f4c268ed0dbfa5fbd17096845026b74bfd57..0000000000000000000000000000000000000000 --- a/o2web/source/x_component_cms_Document/$Processor/task/css.wcss +++ /dev/null @@ -1,148 +0,0 @@ -{ - "routeSelectorTile": { - "overflow": "hidden", - "height": "30px", - "line-height": "36px", - "font-size": "14px", - "font-weight": "bold", - "color": "#333", - "width": "80px", - "float": "left", - "margin-left": "20px" - }, - "routeSelectorArea": { - "overflow": "hidden", - "min-height": "30px", - "margin-left": "100px" - }, - "routeNode": { - "float": "left", - "margin-left": "20px", - "border-radius": "5px", - "background-color": "#E3E3E3", - "height": "24px", - "line-height": "24px", - "margin-top": "8px", - "padding-right": "8px", - "cursor": "pointer" - }, - "routeIconNode": { - "width": "24px", - "height": "24px", - "float": "left", - "background": "url("+"../x_component_cms_Document/$Processor/task/nocheck.png) no-repeat center center" - }, - "routeTextNode": { - "margin-left": "24px", - "line-height": "24px", - "color": "#000" - }, - - "routeOpinionTile": { - "clear": "both", - "overflow": "hidden", - "height": "20px", - "line-height": "20px", - "font-size": "14px", - "font-weight": "bold", - "color": "#333", - "padding-left": "20px" - }, - "routeOpinionArea": { - "height": "99px", - "margin": "0px 10px 0px 20px", - "border-bottom": "0px solid #6681a5" - }, - - "inputOpinionNode": { - "height": "97px", - "width": "358px", - "border": "1px solid #6681a5", - "background-color": "#EEE" - }, - "selectIdeaNode": { - "height": "97px", - "width": "116px", - "float": "right", - "background-color": "#FFF", - "overflow": "hidden" - }, - "selectIdeaScrollNode": { - "height": "97px", - "margin-right": "6px", - "overflow": "hidden" - }, - "selectIdeaItemNode": { - "height": "20px", - "line-height": "20px", - "font-size": "12px", - "cursor": "pointer", - "background-color": "#FFF" - }, - "selectIdeaItemNode_over": { - "background-color": "#e6ecf8" - }, - - - "buttonsArea": { - "height": "50px", - "overflow": "hidden" - }, - - "okButton": { - "height": "30px", - "width": "100px", - "border-radius": "5px", - "background-color": "#6681a5", - "color": "#FFF", - "float": "right", - "margin-right": "20px", - "margin-top": "10px", - "cursor": "pointer" - }, - "okIconNode": { - "height": "30px", - "width": "40px", - "float": "left", - "background": "url("+"../x_component_cms_Document/$Processor/task/ok-18.png) no-repeat center center" - }, - "okTextNode": { - "font-size": "14px", - "margin-left": "40px", - "line-height": "28px" - }, - - "cancelButton": { - "height": "28px", - "width": "78px", - "border": "1px solid #999", - "border-radius": "5px", - "background-color": "#fff", - "color": "#999", - "float": "right", - "margin-right": "20px", - "margin-top": "10px", - "cursor": "pointer" - }, - "cancelIconNode": { - "height": "28px", - "width": "33px", - "float": "left", - "background": "url("+"../x_component_cms_Document/$Processor/task/cancel-18.png) no-repeat center center" - }, - "cancelTextNode": { - "font-size": "14px", - "margin-left": "33px", - "line-height": "26px" - }, - "inputTextarea": { - "font-family": "Microsoft YaHei", - "border": "0px", - "overflow": "auto", - "width": "352px", - "height": "90px", - "padding": "3px", - "color": "#666" - } - -} \ No newline at end of file diff --git a/o2web/source/x_component_cms_Document/$Processor/task/nocheck.png b/o2web/source/x_component_cms_Document/$Processor/task/nocheck.png deleted file mode 100644 index 563b92e49db59a4eb6204c282eb3bdc14e95a42c..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/task/nocheck.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/task/ok-18.png b/o2web/source/x_component_cms_Document/$Processor/task/ok-18.png deleted file mode 100644 index 03b62514bec904ec798dd323d269d14df77bdb76..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/task/ok-18.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/$Processor/task/ok.png b/o2web/source/x_component_cms_Document/$Processor/task/ok.png deleted file mode 100644 index 35f96854e612935dac33135d5324e25a92fd4626..0000000000000000000000000000000000000000 Binary files a/o2web/source/x_component_cms_Document/$Processor/task/ok.png and /dev/null differ diff --git a/o2web/source/x_component_cms_Document/DelayPublishForm.js b/o2web/source/x_component_cms_Document/DelayPublishForm.js new file mode 100644 index 0000000000000000000000000000000000000000..71e94e01d956d3e36f825c257978e275332e0aa5 --- /dev/null +++ b/o2web/source/x_component_cms_Document/DelayPublishForm.js @@ -0,0 +1,100 @@ +MWF.xApplication.cms.Document = MWF.xApplication.cms.Document || {}; +MWF.xDesktop.requireApp("Template", "MPopupForm", null, false); + +MWF.xApplication.cms.Document.DelayPublishForm = new Class({ + Extends: MPopupForm, + Implements: [Options, Events], + options: { + "style": "default", + "width": "580", + "height": "220", + "hasTop": true, + "hasIcon": false, + "hasTopIcon" : false, + "hasTopContent" : true, + "hasBottom": true, + "title": MWF.xApplication.cms.Document.LP.regularPublish, //"设置热点" + "draggable": true, + "closeAction": true, + "publishTime": "" + }, + _createTableContent: function () { + this.formAreaNode.setStyle("z-index", 1002); + this.formMaskNode.setStyle("z-index", 1002); + this.formTableContainer.setStyles({ + "margin":"40px 40px 0px 40px" + }); + var html = "" + + "" + + " " + + " " + + ""+ + "
"+this.lp.publishTime+":
"; + this.formTableArea.set("html", html); + + MWF.xDesktop.requireApp("Template", "MForm", function () { + this.form = new MForm(this.formTableArea, this.data, { + style: "meeting", + isEdited: true, + itemTemplate: { + publishTime: { + text: this.lp.publishTime, + tType: "datetime", + notEmpty: true, + value: this.options.publishTime || "", + attr: { + "readonly":true + }, + calendarOptions : { + "secondEnable": true, + "format": "db", + "onShow": function () { + this.container.setStyle("z-index", 1003 ); + } + } + } + } + }, this.app, this.css); + this.form.load(); + }.bind(this), true); + }, + _createBottomContent: function () { + + this.closeActionNode = new Element("div.formCancelActionNode", { + "styles": this.css.formCancelActionNode, + "text": this.lp.close + }).inject(this.formBottomNode); + + this.closeActionNode.addEvent("click", function (e) { + this.cancel(e); + }.bind(this)); + + this.okActionNode = new Element("div.formOkActionNode", { + "styles": this.css.formOkActionNode, + "text": this.lp.publish + }).inject(this.formBottomNode); + + this.okActionNode.addEvent("click", function (e) { + this.ok(e); + }.bind(this)); + + + }, + ok: function (e) { + this.fireEvent("queryOk"); + + var result = this.form.getResult(true, null); + if( !result ){ + this.app.notice(this.lp.inputPublishTime, "error"); + return; + }else if( new Date( result.publishTime ) <= new Date() ){ + this.app.notice(this.lp.inputPublishTime2, "error"); + return; + } + (this.formMaskNode || this.formMarkNode).destroy(); + this.formAreaNode.destroy(); + // this.app.notice(this.lp.setHotLinkSuccess, "success"); + this.fireEvent("postOk", result.publishTime); + + } +}); diff --git a/o2web/source/x_component_cms_Document/Main.js b/o2web/source/x_component_cms_Document/Main.js index eed7dde2307df09fb63c7803d173a3cc7e10d779..da72a24607890266c9b72222f9bf81464607cdd8 100644 --- a/o2web/source/x_component_cms_Document/Main.js +++ b/o2web/source/x_component_cms_Document/Main.js @@ -481,13 +481,14 @@ MWF.xApplication.cms.Document.Main = new Class({ var isControl = this.options.isControl; this.control = data.control || { "allowRead": true, - "allowPublishDocument": isControl && this.document.docStatus == "draft", + "allowPublishDocument": isControl && ["draft","waitPublish"].contains( this.document.docStatus ), + "allowPublishDocumentDelayed": isControl && ["draft","waitPublish"].contains( this.document.docStatus ), "allowSave": isControl && this.document.docStatus == "published", "allowPopularDocument": MWF.AC.isHotPictureManager() && this.document.docStatus == "published", "allowEditDocument": isControl && !this.document.wf_workId, "allowDeleteDocument": isControl && !this.document.wf_workId, "allowSetTop": this.isAdmin && this.document.docStatus == "published" && !this.document.isTop, - "allowCancelTop": this.isAdmin && this.document.docStatus == "published" && this.document.isTop, + "allowCancelTop": this.isAdmin && this.document.docStatus == "published" && this.document.isTop }; }, errorLoadingV2 : function( error, type ){ diff --git a/o2web/source/x_component_cms_Document/lp/en.js b/o2web/source/x_component_cms_Document/lp/en.js index 7c7ed9b3e173d09755c32b177da6dfd9e35a7a8b..b4b6ba2c73d9d301dfe38b1813603dbd77cb905b 100644 --- a/o2web/source/x_component_cms_Document/lp/en.js +++ b/o2web/source/x_component_cms_Document/lp/en.js @@ -35,6 +35,11 @@ MWF.xApplication.cms.Document.LP = { "hotPicture": "Hot Picture", "cancelHotPicture": "Cancel hotspot", "setHotPicture": "Set HotPicture", + "regularPublish": "Regular Publish", + "publishTime": "Publish Time", + "publish": "Publish", + "inputPublishTime": "Publish time cannot be empty", + "inputPublishTime2": "Publish time cannot be earlier than current time", "setHotLinkSuccess": "Set hotspot picture successfully", "cancelHotLinkSuccess": "Cancel hotspot picture success", "selectDocPicture": "Select Document Picture", diff --git a/o2web/source/x_component_cms_Document/lp/zh-cn.js b/o2web/source/x_component_cms_Document/lp/zh-cn.js index 5346cbb76741326bb4460b367a331641b6c9cf42..73d16d872d9d3d9b94ed7922a8e9bd5c447c09e0 100644 --- a/o2web/source/x_component_cms_Document/lp/zh-cn.js +++ b/o2web/source/x_component_cms_Document/lp/zh-cn.js @@ -35,6 +35,11 @@ MWF.xApplication.cms.Document.LP = { "hotPicture" : "热点图片", "cancelHotPicture" : "取消热点", "setHotPicture" : "设置热点", + "regularPublish": "定时发布", + "publishTime": "发布时间", + "publish": "发布", + "inputPublishTime": "发布时间不能为空", + "inputPublishTime2": "发布时间不能早于当前时间", "setHotLinkSuccess" : "设置热点图片成功", "cancelHotLinkSuccess" : "取消热点图片成功", "selectDocPicture" : "选择文档图片", diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/cmsform/submitDelayed.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/cmsform/submitDelayed.png new file mode 100644 index 0000000000000000000000000000000000000000..0f46f5516cea1e9e6d6b4391f93254c15db9f56b Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/cmsform/submitDelayed.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/cmsform/submitDelayed_over.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/cmsform/submitDelayed_over.png new file mode 100644 index 0000000000000000000000000000000000000000..9cac2445efcfbea873a17eede4449f9a813dae2c Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/cmsform/submitDelayed_over.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/default/submitDelayed.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/default/submitDelayed.png new file mode 100644 index 0000000000000000000000000000000000000000..0f46f5516cea1e9e6d6b4391f93254c15db9f56b Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/default/submitDelayed.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/default/submitDelayed_over.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/default/submitDelayed_over.png new file mode 100644 index 0000000000000000000000000000000000000000..9cac2445efcfbea873a17eede4449f9a813dae2c Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/default/submitDelayed_over.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/mobile/submitDelayed.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/mobile/submitDelayed.png new file mode 100644 index 0000000000000000000000000000000000000000..0f46f5516cea1e9e6d6b4391f93254c15db9f56b Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/mobile/submitDelayed.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/mobile/submitDelayed_over.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/mobile/submitDelayed_over.png new file mode 100644 index 0000000000000000000000000000000000000000..9cac2445efcfbea873a17eede4449f9a813dae2c Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/mobile/submitDelayed_over.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/submitDelayed.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/submitDelayed.png new file mode 100644 index 0000000000000000000000000000000000000000..0f46f5516cea1e9e6d6b4391f93254c15db9f56b Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/submitDelayed.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/submitDelayed_over.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/submitDelayed_over.png new file mode 100644 index 0000000000000000000000000000000000000000..9cac2445efcfbea873a17eede4449f9a813dae2c Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_blue_simple/submitDelayed_over.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_green_simple/submitDelayed.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_green_simple/submitDelayed.png new file mode 100644 index 0000000000000000000000000000000000000000..49944c64224f921f80f4d51e93a12c23e8e8fa49 Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_green_simple/submitDelayed.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_green_simple/submitDelayed_over.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_green_simple/submitDelayed_over.png new file mode 100644 index 0000000000000000000000000000000000000000..49944c64224f921f80f4d51e93a12c23e8e8fa49 Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_green_simple/submitDelayed_over.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/submitDelayed.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/submitDelayed.png new file mode 100644 index 0000000000000000000000000000000000000000..2b82d8aa67bc1498dfafdb6dd8b3c06314ef1efc Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/submitDelayed.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/submitDelayed_over.png b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/submitDelayed_over.png new file mode 100644 index 0000000000000000000000000000000000000000..9cac2445efcfbea873a17eede4449f9a813dae2c Binary files /dev/null and b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/default/tools/xform_red_simple/submitDelayed_over.png differ diff --git a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/toolbars.json b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/toolbars.json index 998c98082f55490e174fbc67abdecefa3520660d..b51b9045239d6bdc5a5c710ba8988346e2e2c22a 100644 --- a/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/toolbars.json +++ b/o2web/source/x_component_cms_FormDesigner/Module/Actionbar/toolbars.json @@ -46,6 +46,18 @@ "read": false, "edit" : true }, + { + "type": "MWFToolBarButton", + "img": "submitDelayed.png", + "img_over": "submitDelayed_over.png", + "title": "{{$.lp.publishDelayedTitle}}", + "action": "publishDocumentDelayed", + "text": "{{$.lp.publishDelayed}}", + "id": "action_publishDocumentDelayed", + "control": "allowPublishDocumentDelayed", + "read": false, + "edit" : true + }, { "type": "MWFToolBarButton", "img": "save.png", diff --git a/o2web/source/x_component_cms_FormDesigner/lp/en.js b/o2web/source/x_component_cms_FormDesigner/lp/en.js index 170561fadf6c6590714e41d91be8fcd210573396..28fc2e840f4872b2126000d82cd59dd1bb7d232f 100644 --- a/o2web/source/x_component_cms_FormDesigner/lp/en.js +++ b/o2web/source/x_component_cms_FormDesigner/lp/en.js @@ -70,6 +70,8 @@ MWF.xApplication.cms.FormDesigner.LP = Object.merge( {}, MWF.xApplication.proces "saveTitle": "Save Document", "publish": "Publish", "publishTitle": "Publish Document", + "publishDelayed": "Timely publish", + "publishDelayedTitle": "Publish documents regularly", "saveDraft": "Save Draft", "saveDraftTitle": "Save Draft", "popular": "Set Popular", diff --git a/o2web/source/x_component_cms_FormDesigner/lp/zh-cn.js b/o2web/source/x_component_cms_FormDesigner/lp/zh-cn.js index aa0e2712fb15227d9f41523a5c72f0e85fd66fe1..8fbcc5b20e8d1f95cc8a4b04081f959025034154 100644 --- a/o2web/source/x_component_cms_FormDesigner/lp/zh-cn.js +++ b/o2web/source/x_component_cms_FormDesigner/lp/zh-cn.js @@ -73,6 +73,8 @@ MWF.xApplication.cms.FormDesigner.LP = Object.merge( {}, MWF.xApplication.proces "saveTitle": "保存文档", "publish": "发布", "publishTitle": "发布文档", + "publishDelayed": "定时发布", + "publishDelayedTitle": "定时发布文档", "saveDraft": "保存草稿", "saveDraftTitle": "保存草稿", "popular": "设置热点", diff --git a/o2web/source/x_component_cms_Module/$ListExplorer/listItemForDelay.json b/o2web/source/x_component_cms_Module/$ListExplorer/listItemForDelay.json new file mode 100644 index 0000000000000000000000000000000000000000..6150a70c4a475f3c320b2a01601ebabba9c13a06 --- /dev/null +++ b/o2web/source/x_component_cms_Module/$ListExplorer/listItemForDelay.json @@ -0,0 +1,56 @@ +[ + { + "title" : MWF.xApplication.cms.Module.LP.subject, + "headStyles" : "titleAreaHeadNode", + "contentStyles" : "titleAreaContentNode", + "item" : "title", + "name" : "titleAreaNode", + "sortByClickTitle" : "yes", + "width" : "38%" + }, + { + "title" : MWF.xApplication.cms.Module.LP.creatorPerson, + "headStyles" : "personAreaHeadNode", + "contentStyles" : "personAreaContentNode", + "item" : "creatorPersonShort", + "name" : "personAreaNode", + "sortByClickTitle" : "yes", + "width" : "11%" + }, + { + "title" : MWF.xApplication.cms.Module.LP.creatorDepartment, + "headStyles" : "departmentAreaHeadNode", + "contentStyles" : "departmentAreaContentNode", + "item" : "creatorUnitNameShort", + "name" : "departmentAreaNode", + "sortByClickTitle" : "yes", + "width" : "11%" + }, + { + "title" : MWF.xApplication.cms.Module.LP.category, + "headStyles" : "categoryAreaHeadNode", + "contentStyles" : "categoryAreaContentNode", + "item" : "categoryName", + "name" : "categoryAreaNode", + "sortByClickTitle" : "yes", + "width" : "11%" + }, + { + "title" : MWF.xApplication.cms.Module.LP.publishTimeDelay, + "headStyles" : "timeAreaHeadNode", + "contentStyles" : "timeAreaContentNode", + "item" : "publishTime", + "name" : "timeAreaNode", + "sortByClickTitle" : "yes", + "width" : "15%" + }, + { + "access" : "admin", + "title" : MWF.xApplication.cms.Module.LP.action, + "headStyles" : "actionAreaHeadNode", + "contentStyles" : "actionAreaContentNode", + "item" : "action", + "name" : "actionAreaNode", + "width" : "13%" + } +] diff --git a/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.svg b/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.svg index 2c4a54880ffd24540d2bf34e1331e2d1a3cfea11..6182362325a97de02f0d9318e7fd4a42ec1810eb 100644 --- a/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.svg +++ b/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.svg @@ -1,27 +1,46 @@ -Generated by IcoMoon + + + +{ + "fontFamily": "cmsmodule", + "majorVersion": 1, + "minorVersion": 0, + "description": "Font generated by IcoMoon.", + "version": "Version 1.0", + "fontId": "cmsmodule", + "psName": "cmsmodule", + "subFamily": "Regular", + "fullName": "cmsmodule" +} + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.ttf b/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.ttf index b5ec493e969539753dc9fd278472962e3580fe6f..cd034a691fabcf2e2cf863fd52799d33339f19cc 100644 Binary files a/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.ttf and b/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.ttf differ diff --git a/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.woff b/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.woff index ce810e2537b8562c7976b356b4bcaa5dc911a972..e8e891807ad506006777c771fba03eb8ded8bdd0 100644 Binary files a/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.woff and b/o2web/source/x_component_cms_Module/$Main/default/fonts/cmsmodule.woff differ diff --git a/o2web/source/x_component_cms_Module/$Main/default/style.css b/o2web/source/x_component_cms_Module/$Main/default/style.css index 522f4b4156768ead434a16b816262342d7a63cbb..c805e1004afc6932cd2e8793c673fd7cc70306d9 100644 --- a/o2web/source/x_component_cms_Module/$Main/default/style.css +++ b/o2web/source/x_component_cms_Module/$Main/default/style.css @@ -74,4 +74,13 @@ } .o2icon-list4:before { content: "\e9c1"; +} +.o2icon-publishdelay:before { + content: "\e901"; +} +.o2icon-clock2:before { + content: "\e9ab"; +} +.o2icon-spinner:before { + content: "\e97d"; } \ No newline at end of file diff --git a/o2web/source/x_component_cms_Module/ListExplorer.js b/o2web/source/x_component_cms_Module/ListExplorer.js index 5da8ee20ce46cfd883859fed0104fe04c3952e20..2b46fcf7e15797a5820742c9227f0bf4f597160f 100644 --- a/o2web/source/x_component_cms_Module/ListExplorer.js +++ b/o2web/source/x_component_cms_Module/ListExplorer.js @@ -140,7 +140,8 @@ MWF.xApplication.cms.Module.ListExplorer = new Class({ this.view = new MWF.xApplication.cms.Module.ListExplorer.ListForALL(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey ); }else if( this.revealData.isDraft ){ this.view = new MWF.xApplication.cms.Module.ListExplorer.ListForDraft(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey ); - + }else if( this.revealData.isDelay ){ + this.view = new MWF.xApplication.cms.Module.ListExplorer.ListForDelay(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey ); }else if( (this.revealData.id == "defaultList") || (this.options.searchKey && this.options.searchKey!="") ){ this.view = new MWF.xApplication.cms.Module.ListExplorer.DefaultList(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey ); }else{ @@ -767,6 +768,95 @@ MWF.xApplication.cms.Module.ListExplorer.ListForDraft = new Class({ }); +MWF.xApplication.cms.Module.ListExplorer.ListForDelay = new Class({ + Extends: MWF.xApplication.cms.Module.ListExplorer.DefaultList, + + createListHead : function(){ + var _self = this; + var headNode = this.headNode = new Element("tr", {"styles": this.css.listHeadNode}).inject(this.table); + + if( this.selectEnable ){ + this.createSelectTh(); + } + + var listItemUrl = this.explorer.path+"listItemForDelay.json"; + MWF.getJSON(listItemUrl, function(json){ + this.listItemTemplate = json; + json.each(function(cell){ + var isShow = true; + if( cell.access ){ + if( cell.access == "admin" && !this.explorer.options.isAdmin ){ + isShow = false; + } + } + if(isShow) { + var th = new Element("th", { + "styles": this.css[cell.headStyles], + "width": cell.width, + "text": cell.title + }).inject(headNode) + } + //var thText = new Element("div",{ + // "styles" : this.css.thTextNode, + // "text": cell.title + //}).inject(th); + if( cell.sortByClickTitle == "yes" ){ + th.store("field",cell.item); + if( this.orderField == cell.item && this.orderType!="" ){ + th.store("orderType",this.orderType); + this.sortIconNode = new Element("div",{ + "styles": this.orderType == "asc" ? this.css.sortIconNode_asc : this.css.sortIconNode_desc + }).inject( th, "bottom" ); + }else{ + th.store("orderType",""); + this.sortIconNode = new Element("div",{"styles":this.css.sortIconNode}).inject( th, "bottom" ); + } + th.setStyle("cursor","pointer"); + th.addEvent("click",function(){ + _self.resort( this ); + }) + } + }.bind(this)); + }.bind(this),false); + }, + _getCurrentPageData: function(callback, count){ + if(!count)count=this.explorer.countPerPage; + // var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)"; + var page = this.currentPage || 1; + this.currentPage = page + 1; + var data = { + "appIdList": [ this.explorer.columnData.id ], + "statusList": [ "waitPublish" ], + "orderField" : this.orderField || null, + "orderType" : this.orderType || null, + "documentType": "全部" + }; + if( this.searchKey && this.searchKey!="" ){ + data.title = this.searchKey + } + if (this.filter && this.filter.filter ){ + var filterResult = this.filter.getFilterResult(); + for(var f in filterResult ){ + data[f] = filterResult[f]; + } + o2.Actions.load("x_cms_assemble_control").DocumentAction.query_listWithFilterPaging(page, count || this.pageCount, data, function(json){ + if (callback) callback(json); + }); + // this.actions.listDocumentFilterNext(id, count || this.pageCount, data, function(json){ + // if (callback) callback(json); + // }); + }else{ + o2.Actions.load("x_cms_assemble_control").DocumentAction.query_listWithFilterPaging(page, count || this.pageCount, data, function(json){ + if (callback) callback(json); + }); + // this.actions.listDocumentFilterNext(id, count || this.pageCount, data, function(json){ + // if (callback) callback(json); + // }); + } + } + +}); + MWF.xApplication.cms.Module.ListExplorer.List = new Class({ Extends: MWF.xApplication.cms.Module.ListExplorer.DefaultList, diff --git a/o2web/source/x_component_cms_Module/Main.js b/o2web/source/x_component_cms_Module/Main.js index 91f85f029cfd855988102e76ad0b6994895a2877..228fc4f6b593c67ce60e633ef51476740a43e4d1 100644 --- a/o2web/source/x_component_cms_Module/Main.js +++ b/o2web/source/x_component_cms_Module/Main.js @@ -1174,6 +1174,10 @@ MWF.xApplication.cms.Module.Navi = new Class({ if( this.columnData.config.latest === false ){ this.draftView = new MWF.xApplication.cms.Module.NaviDraftView( this, this.node, {} ); } + var allowWaitPublish = (typeOf(this.columnData.allowWaitPublish) === "boolean" ? this.columnData.allowWaitPublish : false).toString(); + if( allowWaitPublish !== "false" ){ + this.delayView = new MWF.xApplication.cms.Module.NaviDelayView( this, this.node, {} ); + } new Element("div",{ @@ -1732,3 +1736,106 @@ MWF.xApplication.cms.Module.NaviDraftView = new Class({ this.app.openView( this, null, this.data, searchKey || "", this ); } }); + +MWF.xApplication.cms.Module.NaviDelayView = new Class({ + Implements: [Options, Events], + options: { + "style": "default" + }, + initialize: function ( navi, container, options) { + this.setOptions(options); + this.navi = navi; + this.app = navi.app; + this.container = $(container); + this.css = this.app.css; + this.data = { + "isDelay" : true, + "id" : "defaultList" + }; + this.load(); + }, + load: function(){ + var _self = this; + this.isDefault = true; + this.isAll = true; + this.isCurrent = false; + this.isCategory = false; + + this.listNode = new Element("div.viewNaviListNode_all",{ + "styles" : this.css.viewNaviListNode_all + }).inject(this.container); + + this.node = new Element("div.viewNaviNode_all", { + "styles": this.css.viewNaviNode_all, + "text" : this.app.lp.delayStatus + }).inject(this.listNode); + + this.iconNode = new Element("i.o2icon-clock2", { + "styles": this.css.viewNaviIcon_all + }).inject(this.node, "top"); + + this.node.addEvents({ + "mouseover": function(){ if ( !_self.isCurrent ){ + this.setStyles(_self.css.viewNaviNode_all_over); + this.addClass( "mainColor_bg_opacity" ); + } }, + "mouseout": function(){ if ( !_self.isCurrent ){ + this.setStyles( _self.css.viewNaviNode_all ); + this.removeClass( "mainColor_bg_opacity" ); + } }, + "click": function (el) { + _self.setCurrent(); + } + }); + + new Element("div", { + "styles": this.css.viewNaviSepartorNode + }).inject(this.listNode); + + if( this.isCurrent ){ + this.setCurrent() + } + }, + setCurrent : function(){ + + if( this.navi.currentObject ){ + this.navi.currentObject.cancelCurrent(); + } + + this.node.setStyles( this.css.viewNaviNode_all_selected ); + this.node.addClass( "mainColor_color" ); + this.node.addClass( "mainColor_bg_opacity" ); + + this.iconNode.setStyles( this.css.viewNaviIcon_all_selected ); + this.iconNode.addClass( "mainColor_color" ); + + this.isCurrent = true; + this.navi.currentObject = this; + + var action = this.app.importAction; + if( action ){ + action.setStyle("display","none"); + } + var action = this.app.exportAction; + if( action ){ + action.setStyle("display","none"); + } + + this.loadView(); + }, + cancelCurrent : function(){ + this.isCurrent = false; + this.node.setStyles( this.css.viewNaviNode_all ); + this.node.removeClass( "mainColor_color" ); + this.node.removeClass( "mainColor_bg_opacity" ); + + this.iconNode.setStyles( this.css.viewNaviIcon_all ); + this.iconNode.removeClass( "mainColor_color" ); + }, + getCategoryId : function(){ + return null; + }, + loadView : function( searchKey ){ + this.app.openView( this, null, this.data, searchKey || "", this ); + } +}); \ No newline at end of file diff --git a/o2web/source/x_component_cms_Module/lp/en.js b/o2web/source/x_component_cms_Module/lp/en.js index 216de0634c58ff0c4ab5d6512df2641d87a3bdb4..27391256133392654c41fda884e3b72ee1449556 100644 --- a/o2web/source/x_component_cms_Module/lp/en.js +++ b/o2web/source/x_component_cms_Module/lp/en.js @@ -2,6 +2,7 @@ MWF.xApplication.cms.Module.LP = { "title": "Content Management", "draftStatus": "Draft", + "delayStatus" : "Scheduled", "publishedStatus": "Published", "archivedStatus": "Archived", @@ -102,5 +103,6 @@ MWF.xApplication.cms.Module.LP = { "creatorCompany": "Create Company", "creatorDepartment": "Create Department", "creatorPerson": "Creator", - "publishTime": "Publish Time" + "publishTime": "Publish Time", + "publishTimeDelay": "Timed publishing time" }; \ No newline at end of file diff --git a/o2web/source/x_component_cms_Module/lp/zh-cn.js b/o2web/source/x_component_cms_Module/lp/zh-cn.js index 03d47b83b2d4376077530fe064d8b1e33d4416e8..d96132c10d5592dd82a103b8008be08bc1a484ec 100644 --- a/o2web/source/x_component_cms_Module/lp/zh-cn.js +++ b/o2web/source/x_component_cms_Module/lp/zh-cn.js @@ -2,6 +2,7 @@ MWF.xApplication.cms.Module.LP = { "title": "内容管理", "draftStatus" : "草稿", + "delayStatus" : "定时发布", "publishedStatus" : "已发布", "archivedStatus" : "已归档", @@ -28,6 +29,7 @@ MWF.xApplication.cms.Module.LP = { "completedTime": "完成时间", "process": "流程", + "batchRemove" : "清除", "batchRemoveConfirm" : "确定清除", @@ -102,8 +104,8 @@ MWF.xApplication.cms.Module.LP = { "creatorCompany": "创建公司", "creatorDepartment": "创建部门", "creatorPerson": "创建人", - "publishTime": "发布时间" - + "publishTime": "发布时间", + "publishTimeDelay": "定时发布时间" }; \ No newline at end of file diff --git a/o2web/source/x_component_cms_Xform/Actionbar.js b/o2web/source/x_component_cms_Xform/Actionbar.js index da5533d250d90d26f8e820150624c1787d2a4fdc..cdaf3ea7d8e4dd6514dd753135720a1d2e036879 100644 --- a/o2web/source/x_component_cms_Xform/Actionbar.js +++ b/o2web/source/x_component_cms_Xform/Actionbar.js @@ -191,6 +191,9 @@ MWF.xApplication.cms.Xform.Actionbar = MWF.CMSActionbar = new Class({ publishDocument: function(){ this.form.publishDocument(); }, + publishDocumentDelayed: function(){ + this.form.publishDocumentDelayed(); + }, archiveDocument: function(){ this.form.archiveDocument(); }, diff --git a/o2web/source/x_component_cms_Xform/Form.js b/o2web/source/x_component_cms_Xform/Form.js index b2a10ca2ae053cad7df03ad93b14409d623756e9..0b1d9aea1f3d3528f2eb8fb5c76e23987ccaee7a 100644 --- a/o2web/source/x_component_cms_Xform/Form.js +++ b/o2web/source/x_component_cms_Xform/Form.js @@ -24,156 +24,174 @@ MWF.xDesktop.requireApp("cms.Xform", "Package", null, false); */ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class( /** @lends CMSForm# */ -{ - Implements: [Options, Events], - Extends: MWF.APPForm, - options: { - "style": "default", - "readonly": false, - "cssPath": "", - "autoSave": false, - "saveOnClose": false, - "showAttachment": true, - "moduleEvents": [ - /** - * 表单加载前触发。表单html已经就位。 - * @event CMSForm#queryLoad - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "queryLoad", - /** - * 表单加载前触发。数据(businessData)已经就绪。 - * @event CMSForm#beforeLoad - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "beforeLoad", - /** - * 表单的所有组件加载前触发,此时表单的样式和js head已经加载。 - * @event CMSForm#beforeModulesLoad - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "beforeModulesLoad", - /** - * 表单加载后触发。 - * @event CMSForm#postLoad - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "postLoad", - /** - * 表单的所有组件加载后触发。 - * @event CMSForm#afterModulesLoad - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "afterModulesLoad", - /** - * 表单加载后触发。 - * @event CMSForm#afterLoad - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "afterLoad", - /** - * 保存前触发。 - * @event CMSForm#beforeSave - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "beforeSave", - /** - * 数据已经整理完成,但还未保存到后台时触发。this.event指向整理完成的数据 - * @event CMSForm#postSave - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "postSave", - /** - * 数据保存到后台后触发。 - * @event CMSForm#afterSave - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "afterSave", - /** - * 关闭前触发。 - * @event CMSForm#beforeClose - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "beforeClose", - /** - * 发布前触发。 - * @event CMSForm#beforePublish - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "beforePublish", - /** - * 数据已经整理完成,但还未调用服务发布触发。this.event指向整理完成的数据 - * @event CMSForm#postPublish - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "postPublish", - /** - * 执行后台服务发布后触发。 - * @event CMSForm#afterPublish - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "afterPublish", - /** - * 删除前触发。 - * @event CMSForm#beforeDelete - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "beforeDelete", - /** - * 删除后触发。 - * @event CMSForm#afterDelete - * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} - */ - "afterDelete", - "resize" - ] - }, - /** - * @summary 获取表单的所有数据. - * @method getData - * @memberof CMSForm - * @example - * var data = this.form.getApp().appForm.getData(); - * @return {Object} - */ - initialize: function (node, data, options) { - this.setOptions(options); - + { + Implements: [Options, Events], + Extends: MWF.APPForm, + options: { + "style": "default", + "readonly": false, + "cssPath": "", + "autoSave": false, + "saveOnClose": false, + "showAttachment": true, + "moduleEvents": [ + /** + * 表单加载前触发。表单html已经就位。 + * @event CMSForm#queryLoad + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "queryLoad", + /** + * 表单加载前触发。数据(businessData)已经就绪。 + * @event CMSForm#beforeLoad + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "beforeLoad", + /** + * 表单的所有组件加载前触发,此时表单的样式和js head已经加载。 + * @event CMSForm#beforeModulesLoad + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "beforeModulesLoad", + /** + * 表单加载后触发。 + * @event CMSForm#postLoad + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "postLoad", + /** + * 表单的所有组件加载后触发。 + * @event CMSForm#afterModulesLoad + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "afterModulesLoad", + /** + * 表单加载后触发。 + * @event CMSForm#afterLoad + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "afterLoad", + /** + * 保存前触发。 + * @event CMSForm#beforeSave + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "beforeSave", + /** + * 数据已经整理完成,但还未保存到后台时触发。this.event指向整理完成的数据 + * @event CMSForm#postSave + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "postSave", + /** + * 数据保存到后台后触发。 + * @event CMSForm#afterSave + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "afterSave", + /** + * 关闭前触发。 + * @event CMSForm#beforeClose + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "beforeClose", + /** + * 发布前触发。 + * @event CMSForm#beforePublish + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "beforePublish", + /** + * 数据已经整理完成,但还未调用服务发布触发。this.event指向整理完成的数据 + * @event CMSForm#postPublish + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "postPublish", + /** + * 执行后台服务发布后触发。 + * @event CMSForm#afterPublish + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "afterPublish", + /** + * 定时发布前触发。 + * @event CMSForm#beforeWaitPublish + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "beforeWaitPublish", + /** + * 数据已经整理完成,但还未调用定时发布服务前触发。this.event指向整理完成的数据 + * @event CMSForm#postWaitPublish + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "postWaitPublish", + /** + * 执行后台定时发布服务后触发。 + * @event CMSForm#afterPublish + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "afterWaitPublish", + /** + * 删除前触发。 + * @event CMSForm#beforeDelete + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "beforeDelete", + /** + * 删除后触发。 + * @event CMSForm#afterDelete + * @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明} + */ + "afterDelete", + "resize" + ] + }, /** - * @summary 表单容器 - * @see https://mootools.net/core/docs/1.6.0/Element/Element - * @member {Element} + * @summary 获取表单的所有数据. + * @method getData + * @memberof CMSForm * @example - * //可以在脚本中获取表单容器 - * var formContainer = this.form.getApp().appForm.container; + * var data = this.form.getApp().appForm.getData(); + * @return {Object} */ - this.container = $(node); - this.container.setStyle("-webkit-user-select", "text"); - this.data = data; + initialize: function (node, data, options) { + this.setOptions(options); - /** - * @summary 表单的配置信息,比如表单名称等等. - * @member {Object} - * @example - * //可以在脚本中获取表单配置信息 - * var json = this.form.getApp().appForm.json; //表单配置信息 - * var name = json.name; //表单名称 - */ - this.json = data.json; - this.html = data.html; + /** + * @summary 表单容器 + * @see https://mootools.net/core/docs/1.6.0/Element/Element + * @member {Element} + * @example + * //可以在脚本中获取表单容器 + * var formContainer = this.form.getApp().appForm.container; + */ + this.container = $(node); + this.container.setStyle("-webkit-user-select", "text"); + this.data = data; + + /** + * @summary 表单的配置信息,比如表单名称等等. + * @member {Object} + * @example + * //可以在脚本中获取表单配置信息 + * var json = this.form.getApp().appForm.json; //表单配置信息 + * var name = json.name; //表单名称 + */ + this.json = data.json; + this.html = data.html; - this.path = "../x_component_cms_Xform/$Form/"; - this.cssPath = this.options.cssPath || "../x_component_cms_Xform/$Form/" + this.options.style + "/css.wcss"; - this._loadCss(); + this.path = "../x_component_cms_Xform/$Form/"; + this.cssPath = this.options.cssPath || "../x_component_cms_Xform/$Form/" + this.options.style + "/css.wcss"; + this._loadCss(); - /** - * @summary 表单中的所有组件数组. - * @member {Array} - * @example - * //下面的样例对表单组件进行循环,并且判断是输入类型的组件 - * var modules = this.form.getApp().appForm.modules; //获取所有表单组件 - * for( var i=0; i - * 需要注意的是,在子表单中嵌入不绑定数据的组件(比如div,common,button等等),系统允许重名。
- * 在打开表单的时候,系统会根据重名情况,自动在组件的标识后跟上 "_1", "_2"。 - * @summary 表单中的所有组件对象. - * @member {Object} - * @example - * var moduleAll = this.form.getApp().appForm.all; //获取组件对象 - * var subjectField = moduleAll["subject"] //获取名称为subject的组件 - */ - this.all = {}; - this.forms = {}; - - //if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions(); - }, - load: function (callback) { - if (this.app) { - if (this.app.formNode) this.app.formNode.setStyles(this.json.styles); - if (this.app.addEvent) this.app.addEvent("resize", function () { - this.fireEvent("resize"); - }.bind(this)) - } - //if (!this.businessData.control.allowSave) this.setOptions({"readonly": true}); + /** + * 该对象的key是组件标识,value是组件对象,可以使用该对象根据组件标识获取组件。
+ * 需要注意的是,在子表单中嵌入不绑定数据的组件(比如div,common,button等等),系统允许重名。
+ * 在打开表单的时候,系统会根据重名情况,自动在组件的标识后跟上 "_1", "_2"。 + * @summary 表单中的所有组件对象. + * @member {Object} + * @example + * var moduleAll = this.form.getApp().appForm.all; //获取组件对象 + * var subjectField = moduleAll["subject"] //获取名称为subject的组件 + */ + this.all = {}; + this.forms = {}; + + //if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions(); + }, + load: function (callback) { + if (this.app) { + if (this.app.formNode) this.app.formNode.setStyles(this.json.styles); + if (this.app.addEvent) this.app.addEvent("resize", function () { + this.fireEvent("resize"); + }.bind(this)) + } + //if (!this.businessData.control.allowSave) this.setOptions({"readonly": true}); - this.Macro = new MWF.CMSMacro.CMSFormContext(this); + this.Macro = new MWF.CMSMacro.CMSFormContext(this); - this.loadLanguage(function(flag) { - if (flag && this.formDataText) { - var data = o2.bindJson(this.formDataText, {"lp": MWF.xApplication.cms.Xform.LP.form}); - this.data = JSON.parse(data); + this.loadLanguage(function(flag) { + if (flag && this.formDataText) { + var data = o2.bindJson(this.formDataText, {"lp": MWF.xApplication.cms.Xform.LP.form}); + this.data = JSON.parse(data); - this.json = this.data.json; - this.html = this.data.html; - } + this.json = this.data.json; + this.html = this.data.html; + } - var cssClass = ""; - if (this.json.css && this.json.css.code) cssClass = this.loadCss(); + var cssClass = ""; + if (this.json.css && this.json.css.code) cssClass = this.loadCss(); - this.container.set("html", this.html); - this.node = this.container.getFirst(); - if (cssClass) this.node.addClass(cssClass); + this.container.set("html", this.html); + this.node = this.container.getFirst(); + if (cssClass) this.node.addClass(cssClass); - this._loadEvents(); - this.loadRelatedScript(); + this._loadEvents(); + this.loadRelatedScript(); - if (this.fireEvent("queryLoad")) { - // MWF.xDesktop.requireApp("cms.Xform", "lp." + MWF.language, null, false); + if (this.fireEvent("queryLoad")) { + // MWF.xDesktop.requireApp("cms.Xform", "lp." + MWF.language, null, false); - // this.container.setStyles(this.css.container); - this._loadBusinessData(); - this.fireEvent("beforeLoad"); - if (this.app) if (this.app.fireEvent) this.app.fireEvent("beforeLoad"); + // this.container.setStyles(this.css.container); + this._loadBusinessData(); + this.fireEvent("beforeLoad"); + if (this.app) if (this.app.fireEvent) this.app.fireEvent("beforeLoad"); - this.loadContent(callback) - } + this.loadContent(callback) + } - }.bind(this)); - }, - loadLanguage: function(callback){ - MWF.xDesktop.requireApp("cms.Xform", "lp." + MWF.language, null, false); + }.bind(this)); + }, + loadLanguage: function(callback){ + MWF.xDesktop.requireApp("cms.Xform", "lp." + MWF.language, null, false); - //formDataText - if (this.json.languageType!=="script" && this.json.languageType!=="default"){ - if (callback) callback(); - return true; - } + //formDataText + if (this.json.languageType!=="script" && this.json.languageType!=="default"){ + if (callback) callback(); + return true; + } - var language = MWF.xApplication.cms.Xform.LP.form; - var languageJson = null; + var language = MWF.xApplication.cms.Xform.LP.form; + var languageJson = null; - if (this.json.languageType=="script"){ - if (this.json.languageScript && this.json.languageScript.code){ - languageJson = this.Macro.exec(this.json.languageScript.code, this); + if (this.json.languageType=="script"){ + if (this.json.languageScript && this.json.languageScript.code){ + languageJson = this.Macro.exec(this.json.languageScript.code, this); + } + }else if (this.json.languageType=="default") { + var name = "lp-"+o2.language; + var application = this.businessData.document.appId; + + var p1 = this.documentAction.getDictRoot(name, application, function(d){ + return d.data; + }, function(){}); + var p2 = this.documentAction.getScriptByNameV2(name, application, function(d){ + return this.Macro.exec(d.data.text, this); + }.bind(this), function(){}); + languageJson = Promise.any([p1, p2]); } - }else if (this.json.languageType=="default") { - var name = "lp-"+o2.language; - var application = this.businessData.document.appId; - - var p1 = this.documentAction.getDictRoot(name, application, function(d){ - return d.data; - }, function(){}); - var p2 = this.documentAction.getScriptByNameV2(name, application, function(d){ - return this.Macro.exec(d.data.text, this); - }.bind(this), function(){}); - languageJson = Promise.any([p1, p2]); - } - - if (languageJson){ - if (languageJson.then && o2.typeOf(languageJson.then)=="function"){ - languageJson.then(function(json) { - MWF.xApplication.cms.Xform.LP.form = Object.merge(MWF.xApplication.cms.Xform.LP.form, json); - if (callback) callback(true); - }, function(){ + + if (languageJson){ + if (languageJson.then && o2.typeOf(languageJson.then)=="function"){ + languageJson.then(function(json) { + MWF.xApplication.cms.Xform.LP.form = Object.merge(MWF.xApplication.cms.Xform.LP.form, json); + if (callback) callback(true); + }, function(){ + if (callback) callback(true); + }) + }else{ + MWF.xApplication.cms.Xform.LP.form = Object.merge(MWF.xApplication.cms.Xform.LP.form, languageJson); if (callback) callback(true); - }) + } }else{ - MWF.xApplication.cms.Xform.LP.form = Object.merge(MWF.xApplication.cms.Xform.LP.form, languageJson); if (callback) callback(true); } - }else{ - if (callback) callback(true); - } - - }, - loadRelatedScript: function () { - if (this.json.includeScripts && this.json.includeScripts.length) { - var includeScriptText = ""; - var includedIds = []; - this.json.includeScripts.each(function (s) { - if (this.app.relatedScriptMap && this.app.relatedScriptMap[s.id]) { - includeScriptText += "\n" + this.app.relatedScriptMap[s.id].text; - includedIds.push(s.id); - } - }.bind(this)); - if (includeScriptText) this.Macro.exec(includeScriptText, this); - } - }, - loadContent: function (callback) { - this.subformCount = 0; - this.subformLoadedCount = 0; - this.subformLoaded = [this.json.id]; - - this._loadHtml(); - this._loadForm(); - this.fireEvent("beforeModulesLoad"); - this._loadModules(this.node); - - if (!this.options.readonly) { - if (this.options.autoSave) this.autoSave(); - this.app.addEvent("queryClose", function () { - if (this.options.saveOnClose && this.businessData.document.docStatus == "draft") this.saveDocument(null, true); - //if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID); - Object.each(this.forms, function (module, id) { - if (module.json && module.json.type == "Htmleditor" && module.editor) { - //if(CKEDITOR.currentImageDialog)CKEDITOR.currentImageDialog.destroy(); - //CKEDITOR.currentImageDialog = null; - CKEDITOR.remove(module.editor); - delete module.editor + }, + loadRelatedScript: function () { + if (this.json.includeScripts && this.json.includeScripts.length) { + var includeScriptText = ""; + var includedIds = []; + this.json.includeScripts.each(function (s) { + if (this.app.relatedScriptMap && this.app.relatedScriptMap[s.id]) { + includeScriptText += "\n" + this.app.relatedScriptMap[s.id].text; + includedIds.push(s.id); } - }); - }.bind(this)); - } - this.fireEvent("afterModulesLoad"); - this.fireEvent("postLoad"); - this.fireEvent("afterLoad"); - if (this.app && this.app.fireEvent) { - this.app.fireEvent("afterModulesLoad"); - this.app.fireEvent("postLoad"); - this.app.fireEvent("afterLoad"); - } - // 移动端表单 展现底部工具栏 - debugger; - if (this.json.mode === "Mobile") { - var node = document.body.getElement(".o2_form_mobile_actions"); - if (node) { - node.empty(); - this._loadMobileActions(node, callback); - } else { - if (callback) callback(); - } - } - // 告诉移动端表单加载完成 - // if (this.app && this.app.mobile) { - // if (callback) callback(); - // } - }, - autoSave: function () { - //this.autoSaveTimerID = window.setInterval(function(){ - // this.saveDocument(); - //}.bind(this), 300000); - }, - - // 默认的移动端底部工具栏 - _loadMobileDefaultTools: function (callback) { - if (this.json.defaultTools) { - if (callback) callback(); - } else { - this.json.defaultTools = o2.JSON.get("../x_component_process_FormDesigner/Module/Actionbar/toolbars.json", function (json) { - this.json.defaultTools = json; - if (callback) callback(); - }.bind(this)); - } - }, - // 移动端生成底部工具栏 - _loadMobileActions: function (node, callback) { - var tools = []; - this._loadMobileDefaultTools(function () { - if (this.json.defaultTools) { - var jsonStr = JSON.stringify(this.json.defaultTools); - jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.cms.Xform.LP.form}); - this.json.defaultTools = JSON.parse(jsonStr); - this.json.defaultTools.each(function (tool) { - var flag = this._checkDefaultMobileActionItem(tool, this.options.readonly); - if (flag) tools.push(tool); }.bind(this)); + + if (includeScriptText) this.Macro.exec(includeScriptText, this); } - if (this.json.tools) { - var jsonStr = JSON.stringify(this.json.tools); - jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.cms.Xform.LP.form}); - this.json.tools = JSON.parse(jsonStr); - this.json.tools.each(function (tool) { - var flag = this._checkCustomMobileActionItem(tool, this.options.readonly); - if (flag) tools.push(tool); + }, + loadContent: function (callback) { + this.subformCount = 0; + this.subformLoadedCount = 0; + this.subformLoaded = [this.json.id]; + + this._loadHtml(); + this._loadForm(); + this.fireEvent("beforeModulesLoad"); + this._loadModules(this.node); + + if (!this.options.readonly) { + if (this.options.autoSave) this.autoSave(); + this.app.addEvent("queryClose", function () { + if (this.options.saveOnClose && this.businessData.document.docStatus == "draft") this.saveDocument(null, true); + //if (this.autoSaveTimerID) window.clearInterval(this.autoSaveTimerID); + Object.each(this.forms, function (module, id) { + if (module.json && module.json.type == "Htmleditor" && module.editor) { + //if(CKEDITOR.currentImageDialog)CKEDITOR.currentImageDialog.destroy(); + //CKEDITOR.currentImageDialog = null; + CKEDITOR.remove(module.editor); + delete module.editor + } + }); }.bind(this)); } - this.mobileTools = tools; - //app上用原来的按钮样式 - if (window.o2android) { - if (tools.length) if (node) this._createMobileActions(node, tools); - } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.o2mLog) { - if (tools.length) if (node) this._createMobileActions(node, tools); + this.fireEvent("afterModulesLoad"); + this.fireEvent("postLoad"); + this.fireEvent("afterLoad"); + if (this.app && this.app.fireEvent) { + this.app.fireEvent("afterModulesLoad"); + this.app.fireEvent("postLoad"); + this.app.fireEvent("afterLoad"); + } + // 移动端表单 展现底部工具栏 + debugger; + if (this.json.mode === "Mobile") { + var node = document.body.getElement(".o2_form_mobile_actions"); + if (node) { + node.empty(); + this._loadMobileActions(node, callback); + } else { + if (callback) callback(); + } + } + // 告诉移动端表单加载完成 + // if (this.app && this.app.mobile) { + // if (callback) callback(); + // } + }, + autoSave: function () { + //this.autoSaveTimerID = window.setInterval(function(){ + // this.saveDocument(); + //}.bind(this), 300000); + }, + + // 默认的移动端底部工具栏 + _loadMobileDefaultTools: function (callback) { + if (this.json.defaultTools) { + if (callback) callback(); } else { - //钉钉 企业微信用新的样式 - if (tools.length) if (node) this._createMobileActionsDingdingStyle(node, tools); + this.json.defaultTools = o2.JSON.get("../x_component_process_FormDesigner/Module/Actionbar/toolbars.json", function (json) { + this.json.defaultTools = json; + if (callback) callback(); + }.bind(this)); } - if (callback) callback(); - }.bind(this)); - }, - // 检查默认按钮是否显示 - _checkDefaultMobileActionItem: function (tool, readonly, noCondition) { - var flag = true; - if (tool.control) { - flag = this.businessData.control[tool.control] - } - if (!noCondition) if (tool.condition) { - var hideFlag = this.Macro.exec(tool.condition, this); - flag = flag && (!hideFlag); - } - // if (readonly) if (!tool.read) flag = false; - if (readonly){ - if (!tool.read) flag = false; - }else{ - if (!tool.edit) flag = false; - } - // 移动端禁用 关闭和打印 - if (tool.id === "action_close" || tool.id === "action_print" || tool.id === "action_popular") { - flag = false; - } - return flag; - }, - // 检查自定义按钮是否显示 - _checkCustomMobileActionItem: function (tool, readonly) { - var flag = true; - if (readonly) { - flag = tool.readShow; - } else { - flag = tool.editShow; - } - if (flag) { - flag = true; + }, + // 移动端生成底部工具栏 + _loadMobileActions: function (node, callback) { + var tools = []; + this._loadMobileDefaultTools(function () { + if (this.json.defaultTools) { + var jsonStr = JSON.stringify(this.json.defaultTools); + jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.cms.Xform.LP.form}); + this.json.defaultTools = JSON.parse(jsonStr); + this.json.defaultTools.each(function (tool) { + var flag = this._checkDefaultMobileActionItem(tool, this.options.readonly); + if (flag) tools.push(tool); + }.bind(this)); + } + if (this.json.tools) { + var jsonStr = JSON.stringify(this.json.tools); + jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.cms.Xform.LP.form}); + this.json.tools = JSON.parse(jsonStr); + this.json.tools.each(function (tool) { + var flag = this._checkCustomMobileActionItem(tool, this.options.readonly); + if (flag) tools.push(tool); + }.bind(this)); + } + this.mobileTools = tools; + //app上用原来的按钮样式 + if (window.o2android) { + if (tools.length) if (node) this._createMobileActions(node, tools); + } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.o2mLog) { + if (tools.length) if (node) this._createMobileActions(node, tools); + } else { + //钉钉 企业微信用新的样式 + if (tools.length) if (node) this._createMobileActionsDingdingStyle(node, tools); + } + if (callback) callback(); + }.bind(this)); + }, + // 检查默认按钮是否显示 + _checkDefaultMobileActionItem: function (tool, readonly, noCondition) { + var flag = true; if (tool.control) { flag = this.businessData.control[tool.control] } - if (tool.condition) { + if (!noCondition) if (tool.condition) { var hideFlag = this.Macro.exec(tool.condition, this); - flag = !hideFlag; + flag = flag && (!hideFlag); } - } - return flag; - }, - // 创建默认样式的底部工具栏 - _createMobileActions: function (node, tools) { - node.show(); - var count = tools.length; - if (count <= 2) { - this.css.html5ActionButton.width = "100%"; - if (count == 2) this.css.html5ActionButton.width = "49%"; - tools.each(function (tool) { - var action = new Element("div", { "styles": this.css.html5ActionButton, "text": tool.text }).inject(node); - action.store("tool", tool); - action.addEvent("click", function (e) { - var t = e.target.retrieve("tool"); - e.setDisable = function () { } - if (t.actionScript) { - this._runCustomAction(t.actionScript); - } else { - if (this[t.action]) this[t.action](e); - } - }.bind(this)); - this._setMobileBottonStyle(action); - }.bind(this)); - if (count == 2) new Element("div", { "styles": this.css.html5ActionButtonSplit }).inject(node.getLast(), "before"); - } else { - this.css.html5ActionButton.width = "38%" - for (var i = 0; i < 2; i++) { - tool = tools[i]; - var action = new Element("div", { "styles": this.css.html5ActionButton, "text": tool.text }).inject(node); - action.store("tool", tool); - action.addEvent("click", function (e) { - var t = e.target.retrieve("tool"); - e.setDisable = function () { } - if (t.actionScript) { - this._runCustomAction(t.actionScript); - } else { - if (this[t.action]) this[t.action](e); - } - }.bind(this)); - this._setMobileBottonStyle(action); + // if (readonly) if (!tool.read) flag = false; + if (readonly){ + if (!tool.read) flag = false; + }else{ + if (!tool.edit) flag = false; } - new Element("div", { "styles": this.css.html5ActionButtonSplit }).inject(node.getLast(), "before"); - new Element("div", { "styles": this.css.html5ActionButtonSplit }).inject(node); - this.css.html5ActionButton.width = "23%" - var action = new Element("div", { "styles": this.css.html5ActionButton, "text": "…" }).inject(node); - action.addEvent("click", function (e) { - this._loadMoreMobileActions(tools, 2, node); - }.bind(this)); - this._setMobileBottonStyle(action); - } - }, - // 更多按钮 - _loadMoreMobileActions: function (tools, n, node) { - document.body.mask({ - "id": "cms_toolbar_mask_id", - "style": { - "background-color": "#cccccc", - "opacity": 0.6 - }, - "hideOnClick": true, - "onHide": function () { - if (this.actionMoreArea){ - this.actionMoreArea.setStyle("display", "none"); - } - }.bind(this) - }); - if (this.actionMoreArea) { - this.actionMoreArea.setStyle("display", "block"); - } else { - var size = document.body.getSize(); - this.actionMoreArea = new Element("div", { "styles": this.css.html5ActionOtherArea }).inject(document.body); - var pl = this.actionMoreArea.getStyle("padding-left").toInt(); - var pr = this.actionMoreArea.getStyle("padding-right").toInt(); - var w = size.x - pl - pr; - this.actionMoreArea.setStyle("width", "" + w + "px"); - for (var i = n; i < tools.length; i++) { - tool = tools[i]; - var action = new Element("div", { "styles": this.css.html5ActionOtherButton, "text": tool.text }).inject(this.actionMoreArea); - action.store("tool", tool); - action.addEvent("click", function (e) { - //隐藏更多菜单 - var mask = document.id("cms_toolbar_mask_id"); - mask.destroy(); - this.actionMoreArea.setStyle("display", "none"); - - var t = e.target.retrieve("tool"); - e.setDisable = function () { } - if (t.actionScript) { - this._runCustomAction(t.actionScript); - } else { - if (this[t.action]) this[t.action](e); - } - }.bind(this)); - this._setMobileBottonStyle(action); + // 移动端禁用 关闭和打印 + if (tool.id === "action_close" || tool.id === "action_print" || tool.id === "action_popular") { + flag = false; } - } - - // actionArea.position({ - // relativeTo: node, - // position: 'topCenter', - // edge: 'bottomCenter' - // }); - }, - _setMobileBottonStyle: function (action) { - var _self = this; - action.addEvents({ - "mouseover": function (e) { this.setStyles(_self.css.html5ActionButton_over) }, - "mouseout": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, - "mousedown": function (e) { this.setStyles(_self.css.html5ActionButton_over) }, - "mouseup": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, - "touchstart": function (e) { this.setStyles(_self.css.html5ActionButton_over) }, - "touchcancel": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, - "touchend": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, - "touchmove": function (e) { this.setStyles(_self.css.html5ActionButton_over) } - }); - }, - - // 钉钉企业微信样式的按钮 - _createMobileActionsDingdingStyle: function (node, tools) { - node.show(); - var count = tools.length; - if (count <= 2) { - //左边 间隔 - var dingdingSplitLeft = new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); - var splitSize = dingdingSplitLeft.getSize(); - var size = document.body.getSize(); - var buttonWidth = (size.x - splitSize.x * (count + 1) - (count * 2)) / count; - tools.each(function (tool) { - var actionStyle = this.css.html5ActionButtonDingdingNormal; - if (tool.id === "action_edit" || tool.id === "action_saveData" || tool.id === "action_saveDraftDocument" || tool.id === "action_publishDocument") { - actionStyle = this.css.html5ActionButtonDingdingPrimary; - } else if (tool.id === "action_delete") { - actionStyle = this.css.html5ActionButtonDingdingDanger; + return flag; + }, + // 检查自定义按钮是否显示 + _checkCustomMobileActionItem: function (tool, readonly) { + var flag = true; + if (readonly) { + flag = tool.readShow; + } else { + flag = tool.editShow; + } + if (flag) { + flag = true; + if (tool.control) { + flag = this.businessData.control[tool.control] } - actionStyle.width = buttonWidth + "px"; - var action = new Element("div", { "styles": actionStyle, "text": tool.text }).inject(node); - action.store("tool", tool); - action.addEvent("click", function (e) { - var clickFun = function () { + if (tool.condition) { + var hideFlag = this.Macro.exec(tool.condition, this); + flag = !hideFlag; + } + } + return flag; + }, + // 创建默认样式的底部工具栏 + _createMobileActions: function (node, tools) { + node.show(); + var count = tools.length; + if (count <= 2) { + this.css.html5ActionButton.width = "100%"; + if (count == 2) this.css.html5ActionButton.width = "49%"; + tools.each(function (tool) { + var action = new Element("div", { "styles": this.css.html5ActionButton, "text": tool.text }).inject(node); + action.store("tool", tool); + action.addEvent("click", function (e) { var t = e.target.retrieve("tool"); - e.setDisable = function () { }; + e.setDisable = function () { } if (t.actionScript) { this._runCustomAction(t.actionScript); } else { if (this[t.action]) this[t.action](e); } - }.bind(this); - if (tool.text === "继续流转" || tool.id === "action_processWork") { - //输入法激活的时候,需要一段时间等待输入法关闭 - window.setTimeout(clickFun, 100) - } else { - clickFun(); - } - }.bind(this)); - new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); - }.bind(this)); - } else { - //左边 间隔 - var dingdingSplitLeft = new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); - var splitSize = dingdingSplitLeft.getSize(); - var size = document.body.getSize(); - var buttonWidth = (size.x - splitSize.x * 4 - 6) / 5; - for (var i = 0; i < 3; i++) { - tool = tools[i]; - var actionStyle = this.css.html5ActionButtonDingdingNormal; - if (tool.id === "action_edit" || tool.id === "action_saveData" || tool.id === "action_saveDraftDocument" || tool.id === "action_publishDocument") { - actionStyle = this.css.html5ActionButtonDingdingPrimary; - } else if (tool.id === "action_delete") { - actionStyle = this.css.html5ActionButtonDingdingDanger; - } - if (i == 2) { - this.css.html5ActionButtonDingdingMore.width = buttonWidth + "px"; - var action = new Element("div", { "styles": this.css.html5ActionButtonDingdingMore, "text": "…" }).inject(node); - action.addEvent("click", function (e) { - this._loadMoreMobileActionsDingdingStyle(tools, 2, node); }.bind(this)); - } else { - actionStyle.width = (buttonWidth * 2) + "px"; - var action = new Element("div", { "styles": actionStyle, "text": tool.text }).inject(node); + this._setMobileBottonStyle(action); + }.bind(this)); + if (count == 2) new Element("div", { "styles": this.css.html5ActionButtonSplit }).inject(node.getLast(), "before"); + } else { + this.css.html5ActionButton.width = "38%" + for (var i = 0; i < 2; i++) { + tool = tools[i]; + var action = new Element("div", { "styles": this.css.html5ActionButton, "text": tool.text }).inject(node); action.store("tool", tool); action.addEvent("click", function (e) { var t = e.target.retrieve("tool"); @@ -634,452 +502,622 @@ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class( if (this[t.action]) this[t.action](e); } }.bind(this)); + this._setMobileBottonStyle(action); } - new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); - } - } - }, - // - _loadMoreMobileActionsDingdingStyle: function (tools, n, node) { - document.body.mask({ - "id": "cms_toolbar_mask_id", - "style": { - "background-color": "#cccccc", - "opacity": 0.6 - }, - "hideOnClick": true, - "onHide": function () { - if (this.actionMoreArea){ - this.actionMoreArea.setStyle("display", "none"); - } - }.bind(this) - }); - if (this.actionMoreArea) { - this.actionMoreArea.setStyle("display", "block"); - } else { - var size = document.body.getSize(); - this.actionMoreArea = new Element("div", { "styles": this.css.html5ActionOtherArea }).inject(document.body); - var pl = this.actionMoreArea.getStyle("padding-left").toInt(); - var pr = this.actionMoreArea.getStyle("padding-right").toInt(); - var w = size.x - pl - pr; - this.actionMoreArea.setStyle("width", "" + w + "px"); - for (var i = n; i < tools.length; i++) { - tool = tools[i]; - var actionStyle = this.css.html5ActionButtonDingdingNormal; - if (tool.id === "action_edit" || tool.id === "action_saveData" || tool.id === "action_saveDraftDocument" || tool.id === "action_publishDocument") { - actionStyle = this.css.html5ActionButtonDingdingPrimary; - } else if (tool.id === "action_delete") { - actionStyle = this.css.html5ActionButtonDingdingDanger; - } - actionStyle.width = "100%"; - var action = new Element("div", { "styles": actionStyle, "text": tool.text }).inject(this.actionMoreArea); - action.store("tool", tool); + new Element("div", { "styles": this.css.html5ActionButtonSplit }).inject(node.getLast(), "before"); + new Element("div", { "styles": this.css.html5ActionButtonSplit }).inject(node); + this.css.html5ActionButton.width = "23%" + var action = new Element("div", { "styles": this.css.html5ActionButton, "text": "…" }).inject(node); action.addEvent("click", function (e) { - //隐藏更多菜单 - var mask = document.id("cms_toolbar_mask_id"); - mask.destroy(); - this.actionMoreArea.setStyle("display", "none"); - - var t = e.target.retrieve("tool"); - e.setDisable = function () { } - if (t.actionScript) { - this._runCustomAction(t.actionScript); - } else { - if (this[t.action]) this[t.action](e); - } + this._loadMoreMobileActions(tools, 2, node); }.bind(this)); + this._setMobileBottonStyle(action); } - } - }, + }, + // 更多按钮 + _loadMoreMobileActions: function (tools, n, node) { + document.body.mask({ + "id": "cms_toolbar_mask_id", + "style": { + "background-color": "#cccccc", + "opacity": 0.6 + }, + "hideOnClick": true, + "onHide": function () { + if (this.actionMoreArea){ + this.actionMoreArea.setStyle("display", "none"); + } + }.bind(this) + }); + if (this.actionMoreArea) { + this.actionMoreArea.setStyle("display", "block"); + } else { + var size = document.body.getSize(); + this.actionMoreArea = new Element("div", { "styles": this.css.html5ActionOtherArea }).inject(document.body); + var pl = this.actionMoreArea.getStyle("padding-left").toInt(); + var pr = this.actionMoreArea.getStyle("padding-right").toInt(); + var w = size.x - pl - pr; + this.actionMoreArea.setStyle("width", "" + w + "px"); + for (var i = n; i < tools.length; i++) { + tool = tools[i]; + var action = new Element("div", { "styles": this.css.html5ActionOtherButton, "text": tool.text }).inject(this.actionMoreArea); + action.store("tool", tool); + action.addEvent("click", function (e) { + //隐藏更多菜单 + var mask = document.id("cms_toolbar_mask_id"); + mask.destroy(); + this.actionMoreArea.setStyle("display", "none"); + var t = e.target.retrieve("tool"); + e.setDisable = function () { } + if (t.actionScript) { + this._runCustomAction(t.actionScript); + } else { + if (this[t.action]) this[t.action](e); + } + }.bind(this)); + this._setMobileBottonStyle(action); + } + } - _loadBusinessData: function () { - if (!this.businessData) { - this.businessData = { - "data": {} - }; - } - }, - - _loadEvents: function () { - Object.each(this.json.events, function (e, key) { - if (e.code) { - if (this.options.moduleEvents.indexOf(key) != -1) { - this.addEvent(key, function (event) { - return this.Macro.fire(e.code, this, event); + // actionArea.position({ + // relativeTo: node, + // position: 'topCenter', + // edge: 'bottomCenter' + // }); + }, + _setMobileBottonStyle: function (action) { + var _self = this; + action.addEvents({ + "mouseover": function (e) { this.setStyles(_self.css.html5ActionButton_over) }, + "mouseout": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, + "mousedown": function (e) { this.setStyles(_self.css.html5ActionButton_over) }, + "mouseup": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, + "touchstart": function (e) { this.setStyles(_self.css.html5ActionButton_over) }, + "touchcancel": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, + "touchend": function (e) { this.setStyles(_self.css.html5ActionButton_up) }, + "touchmove": function (e) { this.setStyles(_self.css.html5ActionButton_over) } + }); + }, + + // 钉钉企业微信样式的按钮 + _createMobileActionsDingdingStyle: function (node, tools) { + node.show(); + var count = tools.length; + if (count <= 2) { + //左边 间隔 + var dingdingSplitLeft = new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); + var splitSize = dingdingSplitLeft.getSize(); + var size = document.body.getSize(); + var buttonWidth = (size.x - splitSize.x * (count + 1) - (count * 2)) / count; + tools.each(function (tool) { + var actionStyle = this.css.html5ActionButtonDingdingNormal; + if (tool.id === "action_edit" || tool.id === "action_saveData" || tool.id === "action_saveDraftDocument" || tool.id === "action_publishDocument" || tool.id === "action_publishDocumentDelayed") { + actionStyle = this.css.html5ActionButtonDingdingPrimary; + } else if (tool.id === "action_delete") { + actionStyle = this.css.html5ActionButtonDingdingDanger; + } + actionStyle.width = buttonWidth + "px"; + var action = new Element("div", { "styles": actionStyle, "text": tool.text }).inject(node); + action.store("tool", tool); + action.addEvent("click", function (e) { + var clickFun = function () { + var t = e.target.retrieve("tool"); + e.setDisable = function () { }; + if (t.actionScript) { + this._runCustomAction(t.actionScript); + } else { + if (this[t.action]) this[t.action](e); + } + }.bind(this); + if (tool.text === "继续流转" || tool.id === "action_processWork") { + //输入法激活的时候,需要一段时间等待输入法关闭 + window.setTimeout(clickFun, 100) + } else { + clickFun(); + } }.bind(this)); - } else { - if (key == "load") { - this.addEvent("postLoad", function () { - return this.Macro.fire(e.code, this); - }.bind(this)); - } else if (key == "submit") { - this.addEvent("beforePublish", function () { - return this.Macro.fire(e.code, this); + new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); + }.bind(this)); + } else { + //左边 间隔 + var dingdingSplitLeft = new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); + var splitSize = dingdingSplitLeft.getSize(); + var size = document.body.getSize(); + var buttonWidth = (size.x - splitSize.x * 4 - 6) / 5; + for (var i = 0; i < 3; i++) { + tool = tools[i]; + var actionStyle = this.css.html5ActionButtonDingdingNormal; + if (tool.id === "action_edit" || tool.id === "action_saveData" || tool.id === "action_saveDraftDocument" || tool.id === "action_publishDocument" || tool.id === "action_publishDocumentDelayed") { + actionStyle = this.css.html5ActionButtonDingdingPrimary; + } else if (tool.id === "action_delete") { + actionStyle = this.css.html5ActionButtonDingdingDanger; + } + if (i == 2) { + this.css.html5ActionButtonDingdingMore.width = buttonWidth + "px"; + var action = new Element("div", { "styles": this.css.html5ActionButtonDingdingMore, "text": "…" }).inject(node); + action.addEvent("click", function (e) { + this._loadMoreMobileActionsDingdingStyle(tools, 2, node); }.bind(this)); } else { - this.node.addEvent(key, function (event) { - return this.Macro.fire(e.code, this, event); + actionStyle.width = (buttonWidth * 2) + "px"; + var action = new Element("div", { "styles": actionStyle, "text": tool.text }).inject(node); + action.store("tool", tool); + action.addEvent("click", function (e) { + var t = e.target.retrieve("tool"); + e.setDisable = function () { } + if (t.actionScript) { + this._runCustomAction(t.actionScript); + } else { + if (this[t.action]) this[t.action](e); + } }.bind(this)); } + new Element("div", { "styles": this.css.html5ActionButtonDingdingSplit, "text": " " }).inject(node); } } - }.bind(this)); - }, + }, + // + _loadMoreMobileActionsDingdingStyle: function (tools, n, node) { + document.body.mask({ + "id": "cms_toolbar_mask_id", + "style": { + "background-color": "#cccccc", + "opacity": 0.6 + }, + "hideOnClick": true, + "onHide": function () { + if (this.actionMoreArea){ + this.actionMoreArea.setStyle("display", "none"); + } + }.bind(this) + }); + if (this.actionMoreArea) { + this.actionMoreArea.setStyle("display", "block"); + } else { + var size = document.body.getSize(); + this.actionMoreArea = new Element("div", { "styles": this.css.html5ActionOtherArea }).inject(document.body); + var pl = this.actionMoreArea.getStyle("padding-left").toInt(); + var pr = this.actionMoreArea.getStyle("padding-right").toInt(); + var w = size.x - pl - pr; + this.actionMoreArea.setStyle("width", "" + w + "px"); + for (var i = n; i < tools.length; i++) { + tool = tools[i]; + var actionStyle = this.css.html5ActionButtonDingdingNormal; + if (tool.id === "action_edit" || tool.id === "action_saveData" || tool.id === "action_saveDraftDocument" || tool.id === "action_publishDocument" || tool.id === "action_publishDocumentDelayed") { + actionStyle = this.css.html5ActionButtonDingdingPrimary; + } else if (tool.id === "action_delete") { + actionStyle = this.css.html5ActionButtonDingdingDanger; + } + actionStyle.width = "100%"; + var action = new Element("div", { "styles": actionStyle, "text": tool.text }).inject(this.actionMoreArea); + action.store("tool", tool); + action.addEvent("click", function (e) { + //隐藏更多菜单 + var mask = document.id("cms_toolbar_mask_id"); + mask.destroy(); + this.actionMoreArea.setStyle("display", "none"); + var t = e.target.retrieve("tool"); + e.setDisable = function () { } + if (t.actionScript) { + this._runCustomAction(t.actionScript); + } else { + if (this[t.action]) this[t.action](e); + } + }.bind(this)); + } + } + }, - _loadModules: function (dom, beforeLoadModule, replace, callback) { - var moduleNodes = this._getModuleNodes(dom); - var modules = [], jsons = []; + _loadBusinessData: function () { + if (!this.businessData) { + this.businessData = { + "data": {} + }; + } + }, + + _loadEvents: function () { + Object.each(this.json.events, function (e, key) { + if (e.code) { + if (this.options.moduleEvents.indexOf(key) != -1) { + this.addEvent(key, function (event) { + return this.Macro.fire(e.code, this, event); + }.bind(this)); + } else { + if (key == "load") { + this.addEvent("postLoad", function () { + return this.Macro.fire(e.code, this); + }.bind(this)); + } else if (key == "submit") { + this.addEvent("beforePublish", function () { + return this.Macro.fire(e.code, this); + }.bind(this)); + } else { + this.node.addEvent(key, function (event) { + return this.Macro.fire(e.code, this, event); + }.bind(this)); + } + } + } + }.bind(this)); + }, + - moduleNodes.each(function (node) { - var json = this._getDomjson(node); - jsons.push( json ); - if (!this.options.showAttachment && json.type == "Attachment") { + _loadModules: function (dom, beforeLoadModule, replace, callback) { + var moduleNodes = this._getModuleNodes(dom); + var modules = [], jsons = []; + + moduleNodes.each(function (node) { + var json = this._getDomjson(node); + jsons.push( json ); + + if (!this.options.showAttachment && json.type == "Attachment") { + return; + } + //移动端去掉操作栏 + if (layout.mobile && json.type === "Actionbar") { + return; + } + var module = this._loadModule(json, node, beforeLoadModule, replace); + this.modules.push(module); + modules.push( module ); + }.bind(this)); + if( callback )callback( moduleNodes, jsons, modules ) + }, + _loadModule: function (json, node, beforeLoad) { + if (!json) return; + + //流程组件返回 + if( ( json.type === "Log" && json.logType ) || ["Monitor","ReadLog"].contains(json.type) ){ + node.empty(); return; + }else if( this.options.useProcessForm && json.type === "Actionbar" ){ //使用流程表单,组件是操作条 + json.type = "ProcessActionbar" } - //移动端去掉操作栏 - if (layout.mobile && json.type === "Actionbar") { - return; + + if (!MWF["CMS" + json.type]) { + var moduleType = json.type; + if(moduleType === "AttachmentDg")moduleType = "Attachment"; + MWF.xDesktop.requireApp("cms.Xform", moduleType, null, false); } - var module = this._loadModule(json, node, beforeLoadModule, replace); - this.modules.push(module); - modules.push( module ); - }.bind(this)); - if( callback )callback( moduleNodes, jsons, modules ) - }, - _loadModule: function (json, node, beforeLoad) { - if (!json) return; - - //流程组件返回 - if( ( json.type === "Log" && json.logType ) || ["Monitor","ReadLog"].contains(json.type) ){ - node.empty(); - return; - }else if( this.options.useProcessForm && json.type === "Actionbar" ){ //使用流程表单,组件是操作条 - json.type = "ProcessActionbar" - } - - if (!MWF["CMS" + json.type]) { - var moduleType = json.type; - if(moduleType === "AttachmentDg")moduleType = "Attachment"; - MWF.xDesktop.requireApp("cms.Xform", moduleType, null, false); - } - var module = new MWF["CMS" + json.type](node, json, this); - if (beforeLoad) beforeLoad.apply(module); - if (!this.all[json.id]) this.all[json.id] = module; - if (module.field) { - if (!this.forms[json.id]) this.forms[json.id] = module; - } - module.readonly = this.options.readonly; - module.load(); - return module; - }, - //getData: function(){ - // var data= Object.clone(this.businessData.data); - // Object.each(this.forms, function(module, id){ - // debugger; - // if (module.json.section=="yes"){ - // data[id] = this.getSectionData(module, data[id]); - // }else{ - // data[id] = module.getData(); - // } - // }.bind(this)); - // - // this.businessData.data = data; - // this.Macro.environment.setData(this.businessData.data); - // return data; - //}, - trim: function (array) { - var arr = []; - array.each(function (v) { - if (v) arr.push(v); - }); - return arr; - }, - transportPermissionData: function (array, t) { - var result = []; - array.each(function (data) { - var dn = typeOf(data) === "string" ? data : data.distinguishedName; - if (dn) { - var flag = dn.substr(dn.length - 1, 1); - var type; - switch (flag.toLowerCase()) { - case "i": - type = "人员"; //"身份"; - break; - case "p": - type = "人员"; - break; - case "u": - type = "组织"; - break; - case "g": - type = "群组"; - break; - case "r": - type = "角色"; - break; - default: - type = ""; - //result.push( data ); + var module = new MWF["CMS" + json.type](node, json, this); + if (beforeLoad) beforeLoad.apply(module); + if (!this.all[json.id]) this.all[json.id] = module; + if (module.field) { + if (!this.forms[json.id]) this.forms[json.id] = module; + } + module.readonly = this.options.readonly; + module.load(); + return module; + }, + //getData: function(){ + // var data= Object.clone(this.businessData.data); + // Object.each(this.forms, function(module, id){ + // debugger; + // if (module.json.section=="yes"){ + // data[id] = this.getSectionData(module, data[id]); + // }else{ + // data[id] = module.getData(); + // } + // }.bind(this)); + // + // this.businessData.data = data; + // this.Macro.environment.setData(this.businessData.data); + // return data; + //}, + trim: function (array) { + var arr = []; + array.each(function (v) { + if (v) arr.push(v); + }); + return arr; + }, + transportPermissionData: function (array, t) { + var result = []; + array.each(function (data) { + var dn = typeOf(data) === "string" ? data : data.distinguishedName; + if (dn) { + var flag = dn.substr(dn.length - 1, 1); + var type; + switch (flag.toLowerCase()) { + case "i": + type = "人员"; //"身份"; + break; + case "p": + type = "人员"; + break; + case "u": + type = "组织"; + break; + case "g": + type = "群组"; + break; + case "r": + type = "角色"; + break; + default: + type = ""; + //result.push( data ); + } + if (type) { + var name; + if( typeOf(data) === "object" && data.name ){ + name = data.name; + }else if( MWF.name && MWF.name.cn ){ + name = MWF.name.cn( dn ); + }else{ + name = dn.split("@")[0]; + } + result.push({ + permission: t == "author" ? "作者" : "阅读", + permissionObjectType: type, + permissionObjectName: name, + permissionObjectCode: dn + }) + } } - if (type) { - var name; - if( typeOf(data) === "object" && data.name ){ - name = data.name; - }else if( MWF.name && MWF.name.cn ){ - name = MWF.name.cn( dn ); - }else{ - name = dn.split("@")[0]; + }); + return result.length > 0 ? result : null; + }, + getSpecialData: function () { + var data = this.businessData.data; + var readers = []; + var authors = []; + var pictures = []; + var cloudPictures = []; + var summary = ""; + Object.each(this.forms, function (module, id) { + if (module.json.type == "Readerfield" || module.json.type == "Reader") { + if (module.json.section == "yes") { + readers = readers.concat(this.getSectionData(module, data[id])); + } else { + readers = readers.concat(module.getData()); } - result.push({ - permission: t == "author" ? "作者" : "阅读", - permissionObjectType: type, - permissionObjectName: name, - permissionObjectCode: dn - }) } - } - }); - return result.length > 0 ? result : null; - }, - getSpecialData: function () { - var data = this.businessData.data; - var readers = []; - var authors = []; - var pictures = []; - var cloudPictures = []; - var summary = ""; - Object.each(this.forms, function (module, id) { - if (module.json.type == "Readerfield" || module.json.type == "Reader") { - if (module.json.section == "yes") { - readers = readers.concat(this.getSectionData(module, data[id])); - } else { - readers = readers.concat(module.getData()); + if (module.json.type == "Authorfield" || module.json.type == "Author") { + if (module.json.section == "yes") { + authors = authors.concat(this.getSectionData(module, data[id])); + } else { + authors = authors.concat(module.getData()); + } + } + if (module.json.type == "ImageClipper") { + var d = module.getData(); + if (d) pictures.push(d); + } + if (module.json.type == "Htmleditor") { + var text = module.getText(); + summary = text.substr(0, 80); + + cloudPictures = cloudPictures.concat(module.getImageIds()); + } + if (module.json.type == "TinyMCEEditor") { + var text = module.getText(); + summary = text.substr(0, 80); + + cloudPictures = cloudPictures.concat(module.getImageIds()); } + }); + if (data.processOwnerList && typeOf(data.processOwnerList) == "array") { //如果是流程中发布的 + var owner = { personValue: [] }; + data.processOwnerList.each(function (p) { + owner.personValue.push({ + name: p, + type: "person" + }); + }); + readers = readers.concat(owner); } - if (module.json.type == "Authorfield" || module.json.type == "Author") { - if (module.json.section == "yes") { - authors = authors.concat(this.getSectionData(module, data[id])); - } else { - authors = authors.concat(module.getData()); + return { + readers: this.transportPermissionData(readers, "reader"), + authors: this.transportPermissionData(authors, "author"), + pictures: pictures, + summary: summary, + cloudPictures: cloudPictures + }; + }, + getDocumentData: function (formData) { + var data = Object.clone(this.businessData.document); + if (formData.subject) { + data.title = formData.subject; + data.subject = formData.subject; + this.businessData.document.title = formData.subject; + this.businessData.document.subject = formData.subject; + } + data.isNewDocument = false; + return data; + }, + saveDocument: function (callback, sync) { + this.fireEvent("beforeSave"); + if (this.businessData.document.docStatus == "published") { + if (!this.formValidation("publish")) { + this.app.content.unmask(); + //if (callback) callback(); + return false; } } - if (module.json.type == "ImageClipper") { - var d = module.getData(); - if (d) pictures.push(d); + if (!this.formSaveValidation()) { + this.app.content.unmask(); + if (callback && typeof callback === "function") callback(); + return false; + } + var data = this.getData(); + var specialData = this.getSpecialData(); + var documentData = this.getDocumentData(data); + documentData.readerList = specialData.readers; + documentData.authorList = specialData.authors; + documentData.pictureList = specialData.pictures; + documentData.summary = specialData.summary; + documentData.cloudPictures = specialData.cloudPictures; + documentData.docData = data; + delete documentData.attachmentList; + this.fireEvent("postSave", [documentData]); + if (this.officeList) { + this.officeList.each(function (module) { + module.save(); + }); } - if (module.json.type == "Htmleditor") { - var text = module.getText(); - summary = text.substr(0, 80); + this.documentAction.saveDocument(documentData, function () { + //this.documentAction.saveData(function(json){ + this.app.notice(MWF.xApplication.cms.Xform.LP.dataSaved, "success"); + this.businessData.data.isNew = false; + this.fireEvent("afterSave"); + if (callback && typeof callback === "function") callback(); + if( !this.json.notReloadWhenSave ){ + this._reloadReadForm(); + } + //}.bind(this), null, this.businessData.document.id, data, !sync ); + }.bind(this), null, !sync); + }, + // 重新加载阅读表单 + _reloadReadForm: function() { + this.fireEvent("reloadReadForm"); + if (this.app.inBrowser) { + this.modules.each(function (module) { + MWF.release(module); + }); + //MWF.release(this); + this.app.node.destroy(); - cloudPictures = cloudPictures.concat(module.getImageIds()); - } - if (module.json.type == "TinyMCEEditor") { - var text = module.getText(); - summary = text.substr(0, 80); + this.app.options.readonly = true; - cloudPictures = cloudPictures.concat(module.getImageIds()); + this.app.loadApplication(); } - }); - if (data.processOwnerList && typeOf(data.processOwnerList) == "array") { //如果是流程中发布的 - var owner = { personValue: [] }; - data.processOwnerList.each(function (p) { - owner.personValue.push({ - name: p, - type: "person" - }); - }); - readers = readers.concat(owner); - } - return { - readers: this.transportPermissionData(readers, "reader"), - authors: this.transportPermissionData(authors, "author"), - pictures: pictures, - summary: summary, - cloudPictures: cloudPictures - }; - }, - getDocumentData: function (formData) { - var data = Object.clone(this.businessData.document); - if (formData.subject) { - data.title = formData.subject; - data.subject = formData.subject; - this.businessData.document.title = formData.subject; - this.businessData.document.subject = formData.subject; - } - data.isNewDocument = false; - return data; - }, - saveDocument: function (callback, sync) { - this.fireEvent("beforeSave"); - if (this.businessData.document.docStatus == "published") { - if (!this.formValidation("publish")) { - this.app.content.unmask(); - //if (callback) callback(); - return false; + }, + closeDocument: function () { + this.fireEvent("beforeClose"); + if (this.app) { + this.app.close(); } - } - if (!this.formSaveValidation()) { - this.app.content.unmask(); - if (callback && typeof callback === "function") callback(); - return false; - } - var data = this.getData(); - var specialData = this.getSpecialData(); - var documentData = this.getDocumentData(data); - documentData.readerList = specialData.readers; - documentData.authorList = specialData.authors; - documentData.pictureList = specialData.pictures; - documentData.summary = specialData.summary; - documentData.cloudPictures = specialData.cloudPictures; - documentData.docData = data; - delete documentData.attachmentList; - this.fireEvent("postSave", [documentData]); - if (this.officeList) { - this.officeList.each(function (module) { - module.save(); - }); - } - this.documentAction.saveDocument(documentData, function () { - //this.documentAction.saveData(function(json){ - this.app.notice(MWF.xApplication.cms.Xform.LP.dataSaved, "success"); - this.businessData.data.isNew = false; - this.fireEvent("afterSave"); - if (callback && typeof callback === "function") callback(); - if( !this.json.notReloadWhenSave ){ - this._reloadReadForm(); + }, + printDocument: function (form) { + var form = form; + if (!form) { + form = this.json.id; + if (this.json.printForm && this.json.printForm !== "none") form = this.json.printForm; } - //}.bind(this), null, this.businessData.document.id, data, !sync ); - }.bind(this), null, !sync); - }, - // 重新加载阅读表单 - _reloadReadForm: function() { - this.fireEvent("reloadReadForm"); - if (this.app.inBrowser) { - this.modules.each(function (module) { - MWF.release(module); - }); - //MWF.release(this); - this.app.node.destroy(); - - this.app.options.readonly = true; - - this.app.loadApplication(); - } - }, - closeDocument: function () { - this.fireEvent("beforeClose"); - if (this.app) { - this.app.close(); - } - }, - printDocument: function (form) { - var form = form; - if (!form) { - form = this.json.id; - if (this.json.printForm && this.json.printForm !== "none") form = this.json.printForm; - } - window.open(o2.filterUrl("../x_desktop/printcmsdoc.html?documentid=" + this.businessData.document.id + "&form=" + form)); - }, - - formValidation: function (status) { - if (this.options.readonly) return true; - var flag = true; - //flag = this.validation(); - Object.each(this.forms, function (field, key) { - if (field.validationMode)field.validationMode(); - if (field.validation && !field.validation(status)) { - flag = false; + window.open(o2.filterUrl("../x_desktop/printcmsdoc.html?documentid=" + this.businessData.document.id + "&form=" + form)); + }, + + formValidation: function (status) { + if (this.options.readonly) return true; + var flag = true; + //flag = this.validation(); + Object.each(this.forms, function (field, key) { + if (field.validationMode)field.validationMode(); + if (field.validation && !field.validation(status)) { + flag = false; + } + }.bind(this)); + return flag; + }, + formSaveValidation: function () { + if (!this.json.validationSave) return true; + if (!this.json.validationSave.code) return true; + var flag = this.Macro.exec(this.json.validationSave.code, this); + if (!flag) flag = MWF.xApplication.cms.Xform.LP.notValidation; + if (typeOf(flag) === "string") { + if (flag !== "true") { + this.app.notice(flag, "error"); + return false; + } + } else if (flag.toString() != "true") { + return false; } - }.bind(this)); - return flag; - }, - formSaveValidation: function () { - if (!this.json.validationSave) return true; - if (!this.json.validationSave.code) return true; - var flag = this.Macro.exec(this.json.validationSave.code, this); - if (!flag) flag = MWF.xApplication.cms.Xform.LP.notValidation; - if (typeOf(flag) === "string") { - if (flag !== "true") { - this.app.notice(flag, "error"); + return true; + }, + formPublishValidation: function () { + if (!this.json.validationPublish) return true; + if (!this.json.validationPublish.code) return true; + var flag = this.Macro.exec(this.json.validationPublish.code, this); + if (!flag) flag = MWF.xApplication.cms.Xform.LP.notValidation; + if (typeOf(flag) === "string") { + if (flag !== "true") { + this.app.notice(flag, "error"); + return false; + } + } else if (flag.toString() != "true") { + return false; + } + return true; + }, + publishDocumentDelayed: function( callback ){ + this.fireEvent("beforeWaitPublish"); + // this.app.content.mask({ + // "destroyOnHide": true, + // "style": this.app.css.maskNode + // }); + if (!this.formValidation("publish")) { + // this.app.content.unmask(); + //if (callback) callback(); return false; } - } else if (flag.toString() != "true") { - return false; - } - return true; - }, - formPublishValidation: function () { - if (!this.json.validationPublish) return true; - if (!this.json.validationPublish.code) return true; - var flag = this.Macro.exec(this.json.validationPublish.code, this); - if (!flag) flag = MWF.xApplication.cms.Xform.LP.notValidation; - if (typeOf(flag) === "string") { - if (flag !== "true") { - this.app.notice(flag, "error"); + if (!this.formPublishValidation()) { + // this.app.content.unmask(); + if (callback) callback(); return false; } - } else if (flag.toString() != "true") { - return false; - } - return true; - }, - publishDocument: function (callback) { - this.fireEvent("beforePublish"); - this.app.content.mask({ - "destroyOnHide": true, - "style": this.app.css.maskNode - }); - if (!this.formValidation("publish")) { - this.app.content.unmask(); - //if (callback) callback(); - return false; - } - if (!this.formPublishValidation()) { - this.app.content.unmask(); - if (callback) callback(); - return false; - } - - var data = this.getData(); - var specialData = this.getSpecialData(); - //this.documentAction.saveData(function(json){ - var documentData = this.getDocumentData(data); - documentData.readerList = specialData.readers; - documentData.authorList = specialData.authors; - documentData.pictureList = specialData.pictures; - documentData.summary = specialData.summary; - documentData.cloudPictures = specialData.cloudPictures; - documentData.docData = data; - delete documentData.attachmentList; - //this.documentAction.saveDocument(documentData, function(){ - this.fireEvent("postPublish", [documentData]); - if (this.app) if (this.app.fireEvent) this.app.fireEvent("postPublish",[documentData]); - if (this.officeList) { - this.officeList.each(function (module) { - module.save(); + + MWF.xDesktop.requireApp("cms.Document", "DelayPublishForm", null, false); + + debugger; + var form = new MWF.xApplication.cms.Document.DelayPublishForm(this, {}, { + publishTime : this.businessData.document.publishTime || "", + onPostOk : function( publishTime ){ + + this._publishDocumentDelayed( publishTime ); + + }.bind(this) + },{ + app : this.app, lp : this.app.lp, css : this.app.css, actions : this.app.action }); - } + form.create(); - this.documentAction.publishDocumentComplex(documentData, function (json) { + }, + _publishDocumentDelayed: function( publishTime ){ + var data = this.getData(); + var specialData = this.getSpecialData(); + //this.documentAction.saveData(function(json){ + var documentData = this.getDocumentData(data); + + documentData.publishTime = publishTime; + documentData.docStatus = "waitPublish"; + documentData.documentNotify = this.getNoticeOptions(); + + documentData.readerList = specialData.readers; + documentData.authorList = specialData.authors; + documentData.pictureList = specialData.pictures; + documentData.summary = specialData.summary; + documentData.cloudPictures = specialData.cloudPictures; + documentData.docData = data; + delete documentData.attachmentList; + //this.documentAction.saveDocument(documentData, function(){ + this.fireEvent("postWaitPublish", [documentData]); + if (this.app) if (this.app.fireEvent) this.app.fireEvent("postWaitPublish",[documentData]); + if (this.officeList) { + this.officeList.each(function (module) { + module.save(); + }); + } - this.sendNotice(function () { + this.documentAction.publishDocumentComplex(documentData, function (json) { this.businessData.data.isNew = false; - this.fireEvent("afterPublish", [this, json.data]); - if (this.app) if (this.app.fireEvent) this.app.fireEvent("afterPublish",[this, json.data]); + this.fireEvent("afterWaitPublish", [this, json.data]); + if (this.app) if (this.app.fireEvent) this.app.fireEvent("afterWaitPublish",[this, json.data]); // if (callback) callback(); // 传进来不是function if (layout.mobile) { - this.app.content.unmask(); + // this.app.content.unmask(); this.closeWindowOnMobile(); } else { if (this.businessData.document.title) { - this.app.notice(MWF.xApplication.cms.Xform.LP.documentPublished + ": “" + this.businessData.document.title + "”", "success"); + this.app.notice(MWF.xApplication.cms.Xform.LP.documentDelayedPublished + ": “" + this.businessData.document.title + "”", "success"); } else { - this.app.notice(MWF.xApplication.cms.Xform.LP.documentPublished, "success"); + this.app.notice(MWF.xApplication.cms.Xform.LP.documentDelayedPublished, "success"); } this.options.saveOnClose = false; @@ -1099,480 +1137,557 @@ MWF.xApplication.cms.Xform.Form = MWF.CMSForm = new Class( } }.bind(this)); - - }.bind(this)); - - //}.bind(this)) - //}.bind(this), null, this.businessData.document.id, data); - }, - - sendNotice: function( callback ){ - var rangeList = []; - var sendOptions; - if( this.json.noticeType === "custom" ){ //reader - switch ( o2.typeOf( this.json.noticeSpecificList ) ) { - case "array": - rangeList = this.json.noticeSpecificList; - break; - case "string": - case "object": - rangeList.push( this.json.noticeSpecificList ); - break; + }, + publishDocument: function (callback) { + this.fireEvent("beforeWaitPublish"); + this.app.content.mask({ + "destroyOnHide": true, + "style": this.app.css.maskNode + }); + if (!this.formValidation("publish")) { + this.app.content.unmask(); + //if (callback) callback(); + return false; + } + if (!this.formPublishValidation()) { + this.app.content.unmask(); + if (callback) callback(); + return false; + } + + var data = this.getData(); + var specialData = this.getSpecialData(); + //this.documentAction.saveData(function(json){ + var documentData = this.getDocumentData(data); + documentData.readerList = specialData.readers; + documentData.authorList = specialData.authors; + documentData.pictureList = specialData.pictures; + documentData.summary = specialData.summary; + documentData.cloudPictures = specialData.cloudPictures; + documentData.docData = data; + delete documentData.attachmentList; + //this.documentAction.saveDocument(documentData, function(){ + this.fireEvent("postPublish", [documentData]); + if (this.app) if (this.app.fireEvent) this.app.fireEvent("postPublish",[documentData]); + if (this.officeList) { + this.officeList.each(function (module) { + module.save(); + }); } - (this.json.noticeFormFieldList || []).each(function (name) { - var range = this.all[name.id] ? this.all[name.id].getData() : null; - if( range )rangeList = rangeList.concat( range ); + this.documentAction.publishDocumentComplex(documentData, function (json) { + + this.sendNotice(function () { + + this.businessData.data.isNew = false; + this.fireEvent("afterPublish", [this, json.data]); + if (this.app) if (this.app.fireEvent) this.app.fireEvent("afterPublish",[this, json.data]); + // if (callback) callback(); // 传进来不是function + if (layout.mobile) { + this.app.content.unmask(); + this.closeWindowOnMobile(); + } else { + if (this.businessData.document.title) { + this.app.notice(MWF.xApplication.cms.Xform.LP.documentPublished + ": “" + this.businessData.document.title + "”", "success"); + } else { + this.app.notice(MWF.xApplication.cms.Xform.LP.documentPublished, "success"); + } + this.options.saveOnClose = false; + + debugger; + if( layout.inBrowser ){ + try{ + if( window.opener && window.opener.o2RefreshCMSView ){ + window.opener.o2RefreshCMSView(); + } + }catch (e) {} + window.setTimeout(function () { + this.app.close(); + }.bind(this), 1500) + }else{ + this.app.close(); + } + } + + }.bind(this)); + }.bind(this)); - if( this.json.noticeScript && this.json.noticeScript.code ){ - range = this.Macro.exec(this.json.noticeScript.code, this); - switch ( o2.typeOf( range ) ) { + //}.bind(this)) + //}.bind(this), null, this.businessData.document.id, data); + }, + + getNoticeOptions: function(){ + var rangeList = []; + var sendOptions; + if( this.json.noticeType === "custom" ){ //reader + switch ( o2.typeOf( this.json.noticeSpecificList ) ) { case "array": - rangeList = rangeList.concat( range ); + rangeList = this.json.noticeSpecificList; break; case "string": case "object": - rangeList.push( range ); + rangeList.push( this.json.noticeSpecificList ); break; } - } - rangeList = rangeList.clean().map(function ( range ) { - return o2.typeOf(range) === "string" ? range : range.distinguishedName - }).unique(); + (this.json.noticeFormFieldList || []).each(function (name) { + var range = this.all[name.id] ? this.all[name.id].getData() : null; + if( range )rangeList = rangeList.concat( range ); + }.bind(this)); - sendOptions = { - documentId: this.businessData.document.id, - notifyPersonList: rangeList, - notifyCreatePerson: this.json.notifyCreatePerson !== "no" - }; - }else{ - var readers = []; - Object.each(this.forms, function (module, id) { - if (module.json.type === "Readerfield" || module.json.type === "Reader") { - readers = readers.concat(module.getData()); + if( this.json.noticeScript && this.json.noticeScript.code ){ + range = this.Macro.exec(this.json.noticeScript.code, this); + switch ( o2.typeOf( range ) ) { + case "array": + rangeList = rangeList.concat( range ); + break; + case "string": + case "object": + rangeList.push( range ); + break; + } } - }); - rangeList = readers.clean().map(function ( range ) { - return o2.typeOf(range) === "string" ? range : range.distinguishedName - }).unique(); - if( rangeList.length === 0 ){ - if( this.json.blankToAllNotify !== "no" ){ //通知所有人 + + rangeList = rangeList.clean().map(function ( range ) { + return o2.typeOf(range) === "string" ? range : range.distinguishedName + }).unique(); + + sendOptions = { + documentId: this.businessData.document.id, + notifyPersonList: rangeList, + notifyCreatePerson: this.json.notifyCreatePerson !== "no" + }; + }else{ + var readers = []; + Object.each(this.forms, function (module, id) { + if (module.json.type === "Readerfield" || module.json.type === "Reader") { + readers = readers.concat(module.getData()); + } + }); + rangeList = readers.clean().map(function ( range ) { + return o2.typeOf(range) === "string" ? range : range.distinguishedName + }).unique(); + if( rangeList.length === 0 ){ + if( this.json.blankToAllNotify !== "no" ){ //通知所有人 + sendOptions = { + documentId: this.businessData.document.id, + notifyByDocumentReadPerson: true, + notifyCreatePerson: this.json.notifyCreatePerson !== "no" + }; + } + }else{ sendOptions = { documentId: this.businessData.document.id, + notifyPersonList: rangeList, notifyByDocumentReadPerson: true, notifyCreatePerson: this.json.notifyCreatePerson !== "no" }; } - }else{ + } + if( !sendOptions && this.json.notifyCreatePerson !== "no" ){ sendOptions = { documentId: this.businessData.document.id, - notifyPersonList: rangeList, - notifyByDocumentReadPerson: true, - notifyCreatePerson: this.json.notifyCreatePerson !== "no" + notifyByDocumentReadPerson: false, + notifyCreatePerson: true }; } - } - if( !sendOptions && this.json.notifyCreatePerson !== "no" ){ - sendOptions = { - documentId: this.businessData.document.id, - notifyByDocumentReadPerson: false, - notifyCreatePerson: true - }; - } - if( sendOptions && o2.Actions.load("x_cms_assemble_control").DocumentAction.publishNotify ) { - o2.Actions.load("x_cms_assemble_control").DocumentAction.publishNotify(this.businessData.document.id, sendOptions, function () { - if (callback) callback(); - }, function () { - if (callback) callback(); - }) - }else{ - if(callback)callback(); - } - }, - deleteDocumentForMobile: function () { - if (layout.mobile) { - this.app.content.mask({ - "style": { - "background-color": "#999", - "opacity": 0.6 - } - }); + return sendOptions; + }, + sendNotice: function( callback ){ + var sendOptions = this.getNoticeOptions(); + if( sendOptions && o2.Actions.load("x_cms_assemble_control").DocumentAction.publishNotify ) { + o2.Actions.load("x_cms_assemble_control").DocumentAction.publishNotify(this.businessData.document.id, sendOptions, function () { + if (callback) callback( sendOptions ); + }, function () { + if (callback) callback( sendOptions ); + }) + }else{ + if(callback)callback( sendOptions ); + } + }, + deleteDocumentForMobile: function () { + if (layout.mobile) { + this.app.content.mask({ + "style": { + "background-color": "#999", + "opacity": 0.6 + } + }); - this.fireEvent("beforeDelete"); - if (this.app && this.app.fireEvent) this.app.fireEvent("beforeDelete"); - - this.documentAction.removeDocument(this.businessData.document.id, function (json) { - this.fireEvent("afterDelete"); - if (this.app && this.app.fireEvent) this.app.fireEvent("afterDelete"); - this.app.notice(MWF.xApplication.cms.Xform.LP.documentDelete + ": “" + this.businessData.document.title + "”", "success"); - this.options.autoSave = false; - this.options.saveOnClose = false; - this.fireEvent("postDelete"); - this.closeWindowOnMobile(); - }.bind(this)); - } - }, - - /** - * @summary 弹出删除文档确认框. - * @method deleteDocument - * @memberof CMSForm - * @example - * this.form.getApp().appForm.deleteDocument(); - */ - deleteDocument: function () { - var _self = this; - var p = MWF.getCenterPosition(this.app.content, 380, 150); - var event = { - "event": { - "x": p.x, - "y": p.y - 200, - "clientX": p.x, - "clientY": p.y - 200 + this.fireEvent("beforeDelete"); + if (this.app && this.app.fireEvent) this.app.fireEvent("beforeDelete"); + + this.documentAction.removeDocument(this.businessData.document.id, function (json) { + this.fireEvent("afterDelete"); + if (this.app && this.app.fireEvent) this.app.fireEvent("afterDelete"); + this.app.notice(MWF.xApplication.cms.Xform.LP.documentDelete + ": “" + this.businessData.document.title + "”", "success"); + this.options.autoSave = false; + this.options.saveOnClose = false; + this.fireEvent("postDelete"); + this.closeWindowOnMobile(); + }.bind(this)); } - }; - debugger; - this.app.confirm("infor", event, MWF.xApplication.cms.Xform.LP.deleteDocumentTitle, MWF.xApplication.cms.Xform.LP.deleteDocumentText, 380, 120, function () { - _self.app.content.mask({ - "style": { - "background-color": "#999", - "opacity": 0.6 + }, + + /** + * @summary 弹出删除文档确认框. + * @method deleteDocument + * @memberof CMSForm + * @example + * this.form.getApp().appForm.deleteDocument(); + */ + deleteDocument: function () { + var _self = this; + var p = MWF.getCenterPosition(this.app.content, 380, 150); + var event = { + "event": { + "x": p.x, + "y": p.y - 200, + "clientX": p.x, + "clientY": p.y - 200 } - }); + }; + debugger; + this.app.confirm("infor", event, MWF.xApplication.cms.Xform.LP.deleteDocumentTitle, MWF.xApplication.cms.Xform.LP.deleteDocumentText, 380, 120, function () { + _self.app.content.mask({ + "style": { + "background-color": "#999", + "opacity": 0.6 + } + }); + + _self.fireEvent("beforeDelete"); + if (_self.app && _self.app.fireEvent) _self.app.fireEvent("beforeDelete"); - _self.fireEvent("beforeDelete"); - if (_self.app && _self.app.fireEvent) _self.app.fireEvent("beforeDelete"); - - _self.documentAction.removeDocument(_self.businessData.document.id, function (json) { - debugger; - _self.fireEvent("afterDelete"); - if (_self.app && _self.app.fireEvent) _self.app.fireEvent("afterDelete"); - _self.app.notice(MWF.xApplication.cms.Xform.LP.documentDelete + ": “" + _self.businessData.document.title + "”", "success"); - _self.options.autoSave = false; - _self.options.saveOnClose = false; - _self.fireEvent("postDelete"); - _self.app.close(); + _self.documentAction.removeDocument(_self.businessData.document.id, function (json) { + debugger; + _self.fireEvent("afterDelete"); + if (_self.app && _self.app.fireEvent) _self.app.fireEvent("afterDelete"); + _self.app.notice(MWF.xApplication.cms.Xform.LP.documentDelete + ": “" + _self.businessData.document.title + "”", "success"); + _self.options.autoSave = false; + _self.options.saveOnClose = false; + _self.fireEvent("postDelete"); + _self.app.close(); + this.close(); + }.bind(this)); + //this.close(); + }, function () { this.close(); - }.bind(this)); - //this.close(); - }, function () { - this.close(); - }); - }, - - /** - * @summary 编辑文档. - * @method editDocument - * @memberof CMSForm - * @example - * this.form.getApp().appForm.editDocument(); - */ - editDocument: function () { - this.fireEvent("editDocument"); - if (this.app.inBrowser) { - this.modules.each(function (module) { - MWF.release(module); }); - //MWF.release(this); - this.app.node.destroy(); - - this.app.options.readonly = false; - - this.app.loadApplication(); - } else { - var options = { "documentId": this.businessData.document.id, "readonly": false }; //this.explorer.app.options.application.allowControl}; - - if (this.app.options.postPublish)options.postPublish = this.app.options.postPublish; - if (this.app.options.afterPublish)options.afterPublish = this.app.options.afterPublish; - if (this.app.options.postDelete)options.postDelete = this.app.options.postDelete; - - if (this.app.options.formEditId) options.formEditId = this.app.options.formEditId; - this.app.desktop.openApplication(null, "cms.Document", options); - this.app.close(); - } - }, - - //2019-11-29 移动端 开启编辑模式 - /** - * @summary 移动端开启编辑模式. - * @method editDocumentForMobile - * @memberof CMSForm - * @example - * this.form.getApp().appForm.editDocumentForMobile(); - */ - editDocumentForMobile: function () { - if (layout.mobile) { - this.app.options.readonly = false; - this.app.loadDocument(this.app.options); - } - }, - - /** - * @summary 弹出设置热点的界面. - * @method setPopularDocument - * @memberof CMSForm - * @example - * this.form.getApp().appForm.setPopularDocument(); - */ - setPopularDocument: function () { - this.app.setPopularDocument(); - }, - - // printWork: function (app, form) { - // var application = app || this.businessData.work.application; - // var form = form; - // if (!form) { - // form = this.json.id; - // if (this.json.printForm) form = this.json.printForm; - // } - // window.open(o2.filterUrl("../x_desktop/printWork.html?workid=" + this.businessData.work.id + "&app=" + this.businessData.work.application + "&form=" + form)); - // }, - openWindow: function (form, app) { - var form = form; - if (!form) { - form = this.json.id; - } - if (this.businessData.document) { - //var application = app; - //window.open("../x_desktop/printWork.html?workCompletedId="+this.businessData.workCompleted.id+"&app="+application+"&form="+form); - } - }, - - /** - * @summary 将新上传的附件在指定的附件组件中展现. - * @method uploadedAttachment - * @memberof CMSForm - * @param {String} site - 附件组件的标识 - * @param {String} id - 新上传的附件id - * @example - * this.form.getApp().appForm.uploadedAttachment(site, id); - */ - uploadedAttachment: function (site, id) { - this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { - - var flag = this.businessData.attachmentList.some(function (attData) { - return json.data.id === attData.id; - }.bind(this)); - if( !flag ){ - this.businessData.attachmentList.push(json.data); + }, + + /** + * @summary 编辑文档. + * @method editDocument + * @memberof CMSForm + * @example + * this.form.getApp().appForm.editDocument(); + */ + editDocument: function () { + this.fireEvent("editDocument"); + if (this.app.inBrowser) { + this.modules.each(function (module) { + MWF.release(module); + }); + //MWF.release(this); + this.app.node.destroy(); + + this.app.options.readonly = false; + + this.app.loadApplication(); + } else { + var options = { "documentId": this.businessData.document.id, "readonly": false }; //this.explorer.app.options.application.allowControl}; + + if (this.app.options.postPublish)options.postPublish = this.app.options.postPublish; + if (this.app.options.afterPublish)options.afterPublish = this.app.options.afterPublish; + if (this.app.options.postDelete)options.postDelete = this.app.options.postDelete; + + if (this.app.options.formEditId) options.formEditId = this.app.options.formEditId; + this.app.desktop.openApplication(null, "cms.Document", options); + this.app.close(); } + }, - var att = this.all[site]; - if (att) { - if (json.data) att.attachmentController.addAttachment(json.data); - att.attachmentController.checkActions(); - att.fireEvent("upload", [json.data]); + //2019-11-29 移动端 开启编辑模式 + /** + * @summary 移动端开启编辑模式. + * @method editDocumentForMobile + * @memberof CMSForm + * @example + * this.form.getApp().appForm.editDocumentForMobile(); + */ + editDocumentForMobile: function () { + if (layout.mobile) { + this.app.options.readonly = false; + this.app.loadDocument(this.app.options); } - }.bind(this)); - }, - replacedAttachment: function (site, id) { - this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { - - var att = this.all[site]; - if (att) { - var attachmentController = att.attachmentController; - var attachment = null; - for (var i = 0; i < attachmentController.attachments.length; i++) { - if (attachmentController.attachments[i].data.id === id) { - attachment = attachmentController.attachments[i]; - break; - } - } - attachment.data = json.data; - attachment.reload(); - attachmentController.checkActions(); + }, + + /** + * @summary 弹出设置热点的界面. + * @method setPopularDocument + * @memberof CMSForm + * @example + * this.form.getApp().appForm.setPopularDocument(); + */ + setPopularDocument: function () { + this.app.setPopularDocument(); + }, + + // printWork: function (app, form) { + // var application = app || this.businessData.work.application; + // var form = form; + // if (!form) { + // form = this.json.id; + // if (this.json.printForm) form = this.json.printForm; + // } + // window.open(o2.filterUrl("../x_desktop/printWork.html?workid=" + this.businessData.work.id + "&app=" + this.businessData.work.application + "&form=" + form)); + // }, + openWindow: function (form, app) { + var form = form; + if (!form) { + form = this.json.id; + } + if (this.businessData.document) { + //var application = app; + //window.open("../x_desktop/printWork.html?workCompletedId="+this.businessData.workCompleted.id+"&app="+application+"&form="+form); } - }.bind(this)) - }, + }, + + /** + * @summary 将新上传的附件在指定的附件组件中展现. + * @method uploadedAttachment + * @memberof CMSForm + * @param {String} site - 附件组件的标识 + * @param {String} id - 新上传的附件id + * @example + * this.form.getApp().appForm.uploadedAttachment(site, id); + */ + uploadedAttachment: function (site, id) { + this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { - uploadedAttachmentDatagrid: function (site, id, moduleId) { - this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { + var flag = this.businessData.attachmentList.some(function (attData) { + return json.data.id === attData.id; + }.bind(this)); + if( !flag ){ + this.businessData.attachmentList.push(json.data); + } - var flag = this.businessData.attachmentList.some(function (attData) { - return json.data.id === attData.id; + var att = this.all[site]; + if (att) { + if (json.data) att.attachmentController.addAttachment(json.data); + att.attachmentController.checkActions(); + att.fireEvent("upload", [json.data]); + } }.bind(this)); - if( !flag ){ - this.businessData.attachmentList.push(json.data); - } - - var att = this.all[moduleId]; - if (att) { - if (json.data) att.attachmentController.addAttachment(json.data); - att.setAttachmentBusinessData(); - att.attachmentController.checkActions(); - att.fireEvent("upload", [json.data]); - att.fireEvent("change", [json.data]); - } - }.bind(this)); - }, - replacedAttachmentDatagrid: function (site, id, moduleId) { - this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { - - var att = this.all[moduleId]; - if (att) { - var attachmentController = att.attachmentController; - var attachment = null; - for (var i = 0; i < attachmentController.attachments.length; i++) { - if (attachmentController.attachments[i].data.id === id) { - attachment = attachmentController.attachments[i]; - break; + }, + replacedAttachment: function (site, id) { + this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { + + var att = this.all[site]; + if (att) { + var attachmentController = att.attachmentController; + var attachment = null; + for (var i = 0; i < attachmentController.attachments.length; i++) { + if (attachmentController.attachments[i].data.id === id) { + attachment = attachmentController.attachments[i]; + break; + } } + attachment.data = json.data; + attachment.reload(); + attachmentController.checkActions(); } - attachment.data = json.data; - att.setAttachmentBusinessData(); - attachment.reload(); - attachmentController.checkActions(); - att.fireEvent("change", [json.data]); - } - }.bind(this)) - }, - - /** - * @summary 弹出文档置顶对话框,操作后使当前文档在列式服务中排在前面. - * @method setTop - * @memberof CMSForm - * @example - * this.form.getApp().appForm.setTop(); - */ - setTop: function () { - var _self = this; - var p = MWF.getCenterPosition(this.app.content, 380, 150); - var event = { - "event": { - "x": p.x, - "y": p.y - 200, - "clientX": p.x, - "clientY": p.y - 200 - } - }; - this.app.confirm("infor", event, MWF.xApplication.cms.Xform.LP.setTopTitle, MWF.xApplication.cms.Xform.LP.setTopText, 380, 120, function () { - o2.Actions.load("x_cms_assemble_control").DocumentAction.persist_top(_self.businessData.document.id, function () { - _self.app.notice(MWF.xApplication.cms.Xform.LP.setTopSuccess, "success"); - _self.app.reload(); - this.close(); }.bind(this)) + }, - //this.close(); - }, function () { - this.close(); - }); - }, - - - /** - * @summary 弹出文档取消置顶对话框. - * @method cancelTop - * @memberof CMSForm - * @example - * this.form.getApp().appForm.cancelTop(); - */ - cancelTop: function () { - var _self = this; - var p = MWF.getCenterPosition(this.app.content, 380, 150); - var event = { - "event": { - "x": p.x, - "y": p.y - 200, - "clientX": p.x, - "clientY": p.y - 200 - } - }; - this.app.confirm("infor", event, MWF.xApplication.cms.Xform.LP.cancelTopTitle, MWF.xApplication.cms.Xform.LP.cancelTopText, 380, 120, function () { + uploadedAttachmentDatagrid: function (site, id, moduleId) { + this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { - o2.Actions.load("x_cms_assemble_control").DocumentAction.persist_unTop(_self.businessData.document.id, function () { - _self.app.notice(MWF.xApplication.cms.Xform.LP.cancelTopSuccess, "success"); - _self.app.reload(); - this.close(); + var flag = this.businessData.attachmentList.some(function (attData) { + return json.data.id === attData.id; + }.bind(this)); + if( !flag ){ + this.businessData.attachmentList.push(json.data); + } + + var att = this.all[moduleId]; + if (att) { + if (json.data) att.attachmentController.addAttachment(json.data); + att.setAttachmentBusinessData(); + att.attachmentController.checkActions(); + att.fireEvent("upload", [json.data]); + att.fireEvent("change", [json.data]); + } + }.bind(this)); + }, + replacedAttachmentDatagrid: function (site, id, moduleId) { + this.documentAction.getAttachment(id, this.businessData.document.id, function (json) { + + var att = this.all[moduleId]; + if (att) { + var attachmentController = att.attachmentController; + var attachment = null; + for (var i = 0; i < attachmentController.attachments.length; i++) { + if (attachmentController.attachments[i].data.id === id) { + attachment = attachmentController.attachments[i]; + break; + } + } + attachment.data = json.data; + att.setAttachmentBusinessData(); + attachment.reload(); + attachmentController.checkActions(); + att.fireEvent("change", [json.data]); + } }.bind(this)) + }, - //this.close(); - }, function () { - this.close(); - }); - }, - /** - * 移动端处理关闭 - */ - closeWindowOnMobile: function () { - if (window.o2android && window.o2android.closeDocumentWindow) { - window.o2android.closeDocumentWindow(""); - } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.closeDocumentWindow) { - window.webkit.messageHandlers.closeDocumentWindow.postMessage(""); - } else if (window.wx && window.__wxjs_environment === 'miniprogram') { //微信小程序 关闭页面 - wx.miniProgram.navigateBack({ delta: 1 }); - } else if (window.uni && window.uni.navigateBack) { // uniapp 关闭页面 - window.uni.navigateBack(); - } else if (this.json.afterProcessAction === "redirect" && this.json.afterProcessRedirectScript && this.json.afterProcessRedirectScript.code) { - var url = this.Macro.exec(this.json.afterProcessRedirectScript.code, this); - (new URI(url)).go(); - } else { - var uri = new URI(window.location.href); - var redirectlink = uri.getData("redirectlink"); - if (redirectlink) { - history.replaceState(null, "work", redirectlink); - redirectlink.toURI().go(); + /** + * @summary 弹出文档置顶对话框,操作后使当前文档在列式服务中排在前面. + * @method setTop + * @memberof CMSForm + * @example + * this.form.getApp().appForm.setTop(); + */ + setTop: function () { + var _self = this; + var p = MWF.getCenterPosition(this.app.content, 380, 150); + var event = { + "event": { + "x": p.x, + "y": p.y - 200, + "clientX": p.x, + "clientY": p.y - 200 + } + }; + this.app.confirm("infor", event, MWF.xApplication.cms.Xform.LP.setTopTitle, MWF.xApplication.cms.Xform.LP.setTopText, 380, 120, function () { + o2.Actions.load("x_cms_assemble_control").DocumentAction.persist_top(_self.businessData.document.id, function () { + _self.app.notice(MWF.xApplication.cms.Xform.LP.setTopSuccess, "success"); + _self.app.reload(); + this.close(); + }.bind(this)) + + //this.close(); + }, function () { + this.close(); + }); + }, + + + /** + * @summary 弹出文档取消置顶对话框. + * @method cancelTop + * @memberof CMSForm + * @example + * this.form.getApp().appForm.cancelTop(); + */ + cancelTop: function () { + var _self = this; + var p = MWF.getCenterPosition(this.app.content, 380, 150); + var event = { + "event": { + "x": p.x, + "y": p.y - 200, + "clientX": p.x, + "clientY": p.y - 200 + } + }; + this.app.confirm("infor", event, MWF.xApplication.cms.Xform.LP.cancelTopTitle, MWF.xApplication.cms.Xform.LP.cancelTopText, 380, 120, function () { + + o2.Actions.load("x_cms_assemble_control").DocumentAction.persist_unTop(_self.businessData.document.id, function () { + _self.app.notice(MWF.xApplication.cms.Xform.LP.cancelTopSuccess, "success"); + _self.app.reload(); + this.close(); + }.bind(this)) + + //this.close(); + }, function () { + this.close(); + }); + }, + /** + * 移动端处理关闭 + */ + closeWindowOnMobile: function () { + if (window.o2android && window.o2android.closeDocumentWindow) { + window.o2android.closeDocumentWindow(""); + } else if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.closeDocumentWindow) { + window.webkit.messageHandlers.closeDocumentWindow.postMessage(""); + } else if (window.wx && window.__wxjs_environment === 'miniprogram') { //微信小程序 关闭页面 + wx.miniProgram.navigateBack({ delta: 1 }); + } else if (window.uni && window.uni.navigateBack) { // uniapp 关闭页面 + window.uni.navigateBack(); + } else if (this.json.afterProcessAction === "redirect" && this.json.afterProcessRedirectScript && this.json.afterProcessRedirectScript.code) { + var url = this.Macro.exec(this.json.afterProcessRedirectScript.code, this); + (new URI(url)).go(); } else { - this.app.close(); + var uri = new URI(window.location.href); + var redirectlink = uri.getData("redirectlink"); + if (redirectlink) { + history.replaceState(null, "work", redirectlink); + redirectlink.toURI().go(); + } else { + this.app.close(); + } + // var len = window.history.length; + // if (len > 1) { + // history.back(); + // } else { + + // // window.location = o2.filterUrl("../x_desktop/appMobile.html?app=process.TaskCenter"); + // history.replaceState(null, "work", o2.filterUrl("../x_desktop/appMobile.html?app=process.TaskCenter")); + // o2.filterUrl("../x_desktop/appMobile.html?app=process.TaskCenter").toURI().go(); + + // } } - // var len = window.history.length; - // if (len > 1) { - // history.back(); - // } else { - - // // window.location = o2.filterUrl("../x_desktop/appMobile.html?app=process.TaskCenter"); - // history.replaceState(null, "work", o2.filterUrl("../x_desktop/appMobile.html?app=process.TaskCenter")); - // o2.filterUrl("../x_desktop/appMobile.html?app=process.TaskCenter").toURI().go(); - - // } - } - }, - // //列式流程log - // listWorkLog: function ( callback ) { - // if( !this.businessData.data.$work || !this.businessData.data.$work.job ){ - // callback([]); - // return - // } - // - // if( this.workLogList ){ - // callback(this.workLogList); - // return; - // } - // - // //只获取一次。把callback存起来,等异步调用完成后一次性执行callback - // if( !this.worklogCallbackList )this.worklogCallbackList = []; - // Promise.resolve( o2.Actions.load("x_processplatform_assemble_surface").WorkLogAction.listWithJob( this.businessData.data.$work.job )).then(function(json){ - // this.workLogList = json.data; - // debugger; - // while( this.worklogCallbackList.length ){ - // this.worklogCallbackList.shift()( this.workLogList ); - // } - // }.bind(this)); - // this.worklogCallbackList.push( callback ); - // }, - // //列式流程record - // listWorkRecord: function ( callback ) { - // if( !this.businessData.data.$work || !this.businessData.data.$work.job ){ - // callback([]); - // return - // } - // - // if( this.workRecordList ){ - // callback(this.workRecordList); - // return; - // } - // - // //只获取一次。把callback存起来,等异步调用完成后一次性执行callback - // if( !this.workRecordCallbackList )this.workRecordCallbackList = []; - // Promise.resolve( o2.Actions.load("x_processplatform_assemble_surface").RecordAction.listWithJob( this.businessData.data.$work.job )).then(function(json){ - // this.workRecordList = json.data; - // while( this.workRecordCallbackList.length ){ - // this.workRecordCallbackList.shift()( this.workRecordList ); - // } - // }.bind(this)); - // this.workRecordCallbackList.push( callback ); - // } - - -}); + }, + // //列式流程log + // listWorkLog: function ( callback ) { + // if( !this.businessData.data.$work || !this.businessData.data.$work.job ){ + // callback([]); + // return + // } + // + // if( this.workLogList ){ + // callback(this.workLogList); + // return; + // } + // + // //只获取一次。把callback存起来,等异步调用完成后一次性执行callback + // if( !this.worklogCallbackList )this.worklogCallbackList = []; + // Promise.resolve( o2.Actions.load("x_processplatform_assemble_surface").WorkLogAction.listWithJob( this.businessData.data.$work.job )).then(function(json){ + // this.workLogList = json.data; + // debugger; + // while( this.worklogCallbackList.length ){ + // this.worklogCallbackList.shift()( this.workLogList ); + // } + // }.bind(this)); + // this.worklogCallbackList.push( callback ); + // }, + // //列式流程record + // listWorkRecord: function ( callback ) { + // if( !this.businessData.data.$work || !this.businessData.data.$work.job ){ + // callback([]); + // return + // } + // + // if( this.workRecordList ){ + // callback(this.workRecordList); + // return; + // } + // + // //只获取一次。把callback存起来,等异步调用完成后一次性执行callback + // if( !this.workRecordCallbackList )this.workRecordCallbackList = []; + // Promise.resolve( o2.Actions.load("x_processplatform_assemble_surface").RecordAction.listWithJob( this.businessData.data.$work.job )).then(function(json){ + // this.workRecordList = json.data; + // while( this.workRecordCallbackList.length ){ + // this.workRecordCallbackList.shift()( this.workRecordList ); + // } + // }.bind(this)); + // this.workRecordCallbackList.push( callback ); + // } + + + }); diff --git a/o2web/source/x_component_cms_Xform/ProcessActionbar.js b/o2web/source/x_component_cms_Xform/ProcessActionbar.js index 991c0d98e50f7259ce936ae51c167e6f799dcd9c..923a84c8f46d5337d04ba6010fa2e1c4e2b4109c 100644 --- a/o2web/source/x_component_cms_Xform/ProcessActionbar.js +++ b/o2web/source/x_component_cms_Xform/ProcessActionbar.js @@ -126,6 +126,9 @@ MWF.xApplication.cms.Xform.ProcessActionbar = MWF.CMSProcessActionbar = new Cla publishDocument: function(){ this.form.publishDocument(); }, + publishDocumentDelayed: function(){ + this.form.publishDocumentDelayed(); + }, archiveDocument: function(){ this.form.archiveDocument(); }, diff --git a/o2web/source/x_component_cms_Xform/lp/en.js b/o2web/source/x_component_cms_Xform/lp/en.js index cefbd5bb933038a6edd8c9a90e46ac1b16945da3..18dd149b879ba9284360c72e845c6e50cfcdae88 100644 --- a/o2web/source/x_component_cms_Xform/lp/en.js +++ b/o2web/source/x_component_cms_Xform/lp/en.js @@ -6,7 +6,7 @@ MWF.xApplication.cms.Xform = MWF.xApplication.cms.Xform || {}; MWF.xApplication.cms.Xform.LP = Object.merge({}, MWF.xApplication.process.Xform.LP, { "dataSaved": "Data saved successfully", "documentPublished": "Published successfully", - + "documentDelayedPublished": "Timed Published Successfully", "noSelectRange": "Cannot determine the selection range", @@ -83,6 +83,8 @@ MWF.xApplication.cms.Xform.LP = Object.merge({}, MWF.xApplication.process.Xform "saveTitle": "Save Document", "publish": "Publish", "publishTitle": "Publish Document", + "publishDelayed": "Timed publishing", + "publishDelayedTitle": "Publish the document regularly", "saveDraft": "Save Draft", "saveDraftTitle": "Save Draft", "popular": "Set focus document", diff --git a/o2web/source/x_component_cms_Xform/lp/zh-cn.js b/o2web/source/x_component_cms_Xform/lp/zh-cn.js index fde443eef51cd83bfff5f3279b0e7307f8c3211b..a608719b871b4fa9d9f79c08dc48473aec498852 100644 --- a/o2web/source/x_component_cms_Xform/lp/zh-cn.js +++ b/o2web/source/x_component_cms_Xform/lp/zh-cn.js @@ -6,7 +6,7 @@ MWF.xApplication.cms.Xform = MWF.xApplication.cms.Xform || {}; MWF.xApplication.cms.Xform.LP = Object.merge({}, MWF.xApplication.process.Xform.LP, { "dataSaved": "数据保存成功", "documentPublished" : "发布成功" , - + "documentDelayedPublished": "定时发布成功", "noSelectRange": "无法确定选择范围", @@ -83,6 +83,8 @@ MWF.xApplication.cms.Xform.LP = Object.merge({}, MWF.xApplication.process.Xform. "saveTitle": "保存文档", "publish": "发布", "publishTitle": "发布文档", + "publishDelayed": "定时发布", + "publishDelayedTitle": "定时发布文档", "saveDraft": "保存草稿", "saveDraftTitle": "保存草稿", "popular": "设置热点", diff --git a/o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/submitDelayed.png b/o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/submitDelayed.png new file mode 100644 index 0000000000000000000000000000000000000000..14bb695f9c819b00053f3b02d194d28a31168eeb Binary files /dev/null and b/o2web/source/x_component_process_FormDesigner/widget/$ActionsEditor/default/tools/submitDelayed.png differ