Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/compta/facture/class/facture.class.php
This commit is contained in:
Laurent Destailleur 2020-09-09 12:51:55 +02:00
commit d236e21639
69 changed files with 17747 additions and 17747 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"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
print '<td class="liste_titre"></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>'; 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"></td>';
} }
print '<td class="liste_titre center">'; 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("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("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $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("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 '); 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>'; print '<td>'.$expensereportstatic->getNomUrl(1).'</td>';
// Date validation // 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>'; 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"><input type="text" name="search_login" class="maxwidth50" value="'.$search_login.'"></td>';
print '<td class="liste_titre"></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>'; 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"></td>';
} }
print '<td class="liste_titre center nowraponall minwidth100imp">'; 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("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("LineId", $_SERVER["PHP_SELF"], "erd.rowid", "", $param, '', $sortfield, $sortorder);
print_liste_field_titre("ExpenseReport", $_SERVER["PHP_SELF"], "er.ref", "", $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("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 '); 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>'; print '<td>'.$expensereport_static->getNomUrl(1).'</td>';
// Date validation // 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>'; 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); $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; //print $param;
header("Location: ".DOL_URL_ROOT.'/comm/action/list.php?'.$param); header("Location: ".DOL_URL_ROOT.'/comm/action/list.php?'.$param);
exit; exit;

View File

@ -1291,21 +1291,21 @@ if ($resql)
foreach ($toselect as $checked) { foreach ($toselect as $checked) {
if ($tmpproposal->fetch($checked)) { if ($tmpproposal->fetch($checked)) {
if ($tmpproposal->statut == 0) { if ($tmpproposal->statut == 0) {
if ($tmpproposal->valid($user)){ if ($tmpproposal->valid($user)) {
setEventMessage($tmpproposal->ref . " " . $langs->trans('PassedInOpenStatus'), 'mesgs'); setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
} else { } else {
setEventMessage($langs->trans('CantBeValidated'), 'errors'); setEventMessage($langs->trans('CantBeValidated'), 'errors');
$error++; $error++;
} }
} else { } else {
setEventMessage($tmpproposal->ref . " " . $langs->trans('IsNotADraft'), 'errors'); setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors');
$error++; $error++;
} }
} }
dol_print_error($db); dol_print_error($db);
$error++; $error++;
} }
if ($error){ if ($error) {
$db->rollback(); $db->rollback();
} else { } else {
$db->commit(); $db->commit();
@ -1323,13 +1323,13 @@ if ($resql)
if ($tmpproposal->statut == 1) { if ($tmpproposal->statut == 1) {
$tmpproposal->statut = 2; $tmpproposal->statut = 2;
if ($tmpproposal->update($user)) { if ($tmpproposal->update($user)) {
setEventMessage($tmpproposal->ref . " " . $langs->trans('Signed'), 'mesgs'); setEventMessage($tmpproposal->ref." ".$langs->trans('Signed'), 'mesgs');
} else { } else {
dol_print_error($db); dol_print_error($db);
$error++; $error++;
} }
} else { } else {
setEventMessage($tmpproposal->ref . " " . $langs->trans('CantBeSign'), 'errors'); setEventMessage($tmpproposal->ref." ".$langs->trans('CantBeSign'), 'errors');
$error++; $error++;
} }
} else { } else {
@ -1337,7 +1337,7 @@ if ($resql)
$error++; $error++;
} }
} }
if ($error){ if ($error) {
$db->rollback(); $db->rollback();
} else { } else {
$db->commit(); $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) // 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 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 // Get the dates
$start = dol_getdate($line->date_start); $start = dol_getdate($line->date_start);
$end = dol_getdate($line->date_end); $end = dol_getdate($line->date_end);
@ -5157,7 +5157,7 @@ class FactureLigne extends CommonInvoiceLine
$this->db->begin(); $this->db->begin();
// Mise a jour ligne en base // Update line in database
$sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."facturedet SET";
$sql .= " description='".$this->db->escape($this->desc)."'"; $sql .= " description='".$this->db->escape($this->desc)."'";
$sql .= ", ref_ext='".$this->db->escape($this->ref_ext)."'"; $sql .= ", ref_ext='".$this->db->escape($this->ref_ext)."'";

View File

@ -1355,7 +1355,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$object->fetch_thirdparty(); $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) if ($object->thirdparty->client == 2 || $object->thirdparty->client == 3)
{ {
print '<br>'; print '<br>';
@ -1368,11 +1368,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">'; print '<table width="100%" class="nobordernopadding"><tr><td class="nowrap">';
print $langs->trans('ProspectLevel'); print $langs->trans('ProspectLevel');
print '<td>'; 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 '</tr></table>';
print '</td><td>'; print '</td><td>';
if ($action == 'editlevel') { 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 { } else {
print $object->getLibProspLevel(); print $object->getLibProspLevel();
} }
@ -1381,13 +1381,13 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
// Status of prospection // Status of prospection
$object->loadCacheOfProspStatus(); $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 ' &nbsp; &nbsp; ';
print '<div class="floatright">'; print '<div class="floatright">';
foreach ($object->cacheprospectstatus as $key => $val) { foreach ($object->cacheprospectstatus as $key => $val) {
$titlealt = 'default'; $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 (!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>'; print '</div></td></tr>';

View File

@ -170,7 +170,7 @@ class CMailFile
$this->sendmode = ''; $this->sendmode = '';
if (!empty($this->sendcontext)) { if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext); $smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_' . $smtpContextKey; $keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode}; $smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$this->sendmode = $smtpContextSendMode; $this->sendmode = $smtpContextSendMode;
@ -443,9 +443,9 @@ class CMailFile
// Set the From address with an associative array // Set the From address with an associative array
//$this->message->setFrom(array('john@doe.com' => 'John Doe')); //$this->message->setFrom(array('john@doe.com' => 'John Doe'));
if (! empty($this->addr_from)) { if (!empty($this->addr_from)) {
try { 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 // 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 $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); $emailMatchs = preg_match_all($regexp, $from, $adressEmailFrom);
@ -465,7 +465,7 @@ class CMailFile
} }
// Set the To addresses with an associative array // Set the To addresses with an associative array
if (! empty($this->addr_to)) { if (!empty($this->addr_to)) {
try { try {
$result = $this->message->setTo($this->getArrayAddress($this->addr_to)); $result = $this->message->setTo($this->getArrayAddress($this->addr_to));
} catch (Exception $e) { } catch (Exception $e) {
@ -473,7 +473,7 @@ class CMailFile
} }
} }
if (! empty($this->reply_to)) { if (!empty($this->reply_to)) {
try { try {
$result = $this->message->SetReplyTo($this->getArrayAddress($this->reply_to)); $result = $this->message->SetReplyTo($this->getArrayAddress($this->reply_to));
} catch (Exception $e) { } 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_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_bcc)) $this->message->setBcc($this->getArrayAddress($this->addr_bcc));
//if (! empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to)); //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)); if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) $this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from));
} else { } else {
@ -641,15 +641,15 @@ class CMailFile
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS'; $keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS';
if (!empty($this->sendcontext)) { if (!empty($this->sendcontext)) {
$smtpContextKey = strtoupper($this->sendcontext); $smtpContextKey = strtoupper($this->sendcontext);
$keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_' . $smtpContextKey; $keyForSMTPSendMode = 'MAIN_MAIL_SENDMODE_'.$smtpContextKey;
$smtpContextSendMode = $conf->global->{$keyForSMTPSendMode}; $smtpContextSendMode = $conf->global->{$keyForSMTPSendMode};
if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') { if (!empty($smtpContextSendMode) && $smtpContextSendMode != 'default') {
$keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_' . $smtpContextKey; $keyforsmtpserver = 'MAIN_MAIL_SMTP_SERVER_'.$smtpContextKey;
$keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_' . $smtpContextKey; $keyforsmtpport = 'MAIN_MAIL_SMTP_PORT_'.$smtpContextKey;
$keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_' . $smtpContextKey; $keyforsmtpid = 'MAIN_MAIL_SMTPS_ID_'.$smtpContextKey;
$keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_' . $smtpContextKey; $keyforsmtppw = 'MAIN_MAIL_SMTPS_PW_'.$smtpContextKey;
$keyfortls = 'MAIN_MAIL_EMAIL_TLS_' . $smtpContextKey; $keyfortls = 'MAIN_MAIL_EMAIL_TLS_'.$smtpContextKey;
$keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_' . $smtpContextKey; $keyforstarttls = 'MAIN_MAIL_EMAIL_STARTTLS_'.$smtpContextKey;
} }
} }

View File

@ -1664,9 +1664,9 @@ class ExtraFields
$translabel = $langs->trans($obj->$field_toshow); $translabel = $langs->trans($obj->$field_toshow);
} }
if ($translabel != $field_toshow) { if ($translabel != $field_toshow) {
$value .= dol_trunc($translabel, 18) . ' '; $value .= dol_trunc($translabel, 18).' ';
} else { } else {
$value .= $obj->$field_toshow . ' '; $value .= $obj->$field_toshow.' ';
} }
} }
} else { } else {
@ -1681,7 +1681,7 @@ class ExtraFields
} }
} }
} else { } else {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$toprint = array(); $toprint = array();
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
@ -1689,7 +1689,7 @@ class ExtraFields
$c->fetch($obj->rowid); $c->fetch($obj->rowid);
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
foreach ($ways as $way) { 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>'; $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); $translabel = $langs->trans($obj->$field_toshow);
} }
if ($translabel != $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 { } 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 { } else {
@ -1773,15 +1773,15 @@ class ExtraFields
$translabel = $langs->trans($obj->{$InfoFieldList[1]}); $translabel = $langs->trans($obj->{$InfoFieldList[1]});
} }
if ($translabel != $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 { } 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 { } else {
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$toprint = array(); $toprint = array();
while ($obj = $this->db->fetch_object($resql)) { while ($obj = $this->db->fetch_object($resql)) {
@ -1790,7 +1790,7 @@ class ExtraFields
$c->fetch($obj->rowid); $c->fetch($obj->rowid);
$ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text
foreach ($ways as $way) { 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) foreach ($extralabels as $key => $value)
{ {
if (!empty($onlykey) && $onlykey != '@GETPOSTISSET' && $key != $onlykey) continue; 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]; $key_type = $this->attributes[$object->table_element]['type'][$key];
if ($key_type == 'separate') continue; if ($key_type == 'separate') continue;

View File

@ -855,7 +855,7 @@ class FormMail extends Form
{ {
$out .= '<div id="attachfile_'.$key.'">'; $out .= '<div id="attachfile_'.$key.'">';
// Preview of attachment // 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 .= img_mime($listofnames[$key]).' '.$listofnames[$key];
$out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]);
if (!$this->withfilereadonly) if (!$this->withfilereadonly)
@ -956,13 +956,13 @@ class FormMail extends Form
$atleastonecomponentishtml++; $atleastonecomponentishtml++;
} }
if ($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__']); $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__']); $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); $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) // Period by default on transfer (0: previous month | 1: current month | 2: fiscal year)
$periodbydefaultontransfer = $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER; $periodbydefaultontransfer = $conf->global->ACCOUNTING_DEFAULT_PERIOD_ON_TRANSFER;
isset($periodbydefaultontransfer)?$periodbydefaultontransfer:0; isset($periodbydefaultontransfer) ? $periodbydefaultontransfer : 0;
if ($periodbydefaultontransfer == 2) { if ($periodbydefaultontransfer == 2) {
$sql = "SELECT date_start, date_end from ".MAIN_DB_PREFIX."accounting_fiscalyear "; $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())."'"; $sql .= " where date_start < '".$db->idate(dol_now())."' and date_end > '".$db->idate(dol_now())."'";
@ -284,15 +284,15 @@ function getDefaultDatesForTransfer()
$pastmonthyear = $year_current; $pastmonthyear = $year_current;
if ($pastmonth == 0) { if ($pastmonth == 0) {
$pastmonth = 12; $pastmonth = 12;
$pastmonthyear --; $pastmonthyear--;
} }
} else { } else {
$year_current = strftime("%Y", dol_now()); $year_current = strftime("%Y", dol_now());
$pastmonth = strftime("%m", dol_now())-1; $pastmonth = strftime("%m", dol_now()) - 1;
$pastmonthyear = $year_current; $pastmonthyear = $year_current;
if ($pastmonth == 0) { if ($pastmonth == 0) {
$pastmonth = 12; $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'))"; $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'))"; $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'))"; $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 ('; $sql .= ' AND (';
foreach ($actioncode as $key => $code) { foreach ($actioncode as $key => $code) {
if ($key != 0) $sql .= "OR ("; 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 .= ")"; if ($key != 0) $sql .= ")";
} }
$sql .= ')'; $sql .= ')';
} }
elseif (! empty($actioncode)) addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters); elseif (!empty($actioncode)) addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters);
if (is_array($actioncode)) { if (is_array($actioncode)) {
foreach ($actioncode as $code) { foreach ($actioncode as $code) {
$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj); $sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
if (! empty($sql2)) { if (!empty($sql2)) {
if (! empty($sql)) $sql = $sql." UNION ".$sql2; if (!empty($sql)) $sql = $sql." UNION ".$sql2;
elseif (empty($sql)) $sql = $sql2; elseif (empty($sql)) $sql = $sql2;
break; break;
} }
@ -1435,10 +1435,10 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
} }
else { else {
$sql2 = addMailingEventTypeSQL($actioncode, $objcon, $filterobj); $sql2 = addMailingEventTypeSQL($actioncode, $objcon, $filterobj);
if (! empty($sql) && ! empty($sql2)) { if (!empty($sql) && !empty($sql2)) {
$sql = $sql." UNION ".$sql2; $sql = $sql." UNION ".$sql2;
} }
elseif (empty($sql) && ! empty($sql2)) { elseif (empty($sql) && !empty($sql2)) {
$sql = $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; if (empty($conf->syslog->enabled)) return;
// Check if we are into execution of code of a website // 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; global $website, $websitekey;
if (is_object($website) && ! empty($website->ref)) $suffixinfilename.='_website_'.$website->ref; if (is_object($website) && !empty($website->ref)) $suffixinfilename .= '_website_'.$website->ref;
elseif (! empty($websitekey)) $suffixinfilename.='_website_'.$websitekey; elseif (!empty($websitekey)) $suffixinfilename .= '_website_'.$websitekey;
} }
if ($ident < 0) if ($ident < 0)

View File

@ -41,7 +41,7 @@ function image_format_supported($file, $acceptsvg = 0)
global $conf; global $conf;
$regeximgext = '\.gif|\.jpg|\.jpeg|\.png|\.bmp|\.webp|\.xpm|\.xbm'; // See also into product.class.php $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 $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 = ''; $nature = '';
// Must match array $sourceList defined into journals_list.php // 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 if ($objp->nature == 3
&& (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled)) && (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_invoice->enabled))
&& empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES))
$nature = "purchases"; $nature = "purchases";
if ($objp->nature == 4 && ! empty($conf->banque->enabled)) $nature="bank"; 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 == 5 && !empty($conf->expensereport->enabled) && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_EXPENSEREPORTS)) $nature = "expensereports";
if ($objp->nature == 1) $nature="various"; if ($objp->nature == 1) $nature = "various";
if ($objp->nature == 8) $nature="inventory"; if ($objp->nature == 8) $nature = "inventory";
if ($objp->nature == 9) $nature="hasnew"; if ($objp->nature == 9) $nature = "hasnew";
// To enable when page exists // To enable when page exists
if (empty($conf->global->ACCOUNTANCY_SHOW_DEVELOP_JOURNAL)) 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; $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--) for ($i = count($object->lines) - 1; $i >= 0; $i--)
{ {
$lastline = $object->lines[$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_start_prefill = $lastline->date_start;
$date_end_prefill = $lastline->date_end; $date_end_prefill = $lastline->date_end;
@ -459,7 +459,7 @@ if ((!empty($conf->service->enabled) || ($object->element == 'contrat')) && $dat
if ($prefillDates) 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>'; print '<script>';

View File

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

View File

@ -450,14 +450,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) { if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->approve) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db); $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 // Number of expense reports to pay
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) { if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->to_paid) {
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php'; include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
$board = new ExpenseReport($db); $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 // Number of holidays to approve

View File

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

View File

@ -447,9 +447,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Documents // Documents
if ($includedocgeneration) { if ($includedocgeneration) {
$objref = dol_sanitizeFileName($object->ref); $objref = dol_sanitizeFileName($object->ref);
$relativepath = $objref . '/' . $objref . '.pdf'; $relativepath = $objref.'/'.$objref.'.pdf';
$filedir = $conf->mymodule->dir_output.'/'.$object->element.'/'.$objref; $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 $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 $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); 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'); 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); $tmpproduct = new Product($db);
$result = $tmpproduct->fetch($fk_product); $result = $tmpproduct->fetch($fk_product);

View File

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

View File

@ -736,7 +736,7 @@ class Entrepot extends CommonObject
$result .= $linkstart; $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) $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; $result .= $linkend;
global $action; global $action;

View File

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

View File

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

View File

@ -345,7 +345,7 @@ class Stripe extends CommonObject
$paymentintent = null; $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. // 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. // 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 // list of payment method types
$paymentmethodtypes = array("card"); $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 // iDEAL not supported with setupIntent
$dataforintent = array( $dataforintent = array(

View File

@ -138,7 +138,7 @@ if (empty($reshook)) {
if ($cancel) { if ($cancel) {
if (!empty($backtopage)) { if (!empty($backtopage)) {
header("Location: " . $backtopage); header("Location: ".$backtopage);
exit; exit;
} }
@ -254,10 +254,10 @@ if (empty($reshook)) {
if (!empty($backtopage)) { if (!empty($backtopage)) {
$url = $backtopage; $url = $backtopage;
} else { } else {
$url = 'card.php?track_id=' . $object->track_id; $url = 'card.php?track_id='.$object->track_id;
} }
header("Location: " . $url); header("Location: ".$url);
exit; exit;
} else { } else {
$db->rollback(); $db->rollback();
@ -325,7 +325,7 @@ if (empty($reshook)) {
if ($object->markAsRead($user) > 0) { if ($object->markAsRead($user) > 0) {
setEventMessages($langs->trans('TicketMarkedAsRead'), null, 'mesgs'); 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; exit;
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@ -376,7 +376,7 @@ if (empty($reshook)) {
setEventMessages($langs->trans('TicketAssigned'), null, 'mesgs'); 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; exit;
} else { } else {
array_push($object->errors, $object->error); array_push($object->errors, $object->error);
@ -392,10 +392,10 @@ if (empty($reshook)) {
if (!empty($backtopage)) { if (!empty($backtopage)) {
$url = $backtopage; $url = $backtopage;
} else { } 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; exit;
} else { } else {
setEventMessages($object->error, null, 'errors'); setEventMessages($object->error, null, 'errors');
@ -409,8 +409,8 @@ if (empty($reshook)) {
if ($object->close($user)) { if ($object->close($user)) {
setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs'); setEventMessages($langs->trans('TicketMarkedAsClosed'), null, 'mesgs');
$url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); $url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
header("Location: " . $url); header("Location: ".$url);
} else { } else {
$action = ''; $action = '';
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
@ -425,10 +425,10 @@ if (empty($reshook)) {
// Log action in ticket logs table // Log action in ticket logs table
$log_action = $langs->trans('TicketLogClosedBy', $_SESSION['email_customer']); $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'); $url = 'card.php?action=view_ticket&track_id='.GETPOST('track_id', 'alpha');
header("Location: " . $url); header("Location: ".$url);
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
@ -438,12 +438,12 @@ if (empty($reshook)) {
if ($action == 'confirm_delete_ticket' && GETPOST('confirm', 'alpha') == "yes" && $user->rights->ticket->delete) { 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->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
if ($object->delete($user) > 0) { if ($object->delete($user) > 0) {
setEventMessages('<div class="confirm">' . $langs->trans('TicketDeletedSuccess') . '</div>', null, 'mesgs'); 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; exit;
} else { } else {
$langs->load("errors"); $langs->load("errors");
$mesg = '<div class="error">' . $langs->trans($object->error) . '</div>'; $mesg = '<div class="error">'.$langs->trans($object->error).'</div>';
$action = ''; $action = '';
} }
} }
@ -453,8 +453,8 @@ if (empty($reshook)) {
if ($action == 'set_thirdparty' && $user->rights->societe->creer) { if ($action == 'set_thirdparty' && $user->rights->societe->creer) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$result = $object->setCustomer(GETPOST('editcustomer', 'int')); $result = $object->setCustomer(GETPOST('editcustomer', 'int'));
$url = 'card.php?action=view&track_id=' . GETPOST('track_id', 'alpha'); $url = 'card.php?action=view&track_id='.GETPOST('track_id', 'alpha');
header("Location: " . $url); header("Location: ".$url);
exit(); exit();
} }
} }
@ -463,8 +463,8 @@ if (empty($reshook)) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$result = $object->setProgression(GETPOST('progress', 'alpha')); $result = $object->setProgression(GETPOST('progress', 'alpha'));
$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(); exit();
} }
} }
@ -476,12 +476,12 @@ if (empty($reshook)) {
} }
if ($action == 'setsubject' && empty($object->subject)) { 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 (!$mesg) {
if ($object->update($user) >= 0) { 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; exit;
} }
$mesg = $object->error; $mesg = $object->error;
@ -498,8 +498,8 @@ if (empty($reshook)) {
// Log action in ticket logs table // Log action in ticket logs table
$log_action = $langs->trans('TicketLogReopen'); $log_action = $langs->trans('TicketLogReopen');
$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(); exit();
} }
} }
@ -508,16 +508,16 @@ if (empty($reshook)) {
elseif ($action == 'classin' && $user->rights->ticket->write) { elseif ($action == 'classin' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$object->setProject(GETPOST('projectid', 'int')); $object->setProject(GETPOST('projectid', 'int'));
$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(); exit();
} }
} // Categorisation dans contrat } // Categorisation dans contrat
elseif ($action == 'setcontract' && $user->rights->ticket->write) { elseif ($action == 'setcontract' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) { if ($object->fetch(GETPOST('id', 'int'), '', GETPOST('track_id', 'alpha')) >= 0) {
$object->setContract(GETPOST('contractid', 'int')); $object->setContract(GETPOST('contractid', 'int'));
$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(); exit();
} }
} elseif ($action == "set_message" && $user->rights->ticket->manage) { } elseif ($action == "set_message" && $user->rights->ticket->manage) {
@ -530,7 +530,7 @@ if (empty($reshook)) {
$object->message = $fieldtomodify; $object->message = $fieldtomodify;
$ret = $object->update($user); $ret = $object->update($user);
if ($ret > 0) { if ($ret > 0) {
$log_action = $langs->trans('TicketInitialMessageModified') . " \n"; $log_action = $langs->trans('TicketInitialMessageModified')." \n";
// include the Diff class // include the Diff class
dol_include_once('/ticket/class/utils_diff.class.php'); dol_include_once('/ticket/class/utils_diff.class.php');
// output the result of comparing two files as plain text // 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 in ticket logs table
$log_action = $langs->trans('TicketLogStatusChanged', $langs->transnoentities($object->statuts_short[$old_status]), $langs->transnoentities($object->statuts_short[$new_status])); $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; $url = 'card.php?action=view&track_id='.$object->track_id;
header("Location: " . $url); header("Location: ".$url);
exit(); exit();
} }
} }
@ -597,19 +597,19 @@ if (empty($reshook)) {
$permissiondellink = $user->rights->ticket->write; $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 // Actions to build doc
$upload_dir = $conf->ticket->dir_output; $upload_dir = $conf->ticket->dir_output;
$permissiontoadd = $user->rights->ticket->write; $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 // Actions to send emails
$triggersendname = 'TICKET_SENTBYMAIL'; $triggersendname = 'TICKET_SENTBYMAIL';
$paramname = 'id'; $paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add $autocopy = 'MAIN_MAIL_AUTOCOPY_TICKET_TO'; // used to know the automatic BCC to add
$trackid = 'tic' . $object->id; $trackid = 'tic'.$object->id;
include DOL_DOCUMENT_ROOT . '/core/actions_sendmails.inc.php'; 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 // Set $action to correct value for the case we used presend action to add a message
if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage'; if (GETPOSTISSET('actionbis') && $action == 'presend') $action = 'presend_addmessage';
@ -1027,15 +1027,15 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
} else { } else {
// Type // Type
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td>'; 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>'; print '</td></tr>';
// Group // Group
print '<tr><td>'.$langs->trans("TicketCategory").'</td><td>'; 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>'; print '</td></tr>';
// Severity // Severity
print '<tr><td>'.$langs->trans("TicketSeverity").'</td><td>'; 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 '</td></tr>';
} }
print '</table>'; // End table actions 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) // 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; $param = '&id='.$object->id;
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit;
@ -1308,17 +1308,17 @@ if (empty($action) || $action == 'view' || $action == 'addlink' || $action == 'd
$morehtmlright = ''; $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); $morehtmlright .= dolGetButtonTitle($langs->trans('MessageListViewType'), '', 'fal fa-list-alt imgforviewmode', $messagingUrl, '', 1);
// Show link to add a message (if read and not closed) // 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"; $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); $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) // 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";; $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); $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); $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); 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); $morehtmlcenter .= dolGetButtonTitle($langs->trans('FullList'), '', 'fa fa-list-alt imgforviewmode', DOL_URL_ROOT.'/ticket/agenda.php?id='.$object->id);
// List of actions on element // 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); $formactions = new FormActions($db);
$somethingshown = $formactions->showactions($object, 'ticket', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter); $somethingshown = $formactions->showactions($object, 'ticket', $socid, 1, 'listactions', $MAXEVENT, '', $morehtmlcenter);

View File

@ -1701,7 +1701,7 @@ class Ticket extends CommonObject
$error = 0; $error = 0;
// Valid and close fichinter linked // 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"); dol_syslog("We have closed the ticket, so we close all linked interventions");
$this->fetchObjectLinked($this->id, $this->element, null, 'fichinter'); $this->fetchObjectLinked($this->id, $this->element, null, 'fichinter');
if ($this->linkedObjectsIds) if ($this->linkedObjectsIds)
@ -2549,23 +2549,23 @@ class Ticket extends CommonObject
// Customer company infos // Customer company infos
$message .= '<br><br>'; $message .= '<br><br>';
$message .= "=============================================="; $message .= "==============================================";
$message .= !empty($object->thirdparty->name) ? '<br>' . $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : ''; $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->town) ? '<br>'.$langs->trans('Town')." : ".$object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>' . $langs->trans('Phone') . " : " . $object->thirdparty->phone : ''; $message .= !empty($object->thirdparty->phone) ? '<br>'.$langs->trans('Phone')." : ".$object->thirdparty->phone : '';
// Email send to // Email send to
$message .= '<br><br>'; $message .= '<br><br>';
if (!empty($assigned_user_dont_have_email)) { 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) { foreach ($sendto as $val) {
$message .= '<br>' . $langs->trans('TicketNotificationRecipient') . ' : ' . $val; $message .= '<br>'.$langs->trans('TicketNotificationRecipient').' : '.$val;
} }
// URL ticket // 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 .= '<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); $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames);
} }
@ -2602,9 +2602,9 @@ class Ticket extends CommonObject
// Coordonnées client // Coordonnées client
$message .= '<br><br>'; $message .= '<br><br>';
$message .= "==============================================<br>"; $message .= "==============================================<br>";
$message .= !empty($object->thirdparty->name) ? $langs->trans('Thirdparty') . " : " . $object->thirdparty->name : ''; $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->town) ? '<br>'.$langs->trans('Town')." : ".$object->thirdparty->town : '';
$message .= !empty($object->thirdparty->phone) ? '<br>' . $langs->trans('Phone') . " : " . $object->thirdparty->phone : ''; $message .= !empty($object->thirdparty->phone) ? '<br>'.$langs->trans('Phone')." : ".$object->thirdparty->phone : '';
// Build array to display recipient list // Build array to display recipient list
foreach ($internal_contacts as $key => $info_sendto) { foreach ($internal_contacts as $key => $info_sendto) {
@ -2614,19 +2614,19 @@ class Ticket extends CommonObject
} }
if ($info_sendto['email'] != '') { 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 //Contact type
$recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1') . ' (' . strtolower($info_sendto['libelle']) . ')'; $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . '<br>' : ''); $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'<br>' : '');
} }
} }
$message .= '<br>'; $message .= '<br>';
// URL ticket // 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 // 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 // Add global email address recipient
if ($conf->global->TICKET_NOTIFICATION_ALSO_MAIN_ADDRESS && !in_array($conf->global->TICKET_NOTIFICATION_EMAIL_TO, $sendto)) { 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 ($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']) . ')'; $recipient = dolGetFirstLastname($info_sendto['firstname'], $info_sendto['lastname'], '-1').' ('.strtolower($info_sendto['libelle']).')';
$message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient') . ' : ' . $recipient . '<br>' : ''); $message .= (!empty($recipient) ? $langs->trans('TicketNotificationRecipient').' : '.$recipient.'<br>' : '');
} }
} }
// If public interface is not enable, use link to internal page into mail // If public interface is not enable, use link to internal page into mail
$url_public_ticket = (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE) ? $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; (!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>'; $message .= '<br>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$object->track_id.'</a><br>';
// Build final message // Build final message
$message = $message_intro . '<br><br>' . $message; $message = $message_intro.'<br><br>'.$message;
// Add signature // Add signature
$message .= '<br>' . $message_signature; $message .= '<br>'.$message_signature;
if (!empty($object->origin_email)) { if (!empty($object->origin_email)) {
$sendto[] = $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']; if ($val['searchall']) $fieldstosearchall['t.'.$key] = $val['label'];
} }
$fieldstosearchall['s.name_alias']="AliasNameShort"; $fieldstosearchall['s.name_alias'] = "AliasNameShort";
$fieldstosearchall['s.zip']="Zip"; $fieldstosearchall['s.zip'] = "Zip";
$fieldstosearchall['s.town']="Town"; $fieldstosearchall['s.town'] = "Town";
// Definition of fields for list // Definition of fields for list
$arrayfields = array(); $arrayfields = array();
@ -755,13 +755,13 @@ while ($i < min($num, $limit))
print '>'; print '>';
if ($key == 'fk_statut') print $object->getLibStatut(5); if ($key == 'fk_statut') print $object->getLibStatut(5);
elseif ($key == 'type_code') { 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 '<span title="'.$s.'">';
print $s; print $s;
print '</span>'; print '</span>';
} }
elseif ($key == 'category_code') print $langs->getLabelFromKey($db, 'TicketCategoryShort' . $object->category_code, 'c_ticket_category', 'code', 'label', $object->category_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 == '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 == 'tms') print dol_print_date($db->jdate($obj->$key), 'dayhour', 'tzuser');
elseif ($key == 'fk_user_create') { elseif ($key == 'fk_user_create') {
if ($object->fk_user_create > 0) { if ($object->fk_user_create > 0) {

View File

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

View File

@ -365,7 +365,7 @@ if ($result)
print '<td>&nbsp;</td>'; print '<td>&nbsp;</td>';
// Module Id // 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"; print '</tr>'."\n";
} }

View File

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