Bug 13636: Change wording added vs inserted
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / authorised_values.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Authorized values
3 [% IF op == 'add_form' %]
4   [% IF ( action_modify ) %] &rsaquo; Modify authorized value[% END %]
5   [% IF ( action_add_value ) %] &rsaquo;  New authorized value[% END %]
6   [% IF ( action_add_category ) %] &rsaquo; New category[% END %]
7 [% END %]
8 </title>
9 [% INCLUDE 'doc-head-close.inc' %]
10
11 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
12 [% INCLUDE 'datatables.inc' %]
13 <script type="text/javascript">
14 //<![CDATA[
15  $(document).ready(function() {
16     $("#table_authorized_values").dataTable($.extend(true, {}, dataTablesDefaults, {
17         "aoColumnDefs": [
18             { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
19         ],
20         "aaSorting": [[ 1, "asc" ]],
21         "sPaginationType": "four_button"
22     }));
23
24     if ( $("#branches option:selected").length < 1 ) {
25         $("#branches option:first").attr("selected", "selected");
26     }
27     $('#icons').tabs();
28
29     $("a.delete").click(function(){
30         return confirm(_("Are you sure you want to delete this authorized value?"));
31     });
32 });
33 //]]>
34 </script>
35
36 [% IF op == 'list' %]
37 <script type="text/javascript">
38 //<![CDATA[
39 $(document).ready(function() {
40     $('#category').find("input:submit").hide();
41     $('#searchfield').change(function() {
42         $('#category').submit();
43     });
44 });
45 //]]>
46 </script>
47 [% END %]
48
49 <style type="text/css">
50         fieldset.rows div.toptabs li { clear:none;margin-right:.5em;padding-bottom:0;width:auto; }
51     fieldset.rows div.toptabs .ui-tabs-nav li.ui-tabs-active {background-color : #F4F8F9; }
52         fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
53     fieldset.rows .ui-tabs-nav { margin-left : 10px; }
54 </style>
55 </head>
56 <body id="admin_authorised_values" class="admin">
57 [% INCLUDE 'header.inc' %]
58 [% INCLUDE 'cat-search.inc' %]
59 <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 op == 'add_form' %] <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized values</a> &rsaquo; [% IF ( action_modify ) %]Modify authorized value[% END %]
60            [% IF ( action_add_value ) %]New authorized value[% END %]
61            [% IF ( action_add_category ) %]New category[% END %][% END %]
62 [% IF op == 'list' %]Authorized values[% END %]</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 op == 'add_form' %]
71         <h1>
72            [% IF ( action_modify ) %]Modify authorized value[% END %]
73            [% IF ( action_add_value ) %]New authorized value[% END %]
74            [% IF ( action_add_category ) %]New category[% END %]
75         </h1>
76
77     [% IF ( action_modify ) %]<div class="note"><strong>NOTE:</strong> If you change an authorized value code, existing records using it won't be updated. Changes to value descriptions will show immediately.</div>[% END %]
78
79  <form action="/cgi-bin/koha/admin/authorised_values.pl" name="Aform" method="post">
80     <input type="hidden" name="op" value="add" />
81         <fieldset class="rows"><ol>
82         <li>
83         [% IF ( action_add_category ) %]<label for="category">Category: </label>
84             <input type="text" name="category"  id="category" size="32" maxlength="32" class="focus" />
85                          [% ELSE %]<span class="label">Category</span>
86                 <input type="hidden" name="category" value="[% category %]" />   [% category %]
87                          [% END %]
88         </li>
89         <li>
90             <label for="authorised_value">Authorized value: </label>
91      [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
92             [% IF ( action_add_category ) %]
93             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" />
94             [% ELSE %]
95             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" class="focus" />
96             [% END %]
97         </li>
98         <li>
99             <label for="lib">Description: </label>
100             <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="200" />
101         </li>
102         <li>
103             <label for="lib_opac">Description (OPAC): </label>
104             <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
105         </li>
106         <li><label for="branches">Libraries limitation: </label>
107             <select id="branches" name="branches" multiple size="10">
108                 <option value="">All libraries</option>
109                 [% FOREACH branch IN branches_loop %]
110                   [% IF ( branch.selected ) %]
111                     <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
112                   [% ELSE %]
113                     <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
114                   [% END %]
115                 [% END %]
116             </select>
117             <span>Select 'All libraries' if this authorized value must be displayed all the time. Otherwise select libraries you want to associate with this value.</span>
118         </li>
119
120                 </ol>
121         <div id="icons" class="toptabs" style="clear:both">
122         <h5 style="margin-left:10px;">Choose an icon:</h5>
123                         <ul>
124                   <li><a href="#none">None</a></li>
125                                   [% FOREACH imageset IN imagesets %]
126                         [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
127                                   [% END %]
128                         </ul>
129   <div id="none"><ul>
130   <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
131   </ul>
132   <br class="clear" /></div>
133   [% FOREACH imageset IN imagesets %]
134   <div id="[% imageset.imagesetname %]"><ul>
135   [% FOREACH image IN imageset.images %]
136                         <li style="float: none; display: inline-block; clear : none; width: auto;">
137             <label> [% IF ( image.StaffImageUrl ) %]
138               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
139         [% ELSE %]
140         [% END %]
141     [% IF ( image.checked ) %]
142               <input type="radio" name="imageurl" value="[% image.KohaImage %]" checked="checked" />
143     [% ELSE %]
144               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
145               <input type="radio" name="imageurl" value="[% image.KohaImage %]" />
146               [% END %]
147     [% END %]
148             </label>
149                         </li>
150   [% END %]</ul>
151   <br class="clear" />
152   </div>
153   [% END %]
154   </div>
155         </fieldset>
156        <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
157         <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category %]">Cancel</a></fieldset>
158     </form>
159 [% END %]
160
161
162 [% IF op == 'list' %]
163
164 <div id="toolbar" class="btn-toolbar">
165     <a id="addauth" class="btn btn-small" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;category=[% category %]"><i class="icon-plus"> </i> New authorized value for [% category %]</a>
166     <a id="addcat" class="btn btn-small" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form"><i class="icon-plus"> </i> New category</a>
167 </div>
168
169 <h1>Authorized values</h1>
170 <div class="note"><strong>NOTE:</strong> If you change an authorized value code, existing records using it won't be updated. Changes to value descriptions will show immediately.</div>
171
172 [% FOR m IN messages %]
173     <div class="dialog [% m.type %]">
174         [% SWITCH m.code %]
175         [% CASE 'error_on_update' %]
176             An error occurred when updating this authorized value. Perhaps the value already exists.
177         [% CASE 'error_on_insert' %]
178             An error occurred when inserting this authorized value. Perhaps the value or the category already exists.
179         [% CASE 'error_on_delete' %]
180             An error occurred when deleting this authorized value. Check the logs.
181         [% CASE 'success_on_update' %]
182             Authorized value updated successfully.
183         [% CASE 'success_on_insert' %]
184             Authorized value added successfully.
185         [% CASE 'success_on_delete' %]
186             Authorized value deleted successfully.
187         [% CASE 'already_exists' %]
188             This authorized value already exists.
189         [% CASE %]
190             [% m.code %]
191         [% END %]
192     </div>
193 [% END %]
194
195 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post" id="category">
196   <label for="searchfield">Show category: </label>
197   <select name="searchfield" id="searchfield" size="1">
198   [% FOR c IN categories %]
199     [% IF c == searchfield %]
200       <option value="[% c %]" selected="selected">[% c %]</option>
201     [% ELSE %]
202       <option value="[% c %]">[% c %]</option>
203     [% END %]
204   [% END %]
205   <input type="submit" value="Submit" />
206 </form>
207 [% IF ( category == 'Bsort1' ) %]
208     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
209 [% END %]
210 [% IF ( category == 'Bsort2' ) %]
211     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
212 [% END %]
213 [% IF ( category == 'Asort1' ) %]
214     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
215 [% END %]
216 [% IF ( category == 'Asort2' ) %]
217     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
218 [% END %]
219 [% IF ( category == 'SUGGEST' ) %]
220     <p>Reasons to reject or accept patron suggestions</p>
221 [% END %]
222 [% IF ( category == 'DAMAGED' ) %]
223     <p>Statuses to describe a damaged item</p>
224 [% END %]
225 [% IF ( category == 'LOST' ) %]
226    <p>Statuses to describe a lost item</p>
227 [% END %]
228 [% IF ( category == 'MANUAL_INV' ) %]
229     <p>Additional values for manual invoice types</p>
230 [% END %]
231 [% IF ( category == 'BOR_NOTES' ) %]
232     <p>Values for custom patron notes</p>
233 [% END %]
234 [% IF ( category == 'LOC' ) %]
235     <p>Values for shelving locations</p>
236 [% END %]
237 [% IF ( category == 'CCODE' ) %]
238     <p>Values for collection codes</p>
239  [% END %]
240  [% IF ( category == 'NOT_LOAN' ) %]
241     <p>Statuses to describe why an item is not for loan</p>
242  [% END %]
243 <h3>Authorized values for category [% category %]:</h3>
244
245 [% IF ( loop ) %]<div id="pagertable_authorized_values">
246 </div>[% END %]
247
248 [% IF ( loop ) %]<table id="table_authorized_values">
249 <thead><tr>
250         <th>Authorized value</th>
251         <th>Description</th>
252         <th>Description (OPAC)</th>
253         <th>Icon</th>
254     <th>Branches limitations</th>
255         <th>Edit</th>
256         <th>Delete</th>
257         </tr>
258 </thead><tbody>
259 [% FOREACH loo IN loop %]
260 [% UNLESS ( loop.odd ) %]
261 <tr>
262 [% ELSE %]
263 <tr>
264 [% END %]
265         <td>[% loo.authorised_value %]</td>
266         <td>[% loo.lib %]</td>
267         <td>[% loo.lib_opac %]</td>
268         <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
269     <td>
270         [% IF loo.branches.size > 0 %]
271             [% branches_str = "" %]
272             [% FOREACH branch IN loo.branches %]
273                 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
274             [% END %]
275             <span href="#" title="[% branches_str %]">
276                 [% IF loo.branches.size > 1 %]
277                     [% loo.branches.size %] branches limitations
278                 [% ELSE %]
279                     [% loo.branches.size %] branch limitation
280                 [% END %]
281         [% ELSE %]
282             No limitation
283         [% END %]
284     </td>
285     <td><a href="/cgi-bin/koha/admin/authorised_values.pl?op=add_form&amp;id=[% loo.id %]">Edit</a></td>
286     <td><a class="delete" href="/cgi-bin/koha/admin/authorised_values.pl?op=delete&amp;searchfield=[% searchfield %]&amp;id=[% loo.id %]">Delete</a></td>
287 </tr>
288 [% END %]
289 </tbody></table>[% ELSE %]
290 <div class="dialog message">There are no authorized values defined for [% category %]</div>
291 [% END %]
292
293 [% IF ( isprevpage ) %]
294 <form class="inline" action="/cgi-bin/koha/admin/authorised_values.pl" method="post">
295 <input type="hidden" name="searchfield" value="[% searchfield %]" />
296         <input type="submit" value="&lt;&lt; Previous" /></form>
297 [% END %] 
298
299 [% END %]
300
301 </div>
302 </div>
303 <div class="yui-b">
304 [% INCLUDE 'admin-menu.inc' %]
305 </div>
306 </div>
307 [% INCLUDE 'intranet-bottom.inc' %]