diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index bef2915a976..1120ef57d1c 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -123,10 +123,9 @@ $var=!$var;
print "
| => price(1234.56) | '.price(1234.56)." | ";
//print '
| '.$langs->trans("TimeZone").' | '.$langs->trans("Value").' |
'."\n";
// Timezone
+// PHP server
$var=!$var;
-print "| ".$langs->trans("ClientTZ")." | ".$langs->trans("FeatureNotYetAvailable")." |
\n";
-$var=!$var;
-print "| ".$langs->trans("ServerTZ")." (variable system TZ) | ".$_ENV["TZ"]." |
\n";
+print "| ".$langs->trans("OSTZ")." (variable system TZ) | ".$_ENV["TZ"]." |
\n";
$var=!$var;
print "| ".$langs->trans("PHPTZ")." (php.ini date.timezone) | ".ini_get("date.timezone")." |
\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
if (function_exists('date_default_timezone_get'))
@@ -139,9 +138,21 @@ if (function_exists('date_default_timezone_get'))
$var=!$var;
print "| => ".$langs->trans("PHPServerOffsetWithGreenwich")." | ".(- dol_mktime(0,0,0,1,1,1970))." |
\n";
$var=!$var;
-print "| => ".$langs->trans("CurrentHour")." | ".dol_print_date(time(),'dayhour')." |
\n";
+print "| => ".$langs->trans("CurrentHour")." | ".dol_print_date(dol_now('tzserver'),'dayhour')." |
\n";
$var=!$var;
print "| => dol_print_date(0,"dayhourtext") | '.dol_print_date(0,"dayhourtext")." | ";
+# Parent company
+$var=!$var;
+print "
| ".$langs->trans("CompanyTZ")." | ".$langs->trans("FeatureNotYetAvailable")." |
\n";
+$var=!$var;
+#print "| => ".$langs->trans("CompanyHour")." | ".dol_print_date(dol_now('tzuser'),'dayhour')." |
\n";
+print "| => ".$langs->trans("CompanyHour")." | ".$langs->trans("FeatureNotYetAvailable")." |
\n";
+# Client
+$var=!$var;
+print "| ".$langs->trans("ClientTZ")." | ".$langs->trans("FeatureNotYetAvailable")." |
\n";
+$var=!$var;
+#print "| => ".$langs->trans("ClientHour")." | ".dol_print_date(dol_now('tzuser'),'dayhour')." |
\n";
+print "| => ".$langs->trans("ClientHour")." | ".$langs->trans("FeatureNotYetAvailable")." |
\n";
print '';
print '
';
diff --git a/htdocs/cashdesk/deconnexion.php b/htdocs/cashdesk/deconnexion.php
index 911bb886238..471ffd967ff 100644
--- a/htdocs/cashdesk/deconnexion.php
+++ b/htdocs/cashdesk/deconnexion.php
@@ -19,7 +19,7 @@
// Init session. Name of session is specific to Dolibarr instance.
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();
@@ -28,7 +28,7 @@ include('../master.inc.php');
// Destroy session
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_destroy();
dol_syslog("End of session ".$sessionname);
diff --git a/htdocs/cashdesk/include/environnement.php b/htdocs/cashdesk/include/environnement.php
index 62d37b7bde0..98286639e45 100644
--- a/htdocs/cashdesk/include/environnement.php
+++ b/htdocs/cashdesk/include/environnement.php
@@ -19,7 +19,7 @@
// Init session. Name of session is specific to Dolibarr instance.
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();
dol_syslog("Start session name=".$sessionname." Session id()=".session_id().", _SESSION['dol_login']=".$_SESSION["dol_login"].", ".ini_get("session.gc_maxlifetime"));
diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php
index d49a9db2842..991ae6f6f10 100644
--- a/htdocs/cashdesk/index.php
+++ b/htdocs/cashdesk/index.php
@@ -26,7 +26,7 @@
// Init session. Name of session is specific to Dolibarr instance.
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();
diff --git a/htdocs/includes/.cvsignore b/htdocs/includes/.cvsignore
index ca83ad36d65..2971ef2346d 100644
--- a/htdocs/includes/.cvsignore
+++ b/htdocs/includes/.cvsignore
@@ -1 +1,2 @@
jpgraph2
+phpsane
diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang
index 5b4fdc2855d..3196665cd94 100644
--- a/htdocs/langs/ca_ES/admin.lang
+++ b/htdocs/langs/ca_ES/admin.lang
@@ -82,7 +82,7 @@ LanguageParameter = Variable idioma %s
LanguageBrowserParameter = Variable %s
LocalisationDolibarrParameters = Paràmetres de localització
ClientTZ = Fus horari Client (usuari)
-ServerTZ = Fus horari
+OSTZ = Fus horari
PHPTZ = Fus horari PHP
PHPServerOffsetWithGreenwich = Offset amb Greenwich (segons)
CurrentHour = Hora actual
diff --git a/htdocs/langs/da_DA/admin.lang b/htdocs/langs/da_DA/admin.lang
index 14f1633c57f..b15f5f7e14a 100644
--- a/htdocs/langs/da_DA/admin.lang
+++ b/htdocs/langs/da_DA/admin.lang
@@ -90,7 +90,7 @@ LanguageParameter=Sprog parameter% s
LanguageBrowserParameter=Parameter% s
LocalisationDolibarrParameters=Lokalisering parametre
ClientTZ=Tidszone Client (bruger)
-ServerTZ=Tidszone Server OS
+OSTZ=Tidszone Server OS
PHPTZ=Tidszone Server PHP
PHPServerOffsetWithGreenwich=Offset for PHP server bredde Greenwich (secondes)
CurrentHour=Nuværende time
diff --git a/htdocs/langs/de_DE/admin.lang b/htdocs/langs/de_DE/admin.lang
index 56b4a26bf55..5bd485ce40b 100644
--- a/htdocs/langs/de_DE/admin.lang
+++ b/htdocs/langs/de_DE/admin.lang
@@ -88,7 +88,7 @@ LanguageParameter=Sprache Parameter% s
LanguageBrowserParameter=Parameter% s
LocalisationDolibarrParameters=Localisation Parameter
ClientTZ=Zeitzone Kunde (Benutzer)
-ServerTZ=Time Zone Server OS
+OSTZ=Time Zone Server OS
PHPTZ=Time Zone Server PHP
PHPServerOffsetWithGreenwich=Offset für PHP-Server Breite Greenwich (secondes)
CurrentHour=Aktuelle Stunde
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index acaccd5a6c3..afb70d4ee98 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -42,7 +42,7 @@ UsePopupCalendar=Use popup for dates input
UsePreviewTabs=Use preview tabs
ShowPreview=Show preview
ThemeCurrentlyActive=Theme currently active
-CurrentTimeZone=Current TimeZone
+CurrentTimeZone=PHP server TimeZone
Space=Space
Fields=Fields
Mask=Mask
@@ -81,11 +81,14 @@ ParameterInDolibarr=Parameter %s
LanguageParameter=Language parameter %s
LanguageBrowserParameter=Parameter %s
LocalisationDolibarrParameters=Localisation parameters
-ClientTZ=Time Zone Client (user)
-ServerTZ=Time Zone Server OS
-PHPTZ=Time Zone Server PHP
-PHPServerOffsetWithGreenwich=Offset for PHP server width Greenwich (secondes)
-CurrentHour=Current hour
+ClientTZ=Time Zone client (user)
+ClientHour=Hour client (user)
+OSTZ=Time Zone OS server
+PHPTZ=Time Zone PHP server
+PHPServerOffsetWithGreenwich=PHP server offset width Greenwich (seconds)
+CurrentHour=PHP server hour
+CompanyTZ = Time Zone company (main company)
+CompanyHour = Hour company (main company)
CurrentSessionTimeOut=Current session timeout
OSEnv=OS Environment
Box=Box
diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang
index cfed55d0061..9d997cdbe92 100644
--- a/htdocs/langs/es_ES/admin.lang
+++ b/htdocs/langs/es_ES/admin.lang
@@ -82,7 +82,7 @@ LanguageParameter = Variable idioma %s
LanguageBrowserParameter = Variable %s
LocalisationDolibarrParameters = Parámetros de localización
ClientTZ = Zona horaria Cliente (usuario)
-ServerTZ = Zona horaria
+OSTZ = Zona horaria
PHPTZ = Zona horaria PHP
PHPServerOffsetWithGreenwich = Offset con Greenwich (segundos)
CurrentHour = Hora actual
diff --git a/htdocs/langs/fi_FI/admin.lang b/htdocs/langs/fi_FI/admin.lang
index db5304ab22a..f4d0c68543f 100644
--- a/htdocs/langs/fi_FI/admin.lang
+++ b/htdocs/langs/fi_FI/admin.lang
@@ -88,7 +88,7 @@ LanguageParameter=Kieli parametri% s
LanguageBrowserParameter=Parametri% s
LocalisationDolibarrParameters=Lokalisointi parametrit
ClientTZ=Aikavyöhyke Client (user)
-ServerTZ=Aikavyöhyke Server OS
+OSTZ=Aikavyöhyke Server OS
PHPTZ=Aikavyöhyke Server PHP
PHPServerOffsetWithGreenwich=Offset for PHP-palvelimen leveys Greenwich (sekunnin)
CurrentHour=Nykyinen tunti
diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang
index e72171031d5..a7ed0783109 100644
--- a/htdocs/langs/fr_FR/admin.lang
+++ b/htdocs/langs/fr_FR/admin.lang
@@ -42,7 +42,7 @@ UsePopupCalendar = Utiliser les popups pour la saisie des dates
UsePreviewTabs = Afficher les onglets "Aperçu"
ShowPreview = Afficher aperçu
ThemeCurrentlyActive = Theme actuellement actif
-CurrentTimeZone = Time Zone courant
+CurrentTimeZone = Time Zone serveur PHP
Space = Espace
Fields = Champs
Mask = Masque
@@ -81,11 +81,14 @@ ParameterInDolibarr = Variable %s
LanguageParameter = Variable langue %s
LanguageBrowserParameter = Variable %s
LocalisationDolibarrParameters = Paramètres de localisation
-ClientTZ = Time Zone Client (utilisateur)
-ServerTZ = Time Zone Serveur OS
-PHPTZ = Time Zone Serveur PHP
+ClientTZ = Time Zone client (utilisateur)
+ClientHour = Heure client (utilisateur)
+OSTZ = Time Zone OS
+PHPTZ = Time Zone config PHP
PHPServerOffsetWithGreenwich = Offset serveur PHP avec Greenwich (secondes)
-CurrentHour = Heure courante
+CurrentHour = Heure serveur PHP
+CompanyTZ = Time Zone société (maison mère)
+CompanyHour = Heure société (maison mère)
CurrentSessionTimeOut = Time out session courante
OSEnv = Environnement OS
Box = Boîte
diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang
index 85b361e9585..7dd3216bb37 100644
--- a/htdocs/langs/fr_FR/main.lang
+++ b/htdocs/langs/fr_FR/main.lang
@@ -2,6 +2,14 @@
CHARSET=UTF-8
SeparatorDecimal=,
SeparatorThousand=
+FormatDateShort=%d/%m/%Y # Format of day with PHP/C tags (strftime functions)
+FormatDateShort_java=dd/MM/yyyy # Format of day with Java tags
+FormatHourShort=%H:%M
+FormatDateTextShort=%d %b %Y
+FormatDateText=%d %B %Y
+FormatDateHourShort=%d/%m/%Y %H:%M
+FormatDateHourTextShort=%d %b %Y %H:%M
+FormatDateHourText=%d %B %Y %H:%M
DatabaseConnection=Connexion à la base
Error=Erreur
ErrorFieldRequired=Le champ '%s' est obligatoire
diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang
index caad037b31a..255ba4ddfc7 100644
--- a/htdocs/langs/it_IT/admin.lang
+++ b/htdocs/langs/it_IT/admin.lang
@@ -72,7 +72,7 @@ LanguageParameter =Lingua parametro %s
LanguageBrowserParameter =Parametro %s
LocalisationDolibarrParameters =Parametri di localizzazione
ClientTZ =Fuso orario client (user)
-ServerTZ =Fuso orario server OS
+OSTZ =Fuso orario server OS
PHPTZ =Fuso orario server PHP
PHPServerOffsetWithGreenwich =Offset per PHP server larghezza di Greenwich (secondi)
CurrentHour =Ora corrente
diff --git a/htdocs/langs/nb_NO/admin.lang b/htdocs/langs/nb_NO/admin.lang
index 3f14d039efb..899dc079ff3 100644
--- a/htdocs/langs/nb_NO/admin.lang
+++ b/htdocs/langs/nb_NO/admin.lang
@@ -79,7 +79,7 @@ LanguageParameter=Språkparameter %s
LanguageBrowserParameter=Parameter %s
LocalisationDolibarrParameters=Språkparametere for Dolibarr
ClientTZ=Tidssone klient (bruker)
-ServerTZ=Tidssone server OS
+OSTZ=Tidssone server OS
PHPTZ=Tidssone PHP
PHPServerOffsetWithGreenwich=Forskyvning for PHP-server mot Greenwich (sekunder)
CurrentHour=Gjeldende tid
diff --git a/htdocs/langs/nl_BE/admin.lang b/htdocs/langs/nl_BE/admin.lang
index d8940e28342..2a863f4b108 100644
--- a/htdocs/langs/nl_BE/admin.lang
+++ b/htdocs/langs/nl_BE/admin.lang
@@ -103,7 +103,7 @@ LanguageParameter=Taal parameter %s
LanguageBrowserParameter=Parameter %s
LocalisationDolibarrParameters=Localisatie parameters
ClientTZ=Tijdzone Client (gebruiker)
-ServerTZ=Tijdzone Server OS
+OSTZ=Tijdzone Server OS
PHPTZ=Tijdzone Server PHP
PHPServerOffsetWithGreenwich=Gecompenseerd voor PHP server breedte Greenwich (seconden)
CurrentHour=Huidig uur
diff --git a/htdocs/langs/nl_NL/admin.lang b/htdocs/langs/nl_NL/admin.lang
index c58a5f46be5..bd9e7189931 100644
--- a/htdocs/langs/nl_NL/admin.lang
+++ b/htdocs/langs/nl_NL/admin.lang
@@ -90,7 +90,7 @@ LanguageParameter=Taal parameter% s
LanguageBrowserParameter=Parameter% s
LocalisationDolibarrParameters=Localisatie parameters
ClientTZ=Tijdzone Client (gebruiker)
-ServerTZ=Tijdzone Server OS
+OSTZ=Tijdzone Server OS
PHPTZ=Tijdzone Server PHP
PHPServerOffsetWithGreenwich=Gecompenseerd voor PHP server breedte Greenwich (seconden)
CurrentHour=Huidige uur
diff --git a/htdocs/langs/pl_PL/admin.lang b/htdocs/langs/pl_PL/admin.lang
index 5297cc801e8..db6d0b4719a 100644
--- a/htdocs/langs/pl_PL/admin.lang
+++ b/htdocs/langs/pl_PL/admin.lang
@@ -90,7 +90,7 @@ LanguageParameter=Język parametr% s
LanguageBrowserParameter=Parametr% s
LocalisationDolibarrParameters=Lokalizacja parametry
ClientTZ=Strefa czasowa klienta (użytkownika)
-ServerTZ=Strefa czasowa Server OS
+OSTZ=Strefa czasowa Server OS
PHPTZ=Strefa czasowa serwera PHP
PHPServerOffsetWithGreenwich=Offset dla PHP serwer szerokość Greenwich (secondes)
CurrentHour=Aktualna godzina
diff --git a/htdocs/langs/pt_PT/admin.lang b/htdocs/langs/pt_PT/admin.lang
index 4304d9a0816..34a37cfdb1f 100644
--- a/htdocs/langs/pt_PT/admin.lang
+++ b/htdocs/langs/pt_PT/admin.lang
@@ -78,7 +78,7 @@ LanguageParameter=Variável idioma %s
LanguageBrowserParameter=Variável %s
LocalisationDolibarrParameters=parâmetros de localização
ClientTZ=Zona horaria Cliente (Utilizador)
-ServerTZ=Zona horaria
+OSTZ=Zona horaria
PHPTZ=Zona horaria PHP
PHPServerOffsetWithGreenwich=Offset con Greenwich (segundos)
CurrentHour=Hora actual
diff --git a/htdocs/langs/ro_RO/admin.lang b/htdocs/langs/ro_RO/admin.lang
index b6bb4c882f3..11cde7c8e40 100644
--- a/htdocs/langs/ro_RO/admin.lang
+++ b/htdocs/langs/ro_RO/admin.lang
@@ -88,7 +88,7 @@ LanguageParameter=Limba parametrul% s
LanguageBrowserParameter=Parametru% s
LocalisationDolibarrParameters=Localizare parametrii
ClientTZ=Time Zone de clienţi (utilizatori)
-ServerTZ=Time Zone Server OS
+OSTZ=Time Zone Server OS
PHPTZ=Time Zone Server PHP
PHPServerOffsetWithGreenwich=Offset pentru PHP server de latime Greenwich (secondes)
CurrentHour=Current oră
diff --git a/htdocs/langs/ru_RU/admin.lang b/htdocs/langs/ru_RU/admin.lang
index f0ce12b443f..6e560fc5bc2 100644
--- a/htdocs/langs/ru_RU/admin.lang
+++ b/htdocs/langs/ru_RU/admin.lang
@@ -88,7 +88,7 @@ LanguageParameter=Язык параметр% S
LanguageBrowserParameter=Параметр% S
LocalisationDolibarrParameters=Локализация параметры
ClientTZ=Часовой пояс клиент (пользователь)
-ServerTZ=Часовой пояс Server OS
+OSTZ=Часовой пояс Server OS
PHPTZ=Часовой пояс сервера PHP
PHPServerOffsetWithGreenwich=Сдвиг по PHP сервера ширина Гринвич (secondes)
CurrentHour=Текущий час
diff --git a/htdocs/lib/antispamimage.php b/htdocs/lib/antispamimage.php
index b145e47491d..eff8e248fe9 100644
--- a/htdocs/lib/antispamimage.php
+++ b/htdocs/lib/antispamimage.php
@@ -34,7 +34,7 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
// Init session. Name of session is specific to Dolibarr instance.
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index 8715d3d5e3b..9a90ea61f18 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -38,19 +38,24 @@ if (! defined('ADODB_DATE_VERSION')) include_once(DOL_DOCUMENT_ROOT."/includes/a
/**
* \brief Return date for now
* \param mode 'gmt' => we return GMT timestamp,
- * 'tzref' => we use the company timezone
+ * 'tzserver' => we use the PHP server timezone
+ * 'tzref' => we use the company timezone
* 'tzuser' => we use the user timezone
* \return date Timestamp
*/
-function dol_now($mode='tzref')
+function dol_now($mode='tzserver')
{
- if ($mode == 'gmt') $ret=gmmktime();
- else if ($mode == 'tzref')
+ if ($mode == 'gmt') $ret=gmmktime(); // Time for now at greenwich.
+ else if ($mode == 'tzserver') // Time for now where PHP server is located
+ {
+ $ret=mktime();
+ }
+ else if ($mode == 'tzref') // Time for now where the parent company is located
{
// TODO Should use the timezone of the company instead of timezone of server
$ret=mktime();
}
- else if ($mode == 'tzuser')
+ else if ($mode == 'tzuser') // Time for now where the user is located
{
// TODO Should use the timezone of the user instead of timezone of server
$ret=mktime();
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index bac590168b1..c22129f78ba 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -122,7 +122,7 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
// Init session. Name of session is specific to Dolibarr instance.
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();
diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php
index e48ceefcf6c..6e285669582 100644
--- a/htdocs/public/paybox/newpayment.php
+++ b/htdocs/public/paybox/newpayment.php
@@ -29,7 +29,7 @@
// Init session. Name of session is specific to Dolibarr instance.
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();
diff --git a/htdocs/translate.class.php b/htdocs/translate.class.php
index eaee61424c9..e410a7ec107 100644
--- a/htdocs/translate.class.php
+++ b/htdocs/translate.class.php
@@ -239,7 +239,6 @@ class Translate {
$tab=split('=',$ligne,2);
$key=trim($tab[0]);
//print "Domain=$domain, found a string for $tab[0] with value $tab[1]
";
- //if (! $this->getTransFromTab($key))
if (empty($this->tab_translate[$key]) && isset($tab[1]))
{
$value=trim(ereg_replace('\\\n',"\n",$tab[1]));
@@ -289,16 +288,17 @@ class Translate {
}
// Format for date
- /* TODO If lang file is main, we modify the format constants
- $this->format_date_short="%d/%m/%Y"; # Format of day with PHP/C tags (strftime functions)
- $this->format_date_short_java="dd/MM/yyyy"; # Format of day with Java tags
- $this->format_hour_short="%H:%M";
- $this->format_date_text_short="%d %b %Y";
- $this->format_date_text="%d %B %Y";
- $this->format_date_hour_short="%d/%m/%Y %H:%M";
- $this->format_date_hour_text_short="%d %b %Y %H:%M";
- $this->format_date_hour_text="%d %B %Y %H:%M";
- */
+ if ($domain == 'main')
+ {
+ $this->format_date_short=empty($this->tab_translate['FormatDateShort'])?"%d/%m/%Y":$this->tab_translate['FormatDateShort']; # Format of day with PHP/C tags (strftime functions)
+ $this->format_date_short_java=empty($this->tab_translate['FormatDateShort'])?"dd/MM/yyyy":$this->tab_translate['FormatDateShort']; # Format of day with Java tags
+ $this->format_hour_short=empty($this->tab_translate['FormatHourShort'])?"%H:%M":$this->tab_translate['FormatHourShort'];
+ $this->format_date_text_short=empty($this->tab_translate['FormatDateTextShort'])?"%d %b %Y":$this->tab_translate['FormatDateTextShort'];
+ $this->format_date_text=empty($this->tab_translate['FormatDateText'])?"%d %B %Y":$this->tab_translate['FormatDateText'];
+ $this->format_date_hour_short=empty($this->tab_translate['FormatDateHourShort'])?"%d/%m/%Y %H:%M":$this->tab_translate['FormatDateHourShort'];
+ $this->format_date_hour_text_short=empty($this->tab_translate['FormatDateHourTextShort'])?"%d %b %Y %H:%M":$this->tab_translate['FormatDateHourTextShort'];
+ $this->format_date_hour_text=empty($this->tab_translate['FormatDateHourText'])?"%d %B %Y %H:%M":$this->tab_translate['FormatDateHourText'];
+ }
if (empty($this->tab_loaded[$domain])) $this->tab_loaded[$domain]=2; // Marque ce fichier comme non trouve
diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php
index eb65b0cf900..cef76d3332d 100644
--- a/htdocs/user/logout.php
+++ b/htdocs/user/logout.php
@@ -50,7 +50,7 @@ session_unregister("dol_entity");
// Destroy session
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_destroy();
dol_syslog("End of session ".$sessionname);
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 76a04488c5e..c8725c4d248 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -28,7 +28,7 @@ set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
// Init session. Name of session is specific to Dolibarr instance.
$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$sessiontimeout);
+if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]);
session_name($sessionname);
session_start();