Bug 30952: Staff interface redesign (header)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Context %]
4 [% USE Koha %]
5 [% USE Branches %]
6 [% USE KohaDates %]
7 [% USE Categories %]
8 [% USE TablesSettings %]
9 [% USE ItemTypes %]
10 [% USE Price %]
11 [% USE AuthorisedValues %]
12 [% SET footerjs = 1 %]
13 [% INCLUDE 'doc-head-open.inc' %]
14 [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
15 [% SET destination = "circ" %]
16 <title>
17     [% IF patron %]
18         Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %] &rsaquo; [% END %]
19
20     Circulation &rsaquo; Koha
21 </title>
22 [% INCLUDE 'doc-head-close.inc' %]
23 </head>
24
25 <body id="circ_circulation" class="circ">
26
27     [% WRAPPER 'header.inc' %]
28     [% INCLUDE 'circ-search.inc' %]
29 [% END %]
30
31     [% WRAPPER 'sub-header.inc' %]
32     <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
33         <ol>
34             <li>
35                 <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
36             </li>
37             <li>
38                 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
39             </li>
40
41             [% IF patron %]
42                 <li>
43                     <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a>
44                 </li>
45                 <li>
46                     <a href="#" aria-current="page">
47                         [% INCLUDE 'patron-title.inc' %]
48                     </a>
49                 </li>
50             [% ELSE %]
51                 <li>
52                     <a href="#" aria-current="page">
53                         Checkouts
54                     </a>
55                 </li>
56             [% END %]
57         </ol>
58     </nav>
59     [% END %]
60
61     <div class="main container-fluid">
62         <main>
63             <div class="row">
64                 <div class="col-sm-10 col-sm-push-2">
65
66                     [% IF patron %]
67                         [% INCLUDE 'members-toolbar.inc' %]
68                     [% END %]
69
70                     <h1>Checkouts</h1>
71
72                     <!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
73                     [% IF ( was_renewed ) %]
74                         <div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>
75                     [% END %]
76
77                     [% IF autoswitched %]
78                         <div id="autoswitched" class="dialog message">Patron was automatically switched by reading the patron card during checking out. Ensure you are working with the right patron.</div>
79                     [% END %]
80
81                     [% IF ADDITIONAL_MATERIALS && !NEEDSCONFIRMATION %]
82                         <div id="materials" class="dialog message">Note about the accompanying materials: [% ADDITIONAL_MATERIALS | html %]
83                         </div>
84                     [% END %]
85
86                     [% IF ( alert.ITEM_LOST ) %]
87                         <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST | html %]".</div>
88                     [% END %]
89
90                     [% IF ( alert.OTHER_CHARGES ) %]
91                         <div class="dialog message">The patron has unpaid charges for holds, rentals etc of [% alert.OTHER_CHARGES | $Price %]</div>
92                     [% END %]
93
94                     [% IF alert.HIGHHOLDS %]
95                         <div class="dialog message">High demand item. <strong>Loan period was not shortened due to override.</strong> Shortened due date would have been [% alert.HIGHHOLDS.returndate | $KohaDates %] ([% alert.HIGHHOLDS.duration  | html %] days).</div>
96                     [% END %]
97
98                     [% IF alert.RETURNED_FROM_ANOTHER %]
99                         <div class="dialog alert">Item was checked out to [% INCLUDE 'patron-title.inc' patron = alert.RETURNED_FROM_ANOTHER.patron %] and was returned automatically.</div>
100                     [% END %]
101
102                     [% IF ( nopermission ) %]
103                         <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
104                     [% END %]
105
106                     [% IF ( NEEDSCONFIRMATION ) %]
107                         <div id="circ_needsconfirmation" class="dialog alert audio-alert-action focus" tabindex="-1">
108                             [% IF CAN_user_circulate_force_checkout or ADDITIONAL_MATERIALS %]
109                                 <h3>Please confirm checkout</h3>
110                             [% ELSE %]
111                               <h3>Cannot check out</h3>
112                             [% END %]
113
114                             <ul>
115                                 [%IF ( AGE_RESTRICTION ) %]
116                                     <li>
117                                         Age restriction [% AGE_RESTRICTION | html %].
118                                         [% IF CAN_user_circulate_force_checkout %]
119                                             Check out anyway?
120                                         [% END %]
121                                     </li>
122                                 [% END %]
123
124
125                                 [% IF ( DEBT ) %]
126                                     <li>The patron has a debt of [% DEBT | $Price %].</li>
127                                 [% END %]
128
129                                 [% IF ( DEBT_GUARANTEES ) %]
130                                     <li>The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES | $Price %].</li>
131                                 [% END %]
132
133                                 [% IF ( DEBT_GUARANTORS ) %]
134                                     <li>The patron's guarantors and their other guarantees collectively have a debt of [% DEBT_GUARANTORS | $Price %].</li>
135                                 [% END %]
136
137                                 [% IF ( RENTALCHARGE && RENTALCHARGE > 0 ) %]
138                                     <li>Rental charge for this item: [% RENTALCHARGE | $Price %]</li>
139                                 [% END %]
140
141                                 [% IF ( RENEW_ISSUE ) %]
142                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is currently checked out to this patron.  Renew?</li>
143                                 [% END %]
144
145                                 [% IF ( RESERVE_WAITING ) %]
146                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %] since [% reswaitingdate | $KohaDates %]</li>
147                                 [% END %]
148
149                                 [% IF ( TRANSFERRED ) %]
150                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) and being transferred to [% Branches.GetName( resbranchcode ) | html %]</li>
151                                 [% END %]
152
153                                 [% IF ( PROCESSING ) %]
154                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is being processed for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %]</li>
155                                 [% END %]
156
157                                 [% IF ( RESERVED ) %]
158                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %] since [% resreservedate | $KohaDates %]</li>
159                                 [% END %]
160
161                                 [% IF ( ISSUED_TO_ANOTHER ) %]
162                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issued_borrowernumber | uri %]">[% issued_firstname | html %] [% issued_surname | html %]</a> ([% issued_cardnumber | html %]).
163                                         [% IF CAN_user_circulate_force_checkout %]
164                                             Check in and check out?
165                                         [% END %]
166                                     </li>
167                                 [% END %]
168
169                                 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
170                                     <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
171                                 [% END %]
172
173                                 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
174                                     <li>Too many on-site checked out. [% current_loan_count | html %] on-site checked out, only [% max_loans_allowed | html %] are allowed.</li>
175                                 [% END %]
176
177                                 [% IF ( BORRNOTSAMEBRANCH ) %]
178                                     <li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) | html %])</li>
179                                 [% END %]
180
181                                 [% IF ( PATRON_CANT ) %]
182                                     <li>This patron can't check out this item per library circulation policy.</li>
183                                 [% END %]
184
185                                 [% IF ( TOO_MANY and TOO_MANY == 'NO_RULE_DEFINED' ) %]
186                                     <li>No circulation rule is defined for this patron and itemtype combination.</li>
187                                 [% END %]
188
189                                 [% IF ( NOT_FOR_LOAN_FORCING ) %]
190                                     <li>
191                                     [% IF ( itemtype_notforloan ) %]
192                                         <span>Item type is normally not for loan.</span>
193                                     [% ELSIF ( item_notforloan ) %]
194                                         [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
195                                         <span>Item is normally not for loan</span>[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
196                                     [% END %]
197                                         [% IF CAN_user_circulate_force_checkout %]
198                                             <span>Check out anyway?</span>
199                                         [% END %]
200                                     </li>
201                                 [% END %]
202
203                                 [% IF ( USERBLOCKEDOVERDUE ) %]
204                                     <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).
205                                         [% IF CAN_user_circulate_force_checkout %]
206                                             Check out anyway?
207                                         [% END %]
208                                     </li>
209                                 [% END %]
210
211                                 [% IF ( ITEM_LOST ) %]
212                                     <li>This item has been lost with a status of "[% ITEM_LOST | html %]".
213                                         [% IF CAN_user_circulate_force_checkout %]
214                                             Check out anyway?
215                                         [% END %]
216                                     </li>
217                                 [% END %]
218
219                                 [% IF HIGHHOLDS %]
220                                     <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration | html %] days (due [% HIGHHOLDS.returndate | $KohaDates %]). Check out anyway?</li>
221                                 [% END %]
222
223                                 [% IF PREVISSUE %]
224                                     <li>Patron has previously checked out this title: <strong>[% biblio.title | html %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</strong>. Check out anyway?</li>
225                                 [% END %]
226
227                                 [% IF BIBLIO_ALREADY_ISSUED %]
228                                     <li>
229                                         Patron has already checked out another item from this record.
230                                         [% IF CAN_user_circulate_force_checkout %]
231                                             Check out anyway?
232                                         [% END %]
233                                     </li>
234                                 [% END %]
235
236                                 [% IF ADDITIONAL_MATERIALS %]
237                                     <li>
238                                         Please confirm that the accompanying materials are present: [% ADDITIONAL_MATERIALS | html %]
239                                     </li>
240                                 [% END %]
241
242                                 [% IF RECALLED %]
243                                     [% IF RECALLED.waiting %]
244                                         <li>Item <i>[% RECALLED.biblio.title | html %]</i> ([% RECALLED.item.barcode | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.waiting_date | $KohaDates %]</li>
245                                     [% ELSIF RECALLED.requested or RECALLED.overdue %]
246                                         <li>Item <i>[% RECALLED.biblio.title | html %]</i> [% IF RECALLED.item %]([% RECALLED.item.barcode | html %])[% END %] has been recalled by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.created_date | $KohaDates %]</li>
247                                     [% END %]
248                                 [% END %]
249
250                             </ul>
251
252                             [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
253                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
254                                     <input type="hidden" name="restoreduedatespec" />
255
256                                     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
257
258                                     [% IF HIGHHOLDS %]
259                                         <p class="circ-override-high-holds">
260                                             <input type="checkbox" name="override_high_holds_tmp" id="override_high_holds_tmp" value="1" />
261                                             <label for="override_high_holds_tmp">Don't decrease loan length based on holds</label>
262                                         </p>
263                                     [% END %]
264
265                                     [% IF ( RESERVED ) %]
266                                         <p>
267                                             <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
268                                             <label for="cancelreserve">Cancel hold</label>
269                                         </p>
270                                     [% END %]
271
272                                     [% IF ( RESERVE_WAITING ) %]
273                                         <p>
274                                             <label for="cancelreserve">Cancel hold</label>
275                                             <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
276                                             <label for="revertreserve">Revert waiting status</label>
277                                             <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
278                                         </p>
279                                     [% END %]
280
281                                     [% IF ( TRANSFERRED ) %]
282                                         <p>
283                                             <label for="cancelreserve">Cancel hold</label>
284                                             <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
285                                             <label for="revertreserve">Revert hold transfer status</label>
286                                             <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
287                                         </p>
288                                     [% END %]
289
290                                     [% IF ( PROCESSING ) %]
291                                         <p>
292                                             <label for="cancelreserve">Cancel hold</label>
293                                             <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
294                                             <label for="revertreserve">Revert In Processing status</label>
295                                             <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
296                                         </p>
297                                     [% END %]
298
299                                     [% IF ( RECALLED ) %]
300                                         <p>
301                                             <label for="cancelrecall">Cancel recall</label>
302                                             <input type="radio" value="cancel" name="cancel_recall" id="cancelrecall" />
303                                             <input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
304                                         </p>
305                                         [% IF RECALLED.waiting %]
306                                             <p>
307                                                 <label for="revertrecall">Revert waiting status</label>
308                                                 <input type="radio" value="revert" name="cancel_recall" id="revertrecall" checked="checked"/>
309                                                 <input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
310                                             </p>
311                                         [% END %]
312                                     [% END %]
313
314                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
315                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
316                                     <input type="hidden" name="issueconfirmed" value="1" />
317                                     <input type="hidden" name="override_high_holds" value="[% override_high_holds | html %]"/>
318
319                                     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
320
321                                     [% IF ( INVALID_DATE ) %]
322                                         <p>
323                                           <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
324                                             <label for="duedatespec">Due date</label>
325                                         </p>
326                                     [% ELSE %]
327                                         <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
328                                     [% END %]
329
330                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
331                                     <input type="hidden" name="branch" value="[% branch | html %]" />
332
333                                     [% IF ( RENEW_ISSUE ) %]
334                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
335                                     [% ELSE %]
336                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
337                                     [% END %]
338
339                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
340                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
341                                 </form>
342                             [% END # /IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
343
344                             [% IF ADDITIONAL_MATERIALS && !CAN_user_circulate_force_checkout %]
345                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
346                                     <input type="hidden" name="restoreduedatespec" />
347
348                                     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
349
350                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
351                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
352                                     <input type="hidden" name="issueconfirmed" value="1" />
353                                     <input type="hidden" name="override_high_holds" value="[% override_high_holds | html %]"/>
354                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
355                                     <input type="hidden" name="branch" value="[% branch | html %]" />
356
357                                     [% IF ( RENEW_ISSUE ) %]
358                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
359                                     [% ELSE %]
360                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
361                                     [% END %]
362
363                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
364                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
365                                 </form>
366                             [% END # /IF ADDITIONAL_MATERIALS %]
367
368                             [% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED or PROCESSING ) %]
369                                 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
370                                     <input type="hidden" name="restoreduedatespec" />
371                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
372                                     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
373                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
374                                     <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
375                                 </form>
376                             [% END %]
377
378                             [% IF ( RECALLED ) %]
379                                 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
380                                     <button class="print" type="submit" onclick="Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% RECALLED.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
381                                 </form>
382                             [% END %]
383
384                             <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
385                                 [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
386                                 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
387                                 <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
388                                 <input type="hidden" name="restoreduedatespec" />
389                                 <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
390                                 [% IF CAN_user_circulate_force_checkout or HIGHHOLDS or ADDITIONAL_MATERIALS %]
391                                     [% IF ( RENEW_ISSUE ) %]
392                                         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
393                                     [% ELSE %]
394                                         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't check out (N)</button>
395                                     [% END %]
396                                 [% ELSE %]
397                                     <button type="submit" class="deny"><i class="fa fa-times"></i> Continue</button>
398                                 [% END %]
399                             </form>
400
401                             [% IF ( RESERVED || ISSUED_TO_ANOTHER || RECALLED ) && (CAN_user_reserveforothers_place_holds ) %]
402                                 [% UNLESS noissues %]
403                                     <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa fa-sticky-note-o"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
404                                 [% END %]
405                             [% END %]
406                         </div> <!-- /#circ_needsconfirmation -->
407                     [% END # /NEEDSCONFIRMATION %]
408
409                     [% IF ( IMPOSSIBLE ) %]
410                         <div id="circ_impossible" class="dialog alert audio-alert-warning focus" tabindex="-1">
411                             [% IF ( UNKNOWN_BARCODE ) %]
412                                 <h3>Barcode not found</h3>
413                             [% END %]
414
415                             <!-- RESULT OF ISSUING REQUEST -->
416                             <ul>
417                                 [% IF ( DEBT_GUARANTORS ) %]
418                                     <li>The patron's guarantors and their other guarantees collectively have a debt of [% DEBT_GUARANTORS | $Price %].</li>
419                                 [% END %]
420
421                                 [% IF ( STATS ) %]
422                                     <li>Local use recorded</li>
423                                 [% END %]
424
425                                 [% IF ( INVALID_DATE ) %]
426                                     <li>The due date &quot;[% INVALID_DATE | $KohaDates %]&quot; is invalid</li>
427                                 [% END %]
428
429                                 [% IF ( UNKNOWN_BARCODE ) %]
430                                     <li>The barcode was not found: <span class="ex">[% barcode | html %]</span>
431                                         <div>
432                                             [% IF ( FALLBACK ) %]
433                                                 [% IF options %]
434                                                     <button type="button" class="approve" data-toggle="modal" data-target="#itemSearchFallback"><i class="fa fa-search"></i> Show matching titles</button>
435                                                 [% ELSE %]
436                                                     <div>No items were found by searching.</div>
437                                                 [% END %]
438                                             [% END %]
439
440                                             [% IF ( fast_cataloging ) %]
441                                                 [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
442                                                     <a class="approve" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode |uri %]&amp;circborrowernumber=[% patron.borrowernumber | html %]&amp;branch=[% branch | html %]&amp;duedatespec=[% duedatespec | html %]&amp;stickyduedate=[% stickyduedate | html %]"><i class="fa fa-plus"></i> Add record using fast cataloging</a>
443                                                 [% END %]
444                                             [% END %]
445                                         </div>
446                                     </li>
447                                 [% END %]
448
449                                 [% IF ( NOT_FOR_LOAN ) %]
450                                     <li>
451                                     [% IF ( itemtype_notforloan ) %]
452                                         Item type not for loan.
453                                     [% ELSIF ( item_notforloan ) %]
454                                         [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
455                                         Item not for loan[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
456                                     [% END %]
457                                     </li>
458                                 [% END %]
459
460                                 [% IF ( WTHDRAWN ) %]
461                                     <li>
462                                         <span>Item has been withdrawn</span>
463                                         [% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
464                                         [% IF (item_withdrawn_lib) %]<span class="co-withdrawn">([% item_withdrawn_lib | html %])</span>[% END %]
465                                     </li>
466                                 [% END %]
467
468                                 [% IF ( RESTRICTED ) %]
469                                     <li>Item is restricted</li>
470                                 [% END %]
471
472                                 [% IF ( GNA ) %]
473                                     <li>Patron's address is in doubt</li>
474                                 [% END %]
475
476                                 [% IF ( CARD_LOST ) %]
477                                     <li>Patron's card is lost</li>
478                                 [% END %]
479
480                                 [% IF ( DEBARRED ) %]
481                                     <li>Patron is restricted</li>
482                                 [% END %]
483
484                                 [% IF ( NO_MORE_RENEWALS ) %]
485                                     <li>No more renewals possible</li>
486                                 [% END %]
487
488                                 [% IF NO_RENEWAL_FOR_ONSITE_CHECKOUTS %]
489                                     <li>This item can not be renewed, it's an on-site checkout</li>
490                                 [% END %]
491
492                                 [%IF ( AGE_RESTRICTION ) %]
493                                     <li>Age restriction [% AGE_RESTRICTION | html %].</li>
494                                 [% END %]
495
496                                 [% IF ( EXPIRED ) %]
497                                     <li>Patron's card is expired</li>
498                                 [% END %]
499
500                                 [% IF ( TOO_MANY ) %]
501                                     <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
502                                 [% END %]
503
504                                 [% IF ( ITEMNOTSAMEBRANCH ) %]
505                                     <li>This item belongs to [% Branches.GetName( itemhomebranch ) | html %] and cannot be checked out from this location.</li>
506                                 [% END %]
507
508                                 [% IF RETURN_IMPOSSIBLE %]
509                                     <li>This item must be returned to [% Branches.GetName( branch_to_return ) | html %].</li>
510                                 [% END %]
511
512                                 [% IF ( USERBLOCKEDWITHENDDATE ) %]
513                                     <li>Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].</li>
514                                 [% END %]
515
516                                 [% IF ( USERBLOCKEDNOENDDATE ) %]
517                                     <li>Patron has an indefinite restriction.</li>
518                                 [% END %]
519
520                                 [% IF ( USERBLOCKEDOVERDUE ) %]
521                                     <li>Checkouts are BLOCKED because patron has overdue items.</li>
522                                 [% END %]
523
524                                 [% IF ( RECALLED_INTRANSIT ) %]
525                                     <li>Item has been recalled and is in transit for pickup at [% Branches.GetName( RECALLED_INTRANSIT ) | html %].</li>
526                                 [% END %]
527                                 </ul>
528
529                                 [% IF (forceallow) %]
530                                     <li>Restriction overridden temporarily.</li>
531                                 [% END %]
532                             </ul>
533                         </div> <!-- /#circ_impossible -->
534
535                         [% IF ( FALLBACK ) %]
536                             [% IF options %]
537                                 <!-- Modal -->
538                                 <div class="modal" id="itemSearchFallback" tabindex="-1" role="dialog" aria-labelledby="itemSearchFallbackLabel">
539                                     <div class="modal-dialog modal-wide" role="document">
540                                         <div class="modal-content">
541                                             <div class="modal-header">
542                                                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
543                                                 <h3 id="itemSearchFallbackLabel"><h3>Barcode not found. The following items were found by searching:</h3>
544                                             </div>
545                                             <div class="modal-body">
546                                                 <table class="table_borrowers">
547                                                     <thead>
548                                                         <tr>
549                                                             <th>Title</th>
550                                                             <th>Barcode</th>
551                                                             <th>Call number</th>
552                                                             <th>Copy number</th>
553                                                             <th>Inventory number</th>
554                                                             <th>Serial enumeration</th>
555                                                             <th>Collection</th>
556                                                             [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
557                                                             <th>&nbsp;</th>
558                                                         </tr>
559                                                     </thead>
560                                                     <tbody>
561                                                     [% FOREACH item IN options %]
562                                                         <tr>
563                                                             <td>
564                                                                 <a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber | html %]">[% item.biblio.title | html %] <i class="fa fa-window-restore"></i></a>
565                                                             </td>
566                                                             <td>
567                                                                 [% item.barcode | html %]
568                                                             </td>
569                                                             <td>[% item.itemcallnumber | html %]</th>
570                                                             <td>[% item.copynumber | html %]</th>
571                                                             <td>[% item.stocknumber| html %]</th>
572                                                             <td>[% item.enumchron| html %]</th>
573                                                             <td>
574                                                                 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]
575                                                             </td>
576                                                             [% IF ( item_level_itypes ) %]
577                                                                 <td>
578                                                                     [% ItemTypes.GetDescription( item.itype ) | html %]
579                                                                 </td>
580                                                             [% END %]
581                                                             <td>
582                                                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
583                                                                     [% IF (forceallow) %]
584                                                                         <input type="hidden" name="forceallow" value="1">
585                                                                     [% END %]
586                                                                     <input type="hidden" name="restoreduedatespec" />
587                                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
588                                                                     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
589                                                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
590                                                                     <input type="hidden" name="branch" value="[% branch | html %]" />
591                                                                     <input type="hidden" name="barcode" value="[% item.barcode | html %]" />
592                                                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
593                                                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
594                                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
595                                                                 </form>
596                                                             </td>
597                                                         </tr>
598                                                     [% END %]
599                                                     </tbody>
600                                                 </table>
601                                             </div> <!-- /.modal-body -->
602                                             <div class="modal-footer">
603                                                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
604                                             </div>
605                                         </div> <!-- /.modal-content -->
606                                     </div> <!-- /.modal-dialog.modal-wide -->
607                                 </div> <!-- /#itemSearchFallback -->
608                             [% END # /IF options %]
609                         [% END # /IF FALLBACK %]
610
611                     [% ELSE # IF IMPOSSIBLE %]
612                         [% IF (forceallow) %]
613                             <div id="overridden_debarment" class="dialog alert">Restriction overridden temporarily</div>
614                         [% END %]
615                     [% END # /IF IMPOSSIBLE %]
616
617                     <span class="audio-alert-success"></span>
618
619                     [% IF ( issued ) %]
620                         <p>Item checked out</p>
621                     [% END %]
622
623                     [% IF ( message ) %]
624                         [% INCLUDE 'patron-toolbar.inc' %]
625                         <h4>No patron matched <span class="ex">[% message | html %]</span></h4>
626                     [% END %]
627
628                     <!-- BARCODE ENTRY -->
629
630                     [% IF patron %]
631
632                         [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
633                             <div class="dialog alert">
634                                 <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
635                             </div>
636                         [% END %]
637
638                         <div class="row">
639                             [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
640                                 <div class="col-sm-6">
641                                     <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
642                                         <input type="hidden" name="restoreduedatespec" />
643                                         [% IF ( issue ) %]
644                                             <fieldset id="circ_circulation_issue" class="lastchecked">
645                                         [% ELSE %]
646                                             <fieldset id="circ_circulation_issue">
647                                         [% END %]
648
649                                         [% IF Koha.Preference('DisplayClearScreenButton') == 'issueslip' %]
650                                             <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
651                                             <span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
652                                         [% ELSIF Koha.Preference('DisplayClearScreenButton') == 'issueqslip' %]
653                                             <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
654                                             <span id="printclearscreenq"><a href="#" title="Print quick slip and clear screen"><i class="fa fa-print"></i></a></span>
655                                         [% END %]
656
657                                         [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
658
659                                         <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
660
661                                         [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
662                                             <div class="hint">Enter item barcode or keyword:</div>
663                                         [% ELSE %]
664                                             <div class="hint">Enter item barcode:</div>
665                                         [% END %]
666
667                                         [% IF NEEDSCONFIRMATION %]
668                                             <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
669                                         [% ELSE %]
670                                             <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" />
671                                         [% END %]
672
673                                         <button type="submit" class="btn btn-default">Check out</button>
674
675                                         <div id="show-circ-settings">
676                                             <a href="#"><i class="fa fa-caret-right circ-settings-icon"></i> Checkout settings</a>
677                                         </div>
678
679                                         <div class="circ-settings">
680
681                                                 [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
682                                                     [% IF ( SpecifyDueDate ) %]
683                                                         <div id="specify-due-date" class="circ-setting">
684                                                             <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
685                                                             [% IF ( duedatespec ) %]
686                                                                 <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
687                                                             [% ELSE %]
688                                                                 <input type="text" size="20" id="duedatespec" name="duedatespec" value="" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
689                                                             [% END %]
690                                                             <label for="stickyduedate"> Remember for session:</label>
691                                                             [% IF ( stickyduedate ) %]
692                                                                 <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
693                                                             [% ELSE %]
694                                                                 <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
695                                                             [% END %]
696                                                         </div>
697                                                     [% END %]
698                                                 [% END %]
699
700                                                 [% UNLESS ( noissues ) %]
701                                                     [% IF Koha.Preference('AllowSetAutomaticRenewal') %]
702                                                         <div id="set-automatic-renewal" class="circ-setting">
703                                                             [% IF NEEDSCONFIRMATION %]
704                                                                 [% IF auto_renew %]
705                                                                     [% IF patron.autorenew_checkouts %]
706                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
707                                                                         title="Patron has opted out of auto-renewal"/>
708                                                                     [% ELSE %]
709                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
710                                                                     [% END %]
711                                                                 [% ELSE %]
712                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
713                                                                 [% END %]
714                                                             [% ELSE %]
715                                                                 [% IF ( auto_renew && patron.autorenew_checkouts ) %]
716                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
717                                                                 [% ELSIF patron.autorenew_checkouts %]
718                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
719                                                                 [% ELSE %]
720                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
721                                                                     title="Patron has opted out of auto-renewal"/>
722                                                                 [% END %]
723                                                             [% END %]
724
725                                                             <label for="auto_renew">Automatic renewal</label>
726                                                         </div>
727                                                     [% END %]
728                                                     [% IF Koha.Preference('decreaseLoanHighHolds') %]
729                                                         <div id="set_high_holds_overrride" class="circ-setting">
730                                                             [% IF NEEDSCONFIRMATION %]
731                                                                 [% IF override_high_holds %]
732                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
733                                                                 [% ELSE %]
734                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
735                                                                 [% END %]
736                                                             [% ELSE %]
737                                                                 [% IF override_high_holds %]
738                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
739                                                                 [% ELSE %]
740                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
741                                                                 [% END %]
742                                                             [% END %]
743                                                             <label for="override_high_holds">Don't decrease checkout length based on holds</label>
744                                                         </div>
745                                                     [% END %]
746                                                 [% END %]
747
748                                                 [% IF Koha.Preference('OnSiteCheckouts') %]
749                                                     <div id="onsite_checkout-select" class="circ-setting">
750                                                         [% IF noissues %]
751                                                             <div class="onsite-checkout-only">
752                                                                 <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
753                                                                 <input type="text" name="duedatespec" id="duedatespec" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
754                                                                 <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
755                                                             </div>
756                                                         [% ELSE %]
757                                                             [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
758                                                             <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
759                                                             [% ELSE %]
760                                                             <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
761                                                             [% END %]
762                                                         [% END %]
763                                                     </div>
764                                                 [% END %]
765
766                                             </div> <!-- /.circ-settings -->
767
768                                             <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
769                                             <input type="hidden" name="branch" value="[% branch | html %]" />
770                                             <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
771                                             [% IF ( CHARGES ) %]
772                                                     <input type="hidden" name="charges" value="yes" />
773                                             [% END %]
774                                         </fieldset> <!-- /#circ_circulation_issue -->
775
776                                         [% IF ( issue ) %]
777                                             <div class="lastchecked">
778                                                 <p><strong>Checked out: </strong>[% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]). Due on [% issue.date_due | $KohaDates as_due_date => 1 %]</p>
779                                             </div>
780                                         [% END %]
781                                     </form> <!-- /#mainform -->
782                                 </div> <!-- /.col-sm-6 -->
783
784                             [% END #/IF !noissues %]
785
786                             [% IF ( noissues ) %]
787                                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
788                                     <div class="col-sm-6">
789                                 [% ELSE %]
790                                     <div>
791                                 [% END %]
792                             [% ELSE %]
793                                 <div class="col-sm-6">
794                             [% END %]
795
796                             [% IF ( noissues ) %]
797                                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
798                                     <div id="circmessages" class="circmessage attention">
799                                 [% ELSE %]
800                                     <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
801                                     <div id="circmessages" class="circmessage warning">
802                                 [% END %]
803                                 <h3>
804                                     Cannot check out!
805                                     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
806                                         <span class="circ-hlt">Only on-site checkouts are allowed</span>
807                                     [% END %]
808                                 </h3>
809                             [% ELSE %]
810                                 <div id="circmessages" class="circmessage attention">
811                             [% END %]
812
813                             [% INCLUDE 'patron_messages.inc' %]
814
815                         </div> <!-- /#circmessages -->
816                     </div> <!-- /div or div.col-sm-6 -->
817                 </div> <!-- /.row -->
818
819                 <div id="patronlists" class="toptabs">
820                     <ul>
821                         <li>
822                             <a href="#checkouts">Checkouts ([% issuecount || 0 | html %])</a>
823                         </li>
824
825                         [% IF relatives_issues_count %]
826                             <li>
827                                 <a id="relatives-issues-tab" href="#relatives-issues">Relatives' checkouts ([% relatives_issues_count | html %])</a>
828                             </li>
829                         [% END %]
830
831                         <li>
832                             <a href="#reserves" id="holds-tab">Holds ([% holds_count || 0 | html %])</a>
833                         </li>
834
835                         [% IF Koha.Preference('UseRecalls') %]
836                             <li>
837                                 <a href="#recalls" id="recalls-tab">Recalls ([% recalls.count || 0 | html %])</a>
838                             </li>
839                         [% END %]
840
841                         [% IF Koha.Preference('ArticleRequests') %]
842                             [% SET current_article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current' ) %]
843                             <li>
844                                 <a href="#article-requests" id="article-requests-tab">Article requests ([% current_article_requests.count || 0 | html %])</a>
845                             </li>
846                         [% END %]
847
848                         [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
849                             <li>
850                                 [% IF ( patron.return_claims.count ) %]
851                                     <a href="#return-claims" id="return-claims-tab">
852                                         Claims
853                                         ([% IF patron.return_claims.resolved.count == 0 %]
854                                             <span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
855                                         [% ELSE %]
856                                             <span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
857                                         [% END %]
858                                         [% IF patron.return_claims.unresolved.count == 0 %]
859                                             <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
860                                         [% ELSE %]
861                                             <span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
862                                         [% END %])
863                                     </a>
864                                 [% ELSE %]
865                                     <a href="#return-claims" id="return-claims-tab">
866                                         Claims
867                                         (<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
868                                         <span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>)
869                                     </a>
870                                 [% END %]
871                             </li>
872                         [% END %]
873
874                         <li>
875                             <a id="debarments-tab-link" href="#reldebarments">Restrictions ([% debarments.size || 0 | html %])</a>
876                         </li>
877
878                         [% SET enrollments = patron.get_club_enrollments %]
879                         [% SET enrollable  = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
880                         [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
881                             <li>
882                                 <a id="clubs-tab-link" href="#clubs-tab">
883                                     Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
884                                 </a>
885                             </li>
886                         [% END %]
887                     </ul>
888
889                     <!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
890
891                     [% INCLUDE "checkouts-table.inc" %]
892
893                     [% INCLUDE "relatives-issues-table.inc" %]
894
895                     [% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
896                         <div id="clubs-tab">
897                             Loading...
898                         </div> <!-- /#clubs-tab -->
899                     [% END %]
900
901                     [% INCLUDE borrower_debarments.inc %]
902
903                     <div id="reserves">
904                         [% IF ( holds_count ) %]
905                             <form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
906                                 <input type="hidden" name="from" value="circ" />
907                                 <table id="holds-table" style="width: 100% !Important;">
908                                     <thead>
909                                         <tr>
910                                             <th>Hold date</th>
911                                             <th>Title</th>
912                                             <th>Call number</th>
913                                             <th>Item type</th>
914                                             <th>Barcode</th>
915                                             <th>Pickup at</th>
916                                             <th>Expiration</th>
917                                             <th>Priority</th>
918                                             <th>Cancel?</th>
919                                             <th>Suspend?</th>
920                                             <th>Status</th>
921                                         </tr>
922                                     </thead>
923                                 </table>
924
925                                 <fieldset class="action">
926                                     <input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
927
928                                     [% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
929                                     [% IF hold_cancellation.count %]
930                                         <select name="cancellation-reason">
931                                             <option value="">No reason given</option>
932                                             [% FOREACH reason IN hold_cancellation %]
933                                                 <option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
934                                             [% END %]
935                                         </select>
936                                     [% END %]
937                                 </fieldset>
938                             </form>
939
940                             [% IF Koha.Preference('SuspendHoldsIntranet') %]
941                                 <fieldset class="action">
942                                     <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
943                                         <input type="hidden" name="from" value="circ" />
944                                         <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
945                                         <input type="submit" value="Suspend all holds" />
946
947                                         [% IF Koha.Preference('AutoResumeSuspendedHolds') %]
948                                         <label for="suspend_until">until</label>
949                                         <input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr" data-flatpickr-futuredate="true" />
950                                         <span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
951                                          [% END %]
952                                     </form>
953                                 </fieldset>
954
955                                 <fieldset class="action">
956                                     <form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
957                                         <input type="hidden" name="from" value="circ" />
958                                         <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
959                                         <input type="hidden" name="suspend" value="0" />
960                                         <input type="submit" value="Resume all suspended holds" />
961                                     </form>
962                                 </fieldset>
963                             [% END # /IF SuspendHoldsIntranet %]
964
965                         [% ELSE # IF holds_count %]
966                             <p>Patron has nothing on hold.</p>
967                         [% END # /IF holds_count %]
968                     </div> <!-- /#reserves -->
969
970                     [% IF Koha.Preference('UseRecalls') %]
971                         <div id="recalls">
972                             [% INCLUDE 'recalls.inc' %]
973                         </div>
974                     [% END %]
975
976                     [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
977                         [% INCLUDE 'patron-return-claims.inc' %]
978                     [% END %]
979
980                     [% IF Koha.Preference('ArticleRequests') %]
981                         [% INCLUDE 'patron-article-requests.inc' %]
982                     [% END %]
983
984                 </div> <!-- /#patronlists -->
985                 [% ELSIF borrowernumber # IF patron %]
986                     <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
987                 [% END # /IF patron %]
988
989                 </div> <!-- /.col-sm-10.col-sm-push-2 -->
990
991                 [% IF Koha.Preference('CircSidebar') %]
992                     [% IF not( borrowernumber and patron ) %]
993                         <div class="col-sm-2 col-sm-pull-10">
994                             <aside>
995                                 [% INCLUDE 'circ-nav.inc' %]
996                             </aside>
997                         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
998                     [% END %]
999                 [% END %]
1000
1001                 [% IF borrowernumber and patron %]
1002                         <div class="col-sm-2 col-sm-pull-10">
1003                             <aside>
1004                         [% INCLUDE 'circ-menu.inc' %]
1005                             </aside>
1006                         </div> <!-- /.col-sm-2 col-sm-pull-10 -->
1007                 [% END %]
1008
1009             </div> <!-- /.row -->
1010         </main>
1011
1012         [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
1013             [% INCLUDE 'modals/resolve_return_claim.inc' %]
1014         [% END %]
1015
1016 <!-- Modal -->
1017 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
1018     <div class="modal-dialog">
1019         <div class="modal-content">
1020             <div class="modal-header">
1021                 <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
1022             </div>
1023             <div class="modal-body">
1024                 <p>You have already submitted a barcode, please wait for the checkout to process...</p>
1025             </div>
1026         </div> <!-- /.modal-content -->
1027     </div> <!-- /.modal-dialog -->
1028 </div> <!-- /#barcodeSubmittedModal -->
1029
1030 [% MACRO jsinclude BLOCK %]
1031     [% INCLUDE 'datatables.inc' %]
1032     [% INCLUDE 'columns_settings.inc' %]
1033     [% INCLUDE 'select2.inc' %]
1034     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
1035     [% PROCESS 'modal-claims.inc' %]
1036     [% PROCESS 'modal-claims-js' %]
1037
1038     <script>
1039         /* Set some variable needed in circulation.js */
1040         var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
1041         var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
1042         var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
1043         var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
1044         var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
1045         var interface = "[% interface | html %]";
1046         var theme = "[% theme | html %]";
1047         var borrowernumber = "[% patron.borrowernumber | html %]";
1048         var branchcode = "[% branch | html %]";
1049         var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
1050         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
1051         var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %];
1052         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %];
1053         var script = "circulation";
1054         var relatives_borrowernumbers = new Array();
1055         [% FOREACH b IN relatives_borrowernumbers %]
1056             relatives_borrowernumbers.push("[% b | html %]");
1057         [% END %]
1058         var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
1059     </script>
1060     [% Asset.js("js/pages/circulation.js") | $raw %]
1061     [% Asset.js("js/checkouts.js") | $raw %]
1062     [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
1063         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1064     [% END %]
1065     [% Asset.js("js/holds.js") | $raw %]
1066     [% INCLUDE 'calendar.inc' %]
1067     <script>
1068         table_settings_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1069         table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'relatives-issues-table', 'json' ) | $raw %]
1070         table_settings_borrowers_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1071
1072         [% IF borrowernumber and patron %]
1073             if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){
1074                 Cookies.remove("holdfor", { path: '/' });
1075             }
1076         [% ELSE %]
1077             Cookies.remove("holdfor", { path: '/' });
1078         [% END %]
1079
1080         [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
1081
1082         // On-site checkout
1083         function toggle_onsite_checkout(){
1084             if ( $("#onsite_checkout").prop('checked') ) {
1085                 $("#duedatespec").val("[% todaysdate | $KohaDates  with_hours => 1 %]")
1086             }
1087         }
1088
1089         function Dopop(link) {
1090             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1091         }
1092         $(document).ready(function() {
1093             $('#mainform').on('submit',function() {
1094                 if ($("#barcode") && $("#barcode").val()) {
1095                     $('#barcode').on('keypress',function(event) {
1096                         $('#barcodeSubmittedModal').modal();
1097                         event.preventDefault(); }
1098                     );
1099                 }
1100             });
1101
1102             if ( $('#clubs-tab').length ) {
1103                 $('#clubs-tab-link').on('click', function() {
1104                     $('#clubs-tab').text(_("Loading..."));
1105                     $('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]');
1106                 });
1107             }
1108
1109             // listen submit to trigger qslip on empty checkout
1110             $('#mainform').bind('submit',function() {
1111                 if ($('#barcode').val() == '') {
1112                     [% IF ( CircAutoPrintQuickSlip == 'clear' ) %]
1113                         window.location='/cgi-bin/koha/circ/circulation.pl';
1114                         return false;
1115                     [% ELSE %]
1116                         return printx_window( '[% CircAutoPrintQuickSlip | html %]' );
1117                     [% END %]
1118                 }
1119             });
1120             toggle_onsite_checkout();
1121             $("#onsite_checkout").click(function(){
1122                 toggle_onsite_checkout();
1123             });
1124
1125             [% IF HIGHHOLDS %]
1126                 [% IF !override_high_holds %]
1127                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]');
1128                     if ('[% duedatespec | html %]' === '') {
1129                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1130                     } else {
1131                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]');
1132                     }
1133                 [% END %]
1134
1135                 $("#override_high_holds_tmp").on( 'change', function() {
1136                     if ( this.checked ) {
1137                         $("input[name=duedatespec]:hidden").val('');
1138                     }
1139                 });
1140             [% END %]
1141         });
1142     </script>
1143     [% INCLUDE 'str/members-menu.inc' %]
1144     [% Asset.js("js/members-menu.js") | $raw %]
1145     [% Asset.js("js/recalls.js") | $raw %]
1146 [% END %]
1147
1148 [% INCLUDE 'intranet-bottom.inc' %]