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