Koha/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc
Owen Leonard dd75682f77
Bug 30487: Convert checkout and patron details page tabs to Bootstrap
This patch updates the checkout and patron details pages, updating
jQueryUI tabs to Bootstrap tabs.

To test, apply the patch and rebuild the staff interface CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

Go to Circulation -> Check out and load a patron record for checkout.
Ideally the patron record should have a variet of data associated with
it:

 - Checkouts
 - Relative's checkouts (if patron is a guarantor or guarantee to
   another patron with checkouts)
 - Holds
 - Article requests
 - Claims
 - Restrictions
 - Clubs

On the patron's checkout page, test the various tabs corresponding to
the features listed above. Having data to display in those tabs helps
confirm that any table functionality triggered by the tab activation is
working correctly.

The checkouts tab should work correctly whether you have "Always show
checkouts immediately" checked or not.

Test that you can pre-select any tab by appending its anchor to the URL,
e.g.:

/cgi-bin/koha/circ/circulation.pl?borrowernumber=123#reserves

Perform the same checks on the patron details page.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2022-10-17 08:06:34 -03:00

82 lines
4.4 KiB
HTML

[% USE raw %]
[% USE Koha %]
[% PROCESS 'patron_restrictions.inc' %]
<div id="reldebarments" role="tabpanel" class="tab-pane">
[% IF ( not debarments.defined || debarments.size < 1 ) %]
<p>Patron is currently unrestricted.</p>
[% ELSE %]
<table>
<thead>
<tr>
<th>Type</th>
<th>Comment</th>
<th>Expiration</th>
<th>Created</th>
[% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
<th>&nbsp;</th>
[% END %]
</tr>
</thead>
<tbody>
[% FOREACH d IN debarments %]
[% dtype = d.type %]
<tr>
<td>
[% PROCESS restriction_type_description restriction=restriction_types.$dtype %]
</td>
<td>
[% IF d.comment.search('OVERDUES_PROCESS') %]
<span>Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]</span>
[% ELSE %]
[% d.comment | $raw %]
[% END %]
</td>
<td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <em>Indefinite</em> [% END %]</td>
<td>[% d.created | $KohaDates %]</td>
[% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
<td>
<a class="remove_restriction btn btn-default btn-xs" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% patron.borrowernumber | html %]&amp;borrower_debarment_id=[% d.borrower_debarment_id | html %]&amp;action=del">
<i class="fa fa-trash"></i> Remove
</a>
</td>
[% END %]
</tr>
[% END %]
</tbody>
</table>
[% END %]
[% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
<p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
<form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="hidden" name="action" value="add" />
<fieldset class="rows" id="manual_restriction_form">
<legend>Add manual restriction</legend>
<ol>
[% IF Koha.Preference('PatronRestrictionTypes') %]
<li>
<label for="debarred_type">Type:</label>
<select name="debarred_type">
[% FOREACH code IN restriction_types.keys %]
[% IF !restriction_types.$code.is_system %]
[% IF restriction_types.$code.is_default %]
<option value="[% code | html %]" selected>[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
[% ELSE %]
<option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
[% END %]
[% END %]
[% END %]
</select>
</li>
[% END %]
<li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
<li>
<label for="rexpiration">Expiration:</label>
<input name="expiration" id="rexpiration" size="20" value="" class="flatpickr" data-flatpickr-futuredate="true" type="text" />
</li>
</ol>
<fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
</fieldset>
</form>
[% END %]
</div>