Bugzilla – Attachment 167853 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.93 KB, created by
Sam Lau
on 2024-06-18 14:28:46 UTC
(
hide
)
Description:
Bug 36868: Logic for staff interface
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2024-06-18 14:28:46 UTC
Size:
4.93 KB
patch
obsolete
>From 7c9f428ef501fbe30c386461a4b040f1e273dfdc 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 | 6 +++++- > reserve/request.pl | 4 ++-- > 3 files changed, 15 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 335aa6355f..c3e0581043 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -224,7 +224,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 %] >@@ -1484,6 +1483,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 %] >@@ -1492,6 +1492,7 @@ > > <script> > $(document).ready(function () { >+ > hold_table_settings = [% TablesSettings.GetTableSettings( 'circ', 'holds', 'patron_holds_table', 'json' ) | $raw %]; > KohaTable("patron_holds_table", { > "bPaginate":false, >@@ -1881,6 +1882,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 85c0d3f1eb..8bc4391fba 100755 >--- a/reserve/placerequest.pl >+++ b/reserve/placerequest.pl >@@ -69,6 +69,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; > > } else { > $failed_holds{$can_item_be_reserved} = 1; >@@ -130,6 +132,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > non_priority => $non_priority, > } > ); >+ push @successful_biblionumbers, $biblionumber; > } > } else { > # place a request on 1st available >@@ -152,6 +155,7 @@ if ( $op eq 'cud-placerequest' && $patron ) { > item_group_id => $item_group_id, > } > ); >+ push @successful_biblionumbers, $biblionumber; > } > } > } >@@ -164,7 +168,7 @@ 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 '' ) { >diff --git a/reserve/request.pl b/reserve/request.pl >index 5d0887764d..7992f2a7ea 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -89,7 +89,7 @@ my $messages; > my $exceeded_maxreserves; > my $exceeded_holds_per_record; > my @failed_holds = $input->multi_param('failed_holds'); >- >+my @successful_holds = $input->multi_param('successful_holds'); > my $op = $input->param('op') || q{}; > > if ( $op eq 'cud-move' ) { >@@ -723,7 +723,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.2
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