Merge pull request #9647 from frederic34/patch-17

indentation fix in commonobject class
This commit is contained in:
Laurent Destailleur 2018-10-01 01:20:17 +02:00 committed by GitHub
commit 77dad1b32b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -976,7 +976,7 @@ abstract class CommonObject
* @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user) * @param string $source Source of contact: external or thirdparty (llx_socpeople) or internal (llx_user)
* @param int $list 0:Return array contains all properties, 1:Return array contains just id * @param int $list 0:Return array contains all properties, 1:Return array contains just id
* @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...)
* @return array Array of contacts * @return array|int Array of contacts, -1 if error
*/ */
function liste_contact($statut=-1,$source='external',$list=0,$code='') function liste_contact($statut=-1,$source='external',$list=0,$code='')
{ {
@ -5271,37 +5271,34 @@ abstract class CommonObject
$val=$this->fields[$key]; $val=$this->fields[$key];
$out=''; $out='';
$type=''; $type='';
$param['options']=array(); $param = array();
$size =$this->fields[$key]['size']; $param['options']=array();
// Because we work on extrafields $size =$this->fields[$key]['size'];
if(preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)){ // Because we work on extrafields
$param['options']=array($reg[1].':'.$reg[2]=>'N'); if(preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)){
$type ='link'; $param['options']=array($reg[1].':'.$reg[2]=>'N');
}else if(preg_match('/^link:(.*):(.*)/i', $val['type'], $reg)){ $type ='link';
$param['options']=array($reg[1].':'.$reg[2]=>'N'); } elseif(preg_match('/^link:(.*):(.*)/i', $val['type'], $reg)) {
$type ='link'; $param['options']=array($reg[1].':'.$reg[2]=>'N');
}else if(preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)){ $type ='link';
} elseif(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)){ } elseif(preg_match('/varchar\((\d+)\)/', $val['type'],$reg)) {
$param['options']=array();
$param['options']=array(); $type ='varchar';
$type ='varchar'; $size=$reg[1];
$size=$reg[1]; } elseif(preg_match('/varchar/', $val['type'])) {
}else if(preg_match('/varchar/', $val['type'])){ $param['options']=array();
$type ='varchar';
$param['options']=array(); } elseif(is_array($this->fields[$key]['arrayofkeyval'])) {
$type ='varchar'; $param['options']=$this->fields[$key]['arrayofkeyval'];
}else if(is_array($this->fields[$key]['arrayofkeyval'])){ $type ='select';
} else {
$param['options']=$this->fields[$key]['arrayofkeyval']; $param['options']=array();
$type ='select'; $type =$this->fields[$key]['type'];
}else { }
$param['options']=array();
$type =$this->fields[$key]['type'];
}
$label=$this->fields[$key]['label']; $label=$this->fields[$key]['label'];
//$elementtype=$this->fields[$key]['elementtype']; // Seems not used //$elementtype=$this->fields[$key]['elementtype']; // Seems not used