From 56f2d7a094f96457690a0aa1727a729c6b46f617 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 3 May 2022 11:07:00 +0100 Subject: [PATCH] Bug 21978: Use patron-title for holdfor handling in results This patch update the catalogue search results page to use the patron-title include to display patron titles for the 'Holds for' line in results and dropdown list. Test plan 1) Load patron account 2) Press search to hold 3) Perform a search which brings back 2+ items (e.g. 'street') 4) Note that on the search results it says: Place hold for 'firstname (othername) surname (cardnumber)' 5) Press the Place hold button and note that the dropdown includes "Place hold for 'firstname (othername) surname'" and "Forget 'firstname (othername) surname'" 6) Click through to an item from the results, press the 'Place hold' button and note the dropdown includes "Place hold for 'firstname (othername) surname'" Signed-off-by: Sally Signed-off-by: Jonathan Druart --- catalogue/ISBDdetail.pl | 5 ++--- catalogue/MARCdetail.pl | 5 ++--- catalogue/detail.pl | 4 +--- catalogue/imageviewer.pl | 3 +-- catalogue/labeledMARCdetail.pl | 5 ++--- catalogue/moredetail.pl | 5 ++--- catalogue/search.pl | 5 ++--- koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 6 +++--- .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 2 +- 10 files changed, 17 insertions(+), 25 deletions(-) diff --git a/catalogue/ISBDdetail.pl b/catalogue/ISBDdetail.pl index d991d3e799a..7bb4e61be0f 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_surname => $holdfor_patron->surname, - holdfor_firstname => $holdfor_patron->firstname, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, holdfor_cardnumber => $holdfor_patron->cardnumber, ); } diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 4ff6a03c548..8211d58d97b 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_surname => $holdfor_patron->surname, - holdfor_firstname => $holdfor_patron->firstname, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, holdfor_cardnumber => $holdfor_patron->cardnumber, ); } diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 29b6167f612..2d8e07698b9 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -103,10 +103,8 @@ if($query->cookie("holdfor")){ my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); if ( $holdfor_patron ) { $template->param( - # FIXME Should pass the patron object holdfor => $query->cookie("holdfor"), - holdfor_surname => $holdfor_patron->surname, - holdfor_firstname => $holdfor_patron->firstname, + holdfor_patron => $holdfor_patron, holdfor_cardnumber => $holdfor_patron->cardnumber, ); } diff --git a/catalogue/imageviewer.pl b/catalogue/imageviewer.pl index e9c43a3935e..2fede23b02c 100755 --- a/catalogue/imageviewer.pl +++ b/catalogue/imageviewer.pl @@ -50,8 +50,7 @@ if ( $query->cookie("holdfor") ) { my $holdfor_patron = Koha::Patrons->find( $query->cookie("holdfor") ); $template->param( holdfor => $query->cookie("holdfor"), - holdfor_surname => $holdfor_patron->surname, - holdfor_firstname => $holdfor_patron->firstname, + holdfor_patron => $holdfor_patron, holdfor_cardnumber => $holdfor_patron->cardnumber, ); } diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl index 785c2921542..08fbe6aeab3 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_surname => $holdfor_patron->surname, - holdfor_firstname => $holdfor_patron->firstname, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, holdfor_cardnumber => $holdfor_patron->cardnumber, ); } diff --git a/catalogue/moredetail.pl b/catalogue/moredetail.pl index cff2460a278..4d9cf401a13 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_surname => $holdfor_patron->surname, - holdfor_firstname => $holdfor_patron->firstname, + holdfor => $query->cookie("holdfor"), + holdfor_patron => $holdfor_patron, holdfor_cardnumber => $holdfor_patron->cardnumber, ); } diff --git a/catalogue/search.pl b/catalogue/search.pl index ef7f49088f0..2097f1385a9 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_surname => $holdfor_patron->surname, - holdfor_firstname => $holdfor_patron->firstname, + holdfor => $cgi->cookie("holdfor"), + holdfor_patron => $holdfor_patron, holdfor_cardnumber => $holdfor_patron->cardnumber, ); } 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 1f352ab3ae2..a6435194b20 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 0e550fd353c..e17480f0524 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -143,9 +143,9 @@