Bugzilla – Attachment 43934 Details for
Bug 14949
Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 14949 - Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl
PASSED-QA-Bug-14949---Remove-C4Dates-from-adminsma.patch (text/plain), 3.88 KB, created by
Katrin Fischer
on 2015-10-24 20:50:26 UTC
(
hide
)
Description:
[PASSED QA] Bug 14949 - Remove C4::Dates from admin/smart-rules.pl and admin/categorie.pl
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-10-24 20:50:26 UTC
Size:
3.88 KB
patch
obsolete
>From 5d37cfd276e3987d3f19baa8c674354501022e76 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Sun, 4 Oct 2015 18:25:46 +0200 >Subject: [PATCH] [PASSED QA] Bug 14949 - Remove C4::Dates from > admin/smart-rules.pl and admin/categorie.pl >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Bug to remove C4::Dates from > - admin/smart-rules.pl > - admin/categorie.pl > >To test: > >- Apply patch > >- Go to Home > Administration > Circulation and fine rules (smart-rules.pl) >- Edit or add a rule >- Verify that 'Hard due date' displays and saves fine > >- Go to Home > Administration > Patron categories >- Edit or add a category >- Verify that 'Until date' displays and saves fine > >Note: The date picker does not warn about wrong date formats as e.g. while > editing patrons, but that is not in the scope of this bug > >Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > admin/categorie.pl | 10 ++++------ > admin/smart-rules.pl | 9 +++++---- > 2 files changed, 9 insertions(+), 10 deletions(-) > >diff --git a/admin/categorie.pl b/admin/categorie.pl >index 27e95cb..a848aa4 100755 >--- a/admin/categorie.pl >+++ b/admin/categorie.pl >@@ -42,9 +42,9 @@ use C4::Context; > use C4::Auth; > use C4::Branch; > use C4::Output; >-use C4::Dates; > use C4::Form::MessagingPreferences; > use Koha::Database; >+use Koha::DateUtils; > > sub StringSearch { > my ( $searchstring, $type ) = @_; >@@ -172,11 +172,9 @@ elsif ( $op eq 'add_validate' ) { > my $dbh = C4::Context->dbh; > > if ( $input->param('enrolmentperioddate') ) { >- $input->param( >- 'enrolmentperioddate' => C4::Dates::format_date_in_iso( >- $input->param('enrolmentperioddate') >- ) >- ); >+ my $enrolment_dt = eval { dt_from_string( $input->param('enrolmentperioddate') ) }; >+ $enrolment_dt = eval { output_pref( { dt => $enrolment_dt, dateonly => 1, dateformat => 'iso' } ) } if ( $enrolment_dt ); >+ $input->param( 'enrolmentperioddate' => $enrolment_dt ); > } > > if ($is_a_modif) { >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index de090cb..05c81d5 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -26,7 +26,7 @@ use C4::Auth; > use C4::Koha; > use C4::Debug; > use C4::Branch; # GetBranches >-use C4::Dates qw/format_date format_date_in_iso/; >+use Koha::DateUtils; > use Koha::Database; > > my $input = CGI->new; >@@ -126,8 +126,8 @@ elsif ($op eq 'add') { > $maxonsiteissueqty = undef if $maxonsiteissueqty !~ /^\d+/; > my $issuelength = $input->param('issuelength'); > my $lengthunit = $input->param('lengthunit'); >- my $hardduedate = $input->param('hardduedate'); >- $hardduedate = format_date_in_iso($hardduedate); >+ my $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) }; >+ $hardduedate = output_pref( { dt => $hardduedate, dateonly => 1, dateformat => 'iso' } ) if ( $hardduedate ); > my $hardduedatecompare = $input->param('hardduedatecompare'); > my $rentaldiscount = $input->param('rentaldiscount'); > my $opacitemholds = $input->param('opacitemholds') || 0; >@@ -446,7 +446,8 @@ while (my $row = $sth2->fetchrow_hashref) { > $row->{'default_humancategorycode'} = 1 if $row->{'humancategorycode'} eq '*'; > $row->{'fine'} = sprintf('%.2f', $row->{'fine'}); > if ($row->{'hardduedate'} && $row->{'hardduedate'} ne '0000-00-00') { >- $row->{'hardduedate'} = format_date( $row->{'hardduedate'}); >+ my $harddue_dt = eval { dt_from_string( $row->{'hardduedate'} ) }; >+ $row->{'hardduedate'} = eval { output_pref( { dt => $harddue_dt, dateonly => 1 } ) } if ( $harddue_dt ); > $row->{'hardduedatebefore'} = 1 if ($row->{'hardduedatecompare'} == -1); > $row->{'hardduedateexact'} = 1 if ($row->{'hardduedatecompare'} == 0); > $row->{'hardduedateafter'} = 1 if ($row->{'hardduedatecompare'} == 1); >-- >1.9.1
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 14949
:
43094
|
43101
|
43169
|
43409
|
43884
|
43885
| 43934 |
43935
|
43936