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