From 57ae714ce9845a1e1735391179c9f7f439e13668 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 --- 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 89e2b1dd0a..ab72442ba2 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 a1b8b9f910..b912b6e3ec 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.5