Merge branch 'develop' into patch-1

This commit is contained in:
Laurent Destailleur 2024-12-10 18:47:33 +01:00 committed by GitHub
commit 9550708da7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
32 changed files with 76 additions and 75 deletions

View File

@ -1,8 +1,8 @@
<?php
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -803,14 +803,11 @@ while ($i < $imaxinloop) {
$url .= '&limit='.((int) $limit);
}
if ($page) {
$url .= '&page='.urlencode((string) ($page));
}
if ($sortfield) {
$url .= '&sortfield='.urlencode($sortfield);
}
if ($sortorder) {
$url .= '&page='.urlencode($sortorder);
$url .= '&page='.urlencode((string) $page);
}
$url .= '&sortfield='.urlencode((string) $sortfield);
$url .= '&page='.urlencode((string) $sortorder);
print '<a class="editfielda reposition marginrightonly marginleftonly" href="'.$url.'&action=edit&token='.newToken().'&rowid='.$obj->rowid.'">'.img_edit().'</a>';
//print ' &nbsp; ';
print '<a class=" marginrightonly marginleftonly" href="'.$url.'&action=delete&token='.newToken().'">'.img_delete().'</a> &nbsp; ';
@ -827,7 +824,6 @@ while ($i < $imaxinloop) {
}
}
print '</tr>'."\n";
}

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2017-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -845,7 +845,7 @@ class PaymentVarious extends CommonObject
if ($selected >= 0) {
$return .= '<input id="cb'.$this->id.'" class="flat checkforselect fright" type="checkbox" name="toselect[]" value="'.$this->id.'"'.($selected ? ' checked="checked"' : '').'>';
}
if (!empty($bankline)) {
if (!empty($bankline) && $bankline instanceof AccountLine) {
$return .= ' | <span class="info-box-status ">'.$bankline->getNomUrl(1).'</span>';
}
if (property_exists($this, 'datep')) {

View File

@ -1090,6 +1090,7 @@ class BonPrelevement extends CommonObject
// Pre-store some values into variables to simplify following sql requests
if ($sourcetype != 'salary') {
$entities = $type != 'bank-transfer' ? getEntity('invoice') : getEntity('supplier_invoice');
$sqlTable = $type != 'bank-transfer' ? "facture" : "facture_fourn";
$socOrUser = 'fk_soc';
$societeOrUser = 'societe';
} else {
@ -1099,8 +1100,6 @@ class BonPrelevement extends CommonObject
$societeOrUser = 'user';
}
$sqlTable = $type != 'bank-transfer' ? "facture" : "facture_fourn";
$thirdpartyBANId = 0;
// Check if there is an iban associated to the bank transfer request or if we take the default
@ -1160,7 +1159,7 @@ class BonPrelevement extends CommonObject
$sql .= ", CONCAT(s.firstname,' ',s.lastname) as name";
$sql .= ", f.ref, sr.bic, sr.iban_prefix, 'FRST' as frstrecur";
}
$sql .= " FROM " . $this->db->prefix() . $sqlTable . " as f";
$sql .= " FROM " . $this->db->prefix() . $sqlTable . " as f"; // f is salary, facture or facture_fourn
$sql .= " LEFT JOIN " . $this->db->prefix() . "prelevement_demande as pd ON f.rowid = pd.fk_".$this->db->sanitize($sqlTable);
$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser)." as s ON s.rowid = f.".$this->db->sanitize($socOrUser);
$sql .= " LEFT JOIN " . $this->db->prefix() . $this->db->sanitize($societeOrUser."_rib")." as sr ON s.rowid = sr.".$this->db->sanitize($socOrUser);

View File

