Koha/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt
Owen Leonard f979752031
Bug 34773: Improve translation of title tags: Cataloging tools
This patch modifies cataloging tools templates so that title tags can be
more easily translated. The patch also makes some modifications to
titles, breadcrumb navigation, and page headers in order to make them
more consistent with each other and with other similar pages.

Note that stockrotation.pl has been modified so that rota information is
available to the template in more cases for the purpose of showing that
information in navigation and headings.

To test, apply the patch and go to Cataloging. Test each page and each
variation of the page to confirm that titles, breadcrumbs, and page
headers look correct.

- Export catalog data
- Stage records for import
  - Main page
  - Upload file -> Stage for import
- Manage staged records
  - Main page
    - Batch details
      - Import batch
- Batch item modification and batch item deletion
  - Main page
    - Submit batch
      - Save
- Batch record modification
  - Main page
    - Submit batch
      - Modify selected
- Batch record deletion
  - Main page
    - Submit batch
      - Delete selected
- MARC modification templates
  - Main page
    - Edit actions for a template
- Item modifications by age
  - Main page
    - Add rules
- Stock rotation
  - Main page
    - New rota
    - Edit rota
    - Manage stages for rota
      - New stage
      - Edit stage
    - Manage items for rota
      - Add items

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-11-06 08:42:44 -03:00

