Merge branch 'develop' into phpstanphpstan

This commit is contained in:
Frédéric FRANCE 2024-03-18 16:04:37 +01:00 committed by GitHub
commit 417ff90727
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
62 changed files with 390 additions and 232 deletions

View file

@ -497,7 +497,7 @@ return [
// 'PhanTypeMismatchDimAssignment',
// 'PhanPluginDescriptionlessCommentOnProtectedMethod',
// 'PhanPluginPrintfIncompatibleArgumentTypeWeak',
'PhanUndeclaredVariableAssignOp',
// 'PhanUndeclaredVariableAssignOp',
// 'PhanTypeExpectedObjectOrClassName',
'PhanEmptyFQSENInClasslike',
// 'PhanTypeMismatchArgumentInternalReal',

View file

@ -443,7 +443,7 @@ if ($action != 'export_csv') {
print_liste_field_titre("Balance", $_SERVER["PHP_SELF"], "", $param, "", 'class="right"', $sortfield, $sortorder);
// Hook fields
$parameters = array('param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$parameters = array('param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Action column
@ -549,7 +549,7 @@ if ($action != 'export_csv') {
// Show first line of a break
print '<tr class="trforbreak">';
print '<td colspan="'.($colspan+1).'" class="tdforbreak">'.$root_account_number.($root_account_description ? ' - '.$root_account_description : '').'</td>';
print '<td colspan="'.($colspan + 1).'" class="tdforbreak">'.$root_account_number.($root_account_description ? ' - '.$root_account_description : '').'</td>';
print '</tr>';
$displayed_account = $root_account_number;
@ -692,7 +692,7 @@ if ($action != 'export_csv') {
$accountingResult = $object->accountingResult($search_date_start, $search_date_end);
if ($accountingResult < 0) {
$accountingResultDebit = price(price2num(abs($accountingResult), 'MT'));
$accountingResultDebit = price(abs(price2num($accountingResult, 'MT')));
$accountingResultClassCSS = ' error';
} else {
$accountingResultCredit = price(price2num($accountingResult, 'MT'));

View file

@ -943,7 +943,7 @@ class AccountancyExport
$tab['signe_montant'] = '+';
// The amount must be in centimes without decimal points.
$tab['montant'] = str_pad(abs(($line->debit - $line->credit) * 100), 12, '0', STR_PAD_LEFT);
$tab['montant'] = str_pad((string) abs(($line->debit - $line->credit) * 100), 12, '0', STR_PAD_LEFT);
$tab['contrepartie'] = str_repeat(' ', 8);
// Force date format : %d%m%y

View file

@ -299,7 +299,7 @@ class AccountingJournal extends CommonObject
$label_link .= ' - '.($nourl ? '<span class="opacitymedium">' : '').$langs->transnoentities($this->label).($nourl ? '</span>' : '');
}
if ($withlabel == 2 && !empty($this->nature)) {
$key = $langs->trans("AccountingJournalType".strtoupper($this->nature));
$key = $langs->trans("AccountingJournalType".$this->nature);
$transferlabel = ($this->nature && $key != "AccountingJournalType".strtoupper($langs->trans($this->nature)) ? $key : $this->label);
$label_link .= ' - '.($nourl ? '<span class="opacitymedium">' : '').$transferlabel.($nourl ? '</span>' : '');
}

View file

@ -161,7 +161,7 @@ $formaccounting = new FormAccounting($db);
$title = $langs->trans('Closure');
$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Cl.C3.B4ture_annuelle';
$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Cl.C3.B4ture_annuelle';
llxHeader('', $title, $help_url);
@ -334,7 +334,7 @@ if (isset($current_fiscal_period)) {
print '<td class="right">' . $langs->trans("Year") . '</td>';
}
for ($i = 1; $i <= 12; $i++) {
print '<td class="right">' . $langs->trans('MonthShort' . str_pad($i, 2, '0', STR_PAD_LEFT)) . '</td>';
print '<td class="right">' . $langs->trans('MonthShort' . str_pad((string) $i, 2, '0', STR_PAD_LEFT)) . '</td>';
}
print '<td class="right"><b>' . $langs->trans("Total") . '</b></td>';
print '</tr>';

View file

@ -234,17 +234,17 @@ if ($action == 'validatehistory') {
$facture_static_det->desc = $objp->description;
$accountingAccountArray = array(
'dom'=>$objp->aarowid,
'intra'=>$objp->aarowid_intra,
'export'=>$objp->aarowid_export,
'thirdparty' =>$objp->aarowid_thirdparty);
'dom' => $objp->aarowid,
'intra' => $objp->aarowid_intra,
'export' => $objp->aarowid_export,
'thirdparty' => $objp->aarowid_thirdparty);
$code_sell_p_notset = '';
$code_sell_t_notset = '';
$suggestedid = 0;
$return=$accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
$return = $accountingAccount->getAccountingCodeToBind($thirdpartystatic, $mysoc, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'customer');
if (!is_array($return) && $return < 0) {
setEventMessage($accountingAccount->error, 'errors');
} else {
@ -299,7 +299,7 @@ if ($action == 'validatehistory') {
/*
* View
*/
$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Liaisons_comptables';
$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Liaisons_comptables';
llxHeader('', $langs->trans("CustomersVentilation"), $help_url);
@ -347,7 +347,7 @@ for ($i = 1; $i <= 12; $i++) {
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/customer/list.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT));
print $langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
@ -362,7 +362,7 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((int) $j), "fd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((string) $j), "fd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
@ -434,7 +434,7 @@ if ($resql) {
// Add link to make binding
if (!empty(price2num($row[$i]))) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&year='.$y.'&validatemonth='.((int) $cursormonth).'&validateyear='.((int) $cursoryear).'&token='.newToken().'">';
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad($cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print '</a>';
}
print '</td>';
@ -484,7 +484,7 @@ for ($i = 1; $i <= 12; $i++) {
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/customer/lines.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT));
print $langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
@ -499,7 +499,7 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((int) $j), "fd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((int) $j), "fd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
@ -595,7 +595,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT)).'</td>';
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).'</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -605,7 +605,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((int) $j), "fd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(f.datef) = ".((int) $j), "fd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
@ -655,7 +655,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT)).'</td>';
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).'</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -670,17 +670,17 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
$sql .= " SUM(".$db->ifsql(
"MONTH(f.datef) = ".((int) $j),
" (".$db->ifsql(
"fd.total_ht < 0",
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
" (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))"
).")",
"fd.total_ht < 0",
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
" (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))"
).")",
0
).") AS month".str_pad((int) $j, 2, '0', STR_PAD_LEFT).",";
).") AS month".str_pad((string) $j, 2, '0', STR_PAD_LEFT).",";
}
$sql .= " SUM(".$db->ifsql(
"fd.total_ht < 0",
" (-1 * (abs(fd.total_ht) - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100))))", // TODO This is bugged, we must use the percent for the invoice and fd.situation_percent is cumulated percent !
" (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))"
" (fd.total_ht - (fd.buy_price_ht * fd.qty * (fd.situation_percent / 100)))"
).") as total";
} else {
$sql = "SELECT '".$db->escape($langs->trans("Vide"))."' AS marge,";
@ -697,7 +697,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
" (fd.total_ht - (fd.buy_price_ht * fd.qty))"
).")",
0
).") AS month".str_pad((int) $j, 2, '0', STR_PAD_LEFT).",";
).") AS month".str_pad((string) $j, 2, '0', STR_PAD_LEFT).",";
}
$sql .= " SUM(".$db->ifsql(
"fd.total_ht < 0",

View file

@ -177,7 +177,7 @@ if ($action == 'validatehistory') {
/*
* View
*/
$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Liaisons_comptables';
$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Liaisons_comptables';
llxHeader('', $langs->trans("ExpenseReportsVentilation"), $help_url);
@ -223,7 +223,7 @@ for ($i = 1; $i <= 12; $i++) {
$param .= '&search_month='.$tmp['mon'].'&search_year='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/list.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT));
print $langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
@ -238,7 +238,7 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(erd.total_ht) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
@ -300,7 +300,7 @@ if ($resql) {
// Add link to make binding
if (!empty(price2num($row[$i]))) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&year='.$y.'&validatemonth='.((int) $cursormonth).'&validateyear='.((int) $cursoryear).'&token='.newToken().'">';
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad($cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print '</a>';
}
print '</td>';
@ -338,7 +338,7 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT)).'</td>';
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).'</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -349,7 +349,7 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(er.date_debut) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " ROUND(SUM(erd.total_ht),2) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";
@ -426,7 +426,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).'</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -436,7 +436,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(er.date_create) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(er.date_create) = ".((int) $j), "erd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(erd.total_ht) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."expensereport_det as erd";

View file

