From 82a44fa5cd47f0303da494e7b2827241d2d5691c Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Tue, 5 Dec 2023 16:40:15 +0000 Subject: [PATCH] Bug 35488: Open holds tab by default on opac-user.pl after placing a hold 1 - Place a hold on the opac 2 - Note after placing the hold the URL is: http://localhost:8080/cgi-bin/koha/opac-user.pl?#opac-user-holds 3 - Note the holds tab is not active 4 - APPLY PATCH and restart_all 5 - Try steps 1 - 3 again, this time the holds tab should be opened. Signed-off-by: Owen Leonard Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Katrin Fischer (cherry picked from commit d8bd46d0d7dcc80ece69f3c8f869ec7113401d65) Signed-off-by: Fridolin Somers (cherry picked from commit ce728a04f9adb66c2ed9bc180e30196c4034b4a3) Signed-off-by: Lucas Gass --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 3 +++ opac/opac-reserve.pl | 2 +- opac/opac-user.pl | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) 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 ce4d35ee14..64815e2e77 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -1091,6 +1091,9 @@ } } $(document).ready(function(){ + [% IF ( opac_user_holds ) %] + $("#opac-user-views a[href='#opac-user-holds_panel']").tab("show"); + [% END %] $('#opac-user-article-requests caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]')); $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs"); diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 8f6ea581ce..6e845e17af 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -330,7 +330,7 @@ if ( $query->param('place_reserve') ) { } } - print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( @failed_holds ? "failed_holds=" . join('|',@failed_holds) : q|| ) . "#opac-user-holds"); + print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( @failed_holds ? "failed_holds=" . join('|',@failed_holds) : q|| ) . "&opac-user-holds=1"); exit; } diff --git a/opac/opac-user.pl b/opac/opac-user.pl index bc04c520a8..0885f90d5c 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -429,6 +429,7 @@ $template->param( AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), OpacHoldNotes => C4::Context->preference('OpacHoldNotes'), failed_holds => scalar $query->param('failed_holds'), + opac_user_holds => scalar $query->param('opac-user-holds') || 0, ); # if not an empty string this indicates to return -- 2.39.5