Bug 19623: (follow-up) Correct footer include in pop-up windows
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / patron-attr-types.tt
1 [% USE AuthorisedValues %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Administration &rsaquo; Patron attribute types
4 [% IF ( attribute_type_form ) %]
5   [% IF ( edit_attribute_type ) %]
6     &rsaquo; Modify patron attribute type
7   [% ELSE %]
8     &rsaquo; Add patron attribute type
9   [% END %]
10 [% END %]
11 [% IF ( delete_attribute_type_form ) %]
12   &rsaquo; Confirm deletion of patron attribute type &quot;[% code |html %]&quot;
13 [% END %]
14 </title>
15 [% INCLUDE 'doc-head-close.inc' %]
16
17 <script type="text/javascript">
18 //<![CDATA[
19 $(document).ready(function() {
20     if ( $("#branches option:selected").length < 1 ) {
21         $("#branches option:first").attr("selected", "selected");
22     }
23
24     $("#opac_display").change( function() {
25         if ( this.checked ) {
26             $("#opac_editable").removeAttr('disabled').parent().removeAttr('aria-disabled');
27         } else {
28             $("#opac_editable").attr('disabled', true).parent().attr('aria-disabled', 'true');
29         }
30     } ).change();
31 } );
32 //]]>
33 </script>
34 </head>
35 <body id="admin_patron-attr-types" class="admin">
36 [% INCLUDE 'header.inc' %]
37 [% INCLUDE 'prefs-admin-search.inc' %]
38
39 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF ( display_list ) %]Patron attribute types[% ELSE %]<a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a>[% END %]
40 [% IF ( attribute_type_form ) %]
41   [% IF ( edit_attribute_type ) %]
42     &rsaquo; Modify patron attribute type
43   [% ELSE %]
44     &rsaquo; Add patron attribute type
45   [% END %]
46 [% END %]
47 [% IF ( delete_attribute_type_form ) %]
48   &rsaquo; Confirm deletion of patron attribute type &quot;[% code |html %]&quot;
49 [% END %]
50 </div>
51
52 <div id="doc3" class="yui-t2">
53
54    <div id="bd">
55     <div id="yui-main">
56     <div class="yui-b">
57
58 [% IF ( WARNING_extended_attributes_off ) %]
59 <div class="dialog message">Because the 'ExtendedPatronAttributes` system preference is currently not enabled, extended patron attributes cannot be given to patron records.  Go <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=ExtendedPatronAttributes">here</a> if you wish to enable this feature.</div>
60 [% END %]
61
62 [% IF ( attribute_type_form ) %]
63   [% IF ( edit_attribute_type ) %]
64 <h2>Modify patron attribute type</h2>
65   [% ELSE %]
66 <h2>Add patron attribute type</h2>
67   [% END %]
68 [% IF ( duplicate_code_error ) %]
69 <div class="dialog message">Could not add patron attribute type &quot;[% duplicate_code_error %]&quot; 
70     &mdash; one with that code already exists.
71 </div>
72 [% END %]
73 <form action="[% script_name %]" class="validated" method="post">
74   <input type="hidden" name="op" value="[% confirm_op %]" />
75   <fieldset class="rows">
76     <ol>
77       <li>
78           [% IF ( edit_attribute_type ) %]
79                   <span class="label">Patron attribute type code: </span>
80             <input type="hidden" name="code" value="[% code |html %]" />
81             [% code |html %]
82           [% ELSE %]
83               <label for="code" class="required">Patron attribute type code: </label>
84               <input type="text" id="code" name="code" required="required" class="required" size="10" maxlength="10" />
85               <span class="required">Required</span>
86           [% END %]
87        </li>
88        <li><label for="description" class="required">Description: </label>
89            <input type="text" id="description" name="description" required="required" class="required" size="50" maxlength="250" value="[% description |html %]" />
90            <span class="required">Required</span>
91        </li>
92        <li><label for="repeatable">Repeatable: </label>
93             [% IF ( repeatable_checked ) %]
94               [% IF ( repeatable_disabled ) %]
95                 <input type="checkbox" id="repeatable" name="repeatable" checked="checked" disabled="disabled" />
96               [% ELSE %]
97                 <input type="checkbox" id="repeatable" name="repeatable" checked="checked" />
98               [% END %]
99             [% ELSE %]
100               [% IF ( repeatable_disabled ) %]
101                 <input type="checkbox" id="repeatable" name="repeatable" disabled="disabled" />
102               [% ELSE %]
103                 <input type="checkbox" id="repeatable" name="repeatable" />
104               [% END %]
105             [% END %]
106             <span>Check to let a patron record have multiple values of this attribute.  
107                   This setting cannot be changed after an attribute is defined.</span>
108        </li>
109        <li><label for="unique_id">Unique identifier: </label>
110             [% IF ( unique_id_checked ) %]
111               [% IF ( unique_id_disabled ) %]
112                 <input type="checkbox" id="unique_id" name="unique_id" checked="checked" disabled="disabled" />
113               [% ELSE %]
114                 <input type="checkbox" id="unique_id" name="unique_id" checked="checked" />
115               [% END %]
116             [% ELSE %]
117               [% IF ( unique_id_disabled ) %]
118                 <input type="checkbox" id="unique_id" name="unique_id" disabled="disabled" />
119               [% ELSE %]
120                 <input type="checkbox" id="unique_id" name="unique_id" />
121               [% END %]
122             [% END %]
123             <span>If checked, attribute will be a unique identifier &mdash; if a value is given to a patron record, the same value
124                   cannot be given to a different record.  This setting cannot be changed after an attribute is defined.</span>
125        </li>
126        <li><label for="opac_display">Display in OPAC: </label>
127           [% IF ( opac_display_checked ) %]
128             <input type="checkbox" id="opac_display" name="opac_display" checked="checked" />
129           [% ELSE %]
130             <input type="checkbox" id="opac_display" name="opac_display" />
131           [% END %]
132             <span>Check to display this attribute on a patron's details page in the OPAC.</span>
133        </li>
134        <li><label for="opac_editable">Editable in OPAC: </label>
135           [% IF ( opac_editable_checked ) %]
136             <input type="checkbox" id="opac_editable" name="opac_editable" checked="checked" />
137           [% ELSE %]
138             <input type="checkbox" id="opac_editable" name="opac_editable" />
139           [% END %]
140             <span>Check to allow patrons to edit this attribute from their details page in the OPAC. (Requires above, does not work with <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=PatronSelfRegistrationVerifyByEmail" target="_blank">PatronSelfRegistrationVerifyByEmail</a>.)</span>
141        </li>
142        <li><label for="staff_searchable">Searchable: </label>
143           [% IF ( staff_searchable_checked ) %]
144             <input type="checkbox" id="staff_searchable" name="staff_searchable" checked="checked" />
145           [% ELSE %]
146             <input type="checkbox" id="staff_searchable" name="staff_searchable" />
147           [% END %]
148             <span>Check to make this attribute staff_searchable in the staff patron search.</span>
149        </li>
150        <li><label for="display_checkout">Display in check-out: </label>
151             [% IF display_checkout_checked %]
152                 <input type="checkbox" id="display_checkout" name="display_checkout" checked="checked" />
153             [% ELSE %]
154                 <input type="checkbox" id="display_checkout" name="display_checkout" />
155             [% END %]
156             <span>Check to show this attribute in patron check-out.</span>
157        </li>
158
159         <li><label for="authorised_value_category">Authorized value category: </label>
160             <select name="authorised_value_category" id="authorised_value_category">
161                 <option value=""></option>
162                 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => authorised_value_category ) %]
163             </select>
164             <span>Authorized value category; if one is selected, the patron record input page will only allow values 
165                   to be chosen from the authorized value list.  However, an authorized value list is not 
166                   enforced during batch patron import.</span>
167         </li>
168         <li><label for="branches">Branches limitation: </label>
169             <select id="branches" name="branches" multiple size="10">
170                 <option value="">All branches</option>
171                 [% FOREACH branch IN branches_loop %]
172                   [% IF ( branch.selected ) %]
173                     <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
174                   [% ELSE %]
175                     <option value="[% branch.branchcode %]">[% branch.branchname |html %]</option>
176                   [% END %]
177                 [% END %]
178             </select>
179             <span>Select All if this attribute type must to be displayed all the time. Otherwise select libraries you want to associate with this value.
180             </span>
181         </li>
182         <li>
183             <label for="category">Category: </label>
184             <select name="category_code" id="category">
185                 <option value=""></option>
186                 [% FOREACH cat IN categories %]
187                     [% IF ( cat.categorycode == category_code ) %]<option value="[% cat.categorycode %]" selected="selected">[% cat.description |html %]</option>[% ELSE %]<option value="[% cat.categorycode %]">[% cat.description |html %]</option>[% END %]
188                 [% END %]
189             </select>
190             <span>Choose one to limit this attribute to one patron type. Please leave blank if you want these attributes to be available for all types of patrons.</span>
191         </li>
192         <li>
193             <label for="class">Class: </label>
194             <select name="class" id="class">
195                 <option value=""></option>
196                 [% FOREACH class IN classes_val_loop %]
197                     [% IF class.authorised_value == category_class %]
198                         <option value="[% class.authorised_value %]" selected="selected">
199                             [% class.lib |html %]
200                         </option>
201                     [% ELSE %]
202                         <option value="[% class.authorised_value %]" >
203                             [% class.lib |html %]
204                         </option>
205                     [% END %]
206                 [% END %]
207             </select>
208             <span>Group attributes types with a block title (based on authorized values category 'PA_CLASS')</span>
209         </li>
210     </ol>
211   </fieldset>
212   <fieldset class="action">
213       <input type="submit" value="Save" />
214     <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
215   </fieldset>
216 </form>
217 [% END %]
218
219 [% IF ( delete_attribute_type_form ) %]
220     <div class="dialog alert">
221         <h3>Confirm deletion of patron attribute type <span class="ex">'[% code |html %]' ([% description %])</span>?</h3>
222         <form action="[% script_name %]" name="Aform" method="post">
223             <input type="hidden" name="op" value="[% confirm_op %]" />
224             <input type="hidden" name="code" value="[% code |html %]" />
225             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete patron attribute type</button>
226         </form>
227         <form action="[% script_name %]" method="get">
228             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
229         </form>
230     </div>
231 [% END %]
232
233 [% IF ( display_list ) %]
234
235 <div id="toolbar" class="btn-toolbar">
236     <a class="btn btn-default btn-sm" id="newrule" href="[% script_name %]?op=add_attribute_type"><i class="fa fa-plus"></i> New patron attribute type</a>
237 </div>
238
239 <h2>Patron attribute types</h2>
240 [% IF ( added_attribute_type ) %]
241 <div class="dialog message">Added patron attribute type &quot;[% added_attribute_type %]&quot;</div>
242 [% END %]
243 [% IF ( edited_attribute_type ) %]
244 <div class="dialog message">Modified patron attribute type &quot;[% edited_attribute_type %]&quot;</div>
245 [% END %]
246 [% IF ( deleted_attribute_type ) %]
247 <div class="dialog message">Deleted patron attribute type &quot;[% deleted_attribute_type %]&quot;</div>
248 [% END %]
249 [% IF ( ERROR_delete_in_use ) %]
250 <div class="dialog message">Could not delete patron attribute type &quot;[% ERROR_delete_in_use %]&quot; 
251     &mdash; it is in use by [% ERROR_num_patrons %] patron records</div>
252 [% END %]
253 [% IF ( ERROR_delete_not_found ) %]
254 <div class="dialog message">Could not delete patron attribute type &quot;[% ERROR_delete_not_found %]&quot; 
255     &mdash; it was already absent from the database.</div>
256 [% END %]
257 [% IF ( available_attribute_types ) %]
258   [% FOREACH attribute IN available_attribute_types %]
259     [% IF attribute.class %]
260         <h4>[% attribute.lib %]</h4>
261     [% END %]
262     <table class="patron_attributes_types">
263       <thead>
264         <tr>
265           <th>Code</th>
266           <th>Description</th>
267           <th>Branches limitation</th>
268           <th>Actions</th>
269         </tr>
270       </thead>
271       <tbody>
272         [% FOREACH item IN attribute.items %]
273           <tr>
274             <td>[% item.code |html %]</td>
275             <td>[% item.description |html %]</td>
276             <td>
277                 [% IF ( item.branches && item.branches.size > 0 ) %]
278                     [% branches_str = "" %]
279                     [% FOREACH branch IN item.branches %]
280                         [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
281                     [% END %]
282                     <span title="[% branches_str %]">
283                         [% IF item.branches.size > 1 %]
284                             [% item.branches.size %] branches limitations
285                         [% ELSE %]
286                             [% item.branches.size %] branch limitation
287                         [% END %]
288                     </span>
289                 [% ELSE %]
290                     No limitation
291                 [% END %]
292             </td>
293             <td class="actions">
294               <a class="btn btn-default btn-xs" href="[% item.script_name %]?op=edit_attribute_type&amp;code=[% item.code |html %]"><i class="fa fa-pencil"></i> Edit</a>
295               <a class="btn btn-default btn-xs" href="[% item.script_name %]?op=delete_attribute_type&amp;code=[% item.code |html %]"><i class="fa fa-trash"></i> Delete</a>
296             </td>
297           </tr>
298         [% END %]
299       </tbody>
300     </table>
301   [% END %]
302 [% ELSE %]
303   <p>There are no saved patron attribute types.</p>
304 [% END %]
305
306 <div class="pages">[% pagination_bar %]</div>
307
308 [% END %]
309  
310 </div>
311 </div>
312 <div class="yui-b">
313 [% INCLUDE 'admin-menu.inc' %]
314 </div>
315 </div>
316 [% INCLUDE 'intranet-bottom.inc' %]