Fix scrutinizer

This commit is contained in:
Laurent Destailleur 2017-10-27 00:07:58 +02:00
parent 90bd9f2f4f
commit 9283aaf6aa
5 changed files with 15 additions and 5 deletions

View File

@ -610,6 +610,7 @@ class Commande extends CommonOrder
return -1; return -1;
} }
} }
return 0;
} }
/** /**

View File

@ -40,7 +40,7 @@ class Contracts extends DolibarrApi
); );
/** /**
* @var Contract $contract {@type Contrat} * @var Contrat $contract {@type Contrat}
*/ */
public $contract; public $contract;
@ -156,6 +156,7 @@ class Contracts extends DolibarrApi
{ {
$num = $db->num_rows($result); $num = $db->num_rows($result);
$min = min($num, ($limit <= 0 ? $num : $limit)); $min = min($num, ($limit <= 0 ? $num : $limit));
$i=0;
while ($i < $min) while ($i < $min)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);

View File

@ -101,7 +101,7 @@ abstract class CommonObject
// Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them. // Following vars are used by some objects only. We keep this property here in CommonObject to be able to provide common method using them.
/** /**
* @var string[] Can be used to pass information when only object is provided to method * @var array<string,mixed> Can be used to pass information when only object is provided to method
*/ */
public $context=array(); public $context=array();

View File

@ -974,6 +974,7 @@ class ExtraFields
{ {
$param_list=array_keys($param['options']); $param_list=array_keys($param['options']);
$InfoFieldList = explode(":", $param_list[0]); $InfoFieldList = explode(":", $param_list[0]);
$parentName='';
// 0 : tableName // 0 : tableName
// 1 : label field name // 1 : label field name
// 2 : key fields name (if differ of rowid) // 2 : key fields name (if differ of rowid)
@ -1058,8 +1059,9 @@ class ExtraFields
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
// Several field into label (eq table:code|libelle:rowid) // Several field into label (eq table:code|libelle:rowid)
$notrans = false;
$fields_label = explode('|',$InfoFieldList[1]); $fields_label = explode('|',$InfoFieldList[1]);
if(is_array($fields_label)) if (is_array($fields_label))
{ {
$notrans = true; $notrans = true;
foreach ($fields_label as $field_toshow) foreach ($fields_label as $field_toshow)
@ -1073,7 +1075,7 @@ class ExtraFields
} }
$labeltoshow=dol_trunc($labeltoshow,45); $labeltoshow=dol_trunc($labeltoshow,45);
if ($value==$obj->rowid) if ($value == $obj->rowid)
{ {
foreach ($fields_label as $field_toshow) foreach ($fields_label as $field_toshow)
{ {
@ -1088,7 +1090,7 @@ class ExtraFields
} }
else else
{ {
if(!$notrans) if (! $notrans)
{ {
$translabel=$langs->trans($obj->{$InfoFieldList[1]}); $translabel=$langs->trans($obj->{$InfoFieldList[1]});
if ($translabel!=$obj->{$InfoFieldList[1]}) { if ($translabel!=$obj->{$InfoFieldList[1]}) {

View File

@ -4751,6 +4751,12 @@ class Form
$smin = dol_print_date($set_time, "%M"); $smin = dol_print_date($set_time, "%M");
$ssec = dol_print_date($set_time, "%S"); $ssec = dol_print_date($set_time, "%S");
} }
else
{
$shour = '';
$smin = '';
$ssec = '';
}
} }
else else
{ {