Bug 39498: Correct patron restrictions displays
This patch updates the way patron restrictions are displayed in the OPAC
and staff interface, with the intention of making the details of each
restriction more clear. In the OPAC, a new include file is created to be
reused on the holds page and the user summary page. opac-user.pl is
updated to allow a parameter to be passed to automatically open the
"Overdues" tab.
Test plan:
1. Before applying the patch, check how the display is currently. First
set syspref PatronRestrictionTypes to "Allow"
2. Add two different new restriction types, fill out both "Code" and
"Label"
3. Go to a patron's checkout page and add one of each of these
restrictions, but do not fill out the comment field when adding them!
4. Observe that in the checkouts page and details page of the patron, it
just says "Restricted since..." and does not show the restriction
types.
5. Add another restriction, this time fill out the comment field
6. Observe that now in checkout and detail pages, the labels from the
restriction types are listed and the comment shown.
7. Apply patch
8. Go to patron's details and checkout pages and check the restrictions
are now displayed correctly, that is the text "with the explanation"
is only shown for the restrictions that actually have a comment
8b. Log in to the OPAC with that patron and check they are displayed
correctly in their summary page and when the patron is trying to
place a hold.
9. Go to a different patron's account and add a restriction without a
comment
10. Check it is now displayed correctly
11. Add more restrictions and check they are displayed correctly. Also
add an OVERDUES restriction:
11a. Find a patron with an overdue item checked out (or create an
overdue checkout on a patron's account)
11b. Go to Tools -> Overdue notice/status triggers
11c. Set up a rule for that patron's category, e.g. "First" ->
Delay: 1, make sure to mark the check box for "Restrict" and
"Print"
11d. Run misc/cronjobs/overdue_notices.pl
11e. That patron should now also have an OVERDUES restriction
12. Turn PatronRestrictionTypes off again and check the patrons if
everything is still displayed correctly
13. Go to another different patron and add a restriction with no
comment, check if it is displayed correctly
14. Add another restriction with a comment and check it is displayed
correctly
15. Log in to the OPAC with the patron that had OVERDUES restriction and
check they are displayed correctly in their summary page and when
the patron is trying to place a hold.
16. Same thing for the other patron without the OVERDUES restriction.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
5e5d53fea2
commit
9516fe517c
|
|
@ -92,32 +92,28 @@
|
|||
|
||||
[% IF ( userdebarred ) %]
|
||||
<li class="userdebarred blocker">
|
||||
<span class="circ-hlt"> Restricted since [% debarredsince | $KohaDates %]:</span> Patron's account is restricted
|
||||
[% IF ( userdebarreddate ) %]
|
||||
until [% userdebarreddate | $KohaDates %]
|
||||
[% END %]
|
||||
|
||||
[% IF ( debarredcomment ) %]
|
||||
with the explanation: <br />
|
||||
<em>
|
||||
[% IF debarredcomment.search('OVERDUES_PROCESS') %]
|
||||
Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | $raw | html_line_break %]
|
||||
[% ELSE %]
|
||||
[% FOREACH restriction IN patron.restrictions %]
|
||||
<div class="[% restriction.type.code | lower | html %]_restriction">
|
||||
<span class="restriction_expiration">
|
||||
[% IF restriction.expiration %]
|
||||
[% restriction.expiration | $KohaDates %]
|
||||
[% ELSE %]
|
||||
<strong>Indefinite</strong>
|
||||
[% END %]
|
||||
</span>
|
||||
<span class="restriction_detail"> [%- restriction.type.display_text | html -%][%- IF restriction.comment -%]: [%- restriction.comment | html_line_break -%][%- END -%] </span>
|
||||
</div>
|
||||
<span class="circ-hlt">Account restricted since [% debarredsince | $KohaDates %]</span>
|
||||
<ul>
|
||||
[% FOREACH restriction IN patron.restrictions %]
|
||||
<li class="[% restriction.type.code | lower | html %]_restriction">
|
||||
<span class="restriction_expiration">
|
||||
[% IF restriction.expiration %]
|
||||
<strong>Restriction expiring [% restriction.expiration | $KohaDates %]</strong>
|
||||
[% ELSE %]
|
||||
<strong>Indefinite restriction</strong>
|
||||
[% END %]
|
||||
</span>
|
||||
[% IF restriction.comment.search('OVERDUES_PROCESS') %]
|
||||
Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw | html_line_break %]
|
||||
[% ELSE %]
|
||||
[% IF restriction.comment %]
|
||||
<span class="restriction_detail">[%- restriction.comment | html_line_break -%]</span>
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% END %] </em
|
||||
><br />
|
||||
[% END %]
|
||||
<span class="restriction_type">([%- restriction.type.display_text | html -%])</span>
|
||||
</li>
|
||||
[% END %]
|
||||
</ul>
|
||||
<a class="btn btn-xs btn-default" href="#reldebarments-tab" onclick="(new bootstrap.Tab($('#reldebarments-tab'))).show()"><i class="fa fa-ban"></i> View restrictions</a>
|
||||
</li>
|
||||
<!-- /.blocker -->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
<li class="userdebarred blocker">
|
||||
<strong>Your account has been frozen</strong>
|
||||
<ul>
|
||||
[% FOREACH restriction IN logged_in_user.restrictions %]
|
||||
<li class="[% restriction.type.code | lower | html %]_restriction">
|
||||
<span class="restriction_expiration">
|
||||
[% IF restriction.expiration %]
|
||||
<strong>Restriction expiring [% restriction.expiration | $KohaDates %]</strong>
|
||||
[% ELSE %]
|
||||
<strong>Indefinite restriction</strong>
|
||||
[% END %]
|
||||
</span>
|
||||
[% IF restriction.comment.search('OVERDUES_PROCESS') %]
|
||||
<span class="restriction_detail">Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | $raw | html_line_break %]</span>
|
||||
[% ELSE %]
|
||||
[% IF restriction.comment %]
|
||||
<span class="restriction_detail">[%- restriction.comment | html_line_break -%]</span>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</li>
|
||||
[% END %]
|
||||
<li>
|
||||
<span>Usually the reason for freezing an account is old overdues or damage fees. If it appears that your account is clear, please contact the library.</span>
|
||||
<a href="/cgi-bin/koha/opac-account.pl">Check your charges page.</a> <a href="/cgi-bin/koha/opac-user.pl?opac-user-overdues=1">Check your overdues.</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
@ -30,8 +30,8 @@
|
|||
<div id="holds" class="maincontent">
|
||||
<h1>Placing a hold</h1>
|
||||
[% IF ( message ) %]
|
||||
<div id="holdmessages" class="alert">
|
||||
<p>Sorry, you cannot place holds.</p>
|
||||
<div id="holdmessages" class="alert alert-warning">
|
||||
<h2>Sorry, you cannot place holds.</h2>
|
||||
<ul>
|
||||
[% IF ( GNA ) %]
|
||||
<li id="gna">
|
||||
|
|
@ -49,41 +49,7 @@
|
|||
[% END %]
|
||||
|
||||
[% IF ( debarred ) %]
|
||||
<li id="debarred">
|
||||
Your account has been frozen.
|
||||
[% IF debarred_comment %]
|
||||
Comment:<br />
|
||||
<span id="userdebarred_comment">
|
||||
<strong>
|
||||
[% IF debarred_comment.search('OVERDUES_PROCESS') %]
|
||||
Restriction added by overdues process [% debarred_comment.remove('OVERDUES_PROCESS ') | html_line_break %]
|
||||
[% ELSE %]
|
||||
[% FOR restriction IN logged_in_user.restrictions %]
|
||||
<div class="patron_restriction">
|
||||
[%- restriction.type.display_text | html -%][%- IF restriction.comment -%]
|
||||
: <span class="restriction_comment">[% restriction.comment | html_line_break %]</span>, frozen until:
|
||||
<span class="restriction_expiration">
|
||||
[%- IF restriction.expiration -%]
|
||||
[%- restriction.expiration | $KohaDates -%]
|
||||
[%- ELSE -%]
|
||||
<strong>Indefinite</strong>
|
||||
[%- END -%]
|
||||
</span>
|
||||
[% END %]
|
||||
</div>
|
||||
[% END %]
|
||||
[% END %]
|
||||
</strong>
|
||||
</span>
|
||||
[% END %]
|
||||
|
||||
[% IF debarred_date && debarred_date != '9999-12-31' %]
|
||||
End date:
|
||||
<span id="userdebarred_date">[% debarred_date | $KohaDates %]</span>
|
||||
[% END %]
|
||||
<br /><em>Usually the reason for freezing an account is old overdues or damage fees. If shows your account to be clear, please contact the library.</em>
|
||||
<a href="/cgi-bin/koha/opac-account.pl">Go to your charges page</a>
|
||||
</li>
|
||||
[% INCLUDE "patron-restrictions.inc" %]
|
||||
[% END %]
|
||||
|
||||
[% IF ( too_much_oweing ) %]
|
||||
|
|
@ -273,9 +239,9 @@
|
|||
[% END %]
|
||||
</select>
|
||||
[% IF at_least_one_library_not_available_for_pickup %]
|
||||
<div class="at_least_one_library_not_available_note"
|
||||
>Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items</div
|
||||
>
|
||||
<div class="at_least_one_library_not_available_note">
|
||||
Note: Library policy does not allow hold/pickup of an item available locally. Please come to the library to retrieve these items
|
||||
</div>
|
||||
[% END %]
|
||||
[% END # / UNLESS bibitemloo.holdable %]
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -167,36 +167,7 @@
|
|||
[% IF ( discharge_available ) %]
|
||||
<li id="discharged"> <strong>Please note:</strong> Your account is frozen because it has been discharged. <a href="/cgi-bin/koha/opac-discharge.pl?op=get">Get your discharge</a> </li>
|
||||
[% ELSE %]
|
||||
<li id="userdebarred">
|
||||
<strong>Please note:</strong> Your account has been frozen.
|
||||
[% IF ( borrower.debarredcomment ) %]
|
||||
Comment:<br />
|
||||
<ul id="userdebarred_comment">
|
||||
[% FOREACH restriction IN logged_in_user.restrictions %]
|
||||
<li class="patron_restriction">
|
||||
<strong>[%- restriction.type.display_text | html -%]: </strong>
|
||||
[% IF restriction.comment.search('OVERDUES_PROCESS') %]
|
||||
Restriction added by overdues process [% restriction.comment.remove('OVERDUES_PROCESS ') | html_line_break %]
|
||||
[% ELSE %]
|
||||
[%- IF restriction.comment -%]
|
||||
<span class="restriction_comment">[% restriction.comment | html_line_break %]</span>.
|
||||
[%- END -%]
|
||||
[% END %]
|
||||
[%- IF restriction.expiration -%]
|
||||
Account frozen until <span class="restriction_expiration">[%- restriction.expiration | $KohaDates -%]</span>
|
||||
[%- ELSE -%]
|
||||
<strong>Account frozen indefinitely</strong>
|
||||
[%- END -%]
|
||||
</li>
|
||||
[% END %]
|
||||
</ul>
|
||||
[% END %]
|
||||
|
||||
<p
|
||||
><em>Usually the reason for freezing an account is old overdues or damage fees. If your account shows to be clear, please contact the library.</em>
|
||||
<a href="/cgi-bin/koha/opac-account.pl">Go to your charges page</a></p
|
||||
>
|
||||
</li>
|
||||
[% INCLUDE "patron-restrictions.inc" %]
|
||||
[% END %]
|
||||
[% END %]
|
||||
[% IF ( borrower.gonenoaddress ) %]
|
||||
|
|
@ -1093,8 +1064,9 @@
|
|||
$(document).ready(function(){
|
||||
[% IF ( opac_user_holds ) %]
|
||||
$("#opac-user-views a[href='#opac-user-holds_panel']").tab("show");
|
||||
[% END %]
|
||||
[% IF ( opac_user_article_requests ) %]
|
||||
[% ELSIF ( opac_user_overdues ) %]
|
||||
$("#opac-user-views a[href='#opac-user-overdues_panel']").tab("show");
|
||||
[% ELSIF ( opac_user_article_requests ) %]
|
||||
$("#opac-user-views a[href='#opac-user-article-requests_panel']").tab("show");
|
||||
[% END %]
|
||||
$('#article-requests-table caption .count').html(AR_CAPTION_COUNT.format('[% current_article_requests.size | html %]'));
|
||||
|
|
|
|||
|
|
@ -430,6 +430,7 @@ $template->param(
|
|||
OpacHoldNotes => C4::Context->preference('OpacHoldNotes'),
|
||||
failed_holds => scalar $query->param('failed_holds'),
|
||||
opac_user_holds => scalar $query->param('opac-user-holds') || 0,
|
||||
opac_user_overdues => scalar $query->param('opac-user-overdues') || 0,
|
||||
opac_user_article_requests => scalar $query->param('opac-user-article-requests') || 0,
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue