From e11f5dde0d79d82386f60aad5cdee6e77c52f79c Mon Sep 17 00:00:00 2001 From: redray <redray@ispconfig3> Date: Wed, 11 Feb 2009 05:41:31 -0500 Subject: [PATCH] improved displaying of dates. --- interface/lib/lang/fr.lng | 6 +++ interface/lib/lang/nl.lng | 6 +++ interface/lib/lang/bg.lng | 6 +++ interface/lib/lang/se.lng | 6 +++ interface/lib/lang/ru.lng | 6 +++ interface/web/monitor/list/log.list.php | 2 interface/lib/lang/en.lng | 6 +++ interface/lib/lang/de.lng | 6 +++ interface/lib/lang/es.lng | 6 +++ interface/web/monitor/list/datalog.list.php | 2 interface/lib/lang/it.lng | 6 +++ interface/lib/classes/listform.inc.php | 30 +++++++++++++-- interface/lib/lang/fi.lng | 6 +++ 13 files changed, 88 insertions(+), 6 deletions(-) diff --git a/interface/lib/classes/listform.inc.php b/interface/lib/classes/listform.inc.php index a3946eb..41b93d4 100644 --- a/interface/lib/classes/listform.inc.php +++ b/interface/lib/classes/listform.inc.php @@ -38,7 +38,6 @@ private $pagingValues; private $searchChanged = 0; private $module; - private $dateformat = 'Y-m-d H:i'; public $wordbook; public function loadListDef($file, $module = '') @@ -280,7 +279,25 @@ break; case 'DATE': - $record[$key] = ($record[$key] > 0) ? date($this->dateformat,$record[$key]) : ''; + if ($record[$key] > 0) { + // is value int? + if (ereg("^[0-9]+[.]?[0-9]*$", $record[$key], $p)) { + $record[$key] = date($this->lng('conf_format_dateshort'), $record[$key]); + } else { + $record[$key] = date($this->lng('conf_format_dateshort'), strtotime($record[$key])); + } + } + break; + + case 'DATETIME': + if ($record[$key] > 0) { + // is value int? + if (ereg("^[0-9]+[.]?[0-9]*$", $record[$key], $p)) { + $record[$key] = date($this->lng('conf_format_datetime'), $record[$key]); + } else { + $record[$key] = date($this->lng('conf_format_datetime'), strtotime($record[$key])); + } + } break; case 'INTEGER': @@ -322,8 +339,13 @@ case 'DATE': if($record[$key] > 0) { - list($tag,$monat,$jahr) = explode('.',$record[$key]); - $record[$key] = mktime(0,0,0,$monat,$tag,$jahr); + $record[$key] = date('Y-m-d',strtotime($record[$key])); + } + break; + + case 'DATETIME': + if($record[$key] > 0) { + $record[$key] = date('Y-m-d H:i:s',strtotime($record[$key])); } break; diff --git a/interface/lib/lang/bg.lng b/interface/lib/lang/bg.lng index 1c37304..1d3f890 100644 --- a/interface/lib/lang/bg.lng +++ b/interface/lib/lang/bg.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Този модул не е разрешен за текущия потреител.'; $wb['302'] = 'Невалиден модул.'; $wb['1001'] = 'Потребителското име и паролата не могат да бъдат празни!'; diff --git a/interface/lib/lang/de.lng b/interface/lib/lang/de.lng index c5326e8..eb87bd7 100644 --- a/interface/lib/lang/de.lng +++ b/interface/lib/lang/de.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'd.m.Y'; +$wb['conf_format_datelong'] = 'l, d. F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'd.m.Y H:i'; + $wb['301'] = 'Modul für Benutzer nicht erlaubt.'; $wb['302'] = 'Modul ungültig.'; $wb['1001'] = 'Der Benutzername und das Passwort dürfen nicht leer sein!'; diff --git a/interface/lib/lang/en.lng b/interface/lib/lang/en.lng index e5b01c8..c94811e 100644 --- a/interface/lib/lang/en.lng +++ b/interface/lib/lang/en.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Module not permitted for the current user.'; $wb['302'] = 'Module invalid.'; $wb['1001'] = 'The username and password cannot be empty !'; diff --git a/interface/lib/lang/es.lng b/interface/lib/lang/es.lng index 24737fd..0467f68 100644 --- a/interface/lib/lang/es.lng +++ b/interface/lib/lang/es.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Modulo no permitido para el usuario actual.'; $wb['302'] = 'Modulo inválido.'; $wb['1001'] = '¡ El usuario y contraseña no pueden estar vacíos !'; diff --git a/interface/lib/lang/fi.lng b/interface/lib/lang/fi.lng index 969c373..ecab1d0 100755 --- a/interface/lib/lang/fi.lng +++ b/interface/lib/lang/fi.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Tämä moduuli ei ole sallittu nykyiselle käyttäjälle.'; $wb['302'] = 'Viallinen moduuli.'; $wb['1001'] = 'Käyttäjätunnus ja/tai salasana eivät voi olla tyhjiä!'; diff --git a/interface/lib/lang/fr.lng b/interface/lib/lang/fr.lng index 43dc5de..dfac001 100644 --- a/interface/lib/lang/fr.lng +++ b/interface/lib/lang/fr.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Module interdit pour lutilisateur courant.'; $wb['302'] = 'Module invalide.'; $wb['1001'] = 'The username and password must not be empty!'; diff --git a/interface/lib/lang/it.lng b/interface/lib/lang/it.lng index 4bf4ad6..b03a176 100644 --- a/interface/lib/lang/it.lng +++ b/interface/lib/lang/it.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Modulo non permesso per l`utente corrente.'; $wb['302'] = 'Modulo non valido.'; $wb['1001'] = 'Nome utente e password non possono essere vuoti!'; diff --git a/interface/lib/lang/nl.lng b/interface/lib/lang/nl.lng index 72acdfa..e5e253f 100644 --- a/interface/lib/lang/nl.lng +++ b/interface/lib/lang/nl.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Module niet toegestaan voor de huidige gebruiker.'; $wb['302'] = 'Ongeldige module.'; $wb['1001'] = 'De gebruikersnaam en wachtwoord kunnen niet leeg zijn!'; diff --git a/interface/lib/lang/ru.lng b/interface/lib/lang/ru.lng index 41ceb5c..737b8e3 100644 --- a/interface/lib/lang/ru.lng +++ b/interface/lib/lang/ru.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Модуль недоступен для данной учетной записи.'; $wb['302'] = 'Модуль неправилен.'; $wb['1001'] = 'Имя или пароль не должны быть пустыми!'; diff --git a/interface/lib/lang/se.lng b/interface/lib/lang/se.lng index fde40e8..f37a689 100644 --- a/interface/lib/lang/se.lng +++ b/interface/lib/lang/se.lng @@ -1,4 +1,10 @@ <?php +$wb['conf_format_dateshort'] = 'Y-m-d'; +$wb['conf_format_datelong'] = 'l dS of F Y'; +$wb['conf_format_timeshort'] = 'H:i'; +$wb['conf_format_timelong'] = 'H:i:s'; +$wb['conf_format_datetime'] = 'Y-m-d H:i'; + $wb['301'] = 'Modulen �r ej till�ten f�r nuvarande anv�ndare.'; $wb['302'] = 'Modulen �r ogiltig.'; $wb['1001'] = 'Anv�ndarnamn och l�senord f�r ej vara tomma!'; diff --git a/interface/web/monitor/list/datalog.list.php b/interface/web/monitor/list/datalog.list.php index 5fee4dd..04dbba0 100644 --- a/interface/web/monitor/list/datalog.list.php +++ b/interface/web/monitor/list/datalog.list.php @@ -45,7 +45,7 @@ *****************************************************/ $liste["item"][] = array( 'field' => "tstamp", - 'datatype' => "DATE", + 'datatype' => "DATETIME", 'formtype' => "TEXT", 'op' => "like", 'prefix' => "", diff --git a/interface/web/monitor/list/log.list.php b/interface/web/monitor/list/log.list.php index aa3ad5d..1b2a349 100644 --- a/interface/web/monitor/list/log.list.php +++ b/interface/web/monitor/list/log.list.php @@ -44,7 +44,7 @@ *****************************************************/ $liste["item"][] = array( 'field' => "tstamp", - 'datatype' => "DATE", + 'datatype' => "DATETIME", 'formtype' => "TEXT", 'op' => "like", 'prefix' => "", -- Gitblit v1.9.1