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

(-)a/admin/restrictions.pl (-1 / +1 lines)
Lines 67-74 if ( $op eq 'add_form') { Link Here
67
            };
67
            };
68
        } else {
68
        } else {
69
            my $restriction = Koha::RestrictionTypes->find($code);
69
            my $restriction = Koha::RestrictionTypes->find($code);
70
            $restriction->display_text($display_text);
70
            unless ($restriction->is_system) {
71
            unless ($restriction->is_system) {
71
                $restriction->display_text($display_text);
72
                $restriction->can_be_added_manually($can_be_added_manually);
72
                $restriction->can_be_added_manually($can_be_added_manually);
73
            }
73
            }
74
            $restriction->store;
74
            $restriction->store;
(-)a/installer/data/mysql/en/mandatory/patron_restrictions.yml (-2 / +2 lines)
Lines 22-28 description: Link Here
22
22
23
tables:
23
tables:
24
  - debarment_types:
24
  - debarment_types:
25
      translatable: [ display_text ]
25
      translatable: []
26
      multiline: []
26
      multiline: []
27
      rows:
27
      rows:
28
        - code: "MANUAL"
28
        - code: "MANUAL"
Lines 47-50 tables: Link Here
47
          display_text: "Discharge"
47
          display_text: "Discharge"
48
          is_system: 1
48
          is_system: 1
49
          default: 0
49
          default: 0
50
          can_be_added_manually: 0
50
          can_be_added_manually: 0
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc (-9 / +3 lines)
Lines 1-5 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE Koha %]
2
[% USE Koha %]
3
[% PROCESS 'patron_restrictions.inc' %]
3
<div id="reldebarments">
4
<div id="reldebarments">
4
    [% IF ( not debarments.defined || debarments.size < 1 ) %]
5
    [% IF ( not debarments.defined || debarments.size < 1 ) %]
5
        <p>Patron is currently unrestricted.</p>
6
        <p>Patron is currently unrestricted.</p>
Lines 21-34 Link Here
21
                    [% dtype = d.type %]
22
                    [% dtype = d.type %]
22
                    <tr>
23
                    <tr>
23
                        <td>
24
                        <td>
24
                            [% ddisplay = restriction_types.$dtype.display_text %]
25
                            [% PROCESS restriction_type_description restriction=restriction_types.$dtype %]
25
                            [% SWITCH ddisplay %]
26
                                [% CASE 'Manual' %]Manual
27
                                [% CASE 'Overdues' %]Overdues
28
                                [% CASE 'Suspension' %]Suspension
29
                                [% CASE 'Discharge' %]Discharge
30
                                [% CASE %][% ddisplay | html %]
31
                            [% END %]
32
                        </td>
26
                        </td>
33
                        <td>
27
                        <td>
34
                            [% IF d.comment.search('OVERDUES_PROCESS') %]
28
                            [% IF d.comment.search('OVERDUES_PROCESS') %]
Lines 65-71 Link Here
65
                        <select name="debarred_type">
59
                        <select name="debarred_type">
66
                            [% FOREACH code IN restriction_types.keys %]
60
                            [% FOREACH code IN restriction_types.keys %]
67
                                [% IF restriction_types.$code.can_be_added_manually %]
61
                                [% IF restriction_types.$code.can_be_added_manually %]
68
                                    <option value="[% code | html %]">[% restriction_types.$code.display_text | html %]</option>
62
                                    <option value="[% code | html %]">[% PROCESS restriction_type_description restriction=restriction_types.$code %]</option>
69
                                [% END %]
63
                                [% END %]
70
                            [% END %]
64
                            [% END %]
71
                        </select>
65
                        </select>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_restrictions.inc (+10 lines)
Line 0 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 (-7 / +7 lines)
Lines 1-10 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' %]
4
[% SET footerjs = 1 %]
5
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% restriction.display_text | html %]'[% ELSE %]New restriction[% END %][% END %]
7
<title>[% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% PROCESS restriction_type_description %]'[% ELSE %]New restriction[% END %][% END %]
7
[% IF op == 'delete_confirm' %]Confirm deletion of restriction '[% restriction.display_text | html %]'[% END %] &rsaquo; Patron restrictions &rsaquo; Administration &rsaquo; Koha
8
[% IF op == 'delete_confirm' %]Confirm deletion of restriction '[% PROCESS restriction_type_description %]'[% END %] &rsaquo; Patron restrictions &rsaquo; Administration &rsaquo; Koha
8
</title>
9
</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
[% INCLUDE 'doc-head-close.inc' %]
10
</head>
11
</head>
Lines 37-43 Link Here
37
        [% IF restriction %]
38
        [% IF restriction %]
38
            <li>
39
            <li>
39
                <a href="#" aria-current="page">
40
                <a href="#" aria-current="page">
40
                    Modify restriction '[% restriction.display_text | html %]'
41
                    Modify restriction '[% PROCESS restriction_type_description %]'
41
                </a>
42
                </a>
42
            </li>
43
            </li>
43
        [% ELSE %]
44
        [% ELSE %]
Lines 85-91 Link Here
85
        <input type="hidden" name="op" value="add_validate" />
86
        <input type="hidden" name="op" value="add_validate" />
86
        <input type="hidden" name="checked" value="0" />
87
        <input type="hidden" name="checked" value="0" />
87
        [% IF restriction %]
88
        [% IF restriction %]
88
            <h1>Modify restriction [% restriction.display_text | html %]</h1>
89
            <h1>Modify restriction [% PROCESS restriction_type_description %]</h1>
89
            <input type="hidden" name="is_a_modif" value="1" />
90
            <input type="hidden" name="is_a_modif" value="1" />
90
        [% ELSE %]
91
        [% ELSE %]
91
            <h1>New restriction</h1>
92
            <h1>New restriction</h1>
Lines 151-157 Link Here
151
                Confirm restriction deletion
152
                Confirm restriction deletion
152
            </legend>
153
            </legend>
153
154
154
            <p>Are you sure you want to delete &quot;[% restriction.display_text | html %]&quot;</p>
155
            <p>Are you sure you want to delete &quot;[% PROCESS restriction_type_description %]&quot;</p>
155
156
156
            <fieldset class="action">
157
            <fieldset class="action">
157
                <input type="hidden" name="op" value="delete_confirmed" />
158
                <input type="hidden" name="op" value="delete_confirmed" />
Lines 191-197 Link Here
191
                            [% restriction.code | html %]
192
                            [% restriction.code | html %]
192
                        </td>
193
                        </td>
193
                        <td>
194
                        <td>
194
                            [% restriction.display_text | html %]
195
                            [% PROCESS restriction_type_description %]
195
                        </td>
196
                        </td>
196
                        <td>
197
                        <td>
197
                            [% IF restriction.can_be_added_manually %]Yes[% END %]
198
                            [% IF restriction.can_be_added_manually %]Yes[% END %]
198
- 

Return to bug 23681