diff --git a/ChangeLog b/ChangeLog
index 945bf875bfd..e605a1f3cfb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,11 +19,12 @@ English Dolibarr ChangeLog
- Fix: [ bug #806 ] Margins module with orders2invoice does not respect cost price
- Fix: Orderstoinvoice didn't act as expected when no order was checked
- Fix: Bad link to all proposals into Third party card if customer is prospect
+- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #789 ] VAT not being calculated in POS
- Fix: [ bug #794 ] Lost filter on zipcode in prospect list
-- Fix: [ bug #774 ] Bug on creating event with box "all day" crossed
- Fix: [ bug #810 ] Cannot update ODT template path
- Fix: [ bug #824 ] MAIN_DB_PREFIX not use into dictionnary
+- Fix: [ bug #828 ] Error when code_region is not a number in llx_c_regions (with postgres)
***** ChangeLog for 3.3.1 compared to 3.3 *****
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 2e49d0f2859..281ae05a65b 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -383,7 +383,7 @@ if ($id == 11)
// Define localtax_typeList (used for dictionnary "c_tva")
$localtax_typeList = array();
-if (GETPOST("id") == 10)
+if ($id == 10)
{
$localtax_typeList = array(
"0" => $langs->trans("No"),
@@ -433,7 +433,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
if ($fieldnamekey == 'position') $fieldnamekey = 'Position';
if ($fieldnamekey == 'unicode') $fieldnamekey = 'Unicode';
- $msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'
';
+ $msg.=$langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)).'
';
}
}
// Other checks
@@ -441,14 +441,24 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$ok=0;
$msg.="Value 'system' and 'systemauto' for type is reserved. You can use 'user' as value to add your own record.
";
}
- if (isset($_POST["code"]) && $_POST["code"]=='0') {
- $ok=0;
- $msg.="Code can't contains value 0
";
+ if (isset($_POST["code"])
+ {
+ if ($_POST["code"]=='0')
+ {
+ $ok=0;
+ $msg.="Code can't contains value 0
";
+ }
+ if (!is_numeric($_POST['code']))
+ {
+ $ok = 0;
+ $msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'
';
+ }
}
if (isset($_POST["pays"]) && $_POST["pays"]=='0') {
$ok=0;
- $msg.=$langs->trans("ErrorFieldRequired",$langs->trans("Country")).'
';
+ $msg.=$langs->transnoentities("ErrorFieldRequired",$langs->transnoentities("Country")).'
';
}
+
// Clean some parameters
if (isset($_POST["localtax1"]) && empty($_POST["localtax1"])) $_POST["localtax1"]='0'; // If empty, we force to 0
if (isset($_POST["localtax2"]) && empty($_POST["localtax2"])) $_POST["localtax2"]='0'; // If empty, we force to 0
@@ -510,7 +520,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
else
{
if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
- $msg=$langs->trans("ErrorRecordAlreadyExists").'
';
+ $msg=$langs->transnoentities("ErrorRecordAlreadyExists").'
';
}
else {
dol_print_error($db);
@@ -580,7 +590,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') // delete
{
if ($db->errno() == 'DB_ERROR_CHILD_EXISTS')
{
- $msg='