@ -232,10 +232,10 @@ if ($action == 'validatehistory') {
$facture_static_det->desc = $objp->description;
$accountingAccountArray = array(
'dom'=>$objp->aarowid,
'intra'=>$objp->aarowid_intra,
'export'=>$objp->aarowid_export,
'thirdparty' =>$objp->aarowid_thirdparty);
'dom' => $objp->aarowid,
'intra' => $objp->aarowid_intra,
'export' => $objp->aarowid_export,
'thirdparty' => $objp->aarowid_thirdparty);
$code_buy_p_notset = '';
$code_buy_t_notset = '';
@ -243,7 +243,7 @@ if ($action == 'validatehistory') {
$suggestedid = 0;
$return = $accountingAccount->getAccountingCodeToBind($mysoc, $thirdpartystatic, $product_static, $facture_static, $facture_static_det, $accountingAccountArray, 'supplier');
if (!is_array($return) && $return<0) {
if (!is_array($return) && $return < 0) {
setEventMessage($accountingAccount->error, 'errors');
} else {
$suggestedid = $return['suggestedid'];
@ -297,7 +297,7 @@ if ($action == 'validatehistory') {
/*
* View
*/
$help_url ='EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Liaisons_comptables';
$help_url = 'EN:Module_Double_Entry_Accounting|FR:Module_Comptabilit&eacute;_en_Partie_Double#Liaisons_comptables';
llxHeader('', $langs->trans("SuppliersVentilation"), $help_url);
@ -340,7 +340,7 @@ for ($i = 1; $i <= 12; $i++) {
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/list.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT));
print $langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
@ -355,7 +355,7 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(ffd.total_ht) as total";
$sql .= " FROM ".$db->prefix()."facture_fourn_det as ffd";
@ -422,7 +422,7 @@ if ($resql) {
// Add link to make binding
if (!empty(price2num($row[$i]))) {
print '<a href="'.$_SERVER['PHP_SELF'].'?action=validatehistory&year='.$y.'&validatemonth='.((int) $cursormonth).'&validateyear='.((int) $cursoryear).'&token='.newToken().'">';
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad($cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print img_picto($langs->trans("ValidateHistory").' ('.$langs->trans('Month'.str_pad((string) $cursormonth, 2, '0', STR_PAD_LEFT)).' '.$cursoryear.')', 'link', 'class="marginleft2"');
print '</a>';
}
print '</td>';
@ -472,7 +472,7 @@ for ($i = 1; $i <= 12; $i++) {
$param .= '&search_date_endday='.$tmp['mday'].'&search_date_endmonth='.$tmp['mon'].'&search_date_endyear='.$tmp['year'];
print '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/lines.php?'.$param.'">';
}
print $langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT));
print $langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT));
if (!empty($tmp['mday'])) {
print '</a>';
}
@ -487,7 +487,7 @@ for ($i = 1; $i <= 12; $i++) {
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(ffd.total_ht) as total";
$sql .= " FROM ".$db->prefix()."facture_fourn_det as ffd";
@ -571,7 +571,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((int) $j, 2, '0', STR_PAD_LEFT)).'</td>';
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).'</td>';
}
print '<td width="60" class="right"><b>'.$langs->trans("Total").'</b></td></tr>';
@ -581,7 +581,7 @@ if (getDolGlobalString('SHOW_TOTAL_OF_PREVIOUS_LISTS_IN_LIN_PAGE')) { // This pa
if ($j > 12) {
$j -= 12;
}
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((int) $j, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(ff.datef) = ".((int) $j), "ffd.total_ht", "0").") AS month".str_pad((string) $j, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(ffd.total_ht) as total";
$sql .= " FROM ".$db->prefix()."facture_fourn_det as ffd";

View file

@ -148,7 +148,7 @@ abstract class ActionsAdherentCardCommon
// Town
$this->tpl['select_town'] = $formcompany->select_ziptown($this->object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'));
if (dol_strlen(trim($this->object->country_id)) == 0) {
if ($this->object->country_id == 0) {
$this->object->country_id = $objsoc->country_id;
}
@ -168,7 +168,7 @@ abstract class ActionsAdherentCardCommon
}
// Physical or Moral
$selectarray = array('0'=>$langs->trans("Physical"), '1'=>$langs->trans("Moral"));
$selectarray = array('0' => $langs->trans("Physical"), '1' => $langs->trans("Moral"));
$this->tpl['select_morphy'] = $form->selectarray('morphy', $selectarray, $this->object->morphy, 0);
}

View file

@ -593,7 +593,7 @@ if (empty($reshook)) {
$rowid = $object->id;
$id = $object->id;
$backtopage = preg_replace('/__ID__/', $id, $backtopage);
$backtopage = preg_replace('/__ID__/', (string) $id, $backtopage);
} else {
$db->rollback();

View file

@ -145,7 +145,7 @@ if ($action == 'add' && $user->hasRight('adherent', 'configurer')) {
$object->note_public = trim($comment);
$object->note_private = '';
$object->mail_valid = trim($mail_valid);
$object->vote = (int) $vote;
$object->vote = $vote; // $vote is already int
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object);
@ -201,7 +201,7 @@ if ($action == 'update' && $user->hasRight('adherent', 'configurer')) {
$object->note_public = trim($comment);
$object->note_private = '';
$object->mail_valid = trim($mail_valid);
$object->vote = (bool) trim($vote);
$object->vote = $vote; // $vote is already int.
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');

View file

@ -347,7 +347,7 @@ $db->close();
function _isInBoxList($idrss, array $boxlist)
{
foreach ($boxlist as $box) {
if ($box->boxcode === "lastrssinfos" && strpos($box->note, $idrss) !== false) {
if ($box->boxcode === "lastrssinfos" && strpos($box->note, (string) $idrss) !== false) {
return true;
}
}

View file

@ -158,7 +158,7 @@ $workflowcodes = array(
'WORKFLOW_SHIPPING_CLASSIFY_CLOSED_INVOICE' => array(
'family' => 'classify_shipping',
'position' => 90,
'enabled' => isModEnabled("expedition") && isModEnabled("facture"),
'enabled' => isModEnabled("shipping") && isModEnabled("invoice"),
'picto' => 'shipment',
'deprecated' => 1
),
@ -217,10 +217,10 @@ $workflowcodes = array_filter(
$workflowcodes,
/**
* @param array{enabled:int<0,1>} $var
* @return int<0,1>
* @return bool
*/
static function ($var) {
return $var['enabled'];
return (bool) $var['enabled'];
}
);

View file

@ -182,7 +182,7 @@ if (!empty($number)) {
$errno = 0;
$errstr = 0;
$strCallerId = "Dolibarr caller $found <".strtolower($number).">";
$oSocket = @fsockopen($strHost, $port, $errno, $errstr, 10);
$oSocket = @fsockopen($strHost, (int) $port, $errno, $errstr, 10);
if (!$oSocket) {
print '<body>'."\n";
$txt = "Failed to execute fsockopen($strHost, $port, \$errno, \$errstr, 10)<br>\n";

View file

@ -172,7 +172,7 @@ if (empty($reshook) && (GETPOST('removedassigned') || GETPOST('removedassigned')
$idtoremove = GETPOST('removedassigned');
if (!empty($_SESSION['assignedtouser'])) {
$tmpassigneduserids = json_decode($_SESSION['assignedtouser'], 1);
$tmpassigneduserids = json_decode($_SESSION['assignedtouser'], true);
} else {
$tmpassigneduserids = array();
}
@ -199,7 +199,7 @@ if (empty($reshook) && (GETPOST('removedassignedresource') || GETPOST('removedas
$idtoremove = GETPOST('removedassignedresource');
if (!empty($_SESSION['assignedtoresource'])) {
$tmpassignedresourceids = json_decode($_SESSION['assignedtoresource'], 1);
$tmpassignedresourceids = json_decode($_SESSION['assignedtoresource'], true);
} else {
$tmpassignedresourceids = array();
}

View file

@ -1491,6 +1491,7 @@ if ($action == 'create') {
print '<td colspan="3">';
// List of files
$listofpaths = dol_dir_list($upload_dir, 'all', 0, '', '', 'name', SORT_ASC, 0);
$out = '';
// TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript
$out .= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">'."\n";

View file

@ -1573,6 +1573,7 @@ if (empty($reshook)) {
$TTotalByTva[$line->tva_tx] += $line->total_ttc;
}
$amount_ttc_diff = 0.;
foreach ($TTotalByTva as $tva => &$total) {
$coef = $total / $srcobject->total_ttc; // Calc coef
$am = $amount * $coef;

View file

@ -91,7 +91,7 @@ $search_date_when_endmonth = GETPOSTINT('search_date_when_endmonth');
$search_date_when_endyear = GETPOSTINT('search_date_when_endyear');
$search_date_when_start = dol_mktime(0, 0, 0, $search_date_when_startmonth, $search_date_when_startday, $search_date_when_startyear); // Use tzserver
$search_date_when_end = dol_mktime(23, 59, 59, $search_date_when_endmonth, $search_date_when_endday, $search_date_when_endyear);
$search_recurring = GETPOSTINT('search_recurring');
$search_recurring = GETPOST('search_recurring', 'intcomma');
$search_frequency = GETPOST('search_frequency', 'alpha');
$search_unit_frequency = GETPOST('search_unit_frequency', 'alpha');
$search_nb_gen_done = GETPOST('search_nb_gen_done', 'alpha');

View file

@ -253,6 +253,7 @@ if ($action == 'create') {
$total = 0;
$totalrecu = 0;
$total_ttc = 0.;
while ($i < $num) {
$objp = $tva;

View file

@ -83,6 +83,9 @@ class BonPrelevement extends CommonObject
public $factures = array();
/**
* @var array<int,string>
*/
public $methodes_trans = array();
public $invoice_in_error = array();
@ -171,6 +174,9 @@ class BonPrelevement extends CommonObject
public $credite;
public $note;
public $date_trans;
/**
* @var int Current transport method, index to $methodes_trans
*/
public $method_trans;
public $fk_user_trans;
public $date_credit;

View file

@ -274,10 +274,10 @@ if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
$param = "&id=".((int) $id);
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.((int) $limit);
}
$param = "&id=".urlencode((string) ($id));
// Lines of title fields
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
@ -325,10 +325,14 @@ if ($resql) {
while ($i < min($num, $limit)) {
$obj = $db->fetch_object($resql);
if ($salaryBonPl) {
$itemurl = '';
$partyurl = '';
if ($salaryBonPl && ($salarytmp instanceof Salary) && ($user instanceof User)) {
$salarytmp->fetch($obj->salaryid);
$usertmp->fetch($obj->userid);
} else {
$itemurl = $salarytmp->getNomUrl(1);
$partyurl = $usertmp->getNomUrl(1);
} elseif ($invoicetmp instanceof Facture && $invoicetmpsupplier instanceof FactureFournisseur) {
if ($obj->type == 'bank-transfer') {
$invoicetmp = $invoicetmpsupplier;
} else {
@ -337,22 +341,24 @@ if ($resql) {
$invoicetmp->fetch($obj->facid);
$thirdpartytmp->fetch($obj->socid);
$itemurl = $invoicetmp->getNomUrl(1);
$partyurl = $thirdpartytmp->getNomUrl(1);
}
print '<tr class="oddeven">';
print '<td class="nowraponall">';
print($salaryBonPl ? $salarytmp->getNomUrl(1) : $invoicetmp->getNomUrl(1));
print $itemurl;
print "</td>\n";
if ($object->type == 'bank-transfer' && !$salaryBonPl) {
if ($object->type == 'bank-transfer' && !$salaryBonPl && $invoicetmp instanceof Facture) {
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag($invoicetmp->ref_supplier).'">';
print dol_escape_htmltag($invoicetmp->ref_supplier);
print "</td>\n";
}
print '<td class="tdoverflowmax125">';
print($salaryBonPl ? $usertmp->getNomUrl(-1) : $thirdpartytmp->getNomUrl(1));
print $partyurl;
print "</td>\n";
// Amount of invoice

View file

@ -159,8 +159,8 @@ foreach ($listofparams as $param) {
llxHeader('', $langs->trans("TurnoverReport"), '', '', 0, 0, '', '', $morequerystring);
$exportlink="";
$namelink="";
$exportlink = "";
$namelink = "";
//print load_fiche_titre($langs->trans("VAT"),"");
//$fsearch.='<br>';
@ -304,7 +304,7 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).'</td>';
$i++;
}
print '<td width="60" class="right"><b>'.$langs->trans("TotalHT").'</b></td></tr>';
@ -314,7 +314,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql .= " fd.product_type AS product_type,";
$sql .= " cc.code, cc.label AS country,";
for ($i = 1; $i <= 12; $i++) {
$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$i, "fd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
$sql .= " SUM(".$db->ifsql("MONTH(f.datef)=".$i, "fd.total_ht", "0").") AS month".str_pad((string) $i, 2, "0", STR_PAD_LEFT).",";
}
$sql .= " SUM(fd.total_ht) as total";
$sql .= " FROM ".MAIN_DB_PREFIX."facturedet as fd";
@ -354,7 +354,7 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($j > 12) {
$j -= 12;
}
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
$monthj = 'month'.str_pad((string) $j, 2, '0', STR_PAD_LEFT);
print '<td class="right" width="6%">'.price($obj->$monthj).'</td>';
$totalpermonth[$j] = (empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]) + $obj->$monthj;
}
@ -373,7 +373,7 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($j > 12) {
$j -= 12;
}
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
$monthj = 'month'.str_pad((string) $j, 2, '0', STR_PAD_LEFT);
print '<td class="right" width="6%">'.price((empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j])).'</td>';
}
print '<td class="right" width="6%"><b>'.price((empty($totalpermonth['total']) ? 0 : $totalpermonth['total'])).'</b></td>';
@ -391,7 +391,7 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($j > 12) {
$j -= 12;
}
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad($j, 2, '0', STR_PAD_LEFT)).'</td>';
print '<td width="60" class="right">'.$langs->trans('MonthShort'.str_pad((string) $j, 2, '0', STR_PAD_LEFT)).'</td>';
$i++;
}
print '<td width="60" class="right"><b>'.$langs->trans("TotalHT").'</b></td></tr>';
@ -401,7 +401,7 @@ if ($modecompta == 'CREANCES-DETTES') {
$sql2 .= " ffd.product_type AS product_type,";
$sql2 .= " cc.code, cc.label AS country,";
for ($i = 1; $i <= 12; $i++) {
$sql2 .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$i, "ffd.total_ht", "0").") AS month".str_pad($i, 2, "0", STR_PAD_LEFT).",";
$sql2 .= " SUM(".$db->ifsql("MONTH(ff.datef)=".$i, "ffd.total_ht", "0").") AS month".str_pad((string) $i, 2, "0", STR_PAD_LEFT).",";
}
$sql2 .= " SUM(ffd.total_ht) as total";
$sql2 .= " FROM ".MAIN_DB_PREFIX."facture_fourn_det as ffd";
@ -441,7 +441,7 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($j > 12) {
$j -= 12;
}
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
$monthj = 'month'.str_pad((string) $j, 2, '0', STR_PAD_LEFT);
print '<td class="right" width="6%">'.price($obj->$monthj).'</td>';
$totalpermonth[$j] = (empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]) + $obj->$monthj;
}
@ -460,7 +460,7 @@ if ($modecompta == 'CREANCES-DETTES') {
if ($j > 12) {
$j -= 12;
}
$monthj = 'month'.str_pad($j, 2, '0', STR_PAD_LEFT);
$monthj = 'month'.str_pad((string) $j, 2, '0', STR_PAD_LEFT);
print '<td class="right" width="6%">'.price(empty($totalpermonth[$j]) ? 0 : $totalpermonth[$j]).'</td>';
}
print '<td class="right" width="6%"><b>'.price(empty($totalpermonth['total']) ? 0 : $totalpermonth['total']).'</b></td>';

View file

@ -172,19 +172,19 @@ if ($action == 'add') {
//In sellist we have only one line and it can have come to do SQL expression
if ($type == 'sellist' || $type == 'chkbxlst') {
foreach ($parameters_array as $param_ligne) {
$params['options'] = array($parameters=>null);
$params['options'] = array($parameters => null);
}
} else {
// Else it's separated key/value and coma list
foreach ($parameters_array as $param_ligne) {
if (strpos($param_ligne, ',')!==false) {
if (strpos($param_ligne, ',') !== false) {
list($key, $value) = explode(',', $param_ligne);
if (!array_key_exists('options', $params)) {
$params['options'] = array();
}
} else {
$key=$param_ligne;
$value=null;
$key = $param_ligne;
$value = null;
}
$params['options'][$key] = $value;
}
@ -345,7 +345,7 @@ if ($action == 'update') {
//In sellist we have only one line and it can have come to do SQL expression
if ($type == 'sellist' || $type == 'chkbxlst') {
foreach ($parameters_array as $param_ligne) {
$params['options'] = array($parameters=>null);
$params['options'] = array($parameters => null);
}
} else {
//Else it's separated key/value and coma list
@ -447,7 +447,7 @@ if ($action == 'encrypt') {
if ($extrafields->attributes[$elementtype]['entityid'][$attributekey] == $conf->entity || empty($extrafields->attributes[$elementtype]['entityid'][$attributekey])) {
dol_syslog("Loop on each extafields of table ".$arrayofelement['table_element']);
$sql .= "SELECT te.rowid, te.".$attributekey;
$sql = "SELECT te.rowid, te.".$attributekey;
$sql .= " FROM ".MAIN_DB_PREFIX.$arrayofelement['table_element']." as t, ".MAIN_DB_PREFIX.$arrayofelement['table_element'].'_extrafields as te';
$sql .= " WHERE te.fk_object = t.rowid";
$sql .= " AND te.".$attributekey." NOT LIKE 'dolcrypt:%'";
@ -462,7 +462,7 @@ if ($action == 'encrypt') {
$resql = $db->query($sql);
if ($resql) {
$num_rows = $db->num_rows($resql);
$i=0;
$i = 0;
while ($i < $num_rows) {
$objtmp = $db->fetch_object($resql);
$id = $objtmp->rowid;

View file

@ -45,7 +45,7 @@ class ExtraFields
public $db;
/**
* @var array<string,array{label:array<string,string>,type:array<string,string>,size:array<string,string>,default:array<string,string>,computed:array<string,string>,unique:array<string,int>,required:array<string,int>,param:array<string,mixed>,perms:array<string,mixed[]>,list:array<string,mixed[]>,totalizable:array<string,int>,help:array<string,string>,printable:array<string,int>,enabled:array<string,int>,langfile:array<string,string>,css:array<string,string>,csslist:array<string,string>,hidden:array<string,int>,mandatoryfieldsofotherentities:array<string,string>}> New array to store extrafields definition
* @var array<string,array{label:array<string,string>,type:array<string,string>,size:array<string,string>,default:array<string,string>,computed:array<string,string>,unique:array<string,int>,required:array<string,int>,param:array<string,mixed>,perms:array<string,mixed[]>,list:array<string,int|string>,pos:array<string,int>,totalizable:array<string,int>,help:array<string,string>,printable:array<string,int>,enabled:array<string,int>,langfile:array<string,string>,css:array<string,string>,csslist:array<string,string>,hidden:array<string,int>,mandatoryfieldsofotherentities:array<string,string>}> New array to store extrafields definition
*/
public $attributes;

View file

@ -27,6 +27,7 @@
* Note:
* LDAP_ESCAPE_FILTER is to escape char array('\\', '*', '(', ')', "\x00")
* LDAP_ESCAPE_DN is to escape char array('\\', ',', '=', '+', '<', '>', ';', '"', '#')
* @phan-suppress-file PhanTypeMismatchArgumentInternal (notifications concern 'respource)
*/
/**

View file

@ -390,6 +390,7 @@ if ($action == 'viewgraph') {
// Get all possible values of fields when a 'group by' is set, and save this into $arrayofvaluesforgroupby
// $arrayofvaluesforgroupby will be used to forge lael of each grouped series
if (is_array($search_groupby) && count($search_groupby)) {
$fieldtocount = '';
foreach ($search_groupby as $gkey => $gval) {
$gvalwithoutprefix = preg_replace('/^[a-z]+\./', '', $gval);

View file

@ -724,7 +724,7 @@ class DoliDBPgsql extends DoliDB
*/
public function escape($stringtoencode)
{
return pg_escape_string($stringtoencode);
return pg_escape_string($this->db, $stringtoencode);
}
/**

View file

@ -88,6 +88,8 @@ if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) {
}
$logouttext = '';
$logouthtmltext = '';
$toprightmenu = '';
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
//$logouthtmltext=$appli.'<br>';
if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') {

View file

@ -30,28 +30,28 @@
*/
function getHtmlOfLayout($name)
{
global $conf, $mysoc, $user, $langs;
if ($name == 'basic') {
$out = '
<div >
<div >
<img alt="Gray rectangle" width="800px" height="100px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAIAAABM5OhcAAABGklEQVR4nO3SwQ3AIBDAsNLJb3SWIEJC9gR5ZM3MB6f9twN4k7FIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIvEBtxYAkgpLmAeAAAAAElFTkSuQmCC" />
</div>
<h3>Lorem, ipsum dolor sit amet consectetur adipisicing elit.</h3>
<h3>Lorem, ipsum dolor sit amet consectetur</h3>
<!-- Les paragraphes de texte -->
<div >';
if (!empty($mysoc->logo)) {
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
$out .= '<img height="100px" width="400px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo).'">';
}
} else {
$out .= '<img alt="Gray rectangle" width="100px" height="100px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAIAAABM5OhcAAABGklEQVR4nO3SwQ3AIBDAsNLJb3SWIEJC9gR5ZM3MB6f9twN4k7FIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIvEBtxYAkgpLmAeAAAAAElFTkSuQmCC" />';
}
$out .= '</div>
<h2>'.$langs->trans('TitleOfMailHolder').'</h2>
<div class="email-template-text">
<p>Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aperiam non blanditiis delectus accusamus reprehenderit voluptates repellat.<br> Excepturi illo delectus nisi labore, iste voluptatibus dignissimos explicabo, corrupti voluptatum et facere cum?</p>
</div>
<div class="email-template-text">
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
<div class="email-template-text">
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
</div>
<img alt="Gray rectangle" width="15%" height="50px" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAABkCAIAAABM5OhcAAABGklEQVR4nO3SwQ3AIBDAsNLJb3SWIEJC9gR5ZM3MB6f9twN4k7FIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIuEsUgYi4SxSBiLhLFIGIvEBtxYAkgpLmAeAAAAAElFTkSuQmCC" />
</div>';
<p>'.$langs->trans('ContentOfMailHolder').'</p>
</div>';
if (!(empty($user->signature))) {
$out .= '<h4><strong>'.dol_htmlentities($user->signature).'</strong></h4>';
}
$out .= '</div>';
} elseif ($name == 'news') {
$out = '
<h1 style="margin-left:120px;">Lorem, ipsum dolor sit amet consectetur adipisicing elit sit amet consectetur</h1>

View file

@ -11766,8 +11766,8 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* @param string|array $url Url for link or array of subbutton description ('label'=>, 'url'=>, 'lang'=>, 'perm'=> )
* Example when an array is used: $arrayforbutaction = array(
* 10 => array('lang'=>'propal', 'enabled'=>isModEnabled("propal"), 'perm'=>$user->hasRight('propal', 'creer'), 'label' => 'AddProp', 'url'=>'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
* 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("commande"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
* 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("facture"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
* 20 => array('lang'=>'orders', 'enabled'=>isModEnabled("order"), 'perm'=>$user->hasRight('commande', 'creer'), 'label' => 'CreateOrder', 'url'=>'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
* 30 => array('lang'=>'bills', 'enabled'=>isModEnabled("invoice"), 'perm'=>$user->hasRight('facture', 'creer'), 'label' => 'CreateBill', 'url'=>'/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid),
* );
* @param string $id Attribute id of action button. Example 'action-delete'. This can be used for full ajax confirm if this code is reused into the ->formconfirm() method.
* @param int|boolean $userRight User action right
@ -13931,3 +13931,71 @@ function buildParamDate($prefix, $timestamp = null, $hourTime = '', $gm = 'auto'
return '&' . http_build_query($TParam);
}
/**
* Displays an error page when a record is not found. It allows customization of the message,
* whether to include the header and footer, and if only the message should be shown without additional details.
* The function also supports executing additional hooks for customized handling of error pages.
*
* @param string $message Custom error message to display. If empty, a default "Record Not Found" message is shown.
* @param int $printheader Determines if the page header should be printed (1 = yes, 0 = no).
* @param int $printfooter Determines if the page footer should be printed (1 = yes, 0 = no).
* @param int $showonlymessage If set to 1, only the error message is displayed without any additional information or hooks.
* @param mixed $params Optional parameters to pass to hooks for further processing or customization.
* @global object $conf Dolibarr configuration object (global)
* @global object $db Database connection object (global)
* @global object $user Current user object (global)
* @global Translate $langs Language translation object, initialized within the function if not already.
* @global object $hookmanager Hook manager object, initialized within the function if not already for executing hooks.
* @global string $action Current action, can be modified by hooks.
* @global object $object Current object, can be modified by hooks.
* @return void This function terminates script execution after outputting the error page.
*/
function recordNotFound($message = '', $printheader = 1, $printfooter = 1, $showonlymessage = 0, $params = null)
{
global $conf, $db, $user, $langs, $hookmanager;
global $action, $object;
if (!is_object($langs)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php';
$langs = new Translate('', $conf);
$langs->setDefaultLang();
}
$langs->load("errors");
if ($printheader) {
if (function_exists("llxHeader")) {
llxHeader('');
} elseif (function_exists("llxHeaderVierge")) {
llxHeaderVierge('');
}
}
print '<div class="error">';
if (empty($message)) {
print $langs->trans("ErrorRecordNotFound");
} else {
print $langs->trans($message);
}
print '</div>';
print '<br>';
if (empty($showonlymessage)) {
if (empty($hookmanager)) {
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager = new HookManager($db);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('main'));
}
$parameters = array('message'=>$message, 'params'=>$params);
$reshook = $hookmanager->executeHooks('getErrorRecordNotFound', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
print $hookmanager->resPrint;
}
if ($printfooter && function_exists("llxFooter")) {
llxFooter();
}
exit(0);
}

View file

@ -1008,7 +1008,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
while (preg_match('/\{([A-Z]+)\-([1-9])\}/', $tmpmask, $regKey)) {
$maskperso[$regKey[1]] = '{'.$regKey[1].'-'.$regKey[2].'}';
// @phan-suppress-next-line PhanParamSuspiciousOrder
$maskpersonew[$regKey[1]] = str_pad('', $regKey[2], '_', STR_PAD_RIGHT);
$maskpersonew[$regKey[1]] = str_pad('', (int) $regKey[2], '_', STR_PAD_RIGHT);
$tmpmask = preg_replace('/\{'.$regKey[1].'\-'.$regKey[2].'\}/i', $maskpersonew[$regKey[1]], $tmpmask);
}
@ -1070,7 +1070,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
if ($maskraz > 0) { // A reset is required
if ($maskraz == 99) {
$maskraz = date('m', $date);
$maskraz = (int) date('m', $date);
$resetEveryMonth = true;
}
if ($maskraz > 12) {
@ -1123,7 +1123,7 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
$yearcomp = 0;
if (!empty($yearoffsettype) && !is_numeric($yearoffsettype) && $yearoffsettype != '=') { // $yearoffsettype is - or +
$currentyear = date("Y", $date);
$currentyear = (int) date("Y", $date);
$fiscaldate = dol_mktime('0', '0', '0', $maskraz, '1', $currentyear);
$newyeardate = dol_mktime('0', '0', '0', '1', '1', $currentyear);
$nextnewyeardate = dol_mktime('0', '0', '0', '1', '1', $currentyear + 1);
@ -1139,23 +1139,23 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
// If after or equal of current new year date
$yearoffset = -1;
}
} elseif (date("m", $date) < $maskraz && empty($resetEveryMonth)) {
} elseif ((int) date("m", $date) < $maskraz && empty($resetEveryMonth)) {
// For backward compatibility
$yearoffset = -1;
} // If current month lower that month of return to zero, year is previous year
if ($yearlen == 4) {
$yearcomp = sprintf("%04d", date("Y", $date) + $yearoffset);
$yearcomp = sprintf("%04d", (int) date("Y", $date) + $yearoffset);
} elseif ($yearlen == 2) {
$yearcomp = sprintf("%02d", date("y", $date) + $yearoffset);
$yearcomp = sprintf("%02d", (int) date("y", $date) + $yearoffset);
} elseif ($yearlen == 1) {
$yearcomp = substr(date('y', $date), 1, 1) + $yearoffset;
}
if ($monthcomp > 1 && empty($resetEveryMonth)) { // Test with month is useless if monthcomp = 0 or 1 (0 is same as 1) (regis: $monthcomp can't equal 0)
if ($yearlen == 4) {
$yearcomp1 = sprintf("%04d", date("Y", $date) + $yearoffset + 1);
$yearcomp1 = sprintf("%04d", (int) date("Y", $date) + $yearoffset + 1);
} elseif ($yearlen == 2) {
$yearcomp1 = sprintf("%02d", date("y", $date) + $yearoffset + 1);
$yearcomp1 = sprintf("%02d", (int) date("y", $date) + $yearoffset + 1);
}
$sqlwhere .= "(";
@ -1383,8 +1383,8 @@ function get_next_value($db, $mask, $table, $field, $where = '', $objsoc = '', $
// We replace special codes except refclient
if (!empty($yearoffsettype) && !is_numeric($yearoffsettype) && $yearoffsettype != '=') { // yearoffsettype is - or +, so we don't want current year
$numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date) + $yearoffset, $numFinal);
$numFinal = preg_replace('/\{yy\}/i', date("y", $date) + $yearoffset, $numFinal);
$numFinal = preg_replace('/\{yyyy\}/i', (string) ((int) date("Y", $date) + $yearoffset), $numFinal);
$numFinal = preg_replace('/\{yy\}/i', (string) ((int) date("y", $date) + $yearoffset), $numFinal);
$numFinal = preg_replace('/\{y\}/i', substr(date("y", $date), 1, 1) + $yearoffset, $numFinal);
} else { // we want yyyy to be current year
$numFinal = preg_replace('/\{yyyy\}/i', date("Y", $date), $numFinal);
@ -1538,7 +1538,7 @@ function check_value($mask, $value)
}
if ($maskraz >= 0) {
if ($maskraz == 99) {
$maskraz = date('m');
$maskraz = (int) date('m');
$resetEveryMonth = true;
}
if ($maskraz > 12) {
@ -1589,8 +1589,9 @@ function check_value($mask, $value)
function binhex($bin, $pad = false, $upper = false)
{
$last = dol_strlen($bin) - 1;
$x = 0;
for ($i = 0; $i <= $last; $i++) {
$x += $bin[$last - $i] * pow(2, $i);
$x += ($bin[$last - $i] ? 1 : 0) << $i;
}
$x = dechex($x);
if ($pad) {
@ -1632,9 +1633,9 @@ function numero_semaine($time)
if (preg_match('/^([0-9]+)\-([0-9]+)\-([0-9]+)\s?([0-9]+)?:?([0-9]+)?/i', $stime, $reg)) {
// Date est au format 'YYYY-MM-DD' ou 'YYYY-MM-DD HH:MM:SS'
$annee = $reg[1];
$mois = $reg[2];
$jour = $reg[3];
$annee = (int) $reg[1];
$mois = (int) $reg[2];
$jour = (int) $reg[3];
}
/*
@ -1645,40 +1646,46 @@ function numero_semaine($time)
*/
// Definition du Jeudi de la semaine
if (date("w", mktime(12, 0, 0, $mois, $jour, $annee)) == 0) { // Dimanche
if ((int) date("w", mktime(12, 0, 0, $mois, $jour, $annee)) == 0) { // Dimanche
$jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee) - 3 * 24 * 60 * 60;
} elseif (date("w", mktime(12, 0, 0, $mois, $jour, $annee)) < 4) { // du Lundi au Mercredi
$jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee) + (4 - date("w", mktime(12, 0, 0, $mois, $jour, $annee))) * 24 * 60 * 60;
} elseif (date("w", mktime(12, 0, 0, $mois, $jour, $annee)) > 4) { // du Vendredi au Samedi
$jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee) - (date("w", mktime(12, 0, 0, $mois, $jour, $annee)) - 4) * 24 * 60 * 60;
$jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee) + (4 - (int) date("w", mktime(12, 0, 0, $mois, $jour, $annee))) * 24 * 60 * 60;
} elseif ((int) date("w", mktime(12, 0, 0, $mois, $jour, $annee)) > 4) { // du Vendredi au Samedi
$jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee) - ((int) date("w", mktime(12, 0, 0, $mois, $jour, $annee)) - 4) * 24 * 60 * 60;
} else { // Jeudi
$jeudiSemaine = mktime(12, 0, 0, $mois, $jour, $annee);
}
// Definition du premier Jeudi de l'annee
if (date("w", mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine))) == 0) { // Dimanche
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine)) + 4 * 24 * 60 * 60;
} elseif (date("w", mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine))) < 4) { // du Lundi au Mercredi
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine)) + (4 - date("w", mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine)))) * 24 * 60 * 60;
} elseif (date("w", mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine))) > 4) { // du Vendredi au Samedi
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine)) + (7 - (date("w", mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine))) - 4)) * 24 * 60 * 60;
if ((int) date("w", mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine))) == 0) { // Dimanche
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine)) + 4 * 24 * 60 * 60;
} elseif ((int) date("w", mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine))) < 4) { // du Lundi au Mercredi
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine)) + (4 - (int) date("w", mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine)))) * 24 * 60 * 60;
} elseif ((int) date("w", mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine))) > 4) { // du Vendredi au Samedi
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine)) + (7 - ((int) date("w", mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine))) - 4)) * 24 * 60 * 60;
} else { // Jeudi
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine));
$premierJeudiAnnee = mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine));
}
// Definition du numero de semaine: nb de jours entre "premier Jeudi de l'annee" et "Jeudi de la semaine";
$numeroSemaine = (
(
date("z", mktime(12, 0, 0, date("m", $jeudiSemaine), date("d", $jeudiSemaine), date("Y", $jeudiSemaine)))
(int) date("z", mktime(12, 0, 0, (int) date("m", $jeudiSemaine), (int) date("d", $jeudiSemaine), (int) date("Y", $jeudiSemaine)))
-
date("z", mktime(12, 0, 0, date("m", $premierJeudiAnnee), date("d", $premierJeudiAnnee), date("Y", $premierJeudiAnnee)))
(int) date("z", mktime(12, 0, 0, (int) date("m", $premierJeudiAnnee), (int) date("d", $premierJeudiAnnee), (int) date("Y", $premierJeudiAnnee)))
) / 7
) + 1;
// Cas particulier de la semaine 53
if ($numeroSemaine == 53) {
// Les annees qui commence un Jeudi et les annees bissextiles commencant un Mercredi en possede 53
if (date("w", mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine))) == 4 || (date("w", mktime(12, 0, 0, 1, 1, date("Y", $jeudiSemaine))) == 3 && date("z", mktime(12, 0, 0, 12, 31, date("Y", $jeudiSemaine))) == 365)) {
// Les annees qui commencent un Jeudi et les annees bissextiles commencant un Mercredi en possedent 53
if (
((int) date("w", mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine))) == 4)
|| (
((int) date("w", mktime(12, 0, 0, 1, 1, (int) date("Y", $jeudiSemaine))) == 3)
&& ((int) date("z", mktime(12, 0, 0, 12, 31, (int) date("Y", $jeudiSemaine))) == 365)
)
) {
$numeroSemaine = 53;
} else {
$numeroSemaine = 1;
@ -2533,9 +2540,9 @@ function colorHexToRgb($hex, $alpha = false, $returnArray = false)
$rgb['b'] = hexdec($length == 6 ? substr($hex, 4, 2) : ($length == 3 ? str_repeat(substr($hex, 2, 1), 2) : 0));
if ($alpha !== false) {
$rgb['a'] = (float) $alpha;
$string = 'rgba('.implode(',', $rgb).')';
$string = 'rgba('.implode(',', array_map('strval', $rgb)).')';
} else {
$string = 'rgb('.implode(',', $rgb).')';
$string = 'rgb('.implode(',', array_map('strval', $rgb)).')';
}
if ($returnArray) {

View file

@ -94,7 +94,7 @@ function rebuildObjectClass($destdir, $module, $objectname, $newmask, $readdir =
dol_copy($pathoffiletoedittarget, $pathoffiletoedittarget.'.back', $newmask, 1);
// Edit class files
$contentclass = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
$contentclass = file_get_contents(dol_osencode($pathoffiletoeditsrc));
// Update ->fields (to add or remove entries defined into $addfieldentry)
if (count($object->fields)) {
@ -321,7 +321,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
// Backup old file
dol_copy($pathoffiletoedittarget, $pathoffiletoedittarget.'.back', $newmask, 1);
$contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
$contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc));
$i = 0;
$texttoinsert = '-- BEGIN MODULEBUILDER FIELDS'."\n";
@ -389,7 +389,7 @@ function rebuildObjectSql($destdir, $module, $objectname, $newmask, $readdir = '
$pathoffiletoedittarget = preg_replace('/\.sql$/', '.key.sql', $pathoffiletoedittarget);
$pathoffiletoedittarget = preg_replace('/\.sql.new$/', '.key.sql.new', $pathoffiletoedittarget);
$contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc), 'r');
$contentsql = file_get_contents(dol_osencode($pathoffiletoeditsrc));
$i = 0;
$texttoinsert = '-- BEGIN MODULEBUILDER INDEXES'."\n";
@ -898,7 +898,7 @@ function writePermsInAsciiDoc($file, $destfile)
$array = explode(";", $content);
$permissions = array_filter($array);
// delete occurrences "$r++" and ID
$permissions = str_replace('$r++', 1, $permissions);
$permissions = str_replace('$r++', '1', $permissions);
$permsN = array();
foreach ($permissions as $i => $element) {

View file

@ -18,7 +18,7 @@ insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, left
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 16__+MAX_llx_menu__, 'bom|mrp', 'isModEnabled("bom") || isModEnabled("mrp")', __HANDLER__, 'top', 'mrp', '', 0, '/mrp/index.php?mainmenu=mrp&amp;leftmenu=', 'TMenuMRP', -1, 'mrp', '$user->hasRight("bom","read") || $user->hasRight("mrp","read")', '', 0, 31, __ENTITY__, '<span class="fas fa-cubes fa-fw pictofixedwidth" style=" color: #a69944;"></span>');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 7__+MAX_llx_menu__, 'projet', 'isModEnabled("project")', __HANDLER__, 'top', 'project', '', 0, '/projet/index.php?mainmenu=project&amp;leftmenu=', 'Projects', -1, 'projects', '$user->hasRight("projet","lire")', '', 2, 32, __ENTITY__, '<span class="fas fa-project-diagram em088 infobox-project fa-fw pictofixedwidth" style=""></span>');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 5__+MAX_llx_menu__, 'propal|commande|fournisseur|supplier_order|supplier_invoice|contrat|ficheinter', 'isModEnabled("propal") || isModEnabled("commande") || isModEnabled("supplier_order") || isModEnabled("contrat") || isModEnabled("ficheinter")', __HANDLER__, 'top', 'commercial', '', 0, '/comm/index.php?mainmenu=commercial&amp;leftmenu=', 'Commercial', -1, 'commercial', '$user->hasRight("societe","lire") || $user->hasRight("societe","contact","lire")', '', 2, 40, __ENTITY__, '<span class="fas fa-suitcase em092 infobox-contrat fa-fw pictofixedwidth" style=""></span>');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("facture") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, '<span class="fas fa-file-invoice-dollar infobox-commande fa-fw pictofixedwidth" style=""></span>');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 6__+MAX_llx_menu__, 'facture|don|tax|salaries|loan|banque', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("invoice") || isModEnabled("don") || isModEnabled("tax") || isModEnabled("salaries") || isModEnabled("supplier_invoice") || isModEnabled("loan") || isModEnabled("banque")', __HANDLER__, 'top', 'billing', '', 0, '/compta/index.php?mainmenu=billing&amp;leftmenu=', 'MenuFinancial', -1, 'compta', '$user->hasRight("facture","lire") || $user->hasRight("don","lire") || $user->hasRight("tax","charges","lire") || $user->hasRight("salaries","read") || $user->hasRight("loan","read") || $user->hasRight("banque","lire") || $user->hasRight("fournisseur","facture","lire") || $user->hasRight("supplier_invoice","read")', '', 2, 50, __ENTITY__, '<span class="fas fa-file-invoice-dollar infobox-commande fa-fw pictofixedwidth" style=""></span>');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 14__+MAX_llx_menu__, 'banque|prelevement', 'isModEnabled("banque") || isModEnabled("prelevement")', __HANDLER__, 'top', 'bank', '', 0, '/compta/bank/list.php?mainmenu=bank&amp;leftmenu=bank', 'MenuBankCash', -1, 'banks', '$user->hasRight("banque","lire") || $user->hasRight("prelevement","bons","lire")', '', 0, 52, __ENTITY__, '<span class="fas fa-university infobox-bank_account fa-fw pictofixedwidth" style=""></span>');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 9__+MAX_llx_menu__, 'comptabilite|accounting|asset', 'isModEnabled("comptabilite") || isModEnabled("accounting") || isModEnabled("asset")', __HANDLER__, 'top', 'accountancy', '', 0, '/compta/index.php?mainmenu=accountancy&amp;leftmenu=accountancy', 'MenuAccountancy', -1, 'main', '$user->hasRight("compta","resultat","lire") || $user->hasRight("accounting","mouvements","lire") || $user->hasRight("asset","read")', '', 2, 54, __ENTITY__, '<span class="fas fa-search-dollar infobox-bank_account fa-fw pictofixedwidth" style=""></span>');
insert into llx_menu (rowid, module, enabled, menu_handler, type, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity, prefix) values ( 8__+MAX_llx_menu__, '', '', __HANDLER__, 'top', 'tools', '', 0, '/core/tools.php?mainmenu=tools&amp;leftmenu=', 'Tools', -1, 'other', '', '', 2, 90, __ENTITY__, '<span class="fas fa-tools fa-fw pictofixedwidth" style=""></span>');
@ -231,23 +231,23 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("supplier_invoice")', __HANDLER__, 'left', 1604__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1600__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&amp;leftmenu=customers_bills_stats&mode=supplier', 'Statistics', 1, 'bills', '$user->rights->fournisseur->facture->lire', '', 2, 8, __ENTITY__);
-- Billing - Customer invoice
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&amp;action=create&amp;leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1700__+MAX_llx_menu__, 'billing', 'customer_bills', 6__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills', 'BillsCustomers', 0, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1701__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/card.php?mainmenu=billing&amp;action=create&amp;leftmenu=customers_bills', 'NewBill', 1, 'bills', '$user->rights->facture->creer', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1705__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills', 'List', 1, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_draft&amp;search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_notpaid&amp;search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_paid&amp;search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_canceled&amp;search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1720__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_draft&amp;search_status=0', 'BillShortStatusDraft', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1721__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_notpaid&amp;search_status=1', 'BillShortStatusNotPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1722__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_paid&amp;search_status=2', 'BillShortStatusPaid', 2, 'bills', '$user->rights->facture->lire', '', 2, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1723__+MAX_llx_menu__, 'billing', '', 1705__+MAX_llx_menu__, '/compta/facture/list.php?mainmenu=billing&amp;leftmenu=customers_bills_canceled&amp;search_status=3', 'BillShortStatusCanceled', 2, 'bills', '$user->rights->facture->lire', '', 2, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&amp;leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1702__+MAX_llx_menu__, 'billing', '', 1700__+MAX_llx_menu__, '/compta/facture/invoicetemplate_list.php?mainmenu=billing&amp;leftmenu=customers_bills', 'ListOfTemplates', 1, 'bills', '$user->rights->facture->lire', '', 2, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&amp;leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&amp;leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("facture")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&amp;leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1704__+MAX_llx_menu__, 'billing', 'customers_bills_payment', 1700__+MAX_llx_menu__, '/compta/paiement/list.php?mainmenu=billing&amp;leftmenu=customers_bills_payment', 'Payments', 1, 'bills', '$user->rights->facture->lire', '', 2, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1710__+MAX_llx_menu__, 'billing', 'customers_bills_reports', 1704__+MAX_llx_menu__, '/compta/paiement/rapport.php?mainmenu=billing&amp;leftmenu=customers_bills_reports', 'Reportings', 2, 'bills', '$user->rights->facture->lire', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("invoice")', __HANDLER__, 'left', 1714__+MAX_llx_menu__, 'billing', 'customers_bills_stats', 1700__+MAX_llx_menu__, '/compta/facture/stats/index.php?mainmenu=billing&amp;leftmenu=customers_bills_stats', 'Statistics', 1, 'bills', '$user->rights->facture->lire', '', 2, 8, __ENTITY__);
-- Billing - Orders to bill
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("commande")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&amp;leftmenu=orders&amp;search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("order")', __HANDLER__, 'left', 1900__+MAX_llx_menu__, 'billing', 'orders', 6__+MAX_llx_menu__, '/commande/list.php?mainmenu=billing&amp;leftmenu=orders&amp;search_status=3', 'MenuOrdersToBill', 0, 'orders', '$user->rights->commande->lire', '', 0, 3, __ENTITY__);
-- Donations
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("don")', __HANDLER__, 'left', 2000__+MAX_llx_menu__, 'billing', 'donations', 6__+MAX_llx_menu__, '/don/index.php?mainmenu=billing&amp;leftmenu=donations', 'Donations', 0, 'donations', '$user->rights->don->lire', '', 2, 4, __ENTITY__);
@ -316,9 +316,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && $leftmenu=="accountancy_admin"', __HANDLER__, 'left', 2450__+MAX_llx_menu__, 'accountancy', 'accountancy_admin_period', 2451__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=accountancy&leftmenu=accountancy_admin', 'FiscalPeriod', 1, 'admin', '', '', 2, 80, __ENTITY__);
-- Binding
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("facture") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES)', __HANDLER__, 'left', 2401__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_customer', 2400__+MAX_llx_menu__, '/accountancy/customer/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_customer', 'CustomersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 2, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2402__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 3, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_SALES) && $leftmenu=="accountancy_dispatch_customer"', __HANDLER__, 'left', 2403__+MAX_llx_menu__, 'accountancy', '', 2401__+MAX_llx_menu__, '/accountancy/customer/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 4, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES)', __HANDLER__, 'left', 2410__+MAX_llx_menu__, 'accountancy', 'accountancy_dispatch_supplier', 2400__+MAX_llx_menu__, '/accountancy/supplier/index.php?mainmenu=accountancy&amp;leftmenu=accountancy_dispatch_supplier', 'SuppliersVentilation', 1, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 5, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2411__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/list.php?mainmenu=accountancy', 'ToDispatch', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 6, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("accounting") && isModEnabled("supplier_invoice") && empty($conf->global->ACCOUNTING_DISABLE_BINDING_ON_PURCHASES) && $leftmenu=="accountancy_dispatch_supplier"', __HANDLER__, 'left', 2412__+MAX_llx_menu__, 'accountancy', '', 2410__+MAX_llx_menu__, '/accountancy/supplier/lines.php?mainmenu=accountancy', 'Dispatched', 2, 'accountancy', '$user->hasRight("accounting","bind","write")', '', 0, 7, __ENTITY__);
@ -379,9 +379,9 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("asset") && $leftmenu=="asset"', __HANDLER__, 'left', 3006__+MAX_llx_menu__, 'asset', '', 3004__+MAX_llx_menu__, '/asset/type.php?mainmenu=accountancy', 'MenuListTypeAssets', 3, 'assets', '($conf->global->MAIN_USE_ADVANCED_PERMS?$user->hasRight("asset","model_advance","read"):$user->hasRight("asset","read"))', '', 0, 25, __ENTITY__);
-- Check deposit
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&amp;leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&amp;leftmenu=checks&amp;action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("banque") && (isModEnabled("facture") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&amp;leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1711__+MAX_llx_menu__, 'accountancy', 'checks', 14__+MAX_llx_menu__, '/compta/paiement/cheque/index.php?mainmenu=bank&amp;leftmenu=checks', 'MenuChequeDeposits', 0, 'bills', '$user->hasRight("banque","lire")', '', 2, 9, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1712__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/card.php?mainmenu=bank&amp;leftmenu=checks&amp;action=new', 'NewCheckDeposit', 1, 'compta', '$user->hasRight("banque","lire")', '', 2, 0, __ENTITY__);
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT) && isModEnabled("bank") && (isModEnabled("invoice") || ! empty($conf->global->MAIN_MENU_CHEQUE_DEPOSIT_ON))', __HANDLER__, 'left', 1713__+MAX_llx_menu__, 'accountancy', '', 1711__+MAX_llx_menu__, '/compta/paiement/cheque/list.php?mainmenu=bank&amp;leftmenu=checks', 'List', 1, 'bills', '$user->hasRight("banque","lire")', '', 2, 1, __ENTITY__);
-- PaymentByDirectDebit
insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("prelevement")', __HANDLER__, 'left', 2500__+MAX_llx_menu__, 'accountancy', 'withdraw', 14__+MAX_llx_menu__, '/compta/prelevement/index.php?mainmenu=bank&amp;leftmenu=withdraw', 'PaymentByDirectDebit', 0, 'withdrawals', '$user->hasRight("prelevement","bons","lire")', '', 2, 9, __ENTITY__);

