Bugzilla – Attachment 43276 Details for
Bug 14982
Remove C4::Dates from guided report wizard and dictionary
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Remove C4::Dates from guided report wizard and dictionary
Remove-C4Dates-from-guided-report-wizard-and-dicti.patch (text/plain), 3.81 KB, created by
Marc Véron
on 2015-10-08 18:04:30 UTC
(
hide
)
Description:
Remove C4::Dates from guided report wizard and dictionary
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-10-08 18:04:30 UTC
Size:
3.81 KB
patch
obsolete
>From 0b5fd79704f5b115f4576e367b5f5d1652d7da39 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Thu, 8 Oct 2015 19:34:56 +0200 >Subject: [PATCH] Remove C4::Dates from guided report wizard and dictionary > >This patch removes C4::Dates from files: >- reports/guided_reports.pl >- reports/dictionary.pl > >To test: >- Go to Home > Reports > Guided reports wizard >- Then go to 'View Dictionary' (menue at teh left) >- Click 'New definition' and step through >- In step 2. select e.g. borrowers >- In step 3 select a date field >- In step 4, select date range and test start / end dates >- In step 5, verify that dates display properly >- Save and verify that dates are insertet properly in sql definition > >- Go back to Home > Reports > Guided reports wizard >- Step through the wizard and verify that it works as before. > >http://bugs.koha-community.org/show_bug.cgi?id=14982 >--- > reports/dictionary.pl | 28 +++++++++++++++------------- > reports/guided_reports.pl | 1 - > 2 files changed, 15 insertions(+), 14 deletions(-) > >diff --git a/reports/dictionary.pl b/reports/dictionary.pl >index 400790c..964f76f 100755 >--- a/reports/dictionary.pl >+++ b/reports/dictionary.pl >@@ -23,7 +23,7 @@ use C4::Auth; > use CGI qw ( -utf8 ); > use C4::Output; > use C4::Reports::Guided; >-use C4::Dates; >+use Koha::DateUtils; > > =head1 NAME > >@@ -141,34 +141,36 @@ elsif ( $phase eq 'New Term step 5' ) { > $tmp_hash{'name'} = $crit; > $tmp_hash{'value'} = $value; > push @criteria_loop, \%tmp_hash; >- if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) { >- my $date = C4::Dates->new($value); >- $value = $date->output("iso"); >- } >+ my $value_dt = eval { dt_from_string( $value ) }; >+ $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } ) >+ if ( $value_dt ); >+ > $query_criteria .= " AND $crit='$value'"; > } > $value = $input->param( $crit . "_start_value" ); >+ > if ($value) { > my %tmp_hash; > $tmp_hash{'name'} = "$crit Start"; > $tmp_hash{'value'} = $value; > push @criteria_loop, \%tmp_hash; >- if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) { >- my $date = C4::Dates->new($value); >- $value = $date->output("iso"); >- } >+ my $value_dt = eval { dt_from_string( $value ) }; >+ $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } ) >+ if ( $value_dt ); >+ > $query_criteria .= " AND $crit >= '$value'"; > } >+ > $value = $input->param( $crit . "_end_value" ); > if ($value) { > my %tmp_hash; > $tmp_hash{'name'} = "$crit End"; > $tmp_hash{'value'} = $value; > push @criteria_loop, \%tmp_hash; >- if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) { >- my $date = C4::Dates->new($value); >- $value = $date->output("iso"); >- } >+ my $value_dt = eval { dt_from_string( $value ) }; >+ $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } ) >+ if ( $value_dt ); >+ > $query_criteria .= " AND $crit <= '$value'"; > } > } >diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl >index 0cee490..71b9253 100755 >--- a/reports/guided_reports.pl >+++ b/reports/guided_reports.pl >@@ -27,7 +27,6 @@ use File::Basename qw( dirname ); > use C4::Reports::Guided; > use C4::Auth qw/:DEFAULT get_session/; > use C4::Output; >-use C4::Dates qw/format_date/; > use C4::Debug; > use C4::Branch; # XXX subfield_is_koha_internal_p > use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/; >-- >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 14982
:
43276
|
43283
|
43970
|
43971