From 5a4253aa8ef7dd796c84af1c40dec0abc614cabe Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 18 May 2022 16:17:11 +0100 Subject: [PATCH] Bug 21978: (follow-up) Stop passing holdfor_cardnumber We not longer need to pass holdfor_cardnumber distinctly, we can just refer to holdfor_patron.cardnumber instead. This patch does that ;P Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi --- catalogue/ISBDdetail.pl | 5 ++--- catalogue/MARCdetail.pl | 5 ++--- catalogue/detail.pl | 3 +-- catalogue/imageviewer.pl | 5 ++--- catalogue/labeledMARCdetail.pl | 5 ++--- catalogue/moredetail.pl | 5 ++--- catalogue/search.pl | 5 ++--- koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt | 4 ++-- .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 2 +- 10 files changed, 17 insertions(+), 24 deletions(-) diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index 7bb4e61be0..6e3b4bf845 100755 --- a/catalogue/ISBDdetail.pl +++ b/catalogue/ISBDdetail.pl @@ -108,9 +108,8 @@ my $res = GetISBDView({ if($query->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); $template->param( - holdfor => $query->cookie("holdfor"), - holdfor_patron => $holdfor_patron, - holdfor_cardnumber => $holdfor_patron->cardnumber, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, ); } diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 8211d58d97..6bb5a834dd 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -110,9 +110,8 @@ my $biblio = GetBiblioData($biblionumber); if($query->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); $template->param( - holdfor => $query->cookie("holdfor"), - holdfor_patron => $holdfor_patron, - holdfor_cardnumber => $holdfor_patron->cardnumber, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, ); } diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 2bdb72cbea..990d108cf3 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -103,9 +103,8 @@ if($query->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); if ( $holdfor_patron ) { $template->param( - holdfor => $query->cookie("holdfor"), + holdfor => $query->cookie("holdfor"), holdfor_patron => $holdfor_patron, - holdfor_cardnumber => $holdfor_patron->cardnumber, ); } } diff --git a/catalogue/imageviewer.pl b/catalogue/imageviewer.pl index 2fede23b02..1fc1f42304 100755 --- a/catalogue/imageviewer.pl +++ b/catalogue/imageviewer.pl @@ -49,9 +49,8 @@ my @items = GetItemsInfo($biblionumber); if ( $query->cookie("holdfor") ) { my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); $template->param( - holdfor => $query->cookie("holdfor"), - holdfor_patron => $holdfor_patron, - holdfor_cardnumber => $holdfor_patron->cardnumber, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, ); } diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index 08fbe6aeab..6418fd0edc 100755 --- a/catalogue/labeledMARCdetail.pl +++ b/catalogue/labeledMARCdetail.pl @@ -73,9 +73,8 @@ my $biblio = GetBiblioData($biblionumber); if($query->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); $template->param( - holdfor => $query->cookie("holdfor"), - holdfor_patron => $holdfor_patron, - holdfor_cardnumber => $holdfor_patron->cardnumber, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, ); } diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index 4d9cf401a1..b0dc6e4206 100755 --- a/catalogue/moredetail.pl +++ b/catalogue/moredetail.pl @@ -55,9 +55,8 @@ $template->param( if($query->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); $template->param( - holdfor => $query->cookie("holdfor"), - holdfor_patron => $holdfor_patron, - holdfor_cardnumber => $holdfor_patron->cardnumber, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, ); } diff --git a/catalogue/search.pl b/catalogue/search.pl index 2097f1385a..24e8692d27 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -203,9 +203,8 @@ if($cgi->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $cgi->cookie("holdfor") ); if ( $holdfor_patron ) { # may have been deleted in the meanwhile $template->param( - holdfor => $cgi->cookie("holdfor"), - holdfor_patron => $holdfor_patron, - holdfor_cardnumber => $holdfor_patron->cardnumber, + holdfor => $cgi->cookie("holdfor"), + holdfor_patron => $holdfor_patron, ); } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc index a6435194b2..a1ca101dba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc @@ -182,7 +182,7 @@ [% ELSE %] 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 b9b7208121..f9b80cffe6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -519,7 +519,7 @@ [% ELSE %] [% IF CAN_user_reserveforothers_place_holds %] Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) | html %]) - [% IF ( holdfor ) %] | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %][% END %] + [% IF ( holdfor ) %] | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 no_cardnumber => 1 %][% END %] [% IF ( holdforclub ) %] | Place hold for [% holdforclub_name | html %][% END %] [% ELSE %] Holds ([% Biblio.HoldsCount( SEARCH_RESULT.biblionumber ) | html %]) @@ -724,7 +724,7 @@ var PREF_StaffHighlightedWords = "[% Koha.Preference('StaffHighlightedWords') | html %]"; var PREF_NotHighlightedWords = "[% Koha.Preference('NotHighlightedWords') | html %]"; var biblionumber = "[% biblionumber | html %]"; - var holdfor_cardnumber = "[% holdfor_cardnumber | html %]"; + var holdfor_cardnumber = "[% holdfor_patron.cardnumber | html %]"; var holdforclub = "[% holdforclub | html %]"; [% IF SEARCH_RESULTS %] var SEARCH_RESULTS = 1; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index 47e164bbe6..3fa48ea555 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -276,7 +276,7 @@ [% ELSE %] [% IF ( itemsloo.ITEM_RESULTS.size ) %] Holds - [% IF ( holdfor ) %] | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %][% END %] + [% IF ( holdfor ) %] | Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %][% END %] [% ELSE %] No holds allowed [% END %] -- 2.39.5