Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2017-09-20 19:36:33 +02:00
commit 2831f90b42
2 changed files with 4 additions and 4 deletions

View File

@ -1708,7 +1708,7 @@ class ExtraFields
if (! empty($onlykey) && $key != $onlykey) continue; if (! empty($onlykey) && $key != $onlykey) continue;
$key_type = $this->attribute_type[$key]; $key_type = $this->attribute_type[$key];
if($this->attribute_required[$key] && !GETPOST("options_$key",2)) if ($this->attribute_required[$key] && empty($_POST["options_".$key])) // Check if empty without GETPOST, value can be alpha, int, array, etc...
{ {
$nofillrequired++; $nofillrequired++;
$error_field_required[] = $value; $error_field_required[] = $value;
@ -1721,7 +1721,7 @@ class ExtraFields
} }
else if (in_array($key_type,array('checkbox','chkbxlst'))) else if (in_array($key_type,array('checkbox','chkbxlst')))
{ {
$value_arr=GETPOST("options_".$key); $value_arr=GETPOST("options_".$key, 'array'); // check if an array
if (!empty($value_arr)) { if (!empty($value_arr)) {
$value_key=implode($value_arr,','); $value_key=implode($value_arr,',');
}else { }else {
@ -1740,7 +1740,7 @@ class ExtraFields
$object->array_options["options_".$key]=$value_key; $object->array_options["options_".$key]=$value_key;
} }
if($nofillrequired) { if ($nofillrequired) {
$langs->load('errors'); $langs->load('errors');
setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ',$error_field_required), null, 'errors'); setEventMessages($langs->trans('ErrorFieldsRequired').' : '.implode(', ',$error_field_required), null, 'errors');
return -1; return -1;

View File

@ -397,7 +397,7 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="1">'; print '<td colspan="1">';
$thirdpartyofproject=$projectstatic->getListContactId('thirdparty'); $thirdpartyofproject=$projectstatic->getListContactId('thirdparty');
$selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$projectstatic->societe->id; $selectedCompany = isset($_GET["newcompany"])?$_GET["newcompany"]:$projectstatic->socid;
$selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', $thirdpartyofproject, 0, '&withproject='.$withproject); $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', $thirdpartyofproject, 0, '&withproject='.$withproject);
print '</td>'; print '</td>';