Bug 32355: Add css class url to URL syspref
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / stockrotation.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% USE TablesSettings %]
7 [% SET footerjs = 1 %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Stock rotation &rsaquo; Cataloging &rsaquo; Koha</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="tools_stockrotation" class="tools">
14 [% WRAPPER 'header.inc' %]
15     [% INCLUDE 'cat-search.inc' %]
16 [% END %]
17
18 [% WRAPPER 'sub-header.inc' %]
19 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
20     <ol>
21         <li>
22             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23         </li>
24         <li>
25             <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
26         </li>
27
28         [% IF no_op_set %]
29             <li>
30                 <a href="#" aria-current="page">
31                     Stock rotation
32                 </a>
33             </li>
34         [% ELSE %]
35             <li>
36                 <a href="/cgi-bin/koha/tools/stockrotation.pl">Stock rotation</a>
37             </li>
38         [% END %]
39
40         [% IF (op == 'create_edit_rota' && rota.rota_id) %]
41             <li>
42                 <a href="#" aria-current="page">
43                     Edit rota
44                 </a>
45             </li>
46         [% ELSIF (op == 'create_edit_rota' && !rota.rota_id) %]
47             <li>
48                 <a href="#" aria-current="page">
49                     Create rota
50                 </a>
51             </li>
52         [% ELSIF (op == 'manage_stages') %]
53             <li>
54                 <a href="#" aria-current="page">
55                     Manage stages
56                 </a>
57             </li>
58         [% ELSIF (op == 'create_edit_stage' && stage.id) %]
59             <li>
60                 <a href="?op=manage_stages&amp;rota_id=[% rota_id | uri %]">Manage stages</a>
61             </li>
62             <li>
63                 <a href="#" aria-current="page">
64                     Edit stage
65                 </a>
66             </li>
67         [% ELSIF (op == 'create_edit_stage' && !stage.id) %]
68             <li>
69                 <a href="?op=manage_stages&amp;rota_id=[% rota_id | uri %]">
70             </li>
71             <li>
72                 Manage stages</a>
73             </li>
74             <li>
75                 <a href="#" aria-current="page">
76                     Create stage
77                 </a>
78             </li>
79         [% ELSIF (op == 'manage_items') %]
80             <li>
81                 <a href="#" aria-current="page">
82                     Manage items
83                 </a>
84             </li>
85         [% END %]
86     </ol>
87 </nav>
88 [% END %]
89
90 <div class="main container-fluid">
91     <div class="row">
92         <div class="col-sm-10 col-sm-push-2">
93             <main>
94
95             <div id="stockrotation">
96
97                 [% IF no_op_set %]
98
99                     [% INCLUDE 'stockrotation-toolbar.inc' %]
100
101                     <h1>Stock rotation</h1>
102
103                     [% IF existing_rotas.size > 0 %]
104                         <div class="page-section">
105                             <table id="stock_rotation" class="rotas_table" role="grid">
106                                 <thead>
107                                     <tr>
108                                     <th class="anti-the">Name</th>
109                                     <th>Cyclical</th>
110                                     <th>Active</th>
111                                     <th>Description</th>
112                                     <th>Number of items</th>
113                                     <th class="NoSort noExport">&nbsp;</th>
114                                     </tr>
115                                 </thead>
116                                 <tbody>
117                                     [% FOREACH rota IN existing_rotas %]
118                                         <tr>
119                                             <td>[% rota.title | html %]</td>
120                                             <td>[% rota.cyclical ? 'Yes' : 'No' | html %]</td>
121                                             <td>[% rota.active ? 'Yes' : 'No' | html %]</td>
122                                             <td>[% rota.description | html %]</td>
123                                             <td>[% rota.stockrotationitems.count | html %]</td>
124                                             <td class="actions">
125                                                 <a class="btn btn-default btn-xs" href="?op=create_edit_rota&amp;rota_id=[% rota.rota_id | uri %]">
126                                                     <i class="fa fa-pencil"></i>
127                                                     Edit
128                                                 </a>
129                                                 <div class="btn-group dropup" role="group">
130                                                     <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
131                                                         Manage
132                                                         <i class="fa fa-caret-down"></i>
133                                                     </button>
134                                                     <ul class="dropdown-menu pull-right">
135                                                         <li><a href="?op=manage_stages&amp;rota_id=[% rota.rota_id | uri %]">Stages</a></li>
136                                                         [% IF CAN_user_stockrotation_manage_rota_items && rota.stockrotationstages.count > 0 %]
137                                                         <li><a href="?op=manage_items&amp;rota_id=[% rota.rota_id | uri %]">Items</a></li>
138                                                         [% END %]
139                                                     </ul>
140                                                 </div>
141                                                 <a class="btn btn-default btn-xs" href="?op=toggle_rota&amp;rota_id=[% rota.rota_id | uri %]">
142                                                     <i class="fa fa-power-off"></i>
143                                                     [% IF !rota.active %]
144                                                         Activate
145                                                     [% ELSE %]
146                                                         Deactivate
147                                                     [% END %]
148                                                 </a>
149                                             </td>
150                                         </tr>
151                                     [% END %]
152                                 </tbody>
153                             </table>
154                         </div><!-- /.page-section -->
155                     [% END %]
156
157                 [% ELSIF (op == 'create_edit_rota') %]
158
159                     [% IF rota.rota_id %]
160                         <h1>Edit "[% rota.title | html %]"</h1>
161                     [% ELSE %]
162                         <h1>Create new rota</h1>
163                     [% END %]
164
165                     [% IF error == 'invalid_form' %]
166                     <div class="dialog alert">
167                         <h3>There was a problem with your form submission</h3>
168                     </div>
169                     [% END %]
170
171                     <form id="rota_form" method="post" enctype="multipart/form-data" class="validated">
172                         <fieldset class="rows">
173                             <ol>
174                                 <li>
175                                     <label class="required" for="title">Name:</label>
176                                     <input type="text" id="title" name="title" value="[% rota.title | html %]" required="required" placeholder="Rota name">
177                                     <span class="required">Required</span>
178                                 </li>
179                                 <li>
180                                     <label for="cyclical">Cyclical:</label>
181                                     <select name="cyclical" id="cyclical">
182                                         [% IF rota.cyclical %]
183                                             <option value="1" selected="selected">Yes</option>
184                                             <option value="0">No</option>
185                                         [% ELSE %]
186                                             <option value="1">Yes</option>
187                                             <option value="0" selected="selected">No</option>
188                                         [% END %]
189                                     </select>
190                                 </li>
191                                 <li>
192                                     <label for="description">Description:</label>
193                                     <textarea id="description" name="description" placeholder="Rota description">[% rota.description | html %]</textarea>
194                                 </li>
195                             </ol>
196                         </fieldset>
197                         <fieldset class="action">
198                             <input type="submit" class="btn btn-primary" value="Save" />
199                             <a href="/cgi-bin/koha/tools/stockrotation.pl" class="cancel">Cancel</a>
200                         </fieldset>
201                         [% IF rota.rota_id %]
202                             <input type="hidden" name="id" value="[% rota.rota_id | html %]">
203                         [% END %]
204                         <input type="hidden" name="op" value="process_rota">
205                     </form>
206
207                 [% ELSIF (op == 'manage_stages') %]
208
209                     [% INCLUDE 'stockrotation-toolbar.inc' %]
210
211                     [% IF error == 'invalid_form' %]
212                     <div class="dialog alert">
213                         <h3>There was a problem with your form submission</h3>
214                     </div>
215                     [% END %]
216
217                     <h1>Manage <em>[% rota.title | html %]</em> stages</h1>
218                     <div id="ajax_status"
219                         data-saving-msg="Saving changes..."
220                         data-success-msg=""
221                         data-failed-msg="Error: ">
222                         <span id="ajax_saving_msg"></span>
223                         <i id="ajax_saving_icon" class="fa fa-spinner fa-spin"></i>
224                         <i id="ajax_success_icon" class="fa fa-check"></i>
225                         <i id="ajax_failed_icon" class="fa fa-times"></i>
226                         <span id="ajax_success_msg"></span>
227                         <span id="ajax_failed_msg"></span>
228                     </div>
229
230                     <!-- Add stage modal -->
231                     <div class="modal" id="addStageModal" tabindex="-1" role="dialog" aria-labelledby="addStageLabel">
232                         <form id="stage_form" method="post" enctype="multipart/form-data" class="validated">
233                             <div class="modal-dialog" role="document">
234                                 <div class="modal-content">
235                                     <div class="modal-header">
236                                         <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
237                                         <h4 class="modal-title" id="addStageLabel">Add stage to <em>[% rota.title | html %]</em></h4>
238                                     </div>
239                                     <div class="modal-body">
240                                         <fieldset class="rows">
241                                             <ol>
242                                                 <li>
243                                                     <label class="required" for="branch">Library:</label>
244                                                     <select name="branchcode" id="branch">
245                                                         [% FOREACH branch IN branches %]
246                                                             [% IF branch.branchcode == stage.branchcode_id %]
247                                                                 <option value="[% branch.branchcode | html %]" selected="selected">[% Branches.GetName(branch.branchcode) | html %]</option>
248                                                             [% ELSE %]
249                                                                 <option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option>
250                                                             [% END %]
251                                                         [% END %]
252                                                     </select>
253                                                     <span class="required">Required</span>
254                                                 </li>
255                                                 <li>
256                                                     <label class="required" for="duration">Duration:</label>
257                                                     <input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)">
258                                                     <span class="required">Required</span>
259                                                 </li>
260                                             </ol>
261                                         </fieldset> <!-- /.rows -->
262                                     </div> <!-- /.modal-body -->
263                                     <div class="modal-footer">
264                                         <input type="hidden" name="stage_id" value="[% stage.id | html %]">
265                                         <input type="hidden" name="rota_id" value="[% rota_id | html %]">
266                                         <input type="hidden" name="op" value="process_stage">
267                                         <button type="submit" class="btn btn-default">Save</button>
268                                         <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
269                                     </div> <!-- /.modal-footer -->
270                                 </div> <!-- /.modal-content -->
271                             </div> <!-- /.modal-dialog -->
272                         </form> <!-- /#stage_form -->
273                     </div> <!-- /#addStageModal -->
274
275                     [% IF existing_stages.size > 0 %]
276                         <div id="manage_stages" class="page-section">
277                             <div id="manage_stages_help">
278                                 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
279                             </div>
280                             <div id="stage_list_headings">
281                                 <span class="stagename">Library</span>
282                                 <span class="stageduration">Duration (days)</span>
283                             </div>
284                             <ul id="sortable_stages" data-rota-id="[% rota.rota_id | html %]">
285                                 [% FOREACH stage IN existing_stages %]
286                                     <li id="stage_[% stage.stage_id | html %]">
287                                         <span data-toggle="tooltip" title="Drag and drop to move this stage to another position" data-placement="right" class="stagename">
288                                             [% IF existing_stages.size > 1 %]
289                                                 <i class="drag_handle fa fa-lg fa-bars"></i>
290                                             [% END %]
291                                             [% Branches.GetName(stage.branchcode_id) | html %]
292                                         </span>
293                                         <span class="stageduration">[% stage.duration | html %]</span>
294                                         <span class="stageactions">
295                                             <a class="btn btn-default btn-xs" href="?op=create_edit_stage&amp;stage_id=[% stage.stage_id | uri %]">
296                                                 <i class="fa fa-pencil"></i> Edit
297                                             </a>
298                                             <a class="btn btn-default btn-xs" href="?op=confirm_delete_stage&amp;stage_id=[% stage.stage_id | uri %]">
299                                                 <i class="fa fa-trash"></i> Delete
300                                             </a>
301                                         </span>
302                                     </li>
303                                 [% END %]
304                             </ul>
305                         </div>
306                     [% ELSE %]
307
308                         <div class="dialog message">
309                             <h4>This rota has no stages.</h4>
310                             <p><button type="button" data-toggle="modal" data-target="#addStageModal"><i class="fa fa-plus"></i> Add a stage</button></p>
311                         </div>
312
313                     [% END %]
314
315                     <p><a href="stockrotation.pl">Return to rotas</a></p>
316
317                 [% ELSIF (op == 'create_edit_stage') %]
318
319                     [% IF stage.id %]
320                         <h1>Edit "[% Branches.GetName(stage.branchcode_id) | html %]"</h1>
321                     [% ELSE %]
322                         <h1>Create new stage</h1>
323                     [% END %]
324
325                     [% IF error == 'invalid_form' %]
326                     <div class="dialog alert">
327                         <h3>There was a problem with your form submission</h3>
328                     </div>
329                     [% END %]
330
331                     <form id="stage_form" method="post" enctype="multipart/form-data" class="validated">
332                         <fieldset class="rows">
333                             <ol>
334                                 <li>
335                                     <label class="required" for="branch">Library:</label>
336                                     <select name="branchcode" id="branch">
337                                         [% FOREACH branch IN branches %]
338                                             [% IF branch.branchcode == stage.branchcode_id %]
339                                                 <option value="[% branch.branchcode | html %]" selected="selected">[% Branches.GetName(branch.branchcode) | html %]</option>
340                                             [% ELSE %]
341                                                 <option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option>
342                                             [% END %]
343                                         [% END %]
344                                     </select>
345                                     <span class="required">Required</span>
346                                 </li>
347                                 <li>
348                                     <label class="required" for="duration">Duration:</label>
349                                     <input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)">
350                                     <span class="required">Required</span>
351                                 </li>
352                             </ol>
353                         </fieldset>
354                         <fieldset class="action">
355                             <input type="submit" class="btn btn-primary" value="Save" />
356                             <a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&amp;rota_id=[% rota_id | uri %]" class="cancel">Cancel</a>
357                         </fieldset>
358                         <input type="hidden" name="stage_id" value="[% stage.id | html %]">
359                         <input type="hidden" name="rota_id" value="[% rota_id | html %]">
360                         <input type="hidden" name="op" value="process_stage">
361                     </form>
362                 [% ELSIF (op == 'confirm_remove_from_rota') %]
363
364                     <div class="dialog alert">
365                         <h1>Are you sure you wish to remove this item from it's rota</h1>
366                         <p>
367                             <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&amp;item_id=[% item_id | uri %]&amp;stage_id=[% stage_id | uri %]&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
368                             <a class="btn btn-default btn-xs deny" href="?op=manage_items&amp;rota_id=[% rota_id | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
369                         </p>
370                     </div>
371                 [% ELSIF (op == 'confirm_delete_stage') %]
372
373                     <div class="dialog alert">
374                         <h1>Are you sure you want to delete this stage?</h1>
375                         [% IF stage.stockrotationitems.count > 0 %]
376                             <p>This stage contains the following item(s):</p>
377                             <ul>
378                                 [% FOREACH sritem IN stage.stockrotationitems %]
379                                     <li>[% sritem.item.biblio.title | html %] (Barcode: [% sritem.item.barcode | html %])</li>
380                                 [% END %]
381                             </ul>
382                         [% END %]
383                         <p>
384                             <a class="btn btn-default btn-xs approve" href="?op=delete_stage&amp;stage_id=[% stage.stage_id | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
385                             <a class="btn btn-default btn-xs deny" href="?op=manage_stages&amp;rota_id=[% stage.rota.rota_id | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
386                         </p>
387                     </div>
388                 [% ELSIF (op == 'manage_items') %]
389
390                     [% INCLUDE 'stockrotation-toolbar.inc' %]
391
392                     [% IF error %]
393                         <div class="dialog alert">
394                             [% IF error == "item_not_found" %]
395                                 <h3>The item was not found</h3>
396                             [% ELSIF error == "already_on_rota" %]
397                                 <h3>This item is already on this rota</h3>
398                             [% END %]
399                         </div>
400                     [% END %]
401
402                     <h1>Manage items assigned to <em>[% rota.title | html %]</em></h1>
403
404                     <!-- Add items modal -->
405                     <div class="modal" id="addItemsModal" tabindex="-1" role="dialog" aria-labelledby="addItemsLabel">
406                         <form id="add_rota_item_form" method="post" enctype="multipart/form-data" class="validated">
407                             <div class="modal-dialog" role="document">
408                                 <div class="modal-content">
409                                     <div class="modal-header">
410                                         <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
411                                         <h4 class="modal-title" id="addItemsLabel">Add item to <em>[% rota.title | html %]</em></h4>
412                                     </div>
413                                     <div class="modal-body">
414                                         <fieldset class="rows">
415                                             <legend>Add an item by barcode</legend>
416                                             <ol>
417                                                 <li>
418                                                     <label for="barcode">Barcode:</label>
419                                                     <input type="text" id="barcode" name="barcode" placeholder="Item barcode" autofocus>
420                                                 </li>
421                                             </ol>
422                                         </fieldset>
423                                         <fieldset class="rows">
424                                             <legend>Use a barcode file</legend>
425                                             <ol>
426                                                 <li>
427                                                     <label for="barcodefile">Barcode file:</label>
428                                                     <input type="file" id="barcodefile" name="barcodefile">
429                                                 </li>
430                                             </ol>
431                                         </fieldset> <!-- /.rows -->
432                                     </div> <!-- /.modal-body -->
433                                     <div class="modal-footer">
434                                         <input type="hidden" name="rota_id" value="[% rota.id | html %]">
435                                         <input type="hidden" name="op" value="add_items_to_rota">
436                                         <button type="submit" class="btn btn-default">Save</button>
437                                         <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
438                                     </div> <!-- /.modal-footer -->
439                                 </div> <!-- /.modal-content -->
440                             </div> <!-- /.modal-dialog -->
441                         </form> <!-- /#dd_rota_item_form -->
442                     </div> <!-- /#addItemsModal -->
443
444                     [% IF sritems.count > 0 %]
445                         <div class="page-section">
446                             <table id="stock_rotation_manage_items" class="items_table" role="grid">
447                                 <thead>
448                                     <tr>
449                                         <th>Barcode</th>
450                                         <th>Title</th>
451                                         <th>Author</th>
452                                         <th>Call number</th>
453                                         <th class="NoSearch">In transit</th>
454                                         <th class="NoSort noExport">Stages &amp; duration in days<br>(current stage highlighted)</th>
455                                         <th class="NoSort noExport">&nbsp;</th>
456                                     </tr>
457                                 </thead>
458                                 <tbody>
459                                     [% FOREACH sritem IN sritems %]
460                                         <tr>
461                                             <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=[% sritem.id | uri %]&amp;biblionumber=[% sritem.item.biblio.id | uri %]#item[% sritem.id | uri %]">[% sritem.item.barcode | html %]</a></td>
462                                             <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% sritem.item.biblio.id | uri %]">[% sritem.item.biblio.title | html %]</a></td>
463                                             <td>[% sritem.item.biblio.author | html %]</td>
464                                             <td>[% sritem.item.itemcallnumber | html %]</td>
465                                             <td>[% sritem.item.get_transfer ? 'Yes' : 'No' | html %]</td>
466                                             <td>
467                                                 [% FOREACH this_stage IN stages %]
468                                                     [% IF this_stage.stage_id == sritem.stage.stage_id %]
469                                                         <span class="stage highlight_stage">
470                                                     [% ELSE %]
471                                                         <span class="stage">
472                                                     [% END %]
473                                                     [% Branches.GetName(this_stage.branchcode_id) | html %] ([% this_stage.duration | html %])
474                                                     </span>
475                                                     &raquo;
476                                                 [% END %]
477                                                 [% IF stages.size > 0 %]
478                                                     <span class="stage">[% rota.cyclical ? 'START' : 'END' | html %]</span>
479                                                 [% END %]
480                                             </td>
481                                             <td class="actions">
482                                                 [% in_transit = sritem.item.get_transfer %]
483                                                 [% IF !in_transit && stages.size > 1 %]
484                                                     <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;rota_id=[% rota.id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;stage_id=[% sritem.stage.stage_id | uri %]">
485                                                 [% ELSE %]
486                                                     <a class="btn btn-default btn-xs" disabled>
487                                                 [% END %]
488                                                     <i class="fa fa-arrow-right"></i>
489                                                     Move to next stage
490                                                 </a>
491                                                 [% IF !in_transit %]
492                                                     <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% sritem.stage.stage_id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;rota_id=[% rota.id | uri %]">
493                                                 [% ELSE %]
494                                                     <a class="btn btn-default btn-xs" disabled>
495                                                 [% END %]
496                                                     <i class="fa fa-fire"></i>
497                                                     [% IF sritem.indemand %]
498                                                     <span>Remove &quot;In demand&quot;</span>
499                                                     [% ELSE %]
500                                                     <span>Add &quot;In demand&quot;</span>
501                                                     [% END %]
502                                                 </a>
503                                                 [% IF !in_transit %]
504                                                     <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% sritem.stage.stage_id | uri %]&amp;item_id=[% sritem.id | uri %]&amp;rota_id=[% rota.id | uri %]">
505                                                 [% ELSE %]
506                                                     <a class="btn btn-default btn-xs" disabled>
507                                                 [% END %]
508                                                     <i class="fa fa-trash"></i>
509                                                     Remove from rota
510                                                 </a>
511                                             </td>
512                                         </tr>
513                                     [% END %]
514                                 </tbody>
515                             </table>
516                         </div> <!-- /.page-section -->
517                     [% ELSE %]
518
519                         <div class="dialog message">
520                             <h4>There are no items assigned to this rota.</h4>
521                             <p><button type="button" data-toggle="modal" data-target="#addItemsModal"><i class="fa fa-plus"></i> Add items</button></p>
522                         </div>
523
524                     [% END %]
525
526                     <p><a href="stockrotation.pl">Return to rotas</a></p>
527
528                 [% ELSIF op == 'add_items_to_rota' %]
529
530                     <h1>Add items to rota report</h1>
531
532                     <div class="page-section">
533                         [% IF barcode_status.ok.size > 0 %]
534                             <h4>Items added to rota:</h4>
535                             <ul>
536                                 [% FOREACH item_ok IN barcode_status.ok %]
537                                     <li>[% item_ok.biblio.title | html %]</li>
538                                 [% END %]
539                             </ul>
540                         [% END %]
541                         [% IF barcode_status.on_this.size > 0 %]
542                             <h4>Items already on this rota:</h4>
543                             <ul>
544                                 [% FOREACH item_on_this IN barcode_status.on_this %]
545                                     <li>[% item_on_this.biblio.title | html %]</li>
546                                 [% END %]
547                             </ul>
548                         [% END %]
549                         [% IF barcode_status.not_found.size > 0 %]
550                             <h4>Barcodes not found:</h4>
551                             <ul>
552                                 [% FOREACH barcode_not_found IN barcode_status.not_found %]
553                                     <li>[% barcode_not_found | html %]</li>
554                                 [% END %]
555                             </ul>
556                         [% END %]
557                         [% IF barcode_status.on_other.size > 0 %]
558                             <h4>Items found on other rotas:</h4>
559                             <ul>
560                                 [% FOREACH item_on_other IN barcode_status.on_other %]
561                                     <li>[% item_on_other.biblio.title | html %]</li>
562                                 [% END %]
563                             </ul>
564                         [% END %]
565                     </div>
566
567                     [% IF barcode_status.on_other.size > 0 %]
568                         <form id="add_rota_item_form" method="post" enctype="multipart/form-data">
569                             <fieldset>
570                                 <legend>Select items to move to this rota:</legend>
571                                 [% FOREACH item_on_other IN barcode_status.on_other %]
572                                     <li><input type="checkbox" name="move_item" value="[% item_on_other.itemnumber | html %]"> [% item_on_other.biblio.title | html %] (Currently on &quot;[% item_on_other.stockrotationitem.stage.rota.title | html %]&quot;)</li>
573                                 [% END %]
574
575                             </fieldset>
576                             <fieldset class="action">
577                                 <input type="submit" class="btn btn-primary" value="Save" />
578                             </fieldset>
579                             <input type="hidden" name="rota_id" value="[% rota_id | html %]">
580                             <input type="hidden" name="op" value="move_items_to_rota">
581                         </form>
582                     [% END %]
583                     <p><a href="?op=manage_items&amp;rota_id=[% rota_id | uri %]">Return to rota</a></p>
584
585                 [% END %]
586             </div>
587
588             </main>
589         </div> <!-- /.col-sm-10.col-sm-push-2 -->
590
591         <div class="col-sm-2 col-sm-pull-10">
592             <aside>
593                 [% IF ( op == 'manage_stages' || op == 'manage_items' ) %]
594                     <div id="menu">
595                         <ul>
596                             [% IF op == 'manage_stages' %]
597                                 <li class="active">
598                             [% ELSE %]
599                                 <li>
600                             [% END %]
601                                     <a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&amp;rota_id=[% rota_id | uri %]">Manage stages</a>
602                                 </li>
603                             [% IF op == 'manage_items' %]
604                                 <li class="active">
605                             [% ELSE %]
606                                 <li>
607                             [% END %]
608                                     <a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_items&amp;rota_id=[% rota_id | uri %]">Manage items</a>
609                             </li>
610                         </ul>
611                     </div>
612                 [% END %]
613                 [% INCLUDE 'cat-menu.inc' %]
614             </aside>
615         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
616     </div> <!-- /.row -->
617
618 [% MACRO jsinclude BLOCK %]
619     [% INCLUDE 'datatables.inc' %]
620     [% INCLUDE 'columns_settings.inc' %]
621     [% Asset.js("js/pages/stockrotation.js") | $raw %]
622     <script>
623         var stock_rotation_items_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %];
624         var stock_rotation_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %];
625         $("#addStageModal, #addItemsModal").on("shown.bs.modal", function(){
626             $("#branch, #barcode").focus();
627         });
628     </script>
629 [% END %]
630
631 [% INCLUDE 'intranet-bottom.inc' %]