From 911d45c65bcdd9b8d53c8762ef0e62a5437f8734 Mon Sep 17 00:00:00 2001 From: tbrehm <t.brehm@ispconfig.org> Date: Tue, 02 Nov 2010 11:05:41 -0400 Subject: [PATCH] Added a new tool to force DNS Resyncs. --- interface/lib/classes/tform.inc.php | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php index 8a56e1f..b9a417c 100644 --- a/interface/lib/classes/tform.inc.php +++ b/interface/lib/classes/tform.inc.php @@ -40,7 +40,7 @@ * - DOUBLE * - CURRENCY (Formats digits in currency notation) * - VARCHAR (No format check) -* - DATE (Date format, converts from and to linux timestamps automatically) +* - DATE (Date format, converts from and to UNIX timestamps automatically) * * Formtype: * - TEXT (Normal text field) @@ -379,6 +379,8 @@ if(is_array($field['value'])) { foreach($field['value'] as $k => $v) { $selected = ($k == $val)?' SELECTED':''; + if(!empty($this->wordbook[$v])) + $v = $this->wordbook[$v]; $out .= "<option value='$k'$selected>$v</option>\r\n"; } } @@ -492,6 +494,8 @@ $out = ''; foreach($field['value'] as $k => $v) { $selected = ($k == $field["default"])?' SELECTED':''; + if(!empty($this->wordbook[$v])) + $v = $this->wordbook[$v]; $out .= "<option value='$k'$selected>$v</option>\r\n"; } } @@ -620,8 +624,9 @@ break; case 'DATE': if($record[$key] != '' && $record[$key] != '0000-00-00') { - list($tag,$monat,$jahr) = explode('.',$record[$key]); - $new_record[$key] = $jahr.'-'.$monat.'-'.$tag; + $date_parts = date_parse_from_format($this->dateformat,$record[$key]); + //list($tag,$monat,$jahr) = explode('.',$record[$key]); + $new_record[$key] = $date_parts['year'].'-'.$date_parts['month'].'-'.$date_parts['day']; //$tmp = strptime($record[$key],$this->dateformat); //$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday']; } else { @@ -733,7 +738,7 @@ } break; case 'ISEMAIL': - if(!preg_match("/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z]{2,10}$/i", $field_value)) { + if(!preg_match("/^\w+[\w\.\-\+]*\w{0,}@\w+[\w.-]*\w+\.[a-z\-]{2,10}$/i", $field_value)) { $errmsg = $validator['errmsg']; if(isset($this->wordbook[$errmsg])) { $this->errorMessage .= $this->wordbook[$errmsg]."<br />\r\n"; @@ -1421,4 +1426,4 @@ } } -?> \ No newline at end of file +?> -- Gitblit v1.9.1