Bugzilla – Attachment 167701 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: Add logic for OPAC
Bug-36868-Add-logic-for-OPAC.patch (text/plain), 4.38 KB, created by
Lucas Gass (lukeg)
on 2024-06-13 21:32:04 UTC
(
hide
)
Description:
Bug 36868: Add logic for OPAC
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2024-06-13 21:32:04 UTC
Size:
4.38 KB
patch
obsolete
>From f568c90593cb08251e2cc063e3856ad711eef654 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 13 Jun 2024 17:58:45 +0000 >Subject: [PATCH] Bug 36868: Add logic for OPAC > >1. APPLY PATCH, updatedatabase, restart_all >2. Search for the new AutoDeleteFromCartWhenHoldPlaced system preference >3. Turn it on for both staff and OPAC >4. From the staff interface put some items in your cart. >5. Place a hold on all of them. >6. Once the hold(s) have been successfully done those items should no longer be in your cart. >7. Put more items into your staff cart, place a hold on some of them but not all. >8. Only the items you have placed a hold on should be removed. >9. Go to the OPAC and put some items in your cart. >10. Place a hold on all of them, those items should now be deleted from the cart. >11. Place more items into your OPAC cart, place a hold on some of them but not all. >12. Only the items you have placed a hold on should be removed. >13. Switch the AutoDeleteFromCartWhenHoldPlaced to only be for 'staff'. >14. Try steps 4-8 again. >15. Switch the AutoDeleteFromCartWhenHoldPlaced to only be for 'opac'. >16. Try steps 9 -12 again. >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 6 +++++- > opac/opac-reserve.pl | 4 +++- > opac/opac-user.pl | 1 + > 3 files changed, 9 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index b9be5c22c5..5f7bf3c335 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -58,7 +58,6 @@ > <a href="/cgi-bin/koha/opac-main.pl?logout.x=1" class="d-print-none">Click here if you're not [% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a></p> > > [% IF ( patronupdate ) %]<div class="alert alert-info"><h2>Thank you!</h2><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %] >- > [% IF failed_holds %] > <div class="alert alert-info"> > <h2>Notice:</h2> >@@ -1088,6 +1087,11 @@ > [% INCLUDE 'calendar.inc' %] > [% INCLUDE 'datatables.inc' %] > <script> >+ [% IF successful_holds && Koha.Preference('AutoDeleteFromCartWhenHoldPlaced').grep('opac').size %] >+ [% FOREACH success IN successful_holds.split('\|') %] >+ delSingleRecord('[% success | html %]'); >+ [% END %] >+ [% END %] > var AR_CAPTION_COUNT = _("(%s total)"); > > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index bbc016cb79..c36f94f82c 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -215,6 +215,7 @@ if ( $op eq 'cud-place_reserve' ) { > } > > my @failed_holds; >+ my @successful_holds; > while (@selectedItems) { > my $biblioNum = shift(@selectedItems); > my $itemNum = shift(@selectedItems); >@@ -326,13 +327,14 @@ if ( $op eq 'cud-place_reserve' ) { > ); > if( $reserve_id ){ > ++$reserve_cnt; >+ push @successful_holds, $biblioNum; > } else { > push @failed_holds, 'not_placed'; > } > } > } > >- print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( @failed_holds ? "failed_holds=" . join('|',@failed_holds) : q|| ) . "&opac-user-holds=1"); >+ print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( @failed_holds ? "failed_holds=" . join('|',@failed_holds) : q|| ) . ( @successful_holds ? "successful_holds=" . join('|',@successful_holds) : q|| ) . "&opac-user-holds=1"); > exit; > } > >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index a1b8b9f910..657de7f55c 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -410,6 +410,7 @@ $template->param( > AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), > OpacHoldNotes => C4::Context->preference('OpacHoldNotes'), > failed_holds => scalar $query->param('failed_holds'), >+ successful_holds => scalar $query->param('successful_holds'), > opac_user_holds => scalar $query->param('opac-user-holds') || 0, > opac_user_article_requests => scalar $query->param('opac-user-article-requests') || 0, > ); >-- >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