Bugzilla – Attachment 43427 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 - (Follow-up) Validate date entry in contracts
Bug-14931---Follow-up-Validate-date-entry-in-contr.patch (text/plain), 6.70 KB, created by
Marc Véron
on 2015-10-15 11:05:56 UTC
(
hide
)
Description:
Bug 14931 - (Follow-up) Validate date entry in contracts
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-10-15 11:05:56 UTC
Size:
6.70 KB
patch
obsolete
>From ce164c8d6794343e24c0bf32d23d9311859c2e79 Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Thu, 15 Oct 2015 13:01:50 +0200 >Subject: [PATCH] Bug 14931 - (Follow-up) Validate date entry in contracts > > Go to Home > Acquisitions, search for an active vendor and view the vendor >- Click on 'Contracts' at the left > (admin/aqcontract.pl) >- Create and edit contracts and verify that it works OK. > (Note: there is no help for this page, see Bug 14929) >--- > admin/aqcontract.pl | 16 ++++++++-------- > .../intranet-tmpl/prog/en/modules/admin/aqcontract.tt | 9 +++++---- > 2 files changed, 13 insertions(+), 12 deletions(-) > >diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl >index 6deec5b..8eb1738 100755 >--- a/admin/aqcontract.pl >+++ b/admin/aqcontract.pl >@@ -71,8 +71,8 @@ if ( $op eq 'add_form' ) { > contractnumber => $contract->{contractnumber}, > contractname => $contract->{contractname}, > contractdescription => $contract->{contractdescription}, >- contractstartdate => output_pref({ dt => dt_from_string( $contract->{contractstartdate} ), dateonly => 1 }), >- contractenddate => output_pref({ dt => dt_from_string( $contract->{contractenddate} ), dateonly => 1 }), >+ contractstartdate => $contract->{contractstartdate}, >+ contractenddate => $contract->{contractenddate}, > ); > } else { > $template->param( >@@ -95,8 +95,8 @@ elsif ( $op eq 'add_validate' ) { > > if ( $is_a_modif ) { > ModContract({ >- contractstartdate => output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 }), >- contractenddate => output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 }), >+ contractstartdate => eval { output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 } ); }, >+ contractenddate => eval { output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 } ); }, > contractname => $input->param('contractname'), > contractdescription => $input->param('contractdescription'), > booksellerid => $input->param('booksellerid'), >@@ -107,8 +107,8 @@ elsif ( $op eq 'add_validate' ) { > contractname => $input->param('contractname'), > contractdescription => $input->param('contractdescription'), > booksellerid => $input->param('booksellerid'), >- contractstartdate => output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 }), >- contractenddate => output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 }), >+ contractstartdate => eval { output_pref({ dt => dt_from_string( $input->param('contractstartdate') ), dateformat => 'iso', dateonly => 1 } ); }, >+ contractenddate => eval { output_pref({ dt => dt_from_string( $input->param('contractenddate') ), dateformat => 'iso', dateonly => 1 } ); }, > }); > } > >@@ -127,8 +127,8 @@ elsif ( $op eq 'delete_confirm' ) { > contractnumber => $$contract{contractnumber}, > contractname => $$contract{contractname}, > contractdescription => $$contract{contractdescription}, >- contractstartdate => output_pref({ dt => dt_from_string( $$contract{contractstartdate} ), dateonly => 1 }), >- contractenddate => output_pref({ dt => dt_from_string( $$contract{contractenddate} ), dateonly => 1 }), >+ contractstartdate => $$contract{contractstartdate}, >+ contractenddate => $$contract{contractenddate}, > ); > > # END $OP eq DELETE_CONFIRM >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >index 6c48aa2..684d69f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqcontract.tt >@@ -1,3 +1,4 @@ >+[% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › Contracts › > [% IF ( add_form ) %] >@@ -120,11 +121,11 @@ function Check(ff) { > <input type="text" name="contractdescription" id="contractdescription" size="40" maxlength="80" value="[% contractdescription %]" /> > </li> > <li><label for="from" class="required">Start date: *</label> >- <input type="text" name="contractstartdate" id="from" value="[% contractstartdate %]" maxlength="10" size="10" class="datepickerfrom" /> >+ <input type="text" name="contractstartdate" id="from" value="[% contractstartdate | $KohaDates %]" maxlength="10" size="10" class="datepickerfrom" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > <li><label for="to" class="required">End date: *</label> >- <input type="text" name="contractenddate" id="to" value="[% contractenddate %]" maxlength="10" size="10" class="datepickerto" /> >+ <input type="text" name="contractenddate" id="to" value="[% contractenddate | $KohaDates %]" maxlength="10" size="10" class="datepickerto" /> > <div class="hint">[% INCLUDE 'date-format.inc' %]</div> > </li> > </ol> >@@ -148,8 +149,8 @@ function Check(ff) { > <tr><th scope="row">Contract number:</th><td>[% contractnumber %]</td></tr> > <tr><th scope="row">Contract name:</th><td>[% contractname %]</td></tr> > <tr><th scope="row">Contract description:</th><td>[% contractdescription %]</td></tr> >- <tr><th scope="row">Contract start date:</th><td>[% contractstartdate %]</td></tr> >- <tr><th scope="row">Contract end date:</th><td>[% contractenddate %]</td></tr> >+ <tr><th scope="row">Contract start date:</th><td>[% contractstartdate | $KohaDates %]</td></tr> >+ <tr><th scope="row">Contract end date:</th><td>[% contractenddate | $KohaDates %]</td></tr> > <tr><th scope="row">Vendor:</th><td>[% booksellername %]</td></tr> > </table> > <fieldset class="action"> >-- >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 14931
:
42977
|
43302
|
43427
|
43956
|
44101
|
44103
|
44104
|
44105
|
44107