664 lines
40 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE Branches %]
[% USE KohaDates %]
[% USE TablesSettings %]
[% PROCESS 'i18n.inc' %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% FILTER collapse %]
[% IF (op == 'create_edit_rota' && rota.rota_id) %]
[% tx("Modify rota '{rota_title}'", rota_title = rota.title ) %] &rsaquo;
[% ELSIF (op == 'create_edit_rota' && !rota.rota_id) %]
[% t("New rota") | html %] &rsaquo;
[% ELSIF (op == 'manage_stages') %]
[% tx("Manage stages for '{rota_title}'", rota_title = rota.title ) %] &rsaquo;
[% ELSIF (op == 'create_edit_stage' && stage.id) %]
[% tx("Modify {library} stage", library = Branches.GetName(stage.branchcode_id) ) %] &rsaquo;
[% tx("Manage stages for '{rota_title}'", rota_title = rota.title ) %] &rsaquo;
[% ELSIF (op == 'create_edit_stage' && !stage.id) %]
[% t("New stage") | html %] &rsaquo;
[% ELSIF (op == 'manage_items') %]
[% tx("Manage items for '{rota_title}'", rota_title = rota.title ) %] &rsaquo;
[% ELSIF op == 'add_items_to_rota' %]
[% t("Add items" ) | html %] &rsaquo;
[% tx("Manage items for '{rota_title}'", rota_title = rota.title ) %] &rsaquo;
[% END # /IF (op == 'create_edit_rota' %]
[% t("Stock rotation") | html %] &rsaquo;
[% t("Cataloging") | html %] &rsaquo;
[% t("Koha") | html %]
[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<style>i.drag_handle{ color: #999; }</style>
</head>
<body id="tools_stockrotation" class="tools">
[% WRAPPER 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% END %]
[% WRAPPER 'sub-header.inc' %]
[% WRAPPER breadcrumbs %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
[% END %]
[% IF no_op_set %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>Stock rotation</span>
[% END %]
[% ELSE %]
[% WRAPPER breadcrumb_item %]
<a href="/cgi-bin/koha/tools/stockrotation.pl">Stock rotation</a>
[% END %]
[% END # /IF no_op_set %]
[% IF (op == 'create_edit_rota' && rota.rota_id) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% tx("Modify rota '{rota_title}'", rota_title = rota.title ) %]
[% END %]
[% ELSIF (op == 'create_edit_rota' && !rota.rota_id) %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>New rota</span>
[% END %]
[% ELSIF (op == 'manage_stages') %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% tx("Manage stages for '{rota_title}'", rota_title = rota.title ) %]
[% END %]
[% ELSIF (op == 'create_edit_stage' && stage.id) %]
[% WRAPPER breadcrumb_item %]
<a href="?op=manage_stages&amp;rota_id=[% rota_id | uri %]">[% tx("Manage stages for '{rota_title}'", rota_title = rota.title ) %]</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% tx("Modify {library} stage", library = Branches.GetName(stage.branchcode_id) ) %]
[% END %]
[% ELSIF (op == 'create_edit_stage' && !stage.id) %]
[% WRAPPER breadcrumb_item %]
<a href="?op=manage_stages&amp;rota_id=[% rota_id | uri %]">[% tx("Manage stages for '{rota_title}'", rota_title = rota.title ) %]</a>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
<span>New stage</span>
[% END %]
[% ELSIF op == 'add_items_to_rota' %]
[% WRAPPER breadcrumb_item %]
<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>
[% END %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% t("Add items") | html %]
[% END %]
[% ELSIF (op == 'manage_items') %]
[% WRAPPER breadcrumb_item bc_active= 1 %]
[% tx("Manage items for '{rota_title}'", rota_title = rota.title ) %]
[% END %]
[% END # /IF (op == 'create_edit_rota' %]
[% END #/ WRAPPER breadcrumbs %]
[% END #/ WRAPPER sub-header.inc %]
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<div id="stockrotation">
[% IF no_op_set %]
[% INCLUDE 'stockrotation-toolbar.inc' %]
<h1>Stock rotation</h1>
[% IF existing_rotas.size > 0 %]
<div class="page-section">
<table id="stock_rotation" class="rotas_table" role="grid">
<thead>
<tr>
<th class="anti-the">Name</th>
<th>Cyclical</th>
<th>Active</th>
<th>Description</th>
<th>Number of items</th>
<th class="NoSort noExport">Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH rota IN existing_rotas %]
<tr>
<td>[% rota.title | html %]</td>
<td>[% rota.cyclical ? 'Yes' : 'No' | html %]</td>
<td>[% rota.active ? 'Yes' : 'No' | html %]</td>
<td>[% rota.description | html %]</td>
<td>[% rota.stockrotationitems.count | html %]</td>
<td class="actions">
<a class="btn btn-default btn-xs" href="?op=create_edit_rota&amp;rota_id=[% rota.rota_id | uri %]">
<i class="fa-solid fa-pencil" aria-hidden="true"></i>
Edit
</a>
<div class="btn-group dropup" role="group">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Manage
<i class="fa fa-caret-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><a href="?op=manage_stages&amp;rota_id=[% rota.rota_id | uri %]">Stages</a></li>
[% IF CAN_user_stockrotation_manage_rota_items && rota.stockrotationstages.count > 0 %]
<li><a href="?op=manage_items&amp;rota_id=[% rota.rota_id | uri %]">Items</a></li>
[% END %]
</ul>
</div>
<a class="btn btn-default btn-xs" href="?op=toggle_rota&amp;rota_id=[% rota.rota_id | uri %]">
<i class="fa fa-power-off"></i>
[% IF !rota.active %]
Activate
[% ELSE %]
Deactivate
[% END %]
</a>
<a class="btn btn-default btn-xs" href="?op=confirm_delete_rota&amp;rota_id=[% rota.rota_id | uri %]">
<i class="fa fa-trash"></i>
Delete
</a>
</td>
</tr>
[% END %]
</tbody>
</table>
</div><!-- /.page-section -->
[% END %]
[% ELSIF (op == 'create_edit_rota') %]
[% IF rota.rota_id %]
<h1>[% tx("Modify rota '{rota_title}'", rota_title = rota.title ) %]</h1>
[% ELSE %]
<h1>New rota</h1>
[% END %]
[% IF error == 'invalid_form' %]
<div class="dialog alert">
<h3>There was a problem with your form submission</h3>
</div>
[% END %]
<form id="rota_form" method="post" enctype="multipart/form-data" class="validated">
<fieldset class="rows">
<ol>
<li>
<label class="required" for="title">Name:</label>
<input type="text" id="title" name="title" value="[% rota.title | html %]" required="required" placeholder="Rota name">
<span class="required">Required</span>
</li>
<li>
<label for="cyclical">Cyclical:</label>
<select name="cyclical" id="cyclical">
[% IF rota.cyclical %]
<option value="1" selected="selected">Yes</option>
<option value="0">No</option>
[% ELSE %]
<option value="1">Yes</option>
<option value="0" selected="selected">No</option>
[% END %]
</select>
</li>
<li>
<label for="description">Description:</label>
<textarea id="description" name="description" placeholder="Rota description">[% rota.description | html %]</textarea>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Save" />
<a href="/cgi-bin/koha/tools/stockrotation.pl" class="cancel">Cancel</a>
</fieldset>
[% IF rota.rota_id %]
<input type="hidden" name="id" value="[% rota.rota_id | html %]">
[% END %]
<input type="hidden" name="op" value="process_rota">
</form>
[% ELSIF (op == 'manage_stages') %]
[% INCLUDE 'stockrotation-toolbar.inc' %]
[% IF error == 'invalid_form' %]
<div class="dialog alert">
<h3>There was a problem with your form submission</h3>
</div>
[% END %]
<h1>[% tx("Manage stages for '{rota_title}'", rota_title = rota.title ) %]</h1>
<div id="ajax_status"
data-saving-msg="Saving changes..."
data-success-msg=""
data-failed-msg="Error: ">
<span id="ajax_saving_msg"></span>
<i id="ajax_saving_icon" class="fa fa-spinner fa-spin"></i>
<i id="ajax_success_icon" class="fa fa-check"></i>
<i id="ajax_failed_icon" class="fa fa-times"></i>
<span id="ajax_success_msg"></span>
<span id="ajax_failed_msg"></span>
</div>
<!-- Add stage modal -->
<div class="modal" id="addStageModal" tabindex="-1" role="dialog" aria-labelledby="addStageLabel">
<form id="stage_form" method="post" enctype="multipart/form-data" class="validated">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="addStageLabel">Add stage to <em>[% rota.title | html %]</em></h4>
</div>
<div class="modal-body">
<fieldset class="rows">
<ol>
<li>
<label class="required" for="branch">Library:</label>
<select name="branchcode" id="branch">
[% FOREACH branch IN branches %]
[% IF branch.branchcode == stage.branchcode_id %]
<option value="[% branch.branchcode | html %]" selected="selected">[% Branches.GetName(branch.branchcode) | html %]</option>
[% ELSE %]
<option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option>
[% END %]
[% END %]
</select>
<span class="required">Required</span>
</li>
<li>
<label class="required" for="duration">Duration:</label>
<input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)">
<span class="required">Required</span>
</li>
</ol>
</fieldset> <!-- /.rows -->
</div> <!-- /.modal-body -->
<div class="modal-footer">
<input type="hidden" name="stage_id" value="[% stage.id | html %]">
<input type="hidden" name="rota_id" value="[% rota_id | html %]">
<input type="hidden" name="op" value="process_stage">
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div> <!-- /.modal-footer -->
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</form> <!-- /#stage_form -->
</div> <!-- /#addStageModal -->
[% IF existing_stages.size > 0 %]
<div id="manage_stages" class="page-section">
<div id="manage_stages_help">
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
</div>
<div id="stage_list_headings">
<span class="stagename">Library</span>
<span class="stageduration">Duration (days)</span>
</div>
<ul id="sortable_stages" data-rota-id="[% rota.rota_id | html %]">
[% FOREACH stage IN existing_stages %]
<li id="stage_[% stage.stage_id | html %]">
<span data-toggle="tooltip" title="Drag and drop to move this stage to another position" data-placement="right" class="stagename">
[% IF existing_stages.size > 1 %]
<i class="drag_handle fa-solid fa-fw fa-grip-vertical" aria-hidden="true"></i>
[% END %]
[% Branches.GetName(stage.branchcode_id) | html %]
</span>
<span class="stageduration">[% stage.duration | html %]</span>
<span class="stageactions">
<a class="btn btn-default btn-xs" href="?op=create_edit_stage&amp;stage_id=[% stage.stage_id | uri %]">
<i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit
</a>
<a class="btn btn-default btn-xs" href="?op=confirm_delete_stage&amp;stage_id=[% stage.stage_id | uri %]">
<i class="fa fa-trash-can"></i> Delete
</a>
</span>
</li>
[% END %]
</ul>
</div>
[% ELSE %]
<div class="dialog message">
<h4>This rota has no stages.</h4>
<p><button type="button" data-toggle="modal" data-target="#addStageModal"><i class="fa fa-plus"></i> Add a stage</button></p>
</div>
[% END %]
<p><a href="stockrotation.pl">Return to rotas</a></p>
[% ELSIF (op == 'create_edit_stage') %]
[% IF stage.id %]
<h1>[% tx("Modify {library} stage", library = Branches.GetName(stage.branchcode_id) ) %]</h1>
[% ELSE %]
<h1>New stage</h1>
[% END %]
[% IF error == 'invalid_form' %]
<div class="dialog alert">
<h3>There was a problem with your form submission</h3>
</div>
[% END %]
<form id="stage_form" method="post" enctype="multipart/form-data" class="validated">
<fieldset class="rows">
<ol>
<li>
<label class="required" for="branch">Library:</label>
<select name="branchcode" id="branch">
[% FOREACH branch IN branches %]
[% IF branch.branchcode == stage.branchcode_id %]
<option value="[% branch.branchcode | html %]" selected="selected">[% Branches.GetName(branch.branchcode) | html %]</option>
[% ELSE %]
<option value="[% branch.branchcode | html %]">[% Branches.GetName(branch.branchcode) | html %]</option>
[% END %]
[% END %]
</select>
<span class="required">Required</span>
</li>
<li>
<label class="required" for="duration">Duration:</label>
<input type="text" id="duration" name="duration" value="[% stage.duration | html %]" required="required" placeholder="Duration (days)">
<span class="required">Required</span>
</li>
</ol>
</fieldset>
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Save" />
<a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&amp;rota_id=[% rota_id | uri %]" class="cancel">Cancel</a>
</fieldset>
<input type="hidden" name="stage_id" value="[% stage.id | html %]">
<input type="hidden" name="rota_id" value="[% rota_id | html %]">
<input type="hidden" name="op" value="process_stage">
</form>
[% ELSIF (op == 'confirm_remove_from_rota') %]
<div class="dialog alert">
<h1>Are you sure you wish to remove this item from its rota</h1>
<p>
<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>
<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>
</p>
</div>
[% ELSIF (op == 'confirm_delete_rota') %]
<div class="dialog alert">
<h1>Are you sure you want to delete this rota?</h1>
[% IF sritemstotal > 0 %]
[% IF sritemstotal == 1 %]
<p> [% sritemstotal | html %] item is still attached to this rota, that item will remain at its current stage libraries.</p>
[% ELSE %]
<p> [% sritemstotal | html %] items are still attached to this rota, those items will remain at their current stage libraries.</p>
[% END %]
[% END %]
<p>
<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>
<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>
</p>
</div>
[% ELSIF (op == 'confirm_delete_stage') %]
<div class="dialog alert">
<h1>Are you sure you want to delete this stage?</h1>
[% IF stage.stockrotationitems.count > 0 %]
<p>This stage contains the following item(s):</p>
<ul>
[% FOREACH sritem IN stage.stockrotationitems %]
<li>[% sritem.item.biblio.title | html %] (Barcode: [% sritem.item.barcode | html %])</li>
[% END %]
</ul>
[% END %]
<p>
<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>
<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>
</p>
</div>
[% ELSIF (op == 'manage_items') %]
[% INCLUDE 'stockrotation-toolbar.inc' %]
[% IF error %]
<div class="dialog alert">
[% IF error == "item_not_found" %]
<h3>The item was not found</h3>
[% ELSIF error == "already_on_rota" %]
<h3>This item is already on this rota</h3>
[% END %]
</div>
[% END %]
<h1>[% tx("Manage items for '{rota_title}'", rota_title = rota.title ) %]</h1>
<!-- Add items modal -->
<div class="modal" id="addItemsModal" tabindex="-1" role="dialog" aria-labelledby="addItemsLabel">
<form id="add_rota_item_form" method="post" enctype="multipart/form-data" class="validated">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h1 class="modal-title" id="addItemsLabel">
[% tx("Add items to rota '{rota_title}'", rota_title = rota.title ) %]
</h1>
</div>
<div class="modal-body">
<fieldset class="rows">
<legend>Add an item by barcode</legend>
<ol>
<li>
<label for="barcode">Barcode:</label>
<input type="text" id="barcode" name="barcode" placeholder="Item barcode" autofocus>
</li>
</ol>
</fieldset>
<fieldset class="rows">
<legend>Use a barcode file</legend>
<ol>
<li>
<label for="barcodefile">Barcode file:</label>
<input type="file" id="barcodefile" name="barcodefile">
</li>
</ol>
</fieldset> <!-- /.rows -->
</div> <!-- /.modal-body -->
<div class="modal-footer">
<input type="hidden" name="rota_id" value="[% rota.id | html %]">
<input type="hidden" name="op" value="add_items_to_rota">
<button type="submit" class="btn btn-primary">Save</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div> <!-- /.modal-footer -->
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</form> <!-- /#dd_rota_item_form -->
</div> <!-- /#addItemsModal -->
[% IF sritems.count > 0 %]
<div class="page-section">
<table id="stock_rotation_manage_items" class="items_table" role="grid">
<thead>
<tr>
<th>Barcode</th>
<th>Title</th>
<th>Author</th>
<th>Call number</th>
<th class="NoSearch">In transit</th>
<th class="NoSort noExport">Stages &amp; duration in days<br>(current stage highlighted)</th>
<th class="NoSort noExport">Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH sritem IN sritems %]
<tr>
<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>
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% sritem.item.biblio.id | uri %]">[% sritem.item.biblio.title | html %]</a></td>
<td>[% sritem.item.biblio.author | html %]</td>
<td>[% sritem.item.itemcallnumber | html %]</td>
<td>[% sritem.item.get_transfer ? 'Yes' : 'No' | html %]</td>
<td>
[% FOREACH this_stage IN stages %]
[% IF this_stage.stage_id == sritem.stage.stage_id %]
<span class="stage highlight_stage">
[% ELSE %]
<span class="stage">
[% END %]
[% Branches.GetName(this_stage.branchcode_id) | html %] ([% this_stage.duration | html %])
</span>
&raquo;
[% END %]
[% IF stages.size > 0 %]
<span class="stage">[% rota.cyclical ? 'START' : 'END' | html %]</span>
[% END %]
</td>
<td class="actions">
[% in_transit = sritem.item.get_transfer %]
[% IF stages.size < 2 %]
<a class="btn btn-default btn-xs" title="Rota has a single stage, advancing will have no effect" disabled>
[% ELSIF !in_transit %]
<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 %]">
[% ELSE %]
<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">
[% END %]
<i class="fa fa-arrow-right"></i>
Move to next stage
</a>
[% IF !in_transit %]
<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 %]">
[% ELSE %]
<a class="btn btn-default btn-xs" disabled>
[% END %]
<i class="fa fa-fire"></i>
[% IF sritem.indemand %]
<span>Remove &quot;In demand&quot;</span>
[% ELSE %]
<span>Add &quot;In demand&quot;</span>
[% END %]
</a>
[% IF !in_transit %]
<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 %]">
[% ELSE %]
<a class="btn btn-default btn-xs" disabled>
[% END %]
<i class="fa fa-trash-can"></i>
Remove from rota
</a>
</td>
</tr>
[% END %]
</tbody>
</table>
</div> <!-- /.page-section -->
[% ELSE %]
<div class="dialog message">
<h4>There are no items assigned to this rota.</h4>
<p><button type="button" data-toggle="modal" data-target="#addItemsModal"><i class="fa fa-plus"></i> Add items</button></p>
</div>
[% END %]
<p><a href="stockrotation.pl">Return to rotas</a></p>
[% ELSIF op == 'add_items_to_rota' %]
<h1>[% tx("Add items to rota '{rota_title}'", rota_title = rota.title ) %]</h1>
<h2>Results</h2>
<div class="page-section">
[% IF barcode_status.ok.size > 0 %]
<h4>Items added to rota:</h4>
<ul>
[% FOREACH item_ok IN barcode_status.ok %]
<li>[% item_ok.biblio.title | html %]</li>
[% END %]
</ul>
[% END %]
[% IF barcode_status.on_this.size > 0 %]
<h4>Items already on this rota:</h4>
<ul>
[% FOREACH item_on_this IN barcode_status.on_this %]
<li>[% item_on_this.biblio.title | html %]</li>
[% END %]
</ul>
[% END %]
[% IF barcode_status.not_found.size > 0 %]
<h4>Barcodes not found:</h4>
<ul>
[% FOREACH barcode_not_found IN barcode_status.not_found %]
<li>[% barcode_not_found | html %]</li>
[% END %]
</ul>
[% END %]
[% IF barcode_status.on_other.size > 0 %]
<h4>Items found on other rotas:</h4>
<ul>
[% FOREACH item_on_other IN barcode_status.on_other %]
<li>[% item_on_other.biblio.title | html %]</li>
[% END %]
</ul>
[% END %]
</div>
[% IF barcode_status.on_other.size > 0 %]
<form id="add_rota_item_form" method="post" enctype="multipart/form-data">
<fieldset>
<legend>Select items to move to this rota:</legend>
[% FOREACH item_on_other IN barcode_status.on_other %]
<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>
[% END %]
</fieldset>
<fieldset class="action">
<input type="submit" class="btn btn-primary" value="Save" />
</fieldset>
<input type="hidden" name="rota_id" value="[% rota_id | html %]">
<input type="hidden" name="op" value="move_items_to_rota">
</form>
[% END %]
<p><a href="?op=manage_items&amp;rota_id=[% rota_id | uri %]">Return to rota</a></p>
[% END %]
</div>
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% IF ( op == 'manage_stages' || op == 'manage_items' ) %]
<div id="menu">
<ul>
[% IF op == 'manage_stages' %]
<li class="active">
[% ELSE %]
<li>
[% END %]
<a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_stages&amp;rota_id=[% rota_id | uri %]">Manage stages</a>
</li>
[% IF op == 'manage_items' %]
<li class="active">
[% ELSE %]
<li>
[% END %]
<a href="/cgi-bin/koha/tools/stockrotation.pl?op=manage_items&amp;rota_id=[% rota_id | uri %]">Manage items</a>
</li>
</ul>
</div>
[% END %]
[% INCLUDE 'cat-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% Asset.js( "lib/sortable/Sortable.min.js" ) | $raw %]
[% Asset.js("js/pages/stockrotation.js") | $raw %]
<script>
var stock_rotation_items_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation_manage_items', 'json' ) | $raw %];
var stock_rotation_table_settings = [% TablesSettings.GetTableSettings( 'tools', 'stockrotation', 'stock_rotation', 'json' ) | $raw %];
$("#addStageModal, #addItemsModal").on("shown.bs.modal", function(){
$("#branch, #barcode").focus();
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]