Bug 20226: Centralize update child code (CATCODE_MULTI)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation_batch_checkouts.tt
1 [% USE Asset %]
2 [% USE Branches %]
3 [% USE KohaDates %]
4 [% USE Price %]
5 [% USE AuthorisedValues %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 [% SET destination = "circ" %]
9 <title>Koha &rsaquo; Circulation
10 [% IF patron %]
11   &rsaquo; Batch check out &rsaquo; Issuing items to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %]
12 [% END %]
13 </title>
14 [% INCLUDE 'doc-head-close.inc' %]
15 [% Asset.css("css/datatables.css") %]
16 </head>
17
18 <body id="circ_circulation_batch_checkouts" class="circ">
19
20 [% INCLUDE 'header.inc' %]
21 [% INCLUDE 'circ-search.inc' %]
22
23 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo;
24     [% IF patron %]
25         <a href="/cgi-bin/koha/circ/circulation.pl">Batch check out</a> &rsaquo; [% INCLUDE 'patron-title.inc' %]
26     [% ELSE %]
27         Batch check out
28     [% END %]
29 </div>
30 <div id="doc3" class="yui-t2">
31
32    <div id="bd">
33 <div id="yui-main">
34 <div class="yui-b">
35
36 <div class="yui-g">
37
38 [% IF patron %]
39 [% INCLUDE 'members-toolbar.inc' %]
40 [% END %]
41
42 [% IF patron and not batch_allowed %]
43   <div class="dialog alert">You are not allowed to use batch checkout for this patron</div>
44 [% ELSIF patron and noissues and not checkout_infos %]
45   <div class="dialog alert">
46     Cannot check out!
47     [% IF charges %]
48       <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
49     [% END %]
50     [% IF charges_guarantees %]
51         <li>
52             <span class="circ-hlt">Fees &amp; Charges:</span> Patron's guarantees collectively owe [% chargesamount_guarantees | $Price %].
53         </li>
54         <li>
55             <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
56         </li>
57     [% END %]
58   </div>
59 [% ELSIF patron and not checkout_infos %]
60   <form method="post" enctype="multipart/form-data" action="/cgi-bin/koha/circ/circulation.pl">
61     <fieldset id="circ_circulation_issue">
62       <label for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
63       <fieldset class="rows">
64         <legend>Use a file</legend>
65         <ol>
66           <li><label for="uploadfile">File: </label> <input type="file" id="uploadfile" name="uploadfile" /></li>
67         </ol>
68       </fieldset>
69       <fieldset class="rows">
70         <legend>Or list barcodes one by one</legend>
71         <ol>
72           <li>
73             <label for="barcodelist">Barcode list (one barcode per line): </label>
74             <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
75           </li>
76         </ol>
77       </fieldset>
78       <input type="hidden" name="op" value="show" />
79       <fieldset class="action">
80         <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber %]" />
81         <input type="hidden" name="branch" value="[% branch %]" />
82         <input type="hidden" name="batch" value="1" />
83         <input type="submit" value="Check out" class="button" />
84       </fieldset>
85     </fieldset>
86   </form>
87
88 [% ELSIF patron %]
89   [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
90     <h3>Batch checkout confirmation [% IF patron %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] [% END %]</h3>
91     <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
92   [% ELSE %]
93     <h3>Batch checkout information [% IF patron.borrowernumber %] for [% INCLUDE 'patron-title.inc' invert_name = 1 %] |[% batch %]|[% END %]</h3>
94   [% END %]
95     <table id="checkout_infos">
96       <thead>
97         <tr>
98           [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
99             <th class="NoSort"></th>
100           [% END %]
101           <th>Barcode</th>
102           <th class="anti-the">Title</th>
103           <th>Information</th>
104         </tr>
105       </thead>
106       <tbody>
107         [% FOR checkout_info IN checkout_infos %]
108           <tr>
109             [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
110               <td>
111                 [% IF checkout_info.NEEDSCONFIRMATION %]
112                   <input type="checkbox" name="barcodes" value="[% checkout_info.barcode %]" checked="checked" />
113                 [% END %]
114               </td>
115             [% END %]
116             <td>[% checkout_info.barcode %]</td>
117             <td>
118               <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.biblio.biblionumber %]&amp;type=intra"><strong>[% checkout_info.biblio.title |html %][% FOREACH subtitle IN checkout_info.biblio.subtitles %] [% subtitle.subfield %][% END %]</strong></a>[% IF checkout_info.biblio.author %], by [% checkout_info.biblio.author %][% END %][% IF ( checkout_info.item.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.biblio.biblionumber %]&amp;itemnumber=[% checkout_info.item.itemnumber %]#item[% checkout_info.item.itemnumber %]">[% checkout_info.item.barcode %]</a>
119             </td>
120             <td>
121               [% IF checkout_info.NEEDSCONFIRMATION %]
122                 <ul class="fa-ul warn">
123                   [% IF checkout_info.AGE_RESTRICTION %]
124                       <li><i class="fa fa-li fa-warning"></i>Age restriction [% checkout_info.AGE_RESTRICTION %].</li>
125                   [% END %]
126                   [% IF checkout_info.RENEW_ISSUE %]
127                       <li><i class="fa fa-li fa-warning"></i>This item is currently checked out to this patron. Renew?</li>
128                   [% END %]
129                   [% IF checkout_info.RESERVE_WAITING %]
130                       <li><i class="fa fa-li fa-warning"></i>This item is waiting for another patron.</li>
131                   [% END %]
132                   [% IF checkout_info.RESERVED %]
133                       <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron.</li>
134                   [% END %]
135                   [% IF checkout_info.ISSUED_TO_ANOTHER %]
136                       <li><i class="fa fa-li fa-warning"></i>This item is checked out to another patron.
137                     [% IF CAN_user_circulate_force_checkout %]
138                       Check in and check out?
139                       [% END %]</li>
140                   [% END %]
141                   [% IF checkout_info.TOO_MANY %]
142                       <li><i class="fa fa-li fa-warning"></i>Too many checked out.</li>
143                   [% END %]
144                   [% IF checkout_info.BORRNOTSAMEBRANCH %]
145                       <li><i class="fa fa-li fa-warning"></i>This patron is from a different library ([% Branches.GetName( checkout_info.BORRNOTSAMEBRANCH ) %]).</li>
146                   [% END %]
147                   [% IF checkout_ino.PATRON_CANT %]
148                       <li><i class="fa fa-li fa-warning"></i>This patron can't check out this item per library circulation policy.</li>
149                   [% END %]
150                   [% IF checkout_info.NOT_FOR_LOAN_FORCING %]
151                     [% IF checkout_info.itemtype_notforloan %]
152                         <li><i class="fa fa-li fa-warning"></i>Item type is normally not for loan.</li>
153                     [% ELSIF checkout_info.item_notforloan %]
154                       [% item_notforloan_lib = AuthorisedValues.GetByCode( authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
155                         <li><i class="fa fa-li fa-warning"></i>Item is normally not for loan [% IF item_notforloan_lib %]([% item_notforloan_lib %])[% END %].</li>
156                     [% END %]
157                   [% END %]
158                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
159                       <li><i class="fa fa-li fa-warning"></i>Patron has [% checkout_info.USERBLOCKEDOVERDUE %] overdue item(s).</li>
160                   [% END %]
161                   [% IF checkout_info.ITEM_LOST %]
162                       <li><i class="fa fa-li fa-warning"></i>This item has been lost with a status of "[% checkout_info.ITEM_LOST %]."</li>
163                   [% END %]
164                   [% IF checkout_info.HIGHHOLDS %]
165                       <li><i class="fa fa-li fa-warning"></i>High demand item. Loan period shortened to [% checkout_info.HIGHHOLDS.duration %] days (due [% checkout_info.HIGHHOLDS.returndate %]).</li>
166                   [% END %]
167                   [% IF checkout_info.HIGHHOLDS %] <!-- FIXME -->
168                       <script type="text/javascript">
169                           $(document).ready(function() {
170                               $("input[name=duedatespec]:hidden").val('[% checkout_info.HIGHHOLDS.returndate %]');
171                           });
172                       </script>
173                   [% END %]
174
175                   [% IF NOT checkout_info.IMPOSSIBLE && ( CAN_user_circulate_force_checkout or checkout_info.HIGHHOLDS ) %]
176                       [% IF checkout_info.RESERVED || checkout_info.RESERVE_WAITING %] <!-- arbitrary choice, revert the reserve is not possible-->
177                         <li><i class="fa fa-li fa-warning"></i>This item is on hold for another patron. The hold will be overridden, but not cancelled.</li>
178                       [% END %]
179                   [% END %]
180
181                   [% IF checkout_info.PREVISSUE %]
182                       <li>This item has previously been checked out to this patron.</li>
183                   [% END %]
184                 </ul>
185               [% END %]
186
187
188               [% IF checkout_info.alert.ITEM_LOST || checkout_info.alert.OTHER_CHARGES %]
189                 <ul class="info">
190                   [% IF checkout_info.alert.ITEM_LOST %]
191                       <li>This item has been lost with a status of "[% checkout_info.alert.ITEM_LOST %]."</li>
192                   [% END %]
193                   [% IF checkout_info.alert.OTHER_CHARGES %]
194                       <li>The patron has unpaid charges for holds, rentals etc of [% checkout_info.alert.OTHER_CHARGES %].</li>
195                   [% END %]
196                 </ul>
197               [% END %]
198
199
200               [% IF checkout_info.IMPOSSIBLE %]
201                 <ul class="fa-ul error">
202                   [% IF checkout_info.STATS  %]
203                       <li><i class="fa fa-li fa-exclamation"></i>Local use recorded.</li>
204                   [% END %]
205
206                   [% IF checkout_info.NOT_FOR_LOAN %]
207                     [% IF checkout_info.itemtype_notforloan %]
208                        <li><i class="fa fa-li fa-exclamation"></i>Item type not for loan.</li>
209                     [% ELSIF checkout_info.item_notforloan %]
210                       [% item_notforloan_lib = AuthorisedValues.GetByCode( checkout_info.authvalcode_notforloan, checkout_info.item_notforloan, 0 ) %]
211                         <li><i class="fa fa-li fa-exclamation"></i>Item not for loan [% IF checkout_info.item_notforloan_lib %]([% checkout_info.item_notforloan_lib %])[% END %].</li>
212                     [% END %]
213                   [% END %]
214                   [% IF checkout_info.WTHDRAWN %]
215                       <li><i class="fa fa-li fa-exclamation"></i>Item has been withdrawn.</li>
216                   [% END %]
217                   [% IF checkout_info.RESTRICTED %]
218                       <li><i class="fa fa-li fa-exclamation"></i>Item is restricted.</li>
219                   [% END %]
220                   [% IF checkout_info.GNA %]
221                       <li><i class="fa fa-li fa-exclamation"></i>Patron's address is in doubt.</li>
222                   [% END %]
223                   [% IF checkout_info.CARD_LOST %]
224                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is lost.</li>
225                   [% END %]
226                   [% IF checkout_info.DEBARRED %]
227                       <li><i class="fa fa-li fa-exclamation"></i>Patron is restricted.</li>
228                   [% END %]
229                   [% IF checkout_info.NO_MORE_RENEWALS %]
230                       <li><i class="fa fa-li fa-exclamation"></i>No more renewals possible.</li>
231                   [% END %]
232                   [% IF checkout_info.EXPIRED %]
233                       <li><i class="fa fa-li fa-exclamation"></i>Patron's card is expired.</li>
234                   [% END %]
235                   [% IF checkout_info.ITEMNOTSAMEBRANCH %]
236                       <li><i class="fa fa-li fa-exclamation"></i>This item belongs to [% Branches.GetName( checkout_info.itemhomebranch ) %] and cannot be checked out from this location.</li>
237                   [% END %]
238                   [% IF checkout_info.USERBLOCKEDREMAINING %]
239                       <li><i class="fa fa-li fa-exclamation"></i>Patron has had overdue items and is blocked for [% checkout_info.USERBLOCKEDREMAINING %] day(s).</li>
240                   [% END %]
241                   [% IF checkout_info.USERBLOCKEDOVERDUE %]
242                       <li><i class="fa fa-li fa-exclamation"></i>Checkouts are BLOCKED because patron has overdue items.</li>
243                   [% END %]
244                   [% IF checkout_info.TOO_MANY %]
245                       <li><i class="fa fa-li fa-exclamation"></i>Too many checked out.</li>
246                   [% END %]
247                   [% IF checkout_info.UNKNOWN_BARCODE %]
248                       <li><i class="fa fa-li fa-exclamation"></i>The barcode was not found [% checkout_info.barcode |html %].</li>
249                   [% END %]
250                   [% IF checkout_info.DEBT %]
251                       <li><i class="fa fa-li fa-exclamation"></i>The patron has a debt of [% checkout_info.DEBT | $Price %].</li> <!-- Need debt_confirmed -->
252                   [% END %]
253                 </p>
254               [% END %]
255
256               [% IF checkout_info.issue.date_due %]
257                 <li>Due on [% checkout_info.issue.date_due | $KohaDates %]</li>
258               [% END %]
259             </td>
260           </tr>
261         [% END %]
262       </tbody>
263     </table>
264
265     [% IF confirmation_needed && CAN_user_circulate_force_checkout %]
266         <fieldset>
267             <legend>Please confirm checkout</legend>
268       <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber %]" />
269       <input type="hidden" name="issueconfirmed" value="1" />
270       <input type="hidden" name="debt_confirmed" value="1" />
271       <input type="hidden" name="branch" value="[% branch %]" />
272       <input type="hidden" name="batch" value="1" />
273       <input type="submit" id="checkoutrenew" class="approve" value="Checkout or renew" />
274         </fieldset>
275     </form>
276     [% END %]
277
278 [% ELSE %]
279     <div class="dialog message">This patron does not exist. <a href="/cgi-bin/koha/members/members-home.pl">Find another patron?</a></div>
280 [% END %]
281
282 </div>
283 </div>
284 </div>
285 [% IF patron %]
286     <div class="yui-b">
287         [% INCLUDE 'circ-menu.inc' %]
288     </div>
289 [% END %]
290 </div>
291
292 [% MACRO jsinclude BLOCK %]
293     [% INCLUDE 'calendar.inc' %]
294     [% INCLUDE 'datatables.inc' %]
295     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") %]
296     <script type="text/javascript">
297
298         $(document).ready(function() {
299             if($('#barcodelist').length) {
300                 $('#barcodelist').focus();
301             } else if ($('#checkoutrenew').length) {
302                 $('#checkoutrenew').focus();
303             }
304             $("#checkout_infos").dataTable($.extend(true, {}, dataTablesDefaults, {
305                 "sDom": 't',
306                 "aaSorting": [],
307                 "aoColumnDefs": [
308                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
309                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
310                 ],
311                 "bPaginate": false
312             }));
313         });
314     </script>
315     [% INCLUDE 'str/members-menu.inc' %]
316     [% Asset.js("js/members-menu.js") %]
317 [% END %]
318
319 [% INCLUDE 'intranet-bottom.inc' %]