
Hi there, please check your tabs!
+A browser instance of ProcessMaker is actually open. You can start only one at the time. + For more information: +
+ +diff --git a/workflow/engine/js/src/Register.js b/workflow/engine/js/src/Register.js index 15336890f..4610bd73d 100644 --- a/workflow/engine/js/src/Register.js +++ b/workflow/engine/js/src/Register.js @@ -1,3 +1,3 @@ PM.Sessions.register(); -localStorage.setItem('ID_BLOCKER_MSG', PM.Sessions.getCookie('PM-Warning')); \ No newline at end of file +PM.Sessions.setLabel('ID_BLOCKER_MSG', PM.Sessions.getCookie('PM-Warning')); \ No newline at end of file diff --git a/workflow/engine/js/src/Sessions.js b/workflow/engine/js/src/Sessions.js index c0599e4a2..e4ae2f89d 100644 --- a/workflow/engine/js/src/Sessions.js +++ b/workflow/engine/js/src/Sessions.js @@ -2,40 +2,41 @@ PM.Sessions = (function () { var Sessions = function () { if (window.location.pathname.indexOf("login") === -1 && window.location.pathname.indexOf("sysLogin") === -1 && - this.getCookie('PM-TabPrimary') != 101010010) { + this.getCookie('PM-TabPrimary') !== '101010010') { + this.isClose = (this.getLabel('mainWindowClose') === "true"); + if (this.isClose && parent.parent.parent.window.name === "") { + this.register(); + } this.checkTab(); } }; Sessions.prototype.register = function () { + this.setLabel('mainWindowClose', false); window.name = this.getCookie('PM-TabPrimary'); }; Sessions.prototype.checkTab = function () { var ieVersion, - msg; - if (parent.parent.parent.window.name !== this.getCookie('PM-TabPrimary') && parent.parent.parent.window.name.indexOf(this.getCookie('PM-TabPrimary')) === -1 ) { + msg, + win; + if (window.name === this.getCookie('PM-TabPrimary')) { + this.setLabel('mainWindowClose', false); + } + if (parent.parent.parent.window.name !== this.getCookie('PM-TabPrimary') && + parent.parent.parent.window.name.indexOf(this.getCookie('PM-TabPrimary')) === -1 ) { ieVersion = this.detectBrowser(); msg = this.getLabel('ID_BLOCKER_MSG'); - + win = window.open('', '_self', ''); if (ieVersion && ieVersion <= 11) { - window.open('', '_self', ''); - window.document.execCommand('Stop'); - if (confirm(msg)) { - window.close(); - } - } else if (ieVersion && ieVersion <= 12) { - window.open('', '_self', ''); - window.document.execCommand('Stop'); - if (confirm(msg)) { - window.close(); - } + win.document.execCommand('Stop'); + win.open("/errors/block.php","_self"); + } else if (ieVersion && ieVersion <= 13) { + win.document.execCommand('Stop'); + win.open("/errors/block.php","_self"); } else { - window.open('', '_self', ''); - window.stop(); - if (confirm(msg)) { - window.close(); - } + win.stop(); + win.open("/errors/block.php","_self"); } } }; @@ -105,14 +106,28 @@ PM.Sessions = (function () { this.createCookie(name,"",-1); }; - Sessions.prototype.setLabel = function(nameLabel) { - localStorage.setItem(nameLabel, _(nameLabel)); + Sessions.prototype.setLabel = function(nameLabel, labelValue) { + localStorage.setItem(nameLabel, labelValue); }; Sessions.prototype.getLabel = function(nameLabel) { return localStorage.getItem(nameLabel); }; + Sessions.prototype.addEventHandler = function (elem, eventType, handler) { + if (elem.addEventListener) + elem.addEventListener(eventType, handler, false); + else if (elem.attachEvent) + elem.attachEvent('on' + eventType, handler); + }; + + Sessions.prototype.isClose = false; + return new Sessions(); })(); +PM.Sessions.addEventHandler(window, "unload",function () { + if (window.name === PM.Sessions.getCookie('PM-TabPrimary')){ + PM.Sessions.setLabel('mainWindowClose', true); + } +}); \ No newline at end of file diff --git a/workflow/engine/methods/dashboard/main.php b/workflow/engine/methods/dashboard/main.php index e787bb328..4f15ac770 100644 --- a/workflow/engine/methods/dashboard/main.php +++ b/workflow/engine/methods/dashboard/main.php @@ -29,5 +29,8 @@ $G_ID_MENU_SELECTED = 'DASHBOARD'; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'view', 'dashboard/load' ); +$oHeadPublisher = & headPublisher::getSingleton(); +$oHeadPublisher->addScriptFile('/jscore/src/PM.js'); +$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js'); G::RenderPage( 'publish' ); diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index 2fee26017..a08c11c9a 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -413,7 +413,7 @@ try { } $configS = System::getSystemConfiguration('', '', SYS_SYS); - $activeSession = array_key_exists('session_block', $configS) ? !(int)$configS['session_block']:true; + $activeSession = isset($configS['session_block']) ? !(int)$configS['session_block']:true; if ($activeSession){ setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/'); } diff --git a/workflow/engine/methods/login/login.php b/workflow/engine/methods/login/login.php index b9edcfc8a..e234c041e 100755 --- a/workflow/engine/methods/login/login.php +++ b/workflow/engine/methods/login/login.php @@ -338,7 +338,7 @@ $flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword']) ? $oConf->aConfig['login_enableForgotPassword'] : 'off'; -setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'),'*'), time() + (24 * 60 * 60), SYS_CURRENT_URI); +setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_URI); setcookie("PM-TabPrimary", uniqid(), time() + (24 * 60 * 60), '/'); $oHeadPublisher->addScriptCode("var flagForgotPassword = '$flagForgotPassword';"); diff --git a/workflow/engine/methods/setup/main.php b/workflow/engine/methods/setup/main.php index 4e08f06d7..13a8807af 100755 --- a/workflow/engine/methods/setup/main.php +++ b/workflow/engine/methods/setup/main.php @@ -42,5 +42,8 @@ else { } $G_PUBLISH->AddContent( 'view', 'setup/main_Load' ); +$oHeadPublisher = & headPublisher::getSingleton(); +$oHeadPublisher->addScriptFile('/jscore/src/PM.js'); +$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js'); G::RenderPage( 'publish' ); diff --git a/workflow/engine/methods/strategicDashboard/main.php b/workflow/engine/methods/strategicDashboard/main.php index 20277d740..e239d2420 100644 --- a/workflow/engine/methods/strategicDashboard/main.php +++ b/workflow/engine/methods/strategicDashboard/main.php @@ -34,6 +34,9 @@ $G_ID_MENU_SELECTED = 'DASHBOARD+'; $G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'view', 'strategicDashboard/load' ); +$oHeadPublisher = & headPublisher::getSingleton(); +$oHeadPublisher->addScriptFile('/jscore/src/PM.js'); +$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js'); G::RenderPage( 'publish' ); diff --git a/workflow/engine/methods/users/myInfo.php b/workflow/engine/methods/users/myInfo.php index e9b23a245..62cf69fef 100755 --- a/workflow/engine/methods/users/myInfo.php +++ b/workflow/engine/methods/users/myInfo.php @@ -25,6 +25,9 @@ $G_MAIN_MENU = 'processmaker'; $G_ID_MENU_SELECTED = 'MY_ACCOUNT'; $G_PUBLISH = new Publisher(); +$oHeadPublisher = & headPublisher::getSingleton(); +$oHeadPublisher->addScriptFile('/jscore/src/PM.js'); +$oHeadPublisher->addScriptFile('/jscore/src/Sessions.js'); if (isset( $_GET['type'] )) { $G_PUBLISH->AddContent( 'view', 'users/usersReload' ); diff --git a/workflow/engine/skinEngine/neoclassic/block.php b/workflow/engine/skinEngine/neoclassic/block.php new file mode 100644 index 000000000..838647f2c --- /dev/null +++ b/workflow/engine/skinEngine/neoclassic/block.php @@ -0,0 +1,105 @@ + + + +
+ + + + + + + + + +
A browser instance of ProcessMaker is actually open. You can start only one at the time. + For more information: +
+ +