Skip to content

Commit

Permalink
Fix for Bug 2941 Transfers cannot be canceled once initiated
Browse files Browse the repository at this point in the history
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@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
  • Loading branch information
oleonard authored and ranginui committed Apr 23, 2011
1 parent d04ca42 commit 091cd69
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
15 changes: 15 additions & 0 deletions circ/returns.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down Expand Up @@ -171,6 +172,8 @@ =head1 returns.pl
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();
Expand All @@ -183,6 +186,17 @@ =head1 returns.pl
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
Expand Down Expand Up @@ -321,6 +335,7 @@ =head1 returns.pl
WrongTransfer => 1,
TransferWaitingAt => $messages->{'WrongTransfer'},
WrongTransferItem => $messages->{'WrongTransferItem'},
itemnumber => $itemnumber,
);

my $reserve = $messages->{'ResFound'};
Expand Down
2 changes: 1 addition & 1 deletion koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) %]
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 091cd69

Please sign in to comment.