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 2020-09-08 19:27:28 +00:00
parent c9451c0940
commit c263c8a76c
69 changed files with 17756 additions and 17756 deletions

View File

@ -264,7 +264,7 @@ if ($result) {
print '<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
print '<td class="liste_titre"></td>';
print '<td><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
print '<td class="liste_titre"></td>';
}
print '<td class="liste_titre center">';
@ -287,7 +287,7 @@ if ($result) {
print_liste_field_titre("Employees", $_SERVER['PHP_SELF'], "u.login", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
@ -341,7 +341,7 @@ if ($result) {
print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
// Date validation
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
print '<td class="center">'.dol_print_date($db->jdate($objp->date_valid), 'day').'</td>';
}

View File

@ -303,7 +303,7 @@ if ($result) {
print '<td class="liste_titre"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_expensereport" value="'.dol_escape_htmltag($search_expensereport).'"></td>';
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
print '<td class="liste_titre"></td>';
}
print '<td class="liste_titre center nowraponall minwidth100imp">';
@ -327,7 +327,7 @@ if ($result) {
print_liste_field_titre("Employee", $_SERVER['PHP_SELF'], "u.login", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $param, '', $sortfield, $sortorder);
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
print_liste_field_titre("DateValidation", $_SERVER["PHP_SELF"], "er.date_valid", "", $param, '', $sortfield, $sortorder, 'center ');
}
print_liste_field_titre("DateOfLine", $_SERVER["PHP_SELF"], "erd.date, erd.rowid", "", $param, '', $sortfield, $sortorder, 'center ');
@ -381,7 +381,7 @@ if ($result) {
print '<td>'.$expensereport_static->getNomUrl(1).'</td>';
// Date validation
if (! empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
if (!empty($conf->global->ACCOUNTANCY_USE_EXPENSE_REPORT_VALIDATION_DATE)) {
print '<td class="center">'.dol_print_date($db->jdate($objp->date_valid), 'day').'</td>';
}

View File

@ -150,7 +150,7 @@ if (GETPOST("viewlist", 'alpha') || $action == 'show_list')
$param .= '&'.$key.'='.urlencode($val);
}
}
if (! preg_match('/action=/', $param)) $param .= ($param ? '&' : '').'action=show_list';
if (!preg_match('/action=/', $param)) $param .= ($param ? '&' : '').'action=show_list';
//print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/list.php?'.$param);
exit;

View File

@ -1291,21 +1291,21 @@ if ($resql)
foreach ($toselect as $checked) {
if ($tmpproposal->fetch($checked)) {
if ($tmpproposal->statut == 0) {
if ($tmpproposal->valid($user)){
setEventMessage($tmpproposal->ref . " " . $langs->trans('PassedInOpenStatus'), 'mesgs');
if ($tmpproposal->valid($user)) {
setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
} else {
setEventMessage($langs->trans('CantBeValidated'), 'errors');
$error++;
}
} else {
setEventMessage($tmpproposal->ref . " " . $langs->trans('IsNotADraft'), 'errors');
setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors');
$error++;
}
}
dol_print_error($db);
$error++;
}
if ($error){
if ($error) {
$db->rollback();
} else {
$db->commit();
@ -1323,13 +1323,13 @@ if ($resql)
if ($tmpproposal->statut == 1) {
$tmpproposal->statut = 2;
if ($tmpproposal->update($user)) {
setEventMessage($tmpproposal->ref . " " . $langs->trans('Signed'), 'mesgs');
setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
} else {
dol_print_error($db);
$error++;
}
} else {
setEventMessage($tmpproposal->ref . " " . $langs->trans('CantBeSign'), 'errors');
setEventMessage($tmpproposal->ref." ".$langs->trans('CantBeSign'), 'errors');
$error++;
}
} else {
@ -1337,7 +1337,7 @@ if ($resql)
$error++;
}
}
if ($error){
if ($error) {
$db->rollback();
} else {
$db->commit();

View File

@ -1175,7 +1175,7 @@ class Facture extends CommonInvoice
}
// Bloc to update dates of service (month by month only if previously filled at 1d near start or end of month)
// If it's a service with start and end dates
if (!empty($line->date_start) && !empty($line->date_end) ) {
if (!empty($line->date_start) && !empty($line->date_end)) {
// Get the dates
$start = dol_getdate($line->date_start);
$end = dol_getdate($line->date_end);

View File

@ -1355,7 +1355,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$object->fetch_thirdparty();
if (! empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
if (!empty($conf->global->THIRDPARTY_ENABLE_PROSPECTION_ON_ALTERNATIVE_ADRESSES)) {
if ($object->thirdparty->client == 2 || $object->thirdparty->client == 3)
{
print '<br>';
@ -1368,11 +1368,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('ProspectLevel');
print '<td>';
if ($action != 'editlevel' && $user->rights->societe->contact->creer) print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=editlevel&amp;id=' . $object->id . '">' . img_edit($langs->trans('Modify'), 1) . '</a></td>';
if ($action != 'editlevel' && $user->rights->societe->contact->creer) print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=editlevel&amp;id='.$object->id.'">'.img_edit($langs->trans('Modify'), 1).'</a></td>';
print '</tr></table>';
print '</td><td>';
if ($action == 'editlevel') {
$formcompany->formProspectContactLevel($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->fk_prospectlevel, 'prospect_contact_level_id', 1);
$formcompany->formProspectContactLevel($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_prospectlevel, 'prospect_contact_level_id', 1);
} else {
print $object->getLibProspLevel();
}
@ -1381,13 +1381,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Status of prospection
$object->loadCacheOfProspStatus();
print '<tr><td>' . $langs->trans("StatusProsp") . '</td><td>' . $object->getLibProspCommStatut(4, $object->cacheprospectstatus[$object->stcomm_id]['label']);
print '<tr><td>'.$langs->trans("StatusProsp").'</td><td>'.$object->getLibProspCommStatut(4, $object->cacheprospectstatus[$object->stcomm_id]['label']);
print ' &nbsp; &nbsp; ';
print '<div class="floatright">';
foreach ($object->cacheprospectstatus as $key => $val) {
$titlealt = 'default';
if (!empty($val['code']) && !in_array($val['code'], array('ST_NO', 'ST_NEVER', 'ST_TODO', 'ST_PEND', 'ST_DONE'))) $titlealt = $val['label'];
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&stcomm=' . $val['code'] . '&action=setstcomm">' . img_action($titlealt, $val['code'], $val['picto']) . '</a>';
if ($object->stcomm_id != $val['id']) print '<a class="pictosubstatus" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&stcomm='.$val['code'].'&action=setstcomm">'.img_action($titlealt, $val['code'], $val['picto']).'</a>';
}
print '</div></td></tr>';

View File

@ -170,7 +170,7 @@ class CMailFile
$this->sendmode = '';
if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_' . $smtpContextKey;
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$this->sendmode = $smtpContextSendMode;
@ -443,9 +443,9 @@ class CMailFile
// Set the From address with an associative array
//$this->message->setFrom(array('john@doe.com' => 'John Doe'));
if (! empty($this->addr_from)) {
if (!empty($this->addr_from)) {
try {
if (! empty($conf->global->MAIN_FORCE_DISABLE_MAIL_SPOOFING)) {
if (!empty($conf->global->MAIN_FORCE_DISABLE_MAIL_SPOOFING)) {
// Prevent email spoofing for smtp server with a strict configuration
$regexp = '/([a-z0-9_\.\-\+])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i'; // This regular expression extracts all emails from a string
$emailMatchs = preg_match_all($regexp, $from, $adressEmailFrom);
@ -465,7 +465,7 @@ class CMailFile
}
// Set the To addresses with an associative array
if (! empty($this->addr_to)) {
if (!empty($this->addr_to)) {
try {
$result = $this->message->setTo($this->getArrayAddress($this->addr_to));
} catch (Exception $e) {
@ -473,7 +473,7 @@ class CMailFile
}
}
if (! empty($this->reply_to)) {
if (!empty($this->reply_to)) {
try {
$result = $this->message->SetReplyTo($this->getArrayAddress($this->reply_to));
} catch (Exception $e) {
@ -529,8 +529,8 @@ class CMailFile
}
}
if (! empty($this->addr_cc)) $this->message->setCc($this->getArrayAddress($this->addr_cc));
if (! empty($this->addr_bcc)) $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
if (!empty($this->addr_cc)) $this->message->setCc($this->getArrayAddress($this->addr_cc));
if (!empty($this->addr_bcc)) $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
//if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to));
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from));
} else {
@ -641,15 +641,15 @@ class CMailFile
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS';
if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_' . $smtpContextKey;
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_' . $smtpContextKey;
$keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_' . $smtpContextKey;
$keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_' . $smtpContextKey;
$keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_' . $smtpContextKey;
$keyfortls = 'MAIN_MAIL_EMAIL_TLS_' . $smtpContextKey;
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_' . $smtpContextKey;
$keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_'.$smtpContextKey;
$keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_'.$smtpContextKey;
$keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_'.$smtpContextKey;
$keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_'.$smtpContextKey;
$keyfortls = 'MAIN_MAIL_EMAIL_TLS_'.$smtpContextKey;
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_'.$smtpContextKey;
}
}

View File

@ -1664,9 +1664,9 @@ class ExtraFields
$translabel = $langs->trans($obj->$field_toshow);
}
if ($translabel != $field_toshow) {
$value .= dol_trunc($translabel, 18) . ' ';
$value .= dol_trunc($translabel, 18).' ';
} else {
$value .= $obj->$field_toshow . ' ';
$value .= $obj->$field_toshow.' ';
}
}
} else {
@ -1681,7 +1681,7 @@ class ExtraFields
}
}
} else {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$toprint = array();
$obj = $this->db->fetch_object($resql);
@ -1689,7 +1689,7 @@ class ExtraFields
$c->fetch($obj->rowid);
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
foreach ($ways as $way) {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
}
$value = '<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">'.implode(' ', $toprint).'</ul></div>';
}
@ -1762,9 +1762,9 @@ class ExtraFields
$translabel = $langs->trans($obj->$field_toshow);
}
if ($translabel != $field_toshow) {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">' . dol_trunc($translabel, 18) . '</li>';
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
} else {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">' . $obj->$field_toshow . '</li>';
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->$field_toshow.'</li>';
}
}
} else {
@ -1773,15 +1773,15 @@ class ExtraFields
$translabel = $langs->trans($obj->{$InfoFieldList[1]});
}
if ($translabel != $obj->{$InfoFieldList[1]}) {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">' . dol_trunc($translabel, 18) . '</li>';
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.dol_trunc($translabel, 18).'</li>';
} else {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">' . $obj->{$InfoFieldList[1]} . '</li>';
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories" style="background: #aaa">'.$obj->{$InfoFieldList[1]}.'</li>';
}
}
}
}
} else {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$toprint = array();
while ($obj = $this->db->fetch_object($resql)) {
@ -1790,7 +1790,7 @@ class ExtraFields
$c->fetch($obj->rowid);
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
foreach ($ways as $way) {
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ? ' style="background: #' . $c->color . ';"' : ' style="background: #aaa"') . '>' . img_object('', 'category') . ' ' . $way . '</li>';
$toprint[] = '<li class="select2-search-choice-dolibarr noborderoncategories"'.($c->color ? ' style="background: #'.$c->color.';"' : ' style="background: #aaa"').'>'.img_object('', 'category').' '.$way.'</li>';
}
}
}
@ -1975,7 +1975,7 @@ class ExtraFields
foreach ($extralabels as $key => $value)
{
if (!empty($onlykey) && $onlykey != '@GETPOSTISSET' && $key != $onlykey) continue;
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && ! GETPOSTISSET('options_'.$key)) continue;
if (!empty($onlykey) && $onlykey == '@GETPOSTISSET' && !GETPOSTISSET('options_'.$key)) continue;
$key_type = $this->attributes[$object->table_element]['type'][$key];
if ($key_type == 'separate') continue;

