From 9a40eb5820983fa99f693a13857b9a9ef1bb25fc 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 Signed-off-by: Tomas Cohen Arazi --- 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 d991d3e799..7bb4e61be0 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 4ff6a03c54..8211d58d97 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 3bf6255037..2bdb72cbea 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 e9c43a3935..2fede23b02 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 785c292154..08fbe6aeab 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 cff2460a27..4d9cf401a1 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 ef7f49088f..2097f1385a 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 1f352ab3ae..a6435194b2 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 50f24e05f9..b9b7208121 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 @@