Bugzilla – Attachment 31581 Details for
Bug 12892
Holds Waiting: not showing from check out screen
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12892 - Holds Waiting: not showing from check out screen
0006-Bug-12892-Holds-Waiting-not-showing-from-check-out-s.patch (text/plain), 6.88 KB, created by
Olli-Antti Kivilahti
on 2014-09-14 10:29:31 UTC
(
hide
)
Description:
Bug 12892 - Holds Waiting: not showing from check out screen
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2014-09-14 10:29:31 UTC
Size:
6.88 KB
patch
obsolete
>From 5f4fb1e31d9388ae5369cf37d0d3474328bbb33a Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Sun, 14 Sep 2014 12:34:39 +0300 >Subject: [PATCH 6/6] Bug 12892 - Holds Waiting: not showing from check out > screen > >TEST PLAN: > >1. Create a reservation for a Borrower with pickup branch >2. Check-in the corresponding Item in the pickup branch and confirm the hold > for the Borrower >3. Go to circ/circulation.pl for the Borrower and verify that the reservation > is "Waiting for pickup" >4. In the Borrower -> Check Out -tab (circ/circulation.pl) on the right of the > big "Checking out to borrowername" should be a notification about holds ready > for pickup. >--- > Koha/Reserves.pm | 65 ++++++++++++++++++++ > circ/circulation.pl | 3 + > .../prog/en/modules/circ/circulation.tt | 33 +++++----- > 3 files changed, 87 insertions(+), 14 deletions(-) > >diff --git a/Koha/Reserves.pm b/Koha/Reserves.pm >index 6580a55..f317e4d 100644 >--- a/Koha/Reserves.pm >+++ b/Koha/Reserves.pm >@@ -60,6 +60,71 @@ sub GetLastpickupdate { > return $expiration; > } > >+=head2 GetWaitingReserves > >+ my $waitingReserves = GetWaitingReserves($borrowernumber); >+ >+@PARAM1 Integer from koha.borrowers.borrowernumber >+@RETURNS DBIx:: containing Reservation-objects. >+=cut >+sub GetWaitingReserves { >+ my ($borrowernumber) = @_; >+ >+ my $schema = Koha::Database->new()->schema(); >+ my $reserves_rs = $schema->resultset('Reserve')->search( >+ { -and => [ >+ borrowernumber => $borrowernumber, >+ found => 'W' >+ ] >+ }, >+ { >+ prefetch => { 'item' => 'biblio' }, >+ } >+ ); >+ >+ my $currentBranch = C4::Context->userenv->{branch}; >+ >+ my @waitingReserves; >+ while ( my $reserve = $reserves_rs->next() ) { >+ my %waitingReserveInfo; >+ >+ my $lastpickupdate = Koha::Reserves::GetLastpickupdate( $reserve ); >+ $lastpickupdate = C4::Dates->new($lastpickupdate->ymd(), 'iso')->output(); >+ >+ my $pickupBranchcode = $reserve->branchcode(); >+ my $pickupBranch; >+ if (ref $pickupBranchcode eq 'Koha::Schema::Result::Branch') { >+ $pickupBranch = $pickupBranchcode; >+ $pickupBranchcode = $pickupBranchcode->branchcode(); >+ } >+ >+ my $biblio = $reserve->biblio(); >+ if ($biblio) { #For some reason it is possible for a waiting hold to not have a biblio? >+ $waitingReserveInfo{title} = $biblio->title(); >+ $waitingReserveInfo{biblionumber} = $biblio->biblionumber(); >+ $waitingReserveInfo{author} = $biblio->author(); >+ } >+ else { >+ $waitingReserveInfo{title} = "<<ERROR, no biblio found>>"; >+ } >+ >+ $waitingReserveInfo{lastpickupdate} = $lastpickupdate; >+ >+ my $item = $reserve->item(); >+ if ($item) { >+ $waitingReserveInfo{itemcallnumber} = $reserve->item()->itemcallnumber(); >+ } >+ else { >+ $waitingReserveInfo{itemcallnumber} = "<<ERROR, no item found>>"; >+ } >+ >+ #$waitingReserveInfo{itemcallnumber} = $reserve->item()->itemcallnumber(); >+ $waitingReserveInfo{waitinghere} = 1 if $pickupBranchcode eq $currentBranch; >+ $waitingReserveInfo{waitingat} = $pickupBranch->branchname(); >+ >+ push @waitingReserves, \%waitingReserveInfo; >+ } >+ return \@waitingReserves; >+} > > return 1; >\ No newline at end of file >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 8b4adee..2186504 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -43,6 +43,7 @@ use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Borrower::Debarments qw(GetDebarments IsDebarred); > use Koha::DateUtils; > use Koha::Database; >+use Koha::Reserves; > > use Date::Calc qw( > Today >@@ -378,6 +379,8 @@ if ($borrowernumber) { > ->count( { borrowernumber => $borrowernumber } ) ); > > $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' ); >+ >+ $template->param( WaitingReserveLoop => Koha::Reserves::GetWaitingReserves($borrowernumber) ); > } > > my @values; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index d000ceb..a452b62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -616,20 +616,25 @@ No patron matched <span class="ex">[% message %]</span> > > </div> > >- [% IF ( WaitingReserveLoop ) %] >- <div id="holdswaiting" class="circmessage"> >- <h4>Holds waiting:</h4> >- [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %] >- <ul> >- <li> <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% WaitingReserveLoo.biblionumber %]">[% WaitingReserveLoo.title |html %]</a> ([% WaitingReserveLoo.itemtype %]), [% IF ( WaitingReserveLoo.author ) %]by [% WaitingReserveLoo.author %][% END %] [% IF ( WaitingReserveLoo.itemcallnumber ) %][[% WaitingReserveLoo.itemcallnumber %]] [% END %]Hold placed on [% WaitingReserveLoo.reservedate %]. >- [% IF ( WaitingReserveLoo.waitingat ) %] >- <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]Waiting at [% WaitingReserveLoo.waitingat %]</strong> >- [% END %] >- </li> >- </ul> >- [% END %] >- </div> >- <!-- /If WaitingReserveLoop -->[% END %] >+ [% IF ( WaitingReserveLoop ) %] >+ <div id="holdswaiting" class="circmessage"> >+ <h4>Holds waiting:</h4> >+ [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %] >+ <ul> >+ <li> <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% WaitingReserveLoo.biblionumber %]">[% WaitingReserveLoo.title |html %]</a> [% IF ( WaitingReserveLoo.author ) %] [% WaitingReserveLoo.author %][% END %] [% IF ( WaitingReserveLoo.itemcallnumber ) %][[% WaitingReserveLoo.itemcallnumber %]] [% END %] >+ [% IF ( WaitingReserveLoo.lastpickupdate ) %] >+ Last pickup date [% WaitingReserveLoo.lastpickupdate %] >+ [% END %] >+ [% IF ( WaitingReserveLoo.waitingat ) %] >+ <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %] >+ Waiting at [% WaitingReserveLoo.waitingat %] >+ </strong> >+ [% END %] >+ </li> >+ </ul> >+ [% END %] >+ </div> >+ <!-- /If WaitingReserveLoop -->[% END %] > [% IF ( notes ) %] > <div id="circnotes" class="circmessage"> > <h4>Notes:</h4> >-- >1.7.9.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 12892
:
31471
|
31472
|
31581
|
31600
|
31601
|
31603
|
31604
|
31605
|
31607
|
31608
|
31670
|
31671
|
31672
|
31962
|
31963
|
32010
|
32017
|
32044
|
32057
|
32066
|
32069
|
33222
|
33225
|
33236
|
33275