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