Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
This commit is contained in:
Scrutinizer Auto-Fixer 2019-11-16 22:25:24 +00:00
parent e7276f9044
commit eba082320c
2 changed files with 317 additions and 317 deletions

File diff suppressed because it is too large Load Diff

View File

@ -56,19 +56,19 @@ class FormWebsite
*/ */
public function selectWebsite($selected = '', $htmlname = 'exportmodelid', $useempty = 0) public function selectWebsite($selected = '', $htmlname = 'exportmodelid', $useempty = 0)
{ {
$out=''; $out = '';
$sql = "SELECT rowid, ref"; $sql = "SELECT rowid, ref";
$sql.= " FROM ".MAIN_DB_PREFIX."website"; $sql .= " FROM ".MAIN_DB_PREFIX."website";
$sql.= " WHERE 1 = 1"; $sql .= " WHERE 1 = 1";
$sql.= " ORDER BY rowid"; $sql .= " ORDER BY rowid";
$result = $this->db->query($sql); $result = $this->db->query($sql);
if ($result) if ($result)
{ {
$out.='<select class="flat minwidth100" name="'.$htmlname.'" id="'.$htmlname.'">'; $out .= '<select class="flat minwidth100" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($useempty) if ($useempty)
{ {
$out.='<option value="-1">&nbsp;</option>'; $out .= '<option value="-1">&nbsp;</option>';
} }
$num = $this->db->num_rows($result); $num = $this->db->num_rows($result);
@ -78,17 +78,17 @@ class FormWebsite
$obj = $this->db->fetch_object($result); $obj = $this->db->fetch_object($result);
if ($selected == $obj->rowid) if ($selected == $obj->rowid)
{ {
$out.='<option value="'.$obj->rowid.'" selected>'; $out .= '<option value="'.$obj->rowid.'" selected>';
} }
else else
{ {
$out.='<option value="'.$obj->rowid.'">'; $out .= '<option value="'.$obj->rowid.'">';
} }
$out.=$obj->ref; $out .= $obj->ref;
$out.='</option>'; $out .= '</option>';
$i++; $i++;
} }
$out.="</select>"; $out .= "</select>";
} }
else { else {
dol_print_error($this->db); dol_print_error($this->db);
@ -114,9 +114,9 @@ class FormWebsite
$langs->load("admin"); $langs->load("admin");
$sql = "SELECT rowid, code, label, entity"; $sql = "SELECT rowid, code, label, entity";
$sql.= " FROM ".MAIN_DB_PREFIX.'c_type_container'; $sql .= " FROM ".MAIN_DB_PREFIX.'c_type_container';
$sql.= " WHERE active = 1 AND entity IN (".getEntity('c_type_container').")"; $sql .= " WHERE active = 1 AND entity IN (".getEntity('c_type_container').")";
$sql.= " ORDER BY label"; $sql .= " ORDER BY label";
dol_syslog(get_class($this)."::selectTypeOfContainer", LOG_DEBUG); dol_syslog(get_class($this)."::selectTypeOfContainer", LOG_DEBUG);
$result = $this->db->query($sql); $result = $this->db->query($sql);
@ -126,7 +126,7 @@ class FormWebsite
$i = 0; $i = 0;
if ($num) if ($num)
{ {
print '<select id="select'.$htmlname.'" class="flat selectTypeOfContainer" name="'.$htmlname.'"'.($moreattrib?' '.$moreattrib:'').'>'; print '<select id="select'.$htmlname.'" class="flat selectTypeOfContainer" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
if ($useempty == 1 || ($useempty == 2 && $num > 1)) if ($useempty == 1 || ($useempty == 2 && $num > 1))
{ {
print '<option value="-1">&nbsp;</option>'; print '<option value="-1">&nbsp;</option>';
@ -179,8 +179,8 @@ class FormWebsite
$listofsamples = dol_dir_list(DOL_DOCUMENT_ROOT.'/website/samples', 'files', 0, '^page-sample-.*\.html$'); $listofsamples = dol_dir_list(DOL_DOCUMENT_ROOT.'/website/samples', 'files', 0, '^page-sample-.*\.html$');
$arrayofsamples = array(); $arrayofsamples = array();
$arrayofsamples['empty']='EmptyPage'; // Always this one first $arrayofsamples['empty'] = 'EmptyPage'; // Always this one first
foreach($listofsamples as $sample) foreach ($listofsamples as $sample)
{ {
$reg = array(); $reg = array();
if (preg_match('/^page-sample-(.*)\.html$/', $sample['name'], $reg)) if (preg_match('/^page-sample-(.*)\.html$/', $sample['name'], $reg))
@ -193,14 +193,14 @@ class FormWebsite
} }
$out = ''; $out = '';
$out .= '<select id="select'.$htmlname.'" class="flat selectTypeOfContainer" name="'.$htmlname.'"'.($moreattrib?' '.$moreattrib:'').'>'; $out .= '<select id="select'.$htmlname.'" class="flat selectTypeOfContainer" name="'.$htmlname.'"'.($moreattrib ? ' '.$moreattrib : '').'>';
if ($useempty == 1 || $useempty == 2) if ($useempty == 1 || $useempty == 2)
{ {
$out .= '<option value="-1">&nbsp;</option>'; $out .= '<option value="-1">&nbsp;</option>';
} }
foreach($arrayofsamples as $key => $val) foreach ($arrayofsamples as $key => $val)
{ {
if ($selected == $key) if ($selected == $key)
{ {