From 091cd69f44e871990d511917d4aa93960fea567f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 22 Apr 2011 16:57:38 -0400 Subject: [PATCH] Fix for Bug 2941 Transfers cannot be canceled once initiated 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 Signed-off-by: Chris Cormack --- 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 deletion(-) diff --git a/circ/returns.pl b/circ/returns.pl index 5a0cc09271..d7fad0cc25 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 a766bcc5c6..620f770291 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) { [% END %] -[% IF ( WrongTransfer ) %]

Please return [% title |html %] to [% TransferWaitingAt %]

+[% IF ( WrongTransfer ) %]

Please return [% title |html %] to [% TransferWaitingAt %] or Cancel Transfer

[% IF ( wborcnum ) %]
Hold for:
  • [% borsurname %], [% borfirstname %] ([% borcnum %])
  • 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 50d7ae33c3..2c84d5d056 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() { On hold for Home library Call no. +   [% FOREACH reser IN branchesloo.reserv %] [% IF ( reser.messcompa ) %] @@ -79,6 +80,7 @@ $(document).ready(function() { [% reser.homebranch %] [% reser.itemcallnumber %] + Cancel Transfer [% END %] -- 2.39.5