From 0c2ba1fbb6cc37ff892f848327769a44533ca4e8 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 23 Sep 2011 11:49:37 -0400 Subject: [PATCH] Fix for Bug 5898 - search to hold feature not clearing Search to hold cookie is now cleared when the user loads a blank circulation page and when the user logs out. The user also now has the option to "forget" the current search to hold patron by choosing an option from the search to hold menu on the search results page. Signed-off-by: Liz Rea Tested: Forget from search to hold results clears cookie Logging out clears the cookie - testing note: i had to clear my cookies and test fresh before this would work Loading a blank circulation page (Check Out from the circulation-home) clears the cookie. Signed-off-by: Paul Poulain --- .../intranet-tmpl/prog/en/css/staff-global.css | 12 ++++++++++ .../intranet-tmpl/prog/en/includes/header.inc | 4 +- koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 4 +++ .../prog/en/modules/catalogue/results.tt | 22 ++++++++++++++++--- .../prog/en/modules/circ/circulation.tt | 2 +- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 8784694..7b38062 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -436,6 +436,11 @@ div#toolbar { margin-bottom : .7em; } +div#toolbar .yui-menu-button button, +div#toolbar .yui-button-button button { + line-height : 1.7em; +} + ul.toolbar { padding-left : 0; } @@ -948,6 +953,8 @@ fieldset.rows .inputnote { background-repeat : no-repeat; } +#placeholdc #yui-gen13 { border-top : 1px solid #CCCCCC; margin-top : .3em; } + #holdfor .first-child { padding-left : 17px; } #editmenuc .first-child, #deleteshelf .first-child,#newmenuc .first-child, #addbiblio .first-child, #z3950search .first-child, #printmenuc .first-child, #newsupplier .first-child, #savemenuc .first-child, #budgets_menuc .first-child, #periods_menuc .first-child { @@ -1492,6 +1499,11 @@ html>/**/body #searchheader button, x:-moz-any-link, x:default { padding : 5px 25em 0 0; } +#searchheader .yui-button button, +#searchheader .yui-button a { + line-height : 1.5em; +} + #search-facets ul { margin : 0; padding : .3em; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc index 1faf0ca..24d1104 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc @@ -65,9 +65,9 @@ [% loggedinusername %] [% IF ( intranetbookbag ) %] - (Log Out) | + (Log Out) | [% ELSE %] - (Log Out) | + (Log Out) | [% END %] [% ELSE %] You are not logged in | diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index 463c28e..f491773 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -89,3 +89,7 @@ function checkEnter(e){ //e is event object passed from function invocation return true; } } + +function clearHoldFor(){ + $.cookie("holdfor",null, { path: "/", expires: 0 }); +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index 7a1039d..2bed51c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -136,6 +136,20 @@ function placeHold () { $("#hold_form").submit(); return false; } + +function forgetPatron(){ + $.cookie("holdfor",null, { path: "/", expires: 0 }); + $(".holdforlink").remove(); + $("#placeholdc").empty(); + new YAHOO.widget.Button({ + id: "placehold", + type: "button", + label: _("Place hold"), + container: "placeholdc", + onclick: { fn: placeHold } + }); +} + function addToList () { var checkedItems = $(".selection:checked"); if ($(checkedItems).size() == 0) { @@ -181,8 +195,8 @@ YAHOO.util.Event.onContentReady("searchheader", function () { } var HoldForButtonMenu = [ { text: "Place hold", onclick: { fn: holdFor }}, - { text: "Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])", onclick: { fn: holdForPatron }} - ]; + { text: "Place hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])", onclick: { fn: holdForPatron }}, + { text: "Forget [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])", onclick: { fn: forgetPatron }}]; var HoldForButton = new YAHOO.widget.Button({ type: "split", @@ -195,7 +209,7 @@ YAHOO.util.Event.onContentReady("searchheader", function () { [% ELSE %] new YAHOO.widget.Button({ id: "placehold", - type: "link", + type: "button", label: _("Place hold"), container: "placeholdc", onclick: { fn: placeHold } @@ -499,7 +513,7 @@ YAHOO.util.Event.onContentReady("searchheader", function () { No holds allowed [% ELSE %] Holds - [% IF ( holdfor ) %] | Hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])[% END %] + [% IF ( holdfor ) %] | Hold for [% holdfor_firstname %] [% holdfor_surname %] ([% holdfor_cardnumber %])[% END %] [% END %] [% IF ( CAN_user_editcatalogue_edit_catalogue ) %] | Edit record diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index ff1b015..385579c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -9,7 +9,7 @@