Bug 5917 : Swapping templates over
[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>
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&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             <input type="checkbox" id="repeatable" name="repeatable" [% repeatable_checked %] [% repeatable_disabled %] />
105             <span>Check to let a patron record have multiple values of this attribute.  
106                   This setting cannot be changed after an attribute is defined.</span>
107        </li>
108        <li><label for="unique_id">Unique identifier: </label>
109             <input type="checkbox" id="unique_id" name="unique_id" [% unique_id_checked %] [% unique_id_disabled %] />
110             <span>If checked, attribute will be a unique identifier &mdash; if a value is given to a patron record, the same value
111                   cannot be given to a different record.  This setting cannot be changed after an attribute is defined.</span>
112        </li>
113        <li><label for="password_allowed">Allow password: </label>
114             <input type="checkbox" id="password_allowed" name="password_allowed" [% password_allowed_checked %] />
115             <span>Check to make it possible to associate a password with this attribute.</span>
116        </li>
117        <li><label for="opac_display">Display in OPAC: </label>
118             <input type="checkbox" id="opac_display" name="opac_display" [% opac_display_checked %] />
119             <span>Check to display this attribute on a patron's details page in the OPAC.</span>
120        </li>
121        <li><label for="staff_searchable">Searchable: </label>
122             <input type="checkbox" id="staff_searchable" name="staff_searchable" [% staff_searchable_checked %] />
123             <span>Check to make this attribute staff_searchable in the staff patron search.</span>
124        </li>
125         <li><label for="authorised_value_category">Authorized value category: </label>
126             <select name="authorised_value_category" id="authorised_value_category">
127                 <option value=""></option>
128                 [% FOREACH authorised_value_categorie IN authorised_value_categories %]
129                     [% IF ( authorised_value_categorie.selected ) %]
130                         <option value="[% authorised_value_categorie.category %]" selected="selected">
131                             [% authorised_value_categorie.category %]
132                         </option>
133                     [% ELSE %]
134                         <option value="[% authorised_value_categorie.category %]">
135                             [% authorised_value_categorie.category %]
136                         </option>
137                     [% END %]
138                 [% END %]
139             </select>
140             <span>Authorized value category; if one is selected, the patron record input page will only allow values 
141                   to be chosen from the authorized value list.  However, an authorized value list is not 
142                   enforced during batch patron import.</span>
143         </li>
144     </ol>
145   </fieldset>
146   <fieldset class="action">
147     [% IF ( edit_attribute_type ) %]
148     <input type="button" value="Save"
149            onclick="CheckAttributeTypeForm(this.form)" />
150     [% ELSE %]
151     <input type="button" value="Save"
152            onclick="CheckAttributeTypeForm(this.form)" />
153     [% END %]
154     <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
155   </fieldset>
156 </form>
157 [% END %]
158
159 [% IF ( delete_attribute_type_form ) %]
160 <div class="dialog alert"><h3>Confirm deletion of patron attribute type <span class="ex">'[% code |html %]' ([% description %])</span>?</h3>
161 <form action="[% script_name %]" name="Aform" method="post">
162   <input type="hidden" name="op" value="[% confirm_op %]" />
163   <input type="hidden" name="code" value="[% code |html %]" />
164     <input type="submit" value="Delete patron attribute type" class="approve" /></form>
165         <form action="[% script_name %]" method="get">
166     <input type="submit" value="No, Do Not Delete" class="deny" />
167 </form></div>
168 [% END %]
169
170 [% IF ( display_list ) %]
171
172 <div id="toolbar">
173         <script type="text/javascript">
174         //<![CDATA[
175         // prepare DOM for YUI Toolbar
176          $(document).ready(function() {
177             yuiToolbar();
178          });
179         // YUI Toolbar Functions
180         function yuiToolbar() {
181             new YAHOO.widget.Button("newrule");
182         }       //]]>
183         </script>
184         <ul class="toolbar">
185         <li><a id="newrule" href="[% script_name %]?op=add_attribute_type">New Patron Attribute Type</a></li>
186 </ul></div>
187
188 <h2>Patron Attribute Types</h2>
189 [% IF ( added_attribute_type ) %]
190 <div class="dialog message">Added patron attribute type &quot;[% added_attribute_type %]&quot;</div>
191 [% END %]
192 [% IF ( edited_attribute_type ) %]
193 <div class="dialog message">Modified patron attribute type &quot;[% edited_attribute_type %]&quot;</div>
194 [% END %]
195 [% IF ( deleted_attribute_type ) %]
196 <div class="dialog message">Deleted patron attribute type &quot;[% deleted_attribute_type %]&quot;</div>
197 [% END %]
198 [% IF ( ERROR_delete_in_use ) %]
199 <div class="dialog message">Could not delete patron attribute type &quot;[% ERROR_delete_in_use %]&quot; 
200     &mdash; it is in use by [% ERROR_num_patrons %] patron records</div>
201 [% END %]
202 [% IF ( ERROR_delete_not_found ) %]
203 <div class="dialog message">Could not delete patron attribute type &quot;[% ERROR_delete_not_found %]&quot; 
204     &mdash; it was already absent from the database.</div>
205 [% END %]
206 [% IF ( available_attribute_types ) %]<table>
207   <tr>
208     <th>Code</th>
209     <th>Description</th>
210     <th>Actions</th>
211   </tr>
212   [% FOREACH available_attribute_type IN available_attribute_types %]
213   <tr>
214     <td>[% available_attribute_type.code |html %]</td>
215     <td>[% available_attribute_type.description %]</td>
216     <td>
217       <a href="[% available_attribute_type.script_name %]?op=edit_attribute_type&amp;code=[% available_attribute_type.code |html %]">Edit</a>
218       <a href="[% available_attribute_type.script_name %]?op=delete_attribute_type&amp;code=[% available_attribute_type.code |html %]">Delete</a>
219     </td>
220   </tr>
221   [% END %]
222 </table>[% ELSE %]<p>There are no saved patron attribute types.</p>[% END %]
223
224 <div class="pages">[% pagination_bar %]</div>
225
226 [% END %]
227  
228 </div>
229 </div>
230 <div class="yui-b">
231 [% INCLUDE 'admin-menu.inc' %]
232 </div>
233 </div>
234 [% INCLUDE 'intranet-bottom.inc' %]