From d01b23c364f1094e674c555164261699bf11fa2b Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 22 Feb 2011 09:34:29 -0500
Subject: [PATCH] - Fixed a link problem with client list. - Fixed Date parsing function when PHP version < 5.3 - Added missing / in language file loading function.

---
 interface/web/client/client_edit.php |    1 +
 interface/lib/classes/tform.inc.php  |   17 ++++++++++++-----
 interface/lib/app.inc.php            |    2 +-
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php
index 7a0e31c..4de9904 100644
--- a/interface/lib/app.inc.php
+++ b/interface/lib/app.inc.php
@@ -163,7 +163,7 @@
 			//* Load module wordbook, if it exists
 			if(isset($_SESSION['s']['module']['name']) && isset($_SESSION['s']['language'])) {
 				$lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$_SESSION['s']['language'].'.lng';
-				if(!file_exists(ISPC_ROOT_PATH.$lng_file)) $lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng';
+				if(!file_exists(ISPC_ROOT_PATH.'/'.$lng_file)) $lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng';
 				$this->load_language_file($lng_file);
 			}
 			$this->_language_inc = 1;
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';
 										}
diff --git a/interface/web/client/client_edit.php b/interface/web/client/client_edit.php
index 0cee48a..5878794 100644
--- a/interface/web/client/client_edit.php
+++ b/interface/web/client/client_edit.php
@@ -124,6 +124,7 @@
 		}
 
 		$app->tpl->setVar('template_additional_list', $text);
+		$app->tpl->setVar('app_module','client');
 
 		parent::onShowEnd();
 

--
Gitblit v1.9.1