@ -102,7 +102,7 @@ class pdf_crabe extends ModelePDFFactures
*/
public function __construct($db)
{
global $conf, $langs, $mysoc;
global $langs, $mysoc;
// Translations
$langs->loadLangs(array("main", "bills"));
@ -359,10 +359,10 @@ class pdf_crabe extends ModelePDFFactures
$certprivate = empty($user->conf->CERTIFICATE_CRT_PRIVATE) ? '' : $user->conf->CERTIFICATE_CRT_PRIVATE;
// If user has no certificate, we try to take the company one
if (!$cert) {
$cert = !getDolGlobalString('CERTIFICATE_CRT') ? '' : $conf->global->CERTIFICATE_CRT;
$cert = getDolGlobalString('CERTIFICATE_CRT');
}
if (!$certprivate) {
$certprivate = !getDolGlobalString('CERTIFICATE_CRT_PRIVATE') ? '' : $conf->global->CERTIFICATE_CRT_PRIVATE;
$certprivate = getDolGlobalString('CERTIFICATE_CRT_PRIVATE');
}
// If a certificate is found
if ($cert) {
@ -1162,7 +1162,7 @@ class pdf_crabe extends ModelePDFFactures
protected function _tableau_info(&$pdf, $object, $posy, $outputlangs, $outputlangsbis)
{
// phpcs:enable
global $conf, $mysoc, $hookmanager;
global $mysoc, $hookmanager;
$default_font_size = pdf_getPDFFontSize($outputlangs);
@ -1170,6 +1170,9 @@ class pdf_crabe extends ModelePDFFactures
krsort($this->tva_array);
// Clean data type
$object->total_tva = (float) $object->total_tva;
// Show VAT details
if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$pdf->SetFillColor(224, 224, 224);
@ -1227,7 +1230,7 @@ class pdf_crabe extends ModelePDFFactures
}
}
// If France, show VAT mention if not applicable
// If France, show VAT mention if applicable
if ($this->emetteur->country_code == 'FR' && empty($object->total_tva) && (empty($mysoc->tva_assuj) || ($this->emetteur->isInEEC() && $object->thirdparty->isInEEC()))) {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
@ -1367,7 +1370,7 @@ class pdf_crabe extends ModelePDFFactures
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
// If payment mode unregulated or payment mode forced to CHQ
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
$diffsizetitle = (!getDolGlobalString('PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
$diffsizetitle = getDolGlobalInt('PDF_DIFFSIZE_TITLE', 3);
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') > 0) {
$account = new Account($this->db);
@ -1385,7 +1388,7 @@ class pdf_crabe extends ModelePDFFactures
$posy = $pdf->GetY() + 2;
}
}
if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) {
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
$pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
@ -1404,7 +1407,7 @@ class pdf_crabe extends ModelePDFFactures
// If payment mode not forced or forced to VIR, show payment with BAN
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR') {
if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) {
$bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
$bankid = ($object->fk_account <= 0 ? getDolGlobalString('FACTURE_RIB_NUMBER') : $object->fk_account);
if ($object->fk_bank > 0) {
$bankid = $object->fk_bank; // For backward compatibility when object->fk_account is forced with object->fk_bank
}
@ -1828,7 +1831,7 @@ class pdf_crabe extends ModelePDFFactures
$index++;
$index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $conf->global->BILL_TEXT_TOTAL_FOOTER, 0, 'L', 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, getDolGlobalString('BILL_TEXT_TOTAL_FOOTER'), 0, 'L', 0);
}
return ($tab2_top + ($tab2_hl * $index));
@ -1877,7 +1880,6 @@ class pdf_crabe extends ModelePDFFactures
$pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
$pdf->RoundedRect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5, $this->corner_radius, '1001', 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
}

View File

