From e95172f7d61699c24ba46616f08759cf0bf1cef4 Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Fri, 20 Sep 2024 13:41:26 +0000 Subject: [PATCH] Bug 37972: Allow selection of tab in patron's summary table by query param To test: 1) Apply the patch 2) Place a hold on any biblio with the 'koha' patron for example 3) Authenticate in the OPAC with the patron you picked in step 1 4) Open opac-user.pl with the query param 'tab': /cgi-bin/koha/opac-user.pl?tab=opac-user-holds 5) Note that the holds tab in the patron's user summary is automatically selected 6) Sign-off I'm totally open to renaming the query param, so if you have a suggestion that's more consistent with the rest of koha, I'm all ears. Signed-off-by: David Nind Signed-off-by: Lucas Gass --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 ++++ opac/opac-user.pl | 1 + 2 files changed, 5 insertions(+) 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 89e2b1dd0ad..ab72442ba22 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -1388,6 +1388,10 @@ return confirmDelete(_("Are you sure you want to dismiss this message?")); }); + [% IF ( tab ) %] + $("#opac-user-views #[% tab %]-tab").tab("show"); + [% END %] + if( $("#opac-user-views .tab-pane.active").length < 1 ){ $("#opac-user-views a:first").tab("show"); } diff --git a/opac/opac-user.pl b/opac/opac-user.pl index a1b8b9f9100..b912b6e3ec6 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -406,6 +406,7 @@ $template->param( patronupdate => $patronupdate, OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"), userview => 1, + tab => $query->param('tab'); SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'), AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), OpacHoldNotes => C4::Context->preference('OpacHoldNotes'), -- 2.39.2