diff options
| author | ivan <ivan> | 2010-04-09 08:18:24 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2010-04-09 08:18:24 +0000 | 
| commit | 2ab068f449eb97a10e18d20e9dab5ab9faa017e7 (patch) | |
| tree | f1464912b3f3072cbb4290cfa2a4a26e32165676 /httemplate/edit/process | |
| parent | 4125a128eaa40c751c89a69c2f9888463a78c6f3 (diff) | |
fix date parsing when using international dates (package date edit), RT#8027
Diffstat (limited to 'httemplate/edit/process')
| -rwxr-xr-x | httemplate/edit/process/REAL_cust_pkg.cgi | 10 | ||||
| -rwxr-xr-x | httemplate/edit/process/cust_main.cgi | 2 | ||||
| -rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 2 | ||||
| -rw-r--r-- | httemplate/edit/process/quick-charge.cgi | 2 | ||||
| -rw-r--r-- | httemplate/edit/process/quick-cust_pkg.cgi | 2 | 
5 files changed, 6 insertions, 12 deletions
| diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi index b5796ebf5..570f0e031 100755 --- a/httemplate/edit/process/REAL_cust_pkg.cgi +++ b/httemplate/edit/process/REAL_cust_pkg.cgi @@ -19,13 +19,8 @@ die "access denied"  my $pkgnum = $cgi->param('pkgnum') or die;  my $old = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});  my %hash = $old->hash; -$hash{'start_date'} = $cgi->param('start_date') ? str2time($cgi->param('start_date')) : ''; -$hash{'setup'} = $cgi->param('setup') ? str2time($cgi->param('setup')) : ''; -$hash{'bill'} = $cgi->param('bill') ? str2time($cgi->param('bill')) : ''; -$hash{'last_bill'} = -  $cgi->param('last_bill') ? str2time($cgi->param('last_bill')) : ''; -$hash{'adjourn'} = $cgi->param('adjourn') ? str2time($cgi->param('adjourn')) : ''; -$hash{'expire'} = $cgi->param('expire') ? str2time($cgi->param('expire')) : ''; +$hash{$_}= $cgi->param($_) ? parse_datetime($cgi->param($_)) : '' +  foreach qw( start_date setup bill last_bill adjourn expire );  my @errors = (); @@ -47,7 +42,6 @@ my $error;  if ( @errors ) {    $error = join(',', @errors);  } else { -  warn join(',',%hash);    $new = new FS::cust_pkg \%hash;    $error = $new->replace($old);  } diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index f72ca0a81..1311ba4f3 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -98,7 +98,7 @@ foreach my $dfield (qw( birthdate signupdate )) {      } else { -      $parsed = str2time($value) +      $parsed = parse_datetime($value)          or $error ||= "Invalid $dfield: $value";      } diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index a310c5306..df506c677 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -39,7 +39,7 @@ $cgi->param('link') =~ /^(custnum|invnum|popup)$/  my $field = my $link = $1;  $field = 'custnum' if $field eq 'popup'; -my $_date = str2time($cgi->param('_date')); +my $_date = parse_datetime($cgi->param('_date'));  my $new = new FS::cust_pay ( {    $field => $linknum, diff --git a/httemplate/edit/process/quick-charge.cgi b/httemplate/edit/process/quick-charge.cgi index 27921b8c3..484f6fcc6 100644 --- a/httemplate/edit/process/quick-charge.cgi +++ b/httemplate/edit/process/quick-charge.cgi @@ -58,7 +58,7 @@ unless ( $error ) {      'bill_now'      => scalar($cgi->param('bill_now')),      'invoice_terms' => scalar($cgi->param('invoice_terms')),      'start_date'    => ( scalar($cgi->param('start_date')) -                           ? str2time($cgi->param('start_date')) +                           ? parse_datetime($cgi->param('start_date'))                             : ''                         ),      'no_auto'       => scalar($cgi->param('no_auto')), diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 202d0a3cf..2fde17f5e 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -54,7 +54,7 @@ my $cust_pkg = new FS::cust_pkg {    'custnum'              => $custnum,    'pkgpart'              => $pkgpart,    'start_date'           => ( scalar($cgi->param('start_date')) -                                ? str2time($cgi->param('start_date')) +                                ? parse_datetime($cgi->param('start_date'))                                  : ''                              ),    'no_auto'              => scalar($cgi->param('no_auto')), | 
