Bugzilla – Attachment 165824 Details for
Bug 36064
Add information about holds with cancellation requests to staff start page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36064: (follow-up) Activate correct tab
Bug-36064-follow-up-Activate-correct-tab.patch (text/plain), 3.62 KB, created by
David Nind
on 2024-04-30 02:47:25 UTC
(
hide
)
Description:
Bug 36064: (follow-up) Activate correct tab
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-04-30 02:47:25 UTC
Size:
3.62 KB
patch
obsolete
>From 3f0e39c3739b4ff353ed1570495e206436c8d018 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 13 Feb 2024 11:48:35 +0000 >Subject: [PATCH] Bug 36064: (follow-up) Activate correct tab > >This patch makes a change to the JavaScript on waitingreserves.pl so >that the correct tab is activated if you follow the "Holds with >cancellation requests" link on the home page. > >The page has code to activate the last viewed tab, but I've modified it >so that if there is a location hash ('waitingreserves.pl#tab') the tab >specified in the hash is selected instead of the last used tab. > >If there is no location hash the last active tab will be activated. > >I've also corrected the location hash in the link on the home page. > >To test, apply the patch and follow the "Holds with cancellation >requests" link. The "Holds with cancellation requests" tab should be >active. > >Click a different tab, e.g. "Holds waiting." Go the the circulation home >page, then click the link for "Holds awaiting pickup." The tab you >selected should be active. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../prog/en/modules/circ/waitingreserves.tt | 14 +++++++++++--- > .../intranet-tmpl/prog/en/modules/intranet-main.tt | 2 +- > 2 files changed, 12 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index 3af7bf9861..10e0eedda2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -300,10 +300,18 @@ > }); > }); > >- var activeTab = localStorage.getItem("waitingreserves_activetab"); >- if( activeTab ){ >- $("div#resultlist li:eq(" + activeTab + ") a").tab("show"); >+ var hash = document.location.hash; >+ if( hash !== "" ){ >+ /* The existence of location.hash means someone clicked a link which targets a specific tab */ >+ $( hash ).tab("show"); >+ } else { >+ /* If no specific tab was linked to, use the last active tab */ >+ var activeTab = localStorage.getItem("waitingreserves_activetab"); >+ if( activeTab ){ >+ $("div#resultlist li:eq(" + activeTab + ") a").tab("show"); >+ } > } >+ > $("div#resultlist a[data-toggle='tab']").on("shown.bs.tab", function (e) { > var thisTab = $(e.target).parent(); > var activeTab = thisTab.index(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >index ca914d15cd..4bb3decc3a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt >@@ -271,7 +271,7 @@ > > [% IF holds_with_cancellation_requests && CAN_user_circulate_circulate_remaining_permissions %] > <div class="pending-info" id="holds_with_cancellation_requests"> >- <a href="/cgi-bin/koha/circ/waitingreserves.pl?allbranches=1#holdscancelled_panel">Holds with cancellation requests</a>: >+ <a href="/cgi-bin/koha/circ/waitingreserves.pl?allbranches=1#holdscancelled-tab">Holds with cancellation requests</a>: > <span class="pending-number-link">[% holds_with_cancellation_requests | html %]</span> > </div> > [% END %] >-- >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 36064
:
161998
|
161999
|
162002
|
162105
|
165796
|
165797
|
165798
|
165799
|
165809
|
165810
|
165823
|
165824
|
170654
|
170655
|
173159
|
173160
|
173161