Bugzilla – Attachment 189951 Details for
Bug 34069
Add ability to restore a recently deleted borrower from deletedborrowers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34069: Adjust before and after date search
Bug-34069-Adjust-before-and-after-date-search.patch (text/plain), 2.21 KB, created by
Andrew Fuerste-Henry
on 2025-11-25 19:28:57 UTC
(
hide
)
Description:
Bug 34069: Adjust before and after date search
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-11-25 19:28:57 UTC
Size:
2.21 KB
patch
obsolete
>From 0ee26557ec69b05fe25a9f910319602ea5773edc Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Thu, 20 Nov 2025 13:29:46 +0000 >Subject: [PATCH] Bug 34069: Adjust before and after date search > >Signed-off-by: Katie Bliss <kebliss@dmpl.org> >--- > tools/restore_deleted_borrowers.pl | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/tools/restore_deleted_borrowers.pl b/tools/restore_deleted_borrowers.pl >index 417b5e15087..30b59c4cc39 100755 >--- a/tools/restore_deleted_borrowers.pl >+++ b/tools/restore_deleted_borrowers.pl >@@ -23,8 +23,9 @@ use CGI qw ( -utf8 ); > use Try::Tiny; > use Scalar::Util qw( blessed ); > >-use C4::Auth qw( get_template_and_user haspermission ); >-use C4::Output qw( output_html_with_http_headers ); >+use Koha::DateUtils qw( dt_from_string ); >+use C4::Auth qw( get_template_and_user haspermission ); >+use C4::Output qw( output_html_with_http_headers ); > use C4::Context; > > use Koha::Old::Patrons; >@@ -107,12 +108,21 @@ if ( $op eq 'search' ) { > $search_params{email} = { 'like' => "%$email%" } if $email; > > #date parameters >+ my $dtf = Koha::Database->new->schema->storage->datetime_parser; > if ( $deleted_from && $deleted_to ) { >- $search_params{updated_on} = { -between => [ $deleted_from, $deleted_to ] }; >+ my $from_dt = dt_from_string($deleted_from); >+ my $to_dt = dt_from_string($deleted_to)->add( days => 1 ); >+ >+ $search_params{updated_on} = { >+ '>=' => $dtf->format_datetime($from_dt), >+ '<' => $dtf->format_datetime($to_dt) >+ }; > } elsif ($deleted_from) { >- $search_params{updated_on} = { '>=' => $deleted_from }; >+ my $from_dt = dt_from_string($deleted_from); >+ $search_params{updated_on} = { '>=' => $dtf->format_datetime($from_dt) }; > } elsif ($deleted_to) { >- $search_params{updated_on} = { '<=' => $deleted_to }; >+ my $to_dt = dt_from_string($deleted_to)->add( days => 1 ); >+ $search_params{updated_on} = { '<' => $dtf->format_datetime($to_dt) }; > } > > my $deleted_patrons_rs = Koha::Old::Patrons->search( >-- >2.39.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 34069
:
188299
|
188302
|
188988
|
188989
|
188990
|
189027
|
189028
|
189029
|
189030
|
189037
|
189066
|
189067
|
189370
|
189371
|
189372
|
189373
|
189374
|
189375
|
189376
|
189377
|
189642
|
189645
|
189718
|
189773
|
189774
|
189779
|
189780
|
189781
|
189782
|
189783
|
189784
|
189785
|
189786
|
189787
|
189788
|
189789
|
189790
|
189791
|
189792
|
189793
|
189794
|
189795
|
189940
|
189941
|
189942
|
189943
|
189944
|
189945
|
189946
|
189947
|
189948
|
189949
|
189950
| 189951 |
189952
|
189953
|
189954