Bugzilla – Attachment 188236 Details for
Bug 36868
Add ability to automatically empty cart after placing holds ( staff interface and OPAC )
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36868: (follow-up) Fix staff interface code
Bug-36868-follow-up-Fix-staff-interface-code.patch (text/plain), 4.90 KB, created by
Lucas Gass (lukeg)
on 2025-10-21 16:25:33 UTC
(
hide
)
Description:
Bug 36868: (follow-up) Fix staff interface code
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-10-21 16:25:33 UTC
Size:
4.90 KB
patch
obsolete
>From a632f8dad072184be423da484bf5a2f72084e11c Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 6 Jun 2024 21:57:23 +0000 >Subject: [PATCH] Bug 36868: (follow-up) Fix staff interface code > >Signed-off-by: Sam Lau <samalau@gmail.com> >--- > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 9 ++++++++- > reserve/placerequest.pl | 5 +++++ > reserve/request.pl | 6 +++--- > 3 files changed, 16 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index b2ee7571f9f..d3a6708d227 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -284,7 +284,6 @@ > </ul> > </div> > [% END %] >- > [% UNLESS ( multi_hold ) %] > <h2>Place a hold on [% INCLUDE 'biblio-title.inc' link = 1 %] [% IF biblio.author %]by [% biblio.author | html %][% END %]</h2> > [% ELSE %] >@@ -1574,6 +1573,7 @@ > [% INCLUDE 'select2.inc' %] > [% Asset.js("js/holds.js") | $raw %] > [% Asset.js("js/hold-group.js") | $raw %] >+ [% Asset.js("js/basket.js") | $raw %] > > [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %] > [% IF multi_hold %] >@@ -1581,6 +1581,7 @@ > [% END %] > <script> > $(document).ready(function () { >+ > hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %]; > $("#patron_holds_table").kohaTable( > { >@@ -1978,6 +1979,12 @@ > }); > [% END %] > >+ [% IF successful_holds && Koha.Preference('AutoDeleteFromCartWhenHoldPlaced').grep('staff').size %] >+ [% FOREACH success IN successful_holds.split('\|') %] >+ delSingleRecord('[% success | html %]'); >+ [% END %] >+ [% END %] >+ > $(".hold-arrow").click(function(e) { > e.preventDefault(); > let arrowForm = $("#hold-actions-form").attr({ >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 9c8838c47cc..2a6b212de5a 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -73,6 +73,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > $hold_group = Koha::HoldGroup->new->store; > } > >+ my @successful_biblionumbers; > foreach my $biblionumber ( keys %bibinfos ) { > > my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); >@@ -112,6 +113,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > hold_group_id => $hold_group ? $hold_group->id : undef, > } > ); >+ push @successful_biblionumbers, $biblionumber; > > $hold_priority++; > >@@ -141,6 +143,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > hold_group_id => $hold_group ? $hold_group->id : undef, > } > ); >+ push @successful_biblionumbers, $biblionumber; > } > } else { > >@@ -165,6 +168,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > hold_group_id => $hold_group ? $hold_group->id : undef, > } > ); >+ push @successful_biblionumbers, $biblionumber; > } > } > } >@@ -178,6 +182,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > push( @failed_hold_msgs, $msg ); > } > $redirect_url->query_form( biblionumber => [@biblionumbers], failed_holds => \@failed_hold_msgs ); >+ $redirect_url .= "&successful_holds=" . join( '|', @successful_biblionumbers ); > print $input->redirect($redirect_url); > } elsif ( $borrowernumber eq '' ) { > print $input->header(); >diff --git a/reserve/request.pl b/reserve/request.pl >index a00a6de53e1..c92e34b300e 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -91,7 +91,8 @@ my $exceeded_holds_per_record; > my @failed_holds = $input->multi_param('failed_holds'); > my $form_submitted = $input->param('form_submitted'); > >-my $op = $input->param('op') || q{}; >+my @successful_holds = $input->multi_param('successful_holds'); >+my $op = $input->param('op') || q{}; > > if ( $op eq 'cud-move' ) { > my $where = $input->param('where'); >@@ -803,8 +804,7 @@ $template->param( biblionumbers => \@biblionumbers ); > $template->param( pickup => $pickup || C4::Context->userenv->{branch} ); > > $template->param( borrowernumber => $borrowernumber_hold ); >- >-$template->param( failed_holds => \@failed_holds ); >+$template->param( failed_holds => \@failed_holds, successful_holds => @successful_holds ); > > # printout the page > output_html_with_http_headers $input, $cookie, $template->output; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36868
:
166834
|
166835
|
167558
|
167695
|
167699
|
167700
|
167701
|
167851
|
167852
|
167853
|
167854
|
167855
|
177760
|
177761
|
177762
|
177763
|
178640
|
178700
|
178701
|
188235
| 188236 |
188237