Bugzilla – Attachment 9289 Details for
Bug 8004
Items on hold lose transfer after being scanned twice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8004 - Items on Hold Lose Transfer After Being Scanned Twice
Bug-8004---Items-on-Hold-Lose-Transfer-After-Being.patch (text/plain), 5.37 KB, created by
Kyle M Hall
on 2012-04-24 15:55:54 UTC
(
hide
)
Description:
Bug 8004 - Items on Hold Lose Transfer After Being Scanned Twice
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2012-04-24 15:55:54 UTC
Size:
5.37 KB
patch
obsolete
>From 3dc982c9121a949b3632d701685d1776d0c7f81b Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 24 Apr 2012 11:43:40 -0400 >Subject: [PATCH] Bug 8004 - Items on Hold Lose Transfer After Being Scanned Twice > >When a hold is placed on an item where the pickup location is >different than the holding library, Koha initiates a branch >transfer for that item to fill that hold when items is run through >the returns system. > >If the item is then run through returns a second time, the system is >supposed to close that transfer as a 'wrongtransfer', and open a new >transfer with the same from and to branches as the original. > >The problem is that the original transfer is closed, but the new >transfer is not created. This is because at some point, someone >replaced the template variable WrongTransfer, which had previously >contained the branchcode for the library to transfer to, with the >full name of the library instead ( I assume to make a look nicer ). > >Solved by removing the line that was changing the variable contents >from the branchcode to the branch name, and adding a new TT filter, >KohaBranchName that functions in the same way as KohaDates, except >it takes a branchcode and returns the branch name for the given >branchcode. > >The consequence of this, is the the name of the library is passed to updateWrongTransfer instead of the branchcode, causing the failure. >--- > Koha/Template/Plugin/KohaBranchName.pm | 35 ++++++++++++++++++++ > circ/returns.pl | 1 - > .../intranet-tmpl/prog/en/modules/circ/returns.tt | 4 ++- > 3 files changed, 38 insertions(+), 2 deletions(-) > create mode 100644 Koha/Template/Plugin/KohaBranchName.pm > >diff --git a/Koha/Template/Plugin/KohaBranchName.pm b/Koha/Template/Plugin/KohaBranchName.pm >new file mode 100644 >index 0000000..a39aba0 >--- /dev/null >+++ b/Koha/Template/Plugin/KohaBranchName.pm >@@ -0,0 +1,35 @@ >+package Koha::Template::Plugin::KohaBranchName; >+ >+# Copyright Bywater Solutions 2012 >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 2 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use strict; >+use warnings; >+ >+use Template::Plugin::Filter; >+use base qw( Template::Plugin::Filter ); >+use warnings; >+use strict; >+ >+use C4::Branch qw( GetBranchName );; >+ >+sub filter { >+ my ($self,$branchcode) = @_; >+ return GetBranchName( $branchcode ); >+} >+ >+1; >diff --git a/circ/returns.pl b/circ/returns.pl >index bd60d42..38e9887 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -337,7 +337,6 @@ if ( $messages->{'Wrongbranch'} ){ > # case of wrong transfert, if the document wasn't transfered to the right library (according to branchtransfer (tobranch) BDD) > > if ( $messages->{'WrongTransfer'} and not $messages->{'WasTransfered'}) { >- $messages->{'WrongTransfer'} = GetBranchName( $messages->{'WrongTransfer'} ); > $template->param( > WrongTransfer => 1, > TransferWaitingAt => $messages->{'WrongTransfer'}, >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 cebcb09..3c255fd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -1,4 +1,6 @@ > [% USE KohaDates %] >+[% USE KohaBranchName %] >+ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Circulation › Check in [% title |html %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -87,7 +89,7 @@ function Dopop(link) { > </div> > [% END %] > <!-- case of a mistake in transfer loop --> >-[% IF ( WrongTransfer ) %]<div id="return2" class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% TransferWaitingAt %]</h3><h3><a href="#" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&&branchcode=[% homebranch %]&op=slip'); return true;">Print slip</a> or <a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&canceltransfer=1">Cancel transfer</a></h3> >+[% IF ( WrongTransfer ) %]<div id="return2" class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% TransferWaitingAt | $KohaBranchName %]</h3><h3><a href="#" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&&branchcode=[% homebranch %]&op=slip'); return true;">Print slip</a> or <a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&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> >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8004
:
9289
|
13536
|
13537
|
17911
|
20582
|
20583
|
20682