Bugzilla – Attachment 13534 Details for
Bug 8451
Confusing and problematic double prompt for processing transfers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8451 - Confusing and problematic double prompt for processing transfers
Bug-8451---Confusing-and-problematic-double-prompt.patch (text/plain), 5.11 KB, created by
Kyle M Hall (khall)
on 2012-11-19 18:39:37 UTC
(
hide
)
Description:
Bug 8451 - Confusing and problematic double prompt for processing transfers
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2012-11-19 18:39:37 UTC
Size:
5.11 KB
patch
obsolete
>From bb31e45c50f8130156660af508506181c60acb06 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 19 Nov 2012 13:38:37 -0500 >Subject: [PATCH] Bug 8451 - Confusing and problematic double prompt for processing transfers >Content-Type: text/plain; charset="utf-8" > >This patch will cause changing the priority of a reserve from 'in transit' >to a priority number to delete the transfer associated with it, if there >is one. >--- > C4/Reserves.pm | 17 +++++++++++++++-- > .../prog/en/modules/reserve/request.tt | 1 + > reserve/modrequest.pl | 3 ++- > reserve/request.pl | 1 + > 4 files changed, 19 insertions(+), 3 deletions(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 1dc6f72..e4db4a9 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -273,7 +273,8 @@ sub GetReservesFromBiblionumber { > expirationdate, > lowestPriority, > suspend, >- suspend_until >+ suspend_until, >+ reserve_id > FROM reserves > WHERE biblionumber = ? "; > unless ( $all_dates ) { >@@ -1056,7 +1057,7 @@ itemnumber and supplying itemnumber. > > sub ModReserve { > #subroutine to update a reserve >- my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until) = @_; >+ my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until, $reserve_id ) = @_; > return if $rank eq "W"; > return if $rank eq "n"; > my $dbh = C4::Context->dbh; >@@ -1089,6 +1090,13 @@ sub ModReserve { > > } > elsif ($rank =~ /^\d+/ and $rank > 0) { >+ my $reserve; >+ if ( $reserve_id ) { >+ my $sth = $dbh->prepare("SELECT * FROM reserves WHERE reserve_id = ?"); >+ $sth->execute( $reserve_id ); >+ $reserve = $sth->fetchrow_hashref(); >+ } >+ > my $query = " > UPDATE reserves SET priority = ? ,branchcode = ?, itemnumber = ?, found = NULL, waitingdate = NULL > WHERE biblionumber = ? >@@ -1098,6 +1106,11 @@ sub ModReserve { > $sth->execute( $rank, $branch,$itemnumber, $biblio, $borrower); > $sth->finish; > >+ ## If we are re-prioritizing a previously 'in transit' hold, we need to remove any item transfer that may have been created for it. >+ if ( $reserve->{'found'} eq 'T' ) { >+ $dbh->do("DELETE FROM branchtransfers WHERE itemnumber = ? AND tobranch = ? AND datearrived IS NULL", undef, ( $itemnumber, $reserve->{'branchcode'} ) ); >+ } >+ > if ( defined( $suspend_until ) ) { > if ( $suspend_until ) { > $suspend_until = C4::Dates->new( $suspend_until )->output("iso"); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 0ad5d23..06e3385 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -553,6 +553,7 @@ function checkMultiHold() { > [% FOREACH reserveloo IN biblioloo.reserveloop %] > [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] > <td> >+ <input type="hidden" name="reserve_id" value="[% reserveloo.reserve_id %]" /> > <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernumber %]" /> > <input type="hidden" name="biblionumber" value="[% reserveloo.biblionumber %]" /> > <select name="rank-request"> >diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl >index 03ef064..0b48a1f 100755 >--- a/reserve/modrequest.pl >+++ b/reserve/modrequest.pl >@@ -42,6 +42,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > > my @rank=$query->param('rank-request'); >+my @reserve_id = $query->param('reserve_id'); > my @biblionumber=$query->param('biblionumber'); > my @borrower=$query->param('borrowernumber'); > my @branch=$query->param('pickup'); >@@ -67,7 +68,7 @@ if ($CancelBorrowerNumber) { > else { > for (my $i=0;$i<$count;$i++){ > undef $itemnumber[$i] unless $itemnumber[$i] ne ''; >- ModReserve($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i],$itemnumber[$i],$suspend_until[$i]); #from C4::Reserves >+ ModReserve($rank[$i],$biblionumber[$i],$borrower[$i],$branch[$i],$itemnumber[$i],$suspend_until[$i],$reserve_id[$i]); #from C4::Reserves > } > } > my $from=$query->param('from'); >diff --git a/reserve/request.pl b/reserve/request.pl >index c34a614..8de4e4b 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -556,6 +556,7 @@ foreach my $biblionumber (@biblionumbers) { > $reserve{'expirationdate'} = format_date( $res->{'expirationdate'} ) > unless ( !defined($res->{'expirationdate'}) || $res->{'expirationdate'} eq '0000-00-00' ); > $reserve{'date'} = format_date( $res->{'reservedate'} ); >+ $reserve{'reserve_id'} = $res->{'reserve_id'}; > $reserve{'borrowernumber'} = $res->{'borrowernumber'}; > $reserve{'biblionumber'} = $res->{'biblionumber'}; > $reserve{'borrowernumber'} = $res->{'borrowernumber'}; >-- >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 8451
:
10865
|
13534
|
14275