Bugzilla – Attachment 40673 Details for
Bug 13853
Show waiting hold expiration date for waiting holds in holds ajax datatable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13853 - Show waiting hold expiration date for waiting holds in holds ajax datatable
Bug-13853---Show-waiting-hold-expiration-date-for-.patch (text/plain), 4.97 KB, created by
Kyle M Hall (khall)
on 2015-06-26 14:32:28 UTC
(
hide
)
Description:
Bug 13853 - Show waiting hold expiration date for waiting holds in holds ajax datatable
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-06-26 14:32:28 UTC
Size:
4.97 KB
patch
obsolete
>From ef648a3fa6f9085499e79efd3251c67319b0baab Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 17 Mar 2015 10:09:28 -0400 >Subject: [PATCH] Bug 13853 - Show waiting hold expiration date for waiting holds in holds ajax datatable > >We should show the expiration date for waiting holds in the holds >datatable that appears in circulation.pl and moremember.pl > >Test Plan: >1) Ensure ReservesMaxPickUpDelay is set >2) Place a hold on a record >3) Place a second hold and set it to waiting by checking it in >4) Place a third hold with an expiration date >5) View the holds tab on circulation.pl and moremember.pl >6) Note the first hold has no expiration date >7) Note the second hold has an expiration date of today + ReservesMaxPickUpDelay days >8) Note the thrid hold has an expiration date of whatever you set it to > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Cathi Wiggins <CWIGGINS@ci.arcadia.ca.us> > >Signed-off-by: Megan Wianecki <mwianecki@mplmain.mtpl.org> >--- > Koha/Hold.pm | 12 ++++++++++++ > Koha/Item.pm | 27 +++++++++++++++++++++++++++ > svc/holds | 23 ++++++++++++++--------- > 3 files changed, 53 insertions(+), 9 deletions(-) > >diff --git a/Koha/Hold.pm b/Koha/Hold.pm >index ee4a8a0..b874f13 100644 >--- a/Koha/Hold.pm >+++ b/Koha/Hold.pm >@@ -62,6 +62,18 @@ sub waiting_expires_on { > return $dt; > } > >+=head3 is_waiting >+ >+Returns true if hold is a waiting hold >+ >+=cut >+ >+sub is_waiting { >+ my ($self) = @_; >+ >+ return $self->found() eq 'W'; >+} >+ > =head3 biblio > > Returns the related Koha::Biblio object for this hold >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 4dcefd2..2dcccfb 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -23,6 +23,8 @@ use Carp; > > use Koha::Database; > >+use Koha::Branches; >+ > use base qw(Koha::Object); > > =head1 NAME >@@ -47,6 +49,31 @@ sub effective_itemtype { > return $self->_result()->effective_itemtype(); > } > >+=head3 home_branch >+ >+=cut >+ >+sub home_branch { >+ my ($self) = @_; >+ >+ $self->{_home_branch} ||= Koha::Branches->find( $self->homebranch() ); >+ >+ return $self->{_home_branch}; >+} >+ >+=head3 holding_branch >+ >+=cut >+ >+sub holding_branch { >+ my ($self) = @_; >+ >+ $self->{_holding_branch} ||= Koha::Branches->find( $self->holdingbranch() ); >+ >+ return $self->{_holding_branch}; >+} >+ >+ > =head3 type > > =cut >diff --git a/svc/holds b/svc/holds >index d5f772a..10d9205 100755 >--- a/svc/holds >+++ b/svc/holds >@@ -29,8 +29,8 @@ use C4::Charset; > use C4::Circulation qw(GetTransfers); > use C4::Context; > >-use Koha::Database; > use Koha::DateUtils; >+use Koha::Holds; > > my $input = new CGI; > >@@ -59,7 +59,7 @@ my $sorting_column = $sort_columns[ $input->param('iSortCol_0') ] > binmode STDOUT, ":encoding(UTF-8)"; > print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); > >-my $holds_rs = $schema->resultset('Reserve')->search( >+my $holds_rs = Koha::Holds->search( > { borrowernumber => $borrowernumber }, > { > order_by => { "-$sorting_direction" => $sorting_column } >@@ -79,15 +79,15 @@ while ( my $h = $holds_rs->next() ) { > title => $h->biblio()->title(), > author => $h->biblio()->author(), > reserve_id => $h->reserve_id(), >- branchcode => $h->branchcode()->branchname(), >+ branchcode => $h->branch()->branchname(), > reservedate => $h->reservedate(), > expirationdate => $h->expirationdate(), > suspend => $h->suspend(), > suspend_until => $h->suspend_until(), > found => $h->found(), >- waiting => $h->found() eq 'W', >- waiting_at => $h->branchcode()->branchname(), >- waiting_here => $h->branchcode()->branchcode() eq $branch, >+ waiting => $h->is_waiting(), >+ waiting_at => $h->branch()->branchname(), >+ waiting_here => $h->branch()->branchcode() eq $branch, > priority => $h->priority(), > subtitle => GetRecordValue( > 'subtitle', GetMarcBiblio($biblionumber), >@@ -107,6 +107,11 @@ while ( my $h = $holds_rs->next() ) { > : q{}, > }; > >+ if ( my $e = $h->waiting_expires_on() ) { >+ $hold->{expirationdate} = $e->ymd(); >+ $hold->{expirationdate_formatted} = output_pref( { dt => $e, dateonly => 1 }); >+ } >+ > $hold->{transfered} = 0; > $hold->{not_transfered} = 0; > >@@ -124,11 +129,11 @@ while ( my $h = $holds_rs->next() ) { > $hold->{date_sent} = output_pref( dt_from_string($transferred_when) ); > $hold->{from_branch} = GetBranchName($transferred_from); > } >- elsif ( $item->holdingbranch()->branchcode() ne >- $h->branchcode()->branchcode() ) >+ elsif ( $item->holding_branch()->branchcode() ne >+ $h->branch()->branchcode() ) > { > $hold->{not_transferred} = 1; >- $hold->{not_transferred_by} = $h->item()->holdingbranch()->branchname(); >+ $hold->{not_transferred_by} = $h->item()->holding_branch()->branchname(); > } > } > >-- >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 13853
:
36949
|
36984
|
39748
|
40026
|
40037
|
40417
|
40673
|
40674
|
40675
|
40755
|
40756
|
40757
|
40758