Bug 1983: Checkout: Hold repquest when checking out an item already on loan or reserved
authorMarc Véron <veron@veron.ch>
Sat, 26 Dec 2015 11:28:57 +0000 (12:28 +0100)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Wed, 27 Jan 2016 06:39:14 +0000 (06:39 +0000)
This patch allows to put a hold on an item that is already checked out or reserved.

To test:

- Check out an item A
- Put a hold on an item B
- Verify that the staff user has permission to put holds
- Check out item A to a patron X
- Try to checkout item A to a patron Y
- Verify that you see underneath the buttons for Checkin/Checkout a link
  with following text: "Click here to place hold for [Patron X' name]"
- Verify that the link is stylable (div class circ-scheckoutplacehold)
- Verify that the link takes you to the page to place a hold on this biblio
  for patron Y
- Do the same for item B and verify that it works for reserved items as well.
- Repeat steps above for a patron who has restrictions, verify that the link
  does not appear
- Log in with a staff member who has no permission to place holds
- Repeat steps above for a patron without restrictions, verify that the link
  does not appear.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index db4a653..e6ba9a2 100755 (executable)
@@ -424,11 +424,16 @@ if (@$barcodes) {
 
     if ($question->{RESERVE_WAITING} or $question->{RESERVED}){
         $template->param(
-            reserveborrowernumber => $question->{'resborrowernumber'},
-            itembiblionumber => $getmessageiteminfo->{'biblionumber'}
+            reserveborrowernumber => $question->{'resborrowernumber'}
         );
     }
 
+    $template->param(
+        itembiblionumber => $getmessageiteminfo->{'biblionumber'}
+    );
+
+
+
     $template_params->{issuecount} = $issue;
 
     if ( $iteminfo ) {
index 3c16501..6fd722c 100644 (file)
@@ -408,6 +408,11 @@ $(document).ready(function() {
     [% END %]
 </form>
 
+[% IF ( RESERVED || ISSUED_TO_ANOTHER ) && (CAN_user_reserveforothers_place_holds ) %]
+    [% UNLESS flagged && noissues %]
+        <div class="circ-checkoutplacehold"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber %]&borrowernumber=[% borrowernumber %]">Click here to place a hold for [% INCLUDE 'patron-title.inc' %]</a></div>
+    [% END %]
+[% END %]
 </div></div>
 [% END %] <!-- NEEDSCONFIRMATION -->