From d139d400b11e76f19ed208d4898d57f678acf9f4 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 5 Oct 2011 09:53:02 -0400 Subject: [PATCH] Fix for Bug 6970 - logout not redirecting to login page For some reason the latest version of Firefox doesn't like the javascript which empties the cart on logout. As Ian points out, there is code which tries to redirect to "about:blank" and close the window (since the main context of the function is the Cart's popup window. This patch adds a parameter to the delBasket function so that we can pass a "popup" context to the function and choose whether or not we want to ask JS to close the window. Signed-off-by: Nicole C. Engard Signed-off-by: Chris Cormack --- .../intranet-tmpl/prog/en/includes/header.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/js/basket.js | 15 ++++++++++----- .../prog/en/modules/basket/basket.tt | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 24d1104e97..b43330c2af 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -65,7 +65,7 @@ [% loggedinusername %] [% IF ( intranetbookbag ) %] - (Log Out) | + (Log Out) | [% ELSE %] (Log Out) | [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js index 9946cf752c..3a09f64a0c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js @@ -299,15 +299,20 @@ function delRecord (n, s) { } -function delBasket(rep) { +function delBasket(context,rep) { if (rep == undefined){ rep = confirm(MSG_CONFIRM_DEL_BASKET); } if (rep) { - delCookie(nameCookie); - document.location = "about:blank"; - updateBasket(0,top.opener); - window.close(); + if(context == "popup"){ + delCookie(nameCookie); + document.location = "about:blank"; + updateBasket(0,top.opener); + window.close(); + } else { + delCookie(nameCookie); + updateBasket(0,top.opener); + } } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt index 38b25e2e5d..08960758e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -103,7 +103,7 @@ function placeHold () {
  • - Empty and Close + Empty and Close
  • -- 2.39.5