diff --git a/o2web/source/o2_core/o2.js b/o2web/source/o2_core/o2.js index 6ca6a6f50ccda407b1d81d14981e11e0db5413a6..e0f63e14d3dc72b2ef58cd42f7faf3861b540409 100644 --- a/o2web/source/o2_core/o2.js +++ b/o2web/source/o2_core/o2.js @@ -1451,7 +1451,7 @@ if (!window.Promise){ } //Content-Type application/x-www-form-urlencoded; charset=utf-8 res.send(data); - }.bind(this)); + }.bind(this)).catch(function(){}); //var oReturn = (callback.success && callback.success.isAG) ? callback.success : callback; var oReturn = p; diff --git a/o2web/source/x_component_portal_Portal/Main.js b/o2web/source/x_component_portal_Portal/Main.js index 24b5862550aa5c5ada0028487ef2f7514fe44bdc..6ace05a1c386d344fadf38f5bd7e8244a778e14f 100644 --- a/o2web/source/x_component_portal_Portal/Main.js +++ b/o2web/source/x_component_portal_Portal/Main.js @@ -152,26 +152,31 @@ MWF.xApplication.portal.Portal.Main = new Class({ }.bind(this)); } }, + openPage: function(pageJson, par, callback){ + this.setTitle((this.portal && this.portal.name) ? this.portal.name+"-"+pageJson.data.page.name : pageJson.data.page.name); + if (pageJson.data.page){ + this.page = (pageJson.data.page.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.page.data)): null; + this.relatedFormMap = pageJson.data.relatedWidgetMap; + this.relatedScriptMap = pageJson.data.relatedScriptMap; + delete pageJson.data.page.data; + this.pageInfor = pageJson.data.page; + }else{ + this.page = (pageJson.data.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.data)): null; + delete pageJson.data.data; + this.pageInfor = pageJson.data; + } + this.openPortal(par, callback); + }, loadPortalPage: function(par, callback){ var pageJson = null; var loadModuleFlag = false; var check = function(){ if (!!pageJson && loadModuleFlag){ this.pageJson = pageJson; - layout.sessionPromise.finally(function(){ - this.setTitle((this.portal && this.portal.name) ? this.portal.name+"-"+pageJson.data.page.name : pageJson.data.page.name); - if (pageJson.data.page){ - this.page = (pageJson.data.page.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.page.data)): null; - this.relatedFormMap = pageJson.data.relatedWidgetMap; - this.relatedScriptMap = pageJson.data.relatedScriptMap; - delete pageJson.data.page.data; - this.pageInfor = pageJson.data.page; - }else{ - this.page = (pageJson.data.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.data)): null; - delete pageJson.data.data; - this.pageInfor = pageJson.data; - } - this.openPortal(par, callback); + layout.sessionPromise.then(function(){ + this.openPage(pageJson, par, callback); + }.bind(this), function(){ + this.openPage(pageJson, par, callback); }.bind(this)); } }.bind(this); diff --git a/o2web/source/x_component_process_Xform/$Input.js b/o2web/source/x_component_process_Xform/$Input.js index f049f83994c7f231aa0c42f54611ce41f87b3ded..4296b41e821bc0dd7e3cd41fe38d87d33c1f2b7a 100644 --- a/o2web/source/x_component_process_Xform/$Input.js +++ b/o2web/source/x_component_process_Xform/$Input.js @@ -207,10 +207,12 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({ if (!!value && o2.typeOf(value.then)=="function"){ var p = o2.promiseAll(value).then(function(v){ this.__setValue(v); - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; p.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); }else{ this.moduleValueAG = null; @@ -306,10 +308,12 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({ if (!!data && o2.typeOf(data.then)=="function"){ var p = o2.promiseAll(data).then(function(v){ this.__setValue(v); - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; p.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); }else{ this.moduleValueAG = null; diff --git a/o2web/source/x_component_process_Xform/Calendar.js b/o2web/source/x_component_process_Xform/Calendar.js index 96585b39fe96bbc2f4c51d51b506256a01f126fa..60546a30f206c24bb15c2bb174483f170991c801 100644 --- a/o2web/source/x_component_process_Xform/Calendar.js +++ b/o2web/source/x_component_process_Xform/Calendar.js @@ -27,7 +27,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar = new Class({ if (value && value.isAG){ return value.then(function(v){ this._getValueAg(v, isDate); - }.bind(this)); + }.bind(this), function(){}); }else{ var d = (!!value) ? Date.parse(value) : ""; if (isDate){ diff --git a/o2web/source/x_component_process_Xform/Checkbox.js b/o2web/source/x_component_process_Xform/Checkbox.js index 69e31c15f819c38d293164527c06b4fb4a710042..3ffe2e469259fd7ddb9479e53ac38515b434a637 100644 --- a/o2web/source/x_component_process_Xform/Checkbox.js +++ b/o2web/source/x_component_process_Xform/Checkbox.js @@ -152,10 +152,12 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class({ }.bind(this)); } - }.bind(this)); + }.bind(this), function(){}); this.moduleSelectAG = p; if (p) p.then(function(){ this.moduleSelectAG = null; + }.bind(this), function(){ + this.moduleSelectAG = null; }.bind(this)); }, @@ -169,15 +171,17 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class({ this.moduleSelectAG.then(function(){ this[mothed](v); return v; - }.bind(this)); + }.bind(this), function(){}); }else{ this[mothed](v) } return v; - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); }else{ this[mothed](value); diff --git a/o2web/source/x_component_process_Xform/DatagridMobile.js b/o2web/source/x_component_process_Xform/DatagridMobile.js index 30f4a464418d1a03dbe40b0f30787cd8601e73ea..dc5fb3a7b5380d618b77925a65f0d3219bc2b0b5 100644 --- a/o2web/source/x_component_process_Xform/DatagridMobile.js +++ b/o2web/source/x_component_process_Xform/DatagridMobile.js @@ -199,10 +199,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({ this.__loadReadDatagrid(callback); this.moduleValueAG = null; return v; - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); // if (this.gridData && this.gridData.isAG){ @@ -310,10 +312,14 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({ this.__loadEditDatagrid(callback); this.moduleValueAG = null; return v; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); @@ -1319,10 +1325,14 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({ this.__setData(data); this.moduleValueAG = null; return v; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); // if (data && data.isAG){ diff --git a/o2web/source/x_component_process_Xform/DatagridPC.js b/o2web/source/x_component_process_Xform/DatagridPC.js index 90d494764f06d38bb94e56637066b4ba5e9b7f75..a3efe4ccc100f6035e181874af8eb512ff5eef6d 100644 --- a/o2web/source/x_component_process_Xform/DatagridPC.js +++ b/o2web/source/x_component_process_Xform/DatagridPC.js @@ -121,10 +121,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({ this.__loadEditDatagrid(callback); this.moduleValueAG = null; return v; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); // if (this.gridData && this.gridData.isAG){ // this.moduleValueAG = this.gridData; @@ -827,10 +831,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({ this.__loadReadDatagrid(callback); this.moduleValueAG = null; return v; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); // if (this.gridData && this.gridData.isAG){ @@ -1093,10 +1101,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({ this.__setData(data); this.moduleValueAG = null; return v; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); // if (data && data.isAG){ diff --git a/o2web/source/x_component_process_Xform/Label.js b/o2web/source/x_component_process_Xform/Label.js index 0ddf06fb119362517ec5f0cf9fce8f0afd8a70e3..9b2355fdddd47837ee0be021e03c43adf382672a 100644 --- a/o2web/source/x_component_process_Xform/Label.js +++ b/o2web/source/x_component_process_Xform/Label.js @@ -51,7 +51,7 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel = new Class({ }else{ o2.promiseAll(value).then(function(v){ this.node.set("text", v || ""); - }.bind(this)); + }.bind(this), function(){}); //this.node.set("text", value || ""); } }, @@ -59,7 +59,7 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel = new Class({ if (!!text){ o2.promiseAll(text).then(function(v){ this.node.set("text", v || ""); - }.bind(this)); + }.bind(this), function(){}); }else{ this.node.set("text", v || ""); } diff --git a/o2web/source/x_component_process_Xform/Org.js b/o2web/source/x_component_process_Xform/Org.js index 55b21e7f97251df2b6ad63a53d16c6f810074648..15e3a17e07ee15965f918cafc4f77385314c615e 100644 --- a/o2web/source/x_component_process_Xform/Org.js +++ b/o2web/source/x_component_process_Xform/Org.js @@ -95,7 +95,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({ if (o2.typeOf(v)=="function"){ return v.then(function(re){ this._valueMerge(values, re) - }.bind(this)); + }.bind(this), function(){}); }else{ return values.concat(v); } @@ -133,9 +133,9 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({ }); return arr; }.bind(this)).catch(function(){ - console.log("catch error : get duty") + console.log("catch error : can not get duty : " + duty.name, + "-" + uName); }); - }.bind(this)); + }.bind(this), function(){}); values.push(promise); } }.bind(this)); @@ -884,7 +884,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({ promise.then(function(values){ o2.promiseAll(values).then(function(v){ this.checkChange(oldValues, v) - }.bind(this)); + }.bind(this), function(){}); // if (values && values.isAG){ // values.then(function(v){ @@ -893,7 +893,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({ // }else{ // this.checkChange(oldValues, values) // } - }.bind(this)); + }.bind(this), function(){}); }, // __setData: function(value){ // if (!value) return false; @@ -1058,17 +1058,19 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({ flag = true; this.__setValue(values); return values; - }.bind(this)); + }.bind(this), function(){}); }else{ flag = true; this.__setValue(values); return values } - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; if (p) p.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); return p; diff --git a/o2web/source/x_component_process_Xform/Radio.js b/o2web/source/x_component_process_Xform/Radio.js index 1f0c609afaa1cc09881a810b6bc84692972e32ed..3167edfb785fa90ec01ac329f32a14a136914a3f 100644 --- a/o2web/source/x_component_process_Xform/Radio.js +++ b/o2web/source/x_component_process_Xform/Radio.js @@ -158,10 +158,14 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class({ }.bind(this)); }.bind(this)); } + }.bind(this), function(){ + this.moduleSelectAG = null; }.bind(this)); this.moduleSelectAG = p; if (p) p.then(function(){ this.moduleSelectAG = null; + }.bind(this), function(){ + this.moduleSelectAG = null; }.bind(this)); // this.moduleSelectAG = o2.AG.all(optionItems).then(function(radioValues){ @@ -228,16 +232,18 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class({ this.moduleSelectAG.then(function(){ this[mothed](v); return v; - }.bind(this)); + }.bind(this), function(){}); }else{ this[mothed](v) } return v; - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); }else{ this[mothed](value); diff --git a/o2web/source/x_component_process_Xform/Select.js b/o2web/source/x_component_process_Xform/Select.js index 396bf9c38c198ba6b31fc52fa71d1055031e490c..2913c20d700073305cd2b1dbd62729c6eadee0e7 100644 --- a/o2web/source/x_component_process_Xform/Select.js +++ b/o2web/source/x_component_process_Xform/Select.js @@ -154,10 +154,14 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class({ }.bind(this)); this.fireEvent("setOptions", [options]) } + }.bind(this), function(){ + this.moduleSelectAG = null; }.bind(this)); this.moduleSelectAG = p; if (p) p.then(function(){ this.moduleSelectAG = null; + }.bind(this), function(){ + this.moduleSelectAG = null; }.bind(this)); // this.moduleSelectAG = o2.AG.all(optionItems).then(function(options){ @@ -216,16 +220,18 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class({ this.moduleSelectAG.then(function(){ this[mothed](v); return v; - }.bind(this)); + }.bind(this), function(){}); }else{ this[mothed](v) } return v; - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; if (this.moduleValueAG) this.moduleValueAG.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); }else{ this[mothed](value); diff --git a/o2web/source/x_component_process_Xform/Textarea.js b/o2web/source/x_component_process_Xform/Textarea.js index 233113088aa6d18fa3788378439c2ce6045781d8..9120bfcefa5cdb85df1a47dc7b4bab1101ad1763 100644 --- a/o2web/source/x_component_process_Xform/Textarea.js +++ b/o2web/source/x_component_process_Xform/Textarea.js @@ -41,10 +41,12 @@ MWF.xApplication.process.Xform.Textarea = MWF.APPTextarea = new Class({ this.node.set("html", text); } //this.__setValue(v); - }.bind(this)); + }.bind(this), function(){}); this.moduleValueAG = p; p.then(function(){ this.moduleValueAG = null; + }.bind(this), function(){ + this.moduleValueAG = null; }.bind(this)); // this.moduleValueAG = o2.AG.all(value).then(function(v){ diff --git a/o2web/source/x_desktop/cmsdocMobile.html b/o2web/source/x_desktop/cmsdocMobile.html index a28de83d8d4bfd2ce394c5ef345e6d6232ad9bf2..fe9bfda3a11bde376694f66f20cb66438ebf2b33 100644 --- a/o2web/source/x_desktop/cmsdocMobile.html +++ b/o2web/source/x_desktop/cmsdocMobile.html @@ -22,7 +22,7 @@ -
+
- \ No newline at end of file + diff --git a/o2web/source/x_desktop/cmspreview.html b/o2web/source/x_desktop/cmspreview.html index b5a6fad3d373a7f9940a2efd0ed3419dfbf1ba93..b82fe63c7e7fd6b0496691fb91a75393471665c5 100644 --- a/o2web/source/x_desktop/cmspreview.html +++ b/o2web/source/x_desktop/cmspreview.html @@ -86,7 +86,7 @@ -
+
diff --git a/o2web/source/x_desktop/js/app.js b/o2web/source/x_desktop/js/app.js index 5fdcf4a9d2b3c6a85f783af6fd216e67dafe3b3f..42e60bf6142bc7bf3351f932e8f82d7e6d83e3cc 100644 --- a/o2web/source/x_desktop/js/app.js +++ b/o2web/source/x_desktop/js/app.js @@ -33,7 +33,7 @@ layout.addReady(function(){ if (layout.sessionPromise){ layout.sessionPromise.then(function(){ _load(); - }); + },function(){}); } } diff --git a/o2web/source/x_desktop/js/base.js b/o2web/source/x_desktop/js/base.js index 04942b76fe26a3ee3626a56f1148e93033fcbdec..04fb9d2309ce5bc892b6c5bd636f03ed5629e6a9 100644 --- a/o2web/source/x_desktop/js/base.js +++ b/o2web/source/x_desktop/js/base.js @@ -490,14 +490,8 @@ o2.addReady(function () { layout.sessionPromise = new Promise(function(resolve, reject){ o2.Actions.get("x_organization_assemble_authentication").getAuthentication(function (json) { if (resolve) resolve(json.data); - //this.status = "fulfilled"; - // this.resolveReturn = json.data; - // this.runResolve(this.resolveReturn); }.bind(this), function (xhr, text, error) { if (reject) reject({"xhr": xhr, "text": text, "error": error}); - // this.status = "rejected"; - // this.resolveReturn = {"xhr": xhr, "text": text, "error": error}; - // this.runReject(this.resolveReturn); }.bind(this)); }); diff --git a/o2web/source/x_desktop/js/printCMSDoc.js b/o2web/source/x_desktop/js/printCMSDoc.js index 7c0436a7dac556631b6bb00f55b11e6d3e5c57d4..b8d522d512882ebdba34c0787c07eddb6310f768 100644 --- a/o2web/source/x_desktop/js/printCMSDoc.js +++ b/o2web/source/x_desktop/js/printCMSDoc.js @@ -37,7 +37,7 @@ layout.addReady(function(){ if (layout.sessionPromise){ layout.sessionPromise.then(function(){ _load(); - }); + },function(){}); } } })(layout); diff --git a/o2web/source/x_desktop/js/printWork.js b/o2web/source/x_desktop/js/printWork.js index cf5d27fbad514542eabb13e57bcf35494f551ecc..eb8c0ec10e29ad914b7a250b5ac88ec1f0161afd 100644 --- a/o2web/source/x_desktop/js/printWork.js +++ b/o2web/source/x_desktop/js/printWork.js @@ -124,7 +124,7 @@ layout.addReady(function(){ if (layout.sessionPromise){ layout.sessionPromise.then(function(){ _load(); - }); + },function(){}); } } })(layout); diff --git a/o2web/source/x_desktop/js/x.js b/o2web/source/x_desktop/js/x.js index f1d6fd8d82332cae5c3cc3be3fcaff304a30eb51..4500658e948fa92ded98b0bc4a19248a63539737 100644 --- a/o2web/source/x_desktop/js/x.js +++ b/o2web/source/x_desktop/js/x.js @@ -37,16 +37,15 @@ layout.addReady(function(){ }); }; - layout.sessionPromise.then(function(){ + if (layout.session && layout.session.user){ _load(); - }); - // if (layout.session && layout.session.user){ - // _load(); - // }else{ - // if (layout.sessionPromise){ - // - // } - // } + }else{ + if (layout.sessionPromise){ + layout.sessionPromise.then(function(){ + _load(); + },function(){}); + } + } })(layout); }); diff --git a/o2web/source/x_desktop/work.html b/o2web/source/x_desktop/work.html index c7f89c1e2fe1f39578f9d5bbe21d48957a186378..44915b2dafa103a2748292d7039745aa33e27ab5 100644 --- a/o2web/source/x_desktop/work.html +++ b/o2web/source/x_desktop/work.html @@ -8,7 +8,7 @@ -
+
diff --git a/o2web/source/x_desktop/workmobile.html b/o2web/source/x_desktop/workmobile.html index ad82b99d9d2ad7aa38df7c80f0923b0852e7655a..875d0049b7e019023fa94429dcb2cc37904f4aaf 100644 --- a/o2web/source/x_desktop/workmobile.html +++ b/o2web/source/x_desktop/workmobile.html @@ -18,7 +18,7 @@
-
+
diff --git a/o2web/source/x_desktop/workmobilewithaction.html b/o2web/source/x_desktop/workmobilewithaction.html index e9f2fb8e8af7351eb2f4efb77a02e27033df6eee..0be33e78c94948cd9f7096f35d328346ab4dcf3e 100644 --- a/o2web/source/x_desktop/workmobilewithaction.html +++ b/o2web/source/x_desktop/workmobilewithaction.html @@ -23,7 +23,7 @@
-
+