diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 4cd940f33fc..b41103ace61 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -2001,9 +2001,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $nextindextouse++; // Prepare to use next color } } - //print '|'.($color).'='.($idusertouse?$idusertouse:0).'='.$colorindex.'
'; - // Define color // @suppress-next-line PhanPluginPrintfIncompatibleArgumentType - $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); + if (isset($theme_datacolor[$colorindex])) { + $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); + } elseif (getDolGlobalString('THEME_ELDY_BACKBODY')) { + require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + $color = colorArrayToHex(explode(',', getDolGlobalString('THEME_ELDY_BACKBODY'))); + } else { + $color = "ffffff"; + } } $cssclass = $cssclass.' eventday_'.$ymd; @@ -2377,7 +2382,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa function dol_color_minus($color, $minus, $minusunit = 16) { $newcolor = $color; - if ($minusunit == 16) { + if ($minusunit == 16 && is_array($newcolor)) { $newcolor[0] = dechex(max(min(hexdec($newcolor[0]) - $minus, 15), 0)); $newcolor[2] = dechex(max(min(hexdec($newcolor[2]) - $minus, 15), 0)); $newcolor[4] = dechex(max(min(hexdec($newcolor[4]) - $minus, 15), 0)); diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 836390e4188..1fa01691f34 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -834,6 +834,7 @@ class PaymentVarious extends CommonObject $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); $bankline = ((empty($arraydata['bankline']) || empty($arraydata['bankline']->id)) ? 0 : $arraydata['bankline']); + $formatedaccountancycode = (empty($arraydata['formatedaccountancycode']) ? '' : $arraydata['formatedaccountancycode']); $return = '
'; $return .= '
'; @@ -854,9 +855,14 @@ class PaymentVarious extends CommonObject $return .= ' - '.$this->type_payment.''; } } - if (property_exists($this, 'accountancy_code')) { + if (!empty($formatedaccountancycode)) { + $return .= '
'.$langs->trans("Account").' : '; + $return .= $formatedaccountancycode; + $return .= ''; + } elseif (property_exists($this, 'accountancy_code')) { $return .= '
'.$langs->trans("Account").' : '.$this->accountancy_code.''; } + if (property_exists($this, 'amount')) { $return .= '
'.$langs->trans("Debit").' : '.price($this->amount).''; } diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index 195d635d8d5..96e5af1cef5 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -33,7 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingaccount.class.php'; require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php'; -require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (isModEnabled('project')) { + require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +} /** * @var Conf $conf @@ -253,7 +255,7 @@ if ($arrayfields['bank']['checked'] && isModEnabled('accounting')) { if ($arrayfields['bank']['checked']) { $accountstatic = new Account($db); } -if ($arrayfields['project']['checked']) { +if (isModEnabled('project') && $arrayfields['project']['checked']) { $proj = new Project($db); } @@ -548,7 +550,7 @@ if ($arrayfields['type']['checked']) { } // Project -if ($arrayfields['project']['checked']) { +if (isModEnabled('project') && $arrayfields['project']['checked']) { print ''; // TODO print ''; @@ -653,7 +655,7 @@ if ($arrayfields['type']['checked']) { print_liste_field_titre($arrayfields['type']['label'], $_SERVER["PHP_SELF"], 'type', '', $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } -if ($arrayfields['project']['checked']) { +if (isModEnabled('project') && $arrayfields['project']['checked']) { print_liste_field_titre($arrayfields['project']['label'], $_SERVER["PHP_SELF"], 'fk_project', '', $param, '', $sortfield, $sortorder); $totalarray['nbfield']++; } @@ -716,25 +718,23 @@ while ($i < $imaxinloop) { $variousstatic->label = $obj->label; $variousstatic->datep = $obj->datep; $variousstatic->type_payment = $obj->payment_code; - + $variousstatic->accountancy_code = $obj->accountancy_code; $variousstatic->amount = $obj->amount; - $accountingaccount->fetch(0, $obj->accountancy_code, 1); - $variousstatic->accountancy_code = $accountingaccount->getNomUrl(0, 0, 1, $obj->accountingaccount, 1); - if ($mode == 'kanban') { if ($obj->fk_bank > 0) { $bankline->fetch($obj->fk_bank); } else { $bankline->id = 0; } + $accountingaccount->fetch(0, $obj->accountancy_code, 1); if ($i == 0) { print ''; print '
'; } // Output Kanban - print $variousstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected), 'bankline' => $bankline)); + print $variousstatic->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected), 'bankline' => $bankline, 'formatedaccountancycode' => $accountingaccount->getNomUrl(0, 0, 1, $obj->accountancy_code, 1))); if ($i == ($imaxinloop) - 1) { print '
'; print ''; @@ -805,7 +805,7 @@ while ($i < $imaxinloop) { } // Project - if ($arrayfields['project']['checked']) { + if (isModEnabled('project') && $arrayfields['project']['checked']) { print ''; if ($obj->fk_project > 0 && is_object($proj)) { $proj->fetch($obj->fk_project); diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php index 94edfbce43c..567c8240077 100644 --- a/htdocs/core/class/doleditor.class.php +++ b/htdocs/core/class/doleditor.class.php @@ -205,6 +205,8 @@ class DolEditor $found = 0; $out = ''; + $this->content = ($this->content ?? ''); // to avoid htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated + if (in_array($this->tool, array('textarea', 'ckeditor'))) { $found = 1; //$out.= '