[Koha-patches] [PATCH] [SIGNED OFF] Fix for Bug 2941 Transfers cannot be canceled once initiated

Ian Walls ian.walls at bywatersolutions.com
Fri Apr 22 22:57:38 CEST 2011


From: Owen Leonard <oleonard at myacpl.org>

This patch includes the changes by Catalyst found at
http://git.catalyst.net.nz/gw?p=koha.git;a=shortlog;h=refs/heads/bug_2941
and adds a "cancel transfer" link to the transferstoreceive
script, including a redirect check to send the user back to
that report.

Signed-off-by: Ian Walls <ian.walls at bywatersolutions.com>
---
 circ/returns.pl                                    |   15 +++++++++++++++
 .../intranet-tmpl/prog/en/modules/circ/returns.tt  |    2 +-
 .../prog/en/modules/circ/transferstoreceive.tt     |    2 ++
 3 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/circ/returns.pl b/circ/returns.pl
index 5a0cc09..d7fad0c 100755
--- a/circ/returns.pl
+++ b/circ/returns.pl
@@ -3,6 +3,7 @@
 # Copyright 2000-2002 Katipo Communications
 #           2006 SAN-OP
 #           2007-2010 BibLibre, Paul POULAIN
+#           2010 Catalyst IT
 #
 # This file is part of Koha.
 #
@@ -171,6 +172,8 @@ my $barcode     = $query->param('barcode');
 my $exemptfine  = $query->param('exemptfine');
 my $dropboxmode = $query->param('dropboxmode');
 my $dotransfer  = $query->param('dotransfer');
+my $canceltransfer = $query->param('canceltransfer');
+my $dest = $query->param('dest');
 my $calendar    = C4::Calendar->new( branchcode => $userenv_branch );
 #dropbox: get last open day (today - 1)
 my $today       = C4::Dates->new();
@@ -183,6 +186,17 @@ if ($dotransfer){
     ModItemTransfer($transferitem, $userenv_branch, $tobranch); 
 }
 
+if ($canceltransfer){
+    $itemnumber=$query->param('itemnumber');
+    DeleteTransfer($itemnumber);
+    if($dest eq "ttr"){
+        print $query->redirect("/cgi-bin/koha/circ/transferstoreceive.pl");
+        exit;
+    } else {
+        $template->param( transfercancelled => 1);
+    }
+}
+
 # actually return book and prepare item table.....
 if ($barcode) {
     $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
@@ -321,6 +335,7 @@ if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) {
         WrongTransfer  => 1,
         TransferWaitingAt => $messages->{'WrongTransfer'},
         WrongTransferItem => $messages->{'WrongTransferItem'},
+        itemnumber => $itemnumber,
     );
 
     my $reserve    = $messages->{'ResFound'};
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
index a766bcc..620f770 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
@@ -80,7 +80,7 @@ function Dopop(link) {
 </div>
 [% END %]
 <!-- case of a mistake in transfer loop -->
-[% IF ( WrongTransfer ) %]<div class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% TransferWaitingAt %]</h3>
+[% IF ( WrongTransfer ) %]<div class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% TransferWaitingAt %] or <a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1">Cancel Transfer</a></h3>
 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
         <ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
             [% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
index 50d7ae3..2c84d5d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
@@ -50,6 +50,7 @@ $(document).ready(function() {
                 <th>On hold for</th>
                 <th>Home library</th>
                 <th>Call no.</th>
+                <th>&nbsp;</th>
             </tr></thead>
             <tbody>[% FOREACH reser IN branchesloo.reserv %]
                 [% IF ( reser.messcompa ) %]
@@ -79,6 +80,7 @@ $(document).ready(function() {
                     </td>
                     <td>[% reser.homebranch %]</td>
                     <td>[% reser.itemcallnumber %]</td>
+                    <td><a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% reser.itemnumber %]&amp;canceltransfer=1&amp;dest=ttr">Cancel Transfer</a></td>
                 </tr>
             [% END %]</tbody>
             </table>
-- 
1.5.6.5



More information about the Koha-patches mailing list