Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
Aleisha Amohia db095c3a7b Bug 19532: Recalls on intranet
See recalls on Intranet
- old recalls (all inactive recalls)
- recalls queue (all active recalls) - cancel, expire, revert waiting status, multiple cancel, mark overdue
- recalls to pull (available but not yet waiting) - cancel
- recalls awaiting pickup (awaiting pickup, awaiting pickup more than RecallMaxPickUpDelay days) - expire, revert waiting status
- overdue recalls (overdue to be returned) - cancel, multiple cancel
- biblio recalls tab (all active recalls relevant to this bib) - cancel, expire, revert waiting status, mark overdue
- patron recalls tab (all active recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue
- patron recalls history tab (all recalls relevant to this patron) - cancel, expire, revert waiting status, mark overdue
- log viewer

and the general circulation of recalls

== TEST PLAN FOR RECALLS ==

ADMINISTRATION

1. Apply all patches
2. Run database updates, update schema files and confirm everything applies cleanly
3. Run tests and confirm everything passes:
t/db_dependent/Koha/Recall.t
t/db_dependent/Koha/Recalls.t
t/db_dependent/Stats.t
t/db_dependent/Circulation/CalcFine.t
t/db_dependent/Koha/Item.t
t/db_dependent/Koha/Biblio.t
t/db_dependent/Koha/Patron.t
t/db_dependent/XSLT.t
t/db_dependent/Search.t
t/db_dependent/Holds.t
t/db_dependent/Circulation/transferbook.t
t/db_dependent/Circulation.t

4. Go to Administration -> system preferences. Find the UseRecalls system preference. It should be DISABLED. Confirm RecallsMaxPickUpDelay is set to 7 by default.
5. Go to Administration -> circulation rules. Confirm there are no recalls circulation rules showing.
6. Test a few circulation flows: checking out, placing a reserve, checking in, fulfilling a reserve, etc. Confirm everything works as normal.

7. Go to Administration -> system preferences. Enable the UseRecalls system preference.
8. Go to Administration -> circulation rules. Set the following rules:
Recalls allowed (count) = 0
Recalls per record (count) = 0
On shelf recalls allowed ( If any unavailable / If all unavailable ) = If any unavailable
Recall due date interval (days) = 3
Recall overdue fine amount = (something different to your normal fine amount)
Recall pickup period (days) = 1

Throughout your testing, try with different combinations of these rules and itemtype / branchcode / categorycode. Also try with null values. Keep the circulation rules open in another tab so you can refer to and update these easily. You should also have at least one other tab open for the staff client, and a third tab open for the OPAC, for ease of testing.

9. Go to your account -> More -> Set permissions. Confirm the recalls permission is checked.
10. Set up a test user with OPAC login details (Borrower A). This could also be your own user, as long as you have OPAC login access.
11. Set up a test record (Biblio A) with at least two items (Item A and Item B) of the same item type (or an item type with the same recall circ rules).

PLACING A RECALL

12. Log in to the OPAC as Borrower A. Do a catalogue search with a term that will return multiple results, including Biblio A.
13. Click on Biblio A.
14. Notice there is a 'Place recall' button on the sidebar menu. Click this button. There will be a message saying that there are no items to recall - this is because all items are available.

15. Check out Item A to another borrower (Borrower B).
16. Refresh the 'Place recall' page. You will still NOT be able to place a recall - this is because Recalls allowed = 0 and Recalls per record = 0.

17. Edit the circulation rules to have the following values:
Recalls allowed (count) = 1
Recalls per record (count) = 1
18. Refresh the 'Place recall' page. You will now see the form to place a recall.

BIBLIO-LEVEL RECALL, NO TRANSFER

19. Place a biblio-level recall.
Pickup location: Branch A, the set branch when you are logged into the staff client
Recall not needed after (expiration date): whatever you want
Select 'recall next available item'
Click confirm
20. Confirm the recall is placed successfully. Confirm that the new due date displayed is correctly calculated to be today's date, plus 3 days (taken from the 'recall due date interval' circ rule)
21. In the staff client, look at Borrower B's account, and go to their Notices tab. Confirm they have received a 'Notification to return recalled item' notice.
22. Look at Borrower B's checkouts table. Notice the due date for their checkout has been adjusted, and there is now a note to say that the item was recalled and the due date adjusted.
23. Log in to the OPAC as Borrower B and go to your summary tab. Notice there is a note under their checkout to say the item had been recalled.

24. Log out of the OPAC and log back in as Borrower A.
25. Go to your summary tab. Confirm there is a Recalls tab with a count of 1.
26. Cancel the recall using the button. Confirm it cancels and the Recalls tab disappears.

27. Do a catalogue search with a term that will return multiple results, including Biblio A.
28. When the results load, notice there is a 'Place recall' button next to the 'Place hold' button. Click this 'Place recall' button.
29. Notice you are redirected straight to the form to place a recall.
30. Place a biblio-level recall again, following the steps in Step 19.

31. Go to your recalls history tab. Notice your first cancelled recall shows here.
32. Cancel the recall you just created, using the button. Confirm it cancels and you are redirected to your summary tab.

33. In the staff client, enable the UseCourseReserves system preference.
34. Go to the main menu, click Course Reserves.
35. Add a new course. (You may also have to define an authorised value for DEPARTMENT.)
36. Add Item A as a reserve to this course.

37. View Course Reserves in the OPAC. Click the course you just created.
38. Notice the reserve has a Recall button underneath it's 'Checked out' status. Click this button.
39. Place a biblio-level recall again, following the steps in Step 19.

40. Click the 'Place recall' link in the breadcrumbs.
41. Notice there is a message saying that you have reached the max number of recalls on this record. This is because Recalls allowed = 1 and Recalls per record = 1.
42. Edit the circulation rules to have the following values:
Recalls allowed (count) = 10
Recalls per record (count) = 5
43. Refresh the 'Place recall' page. You will now see the form to place a recall.

44. Create another test record (Biblio B) with at least one item (Item C).
45. Find this record on the OPAC and place a biblio-level recall again, following the steps in Step 19.

46. In the staff client, go to Circulation -> Old recalls. You should be able to see your two cancelled recalls.
47. Go to Circulation -> Recalls queue. Your current recalls should show here.
48. Use the 'Select all' checkbox to select all recalls.
49. Cancel the recalls using the 'Cancel selected recalls' button.

50. Go to the OPAC and place a biblio-level recall on Biblio A again, following the steps in Step 19.

51. In the staff client, check in Item A, which should still be checked out to Borrower B.
52. A box should pop-up asking you to confirm Borrower A's recall. Click ignore.
53. Click the link to go view Biblio A's details in the catalogue.
54. Click the recalls tab. Notice Borrower A's recall is displayed, and shows it is still Requested (has not been confirmed waiting).

55. Check in Item A again. This time, confirm the recall as waiting using the "Confirm recall" button.
56. Go to Borrower A's Notices tab. Confirm there is a notice "Recalled item awaiting pickup".
57. Go to Borrower A's checkouts. Notice there is a recalls tab. Confirm the recall is showing as "Ready for pickup".
58. Click the 'Actions' dropdown. Click the "Revert waiting" button. The page should show a message that the waiting status has been reverted, without reloading.

59. This time, check in Item B. The recall confirmation box should show again, because this a biblio-level recall that any recallable item under Biblio A can fill. Click the "Print slip and confirm" button.
60. Check the slip that is generated. Confirm it contains Borrower A's correct details, and the details of the recall are correct.
61. Go to Circulation -> Recalls awaiting pickup. Confirm the recall is now waiting and shows in this list.
(You could also try this with Item B having a different item type to Item A, and circ rules not allowing Item B's item type to have recalls. When checking in Item A, it should not trigger the recall box).

62. Go to Borrower A's checkouts. Check out Item B.
63. Confirm the checkout is successful and the recall is removed from the Recalls tab.
64. Go to Circulation -> Old recalls. The fulfilled recall should show.

65. Check in Item B.

BIBLIO-LEVEL RECALL, TRANSFER REQUIRED

66. Check out Item A to Borrower B.
67. Log in to the OPAC as Borrower A.
68. Find Biblio A and place a biblio-level recall.
Pickup location: Branch B, a different branch from your logged in branch. This recall will require a transfer.
Recall not needed after (expiration date): whatever you want
Select 'recall next available item'
Click confirm

69. In the staff client, check in Item A at Branch A. Notice the box that pops up shows that a transfer is required.
70. Click "confirm recall and transfer" and confirm the transfer.
71. Go to your account and click the Recalls tab.
72. Confirm the recall status now shows the item is in transit to Branch B.
73. In the drop-down top-right of your window, select 'Set library'.
74. Set your library to Branch B.

75. Go to Circulation -> Transfers to receive. Notice that the recall is showing here.
76. Click 'Cancel transfer'.
77. Go to Circulation -> Recalls queue
78. Confirm the recall status has been reverted to Requested.

79. Set your library back to Branch A.
80. Check in Item A and trigger the transfer.
81. Set your library back to Branch B.

82. Check in Item A at Branch B.
83. When the 'Recall found' box pops up, click Ignore.
84. Go to Circulation -> Recalls to pull. The recall should show here, with a button to "Cancel recall and return to: Branch A"
85. Click the button to cancel the recall.

86. Repeat Steps 66-70.
87. Check in Item A at Branch B. Confirm the recall as waiting.
88. Check out Item A to Borrower A to fulfill the recall.

89. Set your library back to Branch A and check in Item A.

ITEM-LEVEL RECALL, NO TRANSFER

90. Go to Administration -> circulation rules. Set the following rules:
On shelf recalls allowed ( If any unavailable / If all unavailable ) = If all unavailable

91. Check out Item A to Borrower B.
92. Log in to the OPAC as Borrower A and go to Biblio A.
93. Click the 'Place recall' button. Confirm there is a message that there are no items to recall. This is because On shelf recalls allowed = If all unavailable, and there is still one item (Item B) available.
94. In the staff client, edit Item B to have a withdrawn, item lost or not for loan status.
95. Refresh the 'Place recall' page. Confirm you can now see the form to place a recall.

96. Place an item-level recall.
Pickup location: Branch A.
Recall not needed after (expiration date): whatever you want
Select 'recall a specific item'
Item B will not be selectable, and Item A should be selected by default.
Click confirm

97. In the staff client, edit Item B and remove the lost or missing status.
98. Check in Item B. Confirm the recall box does not pop up, because it cannot fill the item-level recall.
99. Check in Item A. Confirm the recall as waiting.
100. Go to Circulation -> Recalls awaiting pickup
101. Expire the recall. Confirm it expires as expected.

ITEM-LEVEL RECALL, TRANSFER REQUIRED

102. Repeat steps 91 to 95.
103. Place an item-level recall.
Pickup location: Branch B, we will require a transfer.
Recall not needed after (expiration date): whatever you want
Select 'recall a specific item'
Item B will not be selectable, and Item A should be selected by default.
Click confirm
104. In the staff client, check in Item A. Confirm the recall and trigger the transfer.
105. Set your library to Branch B and check in Item A.
106. Confirm the recall as waiting.
107. Check out Item A to Borrower A and fulfill the recall.

108. Set your library back to Branch A and check in Item A.

CRONJOBS: EXPIRING RECALL

109. Check out Item A to Borrower B.
110. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A.
111. In your terminal, enter mysql and edit the expiration date of your recall to be before today
UPDATE recalls SET expirationdate = NOW()-2 WHERE recall_id = X;
112. Run the expiry cronjob from within your shell
perl misc/cronjobs/recalls/expire_recalls.pl
113. Go to Borrower A's account and go to the Recalls history tab
114. Confirm the recall has been expired because the current date surpassed the specified expiration date

115. Check out Item A to Borrower B.
116. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A.
117. In the staff client, check in Item A and confirm the recall as waiting.
118. In your terminal, enter mysql and edit the waiting date of your recall to be before today
UPDATE recalls SET waitingdate = NOW() - interval 5 day WHERE recall_id = X;
119. Run the expiry cronjob from within your shell
perl misc/cronjobs/recalls/expire_recalls.pl
120. Go to Borrower A's account and go to the Recalls history tab
121. Confirm the recall has been expired because the recall had been waiting for more days than the Recall pickup period

122. Go to Administration -> circulation rules. Set the following rules:
Recall pickup period (days) = 0
123. Set the RecallsMaxPickUpDelay system preference = 1.
124. Check out Item A to Borrower B.
125. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A.
126. In the staff client, check in Item A and confirm the recall as waiting.
127. In your terminal, enter mysql and edit the waiting date of your recall to be before today
UPDATE recalls SET waitingdate = NOW()-2 WHERE recall_id = X;
128. Run the expiry cronjob from within your shell
perl misc/cronjobs/recalls/expire_recalls.pl
129. Go to Borrower A's account and go to the Recalls history tab
130. Confirm the recall has been expired because the recall had been waiting for more days than the RecallsMaxPickUpDelay syspref

CRONJOBS: OVERDUE RECALL

131. Check out Item A to Borrower B
132. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A.
133. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today
UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X;
134. Run the overdue cronjob from within your shell
perl misc/cronjobs/recall/overdue_recalls.pl
135. Go to Circulation -> Overdue recalls
136. Confirm your recall is showing here now as the recall has been marked Overdue

CIRCULATION

137. Check in Item A.
138. When the recall box pops up, click Ignore.
139. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that another borrower has recalled the item you are trying to check out.
140. Click "No don't check out" and confirm the item isn't checked out and the recall remains.
141. Repeat Step 139.
142. Click "Yes check out" and confirm the item is checked out and the recall remains.
143. When Borrower B's checkout table loads, confirm that you cannot renew or check in the item from the Checkouts table because there is a 'Recalled' link which takes you to the recalls tab for that biblio.
144. Repeat Steps 137-139.
145. Select "Cancel recall" and click "Yes check out" and confirm the item is checked out and the recall has been cancelled.
146. Log in to the OPAC as Borrower A. Place a recall (any level) on Biblio A.
147. Check in Item A. Confirm the recall as waiting.
148. Check out Item A to Borrower B. You should see a yellow confirmation box, saying that that another borrower has recalled the item that you are trying to check out.
149. Select "Revert waiting status" and click "Yes check out" and confirm the item is checked out and the recall status has reverted to requested.

OTHER
150. In your terminal, enter mysql and edit the due date of the checkout to Borrower B to be before today
UPDATE issues SET date_due = NOW()-2 WHERE issue_id = X;
151. Go to Borrower A's recalls and click the Actions dropdown.
152. Click "Mark as overdue" and confirm the recall is marked as overdue manually.

153. Go to Tools -> Log Viewer. Check only the Recalls module, and leave all other parameters, and click Submit.
154. Confirm all of the recalls actions that have been made are correctly logged.

Note: recalls messaging preferences are introduced in Bug 23781.
The recall feature is fully documented at: https://wiki.koha-community.org/wiki/Catalyst_IT_Recalls

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-03-14 22:45:51 -10:00

1119 lines
71 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Context %]
[% USE Koha %]
[% USE Branches %]
[% USE KohaDates %]
[% USE Categories %]
[% USE TablesSettings %]
[% USE ItemTypes %]
[% USE Price %]
[% USE AuthorisedValues %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
[% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
[% SET destination = "circ" %]
<title>
[% IF patron %]
Checking out to [% INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %] &rsaquo; [% END %]
Circulation &rsaquo; Koha
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="circ_circulation" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
<ol>
<li>
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
</li>
<li>
<a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
</li>
[% IF patron %]
<li>
<a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a>
</li>
<li>
<a href="#" aria-current="page">
[% INCLUDE 'patron-title.inc' %]
</a>
</li>
[% ELSE %]
<li>
<a href="#" aria-current="page">
Checkouts
</a>
</li>
[% END %]
</ol>
</nav>
<div class="main container-fluid">
<main>
<div class="row">
<div class="col-sm-10 col-sm-push-2">
[% IF patron %]
[% INCLUDE 'members-toolbar.inc' %]
[% END %]
<!-- INITIAL BLOC : PARAMETERS & BORROWER INFO -->
[% IF ( was_renewed ) %]
<div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>
[% END %]
[% IF autoswitched %]
<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>
[% END %]
[% IF ADDITIONAL_MATERIALS && !NEEDSCONFIRMATION %]
<div id="materials" class="dialog message">Note about the accompanying materials: [% ADDITIONAL_MATERIALS | html %]
</div>
[% END %]
[% IF ( alert.ITEM_LOST ) %]
<div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST | html %]".</div>
[% END %]
[% IF ( alert.OTHER_CHARGES ) %]
<div class="dialog message">The patron has unpaid charges for holds, rentals etc of [% alert.OTHER_CHARGES | $Price %]</div>
[% END %]
[% IF alert.HIGHHOLDS %]
<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>
[% END %]
[% IF alert.RETURNED_FROM_ANOTHER %]
<div class="dialog alert">Item was checked out to [% INCLUDE 'patron-title.inc' patron = alert.RETURNED_FROM_ANOTHER.patron %] and was returned automatically.</div>
[% END %]
[% IF ( nopermission ) %]
<div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
[% END %]
[% IF ( NEEDSCONFIRMATION ) %]
<div id="circ_needsconfirmation" class="dialog alert audio-alert-action focus" tabindex="-1">
[% IF CAN_user_circulate_force_checkout or ADDITIONAL_MATERIALS %]
<h3>Please confirm checkout</h3>
[% ELSE %]
<h3>Cannot check out</h3>
[% END %]
<ul>
[%IF ( AGE_RESTRICTION ) %]
<li>
Age restriction [% AGE_RESTRICTION | html %].
[% IF CAN_user_circulate_force_checkout %]
Check out anyway?
[% END %]
</li>
[% END %]
[% IF ( DEBT ) %]
<li>The patron has a debt of [% DEBT | $Price %].</li>
[% END %]
[% IF ( DEBT_GUARANTEES ) %]
<li>The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES | $Price %].</li>
[% END %]
[% IF ( DEBT_GUARANTORS ) %]
<li>The patron's guarantors and their other guarantees collectively have a debt of [% DEBT_GUARANTORS | $Price %].</li>
[% END %]
[% IF ( RENTALCHARGE && RENTALCHARGE > 0 ) %]
<li>Rental charge for this item: [% RENTALCHARGE | $Price %]</li>
[% END %]
[% IF ( RENEW_ISSUE ) %]
<li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is currently checked out to this patron. Renew?</li>
[% END %]
[% IF ( RESERVE_WAITING ) %]
<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>
[% END %]
[% IF ( TRANSFERRED ) %]
<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>
[% END %]
[% IF ( PROCESSING ) %]
<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>
[% END %]
[% IF ( RESERVED ) %]
<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>
[% END %]
[% IF ( ISSUED_TO_ANOTHER ) %]
<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 %]).
[% IF CAN_user_circulate_force_checkout %]
Check in and check out?
[% END %]
</li>
[% END %]
[% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
<li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
[% END %]
[% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
<li>Too many on-site checked out. [% current_loan_count | html %] on-site checked out, only [% max_loans_allowed | html %] are allowed.</li>
[% END %]
[% IF ( BORRNOTSAMEBRANCH ) %]
<li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) | html %])</li>
[% END %]
[% IF ( PATRON_CANT ) %]
<li>This patron can't check out this item per library circulation policy.</li>
[% END %]
[% IF ( TOO_MANY and TOO_MANY == 'NO_RULE_DEFINED' ) %]
<li>No circulation rule is defined for this patron and itemtype combination.</li>
[% END %]
[% IF ( NOT_FOR_LOAN_FORCING ) %]
<li>
[% IF ( itemtype_notforloan ) %]
Item type is normally not for loan.
[% ELSIF ( item_notforloan ) %]
[% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
Item is normally not for loan[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
[% END %]
[% IF CAN_user_circulate_force_checkout %]
Check out anyway?
[% END %]
</li>
[% END %]
[% IF ( USERBLOCKEDOVERDUE ) %]
<li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).
[% IF CAN_user_circulate_force_checkout %]
Check out anyway?
[% END %]
</li>
[% END %]
[% IF ( ITEM_LOST ) %]
<li>This item has been lost with a status of "[% ITEM_LOST | html %]".
[% IF CAN_user_circulate_force_checkout %]
Check out anyway?
[% END %]
</li>
[% END %]
[% IF HIGHHOLDS %]
<li>High demand item. Loan period shortened to [% HIGHHOLDS.duration | html %] days (due [% HIGHHOLDS.returndate | $KohaDates %]). Check out anyway?</li>
[% END %]
[% IF PREVISSUE %]
<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>
[% END %]
[% IF BIBLIO_ALREADY_ISSUED %]
<li>
Patron has already checked out another item from this record.
[% IF CAN_user_circulate_force_checkout %]
Check out anyway?
[% END %]
</li>
[% END %]
[% IF ADDITIONAL_MATERIALS %]
<li>
Please confirm that the accompanying materials are present: [% ADDITIONAL_MATERIALS | html %]
</li>
[% END %]
[% IF RECALLED %]
[% IF RECALLED.waiting %]
<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.borrowernumber | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.branchcode ) | html %] since [% RECALLED.waitingdate | $KohaDates %]</li>
[% ELSIF RECALLED.requested or RECALLED.overdue %]
<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.borrowernumber | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.branchcode ) | html %] since [% RECALLED.recalldate | $KohaDates %]</li>
[% END %]
[% END %]
</ul>
[% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
<input type="hidden" name="restoreduedatespec" />
[% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
[% IF HIGHHOLDS %]
<p class="circ-override-high-holds">
<input type="checkbox" name="override_high_holds_tmp" id="override_high_holds_tmp" value="1" />
<label for="override_high_holds_tmp">Don't decrease loan length based on holds</label>
</p>
[% END %]
[% IF ( RESERVED ) %]
<p>
<input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
<label for="cancelreserve">Cancel hold</label>
</p>
[% END %]
[% IF ( RESERVE_WAITING ) %]
<p>
<label for="cancelreserve">Cancel hold</label>
<input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
<label for="revertreserve">Revert waiting status</label>
<input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
</p>
[% END %]
[% IF ( TRANSFERRED ) %]
<p>
<label for="cancelreserve">Cancel hold</label>
<input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
<label for="revertreserve">Revert hold transfer status</label>
<input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
</p>
[% END %]
[% IF ( PROCESSING ) %]
<p>
<label for="cancelreserve">Cancel hold</label>
<input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
<label for="revertreserve">Revert In Processing status</label>
<input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
</p>
[% END %]
[% IF ( RECALLED ) %]
<p>
<label for="cancelrecall">Cancel recall</label>
<input type="radio" value="cancel" name="cancel_recall" id="cancelrecall" />
<input type="hidden" value="[% RECALLED.recall_id | html %]" name="recall_id" />
</p>
[% IF RECALLED.waiting %]
<p>
<label for="revertrecall">Revert waiting status</label>
<input type="radio" value="revert" name="cancel_recall" id="revertrecall" checked="checked"/>
<input type="hidden" value="[% RECALLED.recall_id | html %]" name="recall_id" />
</p>
[% END %]
[% END %]
<input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="hidden" name="issueconfirmed" value="1" />
<input type="hidden" name="override_high_holds" value="[% override_high_holds | html %]"/>
[% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
[% IF ( INVALID_DATE ) %]
<p>
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
<label for="duedatespec">Due date</label>
</p>
[% ELSE %]
<input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
[% END %]
<input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
<input type="hidden" name="branch" value="[% branch | html %]" />
[% IF ( RENEW_ISSUE ) %]
<button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
[% ELSE %]
<button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
[% END %]
<input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
<input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
</form>
[% END # /IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
[% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED or PROCESSING ) %]
<form method="get" action="/cgi-bin/koha/circ/circulation.pl">
<input type="hidden" name="restoreduedatespec" />
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
<input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
<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>
</form>
[% END %]
[% IF ( RECALLED ) %]
<form method="get" action="/cgi-bin/koha/circ/circulation.pl">
<button class="print" type="submit" onclick="Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% RECALLED.recall_id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
</form>
[% END %]
<form method="get" action="/cgi-bin/koha/circ/circulation.pl">
[% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
<input type="hidden" name="restoreduedatespec" />
<input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
[% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
[% IF ( RENEW_ISSUE ) %]
<button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
[% ELSE %]
<button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't check out (N)</button>
[% END %]
[% ELSE %]
<button type="submit" class="deny"><i class="fa fa-times"></i> Continue</button>
[% END %]
</form>
[% IF ( RESERVED || ISSUED_TO_ANOTHER || RECALLED ) && (CAN_user_reserveforothers_place_holds ) %]
[% UNLESS noissues %]
<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>
[% END %]
[% END %]
</div> <!-- /#circ_needsconfirmation -->
[% END # /NEEDSCONFIRMATION %]
[% IF ( IMPOSSIBLE ) %]
<div id="circ_impossible" class="dialog alert audio-alert-warning focus" tabindex="-1">
[% IF ( UNKNOWN_BARCODE ) %]
<h3>Barcode not found</h3>
[% END %]
<!-- RESULT OF ISSUING REQUEST -->
<ul>
[% IF ( DEBT_GUARANTORS ) %]
<li>The patron's guarantors and their other guarantees collectively have a debt of [% DEBT_GUARANTORS | $Price %].</li>
[% END %]
[% IF ( STATS ) %]
<li>Local use recorded</li>
[% END %]
[% IF ( INVALID_DATE ) %]
<li>The due date &quot;[% INVALID_DATE | html %]&quot; is invalid</li>
[% END %]
[% IF ( UNKNOWN_BARCODE ) %]
<li>The barcode was not found: <span class="ex">[% barcode | html %]</span>
<div>
[% IF ( FALLBACK ) %]
[% IF options %]
<button type="button" class="approve" data-toggle="modal" data-target="#itemSearchFallback"><i class="fa fa-search"></i> Show matching titles</button>
[% ELSE %]
<div>No items were found by searching.</div>
[% END %]
[% END %]
[% IF ( fast_cataloging ) %]
[% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
<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>
[% END %]
[% END %]
</div>
</li>
[% END %]
[% IF ( NOT_FOR_LOAN ) %]
<li>
[% IF ( itemtype_notforloan ) %]
Item type not for loan.
[% ELSIF ( item_notforloan ) %]
[% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
Item not for loan[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
[% END %]
</li>
[% END %]
[% IF ( WTHDRAWN ) %]
<li>
<span>Item has been withdrawn</span>
[% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
[% IF (item_withdrawn_lib) %]<span class="co-withdrawn">([% item_withdrawn_lib | html %])</span>[% END %]
</li>
[% END %]
[% IF ( RESTRICTED ) %]
<li>Item is restricted</li>
[% END %]
[% IF ( GNA ) %]
<li>Patron's address is in doubt</li>
[% END %]
[% IF ( CARD_LOST ) %]
<li>Patron's card is lost</li>
[% END %]
[% IF ( DEBARRED ) %]
<li>Patron is restricted</li>
[% END %]
[% IF ( NO_MORE_RENEWALS ) %]
<li>No more renewals possible</li>
[% END %]
[% IF NO_RENEWAL_FOR_ONSITE_CHECKOUTS %]
<li>This item can not be renewed, it's an on-site checkout</li>
[% END %]
[%IF ( AGE_RESTRICTION ) %]
<li>Age restriction [% AGE_RESTRICTION | html %].</li>
[% END %]
[% IF ( EXPIRED ) %]
<li>Patron's card is expired</li>
[% END %]
[% IF ( TOO_MANY ) %]
<li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
[% END %]
[% IF ( ITEMNOTSAMEBRANCH ) %]
<li>This item belongs to [% Branches.GetName( itemhomebranch ) | html %] and cannot be checked out from this location.</li>
[% END %]
[% IF RETURN_IMPOSSIBLE %]
<li>This item must be returned to [% Branches.GetName( branch_to_return ) | html %].</li>
[% END %]
[% IF ( USERBLOCKEDWITHENDDATE ) %]
<li>Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].</li>
[% END %]
[% IF ( USERBLOCKEDNOENDDATE ) %]
<li>Patron has an indefinite restriction.</li>
[% END %]
[% IF ( USERBLOCKEDOVERDUE ) %]
<li>Checkouts are BLOCKED because patron has overdue items.</li>
[% END %]
[% IF ( RECALLED_INTRANSIT ) %]
<li>Item has been recalled and is in transit for pickup at [% Branches.GetName( RECALLED_INTRANSIT ) | html %].</li>
[% END %]
</ul>
[% IF (forceallow) %]
<li>Restriction overridden temporarily.</li>
[% END %]
</ul>
</div> <!-- /#circ_impossible -->
[% IF ( FALLBACK ) %]
[% IF options %]
<!-- Modal -->
<div class="modal" id="itemSearchFallback" tabindex="-1" role="dialog" aria-labelledby="itemSearchFallbackLabel">
<div class="modal-dialog modal-wide" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h3 id="itemSearchFallbackLabel"><h3>Barcode not found. The following items were found by searching:</h3>
</div>
<div class="modal-body">
<table class="table_borrowers">
<thead>
<tr>
<th>Title</th>
<th>Barcode</th>
<th>Call number</th>
<th>Copy number</th>
<th>Inventory number</th>
<th>Serial enumeration</th>
<th>Collection</th>
[% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
[% FOREACH item IN options %]
<tr>
<td>
<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>
</td>
<td>
[% item.barcode | html %]
</td>
<td>[% item.itemcallnumber | html %]</th>
<td>[% item.copynumber | html %]</th>
<td>[% item.stocknumber| html %]</th>
<td>[% item.enumchron| html %]</th>
<td>
[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]
</td>
[% IF ( item_level_itypes ) %]
<td>
[% ItemTypes.GetDescription( item.itype ) | html %]
</td>
[% END %]
<td>
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
[% IF (forceallow) %]
<input type="hidden" name="forceallow" value="1">
[% END %]
<input type="hidden" name="restoreduedatespec" />
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
<input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
<input type="hidden" name="branch" value="[% branch | html %]" />
<input type="hidden" name="barcode" value="[% item.barcode | html %]" />
<input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
<input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
<button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
</form>
</td>
</tr>
[% END %]
</tbody>
</table>
</div> <!-- /.modal-body -->
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog.modal-wide -->
</div> <!-- /#itemSearchFallback -->
[% END # /IF options %]
[% END # /IF FALLBACK %]
[% ELSE # IF IMPOSSIBLE %]
[% IF (forceallow) %]
<div id="overridden_debarment" class="dialog alert">Restriction overridden temporarily</div>
[% END %]
[% END # /IF IMPOSSIBLE %]
<span class="audio-alert-success"></span>
[% IF ( issued ) %]
<p>Item checked out</p>
[% END %]
[% IF ( message ) %]
[% INCLUDE 'patron-toolbar.inc' %]
<h4>No patron matched <span class="ex">[% message | html %]</span></h4>
[% END %]
<!-- BARCODE ENTRY -->
[% IF patron %]
[% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
<div class="dialog alert">
<strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
</div>
[% END %]
<div class="row">
[% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
<div class="col-sm-6">
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
<input type="hidden" name="restoreduedatespec" />
[% IF ( issue ) %]
<fieldset id="circ_circulation_issue" class="lastchecked">
[% ELSE %]
<fieldset id="circ_circulation_issue">
[% END %]
[% IF ( DisplayClearScreenButton ) %]
<span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
<span id="printclearscreen"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
[% END %]
[% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
<label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
[% IF Koha.Preference('itemBarcodeFallbackSearch') %]
<div class="hint">Enter item barcode or keyword:</div>
[% ELSE %]
<div class="hint">Enter item barcode:</div>
[% END %]
[% IF NEEDSCONFIRMATION %]
<input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
[% ELSE %]
<input type="text" name="barcode" id="barcode" class="barcode focus" size="14" />
[% END %]
<button type="submit" class="btn btn-default">Check out</button>
<div id="show-circ-settings">
<a href="#"><i class="fa fa-caret-right circ-settings-icon"></i> Checkout settings</a>
</div>
<div class="circ-settings">
[% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
[% IF ( SpecifyDueDate ) %]
<div id="specify-due-date" class="circ-setting">
<div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
[% IF ( duedatespec ) %]
<input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | $KohaDates with_hours => 1 %]" />
[% ELSE %]
<input type="text" size="20" id="duedatespec" name="duedatespec" value="" />
[% END %]
<label for="stickyduedate"> Remember for session:</label>
[% IF ( stickyduedate ) %]
<input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
[% ELSE %]
<input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
[% END %]
</div>
[% END %]
[% END %]
[% UNLESS ( noissues ) %]
<div id="set-automatic-renewal" class="circ-setting">
[% IF NEEDSCONFIRMATION %]
[% IF auto_renew %]
[% IF patron.autorenew_checkouts %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
title="Patron has opted out of auto-renewal"/>
[% ELSE %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
[% END %]
[% ELSE %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
[% END %]
[% ELSE %]
[% IF ( auto_renew && patron.autorenew_checkouts ) %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
[% ELSIF patron.autorenew_checkouts %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
[% ELSE %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
title="Patron has opted out of auto-renewal"/>
[% END %]
[% END %]
<label for="auto_renew">Automatic renewal</label>
</div>
[% IF Koha.Preference('decreaseLoanHighHolds') %]
<div id="set_high_holds_overrride" class="circ-setting">
[% IF NEEDSCONFIRMATION %]
[% IF override_high_holds %]
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
[% ELSE %]
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
[% END %]
[% ELSE %]
[% IF override_high_holds %]
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
[% ELSE %]
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
[% END %]
[% END %]
<label for="override_high_holds">Don't decrease checkout length based on holds</label>
</div>
[% END %]
[% END %]
[% IF Koha.Preference('OnSiteCheckouts') %]
<div id="onsite_checkout-select" class="circ-setting">
[% IF noissues %]
<div class="onsite-checkout-only">
<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>
<input type="text" name="duedatespec" id="duedatespec" />
<input type="hidden" name="onsite_checkout" checked="checked" value="1" />
</div>
[% ELSE %]
[% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
<input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
[% ELSE %]
<input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
[% END %]
[% END %]
</div>
[% END %]
</div> <!-- /.circ-settings -->
<input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="hidden" name="branch" value="[% branch | html %]" />
<input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
[% IF ( CHARGES ) %]
<input type="hidden" name="charges" value="yes" />
[% END %]
</fieldset> <!-- /#circ_circulation_issue -->
[% IF ( issue ) %]
<div class="lastchecked">
<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>
</div>
[% END %]
</form> <!-- /#mainform -->
</div> <!-- /.col-sm-6 -->
[% END #/IF !noissues %]
[% IF ( noissues ) %]
[% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
<div class="col-sm-6">
[% ELSE %]
<div>
[% END %]
[% ELSE %]
<div class="col-sm-6">
[% END %]
[% IF ( noissues ) %]
[% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
<div id="circmessages" class="circmessage attention">
[% ELSE %]
<h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
<div id="circmessages" class="circmessage warning">
[% END %]
<h3>
Cannot check out!
[% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
<span class="circ-hlt">Only on-site checkouts are allowed</span>
[% END %]
</h3>
[% ELSE %]
<div id="circmessages" class="circmessage attention">
[% END %]
[% INCLUDE 'patron_messages.inc' %]
</div> <!-- /#circmessages -->
</div> <!-- /div or div.col-sm-6 -->
</div> <!-- /.row -->
<div id="patronlists" class="toptabs">
<ul>
<li>
[% IF ( issuecount ) %]
<a href="#checkouts">[% issuecount | html %] Checkout(s)</a>
[% ELSE %]
<a href="#checkouts">0 Checkouts</a>
[% END %]
</li>
[% IF relatives_issues_count %]
<li><a id="relatives-issues-tab" href="#relatives-issues">[% relatives_issues_count | html %] Relatives' checkouts</a></li>
[% END %]
<li>
[% IF ( holds_count ) %]
<a href="#reserves" id="holds-tab">[% holds_count | html %] Hold(s)</a>
[% ELSE %]
<a href="#reserves" id="holds-tab">0 Holds</a>
[% END %]
</li>
[% IF Koha.Preference('UseRecalls') %]
<li>
<a href="#recalls" id="recalls-tab">
[% recalls.count | html %] Recalls
</a>
</li>
[% END %]
[% IF Koha.Preference('ArticleRequests') %]
[% SET current_article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current' ) %]
<li>
<a href="#article-requests" id="article-requests-tab"> [% current_article_requests.count | html %] Article requests</a>
</li>
[% END %]
[% IF Koha.Preference('ClaimReturnedLostValue') %]
<li>
[% IF ( patron.return_claims.count ) %]
<a href="#return-claims" id="return-claims-tab">
Claim(s)
[% IF patron.return_claims.resolved.count == 0 %]
<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
[% ELSE %]
<span title="Resolved claims" class="label label-success" id="return-claims-count-resolved">[% patron.return_claims.resolved.count | html %]</span>
[% END %]
[% IF patron.return_claims.unresolved.count == 0 %]
<span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
[% ELSE %]
<span title="Unresolved claims" class="label label-warning" id="return-claims-count-unresolved">[% patron.return_claims.unresolved.count | html %]</span>
[% END %]
</a>
[% ELSE %]
<a href="#return-claims" id="return-claims-tab">
Claim(s)
<span title="Resolved claims" class="label label-default" id="return-claims-count-resolved">0</span>
<span title="Unresolved claims" class="label label-default" id="return-claims-count-unresolved">0</span>
</a>
[% END %]
</li>
[% END %]
<li><a id="debarments-tab-link" href="#reldebarments">[% debarments.count | html %] Restrictions</a></li>
[% SET enrollments = patron.get_club_enrollments %]
[% SET enrollable = patron.get_enrollable_clubs(0) %] <!-- 0 => not OPAC -->
[% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
<li>
<a id="clubs-tab-link" href="#clubs-tab">
Clubs ([% enrollments.count | html %]/[% enrollable.count | html %])
</a>
</li>
[% END %]
</ul>
<!-- SUMMARY : TODAY & PREVIOUS ISSUES -->
[% INCLUDE "checkouts-table.inc" %]
[% INCLUDE "relatives-issues-table.inc" %]
[% IF CAN_user_clubs && ( enrollable.count || enrollments.count ) %]
<div id="clubs-tab">
Loading...
</div> <!-- /#clubs-tab -->
[% END %]
[% INCLUDE borrower_debarments.inc %]
<div id="reserves">
[% IF ( holds_count ) %]
<form action="/cgi-bin/koha/reserve/modrequest.pl" method="post">
<input type="hidden" name="from" value="circ" />
<table id="holds-table" style="width: 100% !Important;">
<thead>
<tr>
<th>Hold date</th>
<th>Title</th>
<th>Call number</th>
<th>Item type</th>
<th>Barcode</th>
<th>Pickup at</th>
<th>Expiration</th>
<th>Priority</th>
<th>Cancel?</th>
<th>Suspend?</th>
<th>Status</th>
</tr>
</thead>
</table>
<fieldset class="action">
<input type="submit" class="cancel" name="submit" value="Cancel marked holds" />
[% SET hold_cancellation = AuthorisedValues.GetAuthValueDropbox('HOLD_CANCELLATION') %]
[% IF hold_cancellation %]
<select name="cancellation-reason">
<option value="">No reason given</option>
[% FOREACH reason IN hold_cancellation %]
<option value="[% reason.authorised_value | html %]">[% reason.lib | html %]</option>
[% END %]
</select>
[% END %]
</fieldset>
</form>
[% IF Koha.Preference('SuspendHoldsIntranet') %]
<fieldset class="action">
<form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
<input type="hidden" name="from" value="circ" />
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="submit" value="Suspend all holds" />
[% IF Koha.Preference('AutoResumeSuspendedHolds') %]
<label for="suspend_until">until</label>
<input type="text" size="10" id="suspend_until" name="suspend_until" class="flatpickr" data-flatpickr-futuredate="true" />
<span class="hint">Specify date on which to resume [% INCLUDE 'date-format.inc' %]: </span>
[% END %]
</form>
</fieldset>
<fieldset class="action">
<form action="/cgi-bin/koha/reserve/modrequest_suspendall.pl" method="post">
<input type="hidden" name="from" value="circ" />
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
<input type="hidden" name="suspend" value="0" />
<input type="submit" value="Resume all suspended holds" />
</form>
</fieldset>
[% END # /IF SuspendHoldsIntranet %]
[% ELSE # IF holds_count %]
<p>Patron has nothing on hold.</p>
[% END # /IF holds_count %]
</div> <!-- /#reserves -->
[% IF Koha.Preference('UseRecalls') %]
<div id="recalls">
[% INCLUDE 'recalls.inc' %]
</div>
[% END %]
[% IF Koha.Preference('ClaimReturnedLostValue') %]
[% INCLUDE 'patron-return-claims.inc' %]
[% END %]
[% IF Koha.Preference('ArticleRequests') %]
[% INCLUDE 'patron-article-requests.inc' %]
[% END %]
</div> <!-- /#patronlists -->
[% ELSIF borrowernumber # IF patron %]
<div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
[% END # /IF patron %]
</div> <!-- /.col-sm-10.col-sm-push-2 -->
[% IF Koha.Preference('CircSidebar') %]
[% IF not( borrowernumber and patron ) %]
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'circ-nav.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
[% END %]
[% END %]
[% IF borrowernumber and patron %]
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'circ-menu.inc' %]
</aside>
</div> <!-- /.col-sm-2 col-sm-pull-10 -->
[% END %]
</div> <!-- /.row -->
</main>
[% IF Koha.Preference('ClaimReturnedLostValue') %]
[% INCLUDE 'modals/resolve_return_claim.inc' %]
[% END %]
<!-- Modal -->
<div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
</div>
<div class="modal-body">
<p>You have already submitted a barcode, please wait for the checkout to process...</p>
</div>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
</div> <!-- /#barcodeSubmittedModal -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
[% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
[% INCLUDE 'timepicker.inc' %]
[% INCLUDE 'select2.inc' %]
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
[% INCLUDE 'js-date-format.inc' %]
<script>
/* Set some variable needed in circulation.js */
var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
var interface = "[% interface | html %]";
var theme = "[% theme | html %]";
var borrowernumber = "[% patron.borrowernumber | html %]";
var branchcode = "[% branch | html %]";
var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %];
var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %];
var script = "circulation";
var relatives_borrowernumbers = new Array();
[% FOREACH b IN relatives_borrowernumbers %]
relatives_borrowernumbers.push("[% b | html %]");
[% END %]
var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
</script>
[% Asset.js("js/pages/circulation.js") | $raw %]
[% Asset.js("js/checkouts.js") | $raw %]
[% IF Koha.Preference('ClaimReturnedLostValue') %]
[% Asset.js("js/resolve_claim_modal.js") | $raw %]
[% END %]
[% Asset.js("js/holds.js") | $raw %]
[% INCLUDE 'calendar.inc' %]
<script>
columns_settings_issues_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
columns_settings_borrowers_table = [% TablesSettings.GetColumns( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
[% IF borrowernumber and patron %]
if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){
Cookies.remove("holdfor", { path: '/' });
}
[% ELSE %]
Cookies.remove("holdfor", { path: '/' });
[% END %]
[% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
// On-site checkout
function toggle_onsite_checkout(){
if ( $("#onsite_checkout").prop('checked') ) {
$("#duedatespec").val("[% todaysdate | $KohaDates with_hours => 1 %]")
}
}
function Dopop(link) {
var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
}
$(document).ready(function() {
$('#mainform').on('submit',function() {
if ($("#barcode") && $("#barcode").val()) {
$('#barcode').on('keypress',function(event) {
$('#barcodeSubmittedModal').modal();
event.preventDefault(); }
);
}
});
if ( $('#clubs-tab').length ) {
$('#clubs-tab-link').on('click', function() {
$('#clubs-tab').text(_("Loading..."));
$('#clubs-tab').load('/cgi-bin/koha/clubs/patron-clubs-tab.pl?borrowernumber=[% patron.borrowernumber | html %]');
});
}
// listen submit to trigger qslip on empty checkout
$('#mainform').bind('submit',function() {
if ($('#barcode').val() == '') {
[% IF ( CircAutoPrintQuickSlip == 'clear' ) %]
window.location='/cgi-bin/koha/circ/circulation.pl';
return false;
[% ELSE %]
return printx_window( '[% CircAutoPrintQuickSlip | html %]' );
[% END %]
}
});
toggle_onsite_checkout();
$("#onsite_checkout").click(function(){
toggle_onsite_checkout();
});
[% IF HIGHHOLDS %]
[% IF !override_high_holds %]
$("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]');
if ('[% duedatespec | html %]' === '') {
$("input[name=restoreduedatespec]:hidden").val('highholds_empty');
} else {
$("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]');
}
[% END %]
$("#override_high_holds_tmp").on( 'change', function() {
if ( this.checked ) {
$("input[name=duedatespec]:hidden").val('');
}
});
[% END %]
});
</script>
[% INCLUDE 'str/members-menu.inc' %]
[% Asset.js("js/members-menu.js") | $raw %]
[% Asset.js("js/recalls.js") | $raw %]
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]