Bugzilla – Attachment 153512 Details for
Bug 33992
Only consider the date when labelling a waiting recall as problematic
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33992: Only consider the date when labelling a waiting recall as problematic
Bug-33992-Only-consider-the-date-when-labelling-a-.patch (text/plain), 2.86 KB, created by
Katrin Fischer
on 2023-07-16 11:11:55 UTC
(
hide
)
Description:
Bug 33992: Only consider the date when labelling a waiting recall as problematic
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2023-07-16 11:11:55 UTC
Size:
2.86 KB
patch
obsolete
>From 7d6c85af02f2fa43857131ea1aad51e8b4ee1eb6 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 13 Jun 2023 17:06:18 +1200 >Subject: [PATCH] Bug 33992: Only consider the date when labelling a waiting > recall as problematic > >This patches makes sure Koha ignores the hours/minutes/seconds when comparing a recall waiting date to decide if it has been waiting too long for pickup. > >To test: > >1. Enable UseRecalls syspref and set the relevant circulation and fines rules to configure recalls >2. Set the RecallsMaxPickUpDelay to 1 day >3. Check out Item A to Patron A >4. Log into the OPAC as Patron B >5. Search for Item A and place a recall >6. Log back into the staff interface and check in Item A >7. Confirm the recall as waiting for Patron B >8. Go to Circulation -> Recalls awaiting pickup >9. Confirm your recall exists under the 'Recalls waiting' tab >10. Log into the database and get the time for now > >sudo koha-mysql INSTANCE >select now(); > >11. Change the waiting_date in the database for this recall to yesterday so we would expect to see it under the 'Recalls waiting over 1 days' tab. Base the hours on the now() timestamp from the step before, add a few hours to this. > >For example, if the above SQl query returns "2023-06-13 10:54:21", change waiting_date to be slightly less than 1 day/24 hours before this now() timestamp, but still what we would consider 'yesterday' > >select * from recalls; # to get the recall_id >update recalls set waiting_date = "2023-06-12 14:54:21" where recall_id = X; > >12. Refresh the Circulation -> Recalls awaiting pickup page. The recall will not show up under the 'Recalls waiting over 1 days' tab, even though we expect it to. > >13. Apply the patch, restart services, refresh the page >14. Confirm the recall now shows under the 'Recalls waiting over 1 days' tab as expected. > >Sponsored-by: Auckland University of Technology >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > recalls/recalls_waiting.pl | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/recalls/recalls_waiting.pl b/recalls/recalls_waiting.pl >index a485e3a8c2..166da73d33 100755 >--- a/recalls/recalls_waiting.pl >+++ b/recalls/recalls_waiting.pl >@@ -55,10 +55,10 @@ if ( $op eq 'list' ) { > my $borrower = Koha::Patrons->find( $loggedinuser ); > my @over; > my $maxdelay = C4::Context->preference('RecallsMaxPickUpDelay') || 7; >- my $today = dt_from_string(); >+ my $today = dt_from_string()->truncate( to => 'day' ); > foreach my $r ( @recalls ){ >- my $lastwaitingday = dt_from_string( $r->waiting_date )->add( days => $maxdelay ); >- if ( $today > $lastwaitingday ){ >+ my $lastwaitingday = dt_from_string( $r->waiting_date )->add( days => $maxdelay )->truncate( to => 'day' ); >+ if ( $today >= $lastwaitingday ){ > push @over, $r; > } > } >-- >2.30.2
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 33992
:
152288
|
152289
|
152363
|
152364
|
152365
|
152368
|
152369
|
153512
|
153513