Lines 133-143
Link Here
|
133 |
<label for="cyclical">Cyclical:</label> |
133 |
<label for="cyclical">Cyclical:</label> |
134 |
<select name="cyclical" id="cyclical"> |
134 |
<select name="cyclical" id="cyclical"> |
135 |
[% IF rota.cyclical %] |
135 |
[% IF rota.cyclical %] |
136 |
<option value="1" selected>Yes</option> |
136 |
<option value="1" selected="selected">Yes</option> |
137 |
<option value="0">No</option> |
137 |
<option value="0">No</option> |
138 |
[% ELSE %] |
138 |
[% ELSE %] |
139 |
<option value="1">Yes</option> |
139 |
<option value="1">Yes</option> |
140 |
<option value="0" selected>No</option> |
140 |
<option value="0" selected="selected">No</option> |
141 |
[% END %] |
141 |
[% END %] |
142 |
</select> |
142 |
</select> |
143 |
</li> |
143 |
</li> |
Lines 167-173
Link Here
|
167 |
</div> |
167 |
</div> |
168 |
[% END %] |
168 |
[% END %] |
169 |
|
169 |
|
170 |
<h2>Manage [% rota.title | html %] stages</h2> |
170 |
<h2>Manage <em>[% rota.title | html %]</em> stages</h2> |
171 |
<div id="ajax_status" |
171 |
<div id="ajax_status" |
172 |
data-saving-msg="Saving changes..." |
172 |
data-saving-msg="Saving changes..." |
173 |
data-success-msg="" |
173 |
data-success-msg="" |
Lines 180-216
Link Here
|
180 |
<span id="ajax_failed_msg"></span> |
180 |
<span id="ajax_failed_msg"></span> |
181 |
</div> |
181 |
</div> |
182 |
|
182 |
|
183 |
<form id="stage_form" method="post" enctype="multipart/form-data" class="validated"> |
183 |
<!-- Add stage modal --> |
184 |
<fieldset class="rows"> |
184 |
<div class="modal" id="addStageModal" tabindex="-1" role="dialog" aria-labelledby="addStageLabel"> |
185 |
<legend>Add stage</legend> |
185 |
<form id="stage_form" method="post" enctype="multipart/form-data" class="validated"> |
186 |
<ol> |
186 |
<div class="modal-dialog" role="document"> |
187 |
<li> |
187 |
<div class="modal-content"> |
188 |
<label class="required" for="branch">Library:</label> |
188 |
<div class="modal-header"> |
189 |
<select name="branchcode" id="branch"> |
189 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
190 |
[% FOREACH branch IN branches %] |
190 |
<h4 class="modal-title" id="addStageLabel">Add stage to <em>[% rota.title | html %]</em></h4> |
191 |
[% IF branch.branchcode == stage.branchcode_id %] |
191 |
</div> |
192 |
<option value="[% branch.branchcode | html %]" selected>[% Branches.GetName(branch.branchcode) | html %]</option> |
192 |
<div class="modal-body"> |
193 |
[% ELSE %] |
193 |
<fieldset class="rows"> |
194 |
<option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option> |
194 |
<ol> |
195 |
[% END %] |
195 |
<li> |
196 |
[% END %] |
196 |
<label class="required" for="branch">Library:</label> |
197 |
</select> |
197 |
<select name="branchcode" id="branch"> |
198 |
<span class="required">Required</span> |
198 |
[% FOREACH branch IN branches %] |
199 |
</li> |
199 |
[% IF branch.branchcode == stage.branchcode_id %] |
200 |
<li> |
200 |
<option value="[% branch.branchcode | html %]" selected="selected">[% Branches.GetName(branch.branchcode) | html %]</option> |
201 |
<label class="required" for="duration">Duration:</label> |
201 |
[% ELSE %] |
202 |
<input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)"> |
202 |
<option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option> |
203 |
<span class="required">Required</span> |
203 |
[% END %] |
204 |
</li> |
204 |
[% END %] |
205 |
</ol> |
205 |
</select> |
206 |
</fieldset> |
206 |
<span class="required">Required</span> |
207 |
<fieldset class="action"> |
207 |
</li> |
208 |
<input type="submit" value="Submit"> |
208 |
<li> |
209 |
</fieldset> |
209 |
<label class="required" for="duration">Duration:</label> |
210 |
<input type="hidden" name="stage_id" value="[% stage.id | html %]"> |
210 |
<input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)"> |
211 |
<input type="hidden" name="rota_id" value="[% rota_id | html %]"> |
211 |
<span class="required">Required</span> |
212 |
<input type="hidden" name="op" value="process_stage"> |
212 |
</li> |
213 |
</form> |
213 |
</ol> |
|
|
214 |
</fieldset> <!-- /.rows --> |
215 |
</div> <!-- /.modal-body --> |
216 |
<div class="modal-footer"> |
217 |
<input type="hidden" name="stage_id" value="[% stage.id | html %]"> |
218 |
<input type="hidden" name="rota_id" value="[% rota_id | html %]"> |
219 |
<input type="hidden" name="op" value="process_stage"> |
220 |
<button type="submit" class="btn btn-default">Save</button> |
221 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
222 |
</div> <!-- /.modal-footer --> |
223 |
</div> <!-- /.modal-content --> |
224 |
</div> <!-- /.modal-dialog --> |
225 |
</form> <!-- /#stage_form --> |
226 |
</div> <!-- /#addStageModal --> |
214 |
|
227 |
|
215 |
[% IF existing_stages.size > 0 %] |
228 |
[% IF existing_stages.size > 0 %] |
216 |
<div id="manage_stages"> |
229 |
<div id="manage_stages"> |
Lines 243-248
Link Here
|
243 |
[% END %] |
256 |
[% END %] |
244 |
</ul> |
257 |
</ul> |
245 |
</div> |
258 |
</div> |
|
|
259 |
[% ELSE %] |
260 |
|
261 |
<div class="dialog message"> |
262 |
<h4>This rota has no stages.</h4> |
263 |
<p><button type="button" data-toggle="modal" data-target="#addStageModal"><i class="fa fa-plus"></i> Add a stage</button></p> |
264 |
</div> |
265 |
|
246 |
[% END %] |
266 |
[% END %] |
247 |
|
267 |
|
248 |
<p><a href="stockrotation.pl">Return to rotas</a></p> |
268 |
<p><a href="stockrotation.pl">Return to rotas</a></p> |
Lines 269-275
Link Here
|
269 |
<select name="branchcode" id="branch"> |
289 |
<select name="branchcode" id="branch"> |
270 |
[% FOREACH branch IN branches %] |
290 |
[% FOREACH branch IN branches %] |
271 |
[% IF branch.branchcode == stage.branchcode_id %] |
291 |
[% IF branch.branchcode == stage.branchcode_id %] |
272 |
<option value="[% branch.branchcode | html %]" selected>[% Branches.GetName(branch.branchcode) | html %]</option> |
292 |
<option value="[% branch.branchcode | html %]" selected="selected">[% Branches.GetName(branch.branchcode) | html %]</option> |
273 |
[% ELSE %] |
293 |
[% ELSE %] |
274 |
<option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option> |
294 |
<option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option> |
275 |
[% END %] |
295 |
[% END %] |
Lines 332-369
Link Here
|
332 |
</div> |
352 |
</div> |
333 |
[% END %] |
353 |
[% END %] |
334 |
|
354 |
|
335 |
<h2>Manage [% rota.title | html %] items</h2> |
355 |
<h2>Manage items assigned to <em>[% rota.title | html %]</em></h2> |
336 |
|
356 |
|
337 |
<div> |
357 |
<!-- Add items modal --> |
|
|
358 |
<div class="modal" id="addItemsModal" tabindex="-1" role="dialog" aria-labelledby="addItemsLabel"> |
338 |
<form id="add_rota_item_form" method="post" enctype="multipart/form-data" class="validated"> |
359 |
<form id="add_rota_item_form" method="post" enctype="multipart/form-data" class="validated"> |
339 |
<fieldset class="rows"> |
360 |
<div class="modal-dialog" role="document"> |
340 |
<legend>Add item to "[% rota.title | html %]"</legend> |
361 |
<div class="modal-content"> |
341 |
<ol> |
362 |
<div class="modal-header"> |
342 |
<li> |
363 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
343 |
<label for="barcode">Barcode:</label> |
364 |
<h4 class="modal-title" id="addItemsLabel">Add item to <em>[% rota.title | html %]</em></h4> |
344 |
<input type="text" id="barcode" name="barcode" placeholder="Item barcode" autofocus> |
365 |
</div> |
345 |
</li> |
366 |
<div class="modal-body"> |
346 |
</ol> |
367 |
<fieldset class="rows"> |
347 |
</fieldset> |
368 |
<legend>Add an item by barcode</legend> |
348 |
<fieldset class="rows"> |
369 |
<ol> |
349 |
<legend>Use a barcode file</legend> |
370 |
<li> |
350 |
<ol> |
371 |
<label for="barcode">Barcode:</label> |
351 |
<li> |
372 |
<input type="text" id="barcode" name="barcode" placeholder="Item barcode" autofocus> |
352 |
<label for="barcodefile">Barcode file:</label> |
373 |
</li> |
353 |
<input type="file" id="barcodefile" name="barcodefile"> |
374 |
</ol> |
354 |
</li> |
375 |
</fieldset> |
355 |
</ol> |
376 |
<fieldset class="rows"> |
356 |
</fieldset> |
377 |
<legend>Use a barcode file</legend> |
357 |
<fieldset class="action"> |
378 |
<ol> |
358 |
<input type="submit" value="Save"> |
379 |
<li> |
359 |
</fieldset> |
380 |
<label for="barcodefile">Barcode file:</label> |
360 |
<input type="hidden" name="rota_id" value="[% rota.id | html %]"> |
381 |
<input type="file" id="barcodefile" name="barcodefile"> |
361 |
<input type="hidden" name="op" value="add_items_to_rota"> |
382 |
</li> |
362 |
</form> |
383 |
</ol> |
363 |
</div> |
384 |
</fieldset> <!-- /.rows --> |
|
|
385 |
</div> <!-- /.modal-body --> |
386 |
<div class="modal-footer"> |
387 |
<input type="hidden" name="rota_id" value="[% rota.id | html %]"> |
388 |
<input type="hidden" name="op" value="add_items_to_rota"> |
389 |
<button type="submit" class="btn btn-default">Save</button> |
390 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
391 |
</div> <!-- /.modal-footer --> |
392 |
</div> <!-- /.modal-content --> |
393 |
</div> <!-- /.modal-dialog --> |
394 |
</form> <!-- /#dd_rota_item_form --> |
395 |
</div> <!-- /#addItemsModal --> |
364 |
|
396 |
|
365 |
[% IF items.count > 0 %] |
397 |
[% IF items.count > 0 %] |
366 |
<h3>Manage items assigned to "[% rota.title | html %]"</h3> |
|
|
367 |
<table id="stock_rotation_manage_items" class="items_table" role="grid"> |
398 |
<table id="stock_rotation_manage_items" class="items_table" role="grid"> |
368 |
<thead> |
399 |
<thead> |
369 |
<tr> |
400 |
<tr> |
Lines 434-439
Link Here
|
434 |
[% END %] |
465 |
[% END %] |
435 |
</tbody> |
466 |
</tbody> |
436 |
</table> |
467 |
</table> |
|
|
468 |
[% ELSE %] |
469 |
|
470 |
<div class="dialog message"> |
471 |
<h4>There are no items assigned to this rota.</h4> |
472 |
<p><button type="button" data-toggle="modal" data-target="#addItemsModal"><i class="fa fa-plus"></i> Add items</button></p> |
473 |
</div> |
474 |
|
437 |
[% END %] |
475 |
[% END %] |
438 |
|
476 |
|
439 |
<p><a href="stockrotation.pl">Return to rotas</a></p> |
477 |
<p><a href="stockrotation.pl">Return to rotas</a></p> |
Lines 504-509
Link Here
|
504 |
|
542 |
|
505 |
<div class="col-sm-2 col-sm-pull-10"> |
543 |
<div class="col-sm-2 col-sm-pull-10"> |
506 |
<aside> |
544 |
<aside> |
|
|
545 |
[% IF ( op == 'manage_stages' || op == 'manage_items' ) %] |
546 |
<div id="menu"> |
547 |
<ul> |
548 |
[% IF op == 'manage_stages' %] |
549 |
<li class="active"> |
550 |
[% ELSE %] |
551 |
<li> |
552 |
[% END %] |
553 |
<a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&rota_id=[% rota_id | uri %]">Manage stages</a> |
554 |
</li> |
555 |
[% IF op == 'manage_items' %] |
556 |
<li class="active"> |
557 |
[% ELSE %] |
558 |
<li> |
559 |
[% END %] |
560 |
<a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_items&rota_id=[% rota_id | uri %]">Manage items</a> |
561 |
</li> |
562 |
</ul> |
563 |
</div> |
564 |
[% END %] |
507 |
[% INCLUDE 'tools-menu.inc' %] |
565 |
[% INCLUDE 'tools-menu.inc' %] |
508 |
</aside> |
566 |
</aside> |
509 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
567 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
Lines 517-522
Link Here
|
517 |
<script> |
575 |
<script> |
518 |
var stock_rotation_items_columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %]; |
576 |
var stock_rotation_items_columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %]; |
519 |
var stock_rotation_columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %]; |
577 |
var stock_rotation_columns_settings = [% ColumnsSettings.GetColumns( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %]; |
|
|
578 |
$("#addStageModal, #addItemsModal").on("shown.bs.modal", function(){ |
579 |
$("#branch, #barcode").focus(); |
580 |
}); |
520 |
</script> |
581 |
</script> |
521 |
[% END %] |
582 |
[% END %] |
522 |
|
583 |
|
523 |
- |
|
|