[freeside-commits] freeside/httemplate/edit/process quick-cust_pkg.cgi, 1.18, 1.19 cust_pay.cgi, 1.15, 1.16 REAL_cust_pkg.cgi, 1.14, 1.15 cust_main.cgi, 1.42, 1.43 quick-charge.cgi, 1.20, 1.21

Ivan,,, ivan at wavetail.420.am
Fri Apr 9 01:18:26 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv7332/httemplate/edit/process

Modified Files:
	quick-cust_pkg.cgi cust_pay.cgi REAL_cust_pkg.cgi 
	cust_main.cgi quick-charge.cgi 
Log Message:
fix date parsing when using international dates (package date edit), RT#8027

Index: quick-cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/quick-cust_pkg.cgi,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -w -d -r1.18 -r1.19
--- quick-cust_pkg.cgi	18 Mar 2010 07:59:52 -0000	1.18
+++ quick-cust_pkg.cgi	9 Apr 2010 08:18:24 -0000	1.19
@@ -54,7 +54,7 @@
   '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')),

Index: REAL_cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/REAL_cust_pkg.cgi,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -d -r1.14 -r1.15
--- REAL_cust_pkg.cgi	10 Mar 2010 06:47:51 -0000	1.14
+++ REAL_cust_pkg.cgi	9 Apr 2010 08:18:24 -0000	1.15
@@ -19,13 +19,8 @@
 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 @@
 if ( @errors ) {
   $error = join(',', @errors);
 } else {
-  warn join(',',%hash);
   $new = new FS::cust_pkg \%hash;
   $error = $new->replace($old);
 }

Index: quick-charge.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/quick-charge.cgi,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -w -d -r1.20 -r1.21
--- quick-charge.cgi	18 Mar 2010 07:59:52 -0000	1.20
+++ quick-charge.cgi	9 Apr 2010 08:18:24 -0000	1.21
@@ -58,7 +58,7 @@
     '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')),

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_main.cgi,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -w -d -r1.42 -r1.43
--- cust_main.cgi	7 Aug 2009 23:08:03 -0000	1.42
+++ cust_main.cgi	9 Apr 2010 08:18:24 -0000	1.43
@@ -98,7 +98,7 @@
 
     } else {
 
-      $parsed = str2time($value)
+      $parsed = parse_datetime($value)
         or $error ||= "Invalid $dfield: $value";
 
     }

Index: cust_pay.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_pay.cgi,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -d -r1.15 -r1.16
--- cust_pay.cgi	21 Sep 2009 02:41:43 -0000	1.15
+++ cust_pay.cgi	9 Apr 2010 08:18:24 -0000	1.16
@@ -39,7 +39,7 @@
 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,



More information about the freeside-commits mailing list