Fix scrutinizer errors
This commit is contained in:
parent
5839cedb4c
commit
6338328c90
@ -91,6 +91,8 @@ class box_graph_invoices_permonth extends ModeleBoxes
|
|||||||
|
|
||||||
if ($user->rights->facture->lire)
|
if ($user->rights->facture->lire)
|
||||||
{
|
{
|
||||||
|
$mesg = '';
|
||||||
|
|
||||||
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
$param_year='DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
|
||||||
$param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
$param_shownb='DOLUSERCOOKIE_box_'.$this->boxcode.'_shownb';
|
||||||
$param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
$param_showtot='DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
|
||||||
|
|||||||
@ -319,7 +319,7 @@ abstract class CommonDocGenerator
|
|||||||
|
|
||||||
foreach($conf->global as $key => $val)
|
foreach($conf->global as $key => $val)
|
||||||
{
|
{
|
||||||
if (preg_match('/(_pass|password|secret|_key|key$)/i', $keyfound)) $newval = '*****forbidden*****';
|
if (preg_match('/(_pass|password|secret|_key|key$)/i', $key)) $newval = '*****forbidden*****';
|
||||||
else $newval = $val;
|
else $newval = $val;
|
||||||
$array_other['__['.$key.']__'] = $newval;
|
$array_other['__['.$key.']__'] = $newval;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4691,7 +4691,8 @@ abstract class CommonObject
|
|||||||
if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']))
|
if ($this->array_options[$key] != '' && is_array($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']))
|
||||||
{
|
{
|
||||||
// If there is an encryption choice, we use it to crypt data before insert
|
// If there is an encryption choice, we use it to crypt data before insert
|
||||||
$algo=reset(array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options']));
|
$tmparrays = array_keys($extrafields->attributes[$this->table_element]['param'][$attributeKey]['options'])
|
||||||
|
$algo=reset($tmparrays);
|
||||||
if ($algo != '')
|
if ($algo != '')
|
||||||
{
|
{
|
||||||
//global $action; // $action may be 'create', 'update', 'update_extras'...
|
//global $action; // $action may be 'create', 'update', 'update_extras'...
|
||||||
|
|||||||
@ -235,6 +235,7 @@ class ExtraFields
|
|||||||
$lengthdb='11';
|
$lengthdb='11';
|
||||||
} elseif ($type=='html') {
|
} elseif ($type=='html') {
|
||||||
$typedb='text';
|
$typedb='text';
|
||||||
|
$lengthdb=$length;
|
||||||
} elseif($type=='password') {
|
} elseif($type=='password') {
|
||||||
$typedb='varchar';
|
$typedb='varchar';
|
||||||
$lengthdb='128';
|
$lengthdb='128';
|
||||||
|
|||||||
@ -194,6 +194,7 @@ class FormActions
|
|||||||
$projectid = $object->fk_project;
|
$projectid = $object->fk_project;
|
||||||
if ($typeelement == 'project') $projectid = $object->id;
|
if ($typeelement == 'project') $projectid = $object->id;
|
||||||
|
|
||||||
|
$buttontoaddnewevent='';
|
||||||
if (! empty($conf->agenda->enabled))
|
if (! empty($conf->agenda->enabled))
|
||||||
{
|
{
|
||||||
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:'').($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'">';
|
$buttontoaddnewevent = '<a href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.dol_print_date(dol_now(),'dayhourlog').'&origin='.$typeelement.'&originid='.$object->id.($object->socid>0?'&socid='.$object->socid:'').($projectid>0?'&projectid='.$projectid:'').'&backtopage='.urlencode($urlbacktopage).'">';
|
||||||
|
|||||||
@ -164,7 +164,7 @@ class FormWebsite
|
|||||||
*
|
*
|
||||||
* @param string $htmlname Name of select zone
|
* @param string $htmlname Name of select zone
|
||||||
* @param string $selected Selected value
|
* @param string $selected Selected value
|
||||||
* @param int $useempty 1=Add an empty value in list, 2=Add an empty value in list only if there is more than 2 entries.
|
* @param int $useempty 1=Add an empty value in list
|
||||||
* @param string $moreattrib More attributes on HTML select tag
|
* @param string $moreattrib More attributes on HTML select tag
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
@ -177,9 +177,9 @@ class FormWebsite
|
|||||||
$arrayofsamples=array('corporatehome'=>'CorporateHomePage', 'empty'=>'EmptyPage');
|
$arrayofsamples=array('corporatehome'=>'CorporateHomePage', 'empty'=>'EmptyPage');
|
||||||
|
|
||||||
$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 && $num > 1))
|
|
||||||
|
if ($useempty == 1 || $useempty == 2)
|
||||||
{
|
{
|
||||||
$out .= '<option value="-1"> </option>';
|
$out .= '<option value="-1"> </option>';
|
||||||
}
|
}
|
||||||
@ -196,7 +196,6 @@ class FormWebsite
|
|||||||
}
|
}
|
||||||
$out .= $langs->trans($val);
|
$out .= $langs->trans($val);
|
||||||
$out .= '</option>';
|
$out .= '</option>';
|
||||||
$i++;
|
|
||||||
}
|
}
|
||||||
$out .= "</select>";
|
$out .= "</select>";
|
||||||
|
|
||||||
|
|||||||
@ -1288,9 +1288,10 @@ function complete_elementList_with_modules(&$elementList)
|
|||||||
|
|
||||||
$modules[$i] = $objMod;
|
$modules[$i] = $objMod;
|
||||||
$filename[$i]= $modName;
|
$filename[$i]= $modName;
|
||||||
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
|
$orders[$i] = $objMod->family."_".$j; // Sort on family then module number
|
||||||
|
$dirmod[$i] = $dir;
|
||||||
//print "x".$modName." ".$orders[$i]."\n<br>";
|
//print "x".$modName." ".$orders[$i]."\n<br>";
|
||||||
$dirmod[$i] = $dirroot;
|
|
||||||
if (! empty($objMod->module_parts['contactelement']))
|
if (! empty($objMod->module_parts['contactelement']))
|
||||||
{
|
{
|
||||||
$elementList[$objMod->name] = $langs->trans($objMod->name);
|
$elementList[$objMod->name] = $langs->trans($objMod->name);
|
||||||
|
|||||||
@ -177,6 +177,7 @@ function redirectToContainer($containerref, $containeraliasalt='',$containerid=0
|
|||||||
global $db, $website;
|
global $db, $website;
|
||||||
|
|
||||||
$newurl = '';
|
$newurl = '';
|
||||||
|
$result=0;
|
||||||
|
|
||||||
// We make redirect using the alternative alias, we must find the real $containerref
|
// We make redirect using the alternative alias, we must find the real $containerref
|
||||||
if ($containeraliasalt)
|
if ($containeraliasalt)
|
||||||
|
|||||||
@ -1169,7 +1169,7 @@ class Societe extends CommonObject
|
|||||||
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
|
$sql .= ' WHERE s.entity IN ('.getEntity($this->element).')';
|
||||||
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
|
if ($rowid) $sql .= ' AND s.rowid = '.$rowid;
|
||||||
if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'";
|
if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'";
|
||||||
if ($ref_alias) $sql .= " AND s.nom_alias = '".$this->db->escape($nom_alias)."'";
|
if ($ref_alias) $sql .= " AND s.nom_alias = '".$this->db->escape($ref_alias)."'";
|
||||||
if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'";
|
if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'";
|
||||||
if ($ref_int) $sql .= " AND s.ref_int = '".$this->db->escape($ref_int)."'";
|
if ($ref_int) $sql .= " AND s.ref_int = '".$this->db->escape($ref_int)."'";
|
||||||
if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'";
|
if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'";
|
||||||
@ -2833,10 +2833,10 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
//Check NIF
|
//Check NIF
|
||||||
if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $string))
|
if (preg_match('/(^[0-9]{8}[A-Z]{1}$)/', $string))
|
||||||
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1))
|
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 0, 8) % 23, 1))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
//algorithm checking type code CIF
|
//algorithm checking type code CIF
|
||||||
$sum = $num[2] + $num[4] + $num[6];
|
$sum = $num[2] + $num[4] + $num[6];
|
||||||
@ -2846,31 +2846,31 @@ class Societe extends CommonObject
|
|||||||
|
|
||||||
//Chek special NIF
|
//Chek special NIF
|
||||||
if (preg_match('/^[KLM]{1}/', $string))
|
if (preg_match('/^[KLM]{1}/', $string))
|
||||||
if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1))
|
if ($num[8] == chr(64 + $n) || $num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr($string, 1, 8) % 23, 1))
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
//Check CIF
|
//Check CIF
|
||||||
if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $string))
|
if (preg_match('/^[ABCDEFGHJNPQRSUVW]{1}/', $string))
|
||||||
if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1))
|
if ($num[8] == chr(64 + $n) || $num[8] == substr($n, strlen($n) - 1, 1))
|
||||||
return 2;
|
return 2;
|
||||||
else
|
else
|
||||||
return -2;
|
return -2;
|
||||||
|
|
||||||
//Check NIE T
|
//Check NIE T
|
||||||
if (preg_match('/^[T]{1}/', $string))
|
if (preg_match('/^[T]{1}/', $string))
|
||||||
if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string))
|
if ($num[8] == preg_match('/^[T]{1}[A-Z0-9]{8}$/', $string))
|
||||||
return 3;
|
return 3;
|
||||||
else
|
else
|
||||||
return -3;
|
return -3;
|
||||||
|
|
||||||
//Check NIE XYZ
|
//Check NIE XYZ
|
||||||
if (preg_match('/^[XYZ]{1}/', $string))
|
if (preg_match('/^[XYZ]{1}/', $string))
|
||||||
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $string), 0, 8) % 23, 1))
|
if ($num[8] == substr('TRWAGMYFPDXBNJZSQVHLCKE', substr(str_replace(array('X','Y','Z'), array('0','1','2'), $string), 0, 8) % 23, 1))
|
||||||
return 3;
|
return 3;
|
||||||
else
|
else
|
||||||
return -3;
|
return -3;
|
||||||
|
|
||||||
//Can not be verified
|
//Can not be verified
|
||||||
return -4;
|
return -4;
|
||||||
@ -2894,9 +2894,6 @@ class Societe extends CommonObject
|
|||||||
else {
|
else {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Wrong format
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $ok;
|
return $ok;
|
||||||
|
|||||||
@ -616,7 +616,7 @@ class Website extends CommonObject
|
|||||||
|
|
||||||
// Generate the index.php page to be the home page
|
// Generate the index.php page to be the home page
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
$result = dolSaveIndexPage($pathofwebsite, $fileindex, $filetpl);
|
$result = dolSaveIndexPage($pathofwebsitenew, $fileindex, $filetpl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user