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