Bug 33187: Use template wrapper for tabs article requests and holds awaiting pickup pages

This patch updates the article requests management and holds awaiting
pickup templates in the staff interface so that they use the new WRAPPER
directive for building tabs.

To test, apply the patch and make sure the ArticleRequests system
preference is enabled.

- Go to Circulation -> Article requests
- You should see three tabs, "New," "Pending," and "Processing."
- The tabs should look correct and work correctly.
- Go to Circulation -> Holds awaiting pickup
- You should see three tabs, "Holds waiting", "Holds waiting over X
  days," and "Holds with cancellation requests." ("X" is the value in
  the ReservesMaxPickUpDelay system preference)

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2023-03-09 19:28:47 +00:00 committed by Tomas Cohen Arazi
parent 99db0a904d
commit 8a4e971ad3
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 48 additions and 52 deletions

View File

@ -172,28 +172,21 @@
</button>
</form>
<div id="article-request-tabs" class="toptabs">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active">
<a href="#article-requests-requested" aria-controls="article-requests-requested" role="tab" data-toggle="tab">
New (<span id="ar_requested_count">[% article_requests_requested.count | html %]</span>)
</a>
</li>
[% WRAPPER tabs id= "article-request-tabs" %]
[% WRAPPER tabs_nav %]
[% WRAPPER tab_item tabname= "article-requests-requested" bt_active= 1 %]
<span>New</span> (<span id="ar_requested_count">[% article_requests_requested.count | html %]</span>)
[% END %]
[% WRAPPER tab_item tabname= "article-requests-pending" %]
<span>Pending</span> (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>)
[% END %]
[% WRAPPER tab_item tabname= "article-requests-processing" %]
<span>Processing</span> (<span id="ar_processing_count">[% article_requests_processing.count | html %]</span>)
[% END %]
[% END # /WRAPPER tabs_nav %]
<li role="presentation">
<a href="#article-requests-pending" aria-controls="article-requests-pending" role="tab" data-toggle="tab">
Pending (<span id="ar_pending_count">[% article_requests_pending.count | html %]</span>)
</a>
</li role="presentation">
<li>
<a href="#article-requests-processing" aria-controls="article-requests-processing" role="tab" data-toggle="tab">
Processing (<span id="ar_processing_count">[% article_requests_processing.count | html %]</span>)
</a>
</li>
</ul>
<div class="tab-content">
<div id="article-requests-requested" role="tabpanel" class="tab-pane active">
[% WRAPPER tab_panels %]
[% WRAPPER tab_panel tabname="article-requests-requested" bt_active= 1 %]
<div class="article-requests-requested_table_controls">
<a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
[% PROCESS actions menuid='article-menu-requested' id_arg=0 pull_right='' aria_menu='table_controls' %]
@ -298,9 +291,9 @@
[% END %]
</tbody>
</table>
</div>
[% END # /tab_panel#article-requests-requested %]
<div id="article-requests-pending" role="tabpanel" class="tab-pane">
[% WRAPPER tab_panel tabname="article-requests-pending" %]
<div class="article-requests-pending_table_controls">
<a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
[% PROCESS actions menuid='article-menu-pending' id_arg=0 pull_right='' aria_menu='table_controls' %]
@ -405,9 +398,9 @@
[% END %]
</tbody>
</table>
</div>
[% END # /tab_panel#article-requests-pending %]
<div id="article-requests-processing" role="tabpanel" class="tab-pane">
[% WRAPPER tab_panel tabname="article-requests-processing" %]
<div class="article-requests-processing_table_controls">
<a href="#" class="SelectAll"><i class="fa fa-check"></i> Select all</a> | <a href="#" class="ClearAll"><i class="fa fa-remove"></i> Clear all</a>
[% PROCESS actions menuid='article-menu-processing' id_arg=0 pull_right='' aria_menu='table_controls' %]
@ -509,10 +502,9 @@
[% END %]
</tbody>
</table>
</div>
</div> <!-- /.tab-content -->
<br/>
</div>
[% END # /tab_panel#article-requests-processing %]
[% END # /WRAPPER tab_panels %]
[% END # /WRAPPER tabs %]
</div>
[% IF Koha.Preference('CircSidebar') %]

View File

@ -5,6 +5,7 @@
[% USE Branches %]
[% USE TablesSettings %]
[% USE AuthorisedValues %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Holds awaiting pickup &rsaquo; Circulation &rsaquo; Koha</title>
@ -87,22 +88,22 @@
<p><a href="/cgi-bin/koha/admin/background_jobs.pl?op=view&id=[% job_id | uri %]" title="View detail of the enqueued job">View detail of the enqueued job</a></p>
</div>
[% END %]
<div id="resultlist" class="toptabs">
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#holdswaiting" aria-controls="holdswaiting" role="tab" data-toggle="tab">Holds waiting: [% reservecount | html %]</a></li>
<li role="presentation">
<a href="#holdsover" aria-controls="holdsover" role="tab" data-toggle="tab">
Holds waiting over [% Koha.Preference('ReservesMaxPickUpDelay') | html %] days: [% overcount | html %]
</a>
</li>
<li role="presentation">
<a href="#holdscancelled" aria-controls="holdscancelled" role="tab" data-toggle="tab">
Holds with cancellation requests: [% cancel_reqs_count | html %]
</a>
</li>
</ul> <!-- /.nav.nav-tabs -->
<div class="tab-content">
<div role="tabpanel" class="tab-pane active" id="holdswaiting">
[% WRAPPER tabs id= "resultlist" %]
[% WRAPPER tabs_nav %]
[% WRAPPER tab_item tabname= "holdswaiting" bt_active= 1 %]
<span>Holds waiting:</span> [% reservecount | html %]
[% END %]
[% WRAPPER tab_item tabname= "holdsover" %]
[% tx("Holds waiting over {count} days:", { count = Koha.Preference('ReservesMaxPickUpDelay') }) %] [% overcount | html %]
[% END %]
[% WRAPPER tab_item tabname= "holdscancelled" %]
<span>Holds with cancellation requests:</span> [% cancel_reqs_count | html %]
[% END %]
[% END # /WRAPPER tabs_nav %]
[% WRAPPER tab_panels %]
[% WRAPPER tab_panel tabname="holdswaiting" bt_active= 1 %]
[% IF ( reserveloop ) %]
<div id="toolbar" class="btn-toolbar">
<button class="btn btn-default cancel_selected_holds" data-bulk="true"></button>
@ -111,8 +112,9 @@
[% ELSE %]
<div class="dialog message">No holds found.</div>
[% END %]
</div> <!-- /#holdswaiting -->
<div role="tabpanel" class="tab-pane" id="holdsover">
[% END # /tab_panel#holdswaiting %]
[% WRAPPER tab_panel tabname="holdsover" %]
[% IF ( ReservesMaxPickUpDelay ) %]
<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>
[% END %]
@ -137,16 +139,18 @@
[% ELSE %]
<div class="dialog message">No holds found.</div>
[% END # /IF( overloop ) %]
</div> <!-- /#holdsover -->
<div role="tabpanel" class="tab-pane" id="holdscancelled">
[% END # /tab_panel#holdsover %]
[% WRAPPER tab_panel tabname="holdscancelled" %]
[% IF cancel_reqs_count %]
[% INCLUDE waiting_holds.inc select_column='1' table_name='holdscr' reserveloop=cancel_reqs tab='holdscr' %]
[% ELSE %]
<div class="dialog message">No holds found.</div>
[% END %]
</div> <!-- /#holdscancelled -->
</div> <!-- /.tab-content -->
</div> <!-- /#resultlist.toptabs -->
[% END # /tab_panel#holdscancelled %]
[% END # /WRAPPER tab_panels %]
[% END # /WRAPPER tabs %]
[% END # /IF ( cancel_result ) %]
</div> <!-- /.col-sm-10.col-sm-push-2 -->