From 8c3fca1b414735be8eaa92d8c88bbf1c93e6c49e Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
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 <patron>" and "Forget <patron>" options. Test
   that these work correctly.
 - In the table of search results each title should include a "Place
   hold for <patron>" 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.
---
 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 acbe85abab3..e32865b9934 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -1053,11 +1053,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 2bfd18e6cf0..0982dafcb31 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.11.0