diff --git a/o2web/source/x_component_process_Work/Main.js b/o2web/source/x_component_process_Work/Main.js index 44687b6d130356e73ec796007607df1b4987b5e6..e89a7cf64819419d222e111785b0ef57da52b676 100644 --- a/o2web/source/x_component_process_Work/Main.js +++ b/o2web/source/x_component_process_Work/Main.js @@ -388,9 +388,21 @@ MWF.xApplication.process.Work.Main = new Class({ this.parseData(workData, control, json_form.data, [], [], []); if (this.mask) this.mask.hide(); - //if (layout.mobile) this.loadMobileActions(); - this.openWork(); - this.unLoading(); + + if (layout.session && layout.session.user){ + this.openWork(); + this.unLoading(); + }else{ + if (layout.sessionPromise){ + layout.sessionPromise.then(function(){ + this.openWork(); + this.unLoading(); + }.bind(this), function(){}); + } + } + + // this.openWork(); + // this.unLoading(); } }.bind(this), "failure": function(){}}, [work.form, work.application]); diff --git a/o2web/source/x_desktop/js/base.js b/o2web/source/x_desktop/js/base.js index af724ce0cc29ba9dddb6b0f87d2873b53e34702d..2ec8af8aeff2ad7d1081f4736d31293e07d30874 100644 --- a/o2web/source/x_desktop/js/base.js +++ b/o2web/source/x_desktop/js/base.js @@ -122,6 +122,18 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) { return false; }; var _openWorkHTML = function (options) { + // var uri = new URI(window.location.href); + // var redirectlink = uri.getData("redirectlink"); + // if (!redirectlink) { + // redirectlink = encodeURIComponent(locate.pathname + locate.search); + // } else { + // redirectlink = encodeURIComponent(redirectlink); + // } + // if (options.workId) { + // window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workid=" + options.workId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink); + // } else if (options.workCompletedId) { + // window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workcompletedid=" + options.workCompletedId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink); + // } var uri = new URI(window.location.href); var redirectlink = uri.getData("redirectlink"); if (!redirectlink) { @@ -129,11 +141,19 @@ o2.xDesktop.requireApp = function (module, clazz, callback, async) { } else { redirectlink = encodeURIComponent(redirectlink); } - if (options.workId) { - window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workid=" + options.workId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink); - } else if (options.workCompletedId) { - window.location = o2.filterUrl("../x_desktop/workmobilewithaction.html?workcompletedid=" + options.workCompletedId + ((layout.debugger) ? "&debugger" : "") + "&redirectlink=" + redirectlink); + var docurl = "../x_desktop/workmobilewithaction.html".toURI(); + if (options.draft){ + var par = "draft="+encodeURIComponent(JSON.stringify(options.draft)); + docurl = "../x_desktop/workmobilewithaction.html?" + par; + }else{ + docurl = docurl.setData(options).toString(); } + var job = (options.jobid || options.jobId || options.job); + if (job) docurl += ((docurl.indexOf("?")!=-1) ? "&" : "?") + "jobid="+job; + docurl += ((redirectlink) ? "&redirectlink=" + redirectlink : ""); + docurl +=((layout.debugger) ? "&debugger" : ""); + + window.location = o2.filterUrl(docurl); }; var _openWork = function (options) { if (!_openWorkAndroid(options)) if (!_openWorkIOS(options)) _openWorkHTML(options);