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