fix incorrect case and remove exclude check (#27449)

This commit is contained in:
Frédéric FRANCE 2024-01-12 20:40:34 +01:00 committed by GitHub
parent 7c5a782593
commit 0d3e0c8ec4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 87 additions and 87 deletions

View file

@ -217,7 +217,7 @@ $title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card');
$help_url = 'EN:Category:Accounting';
llxheader('', $title, $help_url);
llxHeader('', $title, $help_url);
// Create mode

View file

@ -113,7 +113,7 @@ if ($action == 'delete') {
$form = new Form($db);
$formaccounting = new FormAccounting($db);
llxheader('', $langs->trans('AccountingCategory'));
llxHeader('', $langs->trans('AccountingCategory'));
$linkback = '<a href="'.DOL_URL_ROOT.'/accountancy/admin/categories_list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
$titlepicto = 'setup';

View file

@ -563,7 +563,7 @@ if (empty($reshook)) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
}
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEMail($email)) {
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($email)) {
$error++;
$langs->load("errors");
setEventMessages($langs->trans("ErrorBadEMail", $email), null, 'errors');

View file

@ -586,7 +586,7 @@ class Adherent extends CommonObject
$this->import_key = trim($this->import_key);
// Check parameters
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEMail($this->email)) {
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($this->email)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorBadEMail", $this->email);
return -1;
@ -730,7 +730,7 @@ class Adherent extends CommonObject
$this->url = $this->url ? clean_url($this->url, 0) : '';
$this->setUpperOrLowerCase();
// Check parameters
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEMail($this->email)) {
if (getDolGlobalString('ADHERENT_MAIL_REQUIRED') && !isValidEmail($this->email)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorBadEMail", $this->email);
return -1;
@ -1705,7 +1705,7 @@ class Adherent extends CommonObject
$insertid = $acct->addline($dateop, $operation, $label, $amount, $num_chq, '', $user, $emetteur_nom, $emetteur_banque);
if ($insertid > 0) {
$inserturlid = $acct->add_url_line($insertid, $this->id, DOL_URL_ROOT.'/adherents/card.php?rowid=', $this->getFullname($langs), 'member');
$inserturlid = $acct->add_url_line($insertid, $this->id, DOL_URL_ROOT.'/adherents/card.php?rowid=', $this->getFullName($langs), 'member');
if ($inserturlid > 0) {
// Update table subscription
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET fk_bank=".((int) $insertid);

View file

@ -64,7 +64,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
$value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"]);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);
@ -74,7 +74,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"]);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);

View file

@ -55,7 +55,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
$value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"]);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);
@ -65,7 +65,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"]);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);

View file

@ -48,7 +48,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
$value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"]);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);
@ -56,7 +56,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
} elseif (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"]);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);

View file

@ -66,7 +66,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
if (preg_match('/del_(.*)/', $action, $reg)) {
$code = $reg[1];
if (dolibarr_del_const($db, $code, 0) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"].($withtab ? '?withtab='.$withtab : ''));
header("Location: ".$_SERVER["PHP_SELF"].($withtab ? '?withtab='.$withtab : ''));
exit;
} else {
dol_print_error($db);

View file

@ -58,7 +58,7 @@ if (!$sortfield) {
// Security check
//$result = restrictedArea($user, 'agenda', 0, '', 'myactions');
if (!$user->hasRight("agenda", "allactions", "read")) {
accessForbidden();
accessforbidden();
}

View file

@ -147,7 +147,7 @@ if ($id > 0 || !empty($ref)) {
dol_print_error($db);
}
} else {
Header('Location: index.php');
header('Location: index.php');
exit;
}

View file

@ -3242,7 +3242,7 @@ class Facture extends CommonInvoice
} else {
if ($key == 'EMAIL') {
// Check for mandatory
if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEMail($this->thirdparty->email)) {
if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEmail($this->thirdparty->email)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);

View file

@ -2084,7 +2084,7 @@ class BonPrelevement extends CommonObject
fputs($this->file, substr(strtoupper($client_nom)." ", 0, 24));
// Domiciliation facultative D1
$domiciliation = strtr($rib_dom, array(" " => "-", CHR(13) => " ", CHR(10) => ""));
$domiciliation = strtr($rib_dom, array(" " => "-", chr(13) => " ", chr(10) => ""));
fputs($this->file, substr($domiciliation." ", 0, 24));
// Zone Reservee D2
@ -2189,8 +2189,8 @@ class BonPrelevement extends CommonObject
$XML_DEBITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf;
$XML_DEBITOR .= ' <PstlAdr>'.$CrLf;
$XML_DEBITOR .= ' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(CHR(13) => ", ", CHR(10) => ""));
$addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => ""));
if (trim($addressline1)) {
$XML_DEBITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
@ -2258,8 +2258,8 @@ class BonPrelevement extends CommonObject
$XML_CREDITOR .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($row_nom), ' '))).'</Nm>'.$CrLf;
$XML_CREDITOR .= ' <PstlAdr>'.$CrLf;
$XML_CREDITOR .= ' <Ctry>'.$row_country_code.'</Ctry>'.$CrLf;
$addressline1 = strtr($row_address, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(CHR(13) => ", ", CHR(10) => ""));
$addressline1 = strtr($row_address, array(chr(13) => ", ", chr(10) => ""));
$addressline2 = strtr($row_zip.(($row_zip && $row_town) ? ' ' : (string) $row_town), array(chr(13) => ", ", chr(10) => ""));
if (trim($addressline1)) {
$XML_CREDITOR .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
@ -2436,8 +2436,8 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => ""));
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
if ($addressline1) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}
@ -2502,8 +2502,8 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Nm>'.dolEscapeXML(strtoupper(dol_string_nospecial(dol_string_unaccent($this->raison_sociale), ' '))).'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(CHR(13) => ", ", CHR(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(CHR(13) => ", ", CHR(10) => ""));
$addressline1 = strtr($configuration->global->MAIN_INFO_SOCIETE_ADDRESS, array(chr(13) => ", ", chr(10) => ""));
$addressline2 = strtr($configuration->global->MAIN_INFO_SOCIETE_ZIP.(($configuration->global->MAIN_INFO_SOCIETE_ZIP || ' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN) ? ' ' : '').$configuration->global->MAIN_INFO_SOCIETE_TOWN, array(chr(13) => ", ", chr(10) => ""));
if ($addressline1) {
$XML_SEPA_INFO .= ' <AdrLine>'.dolEscapeXML(dol_trunc(dol_string_nospecial(dol_string_unaccent($addressline1), ' '), 70, 'right', 'UTF-8', 1)).'</AdrLine>'.$CrLf;
}

View file

@ -182,7 +182,7 @@ $months = array(
$langs->trans("MonthShort12"),
);
llxheader('', $langs->trans('ReportInOut'));
llxHeader('', $langs->trans('ReportInOut'));
$formaccounting = new FormAccounting($db);
$form = new Form($db);

View file

@ -257,7 +257,7 @@ if (empty($reshook)) {
$action = 'create';
}
if (!empty($object->email) && !isValidEMail($object->email)) {
if (!empty($object->email) && !isValidEmail($object->email)) {
$langs->load("errors");
$error++;
$errors[] = $langs->trans("ErrorBadEMail", GETPOST('email', 'alpha'));
@ -348,7 +348,7 @@ if (empty($reshook)) {
$action = 'edit';
}
if (!empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)) && !isValidEMail(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
if (!empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL)) && !isValidEmail(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
$langs->load("errors");
$error++;
$errors[] = $langs->trans("ErrorBadEMail", GETPOST('email', 'alpha'));

View file

@ -1342,7 +1342,7 @@ class DolGraph
if (empty($showlegend)) {
$this->stringtoshow .= 'legend: { display: false }, '."\n";
} else {
$this->stringtoshow .= 'legend: { maxWidth: '.round(intVal($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n";
$this->stringtoshow .= 'legend: { maxWidth: '.round(intval($this->width) / 2).', labels: { boxWidth: 15 }, position: \'' . (($showlegend && $showlegend == 2) ? 'right' : 'top') . '\' },'."\n";
}
if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) {
$this->stringtoshow .= 'tooltip: { mode: \'nearest\',

View file

@ -792,7 +792,7 @@ class FormMail extends Form
// Ask delivery receipt
if (!empty($this->withdeliveryreceipt) && getDolGlobalInt('MAIN_EMAIL_SUPPORT_ACK')) {
$out .= $this->getHtmlForDeliveryReceipt();
$out .= $this->getHtmlForDeliveryreceipt();
}
// Topic

View file

@ -1014,8 +1014,8 @@ class FormOther
//print $rouge.$vert.$bleu;
imagefill($image, 0, 0, $couleur); //on remplit l'image
// On cree la couleur et on l'attribue a une variable pour ne pas la perdre
ImagePng($image, $file); //renvoie une image sous format png
ImageDestroy($image);
imagepng($image, $file); //renvoie une image sous format png
imagedestroy($image);
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps

View file

@ -382,7 +382,7 @@ class SMTPs
public function buildRCPTlist()
{
// Pull TO list
$_aryToList = $this->getTO();
$_aryToList = $this->getTo();
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@ -1425,7 +1425,7 @@ class SMTPs
global $conf;
$_header = 'From: '.$this->getFrom('org')."\r\n"
. 'To: '.$this->getTO()."\r\n";
. 'To: '.$this->getTo()."\r\n";
if ($this->getCC()) {
$_header .= 'Cc: '.$this->getCC()."\r\n";

View file

@ -396,7 +396,7 @@ class vCard
$this->setProdId('Dolibarr '.DOL_VERSION);
$this->setUid('DOLIBARR-USERID-'.dol_trunc(md5('vcard'.$dolibarr_main_instance_unique_id), 8, 'right', 'UTF-8', 1).'-'.$object->id);
$this->setUID('DOLIBARR-USERID-'.dol_trunc(md5('vcard'.$dolibarr_main_instance_unique_id), 8, 'right', 'UTF-8', 1).'-'.$object->id);
$this->setName($object->lastname, $object->firstname, "", $object->civility_code, "");
$this->setFormattedName($object->getFullName($langs, 1));

View file

@ -1047,7 +1047,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu
// Add main fields of object
foreach ($object->fields as $key => $val) {
if (!empty($val['isameasure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) {
$position = (empty($val['position']) ? 0 : intVal($val['position']));
$position = (empty($val['position']) ? 0 : intval($val['position']));
$arrayofmesures[$tablealias.'.'.$key.'-sum'] = array(
'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$langs->trans("Sum").')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
@ -1200,7 +1200,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis,
continue;
}
if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) {
$position = (empty($val['position']) ? 0 : intVal($val['position']));
$position = (empty($val['position']) ? 0 : intval($val['position']));
$arrayofxaxis[$tablealias.'.'.$key.'-year'] = array(
'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$YYYY.')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
@ -1223,7 +1223,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis,
'tablefromt' => $tablepath
);
} else {
$position = (empty($val['position']) ? 0 : intVal($val['position']));
$position = (empty($val['position']) ? 0 : intval($val['position']));
$arrayofxaxis[$tablealias.'.'.$key] = array(
'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']),
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
@ -1246,7 +1246,7 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis,
}
if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('timestamp', 'date', 'datetime'))) {
$position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intVal($extrafields->attributes[$object->table_element]['pos'][$key]));
$position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intval($extrafields->attributes[$object->table_element]['pos'][$key]));
$arrayofxaxis[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-year'] = array(
'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val).' <span class="opacitymedium">('.$YYYY.')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val),
@ -1362,7 +1362,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
continue;
}
if (in_array($val['type'], array('timestamp', 'date', 'datetime'))) {
$position = (empty($val['position']) ? 0 : intVal($val['position']));
$position = (empty($val['position']) ? 0 : intval($val['position']));
$arrayofgroupby[$tablealias.'.'.$key.'-year'] = array(
'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']).' <span class="opacitymedium">('.$YYYY.')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
@ -1385,7 +1385,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
'tablefromt' => $tablepath
);
} else {
$position = (empty($val['position']) ? 0 : intVal($val['position']));
$position = (empty($val['position']) ? 0 : intval($val['position']));
$arrayofgroupby[$tablealias.'.'.$key] = array(
'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val['label']),
'labelnohtml' => $labelofobject.': '.$langs->trans($val['label']),
@ -1408,7 +1408,7 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup
}
if (in_array($extrafields->attributes[$object->table_element]['type'][$key], array('timestamp', 'date', 'datetime'))) {
$position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intVal($extrafields->attributes[$object->table_element]['pos'][$key]));
$position = (empty($extrafields->attributes[$object->table_element]['pos'][$key]) ? 0 : intval($extrafields->attributes[$object->table_element]['pos'][$key]));
$arrayofgroupby[preg_replace('/^t/', 'te', $tablealias).'.'.$key.'-year'] = array(
'label' => img_picto('', $object->picto, 'class="pictofixedwidth"').' '.$labelofobject.': '.$langs->trans($val).' <span class="opacitymedium">('.$YYYY.')</span>',
'labelnohtml' => $labelofobject.': '.$langs->trans($val),

View file

@ -457,9 +457,9 @@ function barcode_outimage($text, $bars, $scale = 1, $mode = "png", $total_y = 0,
}
$im = imagecreate($total_x, $total_y);
/* create two images */
$col_bg = ImageColorAllocate($im, $bg_color[0], $bg_color[1], $bg_color[2]);
$col_bar = ImageColorAllocate($im, $bar_color[0], $bar_color[1], $bar_color[2]);
$col_text = ImageColorAllocate($im, $text_color[0], $text_color[1], $text_color[2]);
$col_bg = imagecolorallocate($im, $bg_color[0], $bg_color[1], $bg_color[2]);
$col_bar = imagecolorallocate($im, $bar_color[0], $bar_color[1], $bar_color[2]);
$col_text = imagecolorallocate($im, $text_color[0], $text_color[1], $text_color[2]);
$height = round($total_y - ($scale * 10));
$height2 = round($total_y - $space['bottom']);

View file

@ -451,7 +451,7 @@ function correctExifImageOrientation($fileSource, $fileDest, $quality = 95)
if ($infoImg[2] === IMAGETYPE_PNG) { // In fact there is no exif on PNG but just in case
imagealphablending($img, false);
imagesavealpha($img, true);
$img = imagerotate($img, $deg, imageColorAllocateAlpha($img, 0, 0, 0, 127));
$img = imagerotate($img, $deg, imagecolorallocatealpha($img, 0, 0, 0, 127));
imagealphablending($img, false);
imagesavealpha($img, true);
} else {
@ -663,7 +663,7 @@ function vignette($file, $maxWidth = 160, $maxHeight = 120, $extName = '_small',
if ($infoImg[2] === 'IMAGETYPE_PNG') { // In fact there is no exif on PNG but just in case
imagealphablending($img, false);
imagesavealpha($img, true);
$rotated = imagerotate($img, $exifAngle, imageColorAllocateAlpha($img, 0, 0, 0, 127));
$rotated = imagerotate($img, $exifAngle, imagecolorallocatealpha($img, 0, 0, 0, 127));
imagealphablending($rotated, false);
imagesavealpha($rotated, true);
} else {

View file

@ -176,7 +176,7 @@ class mailing_pomme extends MailingTargets
if (GETPOSTISSET("filter") && GETPOST("filter") == '0') {
$sql .= " AND u.statut=0";
}
if (GETPOSTISSET("filteremployee") && GETPOSt("filteremployee") == '1') {
if (GETPOSTISSET("filteremployee") && GETPOST("filteremployee") == '1') {
$sql .= " AND u.employee=1";
}
if (GETPOSTISSET("filteremployee") && GETPOST("filteremployee") == '0') {

View file

@ -164,7 +164,7 @@ class mailing_xinputfile extends MailingTargets
if (!empty($buffer)) {
//print 'xx'.dol_strlen($buffer).empty($buffer)."<br>\n";
if (isValidEMail($email)) {
if (isValidEmail($email)) {
if ($old != $email) {
$cibles[$j] = array(
'email' => $email,

View file

@ -135,7 +135,7 @@ class mailing_xinputuser extends MailingTargets
$cibles = array();
if (!empty($email)) {
if (isValidEMail($email)) {
if (isValidEmail($email)) {
$cibles[] = array(
'email' => $email,
'lastname' => $lastname,

View file

@ -89,7 +89,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $permissiontodelete) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'edit';
} else {
Header("Location: ".DOL_URL_ROOT.'/cron/list.php');
header("Location: ".DOL_URL_ROOT.'/cron/list.php');
exit;
}
}

View file

@ -1722,7 +1722,7 @@ class EmailCollector extends CommonObject
if (preg_match('/^(Re|AW)\s*:\s+/i', $headers['Subject'])) {
$isanswer = 1;
}
if (getDolglobalString('EMAILCOLLECTOR_USE_IN_REPLY_TO_TO_DETECT_ANSWERS')) {
if (getDolGlobalString('EMAILCOLLECTOR_USE_IN_REPLY_TO_TO_DETECT_ANSWERS')) {
// Note: "In-Reply-To" to detect if mail is an answer of another mail is not reliable because we can have:
// Message-ID=A, In-Reply-To=B, References=B and message can BE an answer but may be NOT (for example a transfer of an email rewriten)
if (!empty($headers['In-Reply-To'])) {

View file

@ -249,7 +249,7 @@ class ConferenceOrBoothAttendee extends CommonObject
{
global $langs;
if (!isValidEMail($this->email)) {
if (!isValidEmail($this->email)) {
$langs->load("errors");
$this->errors[] = $langs->trans("ErrorBadEMail", $this->email);
return -1;

View file

@ -315,7 +315,7 @@ if (empty($reshook)) {
if (!$error) {
$db->commit();
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');

View file

@ -1813,7 +1813,7 @@ class FactureFournisseur extends CommonInvoice
} else {
if ($key == 'EMAIL') {
// Check for mandatory
if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEMail($this->thirdparty->email)) {
if (getDolGlobalString('SOCIETE_EMAIL_INVOICE_MANDATORY') && !isValidEmail($this->thirdparty->email)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorBadEMail", $this->thirdparty->email).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']';
dol_syslog(__METHOD__.' '.$this->error, LOG_ERR);

View file

@ -147,7 +147,7 @@ $permissiontoread = $user->hasRight('holiday', 'read');
$permissiontodelete = $user->hasRight('holiday', 'delete');
$permissiontoapprove = $user->hasRight('holiday', 'approve');
if (!ismodEnabled('holiday')) {
if (!isModEnabled('holiday')) {
accessforbidden('Module holiday not enabled');
}

View file

@ -292,7 +292,7 @@ if ($step == 3 && $datatoimport) {
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
Header('Location: '.$_SERVER["PHP_SELF"].'?step='.$step.$param);
header('Location: '.$_SERVER["PHP_SELF"].'?step='.$step.$param);
exit;
}
}

View file

@ -75,7 +75,7 @@ if (preg_match('/set_(.*)/', $action, $reg)) {
if (preg_match('/del_(.*)/', $action, $reg)) {
$code = $reg[1];
if (dolibarr_del_const($db, $code, 0) > 0) {
Header("Location: ".$_SERVER["PHP_SELF"]);
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
} else {
dol_print_error($db);

View file

@ -5036,7 +5036,7 @@ if ($module == 'initmodule') {
$dirins = $listofmodules[strtolower($module)]['moduledescriptorrootpath'];
$destdir = $dirins.'/'.strtolower($module);
$listofobject = dol_dir_list($destdir.'/class', 'files', 0, '\.class\.php$');
$objects = dolGetListOfObjectclasses($destdir);
$objects = dolGetListOfObjectClasses($destdir);
$leftmenus = array();

View file

@ -5199,7 +5199,7 @@ class Product extends CommonObject
$datas['label']= '<br><b>'.$langs->trans('ProductLabel').':</b> '.$this->label;
}
if (!empty($this->description)) {
$datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineofText($this->description, 5);
$datas['description']= '<br><b>'.$langs->trans('ProductDescription').':</b> '.dolGetFirstLineOfText($this->description, 5);
}
if ($this->type == Product::TYPE_PRODUCT || getDolGlobalString('STOCK_SUPPORTS_SERVICES')) {
if (isModEnabled('productbatch')) {

View file

@ -807,7 +807,7 @@ if ($id > 0 || $ref) {
print '<td>'.$langs->trans('GencodBuyPrice').'</td>';
print '<td>';
print img_picto('', 'barcode', 'class="pictofixedwidth"');
print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalint("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1);
print $formbarcode->selectBarcodeType((GETPOSTISSET('fk_barcode_type') ? GETPOST('fk_barcode_type', 'int') : ($rowid ? $object->supplier_fk_barcode_type : getDolGlobalInt("PRODUIT_DEFAULT_BARCODE_TYPE"))), 'fk_barcode_type', 1);
print ' <input class="flat" name="barcode" value="'.(GETPOSTISSET('barcode') ? GETPOST('barcode') : ($rowid ? $object->supplier_barcode : '')).'"></td>';
print '</tr>';
}

View file

@ -1678,7 +1678,7 @@ while ($i < $imaxinloop) {
print '<td class="left">';
// Since description can be very large (several pages of HTML-
// code) we limit to the first two rows
print dolGetFirstLineofText($product_static->description, 2);
print dolGetFirstLineOfText($product_static->description, 2);
print '</td>';
if (!$i) {
$totalarray['nbfield']++;

View file

@ -526,7 +526,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') {
} else {
setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
}
Header('Location: '.$_SERVER["PHP_SELF"]);
header('Location: '.$_SERVER["PHP_SELF"]);
exit;
}

View file

@ -144,7 +144,7 @@ if (getDolGlobalString('PRODUIT_SOUSPRODUITS') && $object->element == 'product'
}
// Serial / Eat-by date
if (ismodEnabled('productbatch') &&
if (isModEnabled('productbatch') &&
(($object->element == 'product' && $object->hasbatch())
|| ($object->element == 'stock'))
) {

View file

@ -258,7 +258,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
$db->commit();
Header("Location: " . $urlback);
header("Location: " . $urlback);
exit;
} else {
$db->rollback();

View file

@ -344,7 +344,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$db->commit();
Header("Location: ".$redirection);
header("Location: ".$redirection);
exit;
}
@ -609,7 +609,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
}
}
Header("Location: ".$redirection);
header("Location: ".$redirection);
exit;
} else {
$db->rollback();
@ -667,7 +667,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen
$securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2);
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
Header("Location: ".$redirection);
header("Location: ".$redirection);
exit;
}
//Header("Location: ".$urlback);

View file

@ -474,7 +474,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
$db->commit();
Header("Location: ".$urlback);
header("Location: ".$urlback);
exit;
} else {
$db->rollback();

View file

@ -512,7 +512,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
$db->commit();
Header("Location: ".$urlback);
header("Location: ".$urlback);
exit;
} else {
$db->rollback();

View file

@ -383,7 +383,7 @@ if ($action == 'dopayment') {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount"));
$action = '';
// } elseif (empty($EMAIL)) { $mesg=$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("YourEMail"));
// } elseif (! isValidEMail($EMAIL)) { $mesg=$langs->trans("ErrorBadEMail",$EMAIL);
// } elseif (! isValidEmail($EMAIL)) { $mesg=$langs->trans("ErrorBadEMail",$EMAIL);
} elseif (!$origfulltag) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentCode"));
$action = '';
@ -446,7 +446,7 @@ if ($action == 'dopayment') {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount"));
} elseif (empty($email)) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ONLINE_PAYMENT_SENDEMAIL"));
} elseif (!isValidEMail($email)) {
} elseif (!isValidEmail($email)) {
$mesg = $langs->trans("ErrorBadEMail", $email);
} elseif (!$origfulltag) {
$mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentCode"));

View file

@ -419,7 +419,7 @@ if (empty($reshook) && $action == 'add') {
if (!$error) {
$db->commit();
Header("Location: ".$urlback);
header("Location: ".$urlback);
exit;
} else {
$db->rollback();

View file

@ -470,7 +470,7 @@ if (empty($reshook) && $action == 'add') {
$redirection .= '&securekey='.$conf->global->PAYMENT_SECURITY_TOKEN;
}
}
Header("Location: ".$redirection);
header("Location: ".$redirection);
exit;
}*/
}
@ -533,7 +533,7 @@ if (empty($reshook) && $action == 'add') {
$securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2);
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.$id.'&securekey='.$securekeyurl;
Header("Location: ".$redirection);
header("Location: ".$redirection);
exit;
} else {
$db->rollback();

View file

@ -470,7 +470,7 @@ if (empty($reshook) && $action == 'add') {
$db->commit();
$securekeyurl = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY') . 'conferenceorbooth'.$id, 2);
$redirection = $dolibarr_main_url_root.'/public/eventorganization/subscriptionok.php?id='.((int) $id).'&securekey='.urlencode($securekeyurl);
Header("Location: ".$redirection);
header("Location: ".$redirection);
exit;
} else {
$db->rollback();

View file

@ -348,7 +348,7 @@ if (($id || $ref) && $action == 'edit') {
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
$res = $object->fetch_optionals();
$head = recruitmentcandidaturePrepareHead($object);
$head = recruitmentCandidaturePrepareHead($object);
print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentCandidature"), -1, $object->picto);
$formconfirm = '';

View file

@ -112,7 +112,7 @@ if (empty($reshook)) {
if ($result > 0) {
// Creation OK
setEventMessages($langs->trans('ResourceCreatedWithSuccess'), null, 'mesgs');
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
} else {
// Creation KO
@ -121,7 +121,7 @@ if (empty($reshook)) {
}
}
} else {
Header("Location: list.php");
header("Location: list.php");
exit;
}
}
@ -150,7 +150,7 @@ if (empty($reshook)) {
$result = $object->update($user);
if ($result > 0) {
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');

View file

@ -430,7 +430,7 @@ if (empty($reshook)) {
// Check parameters
if (!GETPOST('cancel', 'alpha')) {
if (!empty($object->email) && !isValidEMail($object->email)) {
if (!empty($object->email) && !isValidEmail($object->email)) {
$langs->load("errors");
$error++;
setEventMessages($langs->trans("ErrorBadEMail", $object->email), null, 'errors');

View file

@ -1239,7 +1239,7 @@ class Societe extends CommonObject
//var_dump($conf->global->SOCIETE_EMAIL_MANDATORY);
if ($key == 'EMAIL') {
// Check for mandatory
if (getDolGlobalString('SOCIETE_EMAIL_MANDATORY') && !isValidEMail($this->email)) {
if (getDolGlobalString('SOCIETE_EMAIL_MANDATORY') && !isValidEmail($this->email)) {
$langs->load("errors");
$error++;
$this->errors[] = $langs->trans("ErrorBadEMail", $this->email).' ('.$langs->trans("ForbiddenBySetupRules").')';

View file

@ -519,7 +519,7 @@ if (empty($reshook)) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
if ($object->delete($user) > 0) {
setEventMessages('<div class="confirm">'.$langs->trans('TicketDeletedSuccess').'</div>', null, 'mesgs');
Header("Location: ".DOL_URL_ROOT."/ticket/list.php");
header("Location: ".DOL_URL_ROOT."/ticket/list.php");
exit;
} else {
$langs->load("errors");

View file

@ -157,7 +157,7 @@ if ($action == 'deletecontact' && $user->hasRight('ticket', 'write')) {
$result = $object->delete_contact($lineid);
if ($result >= 0) {
Header("Location: ".$url_page_current."?id=".$object->id);
header("Location: ".$url_page_current."?id=".$object->id);
exit;
}
}

View file

@ -1590,7 +1590,7 @@ class User extends CommonObject
$badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\'');
// Check parameters
if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEMail($this->email)) {
if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEmail($this->email)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorBadEMail", $this->email);
return -1;
@ -1993,7 +1993,7 @@ class User extends CommonObject
// Check parameters
$badCharUnauthorizedIntoLoginName = getDolGlobalString('MAIN_LOGIN_BADCHARUNAUTHORIZED', ',@<>"\'');
if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEMail($this->email)) {
if (getDolGlobalString('USER_MAIL_REQUIRED') && !isValidEmail($this->email)) {
$langs->load("errors");
$this->error = $langs->trans("ErrorBadEMail", $this->email);
return -1;

View file

@ -30,7 +30,7 @@ parameters:
checkAlwaysTrueStrictComparison: false
checkClassCaseSensitivity: false
checkFunctionArgumentTypes: false
checkFunctionNameCase: false
checkFunctionNameCase: true
checkArgumentsPassedByReference: false
checkMaybeUndefinedVariables: false
checkNullables: false