Line 0
Link Here
|
|
|
1 |
[% USE Koha %] |
2 |
[% USE Branches %] |
3 |
[% USE KohaDates %] |
4 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
<title>Koha › Stock rotation</title> |
6 |
[% INCLUDE 'doc-head-close.inc' %] |
7 |
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> |
8 |
[% INCLUDE 'datatables.inc' %] |
9 |
<script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/stockrotation.js"></script> |
10 |
<script type="text/javascript"> |
11 |
//<![CDATA[ |
12 |
$(document).ready(function() { |
13 |
$('#sr_manage_items').dataTable($.extend(true, {}, dataTablesDefaults, { |
14 |
"autoWidth": false, |
15 |
"aoColumnDefs": [ |
16 |
{ "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, |
17 |
{ "bSortable": true, "bSearchable": false, 'aTargets': [ 'NoSearch' ] } |
18 |
], |
19 |
"sPaginationType": "four_button" |
20 |
})); |
21 |
}); |
22 |
//]]> |
23 |
</script> |
24 |
</head> |
25 |
|
26 |
<body> |
27 |
[% INCLUDE 'header.inc' %] |
28 |
[% INCLUDE 'patron-search.inc' %] |
29 |
|
30 |
<div id="breadcrumbs"> |
31 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
32 |
› <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> |
33 |
|
34 |
[% IF no_op_set %] |
35 |
› Stock rotation |
36 |
[% ELSE %] |
37 |
› <a href="/cgi-bin/koha/tools/stockrotation.pl">Stock rotation</a> |
38 |
[% END %] |
39 |
|
40 |
[% IF (op == 'create_edit_rota' && rota.rota_id) %] |
41 |
› Edit rota |
42 |
[% ELSIF (op == 'create_edit_rota' && !rota.rota_id) %] |
43 |
› Create rota |
44 |
[% ELSIF (op == 'manage_stages') %] |
45 |
› Manage stages |
46 |
[% ELSIF (op == 'create_edit_stage' && stage.id) %] |
47 |
<a href="?op=manage_stages&rota_id=[% rota_id %]">› Manage stages</a> |
48 |
› Edit stage |
49 |
[% ELSIF (op == 'create_edit_stage' && !stage.id) %] |
50 |
<a href="?op=manage_stages&rota_id=[% rota_id %]">› Manage stages</a> |
51 |
› Create stage |
52 |
[% ELSIF (op == 'manage_items') %] |
53 |
› Manage items |
54 |
[% END %] |
55 |
|
56 |
</div> |
57 |
|
58 |
<div id="doc3" class="yui-t2"> |
59 |
<div id="bd"> |
60 |
<div id="yui-main"> |
61 |
<div id="stockrotation" class="yui-b"> |
62 |
|
63 |
<h1>Stock rotation</h1> |
64 |
|
65 |
[% IF no_op_set %] |
66 |
|
67 |
[% INCLUDE 'stockrotation-toolbar.inc' %] |
68 |
|
69 |
[% IF existing_rotas.size > 0 %] |
70 |
<h3>Manage existing rotas</h3> |
71 |
<table class="rotas_table" role="grid"> |
72 |
<thead> |
73 |
<th>Name</th> |
74 |
<th>Cyclical</th> |
75 |
<th>Active</th> |
76 |
<th>Description</th> |
77 |
<th>Number of items</th> |
78 |
<th> </th> |
79 |
</thead> |
80 |
<tbody> |
81 |
[% FOREACH rota IN existing_rotas %] |
82 |
<tr> |
83 |
<td>[% rota.title %]</td> |
84 |
<td>[% rota.cyclical ? 'Yes' : 'No'%]</td> |
85 |
<td>[% rota.active ? 'Yes' : 'No'%]</td> |
86 |
<td>[% rota.description %]</td> |
87 |
<td>[% rota.stockrotationitems.count %]</td> |
88 |
<td class="actions"> |
89 |
<a class="btn btn-mini" href="?op=create_edit_rota&rota_id=[% rota.rota_id %]"> |
90 |
<i class="fa fa-pencil"></i> |
91 |
Edit |
92 |
</a> |
93 |
<div class="btn-group" role="group"> |
94 |
<button type="button" class="btn btn-mini dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
95 |
Manage |
96 |
<i class="fa fa-caret-down"></i> |
97 |
</button> |
98 |
<ul class="dropdown-menu"> |
99 |
<li><a href="?op=manage_stages&rota_id=[% rota.rota_id %]">Stages</a></li> |
100 |
[% IF CAN_user_stockrotation_can_add_items_rotas && rota.stockrotationstages.count > 0 %] |
101 |
<li><a href="?op=manage_items&rota_id=[% rota.rota_id %]">Items</a></li> |
102 |
[% END %] |
103 |
</ul> |
104 |
</div> |
105 |
<a class="btn btn-mini" href="?op=toggle_rota&rota_id=[% rota.rota_id %]"> |
106 |
<i class="fa fa-power-off"></i> |
107 |
[% IF !rota.active %] |
108 |
Activate |
109 |
[% ELSE %] |
110 |
Deactivate |
111 |
[% END %] |
112 |
</a> |
113 |
</td> |
114 |
</tr> |
115 |
[% END %] |
116 |
</tbody> |
117 |
</table> |
118 |
[% END %] |
119 |
|
120 |
[% ELSIF (op == 'create_edit_rota') %] |
121 |
|
122 |
[% IF rota.rota_id %] |
123 |
<h3>Edit "[% rota.title %]"</h3> |
124 |
[% ELSE %] |
125 |
<h3>Create new rota</h3> |
126 |
[% END %] |
127 |
|
128 |
[% IF error == 'invalid_form' %] |
129 |
<div class="dialog alert"> |
130 |
<h3>There was a problem with your form submission</h3> |
131 |
</div> |
132 |
[% END %] |
133 |
|
134 |
<form id="rota_form" method="post" enctype="multipart/form-data" class="validated"> |
135 |
<fieldset class="rows"> |
136 |
<ol> |
137 |
<li> |
138 |
<label class="required" for="title">Name:</label> |
139 |
<input type="text" id="title" name="title" value="[% rota.title %]" required="required" placeholder="Rota name"> |
140 |
<span class="required">Required</span> |
141 |
</li> |
142 |
<li> |
143 |
<label for="cyclical">Cyclical:</label> |
144 |
<select name="cyclical" id="cyclical"> |
145 |
[% IF rota.cyclical %] |
146 |
<option value="1" selected>Yes</option> |
147 |
<option value="0">No</option> |
148 |
[% ELSE %] |
149 |
<option value="1">Yes</option> |
150 |
<option value="0" selected>No</option> |
151 |
[% END %] |
152 |
</select> |
153 |
</li> |
154 |
<li> |
155 |
<label for="active">Active:</label> |
156 |
<select name="active" id="active"> |
157 |
[% IF rota.active %] |
158 |
<option value="1" selected>Yes</option> |
159 |
<option value="0">No</option> |
160 |
[% ELSE %] |
161 |
<option value="1">Yes</option> |
162 |
<option value="0" selected>No</option> |
163 |
[% END %] |
164 |
</select> |
165 |
</li> |
166 |
<li> |
167 |
<label for="description">Description:</label> |
168 |
<textarea id="description" name="description" placeholder="Rota description">[% rota.description %]</textarea> |
169 |
</li> |
170 |
</ol> |
171 |
</fieldset> |
172 |
<fieldset class="action"> |
173 |
<input type="submit" value="Submit"> |
174 |
<a href="/cgi-bin/koha/tools/stockrotation.pl" class="cancel">Cancel</a> |
175 |
</fieldset> |
176 |
[% IF rota.rota_id %] |
177 |
<input type="hidden" name="id" value="[% rota.rota_id %]"> |
178 |
[% END %] |
179 |
<input type="hidden" name="op" value="process_rota"> |
180 |
</form> |
181 |
|
182 |
[% ELSIF (op == 'manage_stages') %] |
183 |
|
184 |
[% INCLUDE 'stockrotation-toolbar.inc' %] |
185 |
|
186 |
[% IF existing_stages.size > 0 %] |
187 |
<div id="manage_stages"> |
188 |
<h3>Manage stages</h3> |
189 |
<div id="ajax_status" |
190 |
data-saving-msg="Saving changes..." |
191 |
data-success-msg="" |
192 |
data-failed-msg="Error: "> |
193 |
<span id="ajax_saving_msg"></span> |
194 |
<i id="ajax_saving_icon" class="fa fa-spinner fa-spin"></i> |
195 |
<i id="ajax_success_icon" class="fa fa-check"></i> |
196 |
<i id="ajax_failed_icon" class="fa fa-times"></i> |
197 |
<span id="ajax_success_msg"></span> |
198 |
<span id="ajax_failed_msg"></span> |
199 |
</div> |
200 |
<div id="manage_stages_help"> |
201 |
Stages can be re-ordered by using the <i class="drag_handle fa fa-lg fa-bars"></i>handle to drag and drop them to their new position |
202 |
</div> |
203 |
<div id="stage_list_headings"> |
204 |
<span class="stagename">Branch</span> |
205 |
<span class="stageduration">Duration (days)</span> |
206 |
</div> |
207 |
<ul id="sortable_stages" data-rota-id="[% rota.rota_id %]"> |
208 |
[% FOREACH stage IN existing_stages %] |
209 |
<li id="stage_[% stage.stage_id %]"> |
210 |
<span data-toggle="tooltip" title="Drag and drop to move this stage to another position" data-placement="right" class="stagename"> |
211 |
[% IF existing_stages.size > 1 %] |
212 |
<i class="drag_handle fa fa-lg fa-bars"></i> |
213 |
[% END %] |
214 |
[% Branches.GetName(stage.branchcode_id) %] |
215 |
</span> |
216 |
<span class="stageduration">[% stage.duration %]</span> |
217 |
<span class="stageactions"> |
218 |
<a class="btn btn-mini" href="?op=create_edit_stage&stage_id=[% stage.stage_id %]"> |
219 |
<i class="fa fa-pencil"></i> Edit |
220 |
</a> |
221 |
<a class="btn btn-mini" href="?op=confirm_delete_stage&stage_id=[% stage.stage_id %]"> |
222 |
<i class="fa fa-trash"></i> Delete |
223 |
</a> |
224 |
</span> |
225 |
</li> |
226 |
[% END %] |
227 |
</ul> |
228 |
</div> |
229 |
[% END %] |
230 |
|
231 |
<p><a href="stockrotation.pl">Return to rotas</a></p> |
232 |
|
233 |
[% ELSIF (op == 'create_edit_stage') %] |
234 |
|
235 |
[% IF stage.id %] |
236 |
<h3>Edit "[% Branches.GetName(stage.branchcode_id) %]"</h3> |
237 |
[% ELSE %] |
238 |
<h3>Create new stage</h3> |
239 |
[% END %] |
240 |
|
241 |
[% IF error == 'invalid_form' %] |
242 |
<div class="dialog alert"> |
243 |
<h3>There was a problem with your form submission</h3> |
244 |
</div> |
245 |
[% END %] |
246 |
|
247 |
<form id="stage_form" method="post" enctype="multipart/form-data" class="validated"> |
248 |
<fieldset class="rows"> |
249 |
<ol> |
250 |
<li> |
251 |
<label class="required" for="branch">Branch:</label> |
252 |
<select name="branchcode" id="branch"> |
253 |
[% FOREACH branch IN branches %] |
254 |
[% IF branch.branchcode == stage.branchcode_id %] |
255 |
<option value="[% branch.branchcode %]" selected>[% Branches.GetName(branch.branchcode) %]</option> |
256 |
[% ELSE %] |
257 |
<option value="[% branch.branchcode %]">[% Branches.GetName(branch.branchcode) %]</option> |
258 |
[% END %] |
259 |
[% END %] |
260 |
</select> |
261 |
<span class="required">Required</span> |
262 |
</li> |
263 |
<li> |
264 |
<label class="required" for="duration">Duration:</label> |
265 |
<input type="text" id="duration" name="duration" value="[% stage.duration %]" required="required" placeholder="Duration (days)"> |
266 |
<span class="required">Required</span> |
267 |
</li> |
268 |
</ol> |
269 |
</fieldset> |
270 |
<fieldset class="action"> |
271 |
<input type="submit" value="Submit"> |
272 |
<a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&rota_id=[% rota_id %]" class="cancel">Cancel</a> |
273 |
</fieldset> |
274 |
<input type="hidden" name="stage_id" value="[% stage.id %]"> |
275 |
<input type="hidden" name="rota_id" value="[% rota_id %]"> |
276 |
<input type="hidden" name="op" value="process_stage"> |
277 |
</form> |
278 |
[% ELSIF (op == 'confirm_remove_from_rota') %] |
279 |
|
280 |
<div class="dialog alert"> |
281 |
<h3>Are you sure you wish to remove this item from it's rota</h3> |
282 |
<p> |
283 |
<a class="btn approve" href="?op=remove_item_from_stage&item_id=[% item_id %]&stage_id=[% stage_id %]&rota_id=[% rota_id %]"><i class="fa fa-fw fa-check"></i>Yes</a> |
284 |
<a class="btn deny" href="?op=manage_items&rota_id=[% rota_id %]"><i class="fa fa-fw fa-remove"></i>No</a> |
285 |
</p> |
286 |
</div> |
287 |
[% ELSIF (op == 'confirm_delete_stage') %] |
288 |
|
289 |
<div class="dialog alert"> |
290 |
<h3>Are you sure you want to delete this stage?</h3> |
291 |
[% IF stage.stockrotationitems.count > 0 %] |
292 |
<p>This stage contains the following item(s):</p> |
293 |
<ul> |
294 |
[% FOREACH item IN stage.stockrotationitems %] |
295 |
<li>[% item.itemnumber.biblio.title %] (Barcode: [% item.itemnumber.barcode %])</li> |
296 |
[% END %] |
297 |
</ul> |
298 |
[% END %] |
299 |
<p> |
300 |
<a class="btn approve" href="?op=delete_stage&stage_id=[% stage.stage_id %]"><i class="fa fa-fw fa-check"></i>Yes</a> |
301 |
<a class="btn deny" href="?op=manage_stages&rota_id=[% stage.rota.rota_id %]"><i class="fa fa-fw fa-remove"></i>No</a> |
302 |
</p> |
303 |
</div> |
304 |
[% ELSIF (op == 'manage_items') %] |
305 |
|
306 |
[% INCLUDE 'stockrotation-toolbar.inc' %] |
307 |
|
308 |
[% IF error %] |
309 |
<div class="dialog alert"> |
310 |
[% IF error == "item_not_found" %] |
311 |
<h3>The item was not found</h3> |
312 |
[% ELSIF error == "already_on_rota" %] |
313 |
<h3>This item is already on this rota</h3> |
314 |
[% END %] |
315 |
</div> |
316 |
[% END %] |
317 |
|
318 |
<div> |
319 |
<form id="add_rota_item_form" method="post" enctype="multipart/form-data" class="validated"> |
320 |
<fieldset class="rows"> |
321 |
<legend>Add item to "[% rota.title %]"</legend> |
322 |
<ol> |
323 |
<li> |
324 |
<label for="barcode">Barcode:</label> |
325 |
<input type="text" id="barcode" name="barcode" placeholder="Item barcode" autofocus> |
326 |
</li> |
327 |
</ol> |
328 |
</fieldset> |
329 |
<fieldset class="rows"> |
330 |
<legend>Use a barcode file</legend> |
331 |
<ol> |
332 |
<li> |
333 |
<label for="barcodefile">Barcode file:</label> |
334 |
<input type="file" id="barcodefile" name="barcodefile"> |
335 |
</li> |
336 |
</ol> |
337 |
</fieldset> |
338 |
<fieldset class="action"> |
339 |
<input type="submit" value="Submit"> |
340 |
</fieldset> |
341 |
<input type="hidden" name="rota_id" value="[% rota.id %]"> |
342 |
<input type="hidden" name="op" value="add_items_to_rota"> |
343 |
</form> |
344 |
</div> |
345 |
|
346 |
[% IF items.count > 0 %] |
347 |
<h3>Manage items assigned to "[% rota.title %]"</h3> |
348 |
<table id="sr_manage_items" class="items_table" role="grid"> |
349 |
<thead> |
350 |
<th>Barcode</th> |
351 |
<th>Title</th> |
352 |
<th>Author</th> |
353 |
<th>Shelfmark</th> |
354 |
<th class="NoSearch">In transit</th> |
355 |
<th class="NoSort">Stages & duration in days<br>(current stage highlighted)</th> |
356 |
<th class="NoSort"> </th> |
357 |
</thead> |
358 |
<tbody> |
359 |
[% FOREACH item IN items %] |
360 |
<tr> |
361 |
<td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% item.id %]&biblionumber=[% item.itemnumber.biblio.id %]#item[% item.id %]">[% item.itemnumber.barcode %]</a></td> |
362 |
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.itemnumber.biblio.id %]">[% item.itemnumber.biblio.title %]</a></td> |
363 |
<td>[% item.itemnumber.biblio.author %]</td> |
364 |
<td>[% item.itemnumber.itemcallnumber %]</td> |
365 |
<td>[% item.itemnumber.get_transfer ? 'Yes' : 'No' %]</td> |
366 |
<td> |
367 |
[% FOREACH this_stage IN stages %] |
368 |
[% IF this_stage.stage_id == item.stage.stage_id %] |
369 |
<span class="stage highlight_stage"> |
370 |
[% ELSE %] |
371 |
<span class="stage"> |
372 |
[% END %] |
373 |
[% Branches.GetName(this_stage.branchcode_id) %] ([% this_stage.duration %]) |
374 |
</span> |
375 |
» |
376 |
[% END %] |
377 |
[% IF stages.size > 0 %] |
378 |
<span class="stage">[% rota.cyclical ? 'START' : 'END' %]</span> |
379 |
[% END %] |
380 |
</td> |
381 |
<td class="actions"> |
382 |
[% in_transit = item.itemnumber.get_transfer %] |
383 |
[% IF !in_transit && stages.size > 1 %] |
384 |
<a class="btn btn-mini" href="?op=move_to_next_stage&rota_id=[% rota.id %]&item_id=[% item.id %]&stage_id=[% item.stage.stage_id %]"> |
385 |
[% ELSE %] |
386 |
<a class="btn btn-mini" disabled> |
387 |
[% END %] |
388 |
<i class="fa fa-arrow-right"></i> |
389 |
Move to next stage |
390 |
</a> |
391 |
[% IF !in_transit %] |
392 |
<a class="btn btn-mini" href="?op=toggle_in_demand&stage_id=[% item.stage.stage_id %]&item_id=[% item.id %]&rota_id=[% rota.id %]"> |
393 |
[% ELSE %] |
394 |
<a class="btn btn-mini" disabled> |
395 |
[% END %] |
396 |
<i class="fa fa-fire"></i> |
397 |
[% item.indemand ? 'Remove "In demand"' : 'Add "In demand"' %] |
398 |
</a> |
399 |
[% IF !in_transit %] |
400 |
<a class="btn btn-mini" href="?op=confirm_remove_from_rota&stage_id=[% item.stage.stage_id %]&item_id=[% item.id %]&rota_id=[% rota.id %]"> |
401 |
[% ELSE %] |
402 |
<a class="btn btn-mini" disabled> |
403 |
[% END %] |
404 |
<i class="fa fa-trash"></i> |
405 |
Remove from rota |
406 |
</a> |
407 |
</td> |
408 |
</tr> |
409 |
[% END %] |
410 |
</tbody> |
411 |
</table> |
412 |
[% END %] |
413 |
|
414 |
<p><a href="stockrotation.pl">Return to rotas</a></p> |
415 |
|
416 |
[% ELSIF op == 'add_items_to_rota' %] |
417 |
|
418 |
|
419 |
<div class="dialog message"> |
420 |
<h3>Add items to rota report</h3> |
421 |
</div> |
422 |
<div> |
423 |
[% IF barcode_status.ok.size > 0 %] |
424 |
<h4>Items added to rota:</h4> |
425 |
<ul> |
426 |
[% FOREACH item_ok IN barcode_status.ok %] |
427 |
<li>[% item_ok.biblio.title %]</li> |
428 |
[% END %] |
429 |
</ul> |
430 |
[% END %] |
431 |
[% IF barcode_status.on_this.size > 0 %] |
432 |
<h4>Items already on this rota:</h4> |
433 |
<ul> |
434 |
[% FOREACH item_on_this IN barcode_status.on_this %] |
435 |
<li>[% item_on_this.biblio.title %]</li> |
436 |
[% END %] |
437 |
</ul> |
438 |
[% END %] |
439 |
[% IF barcode_status.not_found.size > 0 %] |
440 |
<h4>Barcodes not found:</h4> |
441 |
<ul> |
442 |
[% FOREACH barcode_not_found IN barcode_status.not_found %] |
443 |
<li>[% barcode_not_found %]</li> |
444 |
[% END %] |
445 |
</ul> |
446 |
[% END %] |
447 |
[% IF barcode_status.on_other.size > 0 %] |
448 |
<h4>Items found on other rotas:</h4> |
449 |
<ul> |
450 |
[% FOREACH item_on_other IN barcode_status.on_other %] |
451 |
<li>[% item_on_other.biblio.title %]</li> |
452 |
[% END %] |
453 |
</ul> |
454 |
[% END %] |
455 |
</div> |
456 |
[% IF barcode_status.on_other.size > 0 %] |
457 |
<form id="add_rota_item_form" method="post" enctype="multipart/form-data"> |
458 |
<fieldset> |
459 |
<legend>Select items to move to this rota:</legend> |
460 |
[% FOREACH item_on_other IN barcode_status.on_other %] |
461 |
<li><input type="checkbox" name="move_item" value="[% item_on_other.itemnumber %]"> [% item_on_other.biblio.title %] (Currently on "[% item_on_other.stockrotationitem.stage.rota.title %]")</li> |
462 |
[% END %] |
463 |
|
464 |
</fieldset> |
465 |
<fieldset class="action"> |
466 |
<input type="submit" value="Submit"> |
467 |
</fieldset> |
468 |
<input type="hidden" name="rota_id" value="[% rota_id %]"> |
469 |
<input type="hidden" name="op" value="move_items_to_rota"> |
470 |
</form> |
471 |
[% END %] |
472 |
<p><a href="?op=manage_items&rota_id=[% rota_id %]">Return to rota</a></p> |
473 |
|
474 |
[% END %] |
475 |
</div> |
476 |
</div> |
477 |
<div class="yui-b"> |
478 |
[% INCLUDE 'tools-menu.inc' %] |
479 |
</div> |
480 |
</div> |
481 |
</div> |
482 |
[% INCLUDE 'intranet-bottom.inc' %] |