Bugzilla – Attachment 173160 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.76 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-10-22 14:19:36 UTC
(
hide
)
Description:
Bug 36064: (follow-up) Activate correct tab
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-10-22 14:19:36 UTC
Size:
3.76 KB
patch
obsolete
>From 8e0d0268af9786b8ced01def5f70a1b6c344ed2a 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> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > .../prog/en/modules/circ/waitingreserves.tt | 13 ++++++++++--- > .../intranet-tmpl/prog/en/modules/intranet-main.tt | 2 +- > 2 files changed, 11 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 3a0254a955d..80d7bd91d62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -302,9 +302,16 @@ > localStorage.selectedWaitingHolds = JSON.stringify(this_dt.$(".select_hold:checked", {"page": "all"}).toArray().map(el => $(el).data('id'))); > }); > >- 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-bs-toggle='tab']").on("shown.bs.tab", function (e) { > var thisTab = $(e.target).parent(); >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 eef3e3fbbea..c32de6ab9bf 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.47.0
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