From 54c821a9e8df8a0cbc0a74a83fe605cd27cd40ac Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 1 Nov 2019 13:18:28 +0000 Subject: [PATCH] Bug 23944: (follow-up) Update circulation to use new library This patch updates the circulation page to use the new JavaScript Cookie library for cookie management. To test, apply the patch and open a patron record for checkout in the staff client. - Click "Search to hold" in the toolbar and perform a catalog search which will return results. - On the search results page, the toolbar at the top of the results should include a split "Place hold" button. The button's menu should include "Place hold for " and "Forget " options. Test that these work correctly. - In the table of search results each title should include a "Place hold for " link. - Go to the checkouts page for a patron with one or more checked-out items. - Check the "Always show checkouts immediately" checkbox. - The patron's checkouts should load. - Open another patron for checkout who has checked-out items. - The table of checkouts should load automatically. Signed-off-by: David Nind Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 6 +++--- koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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 6c5f9ebe7d..d83509247f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -1049,11 +1049,11 @@ columns_settings_borrowers_table = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %] [% IF borrowernumber and patron %] - if($.cookie("holdfor") != [% patron.borrowernumber | html %]){ - $.removeCookie("holdfor", { path: '/' }); + if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){ + Cookies.remove("holdfor", { path: '/' }); } [% ELSE %] - $.removeCookie("holdfor", { path: '/' }); + Cookies.remove("holdfor", { path: '/' }); [% END %] [% UNLESS ( patron.borrowernumber ) %][% UNLESS ( borrowers ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js index 0d73aed520..baf6d197a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/js/checkouts.js @@ -220,12 +220,12 @@ $(document).ready(function() { return false; }); - if ( $.cookie("issues-table-load-immediately-" + script) == "true" ) { + if ( Cookies.get("issues-table-load-immediately-" + script) == "true" ) { LoadIssuesTable(); $('#issues-table-load-immediately').prop('checked', true); } $('#issues-table-load-immediately').on( "change", function(){ - $.cookie("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365 }); + Cookies.set("issues-table-load-immediately-" + script, $(this).is(':checked'), { expires: 365 }); }); function LoadIssuesTable() { -- 2.39.5