From d8f64480ebb604d2c7a7f777a5495e136ec17ed4 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Mon, 07 Mar 2011 12:12:42 -0500
Subject: [PATCH] Fixed: FS#1540 - Reassign users (ftp, database, shell) from one client to another client

---
 interface/lib/classes/tform.inc.php |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/interface/lib/classes/tform.inc.php b/interface/lib/classes/tform.inc.php
index e927b38..dfe75ad 100644
--- a/interface/lib/classes/tform.inc.php
+++ b/interface/lib/classes/tform.inc.php
@@ -624,11 +624,18 @@
                                 break;
 								case 'DATE':
                                         if($record[$key] != '' && $record[$key] != '0000-00-00') {
-												$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'];
+												if(function_exists('date_parse_from_format')) {
+													$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 {
+													//$tmp = strptime($record[$key],$this->dateformat);
+													//$new_record[$key] = ($tmp['tm_year']+1900).'-'.($tmp['tm_mon']+1).'-'.$tmp['tm_mday'];
+													$tmp = strtotime($record[$key]);
+													$new_record[$key] = date('Y-m-d',$tmp);
+												}
                                         } else {
 											$new_record[$key] = '0000-00-00';
 										}

--
Gitblit v1.9.1