Clean code

This commit is contained in:
Laurent Destailleur 2018-07-17 13:04:54 +02:00
parent 651ba74007
commit 508133b336

View File

@ -5122,7 +5122,7 @@ abstract class CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
$form=new Form($this->db); $form=new Form($this->db);
} }
$val=$this->fields[$key]; $val=$this->fields[$key];
$out=''; $out='';
@ -5137,20 +5137,20 @@ abstract class CommonObject
$param['options']=array($reg[1].':'.$reg[2]=>'N'); $param['options']=array($reg[1].':'.$reg[2]=>'N');
$type ='link'; $type ='link';
}else if(preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)){ }else if(preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)){
$param['options']=array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4]=>'N'); $param['options']=array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4]=>'N');
$type ='sellist'; $type ='sellist';
}else if(preg_match('/varchar\((\d+)\)/', $val['type'],$reg)){ }else if(preg_match('/varchar\((\d+)\)/', $val['type'],$reg)){
$param['options']=array(); $param['options']=array();
$type ='varchar'; $type ='varchar';
$size=$reg[1]; $size=$reg[1];
}else if(preg_match('/varchar/', $val['type'])){ }else if(preg_match('/varchar/', $val['type'])){
$param['options']=array(); $param['options']=array();
$type ='varchar'; $type ='varchar';
}else if(is_array($this->fields[$key]['arrayofkeyval'])){ }else if(is_array($this->fields[$key]['arrayofkeyval'])){
$param['options']=$this->fields[$key]['arrayofkeyval']; $param['options']=$this->fields[$key]['arrayofkeyval'];
$type ='select'; $type ='select';
}else { }else {
@ -5164,7 +5164,7 @@ abstract class CommonObject
$computed=$this->fields[$key]['computed']; $computed=$this->fields[$key]['computed'];
$unique=$this->fields[$key]['unique']; $unique=$this->fields[$key]['unique'];
$required=$this->fields[$key]['required']; $required=$this->fields[$key]['required'];
$langfile=$this->fields[$key]['langfile']; $langfile=$this->fields[$key]['langfile'];
$list=$this->fields[$key]['list']; $list=$this->fields[$key]['list'];
$hidden=abs($this->fields[$key]['visible'])!=1?1:0; $hidden=abs($this->fields[$key]['visible'])!=1?1:0;
@ -5707,7 +5707,7 @@ abstract class CommonObject
*/ */
return $out; return $out;
} }
/** /**
* Return HTML string to show a field into a page * Return HTML string to show a field into a page
* Code very similar with showOutputField of extra fields * Code very similar with showOutputField of extra fields