Bug 11605: fallback to default DataTables settings where possible
[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-selected {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, existing records using it won't be updated.</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="16" maxlength="16" 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 if this authorized value must to be displayed all the time. Otherwise select libraries you want to associate with this value.
114             </span>
115         </li>
116
117                 </ol>
118         <div id="icons" class="toptabs" style="clear:both">
119         <h5 style="margin-left:10px;">Choose an icon:</h5>
120                         <ul>
121                   <li><a href="#none">None</a></li>
122                                   [% FOREACH imageset IN imagesets %]
123                         [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-selected">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
124                                   [% END %]
125                         </ul>
126   <div id="none"><ul>
127   <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
128   </ul>
129   <br class="clear" /></div>
130   [% FOREACH imageset IN imagesets %]
131   <div id="[% imageset.imagesetname %]"><ul>
132   [% FOREACH image IN imageset.images %]
133                         <li style="float: none; display: inline-block; clear : none; width: auto;">
134             <label> [% IF ( image.StaffImageUrl ) %]
135               <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
136         [% ELSE %]
137         [% END %]
138     [% IF ( image.checked ) %]
139               <input type="radio" name="imageurl" value="[% image.KohaImage %]" checked="checked" />
140     [% ELSE %]
141               [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
142               <input type="radio" name="imageurl" value="[% image.KohaImage %]" />
143               [% END %]
144     [% END %]
145             </label>
146                         </li>
147   [% END %]</ul>
148   <br class="clear" />
149   </div>
150   [% END %]
151   </div>
152         </fieldset>
153        <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
154         <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category %]">Cancel</a></fieldset>
155     </form>
156 [% END %]
157
158
159 [% IF ( delete_confirm ) %]
160         <div class="dialog alert">
161 <h3>Confirm deletion</h3>
162 <table>
163         <tr>
164                 <th>Category</th>
165                 <th>Value</th>
166                 <th>Description</th>
167                 <th>Description (OPAC)</th>
168         </tr>
169         <tr>
170             <td>[% searchfield %]</td>
171             <td>[% Tvalue %]</td>
172             <td>[% Tlib %]</td>
173             <td>[% Tlib_opac %]</td>
174         </tr>
175         </table>
176         <form action="[% script_name %]" method="post">
177                 <input type="hidden" name="op" value="delete_confirmed" />
178                 <input type="hidden" name="id" value="[% id %]" />
179         <input type="hidden" name="searchfield" value="[% searchfield %]" /><fieldset class="action"><input type="submit" value="Yes, delete" class="approve" /></form>
180 <form action="[% script_name %]" method="get"><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="No, do not delete" class="deny" /></form>
181 </div>
182 [% END %]
183
184 [% IF ( else ) %]
185
186 <div id="toolbar" class="btn-toolbar">
187     <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>
188     <a id="addcat" class="btn btn-small" href= "/cgi-bin/koha/admin/authorised_values.pl?op=add_form">New category</a>
189 </div>
190
191 <h1>Authorized values</h1>
192 <div class="note"><strong>NOTE:</strong> If you change an authorized value, existing records using it won't be updated.</div>
193
194 [% IF ( duplicate_category ) %]
195 <div class="dialog alert">Could not add value &quot;[% duplicate_value %]&quot; for category &quot;[% duplicate_category %]&quot; &mdash; value already present.
196 </div>
197 [% END %]
198 <form action="/cgi-bin/koha/admin/authorised_values.pl" method="post" id="category"><label for="searchfield">Show category: </label>[% tab_list %] <input type="submit" value="Submit" /></form>
199 [% IF ( category == 'Bsort1' ) %]
200     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
201 [% END %]
202 [% IF ( category == 'Bsort2' ) %]
203     <p>An authorized value attached to patrons, that can be used for stats purposes</p>
204 [% END %]
205 [% IF ( category == 'Asort1' ) %]
206     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
207 [% END %]
208 [% IF ( category == 'Asort2' ) %]
209     <p>An authorized value attached to acquisitions, that can be used for stats purposes</p>
210 [% END %]
211 [% IF ( category == 'SUGGEST' ) %]
212     <p>Reasons to reject or accept patron suggestions</p>
213 [% END %]
214 [% IF ( category == 'DAMAGED' ) %]
215     <p>Statuses to describe a damaged item</p>
216 [% END %]
217 [% IF ( category == 'LOST' ) %]
218    <p>Statuses to describe a lost item</p>
219 [% END %]
220 [% IF ( category == 'MANUAL_INV' ) %]
221     <p>Additional values for manual invoice types</p>
222 [% END %]
223 [% IF ( category == 'BOR_NOTES' ) %]
224     <p>Values for custom patron notes</p>
225 [% END %]
226 [% IF ( category == 'LOC' ) %]
227     <p>Values for shelving locations</p>
228 [% END %]
229 [% IF ( category == 'CCODE' ) %]
230     <p>Values for collection codes</p>
231  [% END %]
232  [% IF ( category == 'NOT_LOAN' ) %]
233     <p>Statuses to describe why an item is not for loan</p>
234  [% END %]
235 <h3>Authorized values for category [% category %]:</h3>
236
237 [% IF ( loop ) %]<div id="pagertable_authorized_values">
238 </div>[% END %]
239
240 [% IF ( loop ) %]<table id="table_authorized_values">
241 <thead><tr>
242         <th>Authorized value</th>
243         <th>Description</th>
244         <th>Description (OPAC)</th>
245         <th>Icon</th>
246     <th>Branches limitations</th>
247         <th>Edit</th>
248         <th>Delete</th>
249         </tr>
250 </thead><tbody>
251 [% FOREACH loo IN loop %]
252 [% UNLESS ( loop.odd ) %]
253 <tr>
254 [% ELSE %]
255 <tr>
256 [% END %]
257         <td>[% loo.authorised_value %]</td>
258         <td>[% loo.lib %]</td>
259         <td>[% loo.lib_opac %]</td>
260         <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
261     <td>
262         [% IF loo.branches.size > 0 %]
263             [% branches_str = "" %]
264             [% FOREACH branch IN loo.branches %]
265                 [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
266             [% END %]
267             <span href="#" title="[% branches_str %]">
268                 [% IF loo.branches.size > 1 %]
269                     [% loo.branches.size %] branches limitations
270                 [% ELSE %]
271                     [% loo.branches.size %] branch limitation
272                 [% END %]
273         [% ELSE %]
274             No limitation
275         [% END %]
276     </td>
277         <td><a href="[% loo.edit %]">Edit</a></td>
278         <td><a href="[% loo.delete %]">Delete</a></td>
279 </tr>
280 [% END %]
281 </tbody></table>[% ELSE %]
282 <div class="dialog message">There are no authorized values defined for [% category %]</div>
283 [% END %]
284
285 [% IF ( isprevpage ) %]
286 <form class="inline" action="[% script_name %]" method="post">
287 <input type="hidden" name="offset" value="[% prevpage %]" /><input type="hidden" name="searchfield" value="[% searchfield %]" />
288         <input type="submit" value="&lt;&lt; Previous" /></form>
289 [% END %] 
290
291 [% END %]
292
293 </div>
294 </div>
295 <div class="yui-b">
296 [% INCLUDE 'admin-menu.inc' %]
297 </div>
298 </div>
299 [% INCLUDE 'intranet-bottom.inc' %]