Bugzilla – Attachment 44625 Details for
Bug 14870
Delete C4/Dates.pm from System
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14870: (followup) Remove stray C4::Dates from reports files
Bug-14870-followup-Remove-stray-C4Dates-from-repor.patch (text/plain), 2.97 KB, created by
Marc Véron
on 2015-11-08 22:30:54 UTC
(
hide
)
Description:
Bug 14870: (followup) Remove stray C4::Dates from reports files
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-11-08 22:30:54 UTC
Size:
2.97 KB
patch
obsolete
>From e896949417f39be08d2f0e9268edf11df722299b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sun, 8 Nov 2015 23:09:10 +0100 >Subject: [PATCH] Bug 14870: (followup) Remove stray C4::Dates from reports > files > >This patch removes stray C4::Dates from following files: > >reports/borrowers_stats.pl >To test: Verify that C4::Dates is not used in the file > >reports/guided_reports.pl: >To test: >- Run a saved report with date input and with date range input, e.g. >- Verify that you are asked for date range or date and that the results > are the same as without patch >--- > reports/borrowers_stats.pl | 3 --- > reports/guided_reports.pl | 16 +++++++++++----- > 2 files changed, 11 insertions(+), 8 deletions(-) > >diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl >index 9ac0cac..b34934e 100755 >--- a/reports/borrowers_stats.pl >+++ b/reports/borrowers_stats.pl >@@ -31,7 +31,6 @@ use C4::Output; > use C4::Reports; > use C4::Circulation; > use C4::Members::AttributeTypes; >-use C4::Dates qw/format_date format_date_in_iso/; > use Date::Calc qw( > Today > Add_Delta_YM >@@ -43,8 +42,6 @@ plugin that shows a stats on borrowers > > =head1 DESCRIPTION > >-=over 2 >- > =cut > > my $input = new CGI; >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 71b9253..ce329f0 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -356,9 +356,13 @@ elsif ( $phase eq 'Choose these criteria' ) { > my $tovalue = $input->param( "to_" . $crit . "_value" ); > > # If the range values are dates >- if ($fromvalue =~ C4::Dates->regexp('syspref') && $tovalue =~ C4::Dates->regexp('syspref')) { >- $fromvalue = C4::Dates->new($fromvalue)->output("iso"); >- $tovalue = C4::Dates->new($tovalue)->output("iso"); >+ my $fromvalue_dt; >+ $fromvalue_dt = eval { dt_from_string( $fromvalue ); } if ( $fromvalue ); >+ my $tovalue_dt; >+ $tovalue_dt = eval { dt_from_string( $tovalue ); } if ($tovalue); >+ if ( $fromvalue_dt && $tovalue_dt ) { >+ $fromvalue = output_pref( { dt => dt_from_string( $fromvalue_dt ), dateonly => 1, dateformat => 'iso' } ); >+ $tovalue = output_pref( { dt => dt_from_string( $tovalue_dt ), dateonly => 1, dateformat => 'iso' } ); > } > > if ($fromvalue && $tovalue) { >@@ -368,8 +372,10 @@ elsif ( $phase eq 'Choose these criteria' ) { > } else { > > # If value is a date >- if ($value =~ C4::Dates->regexp('syspref')) { >- $value = C4::Dates->new($value)->output("iso"); >+ my $value_dt; >+ $value_dt = eval { dt_from_string( $value ); } if ( $value ); >+ if ( $value_dt ) { >+ $value = output_pref( { dt => dt_from_string( $value_dt ), dateonly => 1, dateformat => 'iso' } ); > } > # don't escape runtime parameters, they'll be at runtime > if ($value =~ /<<.*>>/) { >-- >1.7.10.4
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 14870
:
44595
|
44612
|
44613
|
44623
|
44625
|
44626
|
44943
|
44944
|
44954
|
44997
|
44998
|
44999
|
45000
|
45001
|
45002
|
45003
|
45004
|
45005
|
45006
|
45007
|
45008
|
45009
|
45010
|
45011
|
45012
|
45013
|
45014
|
45015