diff --git a/ChangeLog b/ChangeLog index 6143188192f..1ad59dc6c22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,11 +7,15 @@ For users: - New: Upgrade process works with Postgresql. - New: Task #10538: Add filter on expiration date of subscription for foundation module email selector. +- New: Can input payment conditions on several lines. +- New: Add hidden option MAIN_LOGOUT_GOTO_URL to set the exit url after + a logout. - Fix: Better Postgresql compatibility. - Fix: Box order is saved when moved. +- Fix: Database name can contains "-" characters. For developers: -- New: Add jquery by default +- New: Add jquery by default. - New: Add first Selenium GUI tests. - Qual: Renamed some fields into database to be more internationnal. diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 1e6bcfffeb7..67b20a368ea 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -266,10 +266,16 @@ if ($_POST["actionadd"] || $_POST["actionmodify"]) { if (in_array('region_id',$listfield)) { continue; } // For region page, we do not require the country input } - if (! isset($_POST[$value]) || $_POST[$value]=='') + if ((! isset($_POST[$value]) || $_POST[$value]=='') + && $listfield[$f] != 'decalage') // Fields that are not mandatory { $ok=0; - $msg.=$langs->trans("ErrorFieldRequired",$listfield[$f]).'
'; + $fieldnamekey=$listfield[$f]; + // We take translate key of field + if ($fieldnamekey == 'libelle') $fieldnamekey='Label'; + if ($fieldnamekey == 'nbjour') $fieldnamekey='NbOfDays'; + if ($fieldnamekey == 'decalage') $fieldnamekey='Offset'; + $msg.=$langs->trans("ErrorFieldRequired",$langs->transnoentities($fieldnamekey)).'
'; } } // Autres verif @@ -317,7 +323,8 @@ if ($_POST["actionadd"] || $_POST["actionmodify"]) { if ($value == 'price') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } if ($i) $sql.=","; - $sql.="'".addslashes($_POST[$listfieldvalue[$i]])."'"; + if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; + else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; $i++; } $sql.=",1)"; @@ -361,7 +368,8 @@ if ($_POST["actionadd"] || $_POST["actionmodify"]) if ($field == 'price') { $_POST[$listfieldvalue[$i]] = price2num($_POST[$listfieldvalue[$i]],'MU'); } if ($i) $sql.=","; $sql.= $field."="; - $sql.= "'".addslashes($_POST[$listfieldvalue[$i]])."'"; + if ($_POST[$listfieldvalue[$i]] == '') $sql.="null"; + else $sql.="'".$db->escape($_POST[$listfieldvalue[$i]])."'"; $i++; } $sql.= " WHERE ".$rowidcol." = '".$_POST["rowid"]."'"; @@ -641,7 +649,7 @@ if ($_GET["id"]) print ' '; print ''; - // Lignes de valeurs + // Lines with values while ($i < $num) { $obj = $db->fetch_object($resql); @@ -687,6 +695,9 @@ if ($_GET["id"]) else if ($fieldlist[$field]=='price') { $valuetoshow=price($valuetoshow); } + else if ($fieldlist[$field]=='libelle_facture') { + $valuetoshow=nl2br($valuetoshow); + } else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]=='llx_c_pays') { $key=$langs->trans("Country".strtoupper($obj->code)); $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code))?$key:$obj->$fieldlist[$field]; @@ -882,6 +893,9 @@ function fieldList($fieldlist,$obj='') elseif ($fieldlist[$field] == 'nbjour' || $fieldlist[$field] == 'decalage' || $fieldlist[$field] == 'taux') { print ''; } + elseif ($fieldlist[$field] == 'libelle_facture') { + print ''; + } elseif ($fieldlist[$field] == 'price') { print ''; }