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