diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 65979e86cb4..794b4734c1b 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -727,7 +727,7 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
$info_bits=0;
if ($tva_npr) $info_bits |= 0x01;
-
+
// Rang to use
$rang = (!empty($module->rangtouse)?$module->rangtouse:-1);
@@ -1394,10 +1394,10 @@ if ($id > 0 || ! empty($ref))
foreach($hooks->objModules as $module)
{
$lines = $propal->getLinesArray(1);
-
+
$module->getObjectList($propal);
$sublines = $propal->getLinesArray(2);
-
+
if (! empty($module->lines))
{
$propal->print_title_list();
@@ -1429,17 +1429,17 @@ if ($id > 0 || ! empty($ref))
if (! preg_match('/editline|edit_/',$_GET["action"]))
{
$var=true;
-
+
// Add free products/services
$propal->showAddFreeProductForm();
-
+
// Add predefined products/services
if ($conf->product->enabled || $conf->service->enabled)
{
$var=!$var;
$propal->showAddPredefinedProductForm();
}
-
+
// Hook of thirdparty module
if (! empty($hooks->objModules))
{
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index c898550a3cb..e610453276f 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -399,17 +399,17 @@ class Conf
$this->global->MAIN_GRAPH_LIBRARY = 'artichow';
}
- // Format for date (if not found in lang)
- $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_hour_short_duration="%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";
-
+ // Format for date (used by default when not found or searched in lang)
+ $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_hour_short_duration="%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";
+
// Limites decimales si non definie (peuvent etre egale a 0)
if (! isset($this->global->MAIN_MAX_DECIMALS_UNIT)) $this->global->MAIN_MAX_DECIMALS_UNIT=5;
if (! isset($this->global->MAIN_MAX_DECIMALS_TOT)) $this->global->MAIN_MAX_DECIMALS_TOT=2;
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index eee27a473d4..49e20349f92 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -2541,7 +2541,8 @@ class Form
//print "e".$set_time." t ".$conf->format_date_short;
if (strval($set_time) != '' && $set_time != -1)
{
- $formated_date=dol_print_date($set_time,$conf->format_date_short);
+ //$formated_date=dol_print_date($set_time,$conf->format_date_short);
+ $formated_date=dol_print_date($set_time,$langs->trans("FormatDateShort")); // FormatDateShort for dol_print_date/FormatDateShortJava that is same for javascript
}
// Calendrier popup version eldy
@@ -2550,7 +2551,7 @@ class Form
// Zone de saisie manuelle de la date
$retstring.='';
// Icone calendrier
@@ -2558,7 +2559,7 @@ class Form
{
$retstring.='';
+ $retstring.=' onClick="showDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');">'.img_object($langs->trans("SelectDate"),'calendar').'';
}
$retstring.=''."\n";
@@ -2567,7 +2568,9 @@ class Form
}
else
{
+ print "Bad value of calendar";
// Calendrier popup version defaut
+ /*
if ($langs->defaultlang != "")
{
$retstring.='';
$retstring.=' ';
$retstring.=''."\n";
$retstring.=''."\n";
@@ -2593,6 +2596,7 @@ class Form
$retstring.='
';
$retstring.='';
}
+ */
}
}
@@ -2730,7 +2734,7 @@ class Form
if ($conf->use_popup_calendar)
{
$base=DOL_URL_ROOT.'/lib/';
- $reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$conf->format_date_short_java.'\');';
+ $reset_scripts .= 'resetDP(\''.$base.'\',\''.$prefix.'\',\''.$langs->trans("FormatDateShortJava").'\',\''.$langs->defaultlang.'\');';
}
else
{
diff --git a/htdocs/lib/datepicker.php b/htdocs/lib/datepicker.php
index d51ab75028d..ae00c805f67 100644
--- a/htdocs/lib/datepicker.php
+++ b/htdocs/lib/datepicker.php
@@ -27,25 +27,26 @@
* \version $Id$
*/
-//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
-//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
+if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
+if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
-//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
+if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
require_once("../main.inc.php");
-//var_dump($langs);
-
if (! empty($_GET["lang"])) $langs->setDefaultLang($_GET["lang"]); // If language was forced on URL by the main.inc.php
$langs->load("main");
$right=($langs->direction=='rtl'?'left':'right');
$left=($langs->direction=='rtl'?'right':'left');
+//var_dump($langs->defaultlang);
+//var_dump($conf->format_date_short_java);
+//var_dump($langs->trans("FormatDateShortJava"));
// URL http://mydolibarr/lib/datepicker.php?mode=test&m=10&y=2038 can be used for tests
@@ -158,15 +159,15 @@ function displayBox($selectedDate,$month,$year){