View file

@ -91,7 +91,9 @@ print '<body>'."\n";
print '<div>';
//print '<br>';
if (!isset($bookmarkList)) {
$bookmarkList = '';
}
if (!isModEnabled('multicompany')) {
$langs->load("admin");
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("MultiCompany")).'</span>';
@ -128,7 +130,7 @@ if (!isModEnabled('multicompany')) {
// Execute hook printBookmarks
$parameters = array('multicompany'=>$multicompanyList);
$parameters = array('multicompany' => $multicompanyList);
$reshook = $hookmanager->executeHooks('printMultiCompanyEntities', $parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
$multicompanyList .= $hookmanager->resPrint;

View file

@ -186,5 +186,5 @@ abstract class DolibarrTriggers
* @param conf $conf Object conf
* @return int if KO: <0 || if no trigger ran: 0 || if OK: >0
*/
abstract public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf);
abstract public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf);
}

View file

@ -88,7 +88,7 @@ class InterfaceLogevents extends DolibarrTriggers
* @return int if KO: <0, if no trigger ran: 0, if OK: >0
* @throws Exception dol_syslog can throw Exceptions
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (getDolGlobalString('MAIN_LOGEVENTS_DISABLE_ALL')) {
return 0; // Log events is disabled (hidden features)

View file

@ -62,7 +62,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->workflow) || empty($conf->workflow->enabled)) {
return 0; // Module not active, we do nothing

View file

@ -77,7 +77,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (!isModEnabled('agenda')) {
return 0; // Module not active, we do nothing

View file

@ -56,7 +56,7 @@ class InterfaceActionsBlockedLog extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->blockedlog) || empty($conf->blockedlog->enabled)) {
return 0; // Module not active, we do nothing

View file

@ -69,7 +69,7 @@ class InterfaceEventOrganization extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->eventorganization) || empty($conf->eventorganization->enabled)) {
return 0; // Module not active, we do nothing

View file

@ -59,7 +59,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->ldap) || empty($conf->ldap->enabled)) {
return 0; // Module not active, we do nothing

View file

@ -57,7 +57,7 @@ class InterfaceMailmanSpipsynchro extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->mailmanspip) || empty($conf->mailmanspip->enabled)) {
return 0; // Module not active, we do nothing

View file

@ -64,7 +64,7 @@ class InterfaceNotification extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
global $hookmanager;

View file

@ -59,7 +59,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
global $mysoc;

View file

@ -64,7 +64,7 @@ class InterfaceStripe extends DolibarrTriggers
* @param Conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
// Put here code you want to execute when a Dolibarr business event occurs.
// Data and type of action are stored into $object and $action

View file

@ -65,7 +65,7 @@ class InterfaceContactRoles extends DolibarrTriggers
* @param conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if ($action === 'PROPAL_CREATE' || $action === 'ORDER_CREATE' || $action === 'BILL_CREATE'
|| $action === 'ORDER_SUPPLIER_CREATE' || $action === 'BILL_SUPPLIER_CREATE' || $action === 'PROPOSAL_SUPPLIER_CREATE'

View file

@ -65,7 +65,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers
* @param Conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->webhook) || empty($conf->webhook->enabled)) {
return 0; // If module is not enabled, we do nothing

View file

@ -58,7 +58,7 @@ class InterfaceZapierTriggers extends DolibarrTriggers
* @param Conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (empty($conf->zapier) || empty($conf->zapier->enabled)) {
// Module not active, we do nothing

View file

@ -1172,6 +1172,7 @@ if (empty($reshook)) {
$TTotalByTva[$line->tva_tx] += $line->total_ttc;
}
$amount_ttc_diff = 0.;
foreach ($TTotalByTva as $tva => &$total) {
$coef = $total / $srcobject->total_ttc; // Calc coef
$am = $amount * $coef;

View file

@ -5,7 +5,7 @@
--
-- To restrict request to Mysql version x.y minimum use -- VMYSQLx.y
-- To restrict request to Pgsql version x.y minimum use -- VPGSQLx.y
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new;
-- To rename a table: ALTER TABLE llx_table RENAME TO llx_table_new; -- Note that "RENAME TO" is both compatible mysql/postgesql, not "RENAME" alone.
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
-- To drop a column: ALTER TABLE llx_table DROP COLUMN oldname;
@ -227,8 +227,8 @@ ALTER TABLE llx_product ADD COLUMN last_main_doc varchar(255);
ALTER TABLE llx_knowledgemanagement_knowledgerecord MODIFY COLUMN answer longtext;
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME llx_receptiondet_batch_extrafields;
ALTER TABLE llx_commande_fournisseur_dispatch RENAME llx_receptiondet_batch;
ALTER TABLE llx_commande_fournisseur_dispatch_extrafields RENAME TO llx_receptiondet_batch_extrafields;
ALTER TABLE llx_commande_fournisseur_dispatch RENAME TO llx_receptiondet_batch;
-- Rename const to add customer categories on not customer/prospect third-party if enabled
UPDATE llx_const SET name = 'THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT' WHERE name = 'THIRDPARTY_CAN_HAVE_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT_SUPPLIER';

View file

@ -113,20 +113,20 @@ else $result=restrictedArea($user, 'produit|service', '', '', '', '', '', $objca
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
'i.ref'=>"Ref",
'pfi.ref_fourn'=>"RefSupplier",
'i.label'=>"ProductLabel",
'i.description'=>"Description",
"i.note"=>"Note",
'i.ref' => "Ref",
'pfi.ref_fourn' => "RefSupplier",
'i.label' => "ProductLabel",
'i.description' => "Description",
"i.note" => "Note",
);
$isInEEC = isInEEC($mysoc);
// Definition of fields for lists
$arrayfields = array(
'i.ref' => array('label'=>$langs->trans("Ref"), 'checked'=>1),
'i.label' => array('label'=>$langs->trans("Label"), 'checked'=>1),
'i.fk_product_type'=>array('label'=>$langs->trans("Type"), 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service"))),
'i.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1),
'i.label' => array('label' => $langs->trans("Label"), 'checked' => 1),
'i.fk_product_type' => array('label' => $langs->trans("Type"), 'checked' => 0, 'enabled' => (isModEnabled("product") && isModEnabled("service"))),
);
/*
@ -360,7 +360,7 @@ $param .= $hookmanager->resPrint;
// List of mass actions available
$arrayofmassactions = array(
'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
'generate_doc' => img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
//'builddoc'=>$langs->trans("PDFMerge"),
//'presend'=>$langs->trans("SendByMail"),
);
@ -415,6 +415,9 @@ if ($search_all) {
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
if (!isset($moreforfilter)) {
$moreforfilter = '';
}
if (empty($reshook)) {
$moreforfilter .= $hookmanager->resPrint;
} else {
@ -470,7 +473,7 @@ if (!empty($arrayfields['customerorsupplier']['checked'])) {
if (!empty($arrayfields['i.fk_product_type']['checked'])) {
print '<td class="liste_titre left">';
$array = array('-1'=>'&nbsp;', '0'=>$langs->trans('Product'), '1'=>$langs->trans('Service'));
$array = array('-1' => '&nbsp;', '0' => $langs->trans('Product'), '1' => $langs->trans('Service'));
print $form->selectarray('search_type', $array, $search_type);
print '</td>';
}
@ -480,7 +483,7 @@ if (!empty($arrayfields['i.fk_product_type']['checked'])) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
*/
// Fields from hook
$parameters = array('arrayfields'=>$arrayfields);
$parameters = array('arrayfields' => $arrayfields);
$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
// Date creation
@ -532,7 +535,7 @@ if (!empty($arrayfields['i.fk_product_type']['checked'])) {
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
*/
// Hook fields
$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
print $hookmanager->resPrint;
if (!empty($arrayfields['i.datec']['checked'])) {

View file

@ -191,3 +191,5 @@ helpWithAi=Generate message from AI
YouCanMakeSomeInstructionForEmail=You can make some instructions for your Email (Example: generate image in email template...)
ModelTemplate=Email template
YouCanChooseAModelForYouMailContent= You can choose one of template models or generate one with AI
TitleOfMailHolder=Title of the e-mail goes here
ContentOfMailHolder=Content of email goes here...

View file

@ -65,7 +65,7 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
* @param Conf $conf Object conf
* @return int Return integer <0 if KO, 0 if no triggered ran, >0 if OK
*/
public function runTrigger(string $action, $object, User $user, Translate $langs, Conf $conf)
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
{
if (!isModEnabled('mymodule')) {
return 0; // If module is not enabled, we do nothing
@ -139,7 +139,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'ORDER_DELETE':
//case 'ORDER_CANCEL':
//case 'ORDER_SENTBYMAIL':
//case 'ORDER_CLASSIFY_BILLED':
//case 'ORDER_CLASSIFY_BILLED': // TODO Replace it with ORDER_BILLED
//case 'ORDER_CLASSIFY_UNBILLED': // TODO Replace it with ORDER_UNBILLED
//case 'ORDER_SETDRAFT':
//case 'LINEORDER_INSERT':
//case 'LINEORDER_UPDATE':
@ -151,6 +152,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'ORDER_SUPPLIER_VALIDATE':
//case 'ORDER_SUPPLIER_DELETE':
//case 'ORDER_SUPPLIER_APPROVE':
//case 'ORDER_SUPPLIER_CLASSIFY_BILLED': // TODO Replace with ORDER_SUPPLIER_BILLED
//case 'ORDER_SUPPLIER_CLASSIFY_UNBILLED': // TODO Replace with ORDER_SUPPLIER_UNBILLED
//case 'ORDER_SUPPLIER_REFUSE':
//case 'ORDER_SUPPLIER_CANCEL':
//case 'ORDER_SUPPLIER_SENTBYMAIL':
@ -165,6 +168,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'PROPAL_MODIFY':
//case 'PROPAL_VALIDATE':
//case 'PROPAL_SENTBYMAIL':
//case 'PROPAL_CLASSIFY_BILLED': // TODO Replace it with PROPAL_BILLED
//case 'PROPAL_CLASSIFY_UNBILLED': // TODO Replace it with PROPAL_UNBILLED
//case 'PROPAL_CLOSE_SIGNED':
//case 'PROPAL_CLOSE_REFUSED':
//case 'PROPAL_DELETE':
@ -240,6 +245,8 @@ class InterfaceMyModuleTriggers extends DolibarrTriggers
//case 'FICHINTER_CREATE':
//case 'FICHINTER_MODIFY':
//case 'FICHINTER_VALIDATE':
//case 'FICHINTER_CLASSIFY_BILLED': // TODO Replace it with FICHINTER_BILLED
//case 'FICHINTER_CLASSIFY_UNBILLED': // TODO Replace it with FICHINTER_UNBILLED
//case 'FICHINTER_DELETE':
//case 'LINEFICHINTER_CREATE':
//case 'LINEFICHINTER_UPDATE':

View file

@ -38,6 +38,7 @@ $_SESSION["formatsondage"] = "D";
$erreur = false;
$erreurNbchoice = 0;
$choixdate = '';
/*
* Actions
@ -178,7 +179,7 @@ if (GETPOST('confirmation')) {
// Add survey into database
if (!$erreur && $erreurNb == 0) {
$_SESSION["toutchoix"] = substr("$choixdate", 1);
$_SESSION["toutchoix"] = substr($choixdate, 1);
unset($_SESSION["nbrecaseshoraires"]);
ajouter_sondage();

View file

@ -862,6 +862,7 @@ $savnbfield = $totalarray['nbfield'];
$totalarray = array();
$totalarray['nbfield'] = 0;
$imaxinloop = ($limit ? min($num, $limit) : $num);
$textlate = '';
while ($i < $imaxinloop) {
$obj = $db->fetch_object($resql);
if (empty($obj)) {

View file

@ -59,6 +59,7 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox
// Security check
// No check on module enabled. Done later according to $validpaymentmethod
$errmsg = '';
$action = GETPOST('action', 'aZ09');
$id = GETPOSTINT('id');
$securekeyreceived = GETPOST("securekey", 'alpha');

View file

@ -66,6 +66,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors",
// Security check
// No check on module enabled. Done later according to $validpaymentmethod
$errmsg = '';
$action = GETPOST('action', 'aZ09');
$id = GETPOST('id');
$securekeyreceived = GETPOST("securekey");
@ -172,7 +173,7 @@ if (strlen($idvote)) {
// Has not already voted
$conforbooth = new ActionComm($db);
$resultconforbooth = $conforbooth->fetch($idvote);
if ($resultconforbooth<=0) {
if ($resultconforbooth <= 0) {
$error++;
$errmsg .= $conforbooth->error;
} else {
@ -188,11 +189,11 @@ if (strlen($idvote)) {
}
}
}
if ($votestatus=="ok") {
if ($votestatus == "ok") {
setEventMessage($langs->trans("VoteOk"), 'mesgs');
} elseif ($votestatus=="ko") {
} elseif ($votestatus == "ko") {
setEventMessage($langs->trans("AlreadyVoted"), 'warnings');
} elseif ($votestatus=="err") {
} elseif ($votestatus == "err") {
setEventMessage($langs->trans("VoteError"), 'warnings');
}
header("Refresh:0;url=".dol_buildpath('/public/project/viewandvote.php?id='.$id.'&securekey=', 1).$securekeyreceived);

View file

@ -68,27 +68,27 @@ if (empty($usedolheader)) {
<?php
} else {
$arraycss = array();
$arrayjs = array();
/*
$arraycss=array('/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css',
'/includes/jquery/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css',
'/includes/jquery/plugins/datatables/extensions/ColReorder/css/colReorder.dataTables.min.css'
);
$arrayjs=array('/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/dataTables.buttons.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.colVis.min.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.html5.min.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.flash.min.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.print.min.js',
'/includes/jquery/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js',
'/includes/jszip/jszip.min.js',
'/includes/pdfmake/pdfmake.min.js',
'/includes/pdfmake/vfs_fonts.js'
);
*/
$arraycss = array();
$arrayjs = array();
/*
$arraycss=array('/includes/jquery/plugins/datatables/media/css/jquery.dataTables.css',
'/includes/jquery/plugins/datatables/extensions/Buttons/css/buttons.dataTables.min.css',
'/includes/jquery/plugins/datatables/extensions/ColReorder/css/colReorder.dataTables.min.css'
);
$arrayjs=array('/includes/jquery/plugins/datatables/media/js/jquery.dataTables.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/dataTables.buttons.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.colVis.min.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.html5.min.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.flash.min.js',
'/includes/jquery/plugins/datatables/extensions/Buttons/js/buttons.print.min.js',
'/includes/jquery/plugins/datatables/extensions/ColReorder/js/dataTables.colReorder.min.js',
'/includes/jszip/jszip.min.js',
'/includes/pdfmake/pdfmake.min.js',
'/includes/pdfmake/vfs_fonts.js'
);
*/
llxHeader('', '', '', '', 0, 0, $arrayjs, $arraycss);
llxHeader('', '', '', '', 0, 0, $arrayjs, $arraycss);
}
@ -180,6 +180,9 @@ $sortfield = 'aaa';
$sortorder = 'ASC';
$tasksarray = array(1, 2, 3); // To force having several lines
$tagidfortablednd = 'tablelines3';
if (!isset($moreforfilter)) {
$moreforfilter = '';
}
if (!empty($conf->use_javascript_ajax)) {
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
}
@ -201,10 +204,10 @@ if ($filtert) {
if ($socid) {
$nav .= '<input type="hidden" name="socid" value="'.$socid.'">';
}
if ($showbirthday) {
if (isset($showbirthday) && $showbirthday) {
$nav .= '<input type="hidden" name="showbirthday" value="1">';
}
if ($pid) {
if (isset($pid) && $pid) {
$nav .= '<input type="hidden" name="projectid" value="'.$pid.'">';
}
if ($type) {
@ -213,7 +216,7 @@ if ($type) {
if ($usergroup) {
$nav .= '<input type="hidden" name="usergroup" value="'.$usergroup.'">';
}
$nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
$nav .= $form->selectDate($dateselect ?? '', 'dateselect', 0, 0, 1, '', 1, 0);
$nav .= ' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav .= '</form>';
@ -222,25 +225,25 @@ print_barre_liste('Title of my list', 12, $_SERVER["PHP_SELF"], '', '', '', 'Tex
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('This is a select list for a filter A (no combo forced)').': ';
$cate_arbo = array('field1'=>'value1a into the select list A', 'field2'=>'value2a');
$cate_arbo = array('field1' => 'value1a into the select list A', 'field2' => 'value2a');
$moreforfilter .= $form->selectarray('search_aaa', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 0); // List with no js combo
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('This is a select list for a filter B (auto combo)').': ';
$cate_arbo = array('field1'=>'value1b into the select list B', 'field2'=>'value2b');
$cate_arbo = array('field1' => 'value1b into the select list B', 'field2' => 'value2b');
$moreforfilter .= $form->selectarray('search_bbb', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', -1); // List with js combo auto
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('This is a select list for a filter C (combo forced)').': ';
$cate_arbo = array('field1'=>'value1c into the select list C', 'field2'=>'value2c');
$cate_arbo = array('field1' => 'value1c into the select list C', 'field2' => 'value2c');
$moreforfilter .= $form->selectarray('search_ccc', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 1); // List with js combo forced
$moreforfilter .= '</div>';
$moreforfilter .= '<div class="divsearchfield">';
$moreforfilter .= $langs->trans('This is a select list for a filter D (combo forced)').': ';
$cate_arbo = array('field1'=>'value1d into the select list D', 'field2'=>'value2d');
$cate_arbo = array('field1' => 'value1d into the select list D', 'field2' => 'value2d');
$moreforfilter .= $form->selectarray('search_ddd', $cate_arbo, '', 1, 0, 0, '', 0, 0, 0, '', 'maxwidth300', 1); // List with js combo forced
$moreforfilter .= '</div>';
@ -328,7 +331,7 @@ $(document).ready(function(){
<?php
$tasksarray = array(1, 2, 3); // To force having several lines
$tagidfortablednd = 'tablelines';
$tagidfortablednd = 'tablelines';
if (!empty($conf->use_javascript_ajax)) {
include DOL_DOCUMENT_ROOT.'/core/tpl/ajaxrow.tpl.php';
}

View file

@ -264,6 +264,7 @@ if ($action == 'create') {
print "</tr>\n";
$total = 0;
$total_ttc = 0.;
$totalrecu = 0;
while ($i < $num) {

View file

@ -142,9 +142,7 @@ if ($socid > 0) {
}
if (!($object->id > 0) && $action == 'view') {
$langs->load("errors");
print($langs->trans('ErrorRecordNotFound'));
exit;
recordNotFound();
}
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)

View file

@ -567,6 +567,7 @@ if (empty($reshook)) {
echo "</script>";
if ($nbofsuggested > 0) {
$quantityToBeDelivered = 0;
echo "<center>".$langs->trans("SearchIntoBatch").": <b> $nbofsuggested </b></center><br><table>";
foreach ($prod->stock_warehouse[getDolGlobalString($constantforkey)]->detail_batch as $dbatch) { // $dbatch is instance of Productbatch
$batchStock = + $dbatch->qty; // To get a numeric
@ -1604,6 +1605,7 @@ if (!empty($_SESSION["basiclayout"]) && $_SESSION["basiclayout"] == 1) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$categorie = new Categorie($db);
$categories = $categorie->get_full_arbo('product');
$htmlforlines = '';
foreach ($categories as $row) {
if (defined('INCLUDE_PHONEPAGE_FROM_PUBLIC_PAGE')) {
$htmlforlines .= '<div class="leftcat"';

View file

@ -244,4 +244,45 @@ class Functions2LibTest extends CommonClassTest
{
$this->assertEquals($expected, get_string_between($string, $start, $end));
}
/**
* Dataprovider for numero_semaine
*
* @return array<string,array{0:string,1:string}
*/
public function numeroSemaineDataProvider()
{
return [
// time_str, expected week
'day 1 - 1977' => [ "1977/1/1 10:10:10", '53'],
'day 2 - 1977' => [ "1977/1/1 10:10:10", '53'],
'last day - 1977' => [ "1977/12/31 10:10:10", '52'],
'day 1 - 1978' => [ "1978/1/1 10:10:10", '52'],
'day 2 - 1978' => [ "1978/1/2 10:10:10", '01'],
'day 1 - 1981' => [ "1981/1/1 10:10:10", '01'],
'last day - 1981' => [ "1981/12/31 10:10:10", '53'],
'day 1 - 1982' => [ "1982/1/1 10:10:10", '53'],
'day 3 - 1982' => [ "1982/1/3 10:10:10", '53'],
'day 4 - 1982' => [ "1982/1/4 10:10:10", '01'],
];
}
/**
* Test numero_semaine()
*
* @param string $time_str Time (string) to test
* @param int $expected_week Week expected
*
* @return void
*
* @dataProvider numeroSemaineDataProvider
*/
public function testNumeroSemaine($time_str, $expected_week)
{
$time = strtotime($time_str);
$str = date(DATE_ATOM, $time).PHP_EOL;
$this->assertEquals($expected_week, numero_semaine($time), "Computed week incorrect for $str");
}
}