View | Details | Raw Unified | Return to bug 31095
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc (-82 lines)
Lines 1-82 Link Here
1
[% USE raw %]
2
[% USE Koha %]
3
[% PROCESS 'patron_restrictions.inc' %]
4
<div id="reldebarments">
5
    [% IF ( not debarments.defined || debarments.size < 1 ) %]
6
        <p>Patron is currently unrestricted.</p>
7
    [% ELSE %]
8
        <table>
9
            <thead>
10
                <tr>
11
                     <th>Type</th>
12
                     <th>Comment</th>
13
                     <th>Expiration</th>
14
                     <th>Created</th>
15
                     [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
16
                         <th>&nbsp;</th>
17
                     [% END %]
18
                </tr>
19
            </thead>
20
            <tbody>
21
                [% FOREACH d IN debarments %]
22
                    [% dtype = d.type %]
23
                    <tr>
24
                        <td>
25
                            [% PROCESS restriction_type_description restriction=restriction_types.$dtype %]
26
                        </td>
27
                        <td>
28
                            [% IF d.comment.search('OVERDUES_PROCESS') %]
29
                                <span>Restriction added by overdues process [% d.comment.remove('OVERDUES_PROCESS ') | $raw %]</span>
30
                            [% ELSE %]
31
                                [% d.comment | $raw %]
32
                            [% END %]
33
                        </td>
34
                        <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <em>Indefinite</em> [% END %]</td>
35
                        <td>[% d.created | $KohaDates %]</td>
36
                        [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
37
                            <td>
38
                                <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">
39
                                    <i class="fa fa-trash"></i> Remove
40
                                </a>
41
                            </td>
42
                        [% END %]
43
                    </tr>
44
                [% END %]
45
            </tbody>
46
        </table>
47
    [% END %]
48
    [% IF CAN_user_borrowers_edit_borrowers && CAN_user_circulate_manage_restrictions %]
49
        <p><a href="#" id="add_manual_restriction"><i class="fa fa-plus"></i> Add manual restriction</a></p>
50
        <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix">
51
            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
52
            <input type="hidden" name="action" value="add" />
53
            <fieldset class="rows" id="manual_restriction_form">
54
                <legend>Add manual restriction</legend>
55
                <ol>
56
                    [% IF Koha.Preference('PatronRestrictionTypes') %]
57
                    <li>
58
                        <label for="debarred_type">Type:</label>
59
                        <select name="debarred_type">
60
                            [% FOREACH code IN restriction_types.keys %]
61
                                [% IF !restriction_types.$code.is_system %]
62
                                   [% IF restriction_types.$code.is_default %]
63
                                   <option value="[% code | html %]" selected>[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
64
                                   [% ELSE %]
65
                                   <option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
66
                                   [% END %]
67
                                [% END %]
68
                            [% END %]
69
                        </select>
70
                    </li>
71
                    [% END %]
72
                    <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li>
73
                    <li>
74
                        <label for="rexpiration">Expiration:</label>
75
                        <input name="expiration" id="rexpiration" size="20" value="" class="flatpickr" data-flatpickr-futuredate="true" type="text" />
76
                    </li>
77
                </ol>
78
            <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset>
79
            </fieldset>
80
        </form>
81
    [% END %]
82
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc (-10 lines)
Lines 1-10 Link Here
1
[%- BLOCK restriction_type_description -%]
2
    [%- ddisplay = restriction.display_text -%]
3
    [%- SWITCH ddisplay -%]
4
        [%- CASE 'Manual' -%]<span>Manual</span>
5
        [%- CASE 'Overdues' -%]<span>Overdues</span>
6
        [%- CASE 'Suspension' -%]<span>Suspension</span>
7
        [%- CASE 'Discharge' -%]<span>Discharge</span>
8
        [%- CASE -%]<span>[% ddisplay | html %]</span>
9
    [%- END -%]
10
[%- END -%]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt (-2 lines)
Lines 1-7 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Asset %]
2
[% USE Asset %]
3
[% USE Koha %]
3
[% USE Koha %]
4
[% PROCESS 'patron_restrictions.inc' %]
5
[% SET footerjs = 1 %]
4
[% SET footerjs = 1 %]
6
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
7
<title>[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% PROCESS restriction_type_description %]'[% ELSE %]New restriction[% END %][% END %]
6
<title>[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% PROCESS restriction_type_description %]'[% ELSE %]New restriction[% END %][% END %]
8
- 

Return to bug 31095