Bug 11897: (QA follow-up) Fixes for JS12
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / stockrotation.tt
blob88c7ed2ef43270a68fdaed94a3cb54f4bdce5ed8
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Asset %]
4 [% USE Branches %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Catalog &rsaquo; Stock rotation details for [% biblio.title | html %]</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% INCLUDE 'browser-strings.inc' %]
10 </head>
11 <body id="catalog_stockrotation" class="catalog">
12 [% USE KohaDates %]
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'cat-search.inc' %]
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Stock rotation details for <i>[% biblio.title | html %][% FOREACH subtitle IN biblio.subtitles %][% subtitle.subfield | html %][% END %]</i></div>
18 <div id="doc3" class="yui-t2">
20    <div id="bd">
21     <div id="yui-main">
22     <div class="yui-b">
24 <div id="catalogue_detail_biblio">
26     [% IF no_op_set %]
27         <h1 class="title">Stock rotation details for [% biblio.title | html %]</h1>
28         [% IF rotas.count > 0 && items.size > 0 %]
30             <table class="items_table dataTable no-footer" role="grid">
31                 <thead>
32                     <tr>
33                         <th>Barcode</th>
34                         <th>Callnumber</th>
35                         <th>Rota</th>
36                         <th>Rota status</th>
37                         <th>In transit</th>
38                         <th>Stages &amp; duration in days<br>(current stage highlighted)</th>
39                         <th>&nbsp;</th>
40                     </tr>
41                 </thead>
42                 <tbody>
43                     [% FOREACH item IN items %]
44                         <tr>
45                             <td>[% item.bib_item.barcode | html %]</td>
46                             <td>[% item.bib_item.itemcallnumber | html %]</td>
47                             <td>
48                                 [% item.rota.title | html %]
49                             </td>
50                             <td>
51                                 [% IF item.rota %]
52                                     [% IF !item.rota.active %]
53                                         <span class="highlighted-row">
54                                     [% END %]
55                                         [% IF item.rota.active %]
56                                             Active
57                                         [% ELSE %]
58                                             Inactive
59                                         [% END %]
60                                     [% IF !item.rota.active %]
61                                         </span>
62                                     [% END %]
63                                 [% END %]
64                             </td>
65                             <td>
66                                 [% IF item.bib_item.get_transfer %]
67                                     Yes
68                                 [% ELSE %]
69                                     No
70                                 [% END %]
71                             </td>
72                             <td>
73                                 [% FOREACH this_stage IN item.stages %]
74                                     [% IF this_stage.stage_id == item.stockrotationitem.stage.stage_id %]
75                                         <span class="stage highlight_stage">
76                                     [% ELSE %]
77                                         <span class="stage">
78                                     [% END %]
79                                     [% Branches.GetName(this_stage.branchcode_id) | html %] ([% this_stage.duration | html %])
80                                     </span>
81                                     &raquo;
82                                 [% END %]
83                                 [% IF item.stages.size > 0 %]
84                                     <span class="stage">
85                                         [% IF item.rota.cyclical %]
86                                             START
87                                         [% ELSE %]
88                                             END
89                                         [% END %]
90                                     </span>
91                                 [% END %]
92                             </td>
93                             <td class="actions">
94                                 [% IF item.stockrotationitem %]
95                                     [% in_transit = item.bib_item.get_transfer %]
96                                     [% IF !in_transit && item.stages.size > 1 %]
97                                         <a class="btn btn-default btn-xs" href="?op=move_to_next_stage&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
98                                     [% ELSE %]
99                                         <a class="btn btn-default btn-xs" disabled>
100                                     [% END %]
101                                         <i class="fa fa-arrow-right"></i>
102                                         Move to next stage
103                                     </a>
104                                     [% IF !in_transit %]
105                                         <a class="btn btn-default btn-xs" href="?op=toggle_in_demand&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
106                                     [% ELSE %]
107                                         <a class="btn btn-default btn-xs" disabled>
108                                     [% END %]
109                                         <i class="fa fa-fire"></i>
110                                         [% IF item.stockrotationitem.indemand %]
111                                             Remove "In demand"
112                                         [% ELSE %]
113                                             Add "In demand"
114                                         [% END %]
115                                     </a>
116                                     [% IF !in_transit %]
117                                         <a class="btn btn-default btn-xs" href="?op=confirm_remove_from_rota&amp;stage_id=[% item.stockrotationitem.stage.stage_id | uri %]&amp;item_id=[% item.bib_item.id | uri %]&amp;biblionumber=[% biblionumber | uri %]">
118                                     [% ELSE %]
119                                         <a class="btn btn-default btn-xs" disabled>
120                                     [% END %]
121                                         <i class="fa fa-trash"></i>
122                                         Remove from rota
123                                     </a>
124                                 [% ELSE %]
125                                     <form class="rota_select_form" method="post" enctype="multipart/form-data">
126                                         <select class="item_select_rota" name="rota_id">
127                                             [% FOREACH rota IN rotas %]
128                                                 <option value="[% rota.rota_id | uri %]">[% rota.title | html %]</option>
129                                             [% END %]
130                                         </select>
131                                         <button class="btn btn-default btn-xs" type="submit"><i class="fa fa-plus"></i> Add to rota</button>
132                                         <input type="hidden" name="op" value="add_item_to_rota"></input>
133                                         <input type="hidden" name="item_id" value="[% item.bib_item.id | uri %]"></input>
134                                         <input type="hidden" name="biblionumber" value="[% biblionumber | uri %]"></input>
135                                     </form>
136                                 [% END %]
137                             </td>
138                         </tr>
139                     [% END %]
140                 </tbody>
141             </table>
142         [% END %]
143         [% IF !items || items.size == 0 %]
144             <h1>No physical items for this record</h1>
145         [% END %]
146         [% IF !rotas || rotas.count == 0 %]
147             <h1>There are no rotas with stages assigned</h1>
148         [% END %]
149     [% ELSIF op == 'confirm_remove_from_rota' %]
150         <div class="dialog alert">
151             <h3>Are you sure you want to remove this item from it's rota?</h3>
152             <p>
153                 <a class="btn btn-default btn-xs approve" href="?op=remove_item_from_stage&amp;stage_id=[% stage_id | uri %]&amp;item_id=[% item_id | uri %]&amp;biblionumber=[% biblionumber | uri %]"><i class="fa fa-fw fa-check"></i>Yes</a>
154                 <a class="btn btn-default btn-xs deny" href="?biblionumber=[% biblionumber | uri %]"><i class="fa fa-fw fa-remove"></i>No</a>
155             </p>
156         </div>
157     [% END %]
159 </div>
161 </div>
162 </div>
163 <div class="yui-b">
164 [% INCLUDE 'biblio-view-menu.inc' %]
165 </div>
166 </div>
168 [% MACRO jsinclude BLOCK %]
169     [% Asset.js("js/browser.js") | $raw %]
170     <script type="text/javascript">
171         var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
172         browser.show();
173     </script>
174 [% END %]
176 [% INCLUDE 'intranet-bottom.inc' %]