[freeside-commits] freeside/FS/FS Schema.pm, 1.30, 1.31 cust_main.pm, 1.244, 1.245 Conf.pm, 1.160, 1.161 Record.pm, 1.123, 1.124

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Oct 4 14:22:10 PDT 2006


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv3524/FS/FS

Modified Files:
	Schema.pm cust_main.pm Conf.pm Record.pm 
Log Message:
DoB

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- Schema.pm	3 Oct 2006 22:44:27 -0000	1.30
+++ Schema.pm	4 Oct 2006 21:22:07 -0000	1.31
@@ -407,6 +407,7 @@
 #        'middle',   'varchar', 'NULL', $char_d, '', '', 
         'first',    'varchar', '',     $char_d, '', '', 
         'ss',       'varchar', 'NULL', 11, '', '', 
+        'birthdate', at date_type, '', '', 
         'company',  'varchar', 'NULL', $char_d, '', '', 
         'address1', 'varchar', '',     $char_d, '', '', 
         'address2', 'varchar', 'NULL', $char_d, '', '', 

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.160
retrieving revision 1.161
diff -u -d -r1.160 -r1.161
--- Conf.pm	3 Oct 2006 22:44:26 -0000	1.160
+++ Conf.pm	4 Oct 2006 21:22:08 -0000	1.161
@@ -413,6 +413,13 @@
   },
 
   {
+    'key'         => 'date_format',
+    'section'     => 'UI',
+    'description' => 'format code for displaying dates with Date::Format::time2str',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'cyrus',
     'section'     => 'deprecated',
     'description' => '<b>DEPRECATED</b>, add a <i>cyrus</i> <a href="../browse/part_export.cgi">export</a> instead.  This option used to integrate with <a href="http://asg.web.cmu.edu/cyrus/imapd/">Cyrus IMAP Server</a>, three lines: IMAP server, admin username, and admin password.  Cyrus::IMAP::Admin should be installed locally and the connection to the server secured.',

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.244
retrieving revision 1.245
diff -u -d -r1.244 -r1.245
--- cust_main.pm	3 Oct 2006 22:44:26 -0000	1.244
+++ cust_main.pm	4 Oct 2006 21:22:07 -0000	1.245
@@ -1209,6 +1209,7 @@
     || $self->ut_number('refnum')
     || $self->ut_name('last')
     || $self->ut_name('first')
+    || $self->ut_snumbern('birthdate')
     || $self->ut_textn('company')
     || $self->ut_text('address1')
     || $self->ut_textn('address2')
@@ -4619,6 +4620,8 @@
 
 payinfo_masked false laziness with cust_pay.pm and cust_refund.pm
 
+Birthdates rely on negative epoch values.
+
 =head1 SEE ALSO
 
 L<FS::Record>, L<FS::cust_pkg>, L<FS::cust_bill>, L<FS::cust_credit>

Index: Record.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Record.pm,v
retrieving revision 1.123
retrieving revision 1.124
diff -u -d -r1.123 -r1.124
--- Record.pm	13 Sep 2006 02:14:29 -0000	1.123
+++ Record.pm	4 Oct 2006 21:22:08 -0000	1.124
@@ -83,6 +83,8 @@
     $error = $record->ut_float('column');
     $error = $record->ut_number('column');
     $error = $record->ut_numbern('column');
+    $error = $record->ut_snumber('column');
+    $error = $record->ut_snumbern('column');
     $error = $record->ut_money('column');
     $error = $record->ut_text('column');
     $error = $record->ut_textn('column');
@@ -1288,6 +1290,25 @@
   '';
 }
 
+=item ut_snumbern COLUMN
+
+Check/untaint signed numeric data (whole numbers).  If there is an error,
+returns the error, otherwise returns false.
+
+=cut
+
+sub ut_snumbern {
+  my($self, $field) = @_;
+  $self->getfield($field) =~ /^(-?)\s*(\d*)$/
+    or return "Illegal (numeric) $field: ". $self->getfield($field);
+  if ($1) {
+    return "Illegal (numeric) $field: ". $self->getfield($field)
+      unless $2;
+  }
+  $self->setfield($field, "$1$2");
+  '';
+}
+
 =item ut_number COLUMN
 
 Check/untaint simple numeric data (whole numbers).  May not be null.  If there



More information about the freeside-commits mailing list