From e943ca0ee76d0f3ef05d35332a92857d0cee563b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 5 Jan 2024 14:50:38 +0100 Subject: [PATCH] Bug 35329: Move patron search to modal - routing list The behaviour is a bit different here. Adding a patron from the popup refreshed the parent page with the newly added patron. With this patch the refresh of the page will happen when the modal is closed (if patrons have been added). Test plan: Create a subscription, receive one item, create a routing list. Add users. Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize --- .../prog/en/modules/serials/routing.tt | 60 ++++++++++++++----- serials/routing.pl | 8 ++- 2 files changed, 51 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt index 9c9dbd7edb3..8d3df53bce2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt @@ -1,6 +1,8 @@ [% USE raw %] [% USE KohaDates %] [% SET footerjs = 1 %] +[% PROCESS 'i18n.inc' %] +[% PROCESS 'patron-search.inc' %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( op ) %]Create routing list[% ELSE %]Edit routing list[% END %] › [% title | html %] › Serials › Koha [% INCLUDE 'doc-head-close.inc' %] @@ -88,9 +90,10 @@ [% END %] [% END %] +

- Add recipients + Add recipients [% IF memberloop %] Delete all [% END %] @@ -116,10 +119,6 @@ [% MACRO jsinclude BLOCK %] + + [% INCLUDE 'select2.inc' %] + [% SET columns = ['cardnumber','name','category','branch','action'] %] + [% PROCESS patron_search_modal columns => columns, modal_title => t("Add recipients") %] + [% PROCESS patron_search_js columns => columns, actions => ["add"], preview_on_name_click => 1 %] + + [% END %] diff --git a/serials/routing.pl b/serials/routing.pl index 13f86fad355..acf88a7e8dc 100755 --- a/serials/routing.pl +++ b/serials/routing.pl @@ -41,7 +41,7 @@ my $query = CGI->new; my $subscriptionid = $query->param('subscriptionid'); my $serialseq = $query->param('serialseq'); my $routingid = $query->param('routingid'); -my $borrowernumber = $query->param('borrowernumber'); +my $borrowernumbers = $query->param('borrowernumbers'); my $notes = $query->param('notes'); my $op = $query->param('op') || q{}; my $date_selected = $query->param('date_selected'); @@ -66,8 +66,10 @@ if($op eq 'cud-delete'){ delroutingmember($routingid,$subscriptionid); } -if($op eq 'cud-add'){ - addroutingmember($borrowernumber,$subscriptionid); +if ( $op eq 'cud-add_new_recipients' ) { + for my $borrowernumber ( split ':', $borrowernumbers ) { + addroutingmember( $borrowernumber, $subscriptionid ); + } } if($op eq 'cud-save'){ my $sth = $dbh->prepare('UPDATE serial SET routingnotes = ? WHERE subscriptionid = ?'); -- 2.34.1