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