Bugzilla – Attachment 177761 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: Logic for staff interface
Bug-36868-Logic-for-staff-interface.patch (text/plain), 4.98 KB, created by
Lucas Gass (lukeg)
on 2025-02-11 20:35:53 UTC
(
hide
)
Description:
Bug 36868: Logic for staff interface
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-02-11 20:35:53 UTC
Size:
4.98 KB
patch
obsolete
>From eba9ac047ea1aa40f30795984035465a48a3ae65 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: Logic for staff interface > >Signed-off-by: Sam Lau <samalau@gmail.com> >--- > .../intranet-tmpl/prog/en/modules/reserve/request.tt | 9 ++++++++- > reserve/placerequest.pl | 9 ++++++++- > reserve/request.pl | 5 +++-- > 3 files changed, 19 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 4b74435b508..a1b094a3b23 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -220,7 +220,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 %] >@@ -1427,6 +1426,7 @@ > [% INCLUDE 'select2.inc' %] > [% Asset.js("js/holds.js") | $raw %] > [% Asset.js("js/form-submit.js") | $raw %] >+ [% Asset.js("js/basket.js") | $raw %] > > [% SET url_biblio_params = "biblionumber=" _ biblionumbers.join("&biblionumber=") %] > [% IF multi_hold %] >@@ -1434,6 +1434,7 @@ > [% END %] > <script> > $(document).ready(function () { >+ > hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %]; > KohaTable("patron_holds_table", { > "bPaginate":false, >@@ -1816,6 +1817,12 @@ > }); > [% END %] > >+ [% IF successful_holds && Koha.Preference('AutoDeleteFromCartWhenHoldPlaced').grep('staff').size %] >+ [% FOREACH biblionumber in successful_holds %] >+ delSingleRecord('[% biblionumber | html %]'); >+ [% END %] >+ [% END %] >+ > if(!localStorage.selectedHolds || document.referrer.replace(/\?.*/, '') !== document.location.origin+document.location.pathname) { > localStorage.selectedHolds = []; > } >diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl >index 11aa387672e..8d564793470 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -66,6 +66,7 @@ foreach my $bibnum (@holdable_bibs) { > > if ( $op eq 'cud-placerequest' && $patron ) { > my %failed_holds; >+ my @successful_biblionumbers; > foreach my $biblionumber ( keys %bibinfos ) { > > my $can_override = C4::Context->preference('AllowHoldPolicyOverride'); >@@ -104,6 +105,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > non_priority => $non_priority, > } > ); >+ push @successful_biblionumbers, $biblionumber; > > $hold_priority++; > >@@ -132,6 +134,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > non_priority => $non_priority, > } > ); >+ push @successful_biblionumbers, $biblionumber; > } > } else { > >@@ -155,6 +158,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > item_group_id => $item_group_id, > } > ); >+ push @successful_biblionumbers, $biblionumber; > } > } > } >@@ -167,7 +171,10 @@ if ( $op eq 'cud-placerequest' && $patron ) { > foreach my $msg ( keys %failed_holds ) { > push( @failed_hold_msgs, $msg ); > } >- $redirect_url->query_form( biblionumber => [@biblionumbers], failed_holds => \@failed_hold_msgs ); >+ $redirect_url->query_form( >+ biblionumber => [@biblionumbers], failed_holds => \@failed_hold_msgs, >+ successful_holds => \@successful_biblionumbers, >+ ); > print $input->redirect($redirect_url); > } elsif ( $borrowernumber eq '' ) { > print $input->header(); >diff --git a/reserve/request.pl b/reserve/request.pl >index c5e354aa7d2..6c27930b308 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'); >@@ -738,7 +739,7 @@ $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