View File

@ -855,7 +855,7 @@ class FormMail extends Form
{
$out .= '<div id="attachfile_'.$key.'">';
// Preview of attachment
preg_match('#^(/)(\w+)(/)(.+)$#', substr($val, (strlen(DOL_DATA_ROOT)-strlen($val))), $formfile_params);
preg_match('#^(/)(\w+)(/)(.+)$#', substr($val, (strlen(DOL_DATA_ROOT) - strlen($val))), $formfile_params);
$out .= img_mime($listofnames[$key]).' '.$listofnames[$key];
$out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]);
if (!$this->withfilereadonly)
@ -956,13 +956,13 @@ class FormMail extends Form
$atleastonecomponentishtml++;
}
if ($atleastonecomponentishtml) {
if (! dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
if (!dol_textishtml($this->substit['__USER_SIGNATURE__'])) {
$this->substit['__USER_SIGNATURE__'] = dol_nl2br($this->substit['__USER_SIGNATURE__']);
}
if (! dol_textishtml($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'])) {
if (!dol_textishtml($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'])) {
$this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__'] = dol_nl2br($this->substit['__ONLINE_PAYMENT_TEXT_AND_URL__']);
}
if (! dol_textishtml($defaultmessage)) {
if (!dol_textishtml($defaultmessage)) {
$defaultmessage = dol_nl2br($defaultmessage);
}
}

View File

@ -255,7 +255,7 @@ function getDefaultDatesForTransfer()
// Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
$periodbydefaultontransfer = $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER;
isset($periodbydefaultontransfer)?$periodbydefaultontransfer:0;
isset($periodbydefaultontransfer) ? $periodbydefaultontransfer : 0;
if ($periodbydefaultontransfer == 2) {
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear ";
$sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
@ -284,15 +284,15 @@ function getDefaultDatesForTransfer()
$pastmonthyear = $year_current;
if ($pastmonth == 0) {
$pastmonth = 12;
$pastmonthyear --;
$pastmonthyear--;
}
} else {
$year_current = strftime("%Y", dol_now());
$pastmonth = strftime("%m", dol_now())-1;
$pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current;
if ($pastmonth == 0) {
$pastmonth = 12;
$pastmonthyear --;
$pastmonthyear--;
}
}

View File

@ -1402,32 +1402,32 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
}
if (! empty($search_start) && ! empty($search_end)) {
if (!empty($search_start) && !empty($search_end)) {
$sql .= " AND ((a.datep BETWEEN '$search_start' AND '$search_end') OR (a.datep2 BETWEEN '$search_start' AND '$search_end'))";
}
elseif (empty($search_start) && ! empty($search_end)) {
elseif (empty($search_start) && !empty($search_end)) {
$sql .= " AND ((a.datep <= '$search_end') OR (a.datep2 <= '$search_end'))";
}
elseif (! empty($search_start) && empty($search_end)) {
elseif (!empty($search_start) && empty($search_end)) {
$sql .= " AND ((a.datep >= '$search_start') OR (a.datep2 >= '$search_start'))";
}
if (is_array($actioncode) && ! empty($actioncode)) {
if (is_array($actioncode) && !empty($actioncode)) {
$sql .= ' AND (';
foreach ($actioncode as $key => $code) {
if ($key != 0) $sql .= "OR (";
if (! empty($code)) addEventTypeSQL($sql, $code, $donetodo, $now, $filters, "");
if (!empty($code)) addEventTypeSQL($sql, $code, $donetodo, $now, $filters, "");
if ($key != 0) $sql .= ")";
}
$sql .= ')';
}
elseif (! empty($actioncode)) addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters);
elseif (!empty($actioncode)) addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters);
if (is_array($actioncode)) {
foreach ($actioncode as $code) {
$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
if (! empty($sql2)) {
if (! empty($sql)) $sql = $sql." UNION ".$sql2;
if (!empty($sql2)) {
if (!empty($sql)) $sql = $sql." UNION ".$sql2;
elseif (empty($sql)) $sql = $sql2;
break;
}
@ -1435,10 +1435,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
else {
$sql2 = addMailingEventTypeSQL($actioncode, $objcon, $filterobj);
if (! empty($sql) && ! empty($sql2)) {
if (!empty($sql) && !empty($sql2)) {
$sql = $sql." UNION ".$sql2;
}
elseif (empty($sql) && ! empty($sql2)) {
elseif (empty($sql) && !empty($sql2)) {
$sql = $sql2;
}
}

View File

@ -1063,10 +1063,10 @@ function dol_syslog($message, $level = LOG_INFO, $ident = 0, $suffixinfilename =
if (empty($conf->syslog->enabled)) return;
// Check if we are into execution of code of a website
if (defined('USEEXTERNALSERVER') && ! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) {
if (defined('USEEXTERNALSERVER') && !defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) {
global $website, $websitekey;
if (is_object($website) && ! empty($website->ref)) $suffixinfilename.='_website_'.$website->ref;
elseif (! empty($websitekey)) $suffixinfilename.='_website_'.$websitekey;
if (is_object($website) && !empty($website->ref)) $suffixinfilename .= '_website_'.$website->ref;
elseif (!empty($websitekey)) $suffixinfilename .= '_website_'.$websitekey;
}
if ($ident < 0)

View File

@ -41,7 +41,7 @@ function image_format_supported($file, $acceptsvg = 0)
global $conf;
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php
if ($acceptsvg || ! empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)) {
if ($acceptsvg || !empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)) {
$regeximgext .= '|\.svg'; // Not allowed by default. SVG can contains javascript
}

View File

@ -385,16 +385,16 @@ function print_left_auguria_menu($db, $menu_array_before, $menu_array_after, &$t
$nature = '';
// Must match array $sourceList defined into journals_list.php
if ($objp->nature == 2 && ! empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) $nature="sells";
if ($objp->nature == 2 && !empty($conf->facture->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)) $nature = "sells";
if ($objp->nature == 3
&& (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled))
&& empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES))
$nature = "purchases";
if ($objp->nature == 4 && ! empty($conf->banque->enabled)) $nature="bank";
if ($objp->nature == 5 && ! empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) $nature="expensereports";
if ($objp->nature == 1) $nature="various";
if ($objp->nature == 8) $nature="inventory";
if ($objp->nature == 9) $nature="hasnew";
if ($objp->nature == 4 && !empty($conf->banque->enabled)) $nature = "bank";
if ($objp->nature == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) $nature = "expensereports";
if ($objp->nature == 1) $nature = "various";
if ($objp->nature == 8) $nature = "inventory";
if ($objp->nature == 9) $nature = "hasnew";
// To enable when page exists
if (empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL))

View File

@ -426,13 +426,13 @@ if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dat
$prefillDates = false;
if (!empty($conf->global->MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE) && ! empty($object->lines))
if (!empty($conf->global->MAIN_FILL_SERVICE_DATES_FROM_LAST_SERVICE_LINE) && !empty($object->lines))
{
for ($i = count($object->lines) - 1; $i >= 0; $i--)
{
$lastline = $object->lines[$i];
if ($lastline->product_type == Product::TYPE_SERVICE && (! empty($lastline->date_start) || ! empty($lastline->date_end)))
if ($lastline->product_type == Product::TYPE_SERVICE && (!empty($lastline->date_start) || !empty($lastline->date_end)))
{
$date_start_prefill = $lastline->date_start;
$date_end_prefill = $lastline->date_end;
@ -459,7 +459,7 @@ if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dat
if ($prefillDates)
{
echo ' <span class="small"><a href="#" id="prefill_service_dates">' . $langs->trans('FillWithLastServiceDates') . '</a></span>';
echo ' <span class="small"><a href="#" id="prefill_service_dates">'.$langs->trans('FillWithLastServiceDates').'</a></span>';
}
print '<script>';

View File

@ -197,9 +197,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectAdmin');
$message_admin = $langs->transnoentities('TicketNewEmailBodyAdmin', $object->track_id).'<br><br>';
$message_admin .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_admin .= '<li>' . $langs->trans('Type') . ' : ' . $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code) . '</li>';
$message_admin .= '<li>' . $langs->trans('Category') . ' : ' . $langs->getLabelFromKey($this->db, 'TicketCategoryShort' . $object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code) . '</li>';
$message_admin .= '<li>' . $langs->trans('Severity') . ' : ' . $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code) . '</li>';
$message_admin .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
$message_admin .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
$message_admin .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
$message_admin .= '<li>'.$langs->trans('From').' : '.($object->email_from ? $object->email_from : ($object->fk_user_create > 0 ? $langs->trans('Internal') : '')).'</li>';
// Extrafields
$extraFields = new ExtraFields($this->db);
@ -207,7 +207,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
if (is_array($object->array_options) && count($object->array_options) > 0) {
foreach ($object->array_options as $key => $value) {
$key = substr($key, 8); // remove "options_"
$message_admin .= '<li>' . $langs->trans($extraFields->attributes[$object->element]['label'][$key]) . ' : ' . $extraFields->showOutputField($key, $value) . '</li>';
$message_admin .= '<li>'.$langs->trans($extraFields->attributes[$object->element]['label'][$key]).' : '.$extraFields->showOutputField($key, $value).'</li>';
}
}
$message_admin .= '</ul>';
@ -267,9 +267,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
$subject = '['.$conf->global->MAIN_INFO_SOCIETE_NOM.'] '.$langs->transnoentities('TicketNewEmailSubjectCustomer');
$message_customer = $langs->transnoentities('TicketNewEmailBodyCustomer', $object->track_id).'<br><br>';
$message_customer .= '<ul><li>'.$langs->trans('Title').' : '.$object->subject.'</li>';
$message_customer .= '<li>' . $langs->trans('Type') . ' : ' . $langs->getLabelFromKey($this->db, 'TicketTypeShort' . $object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code) . '</li>';
$message_customer .= '<li>' . $langs->trans('Category') . ' : ' . $langs->getLabelFromKey($this->db, 'TicketCategoryShort' . $object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code) . '</li>';
$message_customer .= '<li>' . $langs->trans('Severity') . ' : ' . $langs->getLabelFromKey($this->db, 'TicketSeverityShort' . $object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code) . '</li>';
$message_customer .= '<li>'.$langs->trans('Type').' : '.$langs->getLabelFromKey($this->db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code).'</li>';
$message_customer .= '<li>'.$langs->trans('Category').' : '.$langs->getLabelFromKey($this->db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code).'</li>';
$message_customer .= '<li>'.$langs->trans('Severity').' : '.$langs->getLabelFromKey($this->db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code).'</li>';
// Extrafields
foreach ($this->attributes[$object->table_element]['label'] as $key => $value)

View File

@ -4,7 +4,7 @@
* Simple autoloader, so we don't need Composer just for this.
*/
spl_autoload_register(function ($class) {
spl_autoload_register(function($class) {
if (preg_match('/^DebugBar/', $class)) {
$file = DOL_DOCUMENT_ROOT.'/includes/maximebf/debugbar/src/'.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
//var_dump($class.' - '.file_exists($file).' - '.$file);

View File

@ -450,14 +450,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db);
$dashboardlines[$board->element . '_toapprove'] = $board->load_board($user, 'toapprove');
$dashboardlines[$board->element.'_toapprove'] = $board->load_board($user, 'toapprove');
}
// Number of expense reports to pay
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db);
$dashboardlines[$board->element . '_topay'] = $board->load_board($user, 'topay');
$dashboardlines[$board->element.'_topay'] = $board->load_board($user, 'topay');
}
// Number of holidays to approve

View File

@ -2210,7 +2210,7 @@ class Product extends CommonObject
}
}*/
} else {
$this->error=$this->db->lasterror;
$this->error = $this->db->lasterror;
return -1;
}
}
@ -2255,12 +2255,12 @@ class Product extends CommonObject
}
$this->prices_by_qty_list[0] = $resultat;
} else {
$this->error=$this->db->lasterror;
$this->error = $this->db->lasterror;
return -1;
}
}
} else {
$this->error=$this->db->lasterror;
$this->error = $this->db->lasterror;
return -1;
}
} elseif (!empty($conf->global->PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES) && empty($ignore_price_load)) // prices per customer and quantity
@ -2314,12 +2314,12 @@ class Product extends CommonObject
}
$this->prices_by_qty_list[$i] = $resultat;
} else {
$this->error=$this->db->lasterror;
$this->error = $this->db->lasterror;
return -1;
}
}
} else {
$this->error=$this->db->lasterror;
$this->error = $this->db->lasterror;
return -1;
}
}
@ -2346,7 +2346,7 @@ class Product extends CommonObject
return 0;
}
} else {
$this->error=$this->db->lasterror;
$this->error = $this->db->lasterror;
return -1;
}
}
@ -4769,7 +4769,7 @@ class Product extends CommonObject
if ($result < 0) dol_print_error($this->db, $this->error);
$stock_sending_client = $this->stats_expedition['qty'];
}
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || ! empty($conf->supplier_order->enabled))
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled))
{
$filterStatus = '1,2,3,4';
if (isset($includedraftpoforvirtual)) $filterStatus = '0,'.$filterStatus;

View File

@ -447,9 +447,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Documents
if ($includedocgeneration) {
$objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref . '/' . $objref . '.pdf';
$relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->mymodule->dir_output.'/'.$object->element.'/'.$objref;
$urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = $user->rights->mymodule->myobject->read; // If you can read, you can build the PDF to read content
$delallowed = $user->rights->mymodule->myobject->write; // If you can create/edit, you can remove a file on card
print $formfile->showdocuments('mymodule:MyObject', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);

View File

@ -133,7 +133,7 @@ if (empty($reshook))
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Product")), null, 'errors');
}
if (! $error && ! empty($conf->productbatch->enabled)) {
if (!$error && !empty($conf->productbatch->enabled)) {
$tmpproduct = new Product($db);
$result = $tmpproduct->fetch($fk_product);

View File

@ -219,7 +219,7 @@ $arrayfields = array(
);
// MultiPrices
if ($conf->global->PRODUIT_MULTIPRICES){
if ($conf->global->PRODUIT_MULTIPRICES) {
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
{
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL'.$i;
@ -753,7 +753,7 @@ if ($resql)
}
// Multiprice
if ($conf->global->PRODUIT_MULTIPRICES){
if ($conf->global->PRODUIT_MULTIPRICES) {
foreach ($arraypricelevel as $key => $value)
{
if (!empty($arrayfields['p.sellprice'.$key]['checked']))
@ -905,7 +905,7 @@ if ($resql)
}
// Multiprices
if ($conf->global->PRODUIT_MULTIPRICES){
if ($conf->global->PRODUIT_MULTIPRICES) {
foreach ($arraypricelevel as $key => $value)
{
if (!empty($arrayfields['p.sellprice'.$key]['checked']))
@ -1265,7 +1265,7 @@ if ($resql)
// Multiprices
if ($conf->global->PRODUIT_MULTIPRICES){
if ($conf->global->PRODUIT_MULTIPRICES) {
foreach ($arraypricelevel as $key => $value)
{
if (!empty($arrayfields['p.sellprice'.$key]['checked']))

View File

@ -736,7 +736,7 @@ class Entrepot extends CommonObject
$result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto != 2) $result .= (($showfullpath || !empty($conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO)) ? $this->get_full_arbo() : (empty($this->label)?$this->libelle:$this->label));
if ($withpicto != 2) $result .= (($showfullpath || !empty($conf->global->STOCK_ALWAYS_SHOW_FULL_ARBO)) ? $this->get_full_arbo() : (empty($this->label) ? $this->libelle : $this->label));
$result .= $linkend;
global $action;

View File

@ -492,7 +492,7 @@ class Project extends CommonObject
$sql .= " WHERE entity IN (".getEntity('project').")";
if (!empty($ref)) {
$sql .= " AND ref = '".$this->db->escape($ref)."'";
} elseif (! empty($ref_ext)) {
} elseif (!empty($ref_ext)) {
$sql .= " AND ref_ext = '".$this->db->escape($ref_ext)."'";
} else {
$sql .= " AND email_msgid = '".$this->db->escape($email_msgid)."'";

View File

@ -321,14 +321,14 @@ $NBMAX = 3;
$max = 3;
// Last modified job position
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
{
$sql = "SELECT s.rowid, s.ref, s.label, s.date_creation, s.tms, s.status";
$sql.= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.fk_soc = $socid";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE s.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND s.fk_soc = $socid";
$sql .= " ORDER BY s.tms DESC";
$sql .= $db->plimit($max, 0);
@ -379,15 +379,15 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitm
}
// Last modified job position
if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
if (!empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitmentjobposition->read)
{
$sql = "SELECT rc.rowid, rc.ref, rc.email, rc.lastname, rc.firstname, rc.date_creation, rc.tms, rc.status";
$sql.= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = " .$user->id;
if ($socid) $sql.= " AND s.fk_soc = $socid";
$sql .= " FROM ".MAIN_DB_PREFIX."recruitment_recruitmentcandidature as rc";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."recruitment_recruitmentjobposition as s ON rc.fk_recruitmentjobposition = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= " WHERE rc.entity IN (".getEntity($staticrecruitmentjobposition->element).")";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.fk_soc = sc.fk_soc AND sc.fk_user = ".$user->id;
if ($socid) $sql .= " AND s.fk_soc = $socid";
$sql .= " ORDER BY rc.tms DESC";
$sql .= $db->plimit($max, 0);
@ -409,9 +409,9 @@ if (! empty($conf->recruitment->enabled) && $user->rights->recruitment->recruitm
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$staticrecruitmentcandidature->id=$objp->rowid;
$staticrecruitmentcandidature->ref=$objp->ref;
$staticrecruitmentcandidature->email=$objp->email;
$staticrecruitmentcandidature->id = $objp->rowid;
$staticrecruitmentcandidature->ref = $objp->ref;
$staticrecruitmentcandidature->email = $objp->email;
$staticrecruitmentcandidature->status = $objp->status;
$staticrecruitmentcandidature->date_creation = $objp->date_creation;
$staticrecruitmentcandidature->firstname = $objp->firstname;

View File

@ -345,7 +345,7 @@ class Stripe extends CommonObject
$paymentintent = null;
if (is_object($object) && ! empty($conf->global->STRIPE_REUSE_EXISTING_INTENT_IF_FOUND))
if (is_object($object) && !empty($conf->global->STRIPE_REUSE_EXISTING_INTENT_IF_FOUND))
{
// Warning. If a payment was tried and failed, a payment intent was created.
// But if we change something on object to pay (amount or other that does not change the idempotency key), reusing same payment intent is not allowed by Stripe.
@ -572,7 +572,7 @@ class Stripe extends CommonObject
// list of payment method types
$paymentmethodtypes = array("card");
if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT) ) $paymentmethodtypes[] = "sepa_debit"; //&& ($object->thirdparty->isInEEC())
if (!empty($conf->global->STRIPE_SEPA_DIRECT_DEBIT)) $paymentmethodtypes[] = "sepa_debit"; //&& ($object->thirdparty->isInEEC())
// iDEAL not supported with setupIntent
$dataforintent = array(

View File

@ -138,7 +138,7 @@ if (empty($reshook)) {
if ($cancel) {
if (!empty($backtopage)) {
header("Location: " . $backtopage);
header("Location: ".$backtopage);
exit;
}
@ -254,10 +254,10 @@ if (empty($reshook)) {
if (!empty($backtopage)) {
$url = $backtopage;
} else {
$url = 'card.php?track_id=' . $object->track_id;
$url = 'card.php?track_id='.$object->track_id;
}
header("Location: " . $url);
header("Location: ".$url);
exit;
} else {
$db->rollback();
@ -325,7 +325,7 @@ if (empty($reshook)) {
if ($object->markAsRead($user) > 0) {
setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs');
header("Location: card.php?track_id=" . $object->track_id . "&action=view");
header("Location: card.php?track_id=".$object->track_id."&action=view");
exit;
} else {
setEventMessages($object->error, $object->errors, 'errors');
@ -376,7 +376,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs');
header("Location: card.php?track_id=" . $object->track_id . "&action=view");
header("Location: card.php?track_id=".$object->track_id."&action=view");
exit;
} else {
array_push($object->errors, $object->error);
@ -392,10 +392,10 @@ if (empty($reshook)) {
if (!empty($backtopage)) {
$url = $backtopage;
} else {
$url = 'card.php?action=view&track_id=' . $object->track_id;
$url = 'card.php?action=view&track_id='.$object->track_id;
}
header("Location: " . $url);
header("Location: ".$url);
exit;
} else {
setEventMessages($object->error, null, 'errors');
@ -409,8 +409,8 @@ if (empty($reshook)) {
if ($object->close($user)) {
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
$url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha');
header("Location: " . $url);
$url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
header("Location: ".$url);
} else {
$action = '';
setEventMessages($object->error, $object->errors, 'errors');
@ -425,10 +425,10 @@ if (empty($reshook)) {
// Log action in ticket logs table
$log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']);
setEventMessages('<div class="confirm">' . $langs->trans('TicketMarkedAsClosed') . '</div>', null, 'mesgs');
setEventMessages('<div class="confirm">'.$langs->trans('TicketMarkedAsClosed').'</div>', null, 'mesgs');
$url = 'card.php?action=view_ticket&track_id=' . GETPOST('track_id', 'alpha');
header("Location: " . $url);
$url = 'card.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha');
header("Location: ".$url);
} else {
setEventMessages($object->error, $object->errors, 'errors');
$action = '';
@ -438,12 +438,12 @@ if (empty($reshook)) {
if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $user->rights->ticket->delete) {
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");
setEventMessages('<div class="confirm">'.$langs->trans('TicketDeletedSuccess').'</div>', null, 'mesgs');
Header("Location: ".DOL_URL_ROOT."/ticket/list.php");
exit;
} else {
$langs->load("errors");
$mesg = '<div class="error">' . $langs->trans($object->error) . '</div>';
$mesg = '<div class="error">'.$langs->trans($object->error).'</div>';
$action = '';
}
}
@ -453,8 +453,8 @@ if (empty($reshook)) {
if ($action == 'set_thirdparty' && $user->rights->societe->creer) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$result = $object->setCustomer(GETPOST('editcustomer', 'int'));
$url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha');
header("Location: " . $url);
$url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
header("Location: ".$url);
exit();
}
}
@ -463,8 +463,8 @@ if (empty($reshook)) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$result = $object->setProgression(GETPOST('progress', 'alpha'));
$url = 'card.php?action=view&track_id=' . $object->track_id;
header("Location: " . $url);
$url = 'card.php?action=view&track_id='.$object->track_id;
header("Location: ".$url);
exit();
}
}
@ -476,12 +476,12 @@ if (empty($reshook)) {
}
if ($action == 'setsubject' && empty($object->subject)) {
$mesg .= ($mesg ? '<br>' : '') . $langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject"));
$mesg .= ($mesg ? '<br>' : '').$langs->trans("ErrorFieldRequired", $langs->transnoentities("Subject"));
}
if (!$mesg) {
if ($object->update($user) >= 0) {
header("Location: " . $_SERVER['PHP_SELF'] . "?track_id=" . $object->track_id);
header("Location: ".$_SERVER['PHP_SELF']."?track_id=".$object->track_id);
exit;
}
$mesg = $object->error;
@ -498,8 +498,8 @@ if (empty($reshook)) {
// Log action in ticket logs table
$log_action = $langs->trans('TicketLogReopen');
$url = 'card.php?action=view&track_id=' . $object->track_id;
header("Location: " . $url);
$url = 'card.php?action=view&track_id='.$object->track_id;
header("Location: ".$url);
exit();
}
}
@ -508,16 +508,16 @@ if (empty($reshook)) {
elseif ($action == 'classin' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$object->setProject(GETPOST('projectid', 'int'));
$url = 'card.php?action=view&track_id=' . $object->track_id;
header("Location: " . $url);
$url = 'card.php?action=view&track_id='.$object->track_id;
header("Location: ".$url);
exit();
}
} // Categorisation dans contrat
elseif ($action == 'setcontract' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$object->setContract(GETPOST('contractid', 'int'));
$url = 'card.php?action=view&track_id=' . $object->track_id;
header("Location: " . $url);
$url = 'card.php?action=view&track_id='.$object->track_id;
header("Location: ".$url);
exit();
}
} elseif ($action == "set_message" && $user->rights->ticket->manage) {
@ -530,7 +530,7 @@ if (empty($reshook)) {
$object->message = $fieldtomodify;
$ret = $object->update($user);
if ($ret > 0) {
$log_action = $langs->trans('TicketInitialMessageModified') . " \n";
$log_action = $langs->trans('TicketInitialMessageModified')." \n";
// include the Diff class
dol_include_once('/ticket/class/utils_diff.class.php');
// output the result of comparing two files as plain text
@ -551,8 +551,8 @@ if (empty($reshook)) {
// Log action in ticket logs table
$log_action = $langs->trans('TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status]));
$url = 'card.php?action=view&track_id=' . $object->track_id;
header("Location: " . $url);
$url = 'card.php?action=view&track_id='.$object->track_id;
header("Location: ".$url);
exit();
}
}
@ -597,19 +597,19 @@ if (empty($reshook)) {
$permissiondellink = $user->rights->ticket->write;
include DOL_DOCUMENT_ROOT . '/core/actions_dellink.inc.php'; // Must be include, not include_once
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be include, not include_once
// Actions to build doc
$upload_dir = $conf->ticket->dir_output;
$permissiontoadd = $user->rights->ticket->write;
include DOL_DOCUMENT_ROOT . '/core/actions_builddoc.inc.php';
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
// Actions to send emails
$triggersendname = 'TICKET_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
$trackid = 'tic' . $object->id;
include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php';
$trackid = 'tic'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
// Set $action to correct value for the case we used presend action to add a message
if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage';
@ -1027,15 +1027,15 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
} else {
// Type
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>';
print $langs->getLabelFromKey($db, 'TicketTypeShort' . $object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
print $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
print '</td></tr>';
// Group
print '<tr><td>'.$langs->trans("TicketCategory").'</td><td>';
print $langs->getLabelFromKey($db, 'TicketCategoryShort' . $object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
print '</td></tr>';
// Severity
print '<tr><td>'.$langs->trans("TicketSeverity").'</td><td>';
print $langs->getLabelFromKey($db, 'TicketSeverityShort' . $object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
print '</td></tr>';
}
print '</table>'; // End table actions
@ -1299,7 +1299,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
}
// Show messages on card (Note: this is a duplicate of the view Events/Agenda but on the main tab)
if (! empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
if (!empty($conf->global->TICKET_SHOW_MESSAGES_ON_CARD)) {
$param = '&id='.$object->id;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
@ -1308,17 +1308,17 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$morehtmlright = '';
$messagingUrl = DOL_URL_ROOT . '/ticket/agenda.php?track_id=' . $object->track_id;
$messagingUrl = DOL_URL_ROOT.'/ticket/agenda.php?track_id='.$object->track_id;
$morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fal fa-list-alt imgforviewmode', $messagingUrl, '', 1);
// Show link to add a message (if read and not closed)
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message";
$url = 'card.php?track_id=' . $object->track_id . '&action=presend_addmessage&mode=init';
$url = 'card.php?track_id='.$object->track_id.'&action=presend_addmessage&mode=init';
$morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fal fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
// Show link to add event (if read and not closed)
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message";;
$url = dol_buildpath('/comm/action/card.php', 1) . '?action=create&datep=' . date('YmdHi') . '&origin=ticket&originid=' . $object->id . '&projectid=' . $object->fk_project . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?track_id=' . $object->track_id);
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage" && $action != "add_message"; ;
$url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fal fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus);
print_barre_liste($langs->trans("ActionsOnTicket"), 0, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', 0, -1, '', 0, $morehtmlright, '', 0, 1, 1);
@ -1352,7 +1352,7 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id);
// List of actions on element
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter);

View File

@ -1701,7 +1701,7 @@ class Ticket extends CommonObject
$error = 0;
// Valid and close fichinter linked
if (!empty($conf->ficheinter->enabled) && ! empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) {
if (!empty($conf->ficheinter->enabled) && !empty($conf->global->WORKFLOW_TICKET_CLOSE_INTERVENTION)) {
dol_syslog("We have closed the ticket, so we close all linked interventions");
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
if ($this->linkedObjectsIds)
@ -2549,23 +2549,23 @@ class Ticket extends CommonObject
// Customer company infos
$message .= '<br><br>';
$message .= "==============================================";
$message .= !empty($object->thirdparty->name) ? '<br>' . $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : '';
$message .= !empty($object->thirdparty->town) ? '<br>' . $langs->trans('Town') . " : " . $object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>' . $langs->trans('Phone') . " : " . $object->thirdparty->phone : '';
$message .= !empty($object->thirdparty->name) ? '<br>'.$langs->trans('Thirdparty')." : ".$object->thirdparty->name : '';
$message .= !empty($object->thirdparty->town) ? '<br>'.$langs->trans('Town')." : ".$object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>'.$langs->trans('Phone')." : ".$object->thirdparty->phone : '';
// Email send to
$message .= '<br><br>';
if (!empty($assigned_user_dont_have_email)) {
$message .= '<br>' . $langs->trans('NoEMail') . ' : ' . $assigned_user_dont_have_email;
$message .= '<br>'.$langs->trans('NoEMail').' : '.$assigned_user_dont_have_email;
}
foreach ($sendto as $val) {
$message .= '<br>' . $langs->trans('TicketNotificationRecipient') . ' : ' . $val;
$message .= '<br>'.$langs->trans('TicketNotificationRecipient').' : '.$val;
}
// URL ticket
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id;
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id;
$message .= '<br><br>';
$message .= $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : <a href="' . $url_internal_ticket . '">' . $object->track_id . '</a>';
$message .= $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : <a href="'.$url_internal_ticket.'">'.$object->track_id.'</a>';
$this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames);
}
@ -2602,9 +2602,9 @@ class Ticket extends CommonObject
// Coordonnées client
$message .= '<br><br>';
$message .= "==============================================<br>";
$message .= !empty($object->thirdparty->name) ? $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : '';
$message .= !empty($object->thirdparty->town) ? '<br>' . $langs->trans('Town') . " : " . $object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>' . $langs->trans('Phone') . " : " . $object->thirdparty->phone : '';
$message .= !empty($object->thirdparty->name) ? $langs->trans('Thirdparty')." : ".$object->thirdparty->name : '';
$message .= !empty($object->thirdparty->town) ? '<br>'.$langs->trans('Town')." : ".$object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>'.$langs->trans('Phone')." : ".$object->thirdparty->phone : '';
// Build array to display recipient list
foreach ($internal_contacts as $key => $info_sendto) {
@ -2614,19 +2614,19 @@ class Ticket extends CommonObject
}
if ($info_sendto['email'] != '') {
if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname'] . " " . $info_sendto['lastname']) . " <" . $info_sendto['email'] . ">";
if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
//Contact type
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1') . ' (' . strtolower($info_sendto['libelle']) . ')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . '<br>' : '');
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'<br>' : '');
}
}
$message .= '<br>';
// URL ticket
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2) . '?track_id=' . $object->track_id;
$url_internal_ticket = dol_buildpath('/ticket/card.php', 2).'?track_id='.$object->track_id;
// altairis: make html link on url
$message .= '<br>' . $langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal') . ' : <a href="' . $url_internal_ticket . '">' . $object->track_id . '</a><br>';
$message .= '<br>'.$langs->trans('TicketNotificationEmailBodyInfosTrackUrlinternal').' : <a href="'.$url_internal_ticket.'">'.$object->track_id.'</a><br>';
// Add global email address recipient
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) {
@ -2688,23 +2688,23 @@ class Ticket extends CommonObject
}
if ($info_sendto['email'] != '' && $info_sendto['email'] != $object->origin_email) {
if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname'] . " " . $info_sendto['lastname']) . " <" . $info_sendto['email'] . ">";
if (!empty($info_sendto['email'])) $sendto[] = trim($info_sendto['firstname']." ".$info_sendto['lastname'])." <".$info_sendto['email'].">";
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1') . ' (' . strtolower($info_sendto['libelle']) . ')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . '<br>' : '');
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'<br>' : '');
}
}
// If public interface is not enable, use link to internal page into mail
$url_public_ticket = (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ?
(!empty($conf->global->TICKET_URL_PUBLIC_INTERFACE) ? $conf->global->TICKET_URL_PUBLIC_INTERFACE . '/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)) . '?track_id=' . $object->track_id;
$message .= '<br>' . $langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer') . ' : <a href="' . $url_public_ticket . '">' . $object->track_id . '</a><br>';
(!empty($conf->global->TICKET_URL_PUBLIC_INTERFACE) ? $conf->global->TICKET_URL_PUBLIC_INTERFACE.'/view.php' : dol_buildpath('/public/ticket/view.php', 2)) : dol_buildpath('/ticket/card.php', 2)).'?track_id='.$object->track_id;
$message .= '<br>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$object->track_id.'</a><br>';
// Build final message
$message = $message_intro . '<br><br>' . $message;
$message = $message_intro.'<br><br>'.$message;
// Add signature
$message .= '<br>' . $message_signature;
$message .= '<br>'.$message_signature;
if (!empty($object->origin_email)) {
$sendto[] = $object->origin_email;

View File

@ -100,9 +100,9 @@ foreach ($object->fields as $key => $val)
{
if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label'];
}
$fieldstosearchall['s.name_alias']="AliasNameShort";
$fieldstosearchall['s.zip']="Zip";
$fieldstosearchall['s.town']="Town";
$fieldstosearchall['s.name_alias'] = "AliasNameShort";
$fieldstosearchall['s.zip'] = "Zip";
$fieldstosearchall['s.town'] = "Town";
// Definition of fields for list
$arrayfields = array();
@ -755,13 +755,13 @@ while ($i < min($num, $limit))
print '>';
if ($key == 'fk_statut') print $object->getLibStatut(5);
elseif ($key == 'type_code') {
$s = $langs->getLabelFromKey($db, 'TicketTypeShort' . $object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
$s = $langs->getLabelFromKey($db, 'TicketTypeShort'.$object->type_code, 'c_ticket_type', 'code', 'label', $object->type_code);
print '<span title="'.$s.'">';
print $s;
print '</span>';
}
elseif ($key == 'category_code') print $langs->getLabelFromKey($db, 'TicketCategoryShort' . $object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
elseif ($key == 'severity_code') print $langs->getLabelFromKey($db, 'TicketSeverityShort' . $object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
elseif ($key == 'category_code') print $langs->getLabelFromKey($db, 'TicketCategoryShort'.$object->category_code, 'c_ticket_category', 'code', 'label', $object->category_code);
elseif ($key == 'severity_code') print $langs->getLabelFromKey($db, 'TicketSeverityShort'.$object->severity_code, 'c_ticket_severity', 'code', 'label', $object->severity_code);
elseif ($key == 'tms') print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
elseif ($key == 'fk_user_create') {
if ($object->fk_user_create > 0) {

View File

@ -303,7 +303,7 @@ if ($object->id > 0)
print '<td colspan="2">&nbsp;</td>';
// Module id
if ($user->admin) print '<td class="right">'. $objMod->numero.'</td>';
if ($user->admin) print '<td class="right">'.$objMod->numero.'</td>';
print '</tr>';
}

View File

@ -365,7 +365,7 @@ if ($result)
print '<td>&nbsp;</td>';
// Module Id
if ($user->admin) print '<td class="right">'. $objMod->numero.'</td>';
if ($user->admin) print '<td class="right">'.$objMod->numero.'</td>';
print '</tr>'."\n";
}

View File

@ -165,11 +165,11 @@ class ProductCombination
/**
* for auto retrocompatibility with last behavior
*/
if ($fk_price_level>0){
if ($fk_price_level > 0) {
$combination_price_levels[$fk_price_level] = ProductCombinationLevel::createFromParent($this->db, $this, $fk_price_level);
}
else {
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++){
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$combination_price_levels[$i] = ProductCombinationLevel::createFromParent($this->db, $this, $i);
}
}
@ -783,16 +783,16 @@ class ProductCombination
$newcomb->variation_weight = $weight_impact;
// Init price level
if ($conf->global->PRODUIT_MULTIPRICES){
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++){
if ($conf->global->PRODUIT_MULTIPRICES) {
for ($i = 1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) {
$productCombinationLevel = new ProductCombinationLevel($this->db);
$productCombinationLevel->fk_product_attribute_combination = $newcomb->id;
$productCombinationLevel->fk_price_level = $i;
$productCombinationLevel->variation_price = $price_impact[$i];
if (is_array($price_var_percent)){
if (is_array($price_var_percent)) {
$productCombinationLevel->variation_price_percentage = (empty($price_var_percent[$i]) ? false : $price_var_percent[$i]);
}else {
} else {
$productCombinationLevel->variation_price_percentage = $price_var_percent;
}