Bugzilla – Attachment 44105 Details for
Bug 14931
Remove C4::Dates from files admin/aq*.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14931: (qa followu-up) small improvements
Bug-14931-qa-followu-up-small-improvements.patch (text/plain), 1.96 KB, created by
Jonathan Druart
on 2015-10-28 08:42:43 UTC
(
hide
)
Description:
Bug 14931: (qa followu-up) small improvements
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-28 08:42:43 UTC
Size:
1.96 KB
patch
obsolete
>From 401d1994ee835a15e0c4cf0fe1030b9c16c7a610 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 28 Oct 2015 08:41:19 +0000 >Subject: [PATCH] Bug 14931: (qa followu-up) small improvements > >- Avoid 1 call to dt_from_string in some cases >- Do not use $_ > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > admin/aqcontract.pl | 14 ++++++++------ > 1 file changed, 8 insertions(+), 6 deletions(-) > >diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl >index 8f6bf30..a191cd8 100755 >--- a/admin/aqcontract.pl >+++ b/admin/aqcontract.pl >@@ -94,10 +94,12 @@ elsif ( $op eq 'add_validate' ) { > my $is_a_modif = $input->param("is_a_modif"); > > my $contractstart_dt = eval { dt_from_string( $input->param('contractstartdate') ); }; >- $contractstart_dt = dt_from_string if ( ! $contractstart_dt ); >- > my $contractend_dt = eval { dt_from_string( $input->param('contractenddate') ); }; >- $contractend_dt = dt_from_string if ( ! $contractend_dt ); >+ unless ( $contractstart_dt and $contractend_dt ) { >+ my $today = dt_from_string; >+ $contractstart_dt ||= $today; >+ $contractend_dt ||= $today; >+ } > > if ( $is_a_modif ) { > ModContract({ >@@ -161,9 +163,9 @@ if ( $op eq 'list' ) { > my @contracts = @{GetContracts( { booksellerid => $booksellerid } )}; > > # format dates >- for ( @contracts ) { >- $$_{contractstartdate} = output_pref({ dt => dt_from_string( $$_{contractstartdate} ), dateonly => 1 }); >- $$_{contractenddate} = output_pref({ dt => dt_from_string( $$_{contractenddate} ), dateonly => 1 }), >+ for my $contract ( @contracts ) { >+ $contract->{contractstartdate} = output_pref({ dt => dt_from_string( $contract->{contractstartdate} ), dateonly => 1 }); >+ $contract->{contractenddate} = output_pref({ dt => dt_from_string( $contract->{contractenddate} ), dateonly => 1 }), > } > > $template->param(loop => \@contracts); >-- >2.1.0
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 14931
:
42977
|
43302
|
43427
|
43956
|
44101
|
44103
|
44104
| 44105 |
44107