diff --git a/gulliver/js/ext/min/ext-all.js b/gulliver/js/ext/min/ext-all.js index 5ef5532a2..157fc1e90 100644 --- a/gulliver/js/ext/min/ext-all.js +++ b/gulliver/js/ext/min/ext-all.js @@ -69,8 +69,8 @@ function getBrowserTimeZoneOffset() {return-1*((new Date()).getTimezoneOffset()*60);} function setExtStateManagerSetProvider(cache,additionalPrefix){var workspace='ws-undefined';var pathname=location.pathname.split('/');var cookieProvider=new Ext.state.CookieProvider();var i;if(additionalPrefix===undefined){additionalPrefix='';} if(pathname.length>1){workspace=pathname[1].replace('sys','');} -workspace=workspace+additionalPrefix;cookieProvider.on('statechange',function(provider,key,value){if(value!==null&&JSON.stringify(Ext.state.Manager.get(workspace+cache))!==JSON.stringify(value)){Ext.state.Manager.set(workspace+cache,value);}});Ext.state.Manager.setProvider(cookieProvider);Ext.state.Manager.clear(cache);try{if(window.extJsViewState!==undefined){for(i in extJsViewState){Ext.state.Manager.clear(i);} -Ext.state.Manager.set(cache,Ext.state.Manager.getProvider().decodeValue(extJsViewState[workspace+cache]));}}catch(e){}} +workspace=workspace+additionalPrefix;cookieProvider.on('statechange',function(provider,key,value){if(value!==null&&JSON.stringify(Ext.state.Manager.get(workspace+window.userUid+cache))!==JSON.stringify(value)){Ext.state.Manager.set(workspace+window.userUid+cache,value);}});Ext.state.Manager.setProvider(cookieProvider);Ext.state.Manager.clear(cache);try{if(window.extJsViewState!==undefined){for(i in extJsViewState){Ext.state.Manager.clear(i);} +Ext.state.Manager.set(cache,Ext.state.Manager.getProvider().decodeValue(extJsViewState[workspace+window.userUid+cache]));}}catch(e){}} function downloadFile(method,url,headers,formData,callBack){var xhr,win=window,value='blob',loadingFile=new Ext.LoadMask(Ext.getBody(),{msg:_('ID_LOADING')});method=method||'POST';loadingFile.show();if(win.XMLHttpRequest){xhr=new XMLHttpRequest();}else if(win.ActiveXObject){xhr=new ActiveXObject('Microsoft.XMLHTTP');} win.URL=win.URL||win.webkitURL;xhr.open(method,url,true);xhr.responseType=value;Object.keys(headers).forEach(function(key){xhr.setRequestHeader(key,headers[key]);});xhr.onload=function(e){loadingFile.hide();if(xhr.status===200){if(xhr.getResponseHeader("Content-Disposition")!==null){var fileName=xhr.getResponseHeader("Content-Disposition").match(/\sfilename="([^"]+)"(\s|$)/)[1];var blob=xhr.response;if((navigator.userAgent.indexOf("MSIE")!==-1)||(navigator.userAgent.indexOf("Trident")!==-1)||(navigator.userAgent.indexOf("Edge")!==-1)){win.navigator.msSaveBlob(blob,fileName);}else{var doc=win.document,a=doc.createElementNS('http://www.w3.org/1999/xhtml','a'),event=doc.createEvent('MouseEvents');event.initMouseEvent('click',true,false,win,0,0,0,0,0,false,false,false,false,0,null);a.href=win.URL.createObjectURL(blob);a.download=fileName;a.dispatchEvent(event);} if(typeof(callBack)!=='undefined'){callBack(xhr);}}else{PMExt.error(_('ID_ERROR'),_('ID_UNEXPECTED_ERROR_OCCURRED_PLEASE'));}}else{PMExt.error(_('ID_ERROR'),xhr.statusText);}};xhr.send(formData);} diff --git a/gulliver/js/ext/pmos-common.js b/gulliver/js/ext/pmos-common.js index 8a774e61d..d75b8b77c 100644 --- a/gulliver/js/ext/pmos-common.js +++ b/gulliver/js/ext/pmos-common.js @@ -609,8 +609,8 @@ function setExtStateManagerSetProvider(cache, additionalPrefix) { } workspace = workspace + additionalPrefix; cookieProvider.on('statechange', function (provider, key, value) { - if (value !== null && JSON.stringify(Ext.state.Manager.get(workspace + cache)) !== JSON.stringify(value)) { - Ext.state.Manager.set(workspace + cache, value); + if (value !== null && JSON.stringify(Ext.state.Manager.get(workspace + window.userUid + cache)) !== JSON.stringify(value)) { + Ext.state.Manager.set(workspace + window.userUid + cache, value); } }); Ext.state.Manager.setProvider(cookieProvider); @@ -620,7 +620,7 @@ function setExtStateManagerSetProvider(cache, additionalPrefix) { for (i in extJsViewState) { Ext.state.Manager.clear(i); } - Ext.state.Manager.set(cache, Ext.state.Manager.getProvider().decodeValue(extJsViewState[workspace + cache])); + Ext.state.Manager.set(cache, Ext.state.Manager.getProvider().decodeValue(extJsViewState[workspace + window.userUid + cache])); } } catch (e) { } diff --git a/gulliver/system/class.headPublisher.php b/gulliver/system/class.headPublisher.php index 8204a05e0..b153f05a7 100644 --- a/gulliver/system/class.headPublisher.php +++ b/gulliver/system/class.headPublisher.php @@ -746,11 +746,11 @@ class headPublisher * * @return array $views */ - public function getExtJsViewState() + public function getExtJsViewState($userUid = '') { $json = new stdClass(); $views = array(); - $keyState = "extJsViewState"; + $keyState = "extJsViewState" . $userUid; $prefixExtJs = "ys-"; $oServerConf = ServerConf::getSingleton(); $deleteCache = true; diff --git a/workflow/engine/methods/cases/casesListExtJs.php b/workflow/engine/methods/cases/casesListExtJs.php index 559698ee7..30adfce14 100644 --- a/workflow/engine/methods/cases/casesListExtJs.php +++ b/workflow/engine/methods/cases/casesListExtJs.php @@ -196,7 +196,8 @@ $oHeadPublisher->addExtJsScript('app/main', true); $oHeadPublisher->addExtJsScript('cases/casesList', false); //adding a javascript file .js $oHeadPublisher->addContent('cases/casesListExtJs'); //adding a html file .html. $oHeadPublisher->assign('FORMATS', $c->getFormats()); -$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState()); +$oHeadPublisher->assign('userUid', $userUid); +$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState($userUid)); $oHeadPublisher->assign('isIE', Bootstrap::isIE()); $oHeadPublisher->assign('__OPEN_APPLICATION_UID__', $openApplicationUid);