@ -1329,7 +1329,7 @@ class pdf_octopus extends ModelePDFFactures
*/
protected function drawInfoTable(&$pdf, $object, $posy, $outputlangs, $outputlangsbis)
{
global $conf, $mysoc, $hookmanager;
global $mysoc, $hookmanager;
$default_font_size = pdf_getPDFFontSize($outputlangs);
@ -1337,6 +1337,9 @@ class pdf_octopus extends ModelePDFFactures
krsort($this->tva_array);
// Clean data type
$object->total_tva = (float) $object->total_tva;
// Show VAT details
if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$pdf->SetFillColor(224, 224, 224);
@ -1394,7 +1397,7 @@ class pdf_octopus extends ModelePDFFactures
}
}
// If France, show VAT mention if not applicable
// If France, show VAT mention if applicable
if ($this->emetteur->country_code == 'FR' && empty($object->total_tva) && (empty($mysoc->tva_assuj) || ($this->emetteur->isInEEC() && $object->thirdparty->isInEEC()))) {
$pdf->SetFont('', 'B', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
@ -1664,7 +1667,7 @@ class pdf_octopus extends ModelePDFFactures
$pdf->SetXY($col1x, $tab2_top + 0);
$pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1);
$total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$total_ht = ((isModEnabled('multicurrency') && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
$pdf->SetXY($col2x, $tab2_top + 0);
$pdf->MultiCell($largcol2, $tab2_hl, price($total_ht, 0, $outputlangs), 0, 'R', 1);
@ -2549,7 +2552,7 @@ class pdf_octopus extends ModelePDFFactures
*/
public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
{
global $conf, $hookmanager;
global $hookmanager;
// Default field style for content
$this->defaultContentsFieldsStyle = array(
@ -2871,7 +2874,6 @@ class pdf_octopus extends ModelePDFFactures
$width = $this->page_largeur - $this->marge_gauche - $this->marge_droite - 83;
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
//$pdf->Rect($this->posx_cumul_anterieur - 1, $tab_top, $width, 5, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
$pdf->RoundedRect($this->posx_cumul_anterieur - 1, $tab_top, $width, 5, $this->corner_radius, '1001', 'F', explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
@ -3069,8 +3071,6 @@ class pdf_octopus extends ModelePDFFactures
*/
public function getDataSituation(&$object)
{
global $conf, $db;
// Fetch previous and next situations invoices.
// Return all previous and next invoices (both standard and credit notes)
$object->fetchPreviousNextSituationInvoice();
@ -3233,7 +3233,6 @@ class pdf_octopus extends ModelePDFFactures
return $object->displayRetainedWarranty();
} else {
// FOR RETROCOMPATIBILITY
global $conf;
// TODO : add a flag on invoices to store this conf USE_RETAINED_WARRANTY_ONLY_FOR_SITUATION_FINAL
@ -3365,7 +3364,7 @@ class pdf_octopus extends ModelePDFFactures
*/
public function btpGetInvoiceAmounts($id, $forceReadFromDB = false)
{
global $user,$langs,$conf,$mysoc,$db,$hookmanager,$nblignes;
global $user, $langs, $mysoc, $db, $hookmanager, $nblignes;
$object = new Facture($db);
$object->fetch($id);
@ -3517,7 +3516,7 @@ class pdf_octopus extends ModelePDFFactures
if (count($propals)) {
$propal = array_pop($propals);
$total_ht = ($conf->multicurrency->enabled && $propal->multicurrency_tx != 1) ? $propal->multicurrency_total_ht : $propal->total_ht;
$total_ht = (isModEnabled('multicurrency') && $propal->multicurrency_tx != 1) ? $propal->multicurrency_total_ht : $propal->total_ht;
$remain_to_pay = $total_ht;
$pdf->SetTextColor(0, 0, 60);
@ -3540,7 +3539,7 @@ class pdf_octopus extends ModelePDFFactures
} elseif (count($orders)) {
$order = array_pop($orders);
$total_ht = ($conf->multicurrency->enabled && $order->multicurrency_tx != 1 ? $order->multicurrency_total_ht : $order->total_ht);
$total_ht = (isModEnabled('multicurrency') && $order->multicurrency_tx != 1 ? $order->multicurrency_total_ht : $order->total_ht);
$remain_to_pay = $total_ht;
}
@ -3608,7 +3607,7 @@ class pdf_octopus extends ModelePDFFactures
$pdf->SetXY($posx, $posy);
$pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
$total_ht = ($conf->multicurrency->enabled && $invoice->multicurrency_tx != 1 ? $invoice->multicurrency_total_ht : $invoice->total_ht);
$total_ht = (isModEnabled('multicurrency') && $invoice->multicurrency_tx != 1 ? $invoice->multicurrency_total_ht : $invoice->total_ht);
$pdf->SetXY($posx + $width, $posy);
$pdf->MultiCell($width2, $height, price($sign * ($total_ht + (!empty($invoice->remise) ? $invoice->remise : 0)), 0, $outputlangs), 0, 'R', 1);
@ -3651,8 +3650,8 @@ class pdf_octopus extends ModelePDFFactures
$index++;
$total_ht = ($conf->multicurrency->enabled && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ht : $invoice->total_ht;
$total_ttc = ($conf->multicurrency->enabled && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ttc : $invoice->total_ttc;
$total_ht = (isModEnabled('multicurrency') && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ht : $invoice->total_ht;
$total_ttc = (isModEnabled('multicurrency') && $invoice->multicurrency_tx != 1) ? $invoice->multicurrency_total_ttc : $invoice->total_ttc;
// Total TTC
$pdf->SetXY($posx, $posy + $height * $index);

View File

@ -1268,6 +1268,9 @@ class pdf_sponge extends ModelePDFFactures
krsort($this->tva_array);
// Clean data type
$object->total_tva = (float) $object->total_tva;
// Show VAT details
if ($object->total_tva != 0 && getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
$pdf->SetFillColor(224, 224, 224);
@ -1325,7 +1328,7 @@ class pdf_sponge extends ModelePDFFactures
}
}
// If France, show VAT mention if not applicable
// If France, show VAT mention if applicable
if ($this->emetteur->country_code == 'FR' && empty($object->total_tva) && (empty($mysoc->tva_assuj) || ($this->emetteur->isInEEC() && $object->thirdparty->isInEEC()))) {
$pdf->SetFont('', '', $default_font_size - 2);
$pdf->SetXY($this->marge_gauche, $posy);
@ -1468,7 +1471,7 @@ class pdf_sponge extends ModelePDFFactures
if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ') {
// If payment mode unregulated or payment mode forced to CHQ
if (getDolGlobalInt('FACTURE_CHQ_NUMBER')) {
$diffsizetitle = (!getDolGlobalString('PDF_DIFFSIZE_TITLE') ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
$diffsizetitle = getDolGlobalInt('PDF_DIFFSIZE_TITLE', 3);
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') > 0) {
$account = new Account($this->db);
@ -1486,7 +1489,7 @@ class pdf_sponge extends ModelePDFFactures
$posy = $pdf->GetY() + 2;
}
}
if ($conf->global->FACTURE_CHQ_NUMBER == -1) {
if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) {
$pdf->SetXY($this->marge_gauche, $posy);
$pdf->SetFont('', 'B', $default_font_size - $diffsizetitle);
$pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0);
@ -1570,7 +1573,7 @@ class pdf_sponge extends ModelePDFFactures
*/
protected function drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs, $outputlangsbis)
{
global $conf, $mysoc, $hookmanager;
global $mysoc, $hookmanager;
$sign = 1;
if ($object->type == 2 && getDolGlobalString('INVOICE_POSITIVE_CREDIT_NOTE')) {

View File

@ -228,7 +228,7 @@ if (!empty($withproject)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('project', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -206,7 +206,7 @@ if (!empty($withproject)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('project', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -180,7 +180,7 @@ if (!empty($withproject)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('project', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -342,7 +342,7 @@ if ($projectid > 0) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('project', 'all', 'lire')) {
$objectsListId = $project->getProjectsAuthorizedForUser($user, 0, 0);
$project->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$project->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($project, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -256,7 +256,7 @@ if (!empty($withproject)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -441,7 +441,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -157,7 +157,7 @@ $morehtmlref .= '</div>';
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -1365,7 +1365,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -128,7 +128,7 @@ $morehtmlref .= '</div>';
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -380,7 +380,7 @@ if ($id > 0 || !empty($ref)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -167,7 +167,7 @@ if ($object->id > 0) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -267,7 +267,7 @@ $morehtmlref .= '</div>';
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "te.rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "te.rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -139,7 +139,7 @@ if (($id > 0 && is_numeric($id)) || !empty($ref)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -157,7 +157,7 @@ $morehtmlref .= '</div>';
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -126,7 +126,7 @@ if ($id > 0 || !empty($ref)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -616,7 +616,7 @@ if ($id > 0 || !empty($ref)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -155,7 +155,7 @@ if ($id > 0 || !empty($ref)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@ -308,7 +308,7 @@ if ($id > 0 || !empty($ref)) {
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")";
$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
} else {
$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
}

View File

@ -212,7 +212,7 @@ if ($id > 0 || !empty($ref)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@ -335,7 +335,7 @@ if ($id > 0 || !empty($ref)) {
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")";
$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
} else {
$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
}

View File

@ -169,7 +169,7 @@ if ($object->id > 0) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@ -293,7 +293,7 @@ if ($object->id > 0) {
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")";
$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
} else {
$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
}

View File

@ -159,7 +159,7 @@ if ($object->id > 0) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
@ -277,7 +277,7 @@ if ($object->id > 0) {
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = " fk_projet:IN:(".$db->sanitize($projectsListId).")";
$object->next_prev_filter = " fk_projet:IN:".$db->sanitize($projectsListId);
} else {
$object->next_prev_filter = " fk_projet:=:".((int) $projectstatic->id);
}

View File

@ -316,7 +316,7 @@ if ($id > 0 || !empty($ref)) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstatic->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@ -597,7 +597,7 @@ if ($id > 0 || !empty($ref)) {
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = "fk_projet:IN:(".$db->sanitize($projectsListId).")";
$object->next_prev_filter = "fk_projet:IN:".$db->sanitize($projectsListId);
} else {
$object->next_prev_filter = "fk_projet:=:".((int) $projectstatic->id);
}

View File

@ -959,7 +959,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
$projectstatic->next_prev_filter = "rowid:IN:(" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0') . ")";
$projectstatic->next_prev_filter = "rowid:IN:" . $db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);
@ -1143,7 +1143,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser
if (!GETPOST('withproject') || empty($projectstatic->id)) {
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
$object->next_prev_filter = "fk_projet:IN:(" . $db->sanitize($projectsListId) . ")";
$object->next_prev_filter = "fk_projet:IN:" . $db->sanitize($projectsListId);
} else {
$object->next_prev_filter = "fk_projet:=:" . ((int) $projectstatic->id);
}

View File

@ -34,7 +34,7 @@ class Client extends Societe
/**
* @var string Used to add a filter in Form::showrefnav method
*/
public $next_prev_filter = "te.client:in:(1,2,3)";
public $next_prev_filter = "te.client:in:1,2,3";
/**
* @var array<int,array{id:int,code:string,label:string,picto:string}>

View File

@ -855,7 +855,7 @@ if ($action == 'create' || $action == 'presend') {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $projectstat->getProjectsAuthorizedForUser($user, $mine, 0);
$projectstat->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$projectstat->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
print $form->showrefnav($projectstat, 'ref', $linkback, 1, 'ref', 'ref', '');
print '</td></tr>';

View File

@ -620,7 +620,7 @@ if ($projectid > 0 || $project_ref) {
// Define a complementary filter for search of next/prev ref.
if (!$user->hasRight('projet', 'all', 'lire')) {
$objectsListId = $object->getProjectsAuthorizedForUser($user, 0, 0);
$object->next_prev_filter = "rowid:IN:(".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0').")";
$object->next_prev_filter = "rowid:IN:".$db->sanitize(count($objectsListId) ? implode(',', array_keys($objectsListId)) : '0');
}
dol_banner_tab($object, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);

View File

@ -50,6 +50,8 @@ print "\n\n\n";
//print dolGetFirstLineOfText($a, 7);
print dol_escape_htmltag($a, 1, 1);
print forgeSQLFromUniversalSearchCriteria("te.client:IN:1,2");
print "\n";
//print print_r(unserialize(serialize($object)));