5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Administration › Patron restrictions › [% IF op == 'add_form' %][% IF ( restriction ) %]Modify restriction '[% restriction.display_text | html %]'[% ELSE %]New restriction[% END %][% END %]
7 [% IF op == 'delete_confirm' %]Confirm deletion of restriction '[% restriction.display_text | html %]'[% END %]
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="admin_restrictions" class="admin">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'patrons-admin-search.inc' %]
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › [% IF op == 'add_form' %] <a href="/cgi-bin/koha/admin/restrictions.pl">Patron restrictions</a> › [% IF ( restriction ) %]Modify restriction '[% restriction.display_text | html %]'[% ELSE %]New restriction[% END %][% END %]
17 [% IF op == 'delete_confirm' %] <a href="/cgi-bin/koha/admin/restrictions.pl">Patron restrictions</a> › Confirm deletion of restriction '[% restriction.display_text | html %]'[% END %]
18 [% IF op == 'delete_confirmed' %] <a href="/cgi-bin/koha/admin/categories.pl">Patron restrictions</a> › Restriction deleted[% END %]
19 [% IF op == 'list' %]Patron restrictions[% END %]</div>
21 <div class="main container-fluid">
23 <div class="col-sm-10 col-sm-push-2">
26 [% FOR m IN messages %]
27 <div class="dialog [% m.type | html %]">
29 [% CASE 'duplicate_display_text' %]
30 Another restriction already has this label
31 [% CASE 'duplicate_code' %]
32 Another restriction already has this code
39 [% IF op == 'add_form' %]
40 <form id="restriction_form" action="/cgi-bin/koha/admin/restrictions.pl" method="post">
41 <input type="hidden" name="op" value="add_validate" />
42 <input type="hidden" name="checked" value="0" />
44 <h1>Modify restriction [% restriction.display_text | html %]</h1>
45 <input type="hidden" name="is_a_modif" value="1" />
47 <h1>New restriction</h1>
49 <fieldset class="rows">
53 <span class="label">Code: </span>[% restriction.code | html %]
54 <input type="hidden" name="code" value="[% restriction.code | html %]" />
57 <label for="display_text" class="required">Label: </label>
58 <input type="text" value="[% restriction.display_text | html %]" name="display_text" id="display_text" size="50" maxlength="50" class="required" required="required" />
59 <span class="required">Required</span>
63 <label for="code" class="required">Code: </label>
64 <input type="text" name="code" id="code" size="50" maxlength="50" class="required type_input " required="required" />
65 <span class="required">Required</span>
68 <label for="display_text" class="required">Label: </label>
69 <input type="text" name="display_text" id="display_text" size="50" maxlength="50" class="required" required="required" />
70 <span class="required">Required</span>
76 <fieldset class="action">
77 <input type="submit" value="Save" />
78 <a href="/cgi-bin/koha/admin/restrictions.pl" class="cancel">Cancel</a>
83 [% IF op == 'delete_confirm' %]
84 <form action="/cgi-bin/koha/admin/restrictions.pl" method="post">
87 Confirm restriction deletion
90 <p>Are you sure you want to delete "[% restriction.display_text | html %]"</p>
92 <fieldset class="action">
93 <input type="hidden" name="op" value="delete_confirmed" />
94 <input type="hidden" name="code" value="[% restriction.code | html %]" />
95 <input type="submit" value="Delete this restriction" />
96 <a class="cancel" href="/cgi-bin/koha/admin/restrictions.pl">Cancel</a>
102 [% IF op == 'list' %]
104 <div id="toolbar" class="btn-toolbar">
105 <a class="btn btn-default" id="newrestriction" href="/cgi-bin/koha/admin/restrictions.pl?op=add_form"><i class="fa fa-plus"></i> New restriction</a>
108 <h2>Patron restrictions</h2>
110 You Searched for [% searchfield | html %]</span>
112 [% IF restrictions %]
113 <table id="restriction_types">
116 <th scope="col">Code</th>
117 <th scope="col">Label</th>
118 <th scope="col">Default</th>
119 <th scope="col">Actions</th>
123 [% FOREACH restriction IN restrictions %]
126 [% restriction.code | html %]
129 [% restriction.display_text | html %]
132 [% IF restriction.dflt %]Yes[% END %]
135 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=add_form&code=[% restriction.code | uri %]"><i class="fa fa-pencil"></i> Edit</a>
136 [% IF !restriction.ronly %]
137 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=delete_confirm&code=[% restriction.code | uri %]"><i class="fa fa-trash"></i> Delete</a>
145 <div class="dialog alert">No restrictions have been defined. <a href="/cgi-bin/koha/admin/restrictions.pl?op=add_form">Create a new restriction</a>.</div>
150 </div> <!-- /.col-sm-10.col-sm-push-2 -->
152 <div class="col-sm-2 col-sm-pull-10">
154 [% INCLUDE 'admin-menu.inc' %]
156 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
157 </div> <!-- /.row -->
159 [% MACRO jsinclude BLOCK %]
160 [% Asset.js("js/admin-menu.js") | $raw %]
161 [% INCLUDE 'datatables.inc' %]
162 [% INCLUDE 'columns_settings.inc' %]
164 var MSG_DUPLICATE_CODE = _("Restriction code is already in use");
165 var MSG_DUPLICATE_DISPLAY_TEXT = _("Label is already in use");
167 [% FOREACH ex IN existing %]
168 [% ex.code | $raw %]: '[% ex.display_text | $raw %]',
172 [% Asset.js("js/restrictiontypes.js") | $raw %]
174 [% INCLUDE 'intranet-bottom.inc' %]