From 3697d7f2aa1f25a06a4758dc8e7cd2927d0edf8f Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Mon, 7 Oct 2024 15:55:13 +0200 Subject: [PATCH 001/375] Fix: Grand total correction --- htdocs/core/tpl/list_print_total.tpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/list_print_total.tpl.php b/htdocs/core/tpl/list_print_total.tpl.php index 8900665eaeb..8990ce12984 100644 --- a/htdocs/core/tpl/list_print_total.tpl.php +++ b/htdocs/core/tpl/list_print_total.tpl.php @@ -64,7 +64,8 @@ if (isset($totalarray['pos'])) { while ($i < $totalarray['nbfield']) { $i++; if (!empty($totalarray['pos'][$i])) { - printTotalValCell($totalarray['type'][$i], $sumsarray[$totalarray['pos'][$i]]); + $fieldname = preg_replace('/[^a-z0-9]/', '', $totalarray['pos'][$i]); + printTotalValCell($totalarray['type'][$i], $sumsarray[$fieldname]); } else { if ($i == 1) { print ''; From 786905a6c8b341e9d52ec356fce9aab0bec35b63 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Thu, 10 Oct 2024 09:16:32 +0200 Subject: [PATCH 002/375] Fix: Does not filter correctly by project contacts --- htdocs/core/lib/company.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 411fe6d0663..9a1ea12d88f 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -10,7 +10,7 @@ * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2017 Rui Strecht - * Copyright (C) 2018 Ferran Marcet + * Copyright (C) 2018-2024 Ferran Marcet * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -1026,7 +1026,7 @@ function show_projects($conf, $langs, $db, $object, $backtopage = '', $nocreatel $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_type_contact as tc on ec.fk_c_type_contact = tc.rowid"; $sql .= " WHERE sc.fk_soc = ".((int) $object->id); $sql .= " AND p.entity IN (".getEntity('project').")"; - $sql .= " AND tc.element = 'project'"; + $sql .= " AND tc.element = 'project' AND tc.source = 'external'"; $sql .= " ORDER BY p.dateo DESC"; $result = $db->query($sql); From 4354165955958eb031f06bf5ba19bd70f704d941 Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 13 Nov 2024 10:31:47 +0100 Subject: [PATCH 003/375] Fix: Closed invoices are not considered as issued --- .../interface_20_modWorkflow_WorkflowManager.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php index a816a83a428..5f291b9e5bd 100644 --- a/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php +++ b/htdocs/core/triggers/interface_20_modWorkflow_WorkflowManager.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010 Regis Houssin * Copyright (C) 2011-2017 Laurent Destailleur * Copyright (C) 2014 Marcos García - * Copyright (C) 2022 Ferran Marcet + * Copyright (C) 2022-2024 Ferran Marcet * Copyright (C) 2023 Alexandre Janniaux * Copyright (C) 2024 MDW * @@ -248,7 +248,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers $totalHTInvoices = 0; $areAllInvoicesValidated = true; foreach ($orderLinked->linkedObjects['facture'] as $key => $invoice) { - if ($invoice->statut == Facture::STATUS_VALIDATED || $object->id == $invoice->id) { + if ($invoice->statut == Facture::STATUS_VALIDATED || $invoice->statut == Facture::STATUS_CLOSED || $object->id == $invoice->id) { $totalHTInvoices += (float) $invoice->total_ht; } else { $areAllInvoicesValidated = false; From 8fe93618cd8f2320f81f3e14ac4c3e6c193f9c19 Mon Sep 17 00:00:00 2001 From: ICMathieu Date: Fri, 15 Nov 2024 16:59:11 +0100 Subject: [PATCH 004/375] FIX go back status #24944 --- htdocs/don/card.php | 12 ++++++++++++ htdocs/don/class/don.class.php | 15 ++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index 1038cdb68d2..b730a7ff227 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -337,6 +337,15 @@ if (empty($reshook)) { $object->setProject($projectid); } + if ($action == 'set_validate' && $permissiontoadd) { + $object->fetch($id); + if ($object->reopen($user) >= 0) { + $action = ''; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } + if ($action == 'update_extras' && $permissiontoadd) { $object->fetch($id); @@ -932,6 +941,9 @@ if (!empty($id) && $action != 'edit') { if ($object->status == $object::STATUS_VALIDATED && round($remaintopay) == 0 && $object->paid == 0 && $user->hasRight('don', 'creer')) { print '"; } + if ($object->status == $object::STATUS_PAID && $object->paid == 1 && $user->hasRight('don', 'creer')) { + print '"; + } // Delete if ($user->hasRight('don', 'supprimer')) { diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 9ba0ac8de98..a1988a2a2b3 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -859,9 +859,22 @@ class Don extends CommonObject public function reopen($user, $notrigger = 0) { // Protection - if ($this->status != self::STATUS_CANCELED) { + if ($this->status != self::STATUS_CANCELED && $this->status != self::STATUS_PAID) { return 0; } + if($this->statut == self::STATUS_PAID) { + $sql = "UPDATE " . MAIN_DB_PREFIX . "don SET paid = 0 WHERE rowid = " . ((int)$this->id); + + $resql = $this->db->query($sql); + if ($resql) { + if ($this->db->affected_rows($resql)) { + $this->paid = 0; + } else { + dol_print_error($this->db); + return -1; + } + } + } return $this->setStatusCommon($user, self::STATUS_VALIDATED, $notrigger, 'DON_REOPEN'); } From 0bac63ffbca058e77dcb75651960abaff74ea2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20PASCAL?= Date: Sat, 16 Nov 2024 17:16:37 +0100 Subject: [PATCH 005/375] feat: add entity in custom translation with multicompany --- htdocs/admin/translation.php | 56 ++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index 045c32ef64a..c35f486dc02 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -59,6 +59,10 @@ if ($mode == 'searchkey') { $transvalue = GETPOST('transvalue', 'restricthtml'); } +if (isModEnabled('multicompany') && !$user->entity) { + $entity = GETPOST('entity', 'int'); +} + // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); @@ -128,10 +132,19 @@ if ($action == 'update') { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("NewTranslationStringToShow")), null, 'errors'); $error++; } + if ($entity == '') { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Entity")), null, 'errors'); + $error++; + } if (!$error) { $db->begin(); - $sql = "UPDATE ".MAIN_DB_PREFIX."overwrite_trans set transkey = '".$db->escape($transkey)."', transvalue = '".$db->escape($transvalue)."' WHERE rowid = ".(GETPOSTINT('rowid')); + $sql = "UPDATE " . MAIN_DB_PREFIX . "overwrite_trans set transkey = '" . $db->escape( + $transkey + ) . "', transvalue = '" . $db->escape($transvalue) . "', entity = '" . $db->escape( + $entity + ) . "' WHERE rowid = " . ((int) GETPOST('rowid', 'int')); + $result = $db->query($sql); if ($result) { $db->commit(); @@ -368,7 +381,9 @@ if ($mode == 'overwrite') { print_liste_field_titre("Language_en_US_es_MX_etc", $_SERVER["PHP_SELF"], 'lang,transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("TranslationKey", $_SERVER["PHP_SELF"], 'transkey', '', $param, '', $sortfield, $sortorder); print_liste_field_titre("NewTranslationStringToShow", $_SERVER["PHP_SELF"], 'transvalue', '', $param, '', $sortfield, $sortorder); - //if (isModEnabled('multicompany') && !$user->entity) print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'entity,transkey', '', $param, '', $sortfield, $sortorder); + if (isModEnabled('multicompany') && !$user->entity) { + print_liste_field_titre("Entity", $_SERVER["PHP_SELF"], 'Entity', '', $param, '', $sortfield, $sortorder); + } print ''; print "\n"; @@ -376,21 +391,36 @@ if ($mode == 'overwrite') { // Line to add new record print "\n"; - print ''; + print ''; + + // Lang + print ''; print $formadmin->select_language(GETPOST('langcode'), 'langcode', 0, array(), 1, 0, $disablededit ? 1 : 0, 'maxwidth250', 1); print ''."\n"; + + // Trans key print ''; print ''; - print ''; + print ''; + + // Value + print ''; print ''; print ''; + + // Multi company + if (isModEnabled('multicompany') && !$user->entity) { + print ''; + print ''; + print ''; + } + print ''; print ''; print ''; print "\n"; print ''; - // Show constants $sql = "SELECT rowid, entity, lang, transkey, transvalue"; $sql .= " FROM ".MAIN_DB_PREFIX."overwrite_trans"; @@ -411,7 +441,10 @@ if ($mode == 'overwrite') { print ''; + // Lang print ''.dol_escape_htmltag($obj->lang).''."\n"; + + // Trans key print ''; if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; @@ -441,6 +474,19 @@ if ($mode == 'overwrite') { } print ''; + // Entity limit to superadmin + if (isModEnabled('multicompany') && empty($user->entity)) { + print ''; + if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { + print ''; + } else { + print dol_escape_htmltag($obj->entity); + } + print ''; + } else { + print ''; + } + print ''; if ($action == 'edit' && $obj->rowid == GETPOSTINT('rowid')) { print ''; From bcf7031a0419a4a0387ac06cf8185dd85d638868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20PASCAL?= Date: Sat, 16 Nov 2024 17:32:30 +0100 Subject: [PATCH 006/375] fix: declare entity before using it --- htdocs/admin/translation.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php index c35f486dc02..78679cc16e5 100644 --- a/htdocs/admin/translation.php +++ b/htdocs/admin/translation.php @@ -59,6 +59,7 @@ if ($mode == 'searchkey') { $transvalue = GETPOST('transvalue', 'restricthtml'); } +$entity = $conf->entity; if (isModEnabled('multicompany') && !$user->entity) { $entity = GETPOST('entity', 'int'); } From f24ee650fcccd421a5cab898eb8e4b0ec4dea9cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 01:11:41 +0100 Subject: [PATCH 007/375] Update don.class.php --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index a1988a2a2b3..6a948061bd0 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -862,7 +862,7 @@ class Don extends CommonObject if ($this->status != self::STATUS_CANCELED && $this->status != self::STATUS_PAID) { return 0; } - if($this->statut == self::STATUS_PAID) { + if ($this->statut == self::STATUS_PAID) { $sql = "UPDATE " . MAIN_DB_PREFIX . "don SET paid = 0 WHERE rowid = " . ((int)$this->id); $resql = $this->db->query($sql); From b6b53218c5d99b3144ef85a5bb322b1927f2b206 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 17 Nov 2024 01:18:57 +0100 Subject: [PATCH 008/375] Update don.class.php --- htdocs/don/class/don.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 6a948061bd0..b7fecd8eefc 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -863,7 +863,7 @@ class Don extends CommonObject return 0; } if ($this->statut == self::STATUS_PAID) { - $sql = "UPDATE " . MAIN_DB_PREFIX . "don SET paid = 0 WHERE rowid = " . ((int)$this->id); + $sql = "UPDATE " . MAIN_DB_PREFIX . "don SET paid = 0 WHERE rowid = " . ((int) $this->id); $resql = $this->db->query($sql); if ($resql) { From 101ee350d39317339843a307c3d51150f3093f4b Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Thu, 21 Nov 2024 19:51:29 +0100 Subject: [PATCH 009/375] new variable search_term to be more clear, term is only for terminal number --- htdocs/takepos/ajax/ajax.php | 15 ++++++++------- htdocs/takepos/index.php | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/takepos/ajax/ajax.php b/htdocs/takepos/ajax/ajax.php index 1ebadc6541d..b90d55d2aa6 100644 --- a/htdocs/takepos/ajax/ajax.php +++ b/htdocs/takepos/ajax/ajax.php @@ -54,6 +54,7 @@ require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $category = GETPOST('category', 'alphanohtml'); // Can be id of category or 'supplements' $action = GETPOST('action', 'aZ09'); $term = GETPOST('term', 'alpha'); +$search_term = GETPOST('search_term', 'alpha'); $id = GETPOSTINT('id'); $search_start = GETPOSTINT('search_start'); $search_limit = GETPOSTINT('search_limit'); @@ -130,11 +131,11 @@ if ($action == 'getProducts' && $user->hasRight('takepos', 'run')) { } else { echo 'Failed to load category with id='.dol_escape_htmltag($category); } -} elseif ($action == 'search' && $term != '' && $user->hasRight('takepos', 'run')) { +} elseif ($action == 'search' && $search_term != '' && $user->hasRight('takepos', 'run')) { top_httphead('application/json'); // Search barcode into thirdparties. If found, it means we want to change thirdparties. - $result = $thirdparty->fetch('', '', '', $term); + $result = $thirdparty->fetch('', '', '', $search_term); if ($result && $thirdparty->id > 0) { $rows = array(); @@ -187,7 +188,7 @@ if ($action == 'getProducts' && $user->hasRight('takepos', 'run')) { $barcode_value_list = array(); $barcode_offset = 0; - $barcode_length = dol_strlen($term); + $barcode_length = dol_strlen($search_term); if ($barcode_length == $barcode_char_nb) { $rows = array(); @@ -195,7 +196,7 @@ if ($action == 'getProducts' && $user->hasRight('takepos', 'run')) { foreach ($barcode_rules_list as $barcode_rule_arr) { $code = $barcode_rule_arr['code']; $char_nb = $barcode_rule_arr['char_nb']; - $barcode_value_list[$code] = substr($term, $barcode_offset, $char_nb); + $barcode_value_list[$code] = substr($search_term, $barcode_offset, $char_nb); $barcode_offset += $char_nb; } @@ -209,7 +210,7 @@ if ($action == 'getProducts' && $user->hasRight('takepos', 'run')) { $sql .= " AND EXISTS (SELECT cp.fk_product FROM " . $db->prefix() . "categorie_product as cp WHERE cp.fk_product = p.rowid AND cp.fk_categorie IN (".$db->sanitize($filteroncategids)."))"; } $sql .= " AND tosell = 1"; - $sql .= " AND (barcode IS NULL OR barcode <> '" . $db->escape($term) . "')"; + $sql .= " AND (barcode IS NULL OR barcode <> '" . $db->escape($search_term) . "')"; $resql = $db->query($sql); if ($resql && $db->num_rows($resql) == 1) { @@ -249,7 +250,7 @@ if ($action == 'getProducts' && $user->hasRight('takepos', 'run')) { 'label' => $obj->label, 'tosell' => $obj->tosell, 'tobuy' => $obj->tobuy, - 'barcode' => $term, // there is only one product matches the barcode rule and so the term is considered as the barcode of this product + 'barcode' => $search_term, // there is only one product matches the barcode rule and so the term is considered as the barcode of this product 'price' => empty($objProd->multiprices[$pricelevel]) ? $obj->price : $objProd->multiprices[$pricelevel], 'price_ttc' => empty($objProd->multiprices_ttc[$pricelevel]) ? $obj->price_ttc : $objProd->multiprices_ttc[$pricelevel], 'object' => 'product', @@ -317,7 +318,7 @@ if ($action == 'getProducts' && $user->hasRight('takepos', 'run')) { if (getDolGlobalInt('TAKEPOS_PRODUCT_IN_STOCK') == 1 && getDolGlobalInt('CASHDESK_ID_WAREHOUSE'.$_SESSION['takeposterminal'])) { $sql .= ' AND ps.reel > 0'; } - $sql .= natural_search(array('ref', 'label', 'barcode'), $term); + $sql .= natural_search(array('ref', 'label', 'barcode'), $search_term); // Add where from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index 62a1d45ce34..0656fddcb97 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -744,7 +744,7 @@ function Search2(keyCodeForEnter, moreorless) { pageproducts = 0; jQuery(".wrapper2 .catwatermark").hide(); var nbsearchresults = 0; - $.getJSON('/takepos/ajax/ajax.php?action=search&token=&term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { + $.getJSON('/takepos/ajax/ajax.php?action=search&token=&search_term=' + search_term + '&thirdpartyid=' + jQuery('#thirdpartyid').val() + '&search_start=' + search_start + '&search_limit=' + search_limit, function (data) { for (i = 0; i < ; i++) { if (typeof (data[i]) == "undefined") { $("#prowatermark" + i).html(""); From 343873c82f1aa8936a31e677209f48f777bb3d26 Mon Sep 17 00:00:00 2001 From: David Beniamine Date: Thu, 7 Nov 2024 23:42:03 +0100 Subject: [PATCH 010/375] Once payment is complet, a click on a product should start a new sale --- htdocs/takepos/index.php | 5 +++++ htdocs/takepos/pay.php | 1 + 2 files changed, 6 insertions(+) diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php index a92bc4cac53..c9fb88f2ed0 100644 --- a/htdocs/takepos/index.php +++ b/htdocs/takepos/index.php @@ -527,6 +527,10 @@ function MoreProducts(moreorless) { function ClickProduct(position, qty = 1) { console.log("ClickProduct at position"+position); + if ($('#invoiceid').val() == "") { + invoiceid = $('#invoiceid').val(); + Refresh(); + } $('#proimg'+position).animate({opacity: '0.5'}, 1); $('#proimg'+position).animate({opacity: '1'}, 100); if ($('#prodiv'+position).data('iscat')==1){ @@ -1015,6 +1019,7 @@ function ModalBox(ModalID) function DirectPayment(){ console.log("DirectPayment"); $("#poslines").load("invoice.php?place="+place+"&action=valid&token=&pay=LIQ", function() { + $('#invoiceid').val(""); }); } diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index d2ee2999100..492419e264d 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -352,6 +352,7 @@ if (!getDolGlobalInt("TAKEPOS_NUMPAD")) { parent.$("#poslines").load("invoice.php?place=&action=valid&token=&pay="+payment+"&amount="+amountpayed+"&excess="+excess+"&invoiceid="+invoiceid+"&accountid="+accountid, function() { if (amountpayed > || amountpayed == || amountpayed==0 ) { console.log("Close popup"); + parent.$('#invoiceid').val(""); parent.$.colorbox.close(); } else { From c86b50e3fc0ff807e78dbe68e51313d8350d60d4 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Sat, 30 Nov 2024 14:24:13 +0100 Subject: [PATCH 011/375] The $empty param must follow same rules than other select component. --- htdocs/core/class/html.formticket.class.php | 42 +++++++++++---------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 8920b259489..0cbd3e55876 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -332,7 +332,7 @@ class FormTicket // Type of Ticket print ''; - $this->selectTypesTickets((GETPOST('type_code', 'alpha') ? GETPOST('type_code', 'alpha') : $this->type_code), 'type_code', '', 2, 1, 0, 0, 'minwidth200'); + $this->selectTypesTickets((GETPOST('type_code', 'alpha') ? GETPOST('type_code', 'alpha') : $this->type_code), 'type_code', '', 2, 'ifone', 0, 0, 'minwidth200'); print ''; // Group => Category @@ -342,12 +342,12 @@ class FormTicket $filter = 'public=1'; } $selected = (GETPOST('category_code') ? GETPOST('category_code') : $this->category_code); - $this->selectGroupTickets($selected, 'category_code', $filter, 2, 1, 0, 0, 'minwidth200'); + $this->selectGroupTickets($selected, 'category_code', $filter, 2, 'ifone', 0, 0, 'minwidth200'); print ''; // Severity => Priority print ''; - $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 1); + $this->selectSeveritiesTickets((GETPOST('severity_code') ? GETPOST('severity_code') : $this->severity_code), 'severity_code', '', 2, 'ifone'); print ''; if (!empty($conf->knowledgemanagement->enabled)) { @@ -690,8 +690,8 @@ class FormTicket * @param string|array $selected Id of preselected field or array of Ids * @param string $htmlname Nom de la zone select * @param string $filtertype To filter on field type in llx_c_ticket_type (array('code'=>xx,'label'=>zz)) - * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code - * @param int $empty 1=peut etre vide, 0 sinon + * @param int $format 0=id+label, 1=code+code, 2=code+label, 3=id+code + * @param int|string $empty 1 = can be empty or 'string' to show the string as the empty value, 0 = can't be empty, 'ifone' = can be empty but autoselected if there is one only * @param int $noadmininfo 0=Add admin info, 1=Disable admin info * @param int $maxlength Max length of label * @param string $morecss More CSS @@ -715,9 +715,9 @@ class FormTicket $ticketstat->loadCacheTypesTickets(); - print ''; + if ($empty) { + print ''; } if (is_array($ticketstat->cache_types_tickets) && count($ticketstat->cache_types_tickets)) { @@ -755,6 +755,8 @@ class FormTicket print ' selected="selected"'; } elseif ($arraytypes['use_default'] == "1" && empty($selected) && !$multiselect) { print ' selected="selected"'; + } elseif (count($ticketstat->cache_types_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it + print ' selected="selected"'; } print '>'; @@ -813,10 +815,10 @@ class FormTicket $ticketstat = new Ticket($this->db); $ticketstat->loadCacheCategoriesTickets($publicgroups ? 1 : -1); // get list of active ticket groups - if ($use_multilevel <= 0) { + if ($use_multilevel <= 0) { // Only one combo list to select the group of ticket (default) print ''; if ($empty) { - print ''; + print ''; } if (is_array($ticketstat->cache_severity_tickets) && count($ticketstat->cache_severity_tickets)) { @@ -1201,6 +1203,8 @@ class FormTicket print ' selected="selected"'; } elseif ($arrayseverities['use_default'] == "1" && empty($selected)) { print ' selected="selected"'; + } elseif (count($conf->cache['severity_tickets']) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it + print ' selected="selected"'; } print '>'; From e48e1e27d542787ca0d42f7fdc814214348f8edc Mon Sep 17 00:00:00 2001 From: tnegre Date: Fri, 6 Dec 2024 12:07:37 +0100 Subject: [PATCH 012/375] replace code from develop to match DLB18 variable name --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 0cbd3e55876..9c3a3847a24 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1203,7 +1203,7 @@ class FormTicket print ' selected="selected"'; } elseif ($arrayseverities['use_default'] == "1" && empty($selected)) { print ' selected="selected"'; - } elseif (count($conf->cache['severity_tickets']) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it + } elseif (count($ticketstat->cache_severity_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; } From e8aaa51edcf65d9feacb7000ee6e657419670275 Mon Sep 17 00:00:00 2001 From: tnegre Date: Fri, 6 Dec 2024 14:06:54 +0100 Subject: [PATCH 013/375] set empty value for choice --- htdocs/ticket/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 9e69271f09c..9f1f30a3e7f 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -856,11 +856,11 @@ foreach ($object->fields as $key => $val) { print ''; } elseif ($key == 'category_code') { print ''; - $formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); + $formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, ' ', 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); print ''; } elseif ($key == 'severity_code') { print ''; - $formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); + $formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, ' ', 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); print ''; } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') { print ''; From 86833633efb1098e2363e41e2047b4813b20405a Mon Sep 17 00:00:00 2001 From: tnegre Date: Wed, 18 Dec 2024 10:26:26 +0100 Subject: [PATCH 014/375] fix --- htdocs/core/class/html.formticket.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 9c3a3847a24..4a140185432 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -863,9 +863,9 @@ class FormTicket print ' selected="selected"'; } elseif (isset($selected) && $selected == $id) { print ' selected="selected"'; - } elseif ($arraycategories['use_default'] == "1" && !$selected && !$empty) { + } elseif ($arraycategories['use_default'] == "1" && !$selected && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; - } elseif (count($ticketstat->cache_category_tickets) == 1) { + } elseif (count($ticketstat->cache_category_tickets) == 1 && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; } @@ -1201,7 +1201,7 @@ class FormTicket print ' selected="selected"'; } elseif (isset($selected) && $selected == $id) { print ' selected="selected"'; - } elseif ($arrayseverities['use_default'] == "1" && empty($selected)) { + } elseif ($arrayseverities['use_default'] == "1" && empty($selected) && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; } elseif (count($ticketstat->cache_severity_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; From fed049e93e2bccf66bed6416e04bf0fa46e49768 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20PASCAL?= Date: Tue, 24 Dec 2024 10:36:53 +0100 Subject: [PATCH 015/375] feat: add function to get public holidays list within period --- htdocs/core/lib/date.lib.php | 268 +++++++++++++++++++++++++++++++++++ 1 file changed, 268 insertions(+) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 1005cc70941..77fbf7944e2 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -1013,6 +1013,274 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', return $nbFerie; } +/** + * Return the list of public holidays including Friday, Saturday and Sunday (or not) between 2 dates in timestamp. + * Dates must be UTC with hour, min, sec to 0. + * Called by function num_open_day() + * + * @param int $timestampStart Timestamp start (UTC with hour, min, sec = 0) + * @param int $timestampEnd Timestamp end (UTC with hour, min, sec = 0) + * @param string $country_code Country code + * @param int $lastday Last day is included, 0: no, 1:yes + * @param int $excludesaturday Exclude saturday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $excludesunday Exclude sunday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $excludefriday Exclude friday as non working day (-1=use setup, 0=no, 1=yes) + * @param int $excludemonday Exclude monday as non working day (-1=use setup, 0=no, 1=yes) + * @return int|array List of public holidays or error message string if error + * @see num_between_day(), num_open_day() + */ +function list_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $excludesaturday = -1, $excludesunday = -1, $excludefriday = -1, $excludemonday = -1) +{ + global $conf, $db, $mysoc; + + // Check to ensure we use correct parameters + if (($timestampEnd - $timestampStart) % 86400 != 0) { + return 'Error Dates must use same hours and must be GMT dates'; + } + + if (empty($country_code)) { + $country_code = $mysoc->country_code; + } + if ($excludemonday < 0) { + $excludemonday = getDolGlobalInt('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY', 0); + } + if ($excludefriday < 0) { + $excludefriday = getDolGlobalInt('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY', 0); + } + if ($excludesaturday < 0) { + $excludesaturday = getDolGlobalInt('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', 1); + } + if ($excludesunday < 0) { + $excludesunday = getDolGlobalInt('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', 1); + } + + $country_id = dol_getIdFromCode($db, $country_code, 'c_country', 'code', 'rowid'); + + if (empty($conf->cache['arrayOfActivePublicHolidays_' . $country_id])) { + // Loop on public holiday defined into hrm_public_holiday for the day, month and year analyzed + $tmpArrayOfPublicHolidays = array(); + $sql = "SELECT id, code, entity, fk_country, dayrule, year, month, day, active"; + $sql .= " FROM " . MAIN_DB_PREFIX . "c_hrm_public_holiday"; + $sql .= " WHERE active = 1 and fk_country IN (0" . ($country_id > 0 ? ", " . $country_id : 0) . ")"; + $sql .= " AND entity IN (0," . getEntity('holiday') . ")"; + + $resql = $db->query($sql); + if ($resql) { + $num_rows = $db->num_rows($resql); + $i = 0; + while ($i < $num_rows) { + $obj = $db->fetch_object($resql); + $tmpArrayOfPublicHolidays[$obj->id] = array('dayrule' => $obj->dayrule, 'year' => $obj->year, 'month' => $obj->month, 'day' => $obj->day); + $i++; + } + } else { + dol_syslog($db->lasterror(), LOG_ERR); + return 'Error sql ' . $db->lasterror(); + } + + //var_dump($tmpArrayOfPublicHolidays); + $conf->cache['arrayOfActivePublicHolidays_' . $country_id] = $tmpArrayOfPublicHolidays; + } + + $arrayOfPublicHolidays = $conf->cache['arrayOfActivePublicHolidays_' . $country_id]; + $listFeries = []; + $i = 0; + while ((($lastday == 0 && $timestampStart < $timestampEnd) || ($lastday && $timestampStart <= $timestampEnd)) + && ($i < 50000)) { // Loop end when equals (Test on i is a security loop to avoid infinite loop) + $nonWorkingDay = false; + $ferie = false; + $specialdayrule = array(); + + $jour = (int) gmdate("d", $timestampStart); + $mois = (int) gmdate("m", $timestampStart); + $annee = (int) gmdate("Y", $timestampStart); + + // If we have to exclude Friday, Saturday and Sunday + if ($excludefriday || $excludesaturday || $excludesunday) { + $jour_julien = unixtojd($timestampStart); + $jour_semaine = jddayofweek($jour_julien, 0); + if ($excludefriday) { //Friday (5), Saturday (6) and Sunday (0) + if ($jour_semaine == 5) { + $nonWorkingDay = true; + } + } + if ($excludesaturday) { //Friday (5), Saturday (6) and Sunday (0) + if ($jour_semaine == 6) { + $nonWorkingDay = true; + } + } + if ($excludesunday) { //Friday (5), Saturday (6) and Sunday (0) + if ($jour_semaine == 0) { + $nonWorkingDay = true; + } + } + } + //print "ferie=".$nonWorkingDay."\n"; + + if (!$nonWorkingDay) { + //print "jour=".$jour." month=".$mois." year=".$annee." includesaturday=".$excludesaturday." includesunday=".$excludesunday."\n"; + foreach ($arrayOfPublicHolidays as $entrypublicholiday) { + if (!empty($entrypublicholiday['dayrule']) && $entrypublicholiday['dayrule'] != 'date') { // For example 'easter', '...' + $specialdayrule[$entrypublicholiday['dayrule']] = $entrypublicholiday['dayrule']; + } else { + $match = 1; + if (!empty($entrypublicholiday['year']) && $entrypublicholiday['year'] != $annee) { + $match = 0; + } + if ($entrypublicholiday['month'] != $mois) { + $match = 0; + } + if ($entrypublicholiday['day'] != $jour) { + $match = 0; + } + + if ($match) { + $ferie = true; + $listFeries[] = $timestampStart; + } + } + + $i++; + } + //var_dump($specialdayrule)."\n"; + //print "ferie=".$nonWorkingDay."\n"; + } + + if (!$nonWorkingDay && !$ferie) { + // Special dayrules + if (in_array('easter', $specialdayrule)) { + // Calculation for easter date + $date_paques = getGMTEasterDatetime($annee); + $jour_paques = gmdate("d", $date_paques); + $mois_paques = gmdate("m", $date_paques); + if ($jour_paques == $jour && $mois_paques == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + // Easter (sunday) + } + + if (in_array('eastermonday', $specialdayrule)) { + // Calculation for the monday of easter date + $date_paques = getGMTEasterDatetime($annee); + //print 'PPP'.$date_paques.' '.dol_print_date($date_paques, 'dayhour', 'gmt')." "; + $date_lundi_paques = $date_paques + (3600 * 24); + $jour_lundi_paques = gmdate("d", $date_lundi_paques); + $mois_lundi_paques = gmdate("m", $date_lundi_paques); + if ($jour_lundi_paques == $jour && $mois_lundi_paques == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + // Easter (monday) + //print 'annee='.$annee.' $jour='.$jour.' $mois='.$mois.' $jour_lundi_paques='.$jour_lundi_paques.' $mois_lundi_paques='.$mois_lundi_paques."\n"; + } + + //Good Friday + if (in_array('goodfriday', $specialdayrule)) { + // Pulls the date of Easter + $easter = getGMTEasterDatetime($annee); + + // Calculates the date of Good Friday based on Easter + $date_good_friday = $easter - (2 * 3600 * 24); + $dom_good_friday = gmdate("d", $date_good_friday); + $month_good_friday = gmdate("m", $date_good_friday); + + if ($dom_good_friday == $jour && $month_good_friday == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + } + + if (in_array('ascension', $specialdayrule)) { + // Calcul du jour de l'ascension (39 days after easter day) + $date_paques = getGMTEasterDatetime($annee); + $date_ascension = $date_paques + (3600 * 24 * 39); + $jour_ascension = gmdate("d", $date_ascension); + $mois_ascension = gmdate("m", $date_ascension); + if ($jour_ascension == $jour && $mois_ascension == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + // Ascension (thursday) + } + + if (in_array('pentecost', $specialdayrule)) { + // Calculation of "Pentecote" (49 days after easter day) + $date_paques = getGMTEasterDatetime($annee); + $date_pentecote = $date_paques + (3600 * 24 * 49); + $jour_pentecote = gmdate("d", $date_pentecote); + $mois_pentecote = gmdate("m", $date_pentecote); + if ($jour_pentecote == $jour && $mois_pentecote == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + // "Pentecote" (sunday) + } + + if (in_array('pentecotemonday', $specialdayrule)) { + // Calculation of "Pentecote" (49 days after easter day) + $date_paques = getGMTEasterDatetime($annee); + $date_pentecote = $date_paques + (3600 * 24 * 50); + $jour_pentecote = gmdate("d", $date_pentecote); + $mois_pentecote = gmdate("m", $date_pentecote); + if ($jour_pentecote == $jour && $mois_pentecote == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + // "Pentecote" (monday) + } + + if (in_array('viernessanto', $specialdayrule)) { + // Viernes Santo + $date_paques = getGMTEasterDatetime($annee); + $date_viernes = $date_paques - (3600 * 24 * 2); + $jour_viernes = gmdate("d", $date_viernes); + $mois_viernes = gmdate("m", $date_viernes); + if ($jour_viernes == $jour && $mois_viernes == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + //Viernes Santo + } + + if (in_array('fronleichnam', $specialdayrule)) { + // Fronleichnam (60 days after easter sunday) + $date_paques = getGMTEasterDatetime($annee); + $date_fronleichnam = $date_paques + (3600 * 24 * 60); + $jour_fronleichnam = gmdate("d", $date_fronleichnam); + $mois_fronleichnam = gmdate("m", $date_fronleichnam); + if ($jour_fronleichnam == $jour && $mois_fronleichnam == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + // Fronleichnam + } + + if (in_array('genevafast', $specialdayrule)) { + // Geneva fast in Switzerland (Thursday after the first sunday in September) + $date_1sunsept = strtotime('next thursday', strtotime('next sunday', mktime(0, 0, 0, 9, 1, $annee))); + $jour_1sunsept = date("d", $date_1sunsept); + $mois_1sunsept = date("m", $date_1sunsept); + if ($jour_1sunsept == $jour && $mois_1sunsept == $mois) { + $ferie = true; + $listFeries[] = $timestampStart; + } + // Geneva fast in Switzerland + } + } + //print "ferie=".$nonWorkingDay."\n"; + + // Increase number of days (on go up into loop) + $timestampStart = dol_time_plus_duree($timestampStart, 1, 'd'); + //var_dump($jour.' '.$mois.' '.$annee.' '.$timestampStart); + + $i++; + } + + //print "nbFerie=".$nbFerie."\n"; + return $listFeries; +} + /** * Function to return number of days between two dates (date must be UTC date !) * Example: 2012-01-01 2012-01-02 => 1 if lastday=0, 2 if lastday=1 From 39e509f3809ee47d40cefe2c7977b7b34bff53b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9?= Date: Tue, 24 Dec 2024 10:50:29 +0100 Subject: [PATCH 016/375] fix: list_public_holiday function return type --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 77fbf7944e2..87ad6a3a213 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -1026,7 +1026,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', * @param int $excludesunday Exclude sunday as non working day (-1=use setup, 0=no, 1=yes) * @param int $excludefriday Exclude friday as non working day (-1=use setup, 0=no, 1=yes) * @param int $excludemonday Exclude monday as non working day (-1=use setup, 0=no, 1=yes) - * @return int|array List of public holidays or error message string if error + * @return string|array List of public holidays or error message string if error * @see num_between_day(), num_open_day() */ function list_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $excludesaturday = -1, $excludesunday = -1, $excludefriday = -1, $excludemonday = -1) From 303b7423f350590e7046b5ef11de4c19964b2144 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9?= Date: Tue, 24 Dec 2024 11:01:15 +0100 Subject: [PATCH 017/375] fix: update list_public_holiday return type --- htdocs/core/lib/date.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php index 87ad6a3a213..956a3f2d2a5 100644 --- a/htdocs/core/lib/date.lib.php +++ b/htdocs/core/lib/date.lib.php @@ -1026,7 +1026,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $country_code = '', * @param int $excludesunday Exclude sunday as non working day (-1=use setup, 0=no, 1=yes) * @param int $excludefriday Exclude friday as non working day (-1=use setup, 0=no, 1=yes) * @param int $excludemonday Exclude monday as non working day (-1=use setup, 0=no, 1=yes) - * @return string|array List of public holidays or error message string if error + * @return string|int[] List of public holidays timestamps or error message string if error * @see num_between_day(), num_open_day() */ function list_public_holiday($timestampStart, $timestampEnd, $country_code = '', $lastday = 0, $excludesaturday = -1, $excludesunday = -1, $excludefriday = -1, $excludemonday = -1) From e9eb22f8f0a8667873e13cafca87723002a28d0d Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Fri, 10 Jan 2025 11:17:06 +0100 Subject: [PATCH 018/375] zero could be a value --- htdocs/admin/dict.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 9d265d0240d..3536ec55be5 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2076,7 +2076,7 @@ if ($id > 0) { //var_dump($fieldlist); $class = ''; $showfield = 1; - $valuetoshow = empty($obj->$value) ? '' : $obj->$value; + $valuetoshow = !isset($obj->$value) ? '' : $obj->$value; $titletoshow = ''; if ($value == 'entity') { From a34d760a88cfd7a96b00864180aed06cde2d4c5c Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Fri, 10 Jan 2025 11:28:46 +0100 Subject: [PATCH 019/375] fix edit : display zero value instead of nothing --- htdocs/admin/dict.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 3536ec55be5..e1a38d4c750 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2445,7 +2445,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } if (in_array($value, array('code', 'libelle', 'type')) && $tabname == "c_actioncomm" && isset($obj->$value) && in_array($obj->type, array('system', 'systemauto'))) { - $hidden = (!empty($obj->{$value}) ? $obj->{$value}:''); + $hidden = (isset($obj->{$value}) ? $obj->{$value}:''); print ''; print ''; print $langs->trans($hidden); @@ -2558,7 +2558,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } elseif ($value == 'price' || preg_match('/^amount/i', $value)) { print ''; } elseif ($value == 'code' && isset($obj->{$value})) { - print ''; + print ''; } elseif ($value == 'unit') { print ''; $units = array( From db47ce3bb129a1dde64bf3348b46a4e2073acb09 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 20 Jan 2025 11:33:24 +0100 Subject: [PATCH 020/375] FIX delete supplier order line when linked to customer order line --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 020b551f99a..156ec3971ef 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3894,7 +3894,7 @@ class CommandeFournisseurLigne extends CommonOrderLine return -1; } - $sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE rowid=".((int) $this->id); + $sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet=".((int) $this->id); $resql = $this->db->query($sql1); if (!$resql) { $this->db->rollback(); From 08a976fd8545ec7edfa17543fb099f74d6a84a9d Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 20 Jan 2025 11:56:54 +0100 Subject: [PATCH 021/375] FIX delete supplier order when at least one line linked to customer order line --- htdocs/fourn/class/fournisseur.commande.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 156ec3971ef..8bd670525a1 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2133,6 +2133,16 @@ class CommandeFournisseur extends CommonOrder $error++; } + if (!$error) { + $sql1 = "UPDATE ".MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet IN (SELECT rowid FROM ".$main." WHERE fk_commande = ".((int) $this->id).")"; + dol_syslog(__METHOD__." linked order lines", LOG_DEBUG); + if (!$this->db->query($sql1)) { + $error++; + $this->error = $this->db->lasterror(); + $this->errors[] = $this->db->lasterror(); + } + } + $sql = "DELETE FROM ".MAIN_DB_PREFIX."commande_fournisseurdet WHERE fk_commande =".((int) $this->id); dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (!$this->db->query($sql)) { From ad60a50d4de17dedcbf6244ff9082343148785d1 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 20 Jan 2025 11:58:58 +0100 Subject: [PATCH 022/375] Uniformize SQL concat char --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 8bd670525a1..0e16160189e 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3904,7 +3904,7 @@ class CommandeFournisseurLigne extends CommonOrderLine return -1; } - $sql1 = 'UPDATE '.MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet=".((int) $this->id); + $sql1 = "UPDATE ".MAIN_DB_PREFIX."commandedet SET fk_commandefourndet = NULL WHERE fk_commandefourndet=".((int) $this->id); $resql = $this->db->query($sql1); if (!$resql) { $this->db->rollback(); From 02dea8d103a8edd96746b0cfb3a307e9ed2f61ba Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 20 Jan 2025 17:11:06 +0100 Subject: [PATCH 023/375] fix: allow list mass action update price when price mode is multiprice price --- htdocs/core/actions_massactions.inc.php | 42 ++++++++++++++++++------- htdocs/product/list.php | 5 ++- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 6e26ef0eca7..3f06f4f3e8c 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1281,18 +1281,38 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa $result = $object->fetch($toselectid); //var_dump($contcats);exit; if ($result > 0) { - if ($obj->price_base_type == 'TTC') { - $newprice = $object->price_ttc * (100 + $pricepercentage) / 100; - $minprice = $object->price_min_ttc; + if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + for ($level = 1; $level <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $level++) { + // Force the update of the price of the product using the new VAT + if ($object->price_base_type == 'TTC') { + $newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100; + $minprice = $object->multiprices_min_ttc[$level]; + } else { + $newprice = $object->multiprices[$level] * (100 + $pricepercentage) / 100; + $minprice = $object->multiprices_min[$level]; + } + $ret = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); + + if ($res > 0) { + $nbok++; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } + } } else { - $newprice = $object->price * (100 + $pricepercentage) / 100; - $minprice = $object->price_min; - } - $res = $object->updatePrice($newprice, $obj->price_base_type, $user, $object->tva_tx, $minprice, 0, $object->tva_npr, 0, 0, array(), $object->default_vat_code); - if ($res > 0) { - $nbok++; - } else { - setEventMessages($object->error, $object->errors, 'errors'); + if ($object->price_base_type == 'TTC') { + $newprice = $object->price_ttc * (100 + $pricepercentage) / 100; + $minprice = $object->price_min_ttc; + } else { + $newprice = $object->price * (100 + $pricepercentage) / 100; + $minprice = $object->price_min; + } + $res = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, 0, $object->tva_npr, 0, 0, array(), $object->default_vat_code); + if ($res > 0) { + $nbok++; + } else { + setEventMessages($object->error, $object->errors, 'errors'); + } } } else { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4d817250cbe..cecce963be1 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -829,9 +829,8 @@ $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight($rightskey, 'creer')) { - if (getDolGlobalString('PRODUCT_PRICE_UNIQ') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { - $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); - } + $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); + $arrayofmassactions['switchonsalestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnSaleStatus"); $arrayofmassactions['switchonpurchasestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnPurchaseStatus"); From e4078477c6c05d51caabeacfd8b5004bed0dffcb Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Mon, 20 Jan 2025 17:32:08 +0100 Subject: [PATCH 024/375] fix: allow list mass action update price when price mode is multiprice price --- htdocs/core/actions_massactions.inc.php | 3 +-- htdocs/core/tpl/massactions_pre.tpl.php | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 3f06f4f3e8c..e84c02a8c93 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1291,8 +1291,7 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa $newprice = $object->multiprices[$level] * (100 + $pricepercentage) / 100; $minprice = $object->multiprices_min[$level]; } - $ret = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); - + $res = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); if ($res > 0) { $nbok++; } else { diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index 3c321f10123..bdbcee257f5 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -112,7 +112,12 @@ if ($massaction == 'preupdateprice') { 'value' => $valuefield ); - print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $langs->trans("ConfirmUpdatePriceQuestion", count($toselect)), "updateprice", $formquestion, 1, 0, 200, 500, 1); + $descConfirmPreUpdatePrice=$langs->trans("ConfirmUpdatePriceQuestion", count($toselect)); + if (getDolGlobalString('PRODUIT_MULTIPRICES')) { + $descConfirmPreUpdatePrice=$langs->trans("ConfirmUpdatePriceQuestion", count($toselect)*getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT') .' ('.$langs->transnoentities('PricingRule').', '.$langs->transnoentities('MultiPricesNumPrices').')'); + } + + print $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans("ConfirmUpdatePrice"), $descConfirmPreUpdatePrice, "updateprice", $formquestion, 1, 0, 200, 500, 1); } if ($massaction == 'presetsupervisor') { From 8d0a4ac6d91b0f719135d86c46311094b4987ba9 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 22 Jan 2025 20:18:53 +0100 Subject: [PATCH 025/375] fix: allow list mass action update price when price mode is multiprice price --- htdocs/core/actions_massactions.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e84c02a8c93..fb45b57ac7a 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1283,7 +1283,6 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa if ($result > 0) { if (getDolGlobalString('PRODUIT_MULTIPRICES')) { for ($level = 1; $level <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $level++) { - // Force the update of the price of the product using the new VAT if ($object->price_base_type == 'TTC') { $newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100; $minprice = $object->multiprices_min_ttc[$level]; From 046d0511db5e5d392a35577839c677ecf6c5e912 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Mon, 27 Jan 2025 08:40:13 +0100 Subject: [PATCH 026/375] add an info against booking.class.php > calendar.class.php --- ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e13f51fa5b..bc39e16a356 100644 --- a/ChangeLog +++ b/ChangeLog @@ -518,7 +518,7 @@ NEW: Upgrade in module builder in menu section NEW: use account address in sepa mandate (#23642) NEW: VAT rate - Add entity NEW: When an user unset the batch management of products, transformation of each batch stock mouvement in global stock mouvement -NEW: PDF Generation for each Human Resource Evaluations. +NEW: PDF Generation for each Human Resource Evaluations. SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520) SEC: Add action confirm_... as sensitive to need a CSRF token @@ -592,7 +592,7 @@ The following changes may create regressions for some external modules, but were * The property ->user_creation to store ID of user of creation has been renamed into ->user_creation_id. * The property ->user_modification to store ID of user of modification has been renamed into ->user_modification_id. * The private array ->status_short, ->statuts and ->status_long are now array ->labelStatusShort and ->labelStatus everywhere. -* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation). +* The duplicate property ->user_creat, ->date_creat, ->date_valid have been removed (use instead user_creation, date_creation, date_validation). * The method get_substitutionarray_shipment_lines() has been removed. Use the generic get_substitutionarray_lines() instead. * The method ProductcustomerPrice->fetch_all_log() has been renamed into camel case ->fetchAllLog() * It was possible to use a variable $soc or $right inside a PHP code condition of some extrafields properties, this is no more true (this 2 variables are no more global variables). @@ -602,7 +602,7 @@ The following changes may create regressions for some external modules, but were * The delete() method of AdherentType, Contact, Delivery, MultiCurrency, CurrencyRate now need $user as first parameter. * A very high number of class properties (with old name in french) are now deprecated in favor of the property name in english. * The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases. - +* booking.class.php was removed, please have a look at calendar.class.php ***** ChangeLog for 18.0.6 compared to 18.0.5 ***** FIX: 16.0 - parent company gets emptied when updating a third party from the card in edit mode (#28269) @@ -1009,7 +1009,7 @@ NEW: Accountancy - Quadratus export with attachments in accountancy export NEW: Accountancy - Can filter on a custom group of accounts. Perf or ledger list. NEW: Accountancy - Can select the export format during export of journals NEW: Accountancy - sort of column of custom group of account -NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions +NEW: Can upload a file with drag and drop on purchase invoice, vats, salaries and social contributions NEW: Authentication: #22740 add OpenID Connect impl NEW: Authentication: add experimental support for Google OAuth2 connexion NEW: Authentication: can now edit service name for OAuth token From 806b01c0a6de7cc1e3a550f4457b38fbf31a2de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= Date: Mon, 27 Jan 2025 11:54:02 +0100 Subject: [PATCH 027/375] fix --- htdocs/core/lib/files.lib.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index b6eb5421d53..684bc3bb9fa 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3564,9 +3564,19 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, dol_print_error(null, 'Error call dol_check_secure_access_document with not supported value for modulepart parameter ('.$modulepart.')'); exit; } - if ($fuser->hasRight($tmpmodule, $lire) || preg_match('/^specimen/i', $original_file)) { - $accessallowed = 1; - } + + // Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read + $partsofdirinoriginalfile = explode('/', $original_file); + if (!empty($partsofdirinoriginalfile[1])) { // If original_file is xxx/filename (xxx is a part we will use) + $partofdirinoriginalfile = $partsofdirinoriginalfile[0]; + if ($partofdirinoriginalfile && ($fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'lire') || $fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'read'))) { + $accessallowed = 1; + } + } + if ($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read)) { + $accessallowed = 1; + } + $original_file = $conf->$tmpmodule->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } else { if (empty($conf->$modulepart->dir_output)) { // modulepart not supported From 180366a2cac5cf2f90c6efe82b5b707c13482abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= Date: Mon, 27 Jan 2025 11:56:47 +0100 Subject: [PATCH 028/375] fix --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 684bc3bb9fa..44f95d9e9f4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3569,11 +3569,11 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $partsofdirinoriginalfile = explode('/', $original_file); if (!empty($partsofdirinoriginalfile[1])) { // If original_file is xxx/filename (xxx is a part we will use) $partofdirinoriginalfile = $partsofdirinoriginalfile[0]; - if ($partofdirinoriginalfile && ($fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'lire') || $fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'read'))) { + if (($partofdirinoriginalfile && ($fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'lire') || $fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'read'))) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } } - if ($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read)) { + if (($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read)) || || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } From da1bee6872cd47c03ca2e2105130ace14c2f592c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= Date: Mon, 27 Jan 2025 11:57:07 +0100 Subject: [PATCH 029/375] re fix --- htdocs/core/lib/files.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 44f95d9e9f4..20edbd73a1c 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3573,7 +3573,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = 1; } } - if (($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read)) || || preg_match('/^specimen/i', $original_file)) { + if (($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read)) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } From 97af0975bc710943374ab1b57b34efee40337c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Champlon?= Date: Mon, 27 Jan 2025 11:58:33 +0100 Subject: [PATCH 030/375] indent --- htdocs/core/lib/files.lib.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 20edbd73a1c..030d29cd9e7 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -3565,17 +3565,17 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, exit; } - // Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read - $partsofdirinoriginalfile = explode('/', $original_file); - if (!empty($partsofdirinoriginalfile[1])) { // If original_file is xxx/filename (xxx is a part we will use) - $partofdirinoriginalfile = $partsofdirinoriginalfile[0]; - if (($partofdirinoriginalfile && ($fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'lire') || $fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'read'))) || preg_match('/^specimen/i', $original_file)) { - $accessallowed = 1; - } - } - if (($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read)) || preg_match('/^specimen/i', $original_file)) { - $accessallowed = 1; - } + // Check fuser->rights->modulepart->myobject->read and fuser->rights->modulepart->read + $partsofdirinoriginalfile = explode('/', $original_file); + if (!empty($partsofdirinoriginalfile[1])) { // If original_file is xxx/filename (xxx is a part we will use) + $partofdirinoriginalfile = $partsofdirinoriginalfile[0]; + if (($partofdirinoriginalfile && ($fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'lire') || $fuser->hasRight($tmpmodule, $partofdirinoriginalfile, 'read'))) || preg_match('/^specimen/i', $original_file)) { + $accessallowed = 1; + } + } + if (($fuser->hasRight($tmpmodule, $lire) || $fuser->hasRight($tmpmodule, $read)) || preg_match('/^specimen/i', $original_file)) { + $accessallowed = 1; + } $original_file = $conf->$tmpmodule->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } else { From 729e6c4aba1a596be4e1ff054f8c9f18cf491601 Mon Sep 17 00:00:00 2001 From: tnegre Date: Mon, 27 Jan 2025 15:12:24 +0100 Subject: [PATCH 031/375] Revert "set empty value for choice" This reverts commit e8aaa51edcf65d9feacb7000ee6e657419670275. --- htdocs/ticket/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 9f1f30a3e7f..9e69271f09c 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -856,11 +856,11 @@ foreach ($object->fields as $key => $val) { print ''; } elseif ($key == 'category_code') { print ''; - $formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, ' ', 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); + $formTicket->selectGroupTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); print ''; } elseif ($key == 'severity_code') { print ''; - $formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, ' ', 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); + $formTicket->selectSeveritiesTickets(dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]), 'search_'.$key, '', 2, 1, 1, 0, (!empty($val['css']) ? $val['css'] : 'maxwidth150')); print ''; } elseif ($key == 'fk_user_assign' || $key == 'fk_user_create') { print ''; From f9ec70f1db6d6aca417b398d15fbf38f897191c9 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 28 Jan 2025 14:05:59 +0100 Subject: [PATCH 032/375] FIX compatibility with multicompany --- htdocs/accountancy/admin/categories_list.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 0e7bd908c9a..674f0ea1a39 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -86,7 +86,7 @@ $tablib[32] = "DictionaryAccountancyCategory"; // Requests to extract data $tabsql = array(); -$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1"; +$tabsql[32] = "SELECT a.rowid as rowid, a.code as code, a.label, a.range_account, a.category_type, a.formula, a.position as position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accounting_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid AND c.active=1 AND a.entity IN (".getEntity('c_accounting_category').")"; // Criteria to sort dictionaries $tabsqlsort = array(); @@ -98,11 +98,11 @@ $tabfield[32] = "code,label,range_account,category_type,formula,position,country // Name of editing fields for record modification $tabfieldvalue = array(); -$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id"; +$tabfieldvalue[32] = "code,label,range_account,category_type,formula,position,country_id,entity"; // Name of the fields in the table for inserting a record $tabfieldinsert = array(); -$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country"; +$tabfieldinsert[32] = "code,label,range_account,category_type,formula,position,fk_country,entity"; // Name of the rowid if the field is not of type autoincrement // Example: "" if id field is "rowid" and has autoincrement on From dd40aea3803251c57f84213eb134ebc68bc5fd49 Mon Sep 17 00:00:00 2001 From: tnegre Date: Tue, 28 Jan 2025 14:18:26 +0100 Subject: [PATCH 033/375] Add hook PrintFieldListFrom on actions list --- htdocs/comm/action/list.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index d3d1ecfb833..18cd89caa2c 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -454,6 +454,12 @@ if ($filtert > 0 || $usergroup > 0) { if ($usergroup > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql .= " WHERE c.id = a.fk_action"; $sql .= ' AND a.entity IN ('.getEntity('agenda').')'; // Condition on actioncode From 353c373361747bfbe01a473e1cd695ee9fe32c91 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 28 Jan 2025 19:31:46 +0100 Subject: [PATCH 034/375] review price update --- htdocs/core/actions_massactions.inc.php | 33 ++++++++++++------------- htdocs/product/list.php | 7 ++++-- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index fb45b57ac7a..3af7a81b909 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1281,23 +1281,8 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa $result = $object->fetch($toselectid); //var_dump($contcats);exit; if ($result > 0) { - if (getDolGlobalString('PRODUIT_MULTIPRICES')) { - for ($level = 1; $level <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $level++) { - if ($object->price_base_type == 'TTC') { - $newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100; - $minprice = $object->multiprices_min_ttc[$level]; - } else { - $newprice = $object->multiprices[$level] * (100 + $pricepercentage) / 100; - $minprice = $object->multiprices_min[$level]; - } - $res = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); - if ($res > 0) { - $nbok++; - } else { - setEventMessages($object->error, $object->errors, 'errors'); - } - } - } else { + if (getDolGlobalString('PRODUCT_PRICE_UNIQ') + || getDolGlobalString('PRODUIT_CUSTOMER_PRICES')) { if ($object->price_base_type == 'TTC') { $newprice = $object->price_ttc * (100 + $pricepercentage) / 100; $minprice = $object->price_min_ttc; @@ -1311,6 +1296,20 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa } else { setEventMessages($object->error, $object->errors, 'errors'); } + } elseif (getDolGlobalString('PRODUIT_MULTIPRICES')) { + for ($level = 1; $level <= getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); $level++) { + if ($object->price_base_type == 'TTC') { + $newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100; + $minprice = $object->multiprices_min_ttc[$level]; + } else { + $newprice = $object->multiprices[$level] * (100 + $pricepercentage) / 100; + $minprice = $object->multiprices_min[$level]; + } + $res = $object->updatePrice($newprice, $object->price_base_type, $user, $object->tva_tx, $minprice, $level, $object->tva_npr, 0, 0, array(), $object->default_vat_code); + if ($res > 0) { + $nbok++; + } + } } } else { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index cecce963be1..329591ab466 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -829,8 +829,11 @@ $arrayofmassactions = array( //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"), ); if ($user->hasRight($rightskey, 'creer')) { - $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); - + if (getDolGlobalString('PRODUCT_PRICE_UNIQ') + || getDolGlobalString('PRODUIT_CUSTOMER_PRICES') + || getDolGlobalString('PRODUIT_MULTIPRICES')) { + $arrayofmassactions['preupdateprice'] = img_picto('', 'edit', 'class="pictofixedwidth"').$langs->trans("UpdatePrice"); + } $arrayofmassactions['switchonsalestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnSaleStatus"); $arrayofmassactions['switchonpurchasestatus'] = img_picto('', 'stop-circle', 'class="pictofixedwidth"').$langs->trans("SwitchOnPurchaseStatus"); From ce19d7cdc0ac1942ac6d61d05d3af50ff798c327 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Tue, 28 Jan 2025 19:40:52 +0100 Subject: [PATCH 035/375] review price update --- htdocs/core/tpl/massactions_pre.tpl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php index bdbcee257f5..78af23d152a 100644 --- a/htdocs/core/tpl/massactions_pre.tpl.php +++ b/htdocs/core/tpl/massactions_pre.tpl.php @@ -98,7 +98,11 @@ if ($massaction == 'preaffecttag' && isModEnabled('category')) { } } -if ($massaction == 'preupdateprice') { +if ($massaction == 'preupdateprice' + && (getDolGlobalString('PRODUCT_PRICE_UNIQ') + || getDolGlobalString('PRODUIT_CUSTOMER_PRICES') + || getDolGlobalString('PRODUIT_MULTIPRICES') + )) { $formquestion = array(); $valuefield = '
'; From e0be95f5315010292b1f16a13002c14c560a8bdf Mon Sep 17 00:00:00 2001 From: Hystepik Date: Wed, 29 Jan 2025 10:17:18 +0100 Subject: [PATCH 036/375] New westite security constants --- htdocs/core/website.inc.php | 16 +-- htdocs/website/index.php | 198 ++++++++++++++++++++++++++++- htdocs/website/lib/website.lib.php | 172 +++++++++++++++++++++++++ 3 files changed, 372 insertions(+), 14 deletions(-) create mode 100644 htdocs/website/lib/website.lib.php diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index e28082e208f..14194ca78fd 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -167,7 +167,7 @@ if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { } // Content-Security-Policy - if (!defined('WEBSITE_MAIN_SECURITY_FORCECSP')) { + if (!defined('WEBSITE_'.$object->id.'_SECURITY_FORCECSP')) { // A default security policy that keep usage of js external component like ckeditor, stripe, google, working // For example: to restrict to only local resources, except for css (cloudflare+google), and js (transifex + google tags) and object/iframe (youtube) // default-src 'self'; style-src: https://cdnjs.cloudflare.com https://fonts.googleapis.com; script-src: https://cdn.transifex.com https://www.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src: *; @@ -178,7 +178,7 @@ if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { // // $contentsecuritypolicy = "frame-ancestors 'self'; img-src * data:; font-src *; default-src 'self' 'unsafe-inline' 'unsafe-eval' *.paypal.com *.stripe.com *.google.com *.googleapis.com *.google-analytics.com *.googletagmanager.com;"; // $contentsecuritypolicy = "frame-ancestors 'self'; img-src * data:; font-src *; default-src *; script-src 'self' 'unsafe-inline' *.paypal.com *.stripe.com *.google.com *.googleapis.com *.google-analytics.com *.googletagmanager.com; style-src 'self' 'unsafe-inline'; connect-src 'self';"; - $contentsecuritypolicy = getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCECSP'); + $contentsecuritypolicy = getDolGlobalString('WEBSITE_'.$object->id.'_SECURITY_FORCECSP'); if (!is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; @@ -200,32 +200,32 @@ if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { } // Referrer-Policy - if (!defined('WEBSITE_MAIN_SECURITY_FORCERP')) { + if (!defined('WEBSITE_'.$object->id.'_SECURITY_FORCERP')) { // The constant WEBSITE_MAIN_SECURITY_FORCERP should never be defined by page, but the variable used just after may be // For public web sites, we use the same default value than "strict-origin-when-cross-origin" - $referrerpolicy = getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCERP', "strict-origin-when-cross-origin"); + $referrerpolicy = getDolGlobalString('WEBSITE_'.$object->id.'_SECURITY_FORCERP', "strict-origin-when-cross-origin"); header("Referrer-Policy: ".$referrerpolicy); } // Strict-Transport-Security - if (!defined('WEBSITE_MAIN_SECURITY_FORCESTS')) { + if (!defined('WEBSITE_'.$object->id.'_SECURITY_FORCESTS')) { // The constant WEBSITE_MAIN_SECURITY_FORCESTS should never be defined by page, but the variable used just after may be // Example: "max-age=31536000; includeSubDomains" - $sts = getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCESTS'); + $sts = getDolGlobalString('WEBSITE_'.$object->id.'_SECURITY_FORCESTS'); if (!empty($sts)) { header("Strict-Transport-Security: ".$sts); } } // Permissions-Policy (old name was Feature-Policy) - if (!defined('WEBSITE_MAIN_SECURITY_FORCEPP')) { + if (!defined('WEBSITE_'.$object->id.'_SECURITY_FORCEPP')) { // The constant WEBSITE_MAIN_SECURITY_FORCEPP should never be defined by page, but the variable used just after may be // Example: "camera: 'none'; microphone: 'none';" - $pp = getDolGlobalString('WEBSITE_MAIN_SECURITY_FORCEPP'); + $pp = getDolGlobalString('WEBSITE_'.$object->id.'_SECURITY_FORCEPP'); if (!empty($pp)) { header("Permissions-Policy: ".$pp); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index bb683e00854..a6bd9f1260d 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -40,6 +40,7 @@ if (!defined('DISABLE_JS_GRAHP')) { // Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/website/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/website2.lib.php'; @@ -1939,6 +1940,47 @@ if ($action == 'updatecss' && $usercanedit) { } } +if ($action == "updatesecurity" && $usercanedit) { + $db->begin(); + $res1 = $res2 = $res3 = $res4 = 0; + $securityrp = GETPOST('WEBSITE_'.$object->id.'_SECURITY_FORCERP', 'alpha'); + $securitysts = GETPOST('WEBSITE_'.$object->id.'_SECURITY_FORCESTS', 'alpha'); + $securitypp = GETPOST('WEBSITE_'.$object->id.'_SECURITY_FORCEPP', 'alpha'); + $securitysp = GETPOST('WEBSITE_'.$object->id.'_SECURITY_FORCECSP', 'alpha'); + + if (!empty($securityrp)) { + $res1 = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCERP', $securityrp, 'chaine', 0, '', $conf->entity); + } + if (!empty($securitysts)) { + $res2 = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCESTS', $securitysts, 'chaine', 0, '', $conf->entity); + } + if (!empty($securitypp)) { + $res3 = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCEPP', $securitypp, 'chaine', 0, '', $conf->entity); + } + if (!empty($securitysp)) { + $res4 = dolibarr_set_const($db, 'WEBSITE_'.$object->id.'_SECURITY_FORCECSP', $securitysp, 'chaine', 0, '', $conf->entity); + } + + if ($res1 >= 0 && $res2 >= 0 && $res3 >= 0 && $res4 >= 0 ) { + $db->commit(); + setEventMessages($langs->trans("Saved"), null, 'mesgs'); + } else { + $db->rollback(); + setEventMessages($langs->trans("ErrorSavingChanges"), null, 'errors'); + } + + if (!GETPOSTISSET('updateandstay')) { // If we click on "Save And Stay", we don not make the redirect + $action = 'preview'; + if ($backtopage) { + $backtopage = preg_replace('/searchstring=[^&]*/', '', $backtopage); // Clean backtopage url + header("Location: ".$backtopage); + exit; + } + } else { + $action = 'editsecurity'; + } +} + // Update page if ($action == 'setashome' && $usercanedit) { $db->begin(); @@ -2946,6 +2988,9 @@ if ($action == 'file_manager') { if ($mode) { print ''; } +if ($action == 'editsecurity') { + print ''; +} print '
'."\n"; @@ -3258,8 +3303,8 @@ if (!GETPOST('hide_websitemenu')) { print ''; } - if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesiteconfirm')) || in_array($mode, array('replacesite'))) { - if ($action == 'editcss') { + if (in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesiteconfirm', 'editsecurity')) || in_array($mode, array('replacesite'))) { + if ($action == 'editcss' || $action == 'editsecurity') { // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers $stringforfirstkey = $langs->trans("KeyboardShortcut"); @@ -3290,8 +3335,8 @@ if (!GETPOST('hide_websitemenu')) { // Toolbar for pages // - if ($websitekey && $websitekey != '-1' && (!in_array($action, array('editcss', 'editmenu', 'importsite', 'file_manager', 'replacesite', 'replacesiteconfirm'))) && (!in_array($mode, array('replacesite'))) && !$file_manager) { - print '
'."\n"; // Close current websitebar to open a new one + if ($websitekey && $websitekey != '-1' && (!in_array($action, array('editcss', 'editmenu', 'importsite', 'file_manager', 'replacesite', 'replacesiteconfirm', 'editsecurity'))) && (!in_array($mode, array('replacesite'))) && !$file_manager) { + print '
'; // Close current websitebar to open a new one print ''; print '
'."\n"; @@ -3754,7 +3799,7 @@ if (!GETPOST('hide_websitemenu')) { // TODO Add js to save alias like we save virtual host name and use dynamic virtual host for url of id=previewpageext } - if (!in_array($mode, array('replacesite')) && !in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesiteconfirm', 'createsite', 'createcontainer', 'createfromclone', 'createpagefromclone', 'deletesite'))) { + if (!in_array($mode, array('replacesite')) && !in_array($action, array('editcss', 'editmenu', 'file_manager', 'replacesiteconfirm', 'createsite', 'createcontainer', 'createfromclone', 'createpagefromclone', 'deletesite', 'editsecurity'))) { if ($action == 'editsource' || $action == 'editmeta') { // accesskey is for Windows or Linux: ALT + key for chrome, ALT + SHIFT + KEY for firefox // accesskey is for Mac: CTRL + key for all browsers @@ -3964,7 +4009,8 @@ if ($action == 'editcss') { //$readmecontent.=""; //} - print dol_get_fiche_head(); + $head = websiteconfigPrepareHead($object); + print dol_get_fiche_head($head, 'general', $langs->trans("General"), 0, 'website'); print ''."\n"; print ''; @@ -4161,6 +4207,146 @@ if ($action == 'editcss') { print '
'; } +if ($action == 'editsecurity') { + $selectarraySP = websiteGetContentPolicyDirectives(); + $selectarraySPlevel2 = websiteGetContentPolicySources(); + print '
'; + print '
'; + + $head = websiteconfigPrepareHead($object); + print dol_get_fiche_head($head, 'security', $langs->trans("General"), 0, 'website'); + + print '
'; + print '
'; + print ''; + print ''; + print ''."\n"; + print ''; + + // Force RP + print ''; + print ''; + print ''; + print ''; + // Force STS + print ''; + print ''; + print ''; + print ''; + // Force PP + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("Parameter").'
'.$langs->trans('WebsiteSecurityForceRP').'id."_SECURITY_FORCERP").'">
'.$langs->trans('WebsiteSecurityForceSTS').'id."_SECURITY_FORCESTS").'">
'.$langs->trans('WebsiteSecurityForcePP').'id."_SECURITY_FORCEPP").'">
'; + print '
'; + + // Security Policy + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'.$langs->trans("SecurityPolicy").'
'.$langs->trans("Value").':id."_SECURITY_FORCECSP").'">
'.$form->selectarray("select_identifier_WEBSITE_SECURITY_FORCECSP", $selectarraySP, "select_identifier_WEBSITE_SECURITY_FORCECSP", 1, 0, 0, '', 0, 0, 0, '', 'minwidth300').''; + foreach ($selectarraySPlevel2 as $key => $values) { + print ''; + } + print '
'; + print '
'; + + + // TODO: liste sous page identifier pour supprimer + print ''; + + print dol_get_fiche_end(); + print ''; +} + if ($action == 'createsite') { print '
'; diff --git a/htdocs/website/lib/website.lib.php b/htdocs/website/lib/website.lib.php new file mode 100644 index 00000000000..045334dc771 --- /dev/null +++ b/htdocs/website/lib/website.lib.php @@ -0,0 +1,172 @@ + + * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024 MDW + * + * 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 + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/website/lib/website.lib.php + * \ingroup website + * \brief Library files with common functions for WebsiteAccount + */ + + + /** + * Prepare array of tabs for Website + * + * @param Website $object Website + * @return array Array of tabs + */ +function websiteconfigPrepareHead($object) +{ + global $db, $langs, $conf; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/website/index.php?websiteid='.$object->id.'&action=editcss'; + $head[$h][1] = $langs->trans("General"); + $head[$h][2] = 'general'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/website/index.php?websiteid='.$object->id.'&action=editsecurity'; + $head[$h][1] = $langs->trans("Security"); + $head[$h][2] = 'security'; + $h++; + + /*if (isset($object->fields['note_public']) || isset($object->fields['note_private'])) { + $nbNote = 0; + if(!empty($object->fields['note_private'])) $nbNote++; + if(!empty($object->fields['note_public'])) $nbNote++; + $head[$h][0] = dol_buildpath('/monmodule/websiteaccount_note.php', 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Notes'); + if ($nbNote > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : ''); + $head[$h][2] = 'note'; + $h++; + }*/ + + /* + require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; + require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; + $upload_dir = $conf->monmodule->dir_output . "/websiteaccount/" . dol_sanitizeFileName($object->ref); + $nbFiles = count(dol_dir_list($upload_dir,'files',0,'','(\.meta|_preview.*\.png)$')); + $nbLinks=Link::count($db, $object->element, $object->id); + $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_document.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans('Documents'); + if (($nbFiles+$nbLinks) > 0) $head[$h][1].= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.($nbFiles+$nbLinks).'' : ''); + $head[$h][2] = 'document'; + $h++; + + $head[$h][0] = dol_buildpath("/monmodule/websiteaccount_agenda.php", 1).'?id='.$object->id; + $head[$h][1] = $langs->trans("Events"); + $head[$h][2] = 'agenda'; + $h++; + */ + + // Show more tabs from modules + // Entries must be declared in modules descriptor with line + //$this->tabs = array( + // 'entity:+tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__' + //); // to add new tab + //$this->tabs = array( + // 'entity:-tabname:Title:@monmodule:/monmodule/mypage.php?id=__ID__' + //); // to remove a tab + complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website'); + + complete_head_from_modules($conf, $langs, $object, $head, $h, 'websiteaccount@website', 'remove'); + + return $head; +} + +/** + * Prepare array of directives for Website + * + * @return array Array of tabs + */ + +function websiteGetContentPolicyDirectives() +{ + return array( + // Fetch directives + "child-src" => array("label" => "child-src","data-directivetype" => "fetch"), + "connect-src" => array("label" => "connect-src","data-directivetype" => "fetch"), + "default-src" => array("label" => "default-src","data-directivetype" => "fetch"), + "fenced-frame-src" => array("label" => "fenced-frame-src","data-directivetype" => "fetch"), + "font-src" => array("label" => "font-src","data-directivetype" => "fetch"), + "frame-src" => array("label" => "frame-src","data-directivetype" => "fetch"), + "img-src" => array("label" => "img-src","data-directivetype" => "fetch"), + "manifest-src" => array("label" => "manifest-src","data-directivetype" => "fetch"), + "media-src" => array("label" => "media-src","data-directivetype" => "fetch"), + "object-src" => array("label" => "object-src","data-directivetype" => "fetch"), + "prefetch-src" => array("label" => "prefetch-src","data-directivetype" => "fetch"), + "script-src" => array("label" => "script-src","data-directivetype" => "fetch"), + "script-src-elem" => array("label" => "script-src-elem","data-directivetype" => "fetch"), + "script-src-attr" => array("label" => "script-src-attr","data-directivetype" => "fetch"), + "style-src" => array("label" => "style-src","data-directivetype" => "fetch"), + "style-src-elem" => array("label" => "style-src-elem","data-directivetype" => "fetch"), + "style-src-attr" => array("label" => "style-src-attr","data-directivetype" => "fetch"), + "worker-src" => array("label" => "worker-src","data-directivetype" => "fetch"), + // Document directives + "base-uri" => array("label" => "base-uri","data-directivetype" => "document"), + "sandbox" => array("label" => "sandbox","data-directivetype" => "document"), + // Navigation directives + "form-action" => array("label" => "form-action","data-directivetype" => "navigation"), + "frame-ancestors" => array("label" => "frame-ancestors","data-directivetype" => "navigation"), + // Reporting directives + "report-to" => array("label" => "report-to","data-directivetype" => "reporting"), + // Other directives + "require-trusted-types-for" => array("label" => "require-trusted-types-for","data-directivetype" => "other"), + "othertrusted-types", + "upgrade-insecure-requests" => array("label" => "upgrade-insecure-requests","data-directivetype" => "other"), + ); +} + +/** + * Prepare array of sources for Website + * + * @return array Array of tabs + */ + +function websiteGetContentPolicySources() +{ + return array( + // Fetch directives + "fetch" => array( + "*", + "data", + "self", + ), + // Document directives + "document" => array( + "base-uri", + "sandbox", + ), + // Navigation directives + "navigation" => array( + "self", + ), + // Reporting directives + "reporting" => array( + "report-to", + ), + // Other directives + "other" => array( + "require-trusted-types-for", + "trusted-types", + "upgrade-insecure-requests", + ), + ); +} From 180954eb16422ff8293f1a1840303e265b362990 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Wed, 29 Jan 2025 10:17:38 +0100 Subject: [PATCH 037/375] fix php typo --- htdocs/website/lib/website.lib.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/website/lib/website.lib.php b/htdocs/website/lib/website.lib.php index 045334dc771..88f4cb834a2 100644 --- a/htdocs/website/lib/website.lib.php +++ b/htdocs/website/lib/website.lib.php @@ -96,7 +96,6 @@ function websiteconfigPrepareHead($object) * * @return array Array of tabs */ - function websiteGetContentPolicyDirectives() { return array( @@ -139,7 +138,6 @@ function websiteGetContentPolicyDirectives() * * @return array Array of tabs */ - function websiteGetContentPolicySources() { return array( From 9870069f44f25c6774134aa7dc4ba9099c368bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Jan 2025 13:56:46 +0100 Subject: [PATCH 038/375] more fields in liste_contacts --- htdocs/core/class/commonobject.class.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 3aa18de36e9..02cee9b9716 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1500,14 +1500,14 @@ abstract class CommonObject $sql = "SELECT ec.rowid, ec.statut as statuslink, ec.fk_socpeople as id, ec.fk_c_type_contact"; // This field contains id of llx_socpeople or id of llx_user if ($source == 'internal') { - $sql .= ", '-1' as socid, t.statut as statuscontact, t.login, t.photo, t.gender"; + $sql .= ", '-1' as socid, t.statut as statuscontact, t.login, t.photo, t.gender, t.fk_country as country_id"; } if ($source == 'external' || $source == 'thirdparty') { - $sql .= ", t.fk_soc as socid, t.statut as statuscontact"; + $sql .= ", t.fk_soc as socid, t.statut as statuscontact, t.fk_pays as country_id"; } - $sql .= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email"; + $sql .= ", t.civility as civility, t.lastname as lastname, t.firstname, t.email, t.address, t.zip, t.town"; if (empty($arrayoftcids)) { - $sql .= ", tc.source, tc.element, tc.code, tc.libelle as type_label"; + $sql .= ", tc.source, tc.element, tc.code, tc.libelle as type_label, co.label as country"; } $sql .= " FROM"; if (empty($arrayoftcids)) { @@ -1516,9 +1516,11 @@ abstract class CommonObject $sql .= " ".$this->db->prefix()."element_contact as ec"; if ($source == 'internal') { // internal contact (user) $sql .= " LEFT JOIN ".$this->db->prefix()."user as t on ec.fk_socpeople = t.rowid"; + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as co ON co.rowid = t.fk_country"; } if ($source == 'external' || $source == 'thirdparty') { // external contact (socpeople) $sql .= " LEFT JOIN ".$this->db->prefix()."socpeople as t on ec.fk_socpeople = t.rowid"; + $sql .= " LEFT JOIN ".$this->db->prefix()."c_country as co ON co.rowid = t.fk_pays"; } $sql .= " WHERE ec.element_id = ".((int) $this->id); if (empty($arrayoftcids)) { @@ -1566,6 +1568,11 @@ abstract class CommonObject 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'email' => $obj->email, + 'address' => $obj->address, + 'zip' => $obj->zip, + 'town' => $obj->town, + 'country_id' => $obj->country_id, + 'country' => $obj->country, 'login' => (empty($obj->login) ? '' : $obj->login), 'photo' => (empty($obj->photo) ? '' : $obj->photo), 'gender' => (empty($obj->gender) ? '' : $obj->gender), From 5b1c5397bac1056c6bc58948806495861b9371f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Wed, 29 Jan 2025 09:34:16 -0500 Subject: [PATCH 039/375] Adding global variables to have more flexibility on external calendars location. --- htdocs/comm/action/class/ical.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index da003149657..3024513dfed 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -96,7 +96,16 @@ class ICal $file_text = ''; //$tmpresult = getURLContent($file, 'GET', '', 1, [], ['http', 'https'], 2, 0); // To test with any URL - $tmpresult = getURLContent($file, 'GET'); + $localip = 0; + $sslverify = -1; + if(getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')) { + $localip = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')); + } + if(getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')) { + $sslverify = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')); + } + // See documentation of getURLContent function for $localip and $sslverify possible values + $tmpresult = getURLContent($file, 'GET', '', 1, [], ['http', 'https'], $localip, $sslverify); if ($tmpresult['http_code'] != 200) { $file_text = null; $this->error = 'Error: '.$tmpresult['http_code'].' '.$tmpresult['content']; From 841356613e24a05566e50ecc8d74f16179d75de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Wed, 29 Jan 2025 09:40:57 -0500 Subject: [PATCH 040/375] code format --- htdocs/comm/action/class/ical.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 3024513dfed..405c84d1046 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -98,10 +98,10 @@ class ICal //$tmpresult = getURLContent($file, 'GET', '', 1, [], ['http', 'https'], 2, 0); // To test with any URL $localip = 0; $sslverify = -1; - if(getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')) { + if (getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')) { $localip = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_IP_MODE')); } - if(getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')) { + if (getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')) { $sslverify = intval(getDolGlobalString('AGENDA_EXT_CALENDAR_SSLVERIFY_MODE')); } // See documentation of getURLContent function for $localip and $sslverify possible values From 71d13cc77af248fc01148ec32a96fd6bf4fcc632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20de=20Grandpr=C3=A9?= Date: Wed, 29 Jan 2025 10:13:01 -0500 Subject: [PATCH 041/375] added cpr --- htdocs/comm/action/class/ical.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/ical.class.php b/htdocs/comm/action/class/ical.class.php index 405c84d1046..648f96aba4d 100644 --- a/htdocs/comm/action/class/ical.class.php +++ b/htdocs/comm/action/class/ical.class.php @@ -4,7 +4,8 @@ * Copyright (C) 2013-2014 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 Vincent de Grandpré * * 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 From 8f3b814aaf2febfa4a4b4b7b65d398d3c42d946a Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:31:07 +0100 Subject: [PATCH 042/375] Update llx_c_forme_juridique.sql added new Austrian business entity type FlexKapG #32803 --- htdocs/install/mysql/data/llx_c_forme_juridique.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index fd094e387ef..38140954e39 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -10,7 +10,7 @@ -- Copyright (C) 2012 Tommaso Basilici -- Copyright (C) 2012 Ricardo Schluter -- Copyright (C) 2013 Cedric GROSS --- Copyright (C) 2020-2021 Udo Tamm +-- Copyright (C) 2020-2025 Udo Tamm -- Copyright (C) 2022 Miro Sertić -- -- This program is free software; you can redistribute it and/or modify @@ -83,6 +83,7 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (41, ' INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (41, '4112', 'GesbR - Gesellschaft nach bürgerlichem Recht', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (41, '4113', 'GesnbR - Gesellschaft nach bürgerlichem Recht', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (41, '4114', 'e.U. - eingetragener Einzelunternehmer', 1); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (41, '4115', 'FlexKapG - Flexible Kapitalgesellschaft', 1); -- Belgium From bd87aa005d6ce623ce83fd389a96796bd14dab3b Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:05:23 -0500 Subject: [PATCH 043/375] NEW CONSTANT: ORDER_TYPE_CONTACT_DEFAULT For example: Direct to SHIPPING --- htdocs/commande/card.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index e60536c9bcb..0c726543905 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -15,7 +15,8 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023-2024 Benjamin Falière - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2025 Lenin Rivas * * 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 @@ -103,6 +104,9 @@ $origin = GETPOST('origin', 'alpha'); $originid = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility $rank = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1; +// Type Contact default +$type_contact_code = (getDolGlobalString('ORDER_TYPE_CONTACT_DEFAULT') ? getDolGlobalString('ORDER_TYPE_CONTACT_DEFAULT') : 'CUSTOMER'); + // PDF $hidedetails = (GETPOSTINT('hidedetails') ? GETPOSTINT('hidedetails') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS') ? 1 : 0)); $hidedesc = (GETPOSTINT('hidedesc') ? GETPOSTINT('hidedesc') : (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_HIDE_DESC') ? 1 : 0)); @@ -549,7 +553,8 @@ if (empty($reshook)) { // Insert default contacts if defined if ($object_id > 0) { if (GETPOSTINT('contactid')) { - $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external'); + // $result = $object->add_contact(GETPOSTINT('contactid'), 'CUSTOMER', 'external'); + $result = $object->add_contact(GETPOSTINT('contactid'), $type_contact_code, 'external'); if ($result < 0) { setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors'); $error++; @@ -1995,7 +2000,10 @@ if ($action == 'create' && $usercancreate) { // Contact of order if ($socid > 0) { // Contacts (ask contact only if thirdparty already defined). - print "".$langs->trans("DefaultContact").''; + // print "".$langs->trans("DefaultContact").''; + print ""; + print $form->textwithpicto($langs->trans("DefaultContact"), $langs->trans("TypeContact_commande_external_".$type_contact_code)); + print ''; print img_picto('', 'contact', 'class="pictofixedwidth"'); //print $form->selectcontacts($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx'); print $form->select_contact($soc->id, $contactid, 'contactid', 1, empty($srccontactslist) ? "" : $srccontactslist, '', 1, 'maxwidth300 widthcentpercentminusx', true); From 40567ce7f680e422b90f138859dc9a7f5ad0bbca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 29 Jan 2025 18:13:03 +0100 Subject: [PATCH 044/375] FIX E_STRICT is deprecated since PHP 8.4 --- htdocs/filefunc.inc.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index aa03bc81bd9..abba0355be6 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -205,10 +205,19 @@ if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) { // If install not do } // Force PHP error_reporting setup (Dolibarr may report warning without this) -if (!empty($dolibarr_strict_mode)) { - error_reporting(E_ALL | E_STRICT); +if (version_compare(phpversion(), '8.4', '<')) { + if (!empty($dolibarr_strict_mode)) { + error_reporting(E_ALL | E_STRICT); + } else { + error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED)); + } } else { - error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED)); + // E_STRICT is deprecated since PHP 8.4 + if (!empty($dolibarr_strict_mode)) { + error_reporting(E_ALL); + } else { + error_reporting(E_ALL & ~(E_NOTICE | E_DEPRECATED)); + } } // Disable php display errors From 9cb16ea555ee945da759107f8b16c229013204d5 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:34:18 +0200 Subject: [PATCH 045/375] fix trans --- htdocs/langs/en_US/datapolicy.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/datapolicy.lang b/htdocs/langs/en_US/datapolicy.lang index 38a4f48f39f..3f8e33544fa 100644 --- a/htdocs/langs/en_US/datapolicy.lang +++ b/htdocs/langs/en_US/datapolicy.lang @@ -19,7 +19,7 @@ Module4100Desc = Module to manage Data Privacy (Conformity with the GDPR) datapolicySetup = Module Data Privacy Policy Setup DataDeletion=Deletion of data DataAnonymization=Anonymization of data -datapolicySetupPage = Depending on the laws of your countries (Example Article 5 of the GDPR), personal data must be kept for a period not exceeding the duration the data is needed for the purpose for which it was collected, except for archival purposes.
This module will make an anonymization automatically after a certain duration without events (the duration which you will have indicated below) and if the object has no existing business object children. +datapolicySetupPage = Depending on the laws of your country (Example Article 5 of the GDPR), personal data must be kept for a period not exceeding the duration the data is needed for the purpose for which it was collected, except for archival purposes.
This module will make an anonymization automatically after a certain duration without events (the duration which you will have indicated below) and if the object has no existing business object children. NB_MONTHS = %s months ONE_YEAR = 1 year NB_YEARS = %s years From a4c397a68b723cb4390eef76f2fcb83cd4d4a33e Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Wed, 29 Jan 2025 18:35:54 +0100 Subject: [PATCH 046/375] fix: php 8 warning --- htdocs/expensereport/tpl/expensereport_linktofile.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php index 2e02e7b8808..b789360e3f2 100644 --- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php +++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php @@ -95,7 +95,7 @@ if (!getDolGlobalString('EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES')) { } print '
'; - print $thumbshown ? $thumbshown : img_mime($minifile); + print $thumbshown ? $thumbshown : ($minifile ? img_mime($minifile): ''); print '
'; if (empty($urlforhref) || empty($thumbshown)) { From 4d8f28f22bd42202cbd981b0a23d49e3f5bf7dcb Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:36:31 +0200 Subject: [PATCH 047/375] fix typo --- htdocs/langs/en_US/website.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 212147881ff..892960dc610 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -92,7 +92,7 @@ DisableSiteFirst=Put website offline first MyContainerTitle=My web site title AnotherContainer=This is how to include content of another page/container (you may have an error here if you enable dynamic code because the embedded subcontainer may not exists) SorryWebsiteIsCurrentlyOffLine=Sorry, this website is currently off line. Please comme back later... -WEBSITE_USE_WEBSITE_ACCOUNTS=Enable the table of web site account fo thirdparties +WEBSITE_USE_WEBSITE_ACCOUNTS=Enable the table of web site account for thirdparties WEBSITE_USE_WEBSITE_ACCOUNTSTooltip=Enable the table to store the web site accounts (login/pass) for each third party YouMustDefineTheHomePage=You must first define the default Home page OnlyEditionOfSourceForGrabbedContentFuture=Warning: Creating a web page by importing an external web page is reserved for experienced users. Depending on the complexity of source page, the result of importation may differ from the original. Also if the source page uses common CSS styles or conflicting JavaScript, it may break the look or features of the Website editor when working on this page. This method is a quicker way to create a page but it is recommended to create your new page from scratch or from a suggested page template.
Note also that the inline editor might not work correctly when used on a grabbed external page. From d66ff94c72f89e5521a63c46ea1ccb9c0315214e Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:38:49 +0200 Subject: [PATCH 048/375] fix trans --- htdocs/langs/en_US/members.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 4d1c90f9e1b..f730d33d5f4 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -191,7 +191,7 @@ MembersStatisticsByRegion=Members statistics by region NbOfMembers=Total number of members NbOfActiveMembers=Total number of current active members NoValidatedMemberYet=No validated members found -MembersByCountryDesc=This screen shows you the statistics of members by countries. +MembersByCountryDesc=This screen shows you the statistics of members by country. MembersByCountryDesc2=Graphs and charts depend on the availability of the Google online graph service as well as on the availability of a working internet connection. MembersByStateDesc=This screen show you statistics of members by state/provinces/canton. MembersByTownDesc=This screen show you statistics of members by town. From 9984652a4502bc47d9472179279577502f6f2230 Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Wed, 29 Jan 2025 19:43:00 +0200 Subject: [PATCH 049/375] fix trans --- htdocs/langs/en_US/admin.lang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a5e14c17cb8..4166884bdf2 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2606,5 +2606,5 @@ AttributeCodeHelp=A code of your choice (without special chars and spaces) to id ThereIsMoreThanXAnswers=There is more than %s answers with your filter. Please add more filters... PdfAddTermOfSaleHelp=You can upload the terms and conditions of sale file at the bottom of this setup page WarningOnlineSignature=Please note that this function allows a person (customer, supplier...) to insert, online, the image of his signature in the PDF document. As for a handwritten signature, such a signature can be made by anyone and might not have the same legal value as a legal electronic signature system going through an authorized trusted third party. If you need this level of security, you can contact an integrator for more information or check for addons on www.dolistore.org. -UploadExtensionRestriction=File exension list forbidden to upload +UploadExtensionRestriction=List of forbidden file extensions to upload UploadExtensionRestrictionExemple=htm, html, shtml, js, php From 841cd5f570ad44c9fabdc4b30ce73c3bf8e26445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Jan 2025 19:08:08 +0100 Subject: [PATCH 050/375] enhance member types list --- htdocs/adherents/type.php | 45 +++++++++++++++++++++++---------- htdocs/langs/en_US/members.lang | 4 ++- 2 files changed, 35 insertions(+), 14 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 91f105c48b8..25bdae150a5 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -9,7 +9,7 @@ * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2021 Waël Almoman * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -136,6 +136,9 @@ $result = restrictedArea($user, 'adherent', $rowid, 'adherent_type'); */ $error = 0; +// Selection of new fields +include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php'; + if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers $search_ref = ""; $search_lastname = ""; @@ -329,8 +332,14 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''; print ''; print ''; + print ''; + print ''; print ''; + $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; + $htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup + $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); + // $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1); @@ -341,11 +350,18 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''; if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ' '; + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch actioncolumn '); + $totalarray['nbfield']++; + } + if (!empty($arrayfields['t.rowid']['checked'])) { + print ''.$langs->trans("Ref").''; + } + if (!empty($arrayfields['t.libelle']['checked'])) { + print ''.$langs->trans($arrayfields['t.libelle']['label']).''; + } + if (!empty($arrayfields['t.morphy']['checked'])) { + print ''.$langs->trans("MembersNature").''; } - print ''.$langs->trans("Ref").''; - print ''.$langs->trans("Label").''; - print ''.$langs->trans("MembersNature").''; print ''.$langs->trans("MembershipDuration").''; print ''.$langs->trans("SubscriptionRequired").''; print ''.$langs->trans("Amount").''; @@ -353,7 +369,8 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''.$langs->trans("VoteAllowed").''; print ''.$langs->trans("Status").''; if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { - print ' '; + print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch center '); + $totalarray['nbfield']++; } print "\n"; @@ -397,13 +414,15 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print 'rowid.'">'.img_edit().''; } } - - print ''; - print $membertype->getNomUrl(1); - //'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.' - print ''; - - print ''.dol_escape_htmltag($objp->label).''; + if (!empty($arrayfields['t.rowid']['checked'])) { + print ''; + print $membertype->getNomUrl(1); + //'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.' + print ''; + } + if (!empty($arrayfields['t.libelle']['checked'])) { + print ''.dol_escape_htmltag($objp->label).''; + } print ''; if ($objp->morphy == 'phy') { diff --git a/htdocs/langs/en_US/members.lang b/htdocs/langs/en_US/members.lang index 4d1c90f9e1b..a4cecf6be82 100644 --- a/htdocs/langs/en_US/members.lang +++ b/htdocs/langs/en_US/members.lang @@ -191,7 +191,7 @@ MembersStatisticsByRegion=Members statistics by region NbOfMembers=Total number of members NbOfActiveMembers=Total number of current active members NoValidatedMemberYet=No validated members found -MembersByCountryDesc=This screen shows you the statistics of members by countries. +MembersByCountryDesc=This screen shows you the statistics of members by countries. MembersByCountryDesc2=Graphs and charts depend on the availability of the Google online graph service as well as on the availability of a working internet connection. MembersByStateDesc=This screen show you statistics of members by state/provinces/canton. MembersByTownDesc=This screen show you statistics of members by town. @@ -251,3 +251,5 @@ XSubsriptionErrors=%s subscription(s) where in error CreateSubscription=Create subscription WarningNoComplementaryActionDone=No Complementary action on recording will be executed with this massaction NewMembership=New membership +Caneditamount=Can edit amount +Morphy=Moral or physical From 0338b5c65851f490b3458113a642b57a43910ddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Jan 2025 19:11:03 +0100 Subject: [PATCH 051/375] enhance member types list --- htdocs/adherents/type.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 25bdae150a5..c1584085f12 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -355,12 +355,15 @@ if (!$rowid && $action != 'create' && $action != 'edit') { } if (!empty($arrayfields['t.rowid']['checked'])) { print ''.$langs->trans("Ref").''; + $totalarray['nbfield']++; } if (!empty($arrayfields['t.libelle']['checked'])) { print ''.$langs->trans($arrayfields['t.libelle']['label']).''; + $totalarray['nbfield']++; } if (!empty($arrayfields['t.morphy']['checked'])) { print ''.$langs->trans("MembersNature").''; + $totalarray['nbfield']++; } print ''.$langs->trans("MembershipDuration").''; print ''.$langs->trans("SubscriptionRequired").''; @@ -423,16 +426,17 @@ if (!$rowid && $action != 'create' && $action != 'edit') { if (!empty($arrayfields['t.libelle']['checked'])) { print ''.dol_escape_htmltag($objp->label).''; } - - print ''; - if ($objp->morphy == 'phy') { - print $langs->trans("Physical"); - } elseif ($objp->morphy == 'mor') { - print $langs->trans("Moral"); - } else { - print $langs->trans("MorAndPhy"); + if (!empty($arrayfields['t.morphy']['checked'])) { + print ''; + if ($objp->morphy == 'phy') { + print $langs->trans("Physical"); + } elseif ($objp->morphy == 'mor') { + print $langs->trans("Moral"); + } else { + print $langs->trans("MorAndPhy"); + } + print ''; } - print ''; print ''; if ($objp->duration) { From de131d7d8ef262862c7dd18af426a82f4fbc3df0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Jan 2025 19:13:23 +0100 Subject: [PATCH 052/375] enhance member types list --- htdocs/adherents/type.php | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index c1584085f12..5e0a853eaa8 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -365,7 +365,10 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''.$langs->trans("MembersNature").''; $totalarray['nbfield']++; } - print ''.$langs->trans("MembershipDuration").''; + if (!empty($arrayfields['t.duration']['checked'])) { + print ''.$langs->trans("MembershipDuration").''; + $totalarray['nbfield']++; + } print ''.$langs->trans("SubscriptionRequired").''; print ''.$langs->trans("Amount").''; print ''.$langs->trans("CanEditAmountShort").''; @@ -437,19 +440,20 @@ if (!$rowid && $action != 'create' && $action != 'edit') { } print ''; } - - print ''; - if ($objp->duration) { - $duration_value = intval($objp->duration); - if ($duration_value > 1) { - $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years")); - } else { - $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year")); + if (!empty($arrayfields['t.duration']['checked'])) { + print ''; + if ($objp->duration) { + $duration_value = intval($objp->duration); + if ($duration_value > 1) { + $dur = array("i" => $langs->trans("Minutes"), "h" => $langs->trans("Hours"), "d" => $langs->trans("Days"), "w" => $langs->trans("Weeks"), "m" => $langs->trans("Months"), "y" => $langs->trans("Years")); + } else { + $dur = array("i" => $langs->trans("Minute"), "h" => $langs->trans("Hour"), "d" => $langs->trans("Day"), "w" => $langs->trans("Week"), "m" => $langs->trans("Month"), "y" => $langs->trans("Year")); + } + $unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration); + print max(1, $duration_value).' '.$dur[$unit]; } - $unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration); - print max(1, $duration_value).' '.$dur[$unit]; + print ''; } - print ''; print ''.yn($objp->subscription).''; From d1adfb32a453e3f0b8d272d5657820a1812993db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Jan 2025 19:21:44 +0100 Subject: [PATCH 053/375] enhance member types list --- htdocs/adherents/type.php | 51 +++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 5e0a853eaa8..221c76c7bfa 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -369,11 +369,26 @@ if (!$rowid && $action != 'create' && $action != 'edit') { print ''.$langs->trans("MembershipDuration").''; $totalarray['nbfield']++; } - print ''.$langs->trans("SubscriptionRequired").''; - print ''.$langs->trans("Amount").''; - print ''.$langs->trans("CanEditAmountShort").''; - print ''.$langs->trans("VoteAllowed").''; - print ''.$langs->trans("Status").''; + if (!empty($arrayfields['t.subscription']['checked'])) { + print ''.$langs->trans("SubscriptionRequired").''; + $totalarray['nbfield']++; + } + if (!empty($arrayfields['t.amount']['checked'])) { + print ''.$langs->trans("Amount").''; + $totalarray['nbfield']++; + } + if (!empty($arrayfields['t.caneditamount']['checked'])) { + print ''.$langs->trans("CanEditAmountShort").''; + $totalarray['nbfield']++; + } + if (!empty($arrayfields['t.vote']['checked'])) { + print ''.$langs->trans("VoteAllowed").''; + $totalarray['nbfield']++; + } + if (!empty($arrayfields['t.statut']['checked'])) { + print ''.$langs->trans("Status").''; + $totalarray['nbfield']++; + } if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch center '); $totalarray['nbfield']++; @@ -454,17 +469,21 @@ if (!$rowid && $action != 'create' && $action != 'edit') { } print ''; } - - print ''.yn($objp->subscription).''; - - print ''.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).''; - - print ''.yn($objp->caneditamount).''; - - print ''.yn($objp->vote).''; - - print ''.$membertype->getLibStatut(5).''; - + if (!empty($arrayfields['t.subscription']['checked'])) { + print ''.yn($objp->subscription).''; + } + if (!empty($arrayfields['t.amount']['checked'])) { + print ''.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).''; + } + if (!empty($arrayfields['t.caneditamount']['checked'])) { + print ''.yn($objp->caneditamount).''; + } + if (!empty($arrayfields['t.vote']['checked'])) { + print ''.yn($objp->vote).''; + } + if (!empty($arrayfields['t.statut']['checked'])) { + print ''.$membertype->getLibStatut(5).''; + } if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { if ($user->hasRight('adherent', 'configurer')) { print 'rowid.'">'.img_edit().''; From 82eb875fabed66fe5554ac528f9e360a196abbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 29 Jan 2025 19:34:35 +0100 Subject: [PATCH 054/375] enhance member types list --- htdocs/adherents/type.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 221c76c7bfa..7db9917b1d2 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -286,6 +286,9 @@ $help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_M llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type'); $arrayofselected = is_array($toselect) ? $toselect : array(); +$totalarray = [ + 'nbfield' => 0, +]; // List of members type if (!$rowid && $action != 'create' && $action != 'edit') { From d831e30869e1e17edc881458d6b8851376a5c377 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 30 Jan 2025 08:29:46 +0100 Subject: [PATCH 055/375] FIX multicompany compatibility --- htdocs/admin/multicurrency.php | 6 +++--- htdocs/multicurrency/multicurrency_rate.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index 2a6713ef599..a4b503b3f24 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -130,9 +130,9 @@ if ($action == 'add_currency') { } } elseif ($action == 'setapilayer') { if (GETPOSTISSET('modify_apilayer')) { - dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha')); - dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha')); - //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha')); + dolibarr_set_const($db, 'MULTICURRENCY_APP_ID', GETPOST('MULTICURRENCY_APP_ID', 'alpha'), 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'MULTICURRENCY_APP_SOURCE', GETPOST('MULTICURRENCY_APP_SOURCE', 'alpha'), 'chaine', 0, '', $conf->entity); + //dolibarr_set_const($db, 'MULTICURRENCY_ALTERNATE_SOURCE', GETPOST('MULTICURRENCY_ALTERNATE_SOURCE', 'alpha'), 'chaine', 0, '', $conf->entity); } else { $multiurrency = new MultiCurrency($db); $result = $multiurrency->syncRates(getDolGlobalString('MULTICURRENCY_APP_ID')); diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index ef05976018e..7cfe91e5e14 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -354,7 +354,8 @@ if ($search_rate) { if ($search_code) { $sql .= natural_search('m.code', $search_code); } -$sql .= " WHERE m.code <> '".$db->escape($conf->currency)."'"; +$sql .= " WHERE cr.entity IN (".getEntity('multicurrency').")"; +$sql .= " AND m.code <> '".$db->escape($conf->currency)."'"; // Add where from hooks $parameters = array(); From 72604763977f4c32d22feed2b834d4bb508740ec Mon Sep 17 00:00:00 2001 From: Pratush Raj Date: Thu, 30 Jan 2025 15:14:07 +0530 Subject: [PATCH 056/375] Bug Fix: #32206 --- htdocs/core/class/discount.class.php | 6 ++++-- htdocs/societe/class/societe.class.php | 24 ++++++++++++++++++------ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 29e663f4e27..06929becacc 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -278,13 +278,15 @@ class DiscountAbsolute extends CommonObject $sql .= " (entity, datec, fk_soc, discount_type, fk_user, description,"; $sql .= " amount_ht, amount_tva, amount_ttc, tva_tx, vat_src_code,"; $sql .= " multicurrency_amount_ht, multicurrency_amount_tva, multicurrency_amount_ttc,"; - $sql .= " fk_facture_source, fk_invoice_supplier_source"; + $sql .= " fk_facture_source, fk_invoice_supplier_source, multicurrency_code, multicurrency_tx"; $sql .= ")"; $sql .= " VALUES (".$conf->entity.", '".$this->db->idate($this->datec != '' ? $this->datec : dol_now())."', ".((int) $this->socid).", ".(empty($this->discount_type) ? 0 : intval($this->discount_type)).", ".((int) $userid).", '".$this->db->escape($this->description)."',"; $sql .= " ".price2num($this->amount_ht).", ".price2num($this->amount_tva).", ".price2num($this->amount_ttc).", ".price2num($this->tva_tx).", '".$this->db->escape($this->vat_src_code)."',"; $sql .= " ".price2num($this->multicurrency_amount_ht).", ".price2num($this->multicurrency_amount_tva).", ".price2num($this->multicurrency_amount_ttc).", "; $sql .= " ".($this->fk_facture_source ? ((int) $this->fk_facture_source) : "null").","; - $sql .= " ".($this->fk_invoice_supplier_source ? ((int) $this->fk_invoice_supplier_source) : "null"); + $sql .= " ".($this->fk_invoice_supplier_source ? ((int) $this->fk_invoice_supplier_source) : "null").","; + $sql .= " '".($this->multicurrency_code ? $this->multicurrency_code : "null")."',"; + $sql .= " ".($this->multicurrency_tx ? price2num($this->multicurrency_tx) : "null"); $sql .= ")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 1f6e6377ca0..65c0c3e6145 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2505,15 +2505,27 @@ class Societe extends CommonObject $discount->socid = $this->id; $discount->discount_type = $discount_type; + $discount->multicurrency_code = $this->multicurrency_code; + list($this->fk_multicurrency, $this->multicurrency_tx) = MultiCurrency::getIdAndTxFromCode($this->db, $this->multicurrency_code); + $discount->multicurrency_tx = $this->multicurrency_tx; if ($price_base_type == 'TTC') { - $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num($remise, 'MT'); - $discount->amount_ht = $discount->multicurrency_amount_ht = price2num((float) $remise / (1 + (float) $vatrate / 100), 'MT'); - $discount->amount_tva = $discount->multicurrency_amount_tva = price2num((float) $discount->amount_ttc - (float) $discount->amount_ht, 'MT'); + $discount->multicurrency_amount_ttc = price2num($remise * (float) $discount->multicurrency_tx, 'MT'); + $discount->multicurrency_amount_ht = price2num(((float) $remise / (1 + (float) $vatrate / 100)) * (float) $discount->multicurrency_tx, 'MT'); + $discount->multicurrency_amount_tva = price2num(((float) $discount->amount_ttc - (float) $discount->amount_ht) * (float) $discount->multicurrency_tx, 'MT'); + + $discount->amount_ttc = price2num($remise, 'MT'); + $discount->amount_ht = price2num((float) $remise / (1 + (float) $vatrate / 100), 'MT'); + $discount->amount_tva = price2num((float) $discount->amount_ttc - (float) $discount->amount_ht, 'MT'); + } else { - $discount->amount_ht = $discount->multicurrency_amount_ht = price2num($remise, 'MT'); - $discount->amount_tva = $discount->multicurrency_amount_tva = price2num((float) $remise * (float) $vatrate / 100, 'MT'); - $discount->amount_ttc = $discount->multicurrency_amount_ttc = price2num((float) $discount->amount_ht + (float) $discount->amount_tva, 'MT'); + $discount->amount_ht = price2num($remise, 'MT'); + $discount->amount_tva = price2num((float) $remise * (float) $vatrate / 100, 'MT'); + $discount->amount_ttc = price2num((float) $discount->amount_ht + (float) $discount->amount_tva, 'MT'); + + $discount->multicurrency_amount_ht = price2num($remise * (float)$discount->multicurrency_tx, 'MT'); + $discount->multicurrency_amount_tva = price2num(((float) $remise * (float) $vatrate / 100) * (float) $discount->multicurrency_tx, 'MT'); + $discount->multicurrency_amount_ttc= price2num(((float) $discount->amount_ht + (float) $discount->amount_tva) * (float) $discount->multicurrency_tx, 'MT'); } $discount->tva_tx = (float) price2num($vatrate); From 4e1a319113b3880e1b3161ce0b74c3dece6c8557 Mon Sep 17 00:00:00 2001 From: Dolibot Date: Thu, 30 Jan 2025 12:06:34 +0000 Subject: [PATCH 057/375] PHPStan > Update baseline --- dev/build/phpstan/phpstan-baseline.neon | 78 ------------------------- 1 file changed, 78 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 2d9c290b25a..740e50d80c5 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -9540,12 +9540,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/dolgraph.class.php - - - message: '#^Comparison operation "\>" between 0 and 0 is always false\.$#' - identifier: greater.alwaysFalse - count: 3 - path: ../../../htdocs/core/class/dolgraph.class.php - - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse @@ -9564,24 +9558,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/dolgraph.class.php - - - message: '#^Loose comparison using \=\= between 0 and 0 will always evaluate to true\.$#' - identifier: equal.alwaysTrue - count: 2 - path: ../../../htdocs/core/class/dolgraph.class.php - - - - message: '#^Loose comparison using \=\= between 1 and 3 will always evaluate to false\.$#' - identifier: equal.alwaysFalse - count: 1 - path: ../../../htdocs/core/class/dolgraph.class.php - - - - message: '#^Offset 0 on array\{array\{stacknum\: int, legend\: mixed, legendwithgroup\: non\-falsy\-string\}\} in empty\(\) always exists and is not falsy\.$#' - identifier: empty.offset - count: 1 - path: ../../../htdocs/core/class/dolgraph.class.php - - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue @@ -14670,24 +14646,12 @@ parameters: count: 12 path: ../../../htdocs/core/tpl/card_presend.tpl.php - - - message: '#^Variable \$hidedesc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/card_presend.tpl.php - - message: '#^Variable \$hidedetails might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/core/tpl/card_presend.tpl.php - - - message: '#^Variable \$hideref might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/core/tpl/card_presend.tpl.php - - message: '#^Variable \$hookmanager might not be defined\.$#' identifier: variable.undefined @@ -15444,12 +15408,6 @@ parameters: count: 1 path: ../../../htdocs/cron/list.php - - - message: '#^Variable \$texttoshow might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/cron/list.php - - message: '#^Offset ''css'' on array\{css\: ''minwidth200'', picto\: mixed\} in empty\(\) always exists and is not falsy\.$#' identifier: empty.offset @@ -15510,12 +15468,6 @@ parameters: count: 1 path: ../../../htdocs/delivery/card.php - - - message: '#^Variable \$arrayoptions might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/delivery/card.php - - message: '#^Variable \$hidedesc might not be defined\.$#' identifier: variable.undefined @@ -15786,42 +15738,12 @@ parameters: count: 1 path: ../../../htdocs/don/paiement/list.php - - - message: '#^Variable \$morecss might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/don/paiement/list.php - - - - message: '#^Variable \$morejs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/don/paiement/list.php - - - - message: '#^Variable \$outputlangs might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/don/payment/card.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue count: 1 path: ../../../htdocs/don/payment/payment.php - - - message: '#^Variable \$sumpaid might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/don/payment/payment.php - - - - message: '#^Variable \$objectlink might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/don/tpl/linkedobjectblock.tpl.php - - message: '#^Property EcmFiles\:\:\$acl \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property From 0cc2ce2c1190bca56cf0d984e27bdb1bb5ee816d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sol=C3=A8ne?= Date: Thu, 30 Jan 2025 15:48:50 +0100 Subject: [PATCH 058/375] Translations fixed --- htdocs/core/lib/fichinter.lib.php | 2 +- htdocs/langs/en_US/interventions.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/fichinter.lib.php b/htdocs/core/lib/fichinter.lib.php index 64b91da0206..2eeb365cc62 100644 --- a/htdocs/core/lib/fichinter.lib.php +++ b/htdocs/core/lib/fichinter.lib.php @@ -232,7 +232,7 @@ function fichinter_rec_prepare_head($object) $head = array(); $head[$h][0] = DOL_URL_ROOT.'/fichinter/card-rec.php?id='.$object->id; - $head[$h][1] = $langs->trans("CardFichinter"); + $head[$h][1] = $langs->trans("InterventionCard"); $head[$h][2] = 'card'; $h++; diff --git a/htdocs/langs/en_US/interventions.lang b/htdocs/langs/en_US/interventions.lang index 1d7b2ada84f..2e3e1d1f510 100644 --- a/htdocs/langs/en_US/interventions.lang +++ b/htdocs/langs/en_US/interventions.lang @@ -86,3 +86,4 @@ TypeContact_fichinter_external_BILLING=Customer contact of intervention billing TypeContact_fichinter_external_CUSTOMER=Customer contact of intervention follow-up NotARecurringInterventionalTemplate=Not a recurring intervention template ShowInterventionModel=Show intervention model +CreateRepeatableIntervention=Create recurring intervention From ac8557e129365439d09592262bcd5f5ff18a0d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9?= Date: Thu, 30 Jan 2025 17:07:31 +0100 Subject: [PATCH 059/375] NEW: Add options on intervention clone popup to clone or not contact and notes --- htdocs/fichinter/card.php | 39 ++++++++++++++++++---- htdocs/fichinter/class/fichinter.class.php | 35 +++++++++++++++++-- 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 07311a5ca20..688aa11479c 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -170,8 +170,16 @@ if (empty($reshook)) { if ($object->id > 0) { // Because createFromClone modifies the object, we must clone it so that we can restore it later $orig = clone $object; + $clone_notes = false; + if (GETPOSTISSET('clone_notes') && GETPOST('clone_notes') === 'on') { + $clone_notes = true; + } + $clone_contacts = false; + if (GETPOSTISSET('clone_contacts') && GETPOST('clone_contacts') === 'on') { + $clone_contacts = true; + } - $result = $object->createFromClone($user, $socid); + $result = $object->createFromClone($user, $socid, $clone_contacts, $clone_notes); if ($result > 0) { header("Location: ".$_SERVER['PHP_SELF'].'?id='.$result); exit; @@ -1273,12 +1281,29 @@ if ($action == 'create') { if ($action == 'clone') { // Create an array for form $formquestion = array( - // 'text' => $langs->trans("ConfirmClone"), - // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => - // 1), - // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' - // => 1), - array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company(GETPOSTINT('socid'), 'socid', '', '', 0, 0, array(), 0, 'minwidth200'))); + // 'text' => $langs->trans("ConfirmClone"), + // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' + // => 1), + array( + 'type' => 'other', + 'name' => 'socid', + 'label' => $langs->trans("SelectThirdParty"), + 'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '', '', 0, 0, null, 0, 'minwidth200') + ), + array( + 'type' => 'checkbox', + 'name' => 'clone_contacts', + 'label' => $langs->trans("CloneContacts"), + 'value' => 1 + ), + array( + 'type' => 'checkbox', + 'name' => 'clone_notes', + 'label' => $langs->trans("CloneNotes"), + 'value' => 1 + ) + ); + // Paiement incomplet. On demande si motif = escompte ou autre $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneIntervention', $object->ref), 'confirm_clone', $formquestion, 'yes', 1); } diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index edb30a045ca..8c09fbed2e5 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1300,9 +1300,10 @@ class Fichinter extends CommonObject * @param int $socid Id of thirdparty * @return int New id of clone */ - public function createFromClone(User $user, $socid = 0) + public function createFromClone(User $user, $socid = 0, $clone_contacts = false, $clone_notes = false) { - global $hookmanager; + global $hookmanager, $langs; + $langs->load("errors"); $error = 0; @@ -1344,6 +1345,11 @@ class Fichinter extends CommonObject $this->ref_client = ''; + if (!$clone_notes) { + $this->note_private = ''; + $this->note_public = ''; + } + // Create clone $this->context['createfromclone'] = 'createfromclone'; $result = $this->create($user); @@ -1369,6 +1375,31 @@ class Fichinter extends CommonObject } } + //Duplicate contact + if ($clone_contacts) { + foreach (array('internal', 'external') as $source) { + $tab = $objFrom->liste_contact(-1, $source); + if (is_array($tab) && count($tab) > 0) { + foreach ($tab as $contacttoadd) { + $retAddContact = $this->add_contact( + $contacttoadd['id'], + $contacttoadd['code'], + $contacttoadd['source'] + ); + if ($this->error == 'DB_ERROR_RECORD_ALREADY_EXISTS') { + $this->error .= $langs->trans("ErrorThisContactIsAlreadyDefinedAsThisType"); + $error++; + } elseif ($retAddContact < 0) { + $error++; + } + } + } elseif ($tab < 0) { + $this->error .= $objFrom->error; + $error++; + } + } + } + unset($this->context['createfromclone']); // End From 1d1eafb19fabbeab0074b8fa1f410dfa8fb0f1ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9?= Date: Thu, 30 Jan 2025 17:33:12 +0100 Subject: [PATCH 060/375] FIX: Add documentation for hte new two params --- htdocs/fichinter/class/fichinter.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 8c09fbed2e5..d9e3631a46c 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -1298,6 +1298,8 @@ class Fichinter extends CommonObject * * @param User $user User making the clone * @param int $socid Id of thirdparty + * @param bool $clone_contacts Clone contacts from origin + * @param bool $clone_notes Clone notes from origin * @return int New id of clone */ public function createFromClone(User $user, $socid = 0, $clone_contacts = false, $clone_notes = false) From 70f9dde739ac3a5aebeb55b7c3e331ed3ea88f03 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 30 Jan 2025 17:53:56 +0100 Subject: [PATCH 061/375] Qual: Improve lang test + message in case of test exception # Qual: Improve lang test + message in case of test exception This fixes the language test enabling the error message itself. I also improved the Exception handling so that a backtrace is shown to help find where it happened (here the error message was empty which was strange and made it harder to find - the (empty(val)?a:b) was lacking parentheses for proper concatenation --- test/phpunit/CommonClassTest.class.php | 12 +++++++++++- test/phpunit/LangTest.php | 12 ++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/test/phpunit/CommonClassTest.class.php b/test/phpunit/CommonClassTest.class.php index d083e842758..4f75b562dcd 100644 --- a/test/phpunit/CommonClassTest.class.php +++ b/test/phpunit/CommonClassTest.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2023 Alexandre Janniaux - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -168,6 +168,16 @@ abstract class CommonClassTest extends TestCase print "##[group]$className::$failedTestMethod failed - $argsText.".PHP_EOL; print "## ".get_class($t).": {$t->getMessage()}".PHP_EOL; + // Show some information about where it happened + foreach ($t->getTrace() as $idx => $trace) { + if (isset($trace['file'], $trace['line']) // Only if we have a file name + && !preg_match('/(?:\bphar\b|Framework)/', $trace['file']) // Only if it's not in phpunit + ) { + print "## backtrace($idx): From {$trace['file']}:{$trace['line']}.".PHP_EOL; + } + } + + if ($nbLinesToShow) { $newLines = count($last_lines); if ($newLines > 0) { diff --git a/test/phpunit/LangTest.php b/test/phpunit/LangTest.php index 1cb8c53c532..2442b165848 100644 --- a/test/phpunit/LangTest.php +++ b/test/phpunit/LangTest.php @@ -1,7 +1,7 @@ * Copyright (C) 2023 Alexandre Janniaux - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -194,14 +194,14 @@ class LangTest extends CommonClassTest include_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; - $prefix = __METHOD__."($code) "; $tmplangs = new Translate('', $conf); $langcode = $code; $tmplangs->setDefaultLang($langcode); $tmplangs->load("main"); - print PHP_EOL.$prefix."Check language file".PHP_EOL; + print PHP_EOL.$prefix."Check language files".PHP_EOL; + $result = $tmplangs->transnoentitiesnoconv("FONTFORPDF"); print $prefix."FONTFORPDF=".$result.PHP_EOL; $this->assertTrue(in_array($result, array('msungstdlight', 'stsongstdlight', 'helvetica', 'DejaVuSans', 'cid0jp', 'cid0kr', 'freemono', 'freeserif')), 'Error bad value '.$result.' for FONTFORPDF in main.lang file '.$code); @@ -231,14 +231,14 @@ class LangTest extends CommonClassTest unset($tmplangs); - print $prefix."Check some syntax rules in the language file".PHP_EOL; + print $prefix."Check syntax rules in the language files".PHP_EOL; $filesarray2 = scandir(DOL_DOCUMENT_ROOT.'/langs/'.$code); foreach ($filesarray2 as $key => $file) { if (! preg_match('/\.lang$/', $file)) { continue; } - //print 'Check lang file '.$file.PHP_EOL; + //print $prefix.'Check lang file '.$file.PHP_EOL; $filecontent = file_get_contents(DOL_DOCUMENT_ROOT.'/langs/'.$code.'/'.$file); $result = preg_match('/=--$/m', $filecontent); // A special % char we don't want. We want the common one. @@ -260,7 +260,7 @@ class LangTest extends CommonClassTest $reg = array(); $result = preg_match('/(.*)\'notranslate\'/im', $filecontent, $reg); // A sequence of char we don't want //print $prefix."Result for checking we don't have bad percent char = ".$result.PHP_EOL; - $this->assertTrue($result == 0, 'Found a sequence tag \'notranslate\' in the translation file '.$code.'/'.$file.' in line '.empty($reg[1]) ? '' : $reg[1]); + $this->assertTrue($result == 0, 'Found a sequence tag \'notranslate\' in the translation file '.$code.'/'.$file.' in line '.(empty($reg[1]) ? '' : $reg[1])); if (!in_array($code, array('ar_SA'))) { $reg = array(); From effe49ef26de2d33a991e972c5a3446bfc77dba8 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 31 Jan 2025 00:01:17 +0100 Subject: [PATCH 062/375] Debug v21 --- htdocs/core/class/html.form.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/position_list.php | 178 ++++++++++++++++---------- htdocs/user/group/list.php | 58 +++++---- 4 files changed, 148 insertions(+), 92 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 1eda2d0ec4f..a450aaa7d6c 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -873,7 +873,7 @@ class Form console.log("initCheckForSelect mode="+mode+" name="+name+" cssclass="+cssclass+" atleastoneselected="+atleastoneselected); - if (atleastoneselected || ' . $alwaysvisible . ') + if (atleastoneselected || ' . ((int) $alwaysvisible) . ') { jQuery("."+name).show(); ' . ($selected ? 'if (atleastoneselected) { jQuery("."+name+"select").val("' . $selected . '").trigger(\'change\'); jQuery("."+name+"confirmed").prop(\'disabled\', false); }' : '') . ' diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 1e4b1407046..10d04ebf202 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -1135,7 +1135,7 @@ class Position extends CommonObject $return .= ''; $return .= '
'; $return .= ''.(method_exists($this, 'getNomUrl') ? $this->getNomUrl(1) : $this->ref).''; - $return .= ''; + $return .= ''; if (!empty($arraydata['user'])) { $return .= '
'.$arraydata['user'].''; } diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index fd562ed9858..aa2dce54f9b 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -47,7 +47,7 @@ require_once DOL_DOCUMENT_ROOT.'/hrm/class/position.class.php'; // Load translation files required by the page $langs->loadLangs(array('hrm', 'other')); -// Get Parameters +// Get parameters $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ... $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists) $show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ? @@ -66,7 +66,7 @@ $ref = GETPOST('ref', 'alpha'); $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page"); +$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page'); if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // If $page is not defined, or '' or -1 or if we click on clear filters $page = 0; @@ -80,7 +80,7 @@ $object = new Position($db); $extrafields = new ExtraFields($db); $userstatic = new User($db); $diroutputmassaction = $conf->hrm->dir_output.'/temp/massgeneration/'.$user->id; -$hookmanager->initHooks(array('positionlist')); // Note that conf->hooks_modules contains array +$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array // Fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -98,7 +98,7 @@ if (!$sortorder) { } // Initialize array of search criteria -$search_all = GETPOST('search_all', 'alphanohtml'); +$search_all = trim(GETPOST('search_all', 'alphanohtml')); $search = array(); foreach ($object->fields as $key => $val) { if (GETPOST('search_'.$key, 'alpha') !== '') { @@ -119,12 +119,13 @@ foreach ($object->fields as $key => $val) { } // Definition of array of fields for columns +$tableprefix = 't'; $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { $visible = (int) dol_eval((string) $val['visible'], 1); - $arrayfields['t.'.$key] = array( + $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), @@ -173,7 +174,7 @@ if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massa $massaction = ''; } -$parameters = array(); +$parameters = array('arrayfields' => &$arrayfields); $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); @@ -192,6 +193,7 @@ if (empty($reshook)) { $search[$key.'_dtend'] = ''; } } + $search_all = ''; $toselect = array(); $search_array_options = array(); } @@ -218,9 +220,9 @@ $jobstatic = new Job($db); $now = dol_now(); +$title = $langs->trans('EmployeePositions'); //$help_url="EN:Module_Position|FR:Module_Position_FR|ES:Módulo_Position"; $help_url = ''; -$title = $langs->trans('EmployeePositions'); $morejs = array(); $morecss = array(); @@ -236,24 +238,29 @@ $sql .= ', j.rowid as job_id, j.label as job_label'; // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { - $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ''); + $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : ""); } } // Add fields from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); + +$sqlfields = $sql; // $sql fields to remove for count total + $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t LEFT JOIN ".MAIN_DB_PREFIX.$userstatic->table_element." as u on t.fk_user = u.rowid, ".MAIN_DB_PREFIX."hrm_job as j"; + +//$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."anothertable as rc ON rc.parent = t.rowid"; if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)"; } // Add table from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; if ($object->ismultientitymanaged == 1) { - $sql .= " WHERE t.entity IN (".getEntity($object->element).")"; + $sql .= " WHERE t.entity IN (".getEntity($object->element, (GETPOSTINT('search_current_entity') ? 0 : 1)).")"; } else { $sql .= " WHERE 1 = 1"; } @@ -270,18 +277,24 @@ foreach ($search as $key => $val) { } $mode_search = 2; } - if ($search[$key] != '') { - $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); + if (empty($object->fields[$key]['searchmulti'])) { + if (!is_array($search[$key]) && $search[$key] != '') { + $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search)); + } + } else { + if (is_array($search[$key]) && !empty($search[$key])) { + $sql .= natural_search("t.".$db->escape($key), implode(',', $search[$key]), (($key == 'status') ? 2 : $mode_search)); + } } } else { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { - $columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key); + $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key); if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) { if (preg_match('/_dtstart$/', $key)) { - $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'"; + $sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'"; } if (preg_match('/_dtend$/', $key)) { - $sql .= " AND t.".$db->escape($columnName)." <= '".$db->idate($search[$key])."'"; + $sql .= " AND t.".$db->sanitize($columnName)." <= '".$db->idate($search[$key])."'"; } } } @@ -299,13 +312,13 @@ if ($search_all) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; // Add where from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; /* If a group by is required $sql .= " GROUP BY "; foreach($object->fields as $key => $val) { - $sql .= "t.".$db->escape($key).", "; + $sql .= "t.".$db->sanitize($key).", "; } // Add fields from extrafields if (!empty($extrafields->attributes[$object->table_element]['label'])) { @@ -313,9 +326,9 @@ if (!empty($extrafields->attributes[$object->table_element]['label'])) { $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : ''); } } -// Add where from hooks +// Add groupby from hooks $parameters = array(); -$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object, $action); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; $sql = preg_replace('/,\s*$/', '', $sql); */ @@ -323,9 +336,19 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { - $resql = $db->query($sql); - $nbtotalofrecords = $db->num_rows($resql); - if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } @@ -348,7 +371,7 @@ $num = $db->num_rows($resql); // Direct jump if only one record found -if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { +if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) { $obj = $db->fetch_object($resql); $id = $obj->rowid; header("Location: ".dol_buildpath('/hrm/position.php', 1).'?id='.$id); @@ -362,7 +385,7 @@ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $s llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist'); // Example : Adding jquery code -// print ''; diff --git a/htdocs/website/lib/website.lib.php b/htdocs/website/lib/website.lib.php index a55150c6194..ba6039683ca 100644 --- a/htdocs/website/lib/website.lib.php +++ b/htdocs/website/lib/website.lib.php @@ -94,7 +94,7 @@ function websiteconfigPrepareHead($object) /** * Prepare array of directives for Website * - * @return array Array of tabs + * @return array Array of directives */ function websiteGetContentPolicyDirectives() { @@ -128,7 +128,7 @@ function websiteGetContentPolicyDirectives() "report-to" => array("label" => "report-to", "data-directivetype" => "reporting"), // Other directives "require-trusted-types-for" => array("label" => "require-trusted-types-for", "data-directivetype" => "other"), - "othertrusted-types", + "othertrusted-types" => array("label" => "othertrusted-types", "data-directivetype" => "other"), "upgrade-insecure-requests" => array("label" => "upgrade-insecure-requests", "data-directivetype" => "other"), ); } @@ -136,7 +136,7 @@ function websiteGetContentPolicyDirectives() /** * Prepare array of sources for Website * - * @return array Array of tabs + * @return array Array of sources */ function websiteGetContentPolicySources() { @@ -145,32 +145,43 @@ function websiteGetContentPolicySources() "fetch" => array( "*" => array("label" => "*", "data-sourcetype" => "select"), "data" => array("label" => "data", "data-sourcetype" => "data"), - "self" => array("label" => "self", "data-sourcetype" => "select"), + "self" => array("label" => "self", "data-sourcetype" => "quoted"), ), // Document directives "document" => array( - "base-uri", - "sandbox", + "base-uri" => array("label" => "base-uri", "data-sourcetype" => "select"), + "sandbox" => array("label" => "sandbox", "data-sourcetype" => "select"), ), // Navigation directives "navigation" => array( - "self", + "self" => array("label" => "self", "data-sourcetype" => "quoted"), ), // Reporting directives "reporting" => array( - "report-to", + "report-to" => array("label" => "report-to", "data-sourcetype" => "select"), ), // Other directives "other" => array( - "require-trusted-types-for", - "trusted-types", - "upgrade-insecure-requests", + "require-trusted-types-for" => array("label" => "require-trusted-types-for", "data-sourcetype" => "select"), + "trusted-types" => array("label" => "trusted-types", "data-sourcetype" => "select"), + "upgrade-insecure-requests" => array("label" => "upgrade-insecure-requests", "data-sourcetype" => "select"), ), ); } +/** + * Transform a Content Security Policy to an array + * @param string content security policy + * + * @return array Array of sources + */ function websiteGetContentPolicyToArray($forceCSP){ $forceCSPArr = array(); + $sourceCSPArr = websiteGetContentPolicySources(); + $sourceCSPArrflatten = array(); + foreach ($sourceCSPArr as $key => $arr) { + $sourceCSPArrflatten = array_merge($sourceCSPArrflatten, array_keys($arr)); + } $securitypolicies = explode(";", $forceCSP); foreach ($securitypolicies as $key => $securitypolicy) { if ($securitypolicy == "") continue; @@ -183,11 +194,29 @@ function websiteGetContentPolicyToArray($forceCSP){ continue; } $sources = $securitypolicyarr; + $issourcedata = 0; foreach ($sources as $key => $source) { - if (empty($forceCSPArr[$directive])) { - $forceCSPArr[$directive] = array($source); + $source = str_replace(":", "", $source); + $source = str_replace("'", "", $source); + + if ($source == "data") { + $issourcedata = 1; + if (empty($forceCSPArr[$directive])) { + $forceCSPArr[$directive] = array($source => array()); + } else { + $forceCSPArr[$directive][$source] = array(); + } + continue; + } + if ($issourcedata && !in_array($source, $sourceCSPArrflatten)) { + $forceCSPArr[$directive]["data"][] = $source; } else { - $forceCSPArr[$directive][] = $source; + $issourcedata = 0; + if (empty($forceCSPArr[$directive])) { + $forceCSPArr[$directive] = array($source); + } else { + $forceCSPArr[$directive][] = $source; + } } } } From 0a958e98ec7646f7071d5997dad5dbfb422683b2 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Tue, 4 Feb 2025 16:16:02 +0100 Subject: [PATCH 137/375] NEW: takepos cash control: add vat taxless total --- htdocs/compta/cashcontrol/report.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php index d4d1d6d758f..4b9d33c32af 100644 --- a/htdocs/compta/cashcontrol/report.php +++ b/htdocs/compta/cashcontrol/report.php @@ -226,6 +226,7 @@ if ($resql) { $totalqty = 0; $totalvat = 0; $totalvatperrate = array(); + $totalhtperrate = array(); $totallocaltax1 = 0; $totallocaltax2 = 0; $cachebankaccount = array(); @@ -257,8 +258,10 @@ if ($resql) { if ($line->tva_tx) { if (empty($totalvatperrate[$line->tva_tx])) { $totalvatperrate[$line->tva_tx] = 0; + $totalhtperrate[$line->tva_tx] = 0; } $totalvatperrate[$line->tva_tx] += $line->total_tva; + $totalhtperrate[$line->tva_tx] += $line->total_ht; } $totallocaltax1 += $line->total_localtax1; $totallocaltax2 += $line->total_localtax2; @@ -448,9 +451,9 @@ if ($resql) { } if (!empty($totalvatperrate) && is_array($totalvatperrate)) { - print '

'.$langs->trans("VATRate").'
'; + print '

'.$langs->trans("TotalHT").'
'.$langs->trans("TotalVAT").'
'; foreach ($totalvatperrate as $keyrate => $valuerate) { - print '
'.$langs->trans("VATRate").' '.vatrate($keyrate, true).' :
'.price($valuerate).'
'; + print '
'.$langs->trans("VATRate").' '.vatrate($keyrate, true).' :
'.price($totalhtperrate[$keyrate] ?? 0).'
'.price($valuerate).'
'; } } From fda8e56ded3a49db04005dfa79c32689d6b75d36 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 4 Feb 2025 16:30:06 +0100 Subject: [PATCH 138/375] CSS --- htdocs/compta/bank/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index 31f7fc7ca20..451802d6c84 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -799,7 +799,7 @@ if ($action == 'create') { if ($object->type == Account::TYPE_SAVINGS || $object->type == Account::TYPE_CURRENT) { print ''; - print ''; + print ''; print ''; $ibankey = FormBank::getIBANLabel($object); From 41dd4e884e6d7fb89e007c43e398e9926b18afc9 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 4 Feb 2025 17:20:42 +0100 Subject: [PATCH 139/375] Debug v21 --- htdocs/core/ajax/ajaxdirpreview.php | 2 +- htdocs/core/lib/files.lib.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 51f053c9eda..6a826b5a126 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -300,7 +300,7 @@ if ($type == 'directory') { // Automatic list if (in_array($module, $automodules)) { - $param .= '&module='.$module; + $param .= '&module='.urlencode($module); if (isset($search_doc_ref) && $search_doc_ref != '') { $param .= '&search_doc_ref='.urlencode($search_doc_ref); } diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 16e56bdff81..a6012f37864 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -250,7 +250,7 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", * Scan a directory and return a list of files/directories. * Content for string is UTF8 and dir separator is "/". * - * @param string $path Starting path from which to search. Example: 'produit/MYPROD' + * @param string $path Starting path from which to search. Example: 'produit/MYPROD' or 'produit/%' * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function * @param string[]|null $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')) * @param string $sortcriteria Sort criteria ("","fullname","name","date","size") @@ -272,9 +272,9 @@ function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $s $sql .= ", description"; } $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; - $sql .= " WHERE entity = ".$conf->entity; + $sql .= " WHERE entity = ".((int) $conf->entity); if (preg_match('/%$/', $path)) { - $sql .= " AND filepath LIKE '".$db->escape($path)."'"; + $sql .= " AND (filepath LIKE '".$db->escape($path)."' OR filepath = '".$db->escape(preg_replace('/\/%$/', '', $path))."')"; } else { $sql .= " AND filepath = '".$db->escape($path)."'"; } From ab4eb1f8341c73e112443b352c4815eb2228981c Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 4 Feb 2025 18:46:20 +0100 Subject: [PATCH 140/375] WIP Dir statement in ECM --- htdocs/core/ajax/ajaxdirpreview.php | 6 +- htdocs/core/class/html.formfile.class.php | 9 ++- htdocs/core/lib/files.lib.php | 86 +++++++++++++---------- htdocs/ecm/index_auto.php | 3 + 4 files changed, 61 insertions(+), 43 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index 51f053c9eda..cf4bf9f79bc 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -233,6 +233,7 @@ if ($type == 'directory') { 'holiday', 'recruitment-recruitmentcandidature', 'banque', + 'bank-statement', 'chequereceipt', 'mrp-mo' ); @@ -286,6 +287,8 @@ if ($type == 'directory') { $upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature'; } elseif ($module == 'banque') { $upload_dir = $conf->bank->dir_output; + } elseif ($module == 'bank-statement') { + $upload_dir = $conf->bank->dir_output.'/*/statement'; } elseif ($module == 'chequereceipt') { $upload_dir = $conf->bank->dir_output.'/checkdeposits'; } elseif ($module == 'mrp-mo') { @@ -300,7 +303,7 @@ if ($type == 'directory') { // Automatic list if (in_array($module, $automodules)) { - $param .= '&module='.$module; + $param .= '&module='.urlencode($module); if (isset($search_doc_ref) && $search_doc_ref != '') { $param .= '&search_doc_ref='.urlencode($search_doc_ref); } @@ -309,6 +312,7 @@ if ($type == 'directory') { $filter = preg_quote((string) $search_doc_ref, '/'); $filearray = dol_dir_list($upload_dir, "files", 1, $filter, $excludefiles, $sortfield, $sorting, 1); + //var_dump($filearray); // To allow external users,we must restrict $filearray to entries the user is a thirdparty. // This can be done by filtering on entries found into llx_ecm diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 54b63b884d3..85cedff7d47 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1837,7 +1837,7 @@ class FormFile } print '
'; - print '
'.$langs->trans("BankName").'
'.$langs->trans("BankName").''.$object->bank.'
'."\n"; + print '
'."\n"; if (!empty($addfilterfields)) { print ''; @@ -1927,6 +1927,9 @@ class FormFile } elseif ($modulepart == 'banque') { include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $object_instance = new Account($this->db); + } elseif ($modulepart == 'bank-statement') { + //include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; + $object_instance = null; } elseif ($modulepart == 'chequereceipt') { include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php'; $object_instance = new RemiseCheque($this->db); @@ -2050,8 +2053,8 @@ class FormFile $result = $object_instance->fetch($id); } else { if (!($result = $object_instance->fetch(0, $ref))) { - //fetchOneLike looks for objects with wildcards in its reference. - //It is useful for those masks who get underscores instead of their actual symbols (because the _ had replaced all forbidden chars into filename) + // fetchOneLike looks for objects with wildcards in its reference. + // It is useful for those masks who get underscores instead of their actual symbols (because the _ had replaced all forbidden chars into filename) // TODO Example when this is needed ? // This may find when ref is 'A_B' and date was stored as 'A~B' into database, but in which case do we have this ? // May be we can add hidden option to enable this. diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 345d170ff2d..3b61c736971 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -62,7 +62,7 @@ function dol_basename($pathfile) */ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", $excludefilter = null, $sortcriteria = "name", $sortorder = SORT_ASC, $mode = 0, $nohook = 0, $relativename = "", $donotfollowsymlinks = 0, $nbsecondsold = 0) { - global $db, $hookmanager; + global $hookmanager; global $object; if ($recursive <= 1) { // Avoid too verbose log @@ -97,43 +97,52 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", $loadsize = ($mode == 1 || $mode == 3 || $sortcriteria == 'size'); $loadperm = ($mode == 1 || $mode == 4 || $sortcriteria == 'perm'); - // Clean parameters - $utf8_path = preg_replace('/([\\/]+)$/', '', $utf8_path); - $os_path = dol_osencode($utf8_path); $now = dol_now(); - $reshook = 0; $file_list = array(); - if (!$nohook && $hookmanager instanceof HookManager) { - $hookmanager->resArray = array(); + // Clean parameters + $utf8_path = preg_replace('/([\\/]+)$/', '', $utf8_path); - $hookmanager->initHooks(array('fileslib')); - - $parameters = array( - 'path' => $os_path, - 'types' => $types, - 'recursive' => $recursive, - 'filter' => $filter, - 'excludefilter' => $exclude_array, // Already converted to array. - 'sortcriteria' => $sortcriteria, - 'sortorder' => $sortorder, - 'loaddate' => $loaddate, - 'loadsize' => $loadsize, - 'mode' => $mode - ); - $reshook = $hookmanager->executeHooks('getDirList', $parameters, $object); + if (preg_match('/\*/', $utf8_path)) { + $utf8_path_array = glob($utf8_path, GLOB_ONLYDIR); // This scan dir for files. If file does not exists, return empty. + //$os_path_array = dol_dir_list($utf8_path); + } else { + $utf8_path_array = array($utf8_path); } - // $hookmanager->resArray may contain array stacked by other modules - if (empty($reshook)) { - if (!is_dir($os_path)) { - return array(); + foreach ($utf8_path_array as $utf8_path_cursor) { + $os_path = dol_osencode($utf8_path_cursor); + if (!$nohook && $hookmanager instanceof HookManager) { + $hookmanager->resArray = array(); + + $hookmanager->initHooks(array('fileslib')); + + $parameters = array( + 'path' => $os_path, + 'types' => $types, + 'recursive' => $recursive, + 'filter' => $filter, + 'excludefilter' => $exclude_array, // Already converted to array. + 'sortcriteria' => $sortcriteria, + 'sortorder' => $sortorder, + 'loaddate' => $loaddate, + 'loadsize' => $loadsize, + 'mode' => $mode + ); + $reshook = $hookmanager->executeHooks('getDirList', $parameters, $object); } - if (($dir = opendir($os_path)) === false) { - return array(); - } else { + // $hookmanager->resArray may contain array stacked by other modules + if (empty($reshook)) { + if (!is_dir($os_path)) { + continue; + } + + if (($dir = opendir($os_path)) === false) { + continue; + } + $filedate = ''; $filesize = ''; $fileperm = ''; @@ -149,7 +158,7 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", $qualified = 1; - $utf8_fullpathfile = "$utf8_path/$utf8_file"; // Temp variable for speed + $utf8_fullpathfile = $utf8_path_cursor."/".$utf8_file; // Temp variable for speed // Check if file is qualified foreach ($excludefilterarray as $filt) { @@ -230,14 +239,14 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", } } closedir($dir); - - // Obtain a list of columns - if (!empty($sortcriteria) && $sortorder) { - $file_list = dol_sort_array($file_list, $sortcriteria, ($sortorder == SORT_ASC ? 'asc' : 'desc')); - } } } + // Obtain a list of columns + if (!empty($sortcriteria) && $sortorder) { + $file_list = dol_sort_array($file_list, $sortcriteria, ($sortorder == SORT_ASC ? 'asc' : 'desc')); + } + if ($hookmanager instanceof HookManager && is_array($hookmanager->resArray)) { $file_list = array_merge($file_list, $hookmanager->resArray); } @@ -250,7 +259,7 @@ function dol_dir_list($utf8_path, $types = "all", $recursive = 0, $filter = "", * Scan a directory and return a list of files/directories. * Content for string is UTF8 and dir separator is "/". * - * @param string $path Starting path from which to search. Example: 'produit/MYPROD' + * @param string $path Starting path from which to search. Example: 'produit/MYPROD' or 'produit/%' * @param string $filter Regex filter to restrict list. This regex value must be escaped for '/', since this char is used for preg_match function * @param string[]|null $excludefilter Array of Regex for exclude filter (example: array('(\.meta|_preview.*\.png)$','^\.')) * @param string $sortcriteria Sort criteria ("","fullname","name","date","size") @@ -272,9 +281,9 @@ function dol_dir_list_in_database($path, $filter = "", $excludefilter = null, $s $sql .= ", description"; } $sql .= " FROM ".MAIN_DB_PREFIX."ecm_files"; - $sql .= " WHERE entity = ".$conf->entity; + $sql .= " WHERE entity = ".((int) $conf->entity); if (preg_match('/%$/', $path)) { - $sql .= " AND filepath LIKE '".$db->escape($path)."'"; + $sql .= " AND (filepath LIKE '".$db->escape($path)."' OR filepath = '".$db->escape(preg_replace('/\/%$/', '', $path))."')"; } else { $sql .= " AND filepath = '".$db->escape($path)."'"; } @@ -3577,7 +3586,6 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, if ($fuser->hasRight($tmpmodule, $read) || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } - $original_file = $conf->$tmpmodule->dir_output.'/temp/massgeneration/'.$user->id.'/'.$original_file; } else { if (empty($conf->$modulepart->dir_output)) { // modulepart not supported diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php index b7b30ba4d1e..d6f9f5142f2 100644 --- a/htdocs/ecm/index_auto.php +++ b/htdocs/ecm/index_auto.php @@ -393,6 +393,9 @@ if (!getDolGlobalString('ECM_AUTO_TREE_HIDEN')) { $langs->load("banks"); $rowspan++; $sectionauto[] = array('position' => 180, 'level' => 1, 'module' => 'banque', 'test' => isModEnabled('bank'), 'label' => $langs->trans("BankAccount"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount"))); + // TODO Enable this + //$rowspan++; + //$sectionauto[] = array('position' => 182, 'level' => 1, 'module' => 'bank-statement', 'test' => isModEnabled('bank'), 'label' => $langs->trans("BankAccount").' - '.$langs->trans("Statement"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount").' - '.$langs->transnoentitiesnoconv("Statement"))); $rowspan++; $sectionauto[] = array('position' => 190, 'level' => 1, 'module' => 'chequereceipt', 'test' => isModEnabled('bank'), 'label' => $langs->trans("CheckReceipt"), 'desc' => $langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt"))); } From fa846254e54a8dc44395318c61508f93aaa9f4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 4 Feb 2025 20:42:07 +0100 Subject: [PATCH 141/375] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/core/ajax/ajaxdirpreview.php | 18 +++++++++--------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index d93d80a939d..4f95b73a9fb 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -8034,12 +8034,6 @@ parameters: count: 1 path: ../../../htdocs/core/ajax/ajaxdirpreview.php - - - message: '#^Variable \$module might not be defined\.$#' - identifier: variable.undefined - count: 34 - path: ../../../htdocs/core/ajax/ajaxdirpreview.php - - message: '#^Variable \$section might not be defined\.$#' identifier: variable.undefined diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index cf4bf9f79bc..e15ee650179 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -1,12 +1,12 @@ - * Copyright (C) 2004-2012 Laurent Destailleur - * Copyright (C) 2005 Simon Tosser - * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010 Pierre Morin - * Copyright (C) 2013 Marcos García - * Copyright (C) 2024 MDW - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2004-2007 Rodolphe Quiedeville + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2005 Simon Tosser + * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2010 Pierre Morin + * Copyright (C) 2013 Marcos García + * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -49,7 +49,7 @@ if (!defined('NOREQUIREAJAX')) { * @var Translate $langs * @var User $user */ - +$module = ''; if (!isset($mode) || $mode != 'noajax') { // For ajax call require_once '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; From 46f17187dc7f658ccab1393ddeeb46391a051344 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Feb 2025 20:59:46 +0100 Subject: [PATCH 142/375] Update societeaccount.class.php --- htdocs/societe/class/societeaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 9322bb6956f..4a386774140 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -94,7 +94,7 @@ class SocieteAccount extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( From 076a329a041d130dc376c42e4581317d2fcc1703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 4 Feb 2025 21:06:19 +0100 Subject: [PATCH 143/375] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 87aebb5c6eb..04c180cd5b2 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -140,7 +140,7 @@ abstract class CommonObject /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); From d648159cb1063f6ad38892d8f011895b60bf5654 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 4 Feb 2025 22:43:01 +0100 Subject: [PATCH 144/375] Fix for marketplace --- htdocs/core/lib/website.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 00de6abe9ae..c243285abe2 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -1080,10 +1080,11 @@ function getNbOfImagePublicURLOfObject($object) * @param Object $object Object * @param int $no Numero of image (if there is several images. 1st one by default) * @param string $extName Extension to differentiate thumb file name ('', '_small', '_mini') + * @param int $cover 1=Add a filter on field "cover", 0=Exclude "cover" images, -1=No filter * @return string HTML img content or '' if no image found * @see getNbOfImagePublicURLOfObject(), getPublicFilesOfObject(), getImageFromHtmlContent() */ -function getImagePublicURLOfObject($object, $no = 1, $extName = '') +function getImagePublicURLOfObject($object, $no = 1, $extName = '', $cover = -1) { global $db; @@ -1098,6 +1099,7 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '') $sql .= " WHERE entity IN (".getEntity($object->element).")"; $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object $sql .= " AND ".$db->regexpsql('filename', $regexforimg, 1); + $sql .= ($cover >= 0 ? " AND cover = ".((int) $cover) : ""); $sql .= $db->order("cover,position,rowid", "ASC,ASC,ASC"); $resql = $db->query($sql); From 0cc61215a939d5d096438509f169198f1ec32fbb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2025 22:56:35 +0100 Subject: [PATCH 145/375] Update accountancyimport.class.php --- htdocs/accountancy/class/accountancyimport.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php index 32cb1dc8405..7ce2554c1d4 100644 --- a/htdocs/accountancy/class/accountancyimport.class.php +++ b/htdocs/accountancy/class/accountancyimport.class.php @@ -113,12 +113,12 @@ class AccountancyImport /** - * Compute direction + * Compute direction * * @param array $arrayrecord Array of read values: [fieldpos] => (['val']=>val, ['type']=>-1=null,0=blank,1=string), [fieldpos+1]... * @param array $listfields Fields list to add * @param int $record_key Record key - * @return mixed Value + * @return string Value D or C or "" */ public function computeDirection(&$arrayrecord, $listfields, $record_key) { @@ -132,7 +132,7 @@ class AccountancyImport $sens = 'C'; } - return $this->db->escape($sens); + return $sens; } return ""; From eb58bf92d7fea5c4a90e01cd5bdde0e322200f75 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 4 Feb 2025 23:17:22 +0100 Subject: [PATCH 146/375] Update upgrade2.php --- htdocs/install/upgrade2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index a0af8634baa..92e58782523 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -4135,7 +4135,7 @@ function migrate_delete_old_files($db, $langs, $conf) //print ''DOL_DOCUMENT_ROOT.$filetodelete."
\n"; if (preg_match('/\*/', $filetodelete) || file_exists(DOL_DOCUMENT_ROOT.$filetodelete)) { //print "Process file ".$filetodelete."\n"; - $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, 1, 0, null, true, false); // nophperrors to avoid false positive with asterisk + $result = dol_delete_file(DOL_DOCUMENT_ROOT.$filetodelete, 0, (preg_match('/\*/', $filetodelete) ? 1 : 0), 0, null, true, false); // nophperrors to avoid false positive with asterisk if (!$result) { $langs->load("errors"); print '
'.$langs->trans("Error").': '.$langs->trans("ErrorFailToDeleteFile", DOL_DOCUMENT_ROOT.$filetodelete); From efeeab4108e6d8d7af47be7dc982d753fc92853c Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 4 Feb 2025 23:58:14 +0100 Subject: [PATCH 147/375] Debug v22 --- htdocs/core/ajax/ajaxdirpreview.php | 4 ++++ htdocs/core/class/html.form.class.php | 2 +- htdocs/modulebuilder/template/myobject_list.php | 2 +- htdocs/user/group/list.php | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index cf4bf9f79bc..cfab01f54a4 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -96,11 +96,15 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call } } else { // When no an ajax call (include from other file) + /* + * @var string $module + */ ' @phan-var-force int $section @phan-var-force string $module @phan-var-force string $showonrightsize '; + $rootdirfordoc = $conf->ecm->dir_output; $ecmdir = new EcmDirectory($db); diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2faab59a652..57769c5b7cd 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9449,7 +9449,7 @@ class Form * @param string $htmlname Name of HTML field * @param array $array Array with array of fields we could show. This array may be modified according to setup of user. * @param string $varpage Id of context for page. Can be set by caller with $varpage=(empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage); - * @param string $pos Position colon on liste value 'left' or '' (meaning 'right'). + * @param string $pos Position of the colon in list: 'left' or '' (meaning 'right'). * @return string HTML multiselect string * @see selectarray() */ diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index 85bf290801a..2451c35d972 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -606,7 +606,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields with user setup $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); diff --git a/htdocs/user/group/list.php b/htdocs/user/group/list.php index f892164abf2..8c7a4d1b5fb 100644 --- a/htdocs/user/group/list.php +++ b/htdocs/user/group/list.php @@ -355,7 +355,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields with user setup $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); From db640de728d7429564b69bcc795ebf0017495631 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2025 00:02:41 +0100 Subject: [PATCH 148/375] Update expensereport_linktofile.tpl.php --- htdocs/expensereport/tpl/expensereport_linktofile.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php index b789360e3f2..689fe8903fb 100644 --- a/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php +++ b/htdocs/expensereport/tpl/expensereport_linktofile.tpl.php @@ -95,7 +95,7 @@ if (!getDolGlobalString('EXPENSEREPORT_DISABLE_ATTACHMENT_ON_LINES')) { } print '
'; - print $thumbshown ? $thumbshown : ($minifile ? img_mime($minifile): ''); + print $thumbshown ? $thumbshown : (empty($minifile) ? '' : img_mime($minifile)); print '
'; if (empty($urlforhref) || empty($thumbshown)) { From 39d15ffde2d454a7c3c1e163cf3eb1a85657ea8b Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 00:06:43 +0100 Subject: [PATCH 149/375] Fix annotation --- htdocs/core/ajax/ajaxdirpreview.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php index cfab01f54a4..b86ab79058f 100644 --- a/htdocs/core/ajax/ajaxdirpreview.php +++ b/htdocs/core/ajax/ajaxdirpreview.php @@ -96,7 +96,7 @@ if (!isset($mode) || $mode != 'noajax') { // For ajax call } } else { // When no an ajax call (include from other file) - /* + /** * @var string $module */ ' From ac7269eb686f670979b7f8d1f6364fb4be58650c Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 00:10:06 +0100 Subject: [PATCH 150/375] Fix phpstan --- htdocs/hrm/position_list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index d9fe89e164a..b3f9759ac87 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -517,7 +517,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column ? 'left' : ''); // This also change content of $arrayfields with user setup $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); @@ -744,7 +744,7 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key) && !in_array($key, array('ref'))) { - print ' title="'.dol_escape_htmltag($object->$key).'"'; + print ' title="'.dolPrintHTMLForAttribute((string) $object->$key).'"'; } print '>'; if ($key == 'status') { From 9cafa5f1a982ffe34700df900a6184084d187d33 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 00:32:27 +0100 Subject: [PATCH 151/375] Fix phan --- htdocs/societe/class/societeaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 9322bb6956f..c28581683b7 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -94,7 +94,7 @@ class SocieteAccount extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( From 732f97d73cd6d71e8f7a3b71ffd4acf71238e4ea Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 00:40:06 +0100 Subject: [PATCH 152/375] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/adherents/class/subscription.class.php | 2 +- htdocs/asset/class/asset.class.php | 2 +- htdocs/asset/class/assetdepreciationoptions.class.php | 2 +- htdocs/asset/class/assetmodel.class.php | 2 +- htdocs/bom/class/bom.class.php | 2 +- htdocs/bom/class/bomline.class.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/calendar.class.php | 2 +- htdocs/comm/action/class/actioncommreminder.class.php | 2 +- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/commande/class/commande.class.php | 2 +- htdocs/compta/bank/class/account.class.php | 2 +- htdocs/compta/bank/class/paymentvarious.class.php | 2 +- htdocs/compta/facture/class/facture-rec.class.php | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- htdocs/compta/prelevement/class/bonprelevement.class.php | 2 +- htdocs/contrat/class/contrat.class.php | 2 +- htdocs/contrat/class/contratligne.class.php | 2 +- htdocs/core/class/ccountry.class.php | 2 +- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/class/defaultvalues.class.php | 2 +- htdocs/core/class/emailsenderprofile.class.php | 2 +- htdocs/core/class/events.class.php | 2 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formmail.class.php | 2 +- htdocs/core/class/timespent.class.php | 2 +- htdocs/emailcollector/class/emailcollector.class.php | 2 +- htdocs/emailcollector/class/emailcollectoraction.class.php | 2 +- htdocs/emailcollector/class/emailcollectorfilter.class.php | 2 +- htdocs/eventorganization/class/conferenceorbooth.class.php | 2 +- .../class/conferenceorboothattendee.class.php | 2 +- htdocs/expedition/class/expedition.class.php | 2 +- htdocs/expensereport/class/expensereport_ik.class.php | 2 +- htdocs/expensereport/class/expensereport_rule.class.php | 2 +- htdocs/fourn/class/fournisseur.facture-rec.class.php | 2 +- htdocs/hrm/class/evaluation.class.php | 2 +- htdocs/hrm/class/evaluationdet.class.php | 2 +- htdocs/hrm/class/job.class.php | 2 +- htdocs/hrm/class/position.class.php | 2 +- htdocs/hrm/class/skill.class.php | 2 +- htdocs/hrm/class/skilldet.class.php | 2 +- htdocs/hrm/class/skillrank.class.php | 2 +- htdocs/intracommreport/class/intracommreport.class.php | 2 +- htdocs/knowledgemanagement/class/knowledgerecord.class.php | 2 +- htdocs/mrp/class/mo.class.php | 2 +- htdocs/opensurvey/class/opensurveysondage.class.php | 2 +- htdocs/partnership/class/partnership.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/class/productcustomerprice.class.php | 2 +- htdocs/product/class/productfournisseurprice.class.php | 2 +- htdocs/product/inventory/class/inventory.class.php | 4 ++-- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/product/stock/class/productlot.class.php | 2 +- .../product/stock/stocktransfer/class/stocktransfer.class.php | 2 +- .../stock/stocktransfer/class/stocktransferline.class.php | 2 +- htdocs/projet/class/project.class.php | 2 +- htdocs/recruitment/class/recruitmentcandidature.class.php | 2 +- htdocs/recruitment/class/recruitmentjobposition.class.php | 2 +- htdocs/salaries/class/paymentsalary.class.php | 2 +- htdocs/societe/class/companybankaccount.class.php | 2 +- htdocs/societe/class/companypaymentmode.class.php | 2 +- htdocs/societe/class/societe.class.php | 2 +- htdocs/ticket/class/cticketcategory.class.php | 2 +- htdocs/variants/class/ProductAttribute.class.php | 2 +- htdocs/variants/class/ProductAttributeValue.class.php | 2 +- htdocs/webhook/class/target.class.php | 2 +- htdocs/webportal/class/webportalinvoice.class.php | 2 +- htdocs/webportal/class/webportalmember.class.php | 2 +- htdocs/webportal/class/webportalorder.class.php | 2 +- htdocs/webportal/class/webportalpartnership.class.php | 2 +- htdocs/webportal/class/webportalpropal.class.php | 2 +- htdocs/website/class/websitepage.class.php | 2 +- htdocs/workstation/class/workstation.class.php | 2 +- htdocs/workstation/class/workstationresource.class.php | 2 +- htdocs/workstation/class/workstationusergroup.class.php | 2 +- htdocs/zapier/class/hook.class.php | 2 +- 76 files changed, 77 insertions(+), 77 deletions(-) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index 8fa636ca903..a9b1ef730ca 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -98,7 +98,7 @@ class Subscription extends CommonObject public $fk_bank; /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index e90672c6d76..a4600c70283 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -84,7 +84,7 @@ class Asset extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/asset/class/assetdepreciationoptions.class.php b/htdocs/asset/class/assetdepreciationoptions.class.php index ecd6d276726..16db99fcd02 100644 --- a/htdocs/asset/class/assetdepreciationoptions.class.php +++ b/htdocs/asset/class/assetdepreciationoptions.class.php @@ -66,7 +66,7 @@ class AssetDepreciationOptions extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index fcb463504e4..f985497ed4d 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -89,7 +89,7 @@ class AssetModel extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index d779f11f4d7..49ebde095d7 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -98,7 +98,7 @@ class BOM extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/bom/class/bomline.class.php b/htdocs/bom/class/bomline.class.php index 67b879078df..a26f0c2a9f2 100644 --- a/htdocs/bom/class/bomline.class.php +++ b/htdocs/bom/class/bomline.class.php @@ -80,7 +80,7 @@ class BOMLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'LineID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 8906b147c82..4dd000ab3d7 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -101,7 +101,7 @@ class Availabilities extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index db5eff037cd..1271b8ec8ac 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -101,7 +101,7 @@ class Calendar extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'right', 'comment' => "Id"), diff --git a/htdocs/comm/action/class/actioncommreminder.class.php b/htdocs/comm/action/class/actioncommreminder.class.php index a1d248df806..f7894822fb3 100644 --- a/htdocs/comm/action/class/actioncommreminder.class.php +++ b/htdocs/comm/action/class/actioncommreminder.class.php @@ -71,7 +71,7 @@ class ActionCommReminder extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 4031c5e5361..7aa4d215061 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -356,7 +356,7 @@ class Propal extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7a68bc13620..28c11b0b566 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -304,7 +304,7 @@ class Commande extends CommonOrder // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 45a30fdef82..d5a7e828953 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -348,7 +348,7 @@ class Account extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 7f38dab7af2..0c8d7c0ac9b 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -198,7 +198,7 @@ class PaymentVarious extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( // TODO: fill this array diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 01d22afb608..7e45aaa7faf 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -235,7 +235,7 @@ class FactureRec extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5d22fb3f0fe..9ce43e36298 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -321,7 +321,7 @@ class Facture extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 1), diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 376a958ee6a..593e4cddf29 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -194,7 +194,7 @@ class BonPrelevement extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => 0,), diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index c7f1bc8f41a..a50e16dca9e 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -263,7 +263,7 @@ class Contrat extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/contrat/class/contratligne.class.php b/htdocs/contrat/class/contratligne.class.php index 9b2184c8b03..09c42a1a632 100644 --- a/htdocs/contrat/class/contratligne.class.php +++ b/htdocs/contrat/class/contratligne.class.php @@ -299,7 +299,7 @@ class ContratLigne extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/core/class/ccountry.class.php b/htdocs/core/class/ccountry.class.php index 81be08a78b8..171100943fc 100644 --- a/htdocs/core/class/ccountry.class.php +++ b/htdocs/core/class/ccountry.class.php @@ -63,7 +63,7 @@ class Ccountry extends CommonDict /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> */ public $fields = array( 'label' => array('type' => 'varchar(250)', 'label' => 'Label', 'enabled' => 1, 'visible' => 1, 'position' => 15, 'notnull' => -1, 'showoncombobox' => 1) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e69d651a9d6..5056559a2d4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -140,7 +140,7 @@ abstract class CommonObject /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 0d28daa0958..c92697a4a9f 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -76,7 +76,7 @@ class DefaultValues extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/core/class/emailsenderprofile.class.php b/htdocs/core/class/emailsenderprofile.class.php index fb2f9a289e4..bd1034abe3d 100644 --- a/htdocs/core/class/emailsenderprofile.class.php +++ b/htdocs/core/class/emailsenderprofile.class.php @@ -87,7 +87,7 @@ class EmailSenderProfile extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index d1f80baadb2..1a581c464e6 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -127,7 +127,7 @@ class Events // extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 26971221bab..77e4cec648e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -8502,7 +8502,7 @@ class Form * @param int $forcecombo Force to load all values and output a standard combobox (with no beautification) * @param int<0,1> $disabled 1=Html component is disabled * @param string $selected_input_value Value of preselected input text (for use with ajax) - * @param string|array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>} $objectfield 'Object:Field' that contains the definition of parent (in table $fields or $extrafields). Example: 'Object:xxx' or 'Object@module:xxx' or 'Object:options_xxx' or 'Object@module:options_xxx' or, better, the full entry array in ->fields + * @param string|array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>} $objectfield 'Object:Field' that contains the definition of parent (in table $fields or $extrafields). Example: 'Object:xxx' or 'Object@module:xxx' or 'Object:options_xxx' or 'Object@module:options_xxx' or, better, the full entry array in ->fields * @return string Return HTML string * @see selectForFormsList(), select_thirdparty_list() */ diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index d86a8cb0fc2..a9b87e75da6 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -2249,7 +2249,7 @@ class ModelMail extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( "rowid" => array("type" => "integer", "label" => "TechnicalID", 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index fdd8dd83bcd..87bb25277f1 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -101,7 +101,7 @@ class TimeSpent extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 344ac3e1ac4..979e676ee7d 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -110,7 +110,7 @@ class EmailCollector extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => 2, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1), diff --git a/htdocs/emailcollector/class/emailcollectoraction.class.php b/htdocs/emailcollector/class/emailcollectoraction.class.php index 198d5ed878f..eea46233dad 100644 --- a/htdocs/emailcollector/class/emailcollectoraction.class.php +++ b/htdocs/emailcollector/class/emailcollectoraction.class.php @@ -69,7 +69,7 @@ class EmailCollectorAction extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/emailcollector/class/emailcollectorfilter.class.php b/htdocs/emailcollector/class/emailcollectorfilter.class.php index dc32722847e..3611bdfdbbc 100644 --- a/htdocs/emailcollector/class/emailcollectorfilter.class.php +++ b/htdocs/emailcollector/class/emailcollectorfilter.class.php @@ -71,7 +71,7 @@ class EmailCollectorFilter extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 6d435671c79..b1c42a70ab2 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -100,7 +100,7 @@ class ConferenceOrBooth extends ActionComm // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'id' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'csslist' => 'left', 'comment' => "Id"), diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index ccdb2ade31a..77357da66d6 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -92,7 +92,7 @@ class ConferenceOrBoothAttendee extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index b46fd85ccfd..a68cc64de77 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -86,7 +86,7 @@ class Expedition extends CommonObject /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array(); diff --git a/htdocs/expensereport/class/expensereport_ik.class.php b/htdocs/expensereport/class/expensereport_ik.class.php index de6296fe230..42e8c4abd46 100644 --- a/htdocs/expensereport/class/expensereport_ik.class.php +++ b/htdocs/expensereport/class/expensereport_ik.class.php @@ -73,7 +73,7 @@ class ExpenseReportIk extends CommonObject /** * Attribute object linked with database - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'index' => 1, 'visible' => -1, 'position' => 10), diff --git a/htdocs/expensereport/class/expensereport_rule.class.php b/htdocs/expensereport/class/expensereport_rule.class.php index c84d4b55d93..6995ed3d609 100644 --- a/htdocs/expensereport/class/expensereport_rule.class.php +++ b/htdocs/expensereport/class/expensereport_rule.class.php @@ -110,7 +110,7 @@ class ExpenseReportRule extends CommonObject /** * Attribute object linked with database - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'index' => 1, 'label' => 'ID', 'enabled' => 1, 'visible' => -1, 'position' => 10), diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 89cf0c3acb3..bbbfed11139 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -263,7 +263,7 @@ class FactureFournisseurRec extends CommonInvoice // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 51b0c78ed3a..a8f0abe070f 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -92,7 +92,7 @@ class Evaluation extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 17b98170904..10e55284fba 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -101,7 +101,7 @@ class EvaluationLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 1377ad1db43..a98c9fd4d85 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -90,7 +90,7 @@ class Job extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index 09099e9a1fd..d148f0fa403 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -89,7 +89,7 @@ class Position extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 2, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index 9c8239465aa..57c198c9e3a 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -95,7 +95,7 @@ class Skill extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index cc0d8d1faa5..c5d9f1dc155 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -99,7 +99,7 @@ class Skilldet extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index 06cefd85cc1..34fb53116c6 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -93,7 +93,7 @@ class SkillRank extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 5bc4c30dfdc..8b8c13051aa 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -101,7 +101,7 @@ class IntracommReport extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array of properties of field to show + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array of properties of field to show */ public $fields = array( "rowid" => array("type" => "integer", "label" => "TechnicalID", "enabled" => 1, 'position' => 10, 'notnull' => 1, "visible" => "0",), diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index f2eb7fb8fe4..8e6b6eaf3fb 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -88,7 +88,7 @@ class KnowledgeRecord extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index c9a54f04c89..a70b5ddd1d2 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -82,7 +82,7 @@ class Mo extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => "Id",), diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 3d8135fa900..67a8cee2e0d 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -101,7 +101,7 @@ class Opensurveysondage extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'id_sondage' => array('type' => 'varchar(16)', 'label' => 'Idsondage', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 86d0cb5700a..0f05deb89fe 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -99,7 +99,7 @@ class Partnership extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb42e09c7d0..df26c3c57d1 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -850,7 +850,7 @@ class Product extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 4e3a7bcc92f..ccd7510b6de 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -32,7 +32,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php'; class ProductCustomerPrice extends CommonObject { /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'ref' => array('type' => 'varchar(128)', 'label' => 'Ref', 'enabled' => 1, 'visible' => 4, 'position' => 10, 'notnull' => 1, 'default' => '(PROV)', 'index' => 1, 'searchall' => 1, 'comment' => "Reference of object", 'showoncombobox' => 1, 'noteditable' => 1), diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index d6421263010..5f8372f6c83 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -81,7 +81,7 @@ class ProductFournisseurPrice extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => '1', 'position' => 10, 'notnull' => 1, 'visible' => 0,), diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 6add004e188..0dc3ca67847 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -86,7 +86,7 @@ class Inventory extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), @@ -837,7 +837,7 @@ class InventoryLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'visible' => -1, 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'index' => 1, 'comment' => 'Id',), diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 76ddc84ecfb..a64de5937ff 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -158,7 +158,7 @@ class Entrepot extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 1c7d90d763c..5eadd6ebbcf 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -144,7 +144,7 @@ class Productlot extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index 0c7a35b4251..1f563ae5fde 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -140,7 +140,7 @@ class StockTransfer extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php index 841fbdeb54f..f4bc5fa55c7 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransferline.class.php @@ -82,7 +82,7 @@ class StockTransferLine extends CommonObjectLine // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 5114564141b..76cdb08ea99 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -339,7 +339,7 @@ class Project extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'ID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 45a3c3a827b..724fffc30e4 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -97,7 +97,7 @@ class RecruitmentCandidature extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index 67b04b6c05b..e9b353ba8e4 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -102,7 +102,7 @@ class RecruitmentJobPosition extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'comment' => "Id"), diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 1097eb06f6d..1c2f47190a1 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -155,7 +155,7 @@ class PaymentSalary extends CommonObject public $datev = ''; /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 7847255fe64..bfdbf8c7920 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -86,7 +86,7 @@ class CompanyBankAccount extends Account // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 10, 'notnull' => 1, 'visible' => -1,), diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 107ee3af714..69701cab92c 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -72,7 +72,7 @@ class CompanyPaymentMode extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'Rowid', 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 4d35651b3b2..46f613dd151 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -174,7 +174,7 @@ class Societe extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -2, 'noteditable' => 1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id', 'css' => 'left'), diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index d34b0a2187e..ae86cfe6df9 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -87,7 +87,7 @@ class CTicketCategory extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 10), diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 07554b580d3..53198494d2a 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -97,7 +97,7 @@ class ProductAttribute extends CommonObject * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/variants/class/ProductAttributeValue.class.php b/htdocs/variants/class/ProductAttributeValue.class.php index c84fbb7d6ed..158d00758e9 100644 --- a/htdocs/variants/class/ProductAttributeValue.class.php +++ b/htdocs/variants/class/ProductAttributeValue.class.php @@ -66,7 +66,7 @@ class ProductAttributeValue extends CommonObjectLine * Note: To have value dynamic, you can set value to 0 in definition and edit the value on the fly into the constructor. */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index d15e25d5457..64eb5066614 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -90,7 +90,7 @@ class Target extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/webportal/class/webportalinvoice.class.php b/htdocs/webportal/class/webportalinvoice.class.php index be5c6e808c2..c7112e9aa6b 100644 --- a/htdocs/webportal/class/webportalinvoice.class.php +++ b/htdocs/webportal/class/webportalinvoice.class.php @@ -93,7 +93,7 @@ class WebPortalInvoice extends Facture // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 1,), diff --git a/htdocs/webportal/class/webportalmember.class.php b/htdocs/webportal/class/webportalmember.class.php index 7d50d3ec397..e44a633319a 100644 --- a/htdocs/webportal/class/webportalmember.class.php +++ b/htdocs/webportal/class/webportalmember.class.php @@ -109,7 +109,7 @@ class WebPortalMember extends Adherent // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10,), diff --git a/htdocs/webportal/class/webportalorder.class.php b/htdocs/webportal/class/webportalorder.class.php index 48ac04bbf73..5e7079a69a3 100644 --- a/htdocs/webportal/class/webportalorder.class.php +++ b/htdocs/webportal/class/webportalorder.class.php @@ -94,7 +94,7 @@ class WebPortalOrder extends Commande // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => 0, 'notnull' => 1, 'position' => 10,), diff --git a/htdocs/webportal/class/webportalpartnership.class.php b/htdocs/webportal/class/webportalpartnership.class.php index 4c8c9f44dbb..d91c64c818e 100644 --- a/htdocs/webportal/class/webportalpartnership.class.php +++ b/htdocs/webportal/class/webportalpartnership.class.php @@ -93,7 +93,7 @@ class WebPortalPartnership extends Partnership // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id",), diff --git a/htdocs/webportal/class/webportalpropal.class.php b/htdocs/webportal/class/webportalpropal.class.php index 3cff9e7c028..60bae2ebd39 100644 --- a/htdocs/webportal/class/webportalpropal.class.php +++ b/htdocs/webportal/class/webportalpropal.class.php @@ -94,7 +94,7 @@ class WebPortalPropal extends Propal // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id",), diff --git a/htdocs/website/class/websitepage.class.php b/htdocs/website/class/websitepage.class.php index b2ce563d33a..5df3a715b33 100644 --- a/htdocs/website/class/websitepage.class.php +++ b/htdocs/website/class/websitepage.class.php @@ -198,7 +198,7 @@ class WebsitePage extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'index' => 1, 'position' => 1, 'comment' => 'Id'), diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index a4e9c3157cd..5b41ab79677 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -96,7 +96,7 @@ class Workstation extends CommonObject // BEGIN MODULEBUILDER PROPERTIES /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array('type' => 'integer', 'label' => 'TechnicalID', 'enabled' => 1, 'position' => 1, 'notnull' => 1, 'visible' => 0, 'noteditable' => 1, 'index' => 1, 'css' => 'left', 'comment' => "Id"), diff --git a/htdocs/workstation/class/workstationresource.class.php b/htdocs/workstation/class/workstationresource.class.php index 78115ea8da0..36d3638e971 100644 --- a/htdocs/workstation/class/workstationresource.class.php +++ b/htdocs/workstation/class/workstationresource.class.php @@ -37,7 +37,7 @@ class WorkstationResource extends CommonObject public $element = 'workstationresource'; /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'fk_workstation' => array('type' => 'integer', 'label' => 'Workstation', 'enabled' => 1, 'position' => 10, 'visible' => 1), diff --git a/htdocs/workstation/class/workstationusergroup.class.php b/htdocs/workstation/class/workstationusergroup.class.php index ce1f3bea2b8..0f623d57564 100644 --- a/htdocs/workstation/class/workstationusergroup.class.php +++ b/htdocs/workstation/class/workstationusergroup.class.php @@ -36,7 +36,7 @@ class WorkstationUserGroup extends CommonObject public $element = 'workstationusergroup'; /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'fk_workstation' => array('type' => 'integer', 'label' => 'Workstation', 'enabled' => 1, 'position' => 10, 'visible' => 1), diff --git a/htdocs/zapier/class/hook.class.php b/htdocs/zapier/class/hook.class.php index cab56314ff3..a6cae084088 100644 --- a/htdocs/zapier/class/hook.class.php +++ b/htdocs/zapier/class/hook.class.php @@ -72,7 +72,7 @@ class Hook extends CommonObject */ /** - * @var array|string,position:int,notnull?:int,visible:int<-5,5>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. + * @var array|string,position:int,notnull?:int,visible:int<-6,6>|string,alwayseditable?:int<0,1>,noteditable?:int<0,1>,default?:string,index?:int,foreignkey?:string,searchall?:int<0,1>,isameasure?:int<0,1>,css?:string,csslist?:string,help?:string,showoncombobox?:int<0,4>,disabled?:int<0,1>,arrayofkeyval?:array,autofocusoncreate?:int<0,1>,comment?:string,copytoclipboard?:int<1,2>,validate?:int<0,1>,showonheader?:int<0,1>}> Array with all fields and their property. Do not use it as a static var. It may be modified by constructor. */ public $fields = array( 'rowid' => array( From 24fa28dfe2b17a0f0fc28f4a6554610cd156e455 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 3 Feb 2025 11:24:16 +0100 Subject: [PATCH 153/375] Qual: Fix getKanban phpdoc # Qual: Fix getKanban phpdoc Array phpdoc for getKanban corrections. --- dev/tools/phan/baseline.txt | 17 +++-------- htdocs/adherents/class/adherent.class.php | 4 +-- .../adherents/class/adherent_type.class.php | 16 +++++------ htdocs/adherents/class/subscription.class.php | 10 +++---- htdocs/adherents/subscription/list.php | 28 +++++++++---------- htdocs/bookcal/class/availabilities.class.php | 4 +-- htdocs/bookcal/class/calendar.class.php | 6 ++-- htdocs/comm/propal/class/propal.class.php | 2 +- htdocs/compta/bank/class/account.class.php | 4 +-- .../bank/class/paymentvarious.class.php | 4 +-- .../cashcontrol/class/cashcontrol.class.php | 6 ++-- htdocs/compta/facture/class/facture.class.php | 2 +- .../compta/localtax/class/localtax.class.php | 4 +-- .../cheque/class/remisecheque.class.php | 4 +-- .../class/bonprelevement.class.php | 6 ++-- .../sociales/class/chargesociales.class.php | 6 ++-- htdocs/compta/tva/class/tva.class.php | 4 +-- htdocs/contact/class/contact.class.php | 4 +-- htdocs/contrat/class/contrat.class.php | 4 +-- htdocs/core/class/commonorder.class.php | 4 +-- htdocs/don/class/don.class.php | 4 +-- .../class/conferenceorbooth.class.php | 4 +-- htdocs/expedition/class/expedition.class.php | 2 +- .../class/expensereport.class.php | 8 ++++-- .../class/paymentexpensereport.class.php | 4 +-- htdocs/fichinter/class/fichinter.class.php | 4 +-- .../class/fournisseur.commande.class.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 8 +++--- .../class/intracommreport.class.php | 4 +-- .../class/knowledgerecord.class.php | 4 +-- htdocs/loan/class/loan.class.php | 4 +-- .../template/class/myobject.class.php | 4 +-- htdocs/mrp/class/mo.class.php | 10 +++---- .../partnership/class/partnership.class.php | 8 +++--- htdocs/product/class/product.class.php | 10 +++---- .../inventory/class/inventory.class.php | 8 +++--- htdocs/product/stock/class/entrepot.class.php | 8 +++--- htdocs/projet/class/project.class.php | 14 +++++----- htdocs/projet/class/task.class.php | 8 +++--- htdocs/reception/class/reception.class.php | 8 +++--- .../class/recruitmentcandidature.class.php | 8 +++--- .../class/recruitmentjobposition.class.php | 8 +++--- htdocs/salaries/class/paymentsalary.class.php | 8 +++--- htdocs/salaries/class/salary.class.php | 8 +++--- .../class/supplier_proposal.class.php | 8 +++--- htdocs/ticket/class/ticket.class.php | 9 +++--- htdocs/user/class/user.class.php | 8 +++--- htdocs/user/class/usergroup.class.php | 8 +++--- .../variants/class/ProductAttribute.class.php | 4 +-- .../class/webportalinvoice.class.php | 8 +++--- .../webportal/class/webportalorder.class.php | 4 +-- .../webportal/class/webportalpropal.class.php | 8 +++--- .../workstation/class/workstation.class.php | 8 +++--- 53 files changed, 178 insertions(+), 184 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index efc4c42240a..856529688c3 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,7 +9,7 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 3730+ occurrences + // PhanTypeMismatchArgument : 3680+ occurrences // PhanUndeclaredProperty : 540+ occurrences // PhanTypeMismatchArgumentNullable : 450+ occurrences // PhanUndeclaredGlobalVariable : 190+ occurrences @@ -88,11 +88,9 @@ return [ 'htdocs/adherents/class/adherent.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/adherents/class/adherent_type.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/adherents/class/api_members.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/adherents/class/subscription.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/adherents/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], 'htdocs/adherents/stats/geo.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/adherents/subscription.php' => ['PhanTypeMismatchArgument'], - 'htdocs/adherents/subscription/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/adherents/type.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], 'htdocs/adherents/vcard.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/agenda_other.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], @@ -288,7 +286,7 @@ return [ 'htdocs/compta/localtax/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/localtax/clients.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument'], 'htdocs/compta/localtax/index.php' => ['PhanTypeMismatchArgument'], - 'htdocs/compta/localtax/list.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/localtax/list.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/paiement.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetch'], 'htdocs/compta/paiement/card.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/compta/paiement/cheque/card.php' => ['PhanTypeMismatchArgument'], @@ -303,8 +301,6 @@ return [ 'htdocs/compta/prelevement/create.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/prelevement/demandes.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/compta/prelevement/line.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/compta/prelevement/list.php' => ['PhanTypeMismatchArgument'], - 'htdocs/compta/prelevement/orders_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/resultat/clientfourn.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/resultat/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/resultat/projects.php' => ['PhanTypeMismatchArgument'], @@ -558,7 +554,7 @@ return [ 'htdocs/don/class/don.class.php' => ['PhanParamTooMany'], 'htdocs/don/document.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/don/list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], + 'htdocs/don/list.php' => ['PhanTypeMismatchProperty'], 'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchArgument'], @@ -621,10 +617,8 @@ return [ 'htdocs/fourn/class/fournisseur.product.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/fourn/commande/card.php' => ['PhanTypeMismatchDimAssignment', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'], 'htdocs/fourn/commande/dispatch.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/fourn/commande/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/fourn/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/fourn/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'], - 'htdocs/fourn/facture/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/fourn/facture/paiement.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/fourn/facture/rapport.php' => ['PhanTypeMismatchArgument'], 'htdocs/fourn/facture/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], @@ -666,7 +660,6 @@ return [ 'htdocs/loan/class/loan.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/loan/document.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/loan/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/loan/note.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/loan/schedule.php' => ['PhanTypeMismatchArgument'], @@ -882,9 +875,8 @@ return [ 'htdocs/salaries/class/salary.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/salaries/document.php' => ['PhanTypeMismatchArgument'], 'htdocs/salaries/info.php' => ['PhanTypeMismatchArgument'], - 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'], + 'htdocs/salaries/list.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/salaries/paiement_salary.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], - 'htdocs/salaries/payments.php' => ['PhanTypeMismatchArgument'], 'htdocs/salaries/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/salaries/virement_request.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/societe/admin/societe.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredMethod'], @@ -960,7 +952,6 @@ return [ 'htdocs/user/class/usergroup.class.php' => ['PhanUndeclaredProperty'], 'htdocs/user/document.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/user/group/card.php' => ['PhanTypeMismatchArgument'], - 'htdocs/user/group/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/user/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/user/param_ihm.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/user/virtualcard.php' => ['PhanTypeMismatchArgument'], diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index a21165c42dd..bcd8753aa95 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Philippe Grand - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -3344,7 +3344,7 @@ class Adherent extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 1af9ebd608d..7c431a82063 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2018-2019 Thibault Foucart * Copyright (C) 2021 Waël Almoman * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -299,12 +299,12 @@ class AdherentType extends CommonObject } /** - * Delete a language for this member type - * - * @param string $langtodelete Language code to delete - * @param User $user Object user making delete - * @return int Return integer <0 if KO, >0 if OK - */ + * Delete a language for this member type + * + * @param string $langtodelete Language code to delete + * @param User $user Object user making delete + * @return int Return integer <0 if KO, >0 if OK + */ public function delMultiLangs($langtodelete, $user) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type_lang"; @@ -1001,7 +1001,7 @@ class AdherentType extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/adherents/class/subscription.class.php b/htdocs/adherents/class/subscription.class.php index a9b1ef730ca..c021e335604 100644 --- a/htdocs/adherents/class/subscription.class.php +++ b/htdocs/adherents/class/subscription.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2006-2015 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -166,7 +166,7 @@ class Subscription extends CommonObject } $sql = "INSERT INTO ".MAIN_DB_PREFIX."subscription (fk_adherent, fk_type, datec, dateadh, datef, subscription, note, fk_user_creat)"; - $sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',"; + $sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape((string) $type)."', '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($this->dateh)."',"; $sql .= " '".$this->db->idate($this->datef)."',"; $sql .= " ".((float) $this->amount).","; @@ -543,9 +543,9 @@ class Subscription extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{selected:?int,member:?Adherent,bank:?Account} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array{selected?:int|bool,adherent_type?:AdherentType,member?:Adherent,bank?:Account} $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index c34a84824cc..a038e3b11f8 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -3,7 +3,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2023 Laurent Destailleur * Copyright (C) 2024 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -102,20 +102,20 @@ $fieldstosearchall = array( 'c.note' => "Label", ); $arrayfields = array( - 'd.ref' => array('label' => "Ref", 'checked' => 1), - 'd.fk_type' => array('label' => "Type", 'checked' => 1), - 'd.lastname' => array('label' => "Lastname", 'checked' => 1), - 'd.firstname' => array('label' => "Firstname", 'checked' => 1), - 'd.login' => array('label' => "Login", 'checked' => 1), - 'c.note' => array('label' => "Label", 'checked' => 1), - 'd.bank' => array('label' => "BankAccount", 'checked' => 1, 'enabled' => (isModEnabled('bank'))), + 'd.ref' => array('label' => "Ref", 'checked' => '1'), + 'd.fk_type' => array('label' => "Type", 'checked' => '1'), + 'd.lastname' => array('label' => "Lastname", 'checked' => '1'), + 'd.firstname' => array('label' => "Firstname", 'checked' => '1'), + 'd.login' => array('label' => "Login", 'checked' => '1'), + 'c.note' => array('label' => "Label", 'checked' => '1'), + 'd.bank' => array('label' => "BankAccount", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled('bank'))), /*'d.note_public'=>array('label'=>"NotePublic", 'checked'=>0), 'd.note_private'=>array('label'=>"NotePrivate", 'checked'=>0),*/ - 'c.dateadh' => array('label' => "DateSubscription", 'checked' => 1, 'position' => 100), - 'c.datef' => array('label' => "EndSubscription", 'checked' => 1, 'position' => 101), - 'd.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 102), - 'c.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), - 'c.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 500), + 'c.dateadh' => array('label' => "DateSubscription", 'checked' => '1', 'position' => 100), + 'c.datef' => array('label' => "EndSubscription", 'checked' => '1', 'position' => 101), + 'd.amount' => array('label' => "Amount", 'checked' => '1', 'position' => 102), + 'c.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500), + 'c.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 500), // 'd.statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) ); @@ -223,7 +223,7 @@ if ($search_ref) { } } if ($search_type > 0) { - $sql .= natural_search(array('c.fk_type'), $search_type); + $sql .= natural_search(array('c.fk_type'), (string) $search_type); } if ($search_lastname) { $sql .= natural_search(array('d.lastname', 'd.societe'), $search_lastname); diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 4dd000ab3d7..ce329cc9620 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2022 Alice Adminson * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -831,7 +831,7 @@ class Availabilities extends CommonObject * Return a thumb for kanban views * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 1271b8ec8ac..a6f76aafb1d 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2023 Alice Adminson - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -816,8 +816,8 @@ class Calendar extends CommonObject /** * Return a thumb for kanban views * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 7aa4d215061..5f3e292e106 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -4014,7 +4014,7 @@ class Propal extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index d5a7e828953..050e4267f95 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -10,7 +10,7 @@ * Copyright (C) 2016 Ferran Marcet * Copyright (C) 2019 JC Prieto * Copyright (C) 2022-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -2016,7 +2016,7 @@ class Account extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index 0c8d7c0ac9b..d46e5bd90dd 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -825,7 +825,7 @@ class PaymentVarious extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/cashcontrol/class/cashcontrol.class.php b/htdocs/compta/cashcontrol/class/cashcontrol.class.php index 755c2f711eb..1449d27ffa6 100644 --- a/htdocs/compta/cashcontrol/class/cashcontrol.class.php +++ b/htdocs/compta/cashcontrol/class/cashcontrol.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2009 Regis Houssin * Copyright (C) 2016 Marcos García * Copyright (C) 2018 Andreu Bisquerra - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -160,7 +160,7 @@ class CashControl extends CommonObject public $fk_user_creat; /** - * @var int|'' $date_valid + * @var int|'' */ public $date_valid; @@ -502,7 +502,7 @@ class CashControl extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 3d95be49f56..f9064e51b20 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -6109,7 +6109,7 @@ class Facture extends CommonInvoice * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/localtax/class/localtax.class.php b/htdocs/compta/localtax/class/localtax.class.php index 398c7f443cc..b7725e4f736 100644 --- a/htdocs/compta/localtax/class/localtax.class.php +++ b/htdocs/compta/localtax/class/localtax.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -671,7 +671,7 @@ class Localtax extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php index ddce090b667..33a10159f33 100644 --- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php +++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2016 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1031,7 +1031,7 @@ class RemiseCheque extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 593e4cddf29..861948151d6 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2014-2016 Ferran Marcet * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 JC Prieto - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -252,7 +252,7 @@ class BonPrelevement extends CommonObject */ public $date_trans; /** - * @var int Current transport method, index to $methodes_trans + * @var int Current transport method, index to `$methodes_trans` */ public $method_trans; /** @@ -2912,7 +2912,7 @@ class BonPrelevement extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param ?array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php index 97ac741e52e..35a1535e232 100644 --- a/htdocs/compta/sociales/class/chargesociales.class.php +++ b/htdocs/compta/sociales/class/chargesociales.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2017 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -62,7 +62,7 @@ class ChargeSociales extends CommonObject protected $table_ref_field = 'ref'; /** - * @var int|string $date_ech + * @var int|string */ public $date_ech; @@ -820,7 +820,7 @@ class ChargeSociales extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/compta/tva/class/tva.class.php b/htdocs/compta/tva/class/tva.class.php index 1222d7c1472..3079b6225de 100644 --- a/htdocs/compta/tva/class/tva.class.php +++ b/htdocs/compta/tva/class/tva.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2018 Philippe Grand * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -935,7 +935,7 @@ class Tva extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index e785fc0a520..2dbc8c53381 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2019 Nicolas ZABOURI * Copyright (C) 2020 Open-Dsi * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -2248,7 +2248,7 @@ class Contact extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index a50e16dca9e..f1ea95f0024 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2015-2018 Ferran Marcet * Copyright (C) 2024 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -2921,7 +2921,7 @@ class Contrat extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/core/class/commonorder.class.php b/htdocs/core/class/commonorder.class.php index 5fbf92c7446..9ab9401c570 100644 --- a/htdocs/core/class/commonorder.class.php +++ b/htdocs/core/class/commonorder.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -39,7 +39,7 @@ abstract class CommonOrder extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index da8bc1d2cf0..c1f3065035e 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2019 Thibault FOUCART * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2021 Maxime DEMAREST - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1170,7 +1170,7 @@ class Don extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index b1c42a70ab2..6b725881c59 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -723,7 +723,7 @@ class ConferenceOrBooth extends ActionComm * Return a thumb for kanban views * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index a68cc64de77..49dc4843f56 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -2089,7 +2089,7 @@ class Expedition extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index 0ce56691fcb..2eacf539c4e 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (c) 2018-2024 Frédéric France * Copyright (C) 2016-2020 Ferran Marcet - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -2827,13 +2827,17 @@ class ExpenseReport extends CommonObject * Return clickable link of object (with optional picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { global $langs; + if ($arraydata === null) { + $arraydata = array(); + } + $selected = (empty($arraydata['selected']) ? 0 : $arraydata['selected']); $return = '
'; diff --git a/htdocs/expensereport/class/paymentexpensereport.class.php b/htdocs/expensereport/class/paymentexpensereport.class.php index d8ecfc9962f..c0d0d5d09e5 100644 --- a/htdocs/expensereport/class/paymentexpensereport.class.php +++ b/htdocs/expensereport/class/paymentexpensereport.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015-2017 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -746,7 +746,7 @@ class PaymentExpenseReport extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index edb30a045ca..e5830ddf88a 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023-2024 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1598,7 +1598,7 @@ class Fichinter extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 84e30e0ad86..837a21b9bb2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -3801,7 +3801,7 @@ class CommandeFournisseur extends CommonOrder * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 88331cf8bbd..1f6bce675e2 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -15,7 +15,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -3359,9 +3359,9 @@ class FactureFournisseur extends CommonInvoice /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param ?array{selected?:int<0,1>} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 8b8c13051aa..3b18fb2bec1 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2015 ATM Consulting * Copyright (C) 2019-2020 Open-DSI * Copyright (C) 2020-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -783,7 +783,7 @@ class IntracommReport extends CommonObject * Return a thumb for kanban views * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 8e6b6eaf3fb..4c233a053e7 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1169,7 +1169,7 @@ class KnowledgeRecord extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index abcfd857a84..e92cf3863bb 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2015-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -767,7 +767,7 @@ class Loan extends CommonObject * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index af3070b6526..ceefd2998b0 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -181,7 +181,7 @@ class MyObject extends CommonObject public $fk_user_modif; /** - * @var string public $last_main_doc + * @var string public */ public $last_main_doc; @@ -908,7 +908,7 @@ class MyObject extends CommonObject * Return a thumb for kanban views * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param ?array $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index a70b5ddd1d2..afbd022789f 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2020 Lenin Rivas * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -266,7 +266,7 @@ class Mo extends CommonObject public $fk_parent_line; /** - @ var array{id:int,label:string,qty_bom:int|float,stock:float,seuil_stock_alerte:float,virtual_stock:float,qty:float,fk_unit:int,qty_frozen:float,disable_stock_change:int<0,1>,efficiency:float} tpl + * @ var array{id:int,label:string,qty_bom:int|float,stock:float,seuil_stock_alerte:float,virtual_stock:float,qty:float,fk_unit:int,qty_frozen:float,disable_stock_change:int<0,1>,efficiency:float} tpl */ public $tpl = array(); @@ -1981,9 +1981,9 @@ class Mo extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param ?array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 0f05deb89fe..6593b6e40b2 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2021 NextGestion * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1388,9 +1388,9 @@ class Partnership extends CommonObject /** * Return a thumb for kanban views * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index df26c3c57d1..807acd3ce95 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -16,7 +16,7 @@ * Copyright (C) 2017 Gustavo Novaro * Copyright (C) 2019-2025 Frédéric France * Copyright (C) 2023 Benjamin Falière - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -379,7 +379,7 @@ class Product extends CommonObject public $seuil_stock_alerte = 0; /** - * @var float Ask for replenishment when $desiredstock < $stock_reel + * @var float Ask for replenishment when `$desiredstock` < `$stock_reel` */ public $desiredstock = 0; @@ -6437,7 +6437,7 @@ class Product extends CommonObject * Move an uploaded file described into $file array into target directory $sdir. * * @param string $sdir Target directory - + * * @param array{name:string,tmp_name:string} $file Array of file info of file to upload: array('name'=>..., 'tmp_name'=>...) * @return int Return integer <0 if KO, >0 if OK */ @@ -7050,8 +7050,8 @@ class Product extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param ?array{string,mixed} $arraydata Array of data + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 0dc3ca67847..2e517001469 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -678,9 +678,9 @@ class Inventory extends CommonObject /** * Return a thumb for kanban views * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index a64de5937ff..ebe21bdc622 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2016 Francis Appels * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1038,9 +1038,9 @@ class Entrepot extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 76cdb08ea99..fa22c00d98b 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -9,7 +9,7 @@ * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -176,8 +176,8 @@ class Project extends CommonObject public $usage_bill_time; // Is the time spent on project must be invoiced or not /** - * @var integer Event organization: Use Event Organization - */ + * @var integer Event organization: Use Event Organization + */ public $usage_organize_event; /** @@ -2515,10 +2515,10 @@ class Project extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @param string $size Size of thumb (''=auto, 'large'=large, 'small'=small) - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @param string $size Size of thumb (''=auto, 'large'=large, 'small'=small) + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null, $size = '') { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 2c9620f0886..ba6f4f83ca5 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2020 Juanjo Menent * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Vincent de Grandpré * * This program is free software; you can redistribute it and/or modify @@ -2729,9 +2729,9 @@ class Task extends CommonObjectLine /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 55072848b4a..1516689de63 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Quentin Vial-Gouteyron * Copyright (C) 2022-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1447,9 +1447,9 @@ class Reception extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index 724fffc30e4..3db699c6d45 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1112,9 +1112,9 @@ class RecruitmentCandidature extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index e9b353ba8e4..6beb6c590bf 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2020 Laurent Destailleur /* Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1151,9 +1151,9 @@ class RecruitmentJobPosition extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 1c2f47190a1..b83a5331aa3 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -989,9 +989,9 @@ class PaymentSalary extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index da4fed65b02..c0fcd932e7c 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -856,9 +856,9 @@ class Salary extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 09474546f81..e33cdc6c377 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -16,7 +16,7 @@ * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2020 Tobias Sekan * Copyright (C) 2022 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -2799,9 +2799,9 @@ class SupplierProposal extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 52b3d99467e..35bf143e0fe 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2023 Charlene Benke * Copyright (C) 2023-2024 Benjamin Falière * Copyright (C) 2024 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -465,7 +465,6 @@ class Ticket extends CommonObject } /** - * * Check if ref exists or not * * @param string $action Action @@ -3260,9 +3259,9 @@ class Ticket extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 549bbb4454d..3c46fd80675 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -14,7 +14,7 @@ * Copyright (C) 2018-2021 Nicolas ZABOURI * Copyright (C) 2019-2024 Frédéric France * Copyright (C) 2019 Abbes Bahfir - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Lenin Rivas * * This program is free software; you can redistribute it and/or modify @@ -3345,9 +3345,9 @@ class User extends CommonObject /** * Return clickable link of object (optionally with picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 81b9945e780..04f014d7133 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2018 Nicolas ZABOURI * Copyright (C) 2019 Abbes Bahfir * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1039,9 +1039,9 @@ class UserGroup extends CommonObject /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 53198494d2a..2a6fd052745 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2016 Marcos García * Copyright (C) 2022 Open-Dsi * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -1237,7 +1237,7 @@ class ProductAttribute extends CommonObject * Return a thumb for kanban views * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param ?array $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/webportal/class/webportalinvoice.class.php b/htdocs/webportal/class/webportalinvoice.class.php index c7112e9aa6b..edbfa2040a3 100644 --- a/htdocs/webportal/class/webportalinvoice.class.php +++ b/htdocs/webportal/class/webportalinvoice.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2023-2024 Lionel Vessiller - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -270,9 +270,9 @@ class WebPortalInvoice extends Facture /** * Return clickable link of object (with eventually picto) * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/webportal/class/webportalorder.class.php b/htdocs/webportal/class/webportalorder.class.php index 5e7079a69a3..1cbf082dccb 100644 --- a/htdocs/webportal/class/webportalorder.class.php +++ b/htdocs/webportal/class/webportalorder.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2023-2024 Lionel Vessiller - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -264,7 +264,7 @@ class WebPortalOrder extends Commande * Return clickable link of object (with eventually picto) * * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data + * @param ?array $arraydata Array of data * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) diff --git a/htdocs/webportal/class/webportalpropal.class.php b/htdocs/webportal/class/webportalpropal.class.php index 60bae2ebd39..838080a666c 100644 --- a/htdocs/webportal/class/webportalpropal.class.php +++ b/htdocs/webportal/class/webportalpropal.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2023-2024 Lionel Vessiller - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -256,9 +256,9 @@ class WebPortalPropal extends Propal /** * Return a thumb for kanban views * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 5b41ab79677..8478f75527e 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2020 Gauthier VERDOL * Copyright (C) 2023-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -727,9 +727,9 @@ class Workstation extends CommonObject /** * Return a thumb for kanban views * - * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) - * @param array{string,mixed} $arraydata Array of data - * @return string HTML Code for Kanban thumb. + * @param string $option Where point the link (0=> main card, 1,2 => shipment, 'nolink'=>No link) + * @param ?array $arraydata Array of data + * @return string HTML Code for Kanban thumb. */ public function getKanbanView($option = '', $arraydata = null) { From aa521a46d22980ada967df15f45e597f67671ae1 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 3 Feb 2025 13:37:43 +0100 Subject: [PATCH 154/375] Qual: Fix phan notices (import) --- .../class/accountancyimport.class.php | 4 +- htdocs/core/modules/import/modules_import.php | 72 ++++++++++++++++++- htdocs/imports/class/import.class.php | 14 ++-- htdocs/imports/emptyexample.php | 9 +-- htdocs/imports/import.php | 7 +- 5 files changed, 88 insertions(+), 18 deletions(-) diff --git a/htdocs/accountancy/class/accountancyimport.class.php b/htdocs/accountancy/class/accountancyimport.class.php index a35235e0218..11c9f9c82d4 100644 --- a/htdocs/accountancy/class/accountancyimport.class.php +++ b/htdocs/accountancy/class/accountancyimport.class.php @@ -11,7 +11,7 @@ * Copyright (C) 2017-2024 Frédéric France * Copyright (C) 2017 André Schild * Copyright (C) 2020 Guillaume Alexandre - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -109,7 +109,7 @@ class AccountancyImport $amount = (float) price2num($arrayrecord[$credit_index]['val']); } - return "'" . $this->db->escape(abs($amount)) . "'"; + return "'" . $this->db->escape((string) abs($amount)) . "'"; } return "''"; diff --git a/htdocs/core/modules/import/modules_import.php b/htdocs/core/modules/import/modules_import.php index 864338b5bca..ca956a86f87 100644 --- a/htdocs/core/modules/import/modules_import.php +++ b/htdocs/core/modules/import/modules_import.php @@ -1,7 +1,7 @@ * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -490,4 +490,74 @@ class ModeleImports $this->error = $msg; return -1; } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output header of an example file for this format + * + * @param Translate $outputlangs Output language + * @return string Empty string + */ + public function write_header_example($outputlangs) + { + // phpcs:enable + $msg = get_class($this)."::".__FUNCTION__." not implemented"; + dol_syslog($msg, LOG_ERR); + $this->errors[] = $msg; + $this->error = $msg; + return ''; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output title line of an example file for this format + * + * @param Translate $outputlangs Output language + * @param string[] $headerlinefields Array of fields name + * @return string String output + */ + public function write_title_example($outputlangs, $headerlinefields) + { + // phpcs:enable + $msg = get_class($this)."::".__FUNCTION__." not implemented"; + dol_syslog($msg, LOG_ERR); + $this->errors[] = $msg; + $this->error = $msg; + return ''; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output record of an example file for this format + * + * @param Translate $outputlangs Output language + * @param mixed[] $contentlinevalues Array of lines + * @return string Empty string + */ + public function write_record_example($outputlangs, $contentlinevalues) + { + // phpcs:enable + $msg = get_class($this)."::".__FUNCTION__." not implemented"; + dol_syslog($msg, LOG_ERR); + $this->errors[] = $msg; + $this->error = $msg; + return ''; + } + + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Output footer of an example file for this format + * + * @param Translate $outputlangs Output language + * @return string String output + */ + public function write_footer_example($outputlangs) + { + // phpcs:enable + $msg = get_class($this)."::".__FUNCTION__." not implemented"; + dol_syslog($msg, LOG_ERR); + $this->errors[] = $msg; + $this->error = $msg; + return ''; + } } diff --git a/htdocs/imports/class/import.class.php b/htdocs/imports/class/import.class.php index f9156a38115..00923125430 100644 --- a/htdocs/imports/class/import.class.php +++ b/htdocs/imports/class/import.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2020 Ahmad Jamaly Rabib * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -303,11 +303,11 @@ class Import * Build an import example file. * Arrays this->array_export_xxx are already loaded for required datatoexport * - * @param string $model Name of import engine ('csv', ...) - * @param string $headerlinefields Array of values for first line of example file - * @param string $contentlinevalues Array of values for content line of example file - * @param string $datatoimport Dataset to import - * @return string Return integer <0 if KO, >0 if OK + * @param string $model Name of import engine ('csv', ...) + * @param string[] $headerlinefields Array of values for first line of example file + * @param string[] $contentlinevalues Array of values for content line of example file + * @param string $datatoimport Dataset to import + * @return string Return integer <0 if KO, >0 if OK */ public function build_example_file($model, $headerlinefields, $contentlinevalues, $datatoimport) { @@ -324,7 +324,7 @@ class Import $classname = "Import".$model; require_once $dir.$file; $objmodel = new $classname($this->db, $datatoimport); - '@phan-var-force CommonObject $objmodel'; + '@phan-var-force ModeleImports $objmodel'; $outputlangs = $langs; // Lang for output $s = ''; diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index 310f9dd0800..cd05fcfe1ac 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -47,7 +48,7 @@ if (!defined('NOTOKENRENEWAL')) { * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeaderEmptyExample($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { print 'Build an import example file'; } @@ -60,7 +61,7 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooterEmptyExample($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { print ''; } @@ -89,9 +90,9 @@ $langs->load("exports"); if (empty($datatoimport)) { $user->loadRights(); - llxHeader(); + llxHeaderEmptyExample(); print '
Bad value for datatoimport.
'; - llxFooter(); + llxFooterEmptyExample(); exit; } diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index fc0a9ff8750..5ddde8e2465 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2022 Charlene Benke - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -1057,7 +1057,7 @@ if ($step == 4 && $datatoimport) { $s = str_replace('{s1}', img_picto('', 'grip_title', '', 0, 0, 0, '', '', 0), $s); print $s; print ' '; - $htmlother->select_import_model($importmodelid, 'importmodelid', $datatoimport, 1, $user->id); + $htmlother->select_import_model((string) $importmodelid, 'importmodelid', $datatoimport, 1, $user->id); print ''; print '
'; print ''; @@ -1088,8 +1088,7 @@ if ($step == 4 && $datatoimport) { $lefti = 1; foreach ($fieldssource as $key => $val) { - // @phan-suppress-next-line PhanPluginSuspiciousParamPosition - show_elem($fieldssource, $key, $val); // key is field number in source file + show_elem($fieldssource, $key, (string) $key); // key is field number in source file @phan-suppress-current-line PhanPluginSuspiciousParamPosition $listofkeys[$key] = 1; $fieldsplaced[$key] = 1; $valforsourcefieldnb[$lefti] = $key; From 97c2c3aea29fd06f66bc198034246e1b3b243991 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 3 Feb 2025 13:44:10 +0100 Subject: [PATCH 155/375] Qual: Fix phan notices (blockedlog) --- htdocs/blockedlog/admin/blockedlog_list.php | 8 ++++---- htdocs/blockedlog/class/blockedlog.class.php | 18 +++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/blockedlog/admin/blockedlog_list.php b/htdocs/blockedlog/admin/blockedlog_list.php index 01cb2c58f1c..35f7934add0 100644 --- a/htdocs/blockedlog/admin/blockedlog_list.php +++ b/htdocs/blockedlog/admin/blockedlog_list.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 ATM Consulting * Copyright (C) 2017-2018 Laurent Destailleur * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -353,7 +353,7 @@ $help_url = "EN:Module_Unalterable_Archives_-_Logs|FR:Module_Archives_-_Logs_Ina llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-blockedlog page-admin_blockedlog_list'); -$blocks = $block_static->getLog('all', $search_id, $MAXLINES, $sortfield, $sortorder, $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); +$blocks = $block_static->getLog('all', (int) $search_id, $MAXLINES, $sortfield, $sortorder, (int) $search_fk_user, $search_start, $search_end, $search_ref, $search_amount, $search_code); if (!is_array($blocks)) { if ($blocks == -2) { setEventMessages($langs->trans("TooManyRecordToScanRestrictFilters", $MAXLINES), null, 'errors'); @@ -440,7 +440,7 @@ print ''; print '
'; print $langs->trans("RestrictYearToExport").': '; // Month -print $formother->select_month(GETPOSTINT('monthtoexport'), 'monthtoexport', 1, 0, 'minwidth50 maxwidth75imp valignmiddle', true); +print $formother->select_month((string) GETPOSTINT('monthtoexport'), 'monthtoexport', 1, 0, 'minwidth50 maxwidth75imp valignmiddle', true); print ''; print ''; print ''; @@ -491,7 +491,7 @@ print ''; // User print '
'; // Actions code diff --git a/htdocs/blockedlog/class/blockedlog.class.php b/htdocs/blockedlog/class/blockedlog.class.php index c959800cef7..afe6549c03d 100644 --- a/htdocs/blockedlog/class/blockedlog.class.php +++ b/htdocs/blockedlog/class/blockedlog.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 ATM Consulting * Copyright (C) 2017-2020 Laurent Destailleur * Copyright (C) 2022 charlene benke - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -102,12 +102,12 @@ class BlockedLog public $fk_user = 0; /** - * @var int|string date_creation + * @var int|string */ public $date_creation; /** - * @var int|string $date_modification; + * @var int|string */ public $date_modification; @@ -395,11 +395,11 @@ class BlockedLog /** * Populate properties of log from object data * - * @param CommonObject $object object to store - * @param string $action action - * @param float|int $amounts amounts - * @param ?User $fuser User object (forced) - * @return int<-1,-1>|int<1,1> >0 if OK, <0 if KO + * @param CommonObject|stdClass $object object to store + * @param string $action action + * @param float|int $amounts amounts + * @param ?User $fuser User object (forced) + * @return int<-1,-1>|int<1,1> >0 if OK, <0 if KO */ public function setObjectData(&$object, $action, $amounts, $fuser = null) { @@ -1115,7 +1115,7 @@ class BlockedLog if (empty($previoussignature)) { $sql = "SELECT rowid, signature FROM ".MAIN_DB_PREFIX."blockedlog"; if ($beforeid) { - $sql.= $this->db->hintindex('entity_rowid', 1); + $sql .= $this->db->hintindex('entity_rowid', 1); } $sql .= " WHERE entity = ".((int) $conf->entity); if ($beforeid) { From 97099b854fdf16c5aa971e7fbb9ecaf72b9757a1 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 3 Feb 2025 14:28:54 +0100 Subject: [PATCH 156/375] Qual: Fix phan notices (install) --- htdocs/core/db/Database.interface.php | 4 +-- htdocs/core/db/mysqli.class.php | 4 +-- htdocs/core/db/pgsql.class.php | 4 +-- htdocs/core/db/sqlite3.class.php | 4 +-- htdocs/debugbar/class/TraceableDB.php | 4 +-- htdocs/index.php | 4 +-- htdocs/install/check.php | 7 +++--- htdocs/install/fileconf.php | 35 ++++++++++++++++++++++++++- htdocs/install/inc.php | 7 +++++- htdocs/install/index.php | 3 ++- htdocs/install/repair.php | 9 ++++++- htdocs/install/step1.php | 23 ++++++++++++------ htdocs/install/step2.php | 10 +++++--- htdocs/install/step5.php | 7 ++++++ htdocs/install/upgrade.php | 7 +++--- 15 files changed, 98 insertions(+), 34 deletions(-) diff --git a/htdocs/core/db/Database.interface.php b/htdocs/core/db/Database.interface.php index 60b129b5a08..046f8504722 100644 --- a/htdocs/core/db/Database.interface.php +++ b/htdocs/core/db/Database.interface.php @@ -5,7 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014-2015 Raphaël Doursenaud - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -372,7 +372,7 @@ interface Database * * @param string $table Name of table * @param string $field_name Name of field to add - * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value] + * @param array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int,noteditable?:int,default?:string,extra?:string,null?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value] * @param string $field_position Optional ex .: "after field stuff" * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php index f572225a3ab..160805761bc 100644 --- a/htdocs/core/db/mysqli.class.php +++ b/htdocs/core/db/mysqli.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Charlene Benke * Copyright (C) 2024 Frédéric France * @@ -962,7 +962,7 @@ class DoliDBMysqli extends DoliDB * * @param string $table Name of table * @param string $field_name Name of field to add - * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative table with description of field to insert [parameter name][parameter value] + * @param array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int,noteditable?:int,default?:string,extra?:string,null?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value] * @param string $field_position Optional e.g.: "after some_field" * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 28561f73648..02288a05e21 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -8,7 +8,7 @@ * Copyright (C) 2012 Yann Droneaud * Copyright (C) 2012 Florian Henry * Copyright (C) 2015 Marcos García - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -1194,7 +1194,7 @@ class DoliDBPgsql extends DoliDB * * @param string $table Name of table * @param string $field_name Name of field to add - * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value] + * @param array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int,noteditable?:int,default?:string,extra?:string,null?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value] * @param string $field_position Optionnel ex.: "after champtruc" * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/core/db/sqlite3.class.php b/htdocs/core/db/sqlite3.class.php index 23fa3483e76..e10cda471b0 100644 --- a/htdocs/core/db/sqlite3.class.php +++ b/htdocs/core/db/sqlite3.class.php @@ -939,7 +939,7 @@ class DoliDBSqlite3 extends DoliDB * * @param string $table Name of table * @return array> Table with information of columns in the table - + * * TODO modify for sqlite */ public function DDLInfoTable($table) @@ -1104,7 +1104,7 @@ class DoliDBSqlite3 extends DoliDB * * @param string $table Table name * @param string $field_name Field name to add - * @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative table with description of field to insert [parameter name][parameter value] + * @param array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int,noteditable?:int,default?:string,extra?:string,null?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value] * @param string $field_position Optional e.g.: "after some_field" * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/debugbar/class/TraceableDB.php b/htdocs/debugbar/class/TraceableDB.php index 9211e8e5fae..a7b45a7da6b 100644 --- a/htdocs/debugbar/class/TraceableDB.php +++ b/htdocs/debugbar/class/TraceableDB.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -535,7 +535,7 @@ class TraceableDB extends DoliDB * * @param string $table Name of table * @param string $field_name Name of field to add - * @param array{type:string,label:string,enabled:int|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Tableau associatif de description du champ a inserer[nom du parameter][valeur du parameter] + * @param array{type:string,label?:string,enabled?:int<0,2>|string,position?:int,notnull?:int,visible?:int,noteditable?:int,default?:string,extra?:string,null?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value] * @param string $field_position Optionnel ex.: "after champtruc" * @return int Return integer <0 if KO, >0 if OK */ diff --git a/htdocs/index.php b/htdocs/index.php index 5e2b667dbae..a7b2c9acf5e 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -5,7 +5,7 @@ * Copyright (C) 2011-2012 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2021-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -677,7 +677,7 @@ if (!getDolGlobalString('MAIN_DISABLE_GLOBAL_WORKBOARD') && getDolGlobalInt('MAI } else { $weatherDashBoard .= ' '.$langs->transnoentitiesnoconv( "NActionsLate", - $totalLateNumber + (string) $totalLateNumber ).''."\n"; if ($totallatePercentage > 0) { $weatherDashBoard .= ' '.$langs->trans( diff --git a/htdocs/install/check.php b/htdocs/install/check.php index 2e9e89c8dc9..e60249532db 100644 --- a/htdocs/install/check.php +++ b/htdocs/install/check.php @@ -6,7 +6,7 @@ * Copyright (C) 2013-2014 Juanjo Menent * Copyright (C) 2014 Marcos García * Copyright (C) 2015-2016 Raphaël Doursenaud - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -374,7 +374,7 @@ if (!file_exists($conffile)) { $conf->db->name = $dolibarr_main_db_name; $conf->db->user = $dolibarr_main_db_user; $conf->db->pass = $dolibarr_main_db_pass; - $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int) $conf->db->port); + $db = getDoliDBInstance($conf->db->type, $conf->db->host, (string) $conf->db->user, $conf->db->pass, $conf->db->name, (int) $conf->db->port); if ($db->connected && $db->database_selected) { $ok = true; } @@ -382,6 +382,7 @@ if (!file_exists($conffile)) { } } + $dolibarrlastupgradeversionarray = array(); // If database access is available, we set more variables if ($ok) { if (empty($dolibarr_main_db_encryption)) { @@ -514,7 +515,7 @@ if (!file_exists($conffile)) { } if ($ok) { - if (count($dolibarrlastupgradeversionarray) >= 2) { // If database access is available and last upgrade version is known + if (is_array($dolibarrlastupgradeversionarray) && count($dolibarrlastupgradeversionarray) >= 2) { // If database access is available and last upgrade version is known // Now we check if this is the first qualified choice if ($allowupgrade && empty($foundrecommandedchoice) && (versioncompare($dolibarrversiontoarray, $dolibarrlastupgradeversionarray) > 0 || versioncompare($dolibarrversiontoarray, $versionarray) < -2) diff --git a/htdocs/install/fileconf.php b/htdocs/install/fileconf.php index 5c73f49a6b1..1514f9e7e40 100644 --- a/htdocs/install/fileconf.php +++ b/htdocs/install/fileconf.php @@ -6,7 +6,7 @@ * Copyright (C) 2004 Sebastien DiCintio * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2016 Raphaël Doursenaud - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -42,6 +42,37 @@ include_once 'inc.php'; * @var string $conffile * @var string $conffiletoshow */ +' +@phan-var-force string $dolibarr_main_db_host +@phan-var-force string $dolibarr_main_db_port +@phan-var-force string $dolibarr_main_db_name +@phan-var-force string $dolibarr_main_db_user +@phan-var-force string $dolibarr_main_db_pass +@phan-var-force string $dolibarr_main_db_encrypted_pass +@phan-var-force string $conffile +@phan-var-force string $conffiletoshow +@phan-var-force ?bool $force_install_ +@phan-var-force ?string $force_install_packager +@phan-var-force ?string $force_install_message +@phan-var-force ?string $force_install_main_data_root +@phan-var-force ?int<0,2> $force_install_noedit +@phan-var-force ?string $force_install_type +@phan-var-force ?string $force_install_dbserver +@phan-var-force ?string $force_install_port +@phan-var-force ?string $force_install_database +@phan-var-force ?string $force_install_prefix +@phan-var-force ?string $force_install_createdatabase +@phan-var-force ?string $force_install_databaselogin +@phan-var-force ?string $force_install_databasepass +@phan-var-force ?string $force_install_databaserootlogin +@phan-var-force ?string $force_install_databaserootpass +@phan-var-force ?string $force_install_dolibarrlogin +@phan-var-force ?string $force_install_nophpinfo +@phan-var-force ?string $force_install_lockinstall +@phan-var-force ?string $force_install_distrib +@phan-var-force ?string $db_user_root +@phan-var-force ?string $db_pass_root +'; $err = 0; @@ -339,6 +370,8 @@ if (!empty($force_install_noedit)) { $defaultype = 'mysql'; } + $testclass = ''; + $testfunction = null; // Show line into list if ($type == 'mysql') { $testfunction = 'mysql_connect'; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 3fd55c11bc4..b1c967e790e 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -7,7 +7,7 @@ * Copyright (C) 2016 Raphaël Doursenaud * Copyright (C) 2021 Charlene Benke * Copyright (C) 2023 Alexandre Janniaux - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -48,6 +48,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; +' +@phan-var-force ?string $dolibarr_main_url_root_alt +@phan-var-force ?string $dolibarr_main_db_prefix +'; + $conf = new Conf(); // Force $_REQUEST["logtohtml"] diff --git a/htdocs/install/index.php b/htdocs/install/index.php index d62f82eaa27..c089a90fdf4 100644 --- a/htdocs/install/index.php +++ b/htdocs/install/index.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2005 Rodolphe Quiedeville * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2016 Raphaël Doursenaud + * Copyright (C) 2025 MDW * * 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 @@ -63,7 +64,7 @@ print '
'; -print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth150'); +print $form->select_dolusers($search_fk_user, 'search_fk_user', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth150'); print '
'; print ''; print ''; print ''; diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php index 4df5b65250d..ccf25a7f725 100644 --- a/htdocs/install/repair.php +++ b/htdocs/install/repair.php @@ -5,7 +5,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Vincent de Grandpré * * This program is free software; you can redistribute it and/or modify @@ -43,6 +43,11 @@ if (file_exists($conffile)) { * @var string $dolibarr_main_db_pass */ +' +@phan-var-force ?string $dolibarr_main_db_encryption +@phan-var-force ?string $dolibarr_main_db_cryptkey +'; + require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php'; include_once $dolibarr_main_document_root.'/core/lib/images.lib.php'; require_once $dolibarr_main_document_root.'/core/class/extrafields.class.php'; @@ -858,6 +863,7 @@ if ($ok && GETPOST('clean_orphelin_dir', 'alpha')) { $filearray = dol_dir_list($upload_dir, "files", 1, '', array('^SPECIMEN\.pdf$', '^\.', '(\.meta|_preview.*\.png)$', '^temp$', '^payments$', '^CVS$', '^thumbs$'), '', SORT_DESC, 1, 1); + $object_instance = null; // To show ref or specific information according to view to show (defined by $module) if ($modulepart == 'company') { include_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; @@ -954,6 +960,7 @@ if ($ok && GETPOST('clean_orphelin_dir', 'alpha')) { } } +$methodtofix = ''; // clean_linked_elements: Check and clean linked elements if ($ok && GETPOST('clean_product_stock_batch', 'alpha')) { $methodtofix = GETPOST('methodtofix', 'alpha') ? GETPOST('methodtofix', 'alpha') : 'updatestock'; diff --git a/htdocs/install/step1.php b/htdocs/install/step1.php index 6ec6c03743d..9d1bbe6d463 100644 --- a/htdocs/install/step1.php +++ b/htdocs/install/step1.php @@ -5,7 +5,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2015-2016 Raphaël Doursenaud - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -101,8 +101,9 @@ if (@file_exists($forcedfile)) { $main_data_dir = $argv[4]; // override when executing the script in command line } // In mode 3 the main_url is custom - if ($force_install_noedit != 3) - $main_url = detect_dolibarr_main_url_root(); + if ($force_install_noedit != 3) { + $main_url = detect_dolibarr_main_url_root(); + } if (!empty($argv[5])) { $main_url = $argv[5]; // override when executing the script in command line } @@ -567,14 +568,20 @@ if (!$error && $db->connected && $action == "set") { // Test on permission not r // Check database connection - $db = getDoliDBInstance($conf->db->type, $conf->db->host, $userroot, $passroot, $databasefortest, (int) $conf->db->port); - - if ($db->error) { - print '
'.$db->error.'
'; + $db = null; + if ($databasefortest === null) { + print '
Database name can not be empty
'; $error++; + } else { + $db = getDoliDBInstance($conf->db->type, $conf->db->host, $userroot, $passroot, $databasefortest, (int) $conf->db->port); + + if ($db->error) { + print '
'.$db->error.'
'; + $error++; + } } - if (!$error) { + if (!$error && $db !== null) { if ($db->connected) { $resultbis = 1; diff --git a/htdocs/install/step2.php b/htdocs/install/step2.php index a0b64c28a22..c58c9fe6fc4 100644 --- a/htdocs/install/step2.php +++ b/htdocs/install/step2.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2015 Cedric GROSS * Copyright (C) 2015-2016 Raphaël Doursenaud - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -141,6 +141,7 @@ if ($action == "set") { // Test on permission not required. Already managed by } + $versionarray = array(); // Display version / Affiche version if ($ok) { $version = $db->getVersion(); @@ -166,7 +167,7 @@ if ($action == "set") { // Test on permission not required. Already managed by // To say that SQL we pass to query are already escaped for mysql, so we need to unescape them if (property_exists($db, 'unescapeslashquot')) { - $db->unescapeslashquot = true; + $db->unescapeslashquot = true; // @phan-suppress-current-line PhanUndeclaredProperty } /************************************************************************************** @@ -396,6 +397,7 @@ if ($action == "set") { // Test on permission not required. Already managed by ***************************************************************************************/ if ($ok && $createfunctions) { // For this file, we use a directory according to database type + $dir = null; if ($choix == 1) { $dir = "mysql/functions/"; } elseif ($choix == 2) { @@ -408,11 +410,11 @@ if ($action == "set") { // Test on permission not required. Already managed by // Creation of data $file = "functions.sql"; - if (file_exists($dir.$file)) { + if ($dir !== null && file_exists($dir.$file)) { $fp = fopen($dir.$file, "r"); dolibarr_install_syslog("step2: open function file ".$dir.$file." handle=".(is_bool($fp) ? json_encode($fp) : $fp)); + $buffer = ''; if ($fp) { - $buffer = ''; while (!feof($fp)) { $buf = fgets($fp, 4096); if (substr($buf, 0, 2) != '--') { diff --git a/htdocs/install/step5.php b/htdocs/install/step5.php index 7b410b14656..9d13cd986ad 100644 --- a/htdocs/install/step5.php +++ b/htdocs/install/step5.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Sebastien DiCintio * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015-2016 Raphaël Doursenaud + * Copyright (C) 2025 MDW * * 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 @@ -45,6 +46,12 @@ require_once $dolibarr_main_document_root.'/core/lib/admin.lib.php'; require_once $dolibarr_main_document_root.'/core/lib/security.lib.php'; // for dol_hash require_once $dolibarr_main_document_root.'/core/lib/functions2.lib.php'; +' +@phan-var-force ?string $modulesdir +@phan-var-force ?string $dolibarr_main_db_encryption +@phan-var-force ?string $dolibarr_main_db_cryptkey +'; + global $langs; $versionfrom = GETPOST("versionfrom", 'alpha', 3) ? GETPOST("versionfrom", 'alpha', 3) : (empty($argv[1]) ? '' : $argv[1]); diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 4a09cff906f..8de7713dd32 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2018 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2015-2016 Raphaël Doursenaud - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -180,6 +180,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } // Affiche version + $versionarray = array(); if ($ok) { $version = $db->getVersion(); $versionarray = $db->getVersionArray(); @@ -210,8 +211,8 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ // Test database version is not forbidden for migration if (empty($ignoredbversion)) { $dbversion_disallowed = array( - array('type'=>'mysql', 'version'=>array(5, 5, 40)), - array('type'=>'mysqli', 'version'=>array(5, 5, 40)) //, + array('type' => 'mysql', 'version' => array(5, 5, 40)), + array('type' => 'mysqli', 'version' => array(5, 5, 40)) //, //array('type'=>'mysql','version'=>array(5,5,41)), //array('type'=>'mysqli','version'=>array(5,5,41)) ); From 30c10f54c8451f8ad727c59b18651d2ab814cb96 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 3 Feb 2025 15:17:58 +0100 Subject: [PATCH 157/375] Qual: Update phan baseline --- dev/tools/phan/baseline.txt | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 856529688c3..ca2ed9bfd30 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,21 +9,21 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 3680+ occurrences - // PhanUndeclaredProperty : 540+ occurrences + // PhanTypeMismatchArgument : 3660+ occurrences + // PhanUndeclaredProperty : 530+ occurrences // PhanTypeMismatchArgumentNullable : 450+ occurrences // PhanUndeclaredGlobalVariable : 190+ occurrences // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 180+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 170+ occurrences // PhanTypeMismatchArgumentProbablyReal : 140+ occurrences // PhanTypeMismatchProperty : 130+ occurrences // PhanPluginUnknownArrayMethodParamType : 110+ occurrences - // PhanRedefineFunction : 45+ occurrences - // PhanPluginUndeclaredVariableIsset : 40+ occurrences + // PhanRedefineFunction : 40+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences // PhanTypeInvalidDimOffset : 25+ occurrences - // PhanTypeMismatchArgumentNullableInternal : 20+ occurrences + // PhanPluginUndeclaredVariableIsset : 20+ occurrences // PhanTypeMismatchDimFetch : 20+ occurrences + // PhanTypeMismatchArgumentNullableInternal : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanTypeComparisonFromArray : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences @@ -64,7 +64,6 @@ return [ 'htdocs/accountancy/bookkeeping/listbyaccount.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/accountancy/class/accountancycategory.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/class/accountancyexport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], - 'htdocs/accountancy/class/accountancyimport.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/class/accountingjournal.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/class/bookkeeping.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/accountancy/class/lettering.class.php' => ['PhanTypeMismatchArgument'], @@ -170,7 +169,6 @@ return [ 'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'], 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/blockedlog/admin/blockedlog_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgument'], 'htdocs/bom/class/api_boms.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], @@ -466,7 +464,6 @@ return [ 'htdocs/core/modules/member/modules_cards.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/modAdherent.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/modAgenda.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/modBlockedLog.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/modCommande.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/modContrat.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/modDon.class.php' => ['PhanTypeMismatchArgument'], @@ -635,19 +632,7 @@ return [ 'htdocs/hrm/evaluation_card.php' => ['PhanTypeMismatchArgument'], 'htdocs/hrm/job_card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/imports/emptyexample.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/imports/import.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/index.php' => ['PhanTypeMismatchArgument'], - 'htdocs/install/check.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/install/fileconf.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable'], - 'htdocs/install/inc.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/install/index.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/install/repair.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'], - 'htdocs/install/step1.php' => ['PhanTypeMismatchArgumentNullable'], - 'htdocs/install/step2.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal', 'PhanUndeclaredProperty'], - 'htdocs/install/step5.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/install/upgrade.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/install/upgrade2.php' => ['PhanTypeMismatchArgument'], + 'htdocs/imports/import.php' => ['PhanTypeMismatchArgument'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/intracommreport/class/intracommreport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/intracommreport/list.php' => ['PhanTypeMismatchArgument'], From 6bf8f7674d320857f241a9d6bc46ea4338cfae18 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 3 Feb 2025 23:46:14 +0100 Subject: [PATCH 158/375] Qual: Fix phan notices (intracomm) --- .../class/intracommreport.class.php | 27 ++++++++++--------- htdocs/intracommreport/list.php | 8 +++--- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 3b18fb2bec1..e551e2fc002 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -139,7 +139,7 @@ class IntracommReport extends CommonObject */ public $content_xml; /** - * @var string + * @var 'deb'|'des' */ public $type_export; /** @@ -241,8 +241,8 @@ class IntracommReport extends CommonObject /** * Function create * - * @param User $user User - * @param int $notrigger notrigger + * @param User $user User + * @param int<0,1> $notrigger notrigger * @return int */ public function create($user, $notrigger = 0) @@ -350,8 +350,8 @@ class IntracommReport extends CommonObject * Generate XMLDes file * * @param int $period_year Year of declaration - * @param int $period_month Month of declaration - * @param string $type_declaration Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des) + * @param int<1,12> $period_month Month of declaration + * @param 'introduction'|'expedition' $type_declaration Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des) * @return string|false Return a well-formed XML string based on SimpleXML element, false or 0 if error */ public function getXMLDes($period_year, $period_month, $type_declaration = 'expedition') @@ -383,8 +383,8 @@ class IntracommReport extends CommonObject * * @param SimpleXMLElement $declaration Reference declaration * @param string $type Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des) - * @param int $period_reference Reference period - * @param string $exporttype 'deb' for DEB, 'des' for DES + * @param string $period_reference Reference period ("YYYY-MM") + * @param 'deb'|'des' $exporttype 'deb' for DEB, 'des' for DES * @return int Return integer <0 if KO, >0 if OK */ public function addItemsFact(&$declaration, $type, $period_reference, $exporttype = 'deb') @@ -406,7 +406,7 @@ class IntracommReport extends CommonObject $categ_fraisdeport = null; if ($exporttype == 'deb' && getDolGlobalInt('INTRACOMMREPORT_CATEG_FRAISDEPORT') > 0) { $categ_fraisdeport = new Categorie($this->db); - $categ_fraisdeport->fetch(getDolGlobalString('INTRACOMMREPORT_CATEG_FRAISDEPORT')); + $categ_fraisdeport->fetch(getDolGlobalInt('INTRACOMMREPORT_CATEG_FRAISDEPORT')); $TLinesFraisDePort = array(); } @@ -429,7 +429,7 @@ class IntracommReport extends CommonObject $i++; } - if (!empty($TLinesFraisDePort)) { + if (!empty($TLinesFraisDePort) && $categ_fraisdeport !== null) { $this->addItemFraisDePort($declaration, $TLinesFraisDePort, $type, $categ_fraisdeport, $i); } @@ -445,8 +445,8 @@ class IntracommReport extends CommonObject * Add invoice line * * @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des) - * @param int $period_reference Reference declaration - * @param string $exporttype deb=DEB, des=DES + * @param string $period_reference Reference declaration + * @param 'deb'|'des' $exporttype deb=DEB, des=DES * @return string Return integer <0 if KO, >0 if OK */ public function getSQLFactLines($type, $period_reference, $exporttype = 'deb') @@ -466,6 +466,9 @@ class IntracommReport extends CommonObject $tabledet = 'facture_fourn_det'; $field_link = 'fk_facture_fourn'; } + list($year, $month) = explode('-', $period_reference); + $period_end_of_month_day = cal_days_in_month(CAL_GREGORIAN, (int) $month, (int) $year); + $sql .= ", l.fk_product, l.qty , p.weight, p.rowid as id_prod, p.customcode , s.rowid as id_client, s.nom, s.zip, s.fk_pays, s.tva_intra @@ -481,7 +484,7 @@ class IntracommReport extends CommonObject AND l.product_type = ".($exporttype == "des" ? 1 : 0)." AND f.entity = ".((int) $conf->entity)." AND (s.fk_pays <> ".((int) $mysoc->country_id)." OR s.fk_pays IS NULL) - AND f.datef BETWEEN '".$this->db->escape($period_reference)."-01' AND '".$this->db->escape($period_reference)."-".date('t')."'"; + AND f.datef BETWEEN '".$this->db->escape((string) $period_reference)."-01' AND '".$this->db->escape((string) $period_reference)."-".((int) $period_end_of_month_day)."'"; return $sql; } diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index 8bad85d7b15..4d35c926827 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -1,7 +1,7 @@ * Copyright (C) 2019-2020 Open-DSI - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -546,7 +546,7 @@ if (!empty($moreforfilter)) { } $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup +$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, (string) $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : ''); $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : ''); @@ -765,13 +765,13 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { - print ' title="'.dol_escape_htmltag($object->$key).'"'; + print ' title="'.dol_escape_htmltag((string) $object->$key).'"'; } print '>'; if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'rowid') { - print $object->showOutputField($val, $key, $object->id, ''); + print $object->showOutputField($val, $key, (string) $object->id, ''); } else { print $object->showOutputField($val, $key, $object->$key, ''); } From 941fa4964bdf857f30ba0e37ab36fdaf4769ff7e Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 00:02:03 +0100 Subject: [PATCH 159/375] Qual: Fix phan notices (knowledgemanagement) --- htdocs/core/class/html.form.class.php | 2 +- .../class/knowledgerecord.class.php | 2 +- .../mod_knowledgerecord_advanced.php | 4 +-- .../knowledgerecord_card.php | 16 ++++++---- .../knowledgerecord_list.php | 31 ++++++++++--------- 5 files changed, 30 insertions(+), 25 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index afe919f3f01..aea65289ce9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9293,7 +9293,7 @@ class Form * Show a multiselect form from an array. WARNING: Use this only for short lists. * * @param string $htmlname Name of select - * @param array $array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> )) + * @param array $array Array(key=>value) or Array(key=>array('id'=>key, 'label'=>value, 'color'=> , 'picto'=> , 'labelhtml'=> )) * @param string[] $selected Array of keys preselected * @param int<0,1> $key_in_label 1 to show key like in "[key] value" * @param int<0,1> $value_as_key 1 to use value as key diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 4c233a053e7..784b833138f 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -424,7 +424,7 @@ class KnowledgeRecord extends CommonObject if ($key == 't.rowid') { $sqlwhere[] = $this->db->sanitize($key)." = ".((int) $value); } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { - $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate($value)."'"; + $sqlwhere[] = $this->db->sanitize($key)." = '".$this->db->idate((int) $value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $this->db->sanitize($key).' IN ('.$this->db->sanitize($this->db->escape($value)).')'; } else { diff --git a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php index 1923836a6fe..51415c1affa 100644 --- a/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php +++ b/htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) * Copyright (C) 2019-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -82,7 +82,7 @@ class mod_knowledgerecord_advanced extends ModeleNumRefKnowledgeRecord // Parametrage du prefix $texte .= '
'; - $texte .= ''; + $texte .= ''; $texte .= ''; diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index 354bdff5580..bf03ca6313d 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -203,11 +203,13 @@ if ($action == 'create') { if (isModEnabled('category')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 3); + // $output_mode is 3, so fix return type: + '@phan-var-force array $cate_arbo'; if (count($cate_arbo)) { // Categories print '"; } } @@ -260,6 +262,8 @@ if (($id || $ref) && $action == 'edit') { if (isModEnabled('category')) { $cate_arbo = $form->select_all_categories(Categorie::TYPE_KNOWLEDGEMANAGEMENT, '', 'parent', 64, 0, 3); + // $output_mode is 3, so fix return type: + '@phan-var-force array $cate_arbo'; if (count($cate_arbo)) { // Categories @@ -272,7 +276,7 @@ if (($id || $ref) && $action == 'edit') { $arrayselected[] = $cat->id; } } - print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print $form->multiselectarray('categories', $cate_arbo, $arrayselected, 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print ""; } } @@ -482,9 +486,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - if (empty($user->socid)) { - //print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); - } + //if (empty($user->socid)) { + //print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle'); + //} // Back to draft if ($object->status == $object::STATUS_VALIDATED) { diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 6eb297100af..423c44ee4c3 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -2,6 +2,7 @@ /* Copyright (C) 2007-2023 Laurent Destailleur * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2023 Anthony Berton + * Copyright (C) 2025 MDW * * 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 @@ -129,11 +130,11 @@ foreach ($object->fields as $key => $val) { if (!empty($val['visible'])) { $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( - 'label'=>$val['label'], - 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), - 'position'=>$val['position'], - 'help'=> isset($val['help']) ? $val['help'] : '' + 'label' => $val['label'], + 'checked' => (($visible < 0) ? 0 : 1), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'position' => $val['position'], + 'help' => isset($val['help']) ? $val['help'] : '' ); } } @@ -472,8 +473,8 @@ print ''; print ''; $newcardbutton = ''; -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition')); -$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition')); +$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition')); $newcardbutton .= dolGetButtonTitleSeparator(); $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd); @@ -565,7 +566,7 @@ foreach ($object->fields as $key => $val) { print ''; } @@ -371,24 +372,24 @@ if ($action == 'create') { print ''; // Accountancy - if (isModEnabled('accounting')) { + if (isModEnabled('accounting') && $formaccounting !== null) { /** @var FormAccounting $formaccounting */ // Accountancy_account_capital print ''; print ''; // Accountancy_account_insurance print ''; print ''; // Accountancy_account_interest print ''; print ''; } else { // For external software @@ -467,11 +468,11 @@ if ($id > 0) { $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(-1, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= ''; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); } } else { if (!empty($object->fk_project)) { @@ -563,9 +564,9 @@ if ($id > 0) { print $langs->trans("LoanAccountancyCapitalCode"); print ''; print '
'.$langs->trans("DefaultLanguage").' : '; -print $formadmin->select_language('auto', 'selectlang', 1, 0, 0, 1); +print $formadmin->select_language('auto', 'selectlang', 1, array(), 0, 1); print '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, '1').' 
'.$langs->trans("Categories").''; - print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); + print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), 0, 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0); print "
'; if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) { print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1); - } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:')=== 0)) { + } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) { print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1); } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) { print '
'; @@ -577,7 +578,7 @@ foreach ($object->fields as $key => $val) { } elseif ($key == 'lang') { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; $formadmin = new FormAdmin($db); - print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth100imp maxwidth125', 2); + print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2); } else { print ''; } @@ -588,7 +589,7 @@ foreach ($object->fields as $key => $val) { 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; // Action column @@ -630,7 +631,7 @@ foreach ($object->fields as $key => $val) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php'; // Hook fields -$parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray); +$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -725,13 +726,13 @@ while ($i < $imaxinloop) { if (!empty($arrayfields['t.'.$key]['checked'])) { print '$key)) { - print ' title="'.dol_escape_htmltag(dol_nl2br($object->$key, 1)).'"'; // We add dol_nl2br for the question and answer fields + print ' title="'.dol_escape_htmltag(dol_nl2br((string) $object->$key, 1)).'"'; // We add dol_nl2br for the question and answer fields } print '>'; if ($key == 'status') { print $object->getLibStatut(5); } elseif ($key == 'rowid') { - print $object->showOutputField($val, $key, $object->id, ''); + print $object->showOutputField($val, $key, (string) $object->id, ''); } elseif ($key == 'fk_user_creat') { if ($object->fk_user_creat > 0) { if (isset($conf->cache['user'][$object->fk_user_creat])) { @@ -795,7 +796,7 @@ while ($i < $imaxinloop) { // Extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; // Fields from hook - $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray); + $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column @@ -836,7 +837,7 @@ if ($num == 0) { $db->free($resql); -$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql); +$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql); $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; From b8e083a4a07eab992699b2c02a0817a7d9651b67 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 00:18:24 +0100 Subject: [PATCH 160/375] Qual: Fix phan notices (loan) --- htdocs/loan/card.php | 35 ++++++++++++++++---------------- htdocs/loan/class/loan.class.php | 10 ++++----- htdocs/loan/document.php | 6 +++--- htdocs/loan/note.php | 4 ++-- htdocs/loan/payment/payment.php | 2 ++ htdocs/loan/schedule.php | 8 ++++---- 6 files changed, 34 insertions(+), 31 deletions(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index db15cac8665..b60db0ef32f 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2015-2024 Frédéric France * Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -274,6 +274,7 @@ $form = new Form($db); $formproject = new FormProjets($db); $morehtmlstatus = ''; $outputlangs = $langs; +$formaccounting = null; if (isModEnabled('accounting')) { $formaccounting = new FormAccounting($db); } @@ -347,7 +348,7 @@ if ($action == 'create') { print '
'.$langs->trans("Project").''; - $numproject = $formproject->select_projects(-1, $projectid, 'projectid', 16, 0, 1, 1); + $numproject = $formproject->select_projects(-1, (string) $projectid, 'projectid', 16, 0, 1, 1); print '
'.$langs->trans("LoanAccountancyCapitalCode").''; - print $formaccounting->select_account(GETPOST('accountancy_account_capital') ? GETPOST('accountancy_account_capital') : getDolGlobalString('LOAN_ACCOUNTING_ACCOUNT_CAPITAL'), 'accountancy_account_capital', 1, '', 1, 1); + print $formaccounting->select_account(GETPOST('accountancy_account_capital') ? GETPOST('accountancy_account_capital') : getDolGlobalString('LOAN_ACCOUNTING_ACCOUNT_CAPITAL'), 'accountancy_account_capital', 1, array(), 1, 1); print '
'.$langs->trans("LoanAccountancyInsuranceCode").''; - print $formaccounting->select_account(GETPOST('accountancy_account_insurance') ? GETPOST('accountancy_account_insurance') : getDolGlobalString('LOAN_ACCOUNTING_ACCOUNT_INSURANCE'), 'accountancy_account_insurance', 1, '', 1, 1); + print $formaccounting->select_account(GETPOST('accountancy_account_insurance') ? GETPOST('accountancy_account_insurance') : getDolGlobalString('LOAN_ACCOUNTING_ACCOUNT_INSURANCE'), 'accountancy_account_insurance', 1, array(), 1, 1); print '
'.$langs->trans("LoanAccountancyInterestCode").''; - print $formaccounting->select_account(GETPOST('accountancy_account_interest') ? GETPOST('accountancy_account_interest') : getDolGlobalString('LOAN_ACCOUNTING_ACCOUNT_INTEREST'), 'accountancy_account_interest', 1, '', 1, 1); + print $formaccounting->select_account(GETPOST('accountancy_account_interest') ? GETPOST('accountancy_account_interest') : getDolGlobalString('LOAN_ACCOUNTING_ACCOUNT_INTEREST'), 'accountancy_account_interest', 1, array(), 1, 1); print '
'; - if (isModEnabled('accounting')) { + if (isModEnabled('accounting') && $formaccounting !== null) { /** @var FormAccounting $formaccounting */ - print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, '', 1, 1); + print $formaccounting->select_account($object->account_capital, 'accountancy_account_capital', 1, array(), 1, 1); } else { print ''; } @@ -577,7 +578,7 @@ if ($id > 0) { if (isModEnabled('accounting')) { $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch('', $object->account_capital, 1); + $accountingaccount->fetch(0, $object->account_capital, 1); print $accountingaccount->getNomUrl(0, 1, 1, '', 1); } else { @@ -595,9 +596,9 @@ if ($id > 0) { print $langs->trans("LoanAccountancyInsuranceCode"); print ''; - if (isModEnabled('accounting')) { + if (isModEnabled('accounting') && $formaccounting !== null) { /** @var FormAccounting $formaccounting */ - print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, '', 1, 1); + print $formaccounting->select_account($object->account_insurance, 'accountancy_account_insurance', 1, array(), 1, 1); } else { print ''; } @@ -609,7 +610,7 @@ if ($id > 0) { if (isModEnabled('accounting')) { $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch('', $object->account_insurance, 1); + $accountingaccount->fetch(0, $object->account_insurance, 1); print $accountingaccount->getNomUrl(0, 1, 1, '', 1); } else { @@ -627,9 +628,9 @@ if ($id > 0) { print $langs->trans("LoanAccountancyInterestCode"); print ''; - if (isModEnabled('accounting')) { + if (isModEnabled('accounting') && $formaccounting !== null) { /** @var FormAccounting $formaccounting */ - print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, '', 1, 1); + print $formaccounting->select_account($object->account_interest, 'accountancy_account_interest', 1, array(), 1, 1); } else { print ''; } @@ -641,7 +642,7 @@ if ($id > 0) { if (isModEnabled('accounting')) { $accountingaccount = new AccountingAccount($db); - $accountingaccount->fetch('', $object->account_interest, 1); + $accountingaccount->fetch(0, $object->account_interest, 1); print $accountingaccount->getNomUrl(0, 1, 1, '', 1); } else { diff --git a/htdocs/loan/class/loan.class.php b/htdocs/loan/class/loan.class.php index e92cf3863bb..9d0e8b8f014 100644 --- a/htdocs/loan/class/loan.class.php +++ b/htdocs/loan/class/loan.class.php @@ -301,12 +301,12 @@ class Loan extends CommonObject $sql .= " accountancy_account_capital, accountancy_account_insurance, accountancy_account_interest, entity,"; $sql .= " datec, fk_projet, fk_user_author, insurance_amount)"; $sql .= " VALUES ('".$this->db->escape($this->label)."',"; - $sql .= " '".$this->db->escape($this->fk_bank)."',"; + $sql .= " '".$this->db->escape((string) $this->fk_bank)."',"; $sql .= " '".price2num($newcapital)."',"; $sql .= " '".$this->db->idate($this->datestart)."',"; $sql .= " '".$this->db->idate($this->dateend)."',"; - $sql .= " '".$this->db->escape($this->nbterm)."',"; - $sql .= " '".$this->db->escape($this->rate)."',"; + $sql .= " '".$this->db->escape((string) $this->nbterm)."',"; + $sql .= " '".$this->db->escape((string) $this->rate)."',"; $sql .= " '".$this->db->escape($this->note_private)."',"; $sql .= " '".$this->db->escape($this->note_public)."',"; $sql .= " '".$this->db->escape($this->account_capital)."',"; @@ -413,7 +413,7 @@ class Loan extends CommonObject $sql = "UPDATE ".MAIN_DB_PREFIX."loan"; $sql .= " SET label='".$this->db->escape($this->label)."',"; - $sql .= " capital='".price2num($this->db->escape($this->capital))."',"; + $sql .= " capital='".$this->db->escape(price2num($this->capital))."',"; $sql .= " datestart='".$this->db->idate($this->datestart)."',"; $sql .= " dateend='".$this->db->idate($this->dateend)."',"; $sql .= " nbterm=".((float) $this->nbterm).","; @@ -423,7 +423,7 @@ class Loan extends CommonObject $sql .= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',"; $sql .= " fk_projet=".(empty($this->fk_project) ? 'NULL' : ((int) $this->fk_project)).","; $sql .= " fk_user_modif = ".((int) $user->id).","; - $sql .= " insurance_amount = '".price2num($this->db->escape($this->insurance_amount))."'"; + $sql .= " insurance_amount = '".price2num($this->db->escape((string) $this->insurance_amount))."'"; $sql .= " WHERE rowid=".((int) $this->id); dol_syslog(get_class($this)."::update", LOG_DEBUG); diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php index 7439076d226..7d6aba80f8f 100644 --- a/htdocs/loan/document.php +++ b/htdocs/loan/document.php @@ -1,7 +1,7 @@ * Copyright (C) 2017 Ferran Marcet - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -129,11 +129,11 @@ if ($object->id) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php index 680ad131370..8d0765fac30 100644 --- a/htdocs/loan/note.php +++ b/htdocs/loan/note.php @@ -116,11 +116,11 @@ if ($id > 0) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); } } else { if (!empty($object->fk_project)) { diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index ce0e53dde2d..e57ea4351ed 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -2,6 +2,7 @@ /* Copyright (C) 2014-2024 Alexandre Spangaro * Copyright (C) 2015-2025 Frédéric France * Copyright (C) 2020 Maxime DEMAREST + * Copyright (C) 2025 MDW * * 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 @@ -254,6 +255,7 @@ llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-loan pag // Form to create loan's payment if ($action == 'create') { $total = $loan->capital; + $sumpaid = 0; print load_fiche_titre($langs->trans("DoPayment")); diff --git a/htdocs/loan/schedule.php b/htdocs/loan/schedule.php index 23e6c561dfd..e02861d8161 100644 --- a/htdocs/loan/schedule.php +++ b/htdocs/loan/schedule.php @@ -2,7 +2,7 @@ /* Copyright (C) 2017 Franck Moreau * Copyright (C) 2018-2024 Alexandre Spangaro * Copyright (C) 2020 Maxime DEMAREST - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -125,7 +125,7 @@ if ($action == 'updateecheancier' && empty($pay_without_schedule) && $permission while ($i < $object->nbterm + 1) { $mens = price2num(GETPOST('mens'.$i)); $int = price2num(GETPOST('hi_interets'.$i)); - $id = GETPOST('hi_rowid'.$i); + $id = GETPOSTINT('hi_rowid'.$i); $insurance = price2num(GETPOST('hi_insurance'.$i)); $new_echeance = new LoanSchedule($db); @@ -185,11 +185,11 @@ if (isModEnabled('project')) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects(-1, (string) $object->fk_project, 'projectid', 16, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { - $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); + $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, -1, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300'); } } } else { From 5ead7465115a94ec7cfe1dcca50e3f05c69fb07c Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 00:36:09 +0100 Subject: [PATCH 161/375] Qual: Fix phan notices (main.inc,master.inc) --- htdocs/main.inc.php | 10 +++++----- htdocs/master.inc.php | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ac53e4decaa..1bfd7b4361e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -12,12 +12,12 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2020 Demarest Maxime - * Copyright (C) 2020-2024 Charlene Benke + * Copyright (C) 2020-2024 Charlene Benke * Copyright (C) 2021-2024 Frédéric France * Copyright (C) 2021 Alexandre Spangaro * Copyright (C) 2023 Joachim Küter * Copyright (C) 2023 Eric Seigne - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -255,7 +255,7 @@ function testSqlAndScriptInject($val, $type) /** * Return true if security check on parameters are OK, false otherwise. * - * @param string|array $var Variable name + * @param string|array $var Variable name * @param int<0,2> $type 1=GET, 0=POST, 2=PHP_SELF * @param int<0,1> $stopcode 0=No stop code, 1=Stop code (default) if injection found * @return boolean True if there is no injection. @@ -3133,7 +3133,7 @@ function printDropdownQuickadd($mode = 0) // Allow the $items of the menu to be manipulated by modules $parameters = array(); $hook_items = $items; - $reshook = $hookmanager->executeHooks('menuDropdownQuickaddItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('menuDropdownQuickaddItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks @phan-suppress-current-line PhanTypeMismatchArgument if (is_numeric($reshook) && !empty($hookmanager->resArray) && is_array($hookmanager->resArray)) { if ($reshook == 0) { $items['items'] = array_merge($items['items'], $hookmanager->resArray); // add @@ -3498,7 +3498,7 @@ function left_menu($menu_array_before, $helppagename = '', $notused = '', $menu_ //$textsearch = $langs->trans("Search"); $textsearch = ''.$langs->trans("Search"); - $searchform .= $form->selectArrayFilter('searchselectcombo', $arrayresult, $selected, 'accesskey="s"', 1, 0, (getDolGlobalString('MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY') ? 0 : 1), 'vmenusearchselectcombo', 1, $textsearch, 1, $stringforfirstkey.' s'); + $searchform .= $form->selectArrayFilter('searchselectcombo', $arrayresult, (string) $selected, 'accesskey="s"', 1, 0, (getDolGlobalString('MAIN_SEARCHBOX_CONTENT_LOADED_BEFORE_KEY') ? 0 : 1), 'vmenusearchselectcombo', 1, $textsearch, 1, $stringforfirstkey.' s'); } else { if (is_array($arrayresult)) { // @phan-suppress-next-line PhanEmptyForeach // array is really empty in else case. diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index e2ccbe25dd2..41cb8f391cd 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -10,7 +10,7 @@ * Copyright (C) 2010 Juanjo Menent * Copyright (C) 2011 Philippe Grand * Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com> - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -45,6 +45,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; * @var string $dolibarr_main_url_root_alt */ +' +@phan-var-force ?string $dolibarr_main_db_prefix +@phan-var-force ?string $dolibarr_main_db_encryption +@phan-var-force ?string $dolibarr_main_db_cryptkey +@phan-var-force ?string $dolibarr_main_limit_users +@phan-var-force ?string $dolibarr_main_url_root_alt +'; + if (!function_exists('is_countable')) { /** * function is_countable (to remove when php version supported will be >= 7.3) @@ -99,7 +107,7 @@ if (!empty($dolibarr_main_document_root_alt)) { foreach ($values as $value) { $conf->file->dol_document_root['alt'.($i++)] = (string) $value; } - $values = preg_split('/[;,]/', $dolibarr_main_url_root_alt); + $values = preg_split('/[;,]/', (string) $dolibarr_main_url_root_alt); $i = 0; foreach ($values as $value) { if (preg_match('/^http(s)?:/', $value)) { @@ -178,14 +186,16 @@ unset($conf->db->pass); // This is to avoid password to be shown in memory/swap /* * Object $user */ -if (!defined('NOREQUIREUSER')) { +if (!defined('NOREQUIREUSER') && $db !== null) { $user = new User($db); } /* * Create the global $hookmanager object */ -$hookmanager = new HookManager($db); +if ($db !== null) { + $hookmanager = new HookManager($db); +} /* @@ -212,10 +222,12 @@ if (!is_numeric($conf->entity)) { } // Here we read database (llx_const table) and define conf var $conf->global->XXX. //print "We work with data into entity instance number '".$conf->entity."'"; -$conf->setValues($db); +if ($db !== null) { + $conf->setValues($db); +} // Create object $mysoc (A thirdparty object that contains properties of companies managed by Dolibarr. -if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) { +if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC') && $db != null) { require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; $mysoc = new Societe($db); From fb62409ca7351e8b73aa1193437f4b88f028a5aa Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 01:17:07 +0100 Subject: [PATCH 162/375] Qual: Fix phan notices (eldy.lib) --- htdocs/core/lib/functions.lib.php | 4 +- htdocs/core/menus/standard/eldy.lib.php | 138 ++++++++++++------------ 2 files changed, 71 insertions(+), 71 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fa6deaefda1..3695a1eeb69 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12452,7 +12452,7 @@ function colorIsLight($stringcolor) * Function to test if an entry is enabled or not * * @param int<0,1> $type_user 0=We test for internal user, 1=We test for external user - * @param array{enabled:int<0,1>,module:string,perms:string} $menuentry Array for feature entry to test + * @param array{enabled:int<0,1>,module?:string,perms:string} $menuentry Array for feature entry to test * @param string[] $listofmodulesforexternal Array with list of modules allowed to external users * @return int<0,2> 0=Hide, 1=Show, 2=Show gray */ @@ -12465,7 +12465,7 @@ function isVisibleToUserType($type_user, &$menuentry, &$listofmodulesforexternal if (empty($menuentry['enabled'])) { return 0; // Entry disabled by condition } - if ($type_user && $menuentry['module']) { + if ($type_user && array_key_exists('module', $menuentry) && $menuentry['module']) { $tmploops = explode('|', $menuentry['module']); $found = 0; foreach ($tmploops as $tmploop) { diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 76040bb5c01..3b3c57167ac 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -7,7 +7,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -97,8 +97,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Members $tmpentry = array( - 'enabled' => isModEnabled('member'), - 'perms' => $user->hasRight('adherent', 'lire'), + 'enabled' => (int) isModEnabled('member'), + 'perms' => (string) (int) $user->hasRight('adherent', 'lire'), 'module' => 'adherent' ); $menu_arr[] = array( @@ -106,7 +106,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/adherents/index.php?mainmenu=members&leftmenu=', 'title' => "MenuMembers", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "members", 'leftmenu' => '', @@ -122,14 +122,14 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Third parties $tmpentry = array( - 'enabled' => ( + 'enabled' => (int) ( ( isModEnabled('societe') && (!getDolGlobalString('SOCIETE_DISABLE_PROSPECTS') || !getDolGlobalString('SOCIETE_DISABLE_CUSTOMERS')) ) || (isModEnabled('supplier_proposal') || isModEnabled('supplier_order') || isModEnabled('supplier_invoice')) ), - 'perms' => ($user->hasRight('societe', 'lire') || $user->hasRight('societe', 'contact', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), + 'perms' => (string) (int) ($user->hasRight('societe', 'lire') || $user->hasRight('societe', 'contact', 'lire') || $user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), 'module' => 'societe|fournisseur' ); @@ -138,7 +138,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/societe/index.php?mainmenu=companies&leftmenu=', 'title' => "ThirdParties", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "companies", 'leftmenu' => '', @@ -154,8 +154,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Products-Services $tmpentry = array( - 'enabled' => (isModEnabled('product') || isModEnabled('service') || isModEnabled('shipping')), - 'perms' => ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), + 'enabled' => (int) (isModEnabled('product') || isModEnabled('service') || isModEnabled('shipping')), + 'perms' => (string) (int) ($user->hasRight('product', 'read') || $user->hasRight('service', 'read') || $user->hasRight('expedition', 'lire')), 'module' => 'product|service' ); $menu_arr[] = array( @@ -165,7 +165,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = ? (array("TMenuProducts", " | ", "TMenuServices")) : (isModEnabled('product') ? "TMenuProducts" : "TMenuServices"), 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "products", 'leftmenu' => '', @@ -181,8 +181,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // MRP - GPAO $tmpentry = array( - 'enabled' => (isModEnabled('bom') || isModEnabled('mrp')), - 'perms' => ($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), + 'enabled' => (int) (isModEnabled('bom') || isModEnabled('mrp')), + 'perms' => (string) (int) ($user->hasRight('bom', 'read') || $user->hasRight('mrp', 'read')), 'module' => 'bom|mrp' ); $menu_arr[] = array( @@ -190,7 +190,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/mrp/index.php?mainmenu=mrp&leftmenu=', 'title' => "TMenuMRP", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "mrp", 'leftmenu' => '', @@ -206,8 +206,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Projects $tmpentry = array( - 'enabled' => (isModEnabled('project') ? 1 : 0), - 'perms' => ($user->hasRight('projet', 'lire') ? 1 : 0), + 'enabled' => (int) (isModEnabled('project') ? 1 : 0), + 'perms' => (string) (int) ($user->hasRight('projet', 'lire') ? 1 : 0), 'module' => 'projet' ); @@ -228,7 +228,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/projet/index.php?mainmenu=project&leftmenu=', 'title' => $titleboth, 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "project", 'leftmenu' => '', @@ -244,7 +244,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Commercial (propal, commande, supplier_proposal, supplier_order, contrat, ficheinter) $tmpentry = array( - 'enabled' => ( + 'enabled' => (int) ( isModEnabled('propal') || isModEnabled('order') || isModEnabled('fournisseur') @@ -253,7 +253,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = || isModEnabled('contract') || isModEnabled('intervention') ) ? 1 : 0, - 'perms' => ( + 'perms' => (string) (int) ( $user->hasRight('propal', 'read') || $user->hasRight('commande', 'lire') || $user->hasRight('supplier_proposal', 'lire') @@ -279,7 +279,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => ($onlysupplierorder ? '/fourn/commande/index.php?mainmenu=commercial&leftmenu=' : '/comm/index.php?mainmenu=commercial&leftmenu='), 'title' => "Commercial", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "commercial", 'leftmenu' => '', @@ -295,7 +295,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Billing - Financial $tmpentry = array( - 'enabled' => ( + 'enabled' => (int) ( isModEnabled('invoice') || isModEnabled('don') || isModEnabled('tax') || @@ -304,7 +304,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = isModEnabled('loan') || isModEnabled('margin') ) ? 1 : 0, - 'perms' => ($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') + 'perms' => (string) (int) ($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') || $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('loan', 'read') || $user->hasRight('margins', 'liretous')), 'module' => 'facture|supplier_invoice|don|tax|salaries|loan' @@ -314,7 +314,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/compta/index.php?mainmenu=billing&leftmenu=', 'title' => "MenuFinancial", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "billing", 'leftmenu' => '', @@ -330,8 +330,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Bank $tmpentry = array( - 'enabled' => (isModEnabled('bank') || isModEnabled('prelevement')), - 'perms' => ($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), + 'enabled' => (int) (isModEnabled('bank') || isModEnabled('prelevement')), + 'perms' => (string) (int) ($user->hasRight('banque', 'lire') || $user->hasRight('prelevement', 'lire') || $user->hasRight('paymentbybanktransfer', 'read')), 'module' => 'banque|prelevement|paymentbybanktransfer' ); $menu_arr[] = array( @@ -339,7 +339,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/compta/bank/list.php?mainmenu=bank&leftmenu=&search_status=opened', 'title' => "MenuBankCash", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "bank", 'leftmenu' => '', @@ -355,8 +355,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Accounting $tmpentry = array( - 'enabled' => (isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), - 'perms' => ($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), + 'enabled' => (int) (isModEnabled('comptabilite') || isModEnabled('accounting') || isModEnabled('asset') || isModEnabled('intracommreport')), + 'perms' => (string) (int) ($user->hasRight('compta', 'resultat', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire') || $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('asset', 'read') || $user->hasRight('intracommreport', 'read')), 'module' => 'comptabilite|accounting|asset|intracommreport' ); $menu_arr[] = array( @@ -364,7 +364,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/accountancy/index.php?mainmenu=accountancy&leftmenu=', 'title' => "MenuAccountancy", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "accountancy", 'leftmenu' => '', @@ -380,8 +380,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // HRM $tmpentry = array( - 'enabled' => (isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), - 'perms' => ($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), + 'enabled' => (int) (isModEnabled('hrm') || (isModEnabled('holiday')) || isModEnabled('deplacement') || isModEnabled('expensereport') || isModEnabled('recruitment')), + 'perms' => (string) (int) ($user->hasRight('user', 'user', 'lire') || $user->hasRight('holiday', 'read') || $user->hasRight('deplacement', 'lire') || $user->hasRight('expensereport', 'lire') || $user->hasRight('recruitment', 'recruitmentjobposition', 'read')), 'module' => 'hrm|holiday|deplacement|expensereport|recruitment' ); @@ -390,7 +390,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/hrm/index.php?mainmenu=hrm&leftmenu=', 'title' => "HRM", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "hrm", 'leftmenu' => '', @@ -406,8 +406,8 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tickets and Knowledge base $tmpentry = array( - 'enabled' => (isModEnabled('ticket') || isModEnabled('knowledgemanagement')), - 'perms' => ($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), + 'enabled' => (int) (isModEnabled('ticket') || isModEnabled('knowledgemanagement')), + 'perms' => (string) (int) ($user->hasRight('ticket', 'read') || $user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')), 'module' => 'ticket|knowledgemanagement' ); $link = ''; @@ -421,7 +421,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => $link, 'title' => isModEnabled('ticket') ? "Tickets" : "MenuKnowledgeRecordShort", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "ticket", 'leftmenu' => '', @@ -438,7 +438,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = // Tools $tmpentry = array( 'enabled' => 1, - 'perms' => 1, + 'perms' => '1', 'module' => '' ); $menu_arr[] = array( @@ -446,7 +446,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = 'link' => '/core/tools.php?mainmenu=tools&leftmenu=', 'title' => "Tools", 'level' => 0, - 'enabled' => $showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal), + 'enabled' => (int) ($showmode = isVisibleToUserType($type_user, $tmpentry, $listofmodulesforexternal)), 'target' => $atarget, 'mainmenu' => "tools", 'leftmenu' => '', @@ -484,7 +484,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = $mtitle = $langs->trans($smenu->title); } // Add item - $menu->add($smenu->link, $mtitle, $smenu->level, $smenu->enabled, $smenu->target, $smenu->mainmenu, $smenu->leftmenu, $smenu->position, $smenu->id, $smenu->idsel, $smenu->classname, $smenu->prefix); + $menu->add($smenu->link, $mtitle, $smenu->level, $smenu->enabled, $smenu->target, $smenu->mainmenu, $smenu->leftmenu, $smenu->position, $smenu->id, $smenu->idsel, $smenu->classname, (string) $smenu->prefix); } } @@ -724,9 +724,9 @@ function print_end_menu_array() * Fill &$menu (example with $forcemainmenu='home' $forceleftmenu='all', return left menu tree of Home) * * @param DoliDB $db Database handler - * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add) - * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add) - * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) + * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $menu_array_before Table of menu entries to show before entries of menu handler (menu->liste filled with menu->add) + * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $menu_array_after Table of menu entries to show after entries of menu handler (menu->liste filled with menu->add) + * @param array,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) * @param Menu $menu Object Menu to return back list of menu entries * @param int<0,1> $noout Disable output (Initialise &$menu only). * @param string $forcemainmenu 'x'=Force mainmenu to mainmenu='x' @@ -907,7 +907,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM 'mainmenu' => $mainmenu, ); $hook_items = $menu_array; - $reshook = $hookmanager->executeHooks('menuLeftMenuItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks + $reshook = $hookmanager->executeHooks('menuLeftMenuItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks @phan-suppress-current-line PhanTypeMismatchArgument if (is_numeric($reshook)) { if ($reshook == 0 && !empty($hookmanager->resArray)) { @@ -1224,17 +1224,17 @@ function get_left_menu_home($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/user/home.php?leftmenu=users", $langs->trans("MenuUsersAndGroups"), 0, $user->hasRight('user', 'user', 'read'), '', $mainmenu, 'users', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); if ($user->hasRight('user', 'user', 'read')) { if ($usemenuhider || empty($leftmenu) || $leftmenu == "users") { - $newmenu->add("", $langs->trans("Users"), 1, $user->hasRight('user', 'user', 'read') || $user->admin); - $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, ($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')), '', 'home'); - $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->hasRight('user', 'user', 'read') || $user->admin); - $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->hasRight('user', 'user', 'read') || $user->admin); + $newmenu->add("", $langs->trans("Users"), 1, (int) ($user->hasRight('user', 'user', 'read') || $user->admin)); + $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"), 2, (int) (($user->hasRight("user", "user", "write") || $user->admin) && !(isModEnabled('multicompany') && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE'))), '', 'home'); + $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, (int) ($user->hasRight('user', 'user', 'read') || $user->admin)); + $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, (int) ($user->hasRight('user', 'user', 'read') || $user->admin)); if (isModEnabled('category')) { $langs->load("categories"); $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->hasRight('categorie', 'read'), '', $mainmenu, 'cat'); } - $newmenu->add("", $langs->trans("Groups"), 1, ($user->hasRight('user', 'user', 'read') || $user->admin) && !(isModEnabled('multicompany') && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE'))); - $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight("user", "group_advance", "write") : $user->hasRight("user", "user", "write")) || $user->admin) && !(isModEnabled('multicompany') && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE'))); - $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'read')) || $user->admin)); + $newmenu->add("", $langs->trans("Groups"), 1, (int) (($user->hasRight('user', 'user', 'read') || $user->admin) && !(isModEnabled('multicompany') && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')))); + $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (int) (((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight("user", "group_advance", "write") : $user->hasRight("user", "user", "write")) || $user->admin) && !(isModEnabled('multicompany') && !empty($user->entity) && getDolGlobalString('MULTICOMPANY_TRANSVERSE_MODE')))); + $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (int) ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') ? $user->hasRight('user', 'group_advance', 'read') : $user->hasRight('user', 'user', 'read')) || $user->admin)); } } } @@ -1289,9 +1289,9 @@ function get_left_menu_thridparties($mainmenu, &$newmenu, $usemenuhider = 1, $le // Suppliers if (isModEnabled('societe') && (isModEnabled('supplier_order') || isModEnabled('supplier_invoice') || isModEnabled('supplier_proposal'))) { $langs->load("suppliers"); - $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("Suppliers"), 2, ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers', 15); + $newmenu->add("/societe/list.php?type=f&leftmenu=suppliers", $langs->trans("Suppliers"), 2, (int) ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')), '', $mainmenu, 'suppliers', 15); - $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, $user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire'))); + $newmenu->add("/societe/card.php?leftmenu=suppliers&action=create&type=f", $langs->trans("MenuNewSupplier"), 3, (int) ($user->hasRight('societe', 'creer') && ($user->hasRight('fournisseur', 'lire') || $user->hasRight('supplier_order', 'lire') || $user->hasRight('supplier_invoice', 'lire') || $user->hasRight('supplier_proposal', 'lire')))); } // Categories @@ -1514,7 +1514,7 @@ function get_left_menu_billing($mainmenu, &$newmenu, $usemenuhider = 1, $leftmen if (isModEnabled('societe') && isModEnabled('supplier_invoice') && !getDolGlobalString('SUPPLIER_INVOICE_MENU_DISABLED')) { $langs->load("bills"); $newmenu->add("/fourn/facture/index.php?leftmenu=suppliers_bills", $langs->trans("BillsSuppliers"), 0, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills', 0, '', '', '', img_picto('', 'supplier_invoice', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); + $newmenu->add("/fourn/facture/card.php?leftmenu=suppliers_bills&action=create", $langs->trans("NewBill"), 1, (int) ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')), '', $mainmenu, 'suppliers_bills_create'); $newmenu->add("/fourn/facture/list.php?leftmenu=suppliers_bills", $langs->trans("List"), 1, $user->hasRight('fournisseur', 'facture', 'lire'), '', $mainmenu, 'suppliers_bills_list'); if ($usemenuhider || empty($leftmenu) || preg_match('/suppliers_bills/', $leftmenu)) { @@ -1821,7 +1821,7 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef // Accounting - $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, $user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire'), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/accountancy/index.php?leftmenu=accountancy_accountancy", $langs->trans("MenuAccountancy"), 0, (int) ($user->hasRight('accounting', 'mouvements', 'lire') || $user->hasRight('accounting', 'comptarapport', 'lire')), '', $mainmenu, 'accountancy', 1, '', '', '', img_picto('', 'accountancy', 'class="paddingright pictofixedwidth"')); // General Ledger $newmenu->add("/accountancy/bookkeeping/listbyaccount.php?mainmenu=accountancy&leftmenu=accountancy_accountancy", $langs->trans("Bookkeeping"), 1, $user->hasRight('accounting', 'mouvements', 'lire')); @@ -2003,10 +2003,10 @@ function get_left_menu_accountancy($mainmenu, &$newmenu, $usemenuhider = 1, $lef $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuAssets"), 0, $user->hasRight('asset', 'read'), '', $mainmenu, 'asset', 100, '', '', '', img_picto('', 'payment', 'class="paddingright pictofixedwidth"')); $newmenu->add("/asset/card.php?leftmenu=asset&action=create", $langs->trans("MenuNewAsset"), 1, $user->hasRight('asset', 'write')); $newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->hasRight('asset', 'read')); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read')), '', $mainmenu, 'asset_model'); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuAssetModels"), 1, (int) ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read'))), '', $mainmenu, 'asset_model'); if ($usemenuhider || empty($leftmenu) || preg_match('/asset_model/', $leftmenu)) { - $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write'))); - $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read'))); + $newmenu->add("/asset/model/card.php?leftmenu=asset_model&action=create", $langs->trans("MenuNewAssetModel"), 2, (int) ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'write')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'write')))); + $newmenu->add("/asset/model/list.php?leftmenu=asset_model", $langs->trans("MenuListAssetModels"), 2, (int) ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'read')) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('asset', 'model_advance', 'read')))); } } } @@ -2088,9 +2088,9 @@ function get_left_menu_bank($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = // Cash Control if (isModEnabled('takepos') || isModEnabled('cashdesk')) { $permtomakecashfence = ($user->hasRight('cashdesk', 'run') || $user->hasRight('takepos', 'run')); - $newmenu->add("/compta/cashcontrol/cashcontrol_list.php", $langs->trans("CashControl"), 0, $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="paddingright pictofixedwidth"')); - $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, $permtomakecashfence); - $newmenu->add("/compta/cashcontrol/cashcontrol_list.php", $langs->trans("List"), 1, $permtomakecashfence); + $newmenu->add("/compta/cashcontrol/cashcontrol_list.php", $langs->trans("CashControl"), 0, (int) $permtomakecashfence, '', $mainmenu, 'cashcontrol', 0, '', '', '', img_picto('', 'pos', 'class="paddingright pictofixedwidth"')); + $newmenu->add("/compta/cashcontrol/cashcontrol_card.php?action=create", $langs->trans("NewCashFence"), 1, (int) $permtomakecashfence); + $newmenu->add("/compta/cashcontrol/cashcontrol_list.php", $langs->trans("List"), 1, (int) $permtomakecashfence); } } } @@ -2116,12 +2116,12 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/product/card.php?leftmenu=product&action=create&type=0", $langs->trans("NewProduct"), 1, $user->hasRight('product', 'creer')); $newmenu->add("/product/list.php?leftmenu=product&type=0", $langs->trans("List"), 1, $user->hasRight('product', 'read')); if (isModEnabled('stock')) { - $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); + $newmenu->add("/product/reassort.php?type=0", $langs->trans("MenuStocks"), 1, (int) ($user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'))); } if (isModEnabled('productbatch')) { $langs->load("stocks"); - $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); - $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); + $newmenu->add("/product/reassortlot.php?type=0&search_subjecttolotserial=1", $langs->trans("StocksByLotSerial"), 1, (int) ($user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'))); + $newmenu->add("/product/stock/productlot_list.php", $langs->trans("LotSerial"), 1, (int) ($user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'))); } if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('product', 'read')); @@ -2145,7 +2145,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read')); if (isModEnabled('stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { - $newmenu->add("/product/reassort.php?type=1", $langs->trans("MenuStocks"), 1, $user->hasRight('service', 'read') && $user->hasRight('stock', 'lire')); + $newmenu->add("/product/reassort.php?type=1", $langs->trans("MenuStocks"), 1, (int) ($user->hasRight('service', 'read') && $user->hasRight('stock', 'lire'))); } if (isModEnabled('variants')) { $newmenu->add("/variants/list.php", $langs->trans("VariantAttributes"), 1, $user->hasRight('service', 'read')); @@ -2171,9 +2171,9 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/product/stock/massstockmove.php?init=1", $langs->trans("MassStockTransferShort"), 1, $user->hasRight('stock', 'mouvement', 'creer')); if (isModEnabled('supplier_order')) { - $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire')); + $newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, (int) ($user->hasRight('stock', 'mouvement', 'creer') && $user->hasRight('fournisseur', 'lire'))); } - $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->hasRight('product', 'read') && $user->hasRight('stock', 'lire')); + $newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, (int) ($user->hasRight('product', 'read') && $user->hasRight('stock', 'lire'))); // Categories for warehouses if (isModEnabled('category')) { @@ -2294,8 +2294,8 @@ function get_left_menu_projects($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $search_project_user = GETPOSTINT('search_project_user'); $tmpentry = array( - 'enabled' => isModEnabled('project'), - 'perms' => $user->hasRight('projet', 'lire'), + 'enabled' => (int) isModEnabled('project'), + 'perms' => (string) (int) $user->hasRight('projet', 'lire'), 'module' => 'projet' ); $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); @@ -2392,7 +2392,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("Evals"), 1, $user->hasRight('hrm', 'evaluation', 'read'), '', $mainmenu, 'hrm_sm', 0, '', '', '', img_picto('', 'user', 'class="paddingright pictofixedwidth"')); //$newmenu->add("/hrm/evaluation_card.php?mainmenu=hrm&leftmenu=hrm_sm&action=create", $langs->trans("NewEval"), 1, $user->hasRight('hrm', 'evaluation', 'write')); //$newmenu->add("/hrm/evaluation_list.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("List"), 1, $user->hasRight('hrm', 'evaluation', 'read')); - $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, $user->hasRight('hrm', 'evaluation', 'read') || $user->hasRight('hrm', 'compare_advance', 'read')); + $newmenu->add("/hrm/compare.php?mainmenu=hrm&leftmenu=hrm_sm", $langs->trans("SkillComparison"), 1, (int) ($user->hasRight('hrm', 'evaluation', 'read') || $user->hasRight('hrm', 'compare_advance', 'read'))); } // Leave/Holiday/Vacation module @@ -2402,7 +2402,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("CPTitreMenu"), 0, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday', 0, '', '', '', img_picto('', 'holiday', 'class="paddingright pictofixedwidth"')); $newmenu->add("/holiday/card.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("New"), 1, $user->hasRight('holiday', 'write'), '', $mainmenu); - $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm'); + $newmenu->add("/holiday/card_group.php?mainmenu=hrm&leftmenu=holiday&action=create", $langs->trans("NewHolidayForGroup"), 1, (int) ($user->hasRight('holiday', 'writeall') && $user->hasRight('holiday', 'readall')), '', $mainmenu, 'holiday_sm'); $newmenu->add("/holiday/list.php?mainmenu=hrm&leftmenu=holiday", $langs->trans("List"), 1, $user->hasRight('holiday', 'read'), '', $mainmenu); if ($usemenuhider || empty($leftmenu) || $leftmenu == "holiday") { $newmenu->add("/holiday/list.php?search_status=1&mainmenu=hrm&leftmenu=holiday", $langs->trans("DraftCP"), 2, $user->hasRight('holiday', 'read'), '', $mainmenu, 'holiday_sm'); @@ -2439,7 +2439,7 @@ function get_left_menu_hrm($mainmenu, &$newmenu, $usemenuhider = 1, $leftmenu = $newmenu->add("/expensereport/list.php?search_status=4&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Canceled"), 2, $user->hasRight('expensereport', 'lire')); $newmenu->add("/expensereport/list.php?search_status=99&leftmenu=expensereport&mainmenu=hrm", $langs->trans("Refused"), 2, $user->hasRight('expensereport', 'lire')); } - $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, ($user->hasRight('expensereport', 'lire')) && isModEnabled('bank')); + $newmenu->add("/expensereport/payment/list.php?leftmenu=expensereport_payments&mainmenu=hrm", $langs->trans("Payments"), 1, (int) (int) ($user->hasRight('expensereport', 'lire') && isModEnabled('bank'))); $newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&mainmenu=hrm", $langs->trans("Statistics"), 1, $user->hasRight('expensereport', 'lire')); } From 4eeb0bdf5825b0bb691be909fa73a6b35b01d195 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 02:01:46 +0100 Subject: [PATCH 163/375] Qual: Update phan baseline --- dev/tools/phan/baseline.txt | 39 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 27 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index ca2ed9bfd30..120481e2752 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,13 +9,13 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 3660+ occurrences + // PhanTypeMismatchArgument : 3560+ occurrences // PhanUndeclaredProperty : 530+ occurrences // PhanTypeMismatchArgumentNullable : 450+ occurrences // PhanUndeclaredGlobalVariable : 190+ occurrences // PhanPluginUnknownArrayMethodReturnType : 180+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 170+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 140+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 160+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 130+ occurrences // PhanTypeMismatchProperty : 130+ occurrences // PhanPluginUnknownArrayMethodParamType : 110+ occurrences // PhanRedefineFunction : 40+ occurrences @@ -28,9 +28,9 @@ return [ // PhanTypeComparisonFromArray : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences // PhanPluginUnknownObjectMethodCall : 8 occurrences - // PhanPluginEmptyStatementIf : 7 occurrences // PhanPluginSuspiciousParamPosition : 7 occurrences // PhanPluginDuplicateExpressionBinaryOp : 6 occurrences + // PhanPluginEmptyStatementIf : 6 occurrences // PhanTypeArraySuspiciousNull : 6 occurrences // PhanEmptyForeach : 5 occurrences // PhanParamTooMany : 5 occurrences @@ -245,7 +245,7 @@ return [ 'htdocs/compta/bank/class/api_bankaccounts.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/bank/class/paymentvarious.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/graph.php' => ['PhanTypeMismatchArgument'], - 'htdocs/compta/bank/line.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'], + 'htdocs/compta/bank/line.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/compta/bank/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/releve.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/bank/transfer.php' => ['PhanTypeMismatchArgument'], @@ -376,16 +376,13 @@ return [ 'htdocs/core/class/fileupload.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/fiscalyear.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/hookmanager.class.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/class/html.form.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/core/class/html.formcategory.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/class/html.form.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/class/html.formcompany.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/core/class/html.formfile.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/core/class/html.formmail.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/core/class/html.formorder.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/html.formother.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/html.formprojet.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/html.formsetup.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/core/class/html.formticket.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/link.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/class/menubase.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/notify.class.php' => ['PhanUndeclaredProperty'], @@ -418,7 +415,6 @@ return [ 'htdocs/core/login/functions_dolibarr.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/login/functions_ldap.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/menus/standard/eldy.lib.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/action/doc/pdf_standard_actions.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], @@ -525,7 +521,6 @@ return [ 'htdocs/core/search_page.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/admin_extrafields_add.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/admin_extrafields_edit.tpl.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/tpl/advtarget.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/extrafields_list_array_fields.tpl.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/tpl/extrafields_list_print_fields.tpl.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/tpl/extrafields_view.tpl.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], @@ -553,7 +548,6 @@ return [ 'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/don/list.php' => ['PhanTypeMismatchProperty'], 'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/don/stats/index.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/class/ecmdirectory.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/class/ecmfiles.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/ecm/dir_add_card.php' => ['PhanTypeMismatchArgument'], @@ -634,26 +628,17 @@ return [ 'htdocs/hrm/skill_card.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/imports/import.php' => ['PhanTypeMismatchArgument'], 'htdocs/intracommreport/card.php' => ['PhanUndeclaredGlobalVariable'], - 'htdocs/intracommreport/class/intracommreport.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/intracommreport/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/knowledgemanagement/class/api_knowledgemanagement.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], - 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/knowledgemanagement/core/modules/knowledgemanagement/mod_knowledgerecord_advanced.php' => ['PhanTypeMismatchArgument'], - 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanPluginEmptyStatementIf', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/knowledgemanagement/knowledgerecord_list.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/loan/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/loan/class/loan.class.php' => ['PhanTypeMismatchArgument'], + 'htdocs/knowledgemanagement/class/knowledgerecord.class.php' => ['PhanUndeclaredProperty'], + 'htdocs/knowledgemanagement/knowledgerecord_card.php' => ['PhanTypeMismatchArgument'], 'htdocs/loan/class/paymentloan.class.php' => ['PhanTypeMismatchArgument'], - 'htdocs/loan/document.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/loan/note.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/loan/payment/payment.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/loan/schedule.php' => ['PhanTypeMismatchArgument'], - 'htdocs/main.inc.php' => ['PhanTypeMismatchArgument'], + 'htdocs/loan/document.php' => ['PhanUndeclaredProperty'], + 'htdocs/loan/note.php' => ['PhanUndeclaredProperty'], + 'htdocs/loan/payment/payment.php' => ['PhanUndeclaredProperty'], 'htdocs/margin/agentMargins.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/margin/customerMargins.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/margin/productMargins.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/margin/tabs/productMargins.php' => ['PhanTypeMismatchArgument'], - 'htdocs/master.inc.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], 'htdocs/modulebuilder/index.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/modulebuilder/template/admin/setup.php' => ['PhanTypeMismatchArgument'], 'htdocs/modulebuilder/template/ajax/myobject.php' => ['PhanTypeMismatchArgument'], @@ -878,7 +863,7 @@ return [ 'htdocs/societe/list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/paymentmodes.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], 'htdocs/societe/price.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/societe/tpl/linesalesrepresentative.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/societe/website.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/stripe/admin/stripe.php' => ['PhanTypeMismatchArgument'], 'htdocs/stripe/charge.php' => ['PhanTypeMismatchArgument'], From 2e30ae50ac20da1aca7322e74da490a266fe3737 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 02:49:41 +0100 Subject: [PATCH 164/375] Qual: fix phpstan notices after fixing phan notices --- dev/tools/phan/baseline.txt | 5 +---- htdocs/admin/boxes.php | 4 ++-- htdocs/core/boxes/box_produits.php | 6 +++--- htdocs/core/boxes/box_produits_alerte_stock.php | 6 +++--- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 120481e2752..1c639a11b22 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,7 +9,7 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 3560+ occurrences + // PhanTypeMismatchArgument : 3540+ occurrences // PhanUndeclaredProperty : 530+ occurrences // PhanTypeMismatchArgumentNullable : 450+ occurrences // PhanUndeclaredGlobalVariable : 190+ occurrences @@ -97,7 +97,6 @@ return [ 'htdocs/admin/bank.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/barcode.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'], - 'htdocs/admin/boxes.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/chequereceipts.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/company.php' => ['PhanTypeMismatchArgument'], 'htdocs/admin/contract.php' => ['PhanTypeMismatchArgument'], @@ -349,8 +348,6 @@ return [ 'htdocs/core/ajax/loadinplace.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/ajax/saveinplace.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/ajax/selectobject.php' => ['PhanTypeMismatchArgumentNullable'], - 'htdocs/core/boxes/box_produits.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/boxes/box_produits_alerte_stock.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/class/CMailFile.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'], 'htdocs/core/class/ccountry.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index 07f6779fd90..11955d4ae4f 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2022 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -471,7 +471,7 @@ print '
'; print '
'; -print $form->buttonsSaveCancel("Save", '', array(), 0, 'reposition'); +print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition'); print ''; print "\n".''."\n"; diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index db7710e960b..5e622fd0792 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015-2023 Frederic France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -52,7 +52,7 @@ class box_produits extends ModeleBoxes $this->db = $db; $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); - $tmpentry = array('enabled' => (isModEnabled("product") || isModEnabled("service")), 'perms' => ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module' => 'product|service'); + $tmpentry = array('enabled' => (int) (isModEnabled("product") || isModEnabled("service")), 'perms' => (string) (int) ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module' => 'product|service'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); $this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create'; @@ -167,7 +167,7 @@ class box_produits extends ModeleBoxes $price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc); } else { //Parse the dynamic price - $productstatic->fetch($objp->rowid, '', '', 1); + $productstatic->fetch($objp->rowid, '', '', '1'); require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $priceparser = new PriceParser($this->db); diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index f2a18d04ccc..fc5448fed47 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Maxime Kohlhaas * Copyright (C) 2015-2021 Frédéric France * Copyright (C) 2015 Juanjo Menent - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -54,7 +54,7 @@ class box_produits_alerte_stock extends ModeleBoxes $this->db = $db; $listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); - $tmpentry = array('enabled' => ((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms' => $user->hasRight('stock', 'lire'), 'module' => 'product|service|stock'); + $tmpentry = array('enabled' => (int) ((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms' => (string) (int) $user->hasRight('stock', 'lire'), 'module' => 'product|service|stock'); $showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal); $this->hidden = ($showmode != 1); $this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create'; @@ -163,7 +163,7 @@ class box_produits_alerte_stock extends ModeleBoxes $price_base_type = $langs->trans($objp->price_base_type); $price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc); } else { //Parse the dynamic price - $productstatic->fetch($objp->rowid, '', '', 1); + $productstatic->fetch($objp->rowid, '', '', '1'); require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php'; $priceparser = new PriceParser($this->db); From 7841b55813ab7e1abdb90f80a3168b9ffd32315c Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 23:04:36 +0100 Subject: [PATCH 165/375] Qual: Fix MultiCell 'fill' argument type --- .../phan/plugins/setPageOrientationFixer.php | 176 ++++++++++++++++++ .../action/doc/pdf_standard_actions.class.php | 14 +- .../bank/doc/pdf_sepamandate.modules.php | 14 +- .../modules/cheque/doc/pdf_blochet.class.php | 14 +- .../commande/doc/pdf_einstein.modules.php | 60 +++--- .../commande/doc/pdf_eratosthene.modules.php | 56 +++--- .../contract/doc/pdf_strato.modules.php | 4 +- .../expedition/doc/pdf_merou.modules.php | 18 +- .../expedition/doc/pdf_rouget.modules.php | 16 +- .../pdf_standard_expensereport.modules.php | 30 +-- .../modules/facture/doc/pdf_crabe.modules.php | 122 ++++++------ .../facture/doc/pdf_octopus.modules.php | 171 +++++++++-------- .../facture/doc/pdf_sponge.modules.php | 130 ++++++------- .../fichinter/doc/pdf_soleil.modules.php | 8 +- .../doc/pdf_standard_evaluation.modules.php | 4 +- .../pdf_standard_movementstock.modules.php | 6 +- .../modules/mrp/doc/pdf_vinci.modules.php | 42 ++--- .../modules/propale/doc/pdf_azur.modules.php | 60 +++--- .../modules/propale/doc/pdf_cyan.modules.php | 56 +++--- .../modules/rapport/pdf_paiement.class.php | 28 +-- .../reception/doc/pdf_squille.modules.php | 14 +- .../stock/doc/pdf_standard_stock.modules.php | 6 +- .../stocktransfer/doc/pdf_eagle.modules.php | 12 +- .../doc/pdf_eagle_proforma.modules.php | 22 +-- .../doc/pdf_canelle.modules.php | 70 +++---- .../supplier_order/doc/pdf_cornas.modules.php | 42 ++--- .../doc/pdf_muscadet.modules.php | 46 ++--- .../pdf_standard_supplierpayment.modules.php | 28 +-- .../doc/pdf_aurore.modules.php | 46 ++--- .../doc/pdf_zenith.modules.php | 44 ++--- .../doc/pdf_standard_myobject.modules.php | 2 +- ...tandard_recruitmentjobposition.modules.php | 2 +- 32 files changed, 769 insertions(+), 594 deletions(-) create mode 100644 dev/tools/phan/plugins/setPageOrientationFixer.php diff --git a/dev/tools/phan/plugins/setPageOrientationFixer.php b/dev/tools/phan/plugins/setPageOrientationFixer.php new file mode 100644 index 00000000000..657241ca155 --- /dev/null +++ b/dev/tools/phan/plugins/setPageOrientationFixer.php @@ -0,0 +1,176 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $details = (string) $instance->getTemplateParameters()[4]; + $functionlike = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDI::setPageOrientation()"; + $expected_name = "setPageOrientation"; + if ($functionlike !== $expected_functionlike) { + print "$functionlike != '$expected_functionlike'".PHP_EOL; + return null; + } + + $toBoolReplaceArray=array("0"=>"false","1"=>"true"); + // Check if we fix any of this + if ( + ($argument_name === 'argument_name' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_name]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = ""; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + // print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $stringValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + && $arg->expression instanceof StringLiteral + ) { + // Get the string value of the StringLiteral + $stringValue = $arg->expression->getStringContentsText(); + print "String is '$stringValue'".PHP_EOL; + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $stringValue = ''; // Fake empty + } else { + print "Expression is not string or null ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($stringValue !== $expectedStringValue) { + print "Not replacing $argument_name which is '$stringValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$stringValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php index 83b6a9ec13b..f61d8b09760 100644 --- a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php +++ b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Nick Fragoulis * @@ -366,12 +366,12 @@ class pdf_standard_actions } } $textdate = $outputlangs->trans("ID").' '.$obj->id.' - '.$textdate; - $pdf->MultiCell(45 - $this->marge_gauche, $height, $textdate, 0, 'L', 0); + $pdf->MultiCell(45 - $this->marge_gauche, $height, $textdate, 0, 'L', false); $y0 = $pdf->GetY(); // Third party $pdf->SetXY(45, $y); - $pdf->MultiCell(28, $height, dol_trunc($outputlangs->convToOutputCharset($obj->thirdparty), 28), 0, 'L', 0); + $pdf->MultiCell(28, $height, dol_trunc($outputlangs->convToOutputCharset($obj->thirdparty), 28), 0, 'L', false); $y1 = $pdf->GetY(); // Action code @@ -387,12 +387,12 @@ class pdf_standard_actions $pdf->SetXY(73, $y); $labelactiontype = $outputlangs->transnoentitiesnoconv("Action".$code); $labelactiontypeshort = $outputlangs->transnoentitiesnoconv("Action".$code.'Short'); - $pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($labelactiontypeshort == "Action".$code.'Short' ? $labelactiontype : $labelactiontypeshort), 32), 0, 'L', 0); + $pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($labelactiontypeshort == "Action".$code.'Short' ? $labelactiontype : $labelactiontypeshort), 32), 0, 'L', false); $y2 = $pdf->GetY(); // Description of event $pdf->SetXY(106, $y); - $pdf->MultiCell(94, $height, $outputlangs->convToOutputCharset(dol_trunc(dol_string_nohtmltag($text, 0), 250, 'right', 'UTF-8', 0)), 0, 'L', 0); + $pdf->MultiCell(94, $height, $outputlangs->convToOutputCharset(dol_trunc(dol_string_nohtmltag($text, 0), 250, 'right', 'UTF-8', 0)), 0, 'L', false); $y3 = $pdf->GetY(); $i++; @@ -421,11 +421,11 @@ class pdf_standard_actions // Show title $pdf->SetFont('', 'B', 10); $pdf->SetXY($this->marge_gauche, $this->marge_haute); - $pdf->MultiCell(120, 1, $outputlangs->convToOutputCharset($this->title), 0, 'L', 0); + $pdf->MultiCell(120, 1, $outputlangs->convToOutputCharset($this->title), 0, 'L', false); // Show page nb only on iso languages (so default Helvetica font) if (pdf_getPDFFont($outputlangs) == 'Helvetica') { $pdf->SetXY($this->page_largeur - $this->marge_droite - 40, $this->marge_haute); - $pdf->MultiCell(40, 1, $pagenb.'/'.$pdf->getAliasNbPages(), 0, 'R', 0); + $pdf->MultiCell(40, 1, $pagenb.'/'.$pdf->getAliasNbPages(), 0, 'R', false); } $y = $pdf->GetY() + 2; diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index be1a81ddfac..eef507075db 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2020 Josep Lluís Amador - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 Nick Fragoulis * @@ -526,13 +526,13 @@ class pdf_sepamandate extends ModeleBankAccountDoc $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size); - $pdf->MultiCell(100, 3, $outputlangs->transnoentitiesnoconv("PleaseReturnMandate", $mysoc->email).':', 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentitiesnoconv("PleaseReturnMandate", $mysoc->email).':', 0, 'L', false); $posy = $pdf->GetY() + 2; $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 6, $mysoc->name, 0, 'L', 0); - $pdf->MultiCell(100, 6, $outputlangs->convToOutputCharset($mysoc->getFullAddress(1)), 0, 'L', 0); + $pdf->MultiCell(100, 6, $mysoc->name, 0, 'L', false); + $pdf->MultiCell(100, 6, $outputlangs->convToOutputCharset($mysoc->getFullAddress(1)), 0, 'L', false); $posy = $pdf->GetY() + 2; return $posy; @@ -562,9 +562,9 @@ class pdf_sepamandate extends ModeleBankAccountDoc $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell(100, 3, $outputlangs->transnoentitiesnoconv("DateSigning"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentitiesnoconv("DateSigning"), 0, 'L', false); $pdf->MultiCell(100, 3, ' '); - $pdf->MultiCell(100, 3, '______________________', 0, 'L', 0); + $pdf->MultiCell(100, 3, '______________________', 0, 'L', false); $posx = $this->xPosSignArea; $largcol = ($this->page_largeur - $this->marge_droite - $posx); @@ -572,7 +572,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($posx, $tab_top); - $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentitiesnoconv("Signature"), 0, 'L', 1); + $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentitiesnoconv("Signature"), 0, 'L', true); $pdf->SetXY($posx, $tab_top + $tab_hl); //$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index a5c00ad81bd..e69f8b24ac8 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2009-2015 Laurent Destailleur * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify @@ -325,7 +325,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $pdf->SetFont('', 'B', $default_font_size); $pdf->SetXY(170, $posy + 1); - $pdf->MultiCell(31, 2, price($this->amount), 0, 'C', 0); + $pdf->MultiCell(31, 2, price($this->amount), 0, 'C', false); // Tableau $pdf->SetFont('', '', $default_font_size - 2); @@ -402,19 +402,19 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $lineinpage += $nb_lines; $pdf->SetXY(1, $this->tab_top + 10 + $yp); - $pdf->MultiCell(8, $this->line_height, $j + 1, 0, 'R', 0); + $pdf->MultiCell(8, $this->line_height, $j + 1, 0, 'R', false); $pdf->SetXY(10, $this->tab_top + 10 + $yp); - $pdf->MultiCell(30, $this->line_height, $this->lines[$j]->num_chq ? $this->lines[$j]->num_chq : '', 0, 'L', 0); + $pdf->MultiCell(30, $this->line_height, $this->lines[$j]->num_chq ? $this->lines[$j]->num_chq : '', 0, 'L', false); $pdf->SetXY(40, $this->tab_top + 10 + $yp); - $pdf->MultiCell(60, $this->line_height, $outputlangs->convToOutputCharset($this->lines[$j]->bank_chq, 44), 0, 'L', 0); + $pdf->MultiCell(60, $this->line_height, $outputlangs->convToOutputCharset($this->lines[$j]->bank_chq, 44), 0, 'L', false); $pdf->SetXY(100, $this->tab_top + 10 + $yp); - $pdf->MultiCell(80, $this->line_height, $outputlangs->convToOutputCharset($this->lines[$j]->emetteur_chq, 50), 0, 'L', 0); + $pdf->MultiCell(80, $this->line_height, $outputlangs->convToOutputCharset($this->lines[$j]->emetteur_chq, 50), 0, 'L', false); $pdf->SetXY(180, $this->tab_top + 10 + $yp); - $pdf->MultiCell(20, $this->line_height, price($this->lines[$j]->amount_chq), 0, 'R', 0); + $pdf->MultiCell(20, $this->line_height, price($this->lines[$j]->amount_chq), 0, 'R', false); $yp += ($this->line_height * $nb_lines); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 39c393568bf..43733946c25 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -470,7 +470,7 @@ class pdf_einstein extends ModelePDFCommandes // Unit price before discount $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', false); // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); @@ -495,7 +495,7 @@ class pdf_einstein extends ModelePDFCommandes // Total HT line $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', false); // Collection of totals by value of vat in $this->vat["rate"] = total_tva if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { @@ -732,7 +732,7 @@ class pdf_einstein extends ModelePDFCommandes if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -843,26 +843,26 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } if ($conf->global->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); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -949,18 +949,18 @@ class pdf_einstein extends ModelePDFCommandes if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); $index++; // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -968,11 +968,11 @@ class pdf_einstein extends ModelePDFCommandes // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -1011,12 +1011,12 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1047,12 +1047,12 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1081,10 +1081,10 @@ class pdf_einstein extends ModelePDFCommandes } else { $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', true); } } @@ -1117,12 +1117,12 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1157,12 +1157,12 @@ class pdf_einstein extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1173,10 +1173,10 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); } } @@ -1197,18 +1197,18 @@ class pdf_einstein extends ModelePDFCommandes $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -1614,7 +1614,7 @@ class pdf_einstein extends ModelePDFCommandes // Show shipping frame $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); + $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', false); $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 1362556387d..65075ab0ba6 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -949,7 +949,7 @@ class pdf_eratosthene extends ModelePDFCommandes if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -1059,26 +1059,26 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } if ($conf->global->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); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -1165,18 +1165,18 @@ class pdf_eratosthene extends ModelePDFCommandes if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); $index++; // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1184,10 +1184,10 @@ class pdf_eratosthene extends ModelePDFCommandes // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -1225,12 +1225,12 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1261,12 +1261,12 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1295,10 +1295,10 @@ class pdf_eratosthene extends ModelePDFCommandes } else { $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', true); } } @@ -1329,12 +1329,12 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1367,12 +1367,12 @@ class pdf_eratosthene extends ModelePDFCommandes $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1383,10 +1383,10 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalTTC", $mysoc->country_code) : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); } } @@ -1407,18 +1407,18 @@ class pdf_eratosthene extends ModelePDFCommandes $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -1810,7 +1810,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Show shipping frame $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); + $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', false); $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index f5f86c6008a..ea44c428b90 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -591,7 +591,7 @@ class pdf_strato extends ModelePDFContract if (!getDolGlobalString('CONTRACT_HIDE_MYCOMPANY_SIGNATURE_SECTION_PDF')) { $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 5, $outputlangs->transnoentities("ContactNameAndSignature", $this->emetteur->name), 0, 'L', 0); + $pdf->MultiCell($posmiddle - $this->marge_gauche - 5, 5, $outputlangs->transnoentities("ContactNameAndSignature", $this->emetteur->name), 0, 'L', false); $pdf->SetXY($this->marge_gauche, $posy + 5); $pdf->RoundedRect($this->marge_gauche, $posy + 5, $posmiddle - $this->marge_gauche - 5, 20, $this->corner_radius, '1234', 'D'); @@ -599,7 +599,7 @@ class pdf_strato extends ModelePDFContract if (!getDolGlobalString('CONTRACT_HIDE_THIRPARTY_SIGNATURE_SECTION_PDF')) { $pdf->SetXY($posmiddle + 5, $posy); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 5, $outputlangs->transnoentities("ContactNameAndSignature", $this->recipient->name), 0, 'L', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $posmiddle - 5, 5, $outputlangs->transnoentities("ContactNameAndSignature", $this->recipient->name), 0, 'L', false); $pdf->SetXY($posmiddle + 5, $posy + 5); $pdf->RoundedRect($posmiddle + 5, $posy + 5, $this->page_largeur - $this->marge_droite - $posmiddle - 5, 20, $this->corner_radius, '1234', 'D'); diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index d54d831adb1..6178f9efc1e 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -324,13 +324,13 @@ class pdf_merou extends ModelePdfExpedition //Inserting the product reference $pdf->SetXY(30, $curY); $pdf->SetFont('', 'B', $default_font_size - 3); - $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0); + $pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', false); $pdf->SetXY(140, $curY); - $pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0); + $pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', false); $pdf->SetXY(170, $curY); - $pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'C', 0); + $pdf->MultiCell(30, 3, $object->lines[$i]->qty_shipped, 0, 'C', false); // Add line if (getDolGlobalString('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) { @@ -441,19 +441,19 @@ class pdf_merou extends ModelePdfExpedition if (empty($hidetop)) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY(10, $tab_top); - $pdf->MultiCell(10, 5, "LS", 0, 'C', 1); + $pdf->MultiCell(10, 5, "LS", 0, 'C', true); $pdf->line(20, $tab_top, 20, $tab_top + $tab_height); $pdf->SetXY(20, $tab_top); - $pdf->MultiCell(10, 5, "LR", 0, 'C', 1); + $pdf->MultiCell(10, 5, "LR", 0, 'C', true); $pdf->line(30, $tab_top, 30, $tab_top + $tab_height); $pdf->SetXY(30, $tab_top); - $pdf->MultiCell(20, 5, $outputlangs->transnoentities("Ref"), 0, 'C', 1); + $pdf->MultiCell(20, 5, $outputlangs->transnoentities("Ref"), 0, 'C', true); $pdf->SetXY(50, $tab_top); - $pdf->MultiCell(90, 5, $outputlangs->transnoentities("Description"), 0, 'L', 1); + $pdf->MultiCell(90, 5, $outputlangs->transnoentities("Description"), 0, 'L', true); $pdf->SetXY(140, $tab_top); - $pdf->MultiCell(30, 5, $outputlangs->transnoentities("QtyOrdered"), 0, 'C', 1); + $pdf->MultiCell(30, 5, $outputlangs->transnoentities("QtyOrdered"), 0, 'C', true); $pdf->SetXY(170, $tab_top); - $pdf->MultiCell(30, 5, $outputlangs->transnoentities("QtyToShip"), 0, 'C', 1); + $pdf->MultiCell(30, 5, $outputlangs->transnoentities("QtyToShip"), 0, 'C', true); } $pdf->RoundedRect(10, $tab_top, 190, $tab_height, $this->corner_radius, '1234', 'D'); } diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index d10193f90b0..1a9c3d34fd0 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018-2025 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Nick Fragoulis * Copyright (C) 2024 Alexandre Spangaro * @@ -781,37 +781,37 @@ class pdf_rouget extends ModelePdfExpedition $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', true); if (!getDolGlobalString('SHIPPING_PDF_HIDE_ORDERED')) { $pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1); + $pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', true); } if (!getDolGlobalString('SHIPPING_PDF_HIDE_QTYTOSHIP')) { $pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1); + $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', true); } if (getDolGlobalString('SHIPPING_PDF_DISPLAY_AMOUNT_HT')) { $pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1); + $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', true); $pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', true); } if (!getDolGlobalString('SHIPPING_PDF_HIDE_WEIGHT_AND_VOLUME')) { // Total Weight if ($totalWeighttoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', true); $index++; } if ($totalVolumetoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', true); $index++; } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index 52d72c00e62..d98ea1a7ec4 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -1045,19 +1045,19 @@ class pdf_standard_expensereport extends ModeleExpenseReport $pdf->SetFont('', '', $default_font_size - 2); $pdf->SetXY($tab3_posx, $tab3_top - 4); $pdf->SetTextColor(0, 0, 0); - $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + $pdf->MultiCell(60, 3, $title, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width + 2, $tab3_top); // Top border line of table title $pdf->SetXY($tab3_posx, $tab3_top + 1); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Date"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Date"), 0, 'L', false); $pdf->SetXY($tab3_posx + 19, $tab3_top + 1); // Old value 17 - $pdf->MultiCell(15, 3, $outputlangs->transnoentities("Amount"), 0, 'C', 0); + $pdf->MultiCell(15, 3, $outputlangs->transnoentities("Amount"), 0, 'C', false); $pdf->SetXY($tab3_posx + 45, $tab3_top + 1); - $pdf->MultiCell(35, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->MultiCell(35, 3, $outputlangs->transnoentities("Type"), 0, 'L', false); if (isModEnabled("bank")) { $pdf->SetXY($tab3_posx + 65, $tab3_top + 1); - $pdf->MultiCell(25, 3, $outputlangs->transnoentities("BankAccount"), 0, 'L', 0); + $pdf->MultiCell(25, 3, $outputlangs->transnoentities("BankAccount"), 0, 'L', false); } $pdf->line($tab3_posx, $tab3_top + $tab3_height, $tab3_posx + $tab3_width + 2, $tab3_top + $tab3_height); // Bottom border line of table title @@ -1088,16 +1088,16 @@ class pdf_standard_expensereport extends ModeleExpenseReport $row = $this->db->fetch_object($resql); $pdf->SetXY($tab3_posx, $tab3_top + $y + 1); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->dp), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->dp), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 20, $tab3_top + $y + 1); - $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * $row->amount, 0, $outputlangs), 0, 'L', false); $pdf->SetXY($tab3_posx + 45, $tab3_top + $y + 1); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->p_code); - $pdf->MultiCell(40, 3, $oper, 0, 'L', 0); + $pdf->MultiCell(40, 3, $oper, 0, 'L', false); if (isModEnabled("bank")) { $pdf->SetXY($tab3_posx + 65, $tab3_top + $y + 1); - $pdf->MultiCell(30, 3, $row->baref, 0, 'L', 0); + $pdf->MultiCell(30, 3, $row->baref, 0, 'L', false); } $pdf->line($tab3_posx, $tab3_top + $y + $tab3_height, $tab3_posx + $tab3_width + 2, $tab3_top + $y + $tab3_height); // Bottom line border of table @@ -1108,20 +1108,20 @@ class pdf_standard_expensereport extends ModeleExpenseReport $y += $tab3_height; $pdf->SetXY($tab3_posx + 17, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($totalpaid), 0, 'R', 0); + $pdf->MultiCell(20, 3, price($totalpaid), 0, 'R', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); - $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AlreadyPaid"), 0, 'L', 0); + $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AlreadyPaid"), 0, 'L', false); $y += $tab3_height - 2; $pdf->SetXY($tab3_posx + 17, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($object->total_ttc), 0, 'R', 0); + $pdf->MultiCell(20, 3, price($object->total_ttc), 0, 'R', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); - $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AmountExpected"), 0, 'L', 0); + $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("AmountExpected"), 0, 'L', false); $y += $tab3_height - 2; $remaintopay = $object->total_ttc - $totalpaid; $pdf->SetXY($tab3_posx + 17, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($remaintopay), 0, 'R', 0); + $pdf->MultiCell(20, 3, price($remaintopay), 0, 'R', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); - $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("RemainderToPay"), 0, 'L', 0); + $pdf->MultiCell(30, 4, $outputlangs->transnoentitiesnoconv("RemainderToPay"), 0, 'L', false); } } else { $this->error = $this->db->lasterror(); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 97c8787a3ee..1e5d131662b 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -486,7 +486,7 @@ class pdf_crabe extends ModelePDFFactures if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $pdf->SetXY($this->marge_gauche + 30, $pdf->GetY() - 15); $pdf->SetFont('', '', $default_font_size - 4); - $pdf->MultiCell(40, 3, $langs->transnoentitiesnoconv("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', 0); + $pdf->MultiCell(40, 3, $langs->transnoentitiesnoconv("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', false); } } @@ -688,7 +688,7 @@ class pdf_crabe extends ModelePDFFactures // Unit price before discount $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', false); // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); @@ -719,7 +719,7 @@ class pdf_crabe extends ModelePDFFactures // Total HT line $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', false); $sign = 1; @@ -1030,13 +1030,13 @@ class pdf_crabe extends ModelePDFFactures $invoice->fetch($obj->fk_facture_source); $pdf->SetXY($tab3_posx, $tab3_top + $y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); - $pdf->MultiCell(20, 3, $text, 0, 'L', 0); + $pdf->MultiCell(20, 3, $text, 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); - $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); + $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); @@ -1082,16 +1082,16 @@ class pdf_crabe extends ModelePDFFactures $row = $this->db->fetch_object($resql); $pdf->SetXY($tab3_posx, $tab3_top + $y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); - $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); + $pdf->MultiCell(20, 3, $oper, 0, 'L', false); $maxY = max($pdf->GetY() - $tab3_top - 3, $maxY); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); - $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); + $pdf->MultiCell(30, 3, $row->num, 0, 'L', false); $y = $maxY = max($pdf->GetY() - $tab3_top - 3, $maxY); $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); $y += 3; @@ -1130,19 +1130,19 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 3); $pdf->SetXY($tab3_posx, $tab3_top - 4); - $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + $pdf->MultiCell(60, 3, $title, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top); $pdf->SetFont('', '', $default_font_size - 4); $pdf->SetXY($tab3_posx, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', false); $pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height); } @@ -1236,12 +1236,12 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); if (empty($mysoc->tva_assuj)) { if ($mysoc->forme_juridique_code == 92) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', false); } else { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); } } elseif (getDolGlobalString("INVOICE_VAT_SHOW_REVERSE_CHARGE_MENTION") && $this->emetteur->country_code != $object->thirdparty->country_code && $this->emetteur->isInEEC() && $object->thirdparty->isInEEC()) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', false); } $posy = $pdf->GetY() + 4; } @@ -1298,7 +1298,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup", $object->mode_reglement_code); - $pdf->MultiCell(80, 3, $this->error, 0, 'L', 0); + $pdf->MultiCell(80, 3, $this->error, 0, 'L', false); $pdf->SetTextColor(0, 0, 0); $posy = $pdf->GetY() + 1; @@ -1381,26 +1381,26 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } 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); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -1428,7 +1428,7 @@ class pdf_crabe extends ModelePDFFactures include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); } } } @@ -1503,18 +1503,18 @@ class pdf_crabe extends ModelePDFFactures if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); $index++; // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1522,20 +1522,20 @@ class pdf_crabe extends ModelePDFFactures // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', true); if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { $index++; $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', true); } // Show VAT by rates and total @@ -1577,12 +1577,12 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1614,12 +1614,12 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1649,9 +1649,9 @@ class pdf_crabe extends ModelePDFFactures } else { $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', true); } } } @@ -1682,12 +1682,12 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1717,12 +1717,12 @@ class pdf_crabe extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } @@ -1730,10 +1730,10 @@ class pdf_crabe extends ModelePDFFactures if (price2num($object->revenuestamp, 'MT') != 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', true); } // Total TTC @@ -1741,10 +1741,10 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); // Retained warranty if ($object->displayRetainedWarranty()) { @@ -1757,10 +1757,10 @@ class pdf_crabe extends ModelePDFFactures // Billed - retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', true); // retained warranty $index++; @@ -1769,9 +1769,9 @@ class pdf_crabe extends ModelePDFFactures $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty").' ('.$object->retained_warranty.'%)'; $retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("toPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', true); } } } @@ -1789,18 +1789,18 @@ class pdf_crabe extends ModelePDFFactures // Already paid + Deposits $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); // Credit note if ($creditnoteamount) { $labeltouse = ($outputlangs->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangs->transnoentities("CreditNotesOrExcessReceived") : $outputlangs->transnoentities("CreditNotes"); $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', false); } // Escompte @@ -1809,9 +1809,9 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', true); $resteapayer = 0; } @@ -1820,9 +1820,9 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -1834,7 +1834,7 @@ class pdf_crabe extends ModelePDFFactures $index++; $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, getDolGlobalString('BILL_TEXT_TOTAL_FOOTER'), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, getDolGlobalString('BILL_TEXT_TOTAL_FOOTER'), 0, 'L', false); } return ($tab2_top + ($tab2_hl * $index)); @@ -2338,7 +2338,7 @@ class pdf_crabe extends ModelePDFFactures // Show shipping frame $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); + $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', false); $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index 067a3a126b1..e80737f02f5 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -1210,19 +1210,19 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 3); $pdf->SetXY($tab3_posx, $tab3_top - 4); - $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + $pdf->MultiCell(60, 3, $title, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top); $pdf->SetFont('', '', $default_font_size - 4); $pdf->SetXY($tab3_posx, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', false); $pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height); @@ -1259,13 +1259,13 @@ class pdf_octopus extends ModelePDFFactures $invoice->fetch($obj->fk_facture_source); $pdf->SetXY($tab3_posx, $tab3_top + $y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); - $pdf->MultiCell(20, 3, $text, 0, 'L', 0); + $pdf->MultiCell(20, 3, $text, 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); - $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); + $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); @@ -1295,16 +1295,16 @@ class pdf_octopus extends ModelePDFFactures while ($i < $num) { $row = $this->db->fetch_object($resql); $pdf->SetXY($tab3_posx, $tab3_top + $y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); - $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); + $pdf->MultiCell(20, 3, $oper, 0, 'L', false); $maxY = max($pdf->GetY() - $tab3_top - 3, $maxY); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); - $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); + $pdf->MultiCell(30, 3, $row->num, 0, 'L', false); $y = $maxY = max($pdf->GetY() - 3 - $tab3_top, $maxY); $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); $y += 3; @@ -1405,12 +1405,12 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); if (empty($mysoc->tva_assuj)) { if ($mysoc->forme_juridique_code == 92) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', false); } else { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); } } elseif (getDolGlobalString("INVOICE_VAT_SHOW_REVERSE_CHARGE_MENTION") && $this->emetteur->country_code != $object->thirdparty->country_code && $this->emetteur->isInEEC() && $object->thirdparty->isInEEC()) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', false); } $posy = $pdf->GetY() + 4; } @@ -1467,7 +1467,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', 'B', $default_font_size - 2); $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup", $object->mode_reglement_code); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $this->error, 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $this->error, 0, 'L', false); $pdf->SetTextColor(0, 0, 0); $posy = $pdf->GetY() + 1; @@ -1565,26 +1565,26 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } if (getDolGlobalString('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); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -1613,7 +1613,7 @@ class pdf_octopus extends ModelePDFFactures include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); } } } @@ -1670,35 +1670,35 @@ class pdf_octopus extends ModelePDFFactures // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + 0); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); $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); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht, 0, $outputlangs), 0, 'R', true); $remise = !empty($object->remise) ? $object->remise : 0; if ($remise > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("DiscountHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("DiscountHT") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("DiscountHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("DiscountHT") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($remise, 0, $outputlangs), 0, 'R', true); $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTWithDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTWithDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTWithDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTWithDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht - $remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht - $remise, 0, $outputlangs), 0, 'R', true); } if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { $index++; $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', true); } // Show VAT by rates and total @@ -1740,12 +1740,12 @@ class pdf_octopus extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1777,12 +1777,12 @@ class pdf_octopus extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1828,10 +1828,10 @@ class pdf_octopus extends ModelePDFFactures } else { $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', true); } } } @@ -1863,12 +1863,12 @@ class pdf_octopus extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1901,12 +1901,12 @@ class pdf_octopus extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1916,10 +1916,10 @@ class pdf_octopus extends ModelePDFFactures if (price2num($object->revenuestamp, 'MT') != 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RevenueStamp", $mysoc->country_code) : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RevenueStamp", $mysoc->country_code) : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', true); } // Total TTC @@ -1927,10 +1927,10 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); // Retained warranty @@ -1944,10 +1944,10 @@ class pdf_octopus extends ModelePDFFactures // Billed - retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', true); // retained warranty $index++; @@ -1956,9 +1956,9 @@ class pdf_octopus extends ModelePDFFactures $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RetainedWarranty") : '').' ('.$object->retained_warranty.'%)'; $retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("toPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', true); } } } @@ -1976,10 +1976,10 @@ class pdf_octopus extends ModelePDFFactures $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); /* if ($object->close_code == 'discount_vat') @@ -2001,9 +2001,9 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -2505,7 +2505,7 @@ class pdf_octopus extends ModelePDFFactures // Show shipping frame $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); + $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', false); $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name @@ -3074,7 +3074,6 @@ class pdf_octopus extends ModelePDFFactures * cumul_anterieur: data from previous status invoice * nouveau_cumul: Cumulative data from all invoices up to the current one * current: current status invoice data - * */ public function getDataSituation(&$object) { @@ -3530,10 +3529,10 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); $label = $outputlangs->transnoentities("SituationInvoiceTotalProposal"); - $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', 0, 1, $posx, $posy + 1); + $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', false, 1, $posx, $posy + 1); $amount = price($sign * ($total_ht + (! empty($propal->remise) ? $propal->remise : 0))); - $pdf->MultiCell($width2, 3, $amount, 0, 'R', 0, 1, $posx + $width, $posy + 1); + $pdf->MultiCell($width2, 3, $amount, 0, 'R', false, 1, $posx + $width, $posy + 1); $pdf->SetFont('', '', $default_font_size - 1); @@ -3599,7 +3598,7 @@ class pdf_octopus extends ModelePDFFactures $ref .= ' - '. $invoice->ref; $ref .= ' ('.dol_print_date($invoice->date, "%d/%m/%Y", false, $outputlangs).')'; - $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', 0); + $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $ref, 0, 'L', false); $pdf->SetFont('', '', $default_font_size - 1); @@ -3612,12 +3611,12 @@ class pdf_octopus extends ModelePDFFactures // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($posx, $posy); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $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); + $pdf->MultiCell($width2, $height, price($sign * ($total_ht + (!empty($invoice->remise) ? $invoice->remise : 0)), 0, $outputlangs), 0, 'R', true); $tvas = array(); $nblines = count($invoice->lines); @@ -3648,10 +3647,10 @@ class pdf_octopus extends ModelePDFFactures } $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($width, $height, $totalvat, 0, 'L', 1); + $pdf->MultiCell($width, $height, $totalvat, 0, 'L', true); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($width2, $height, price($tvaval, 0, $outputlangs), 0, 'R', true); } } @@ -3664,11 +3663,11 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($posx, $posy + $height * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($width2, $height, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); $retainedWarrantyRate = (float) ($object->retained_warranty ? price2num($object->retained_warranty) : price2num(getDolGlobalString('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT', 0))); @@ -3681,13 +3680,13 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($posx, $posy + $height * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(241, 241, 241); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("RetainedWarrantyShort", $retainedWarrantyRate), $useborder, 'L', 1); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("RetainedWarrantyShort", $retainedWarrantyRate), $useborder, 'L', true); $total_ht_rg = (float) price2num(price($total_ht * $retainedWarrantyRate / 100), 'MT'); $total_ttc_rg = (float) price2num(price($total_ttc * $retainedWarrantyRate / 100), 'MT'); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price(-$sign * $total_ht_rg, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($width2, $height, price(-$sign * $total_ht_rg, 0, $outputlangs), $useborder, 'R', true); $total_ht_with_rg = $total_ht - $total_ht_rg; $total_ttc_with_rg = $total_ttc - $total_ttc_rg; @@ -3698,10 +3697,10 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetXY($posx, $posy + $height * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalSituationInvoiceWithRetainedWarranty"), $useborder, 'L', 1); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("TotalSituationInvoiceWithRetainedWarranty"), $useborder, 'L', true); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price($sign * $total_ttc_with_rg, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($width2, $height, price($sign * $total_ttc_with_rg, 0, $outputlangs), $useborder, 'R', true); } @@ -3726,17 +3725,17 @@ class pdf_octopus extends ModelePDFFactures $tot_deja_regle += $deja_regle + $depositsamount; $pdf->SetXY($posx, $posy + $height * $index); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("Paid"), 0, 'L', 0); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("Paid"), 0, 'L', false); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($width2, $height, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); // Credit note if ($creditnoteamount) { $index++; $pdf->SetXY($posx, $posy + $height * $index); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("CreditNotes"), 0, 'L', 0); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("CreditNotes"), 0, 'L', false); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($width2, $height, price($creditnoteamount, 0, $outputlangs), 0, 'R', false); } // Escompte @@ -3745,9 +3744,9 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($posx, $posy + $height * $index); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', true); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price($invoice->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($width2, $height, price($invoice->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', true); $resteapayer = 0; } @@ -3756,9 +3755,9 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($posx, $posy + $height * $index); - $pdf->MultiCell($width, $height, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($width, $height, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($posx + $width, $posy + $height * $index); - $pdf->MultiCell($width2, $height, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($width2, $height, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -3773,7 +3772,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 3); $pdf->SetXY($posx, $posy + $height * $index); - $pdf->MultiCell($width, $height, $title, 0, 'L', 0); + $pdf->MultiCell($width, $height, $title, 0, 'L', false); //$pdf->line($tab3_posx, $tab3_top, $tab3_posx+$tab3_width, $tab3_top); @@ -3783,13 +3782,13 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 4); $pdf->SetXY($posx, $posy + $height * $index); - $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Payment"), 0, 'L', false); $pdf->SetXY($posx + $width4, $posy + $height * $index); - $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Amount"), 0, 'L', false); $pdf->SetXY($posx + $width4 * 2, $posy + $height * $index); - $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Type"), 0, 'L', false); $pdf->SetXY($posx + $width4 * 3, $posy + $height * $index); - $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Num"), 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, $outputlangs->transnoentities("Num"), 0, 'L', false); //$pdf->line($tab3_posx, $tab3_top-1+$tab3_height, $tab3_posx+$tab3_width, $tab3_top-1+$tab3_height); @@ -3802,15 +3801,15 @@ class pdf_octopus extends ModelePDFFactures if (count($payments)) { foreach ($payments as $payment) { $pdf->SetXY($posx, $posy + $height * $index + $y); - $pdf->MultiCell($width4, $height - 1, dol_print_date($this->db->jdate($payment['date']), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, dol_print_date($this->db->jdate($payment['date']), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($posx + $width4, $posy + $height * $index + $y); - $pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, price($sign * $payment['amount'], 0, $outputlangs), 0, 'L', false); $pdf->SetXY($posx + $width4 * 2, $posy + $height * $index + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort" . $payment['type']); - $pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, $oper, 0, 'L', false); $pdf->SetXY($posx + $width4 * 3, $posy + $height * $index + $y); - $pdf->MultiCell($width4, $height - 1, $payment['num'], 0, 'L', 0); + $pdf->MultiCell($width4, $height - 1, $payment['num'], 0, 'L', false); //$pdf->line($tab3_posx, $tab3_top+$y+3, $tab3_posx+$tab3_width, $tab3_top+$y+3); $y += ($height - 1); @@ -3875,10 +3874,10 @@ class pdf_octopus extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetXY($this->marge_gauche, $posy + 1); $label = $outputlangs->transnoentities("SituationTotalRayToRest"); - $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', 0); + $pdf->MultiCell($this->page_largeur - ($this->marge_droite + $this->marge_gauche), 3, $label, 0, 'L', false); $amount = price($remain_to_pay); - $pdf->MultiCell($width2, 3, $amount, 0, 'R', 0, 1, $posx + $width, $posy + 1); + $pdf->MultiCell($width2, 3, $amount, 0, 'R', false, 1, $posx + $width, $posy + 1); $pdf->SetDrawColor(128, 128, 128); //$this->printRect($pdf, $this->marge_gauche, $posy, $this->page_largeur - $this->marge_gauche - $this->marge_droite, 7); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 0474bd6bf61..d34c7146710 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -496,7 +496,7 @@ class pdf_sponge extends ModelePDFFactures if ($object->fk_account > 0 || $object->fk_bank > 0 || getDolGlobalInt('FACTURE_RIB_NUMBER')) { $pdf->SetXY($this->marge_gauche + 30, $pdf->GetY() - 15); $pdf->SetFont('', '', $default_font_size - 4); - $pdf->MultiCell(40, 3, $langs->transnoentitiesnoconv("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', 0); + $pdf->MultiCell(40, 3, $langs->transnoentitiesnoconv("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', false); } } @@ -1141,19 +1141,19 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 3); $pdf->SetXY($tab3_posx, $tab3_top - 4); - $pdf->MultiCell(60, 3, $title, 0, 'L', 0); + $pdf->MultiCell(60, 3, $title, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top); $pdf->SetFont('', '', $default_font_size - 4); $pdf->SetXY($tab3_posx, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', false); $pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height); @@ -1190,13 +1190,13 @@ class pdf_sponge extends ModelePDFFactures $invoice->fetch($obj->fk_facture_source); $pdf->SetXY($tab3_posx, $tab3_top + $y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($obj->datef), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $obj->multicurrency_amount_ttc : $obj->amount_ttc, 0, $outputlangs), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); - $pdf->MultiCell(20, 3, $text, 0, 'L', 0); + $pdf->MultiCell(20, 3, $text, 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); - $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', 0); + $pdf->MultiCell(20, 3, $invoice->ref, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); @@ -1226,16 +1226,16 @@ class pdf_sponge extends ModelePDFFactures while ($i < $num) { $row = $this->db->fetch_object($resql); $pdf->SetXY($tab3_posx, $tab3_top + $y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount), 0, $outputlangs), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); - $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); + $pdf->MultiCell(20, 3, $oper, 0, 'L', false); $maxY = max($pdf->GetY() - $tab3_top - 3, $maxY); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); - $pdf->MultiCell(30, 3, $row->num, 0, 'L', 0); + $pdf->MultiCell(30, 3, $row->num, 0, 'L', false); $y = $maxY = max($pdf->GetY() - 3 - $tab3_top, $maxY); $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); $y += 3; @@ -1336,12 +1336,12 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); if (empty($mysoc->tva_assuj)) { if ($mysoc->forme_juridique_code == 92) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoiceAsso"), 0, 'L', false); } else { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); } } elseif (getDolGlobalString("INVOICE_VAT_SHOW_REVERSE_CHARGE_MENTION") && $this->emetteur->country_code != $object->thirdparty->country_code && $this->emetteur->isInEEC() && $object->thirdparty->isInEEC()) { - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedReverseChargeProcedure"), 0, 'L', false); } $posy = $pdf->GetY() + 4; } @@ -1398,7 +1398,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(200, 0, 0); $pdf->SetFont('', '', $default_font_size - 2); $this->error = $outputlangs->transnoentities("ErrorPaymentModeDefinedToWithoutSetup", $object->mode_reglement_code); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $this->error, 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $this->error, 0, 'L', false); $pdf->SetTextColor(0, 0, 0); $posy = $pdf->GetY() + 1; @@ -1484,26 +1484,26 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } 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); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell($posxend - $this->marge_gauche, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -1546,7 +1546,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($qrPosX + 30, $posy + 5); $pdf->SetFont('', '', $default_font_size - 5); - $pdf->MultiCell(30, 3, $outputlangs->transnoentitiesnoconv("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', 0); + $pdf->MultiCell(30, 3, $outputlangs->transnoentitiesnoconv("INVOICE_ADD_EPC_QR_CODEPay"), 0, 'L', false); $posy = $pdf->GetY() + 2; } @@ -1555,7 +1555,7 @@ class pdf_sponge extends ModelePDFFactures include_once DOL_DOCUMENT_ROOT.'/core/lib/functions_be.lib.php'; $invoicePaymentKey = dolBECalculateStructuredCommunication($object->ref, $object->type); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('StructuredCommunication').": " . $outputlangs->convToOutputCharset($invoicePaymentKey), 0, 'L', false); } } } @@ -1672,7 +1672,7 @@ class pdf_sponge extends ModelePDFFactures $index++; $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $posy); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $fac->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $fac->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', true); $pdf->SetXY($col2x, $posy); @@ -1683,7 +1683,7 @@ class pdf_sponge extends ModelePDFFactures $displayAmount = ' '.$facSign.' '.price($fac->total_ht, 0, $outputlangs); - $pdf->MultiCell($largcol2, $tab2_hl, $displayAmount, 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, $displayAmount, 0, 'R', true); $i++; $posy += $tab2_hl; @@ -1694,7 +1694,7 @@ class pdf_sponge extends ModelePDFFactures // Display current total $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $posy); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $object->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("PDFSituationTitle", $object->situation_counter).' '.$outputlangs->transnoentities("TotalHT"), 0, 'L', true); $pdf->SetXY($col2x, $posy); $facSign = ''; @@ -1708,7 +1708,7 @@ class pdf_sponge extends ModelePDFFactures $displayAmount = ' '.$facSign.' '.price($object->total_ht, 0, $outputlangs); - $pdf->MultiCell($largcol2, $tab2_hl, $displayAmount, 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, $displayAmount, 0, 'R', true); $posy += $tab2_hl; @@ -1716,10 +1716,10 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $posy); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("SituationTotalProgress", $avancementGlobal), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("SituationTotalProgress", $avancementGlobal), 0, 'L', true); $pdf->SetXY($col2x, $posy); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_a_payer * $avancementGlobal / 100, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_a_payer * $avancementGlobal / 100, 0, $outputlangs), 0, 'R', true); $pdf->SetFont('', '', $default_font_size - 2); $posy += $tab2_hl; @@ -1759,18 +1759,18 @@ class pdf_sponge extends ModelePDFFactures if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); $index++; // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1778,20 +1778,20 @@ class pdf_sponge extends ModelePDFFactures // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities(!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') ? "TotalHT" : "Total") : ''), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', true); if (getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS')) { $index++; $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_tva), 0, 'R', true); } // Show VAT by rates and total @@ -1833,12 +1833,12 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1870,12 +1870,12 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1929,10 +1929,10 @@ class pdf_sponge extends ModelePDFFactures } else { $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', true); } } } @@ -1964,12 +1964,12 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -2002,12 +2002,12 @@ class pdf_sponge extends ModelePDFFactures $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -2016,10 +2016,10 @@ class pdf_sponge extends ModelePDFFactures if (price2num($object->revenuestamp, 'MT') != 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RevenueStamp", $mysoc->country_code) : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RevenueStamp").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RevenueStamp", $mysoc->country_code) : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->revenuestamp), $useborder, 'R', true); } // Total TTC @@ -2027,10 +2027,10 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); // Retained warranty @@ -2044,10 +2044,10 @@ class pdf_sponge extends ModelePDFFactures // Billed - retained warranty $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("ToPayOn", dol_print_date($object->date_lim_reglement, 'day')), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($billedWithRetainedWarranty), $useborder, 'R', true); // retained warranty $index++; @@ -2056,9 +2056,9 @@ class pdf_sponge extends ModelePDFFactures $retainedWarrantyToPayOn = $outputlangs->transnoentities("RetainedWarranty").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RetainedWarranty") : '').' ('.$object->retained_warranty.'%)'; $retainedWarrantyToPayOn .= !empty($object->retained_warranty_date_limit) ? ' '.$outputlangs->transnoentities("toPayOn", dol_print_date($object->retained_warranty_date_limit, 'day')) : ''; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $retainedWarrantyToPayOn, $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($retainedWarranty), $useborder, 'R', true); } } } @@ -2077,9 +2077,9 @@ class pdf_sponge extends ModelePDFFactures // Already paid + Deposits $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : ''), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("Paid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); // Credit note if ($creditnoteamount) { @@ -2087,9 +2087,9 @@ class pdf_sponge extends ModelePDFFactures $labeltouse .= (is_object($outputlangsbis) ? (' / '.(($outputlangsbis->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangsbis->transnoentities("CreditNotesOrExcessReceived") : $outputlangsbis->transnoentities("CreditNotes"))) : ''); $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', false); } if ($object->close_code == Facture::CLOSECODE_DISCOUNTVAT) { @@ -2097,9 +2097,9 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("EscompteOfferedShort") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("EscompteOfferedShort") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'), 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT'), 0, $outputlangs), $useborder, 'R', true); $resteapayer = 0; } @@ -2108,9 +2108,9 @@ class pdf_sponge extends ModelePDFFactures $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -2588,7 +2588,7 @@ class pdf_sponge extends ModelePDFFactures // Show shipping frame $pdf->SetXY($posx + 2, $posy - 5); $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', 0); + $pdf->MultiCell($widthrecbox, 0, $outputlangs->transnoentities('ShippingTo'), 0, 'L', false); $pdf->RoundedRect($posx, $posy, $widthrecbox, $hautcadre, $this->corner_radius, '1234', 'D'); // Show shipping name diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index 72788ca6ce3..b46621fd396 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -6,7 +6,7 @@ * Copyright (C) 2011 Fabrice CHERRIER * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2015 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Nick Fragoulis * Copyright (C) 2024 Alexandre Spangaro @@ -273,7 +273,7 @@ class pdf_soleil extends ModelePDFFicheinter $nexY = $tab_top + 7; $pdf->SetXY($this->marge_gauche, $tab_top); - $pdf->MultiCell(190, 5, $outputlangs->transnoentities("Description"), 0, 'L', 0); + $pdf->MultiCell(190, 5, $outputlangs->transnoentities("Description"), 0, 'L', false); $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5); $pdf->SetFont('', '', $default_font_size - 1); @@ -507,13 +507,13 @@ class pdf_soleil extends ModelePDFFicheinter } $pdf->SetXY(20, 230); - $pdf->MultiCell(80, 5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"), 0, 'L', 0); + $pdf->MultiCell(80, 5, $outputlangs->transnoentities("NameAndSignatureOfInternalContact"), 0, 'L', false); $pdf->SetXY(20, 235); $pdf->MultiCell(80, 25, $employee_name, 1, 'L'); $pdf->SetXY(110, 230); - $pdf->MultiCell(80, 5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"), 0, 'L', 0); + $pdf->MultiCell(80, 5, $outputlangs->transnoentities("NameAndSignatureOfExternalContact"), 0, 'L', false); $pdf->SetXY(110, 235); $pdf->MultiCell(80, 25, '', 1); diff --git a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index 8b2b2fb5c0b..9f8a685a31e 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -285,7 +285,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $tab_top = 65; $pdf->SetFont('', 'B', $default_font_size); - $pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', 0, 0, 12, $tab_top); + $pdf->MultiCell(190, 4, $outputlangs->transnoentities("Notes") . ":", 0, 'L', false, 0, 12, $tab_top); $tab_top += 4; $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxnotes + 1, $tab_top + 1, dol_htmlentitiesbr($object->note_public), 0, 1); @@ -518,7 +518,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $pdf->SetFillColor(255, 255, 255); } $result = (($objectligne->required_rank != 0 && $objectligne->rankorder != 0) ? $objectligne->rankorder . "/" . $objectligne->required_rank : "-"); - $pdf->MultiCell($this->posxresult - 210 - 0.8 - 4, 4, $result, 0, 'C', 1); + $pdf->MultiCell($this->posxresult - 210 - 0.8 - 4, 4, $result, 0, 'C', true); // required Rank diff --git a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index 9f461561c32..fcc366eb619 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -636,7 +636,7 @@ class pdf_standard_movementstock extends ModelePDFMovement // Origin $pricemin = $objp->price; $pdf->SetXY($this->posxdiscount, $curY); - $pdf->MultiCell($this->postotalht - $this->posxdiscount - 0.8, 3, $origin, 0, 'R', 0); + $pdf->MultiCell($this->postotalht - $this->posxdiscount - 0.8, 3, $origin, 0, 'R', false); // Qty $valtoshow = price2num($objp->qty, 'MS'); @@ -644,7 +644,7 @@ class pdf_standard_movementstock extends ModelePDFMovement $totalunit += $objp->qty; $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $objp->qty, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $objp->qty, 0, 'R', false); $totalvaluesell += price2num($pricemin * $objp->value, 'MT'); @@ -720,7 +720,7 @@ class pdf_standard_movementstock extends ModelePDFMovement // Total Qty $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $totalunit, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $totalunit, 0, 'R', false); } else { dol_print_error($this->db); } diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index db63002175f..276bd535801 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -658,7 +658,7 @@ class pdf_vinci extends ModelePDFMo if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -737,11 +737,11 @@ class pdf_vinci extends ModelePDFMo // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -763,36 +763,36 @@ class pdf_vinci extends ModelePDFMo $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } if (!$this->atleastoneratenotnull) { // If no vat at all $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', true); // Total LocalTax1 if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on' && $object->total_localtax1 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', true); } // Total LocalTax2 if (getDolGlobalString('FACTURE_LOCAL_TAX2_OPTION') == 'localtax2on' && $object->total_localtax2 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', true); } } else { //if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') && getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on') @@ -817,10 +817,10 @@ class pdf_vinci extends ModelePDFMo } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -847,10 +847,10 @@ class pdf_vinci extends ModelePDFMo } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } } @@ -861,11 +861,11 @@ class pdf_vinci extends ModelePDFMo $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -884,18 +884,18 @@ class pdf_vinci extends ModelePDFMo $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 8021ef701dc..83e348cb0db 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -585,7 +585,7 @@ class pdf_azur extends ModelePDFPropales // Unit price before discount $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', false); // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); @@ -610,7 +610,7 @@ class pdf_azur extends ModelePDFPropales // Total HT line $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', false); // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { @@ -930,7 +930,7 @@ class pdf_azur extends ModelePDFPropales if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -1041,26 +1041,26 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } 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); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -1140,18 +1140,18 @@ class pdf_azur extends ModelePDFPropales if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); $index++; // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1159,11 +1159,11 @@ class pdf_azur extends ModelePDFPropales // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -1202,12 +1202,12 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1238,12 +1238,12 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1272,10 +1272,10 @@ class pdf_azur extends ModelePDFPropales } else { $totalvat .= vatrate($tvaval['vatrate'], true).($tvaval['vatcode'] ? ' ('.$tvaval['vatcode'].')' : '').$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price(price2num($tvaval['amount'], 'MT'), 0, $outputlangs), 0, 'R', true); } } @@ -1305,12 +1305,12 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1342,12 +1342,12 @@ class pdf_azur extends ModelePDFPropales $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1358,10 +1358,10 @@ class pdf_azur extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); } } @@ -1377,10 +1377,10 @@ class pdf_azur extends ModelePDFPropales $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); /* if ($object->close_code == 'discount_vat') { @@ -1401,10 +1401,10 @@ class pdf_azur extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -1851,7 +1851,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($posx, $tab_top); $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1); + $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', true); $pdf->SetXY($posx, $tab_top + $tab_hl + 3); //$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index de8072300ba..f8db0c8030b 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -1031,7 +1031,7 @@ class pdf_cyan extends ModelePDFPropales if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -1142,26 +1142,26 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } 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); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -1247,18 +1247,18 @@ class pdf_cyan extends ModelePDFPropales if ($total_line_remise > 0) { $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise, 0, $outputlangs), 0, 'R', true); $index++; // Show total NET before discount $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHTBeforeDiscount").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHTBeforeDiscount") : ''), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_line_remise + $total_ht, 0, $outputlangs), 0, 'R', true); $index++; } @@ -1266,11 +1266,11 @@ class pdf_cyan extends ModelePDFPropales // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalHT") : ''), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -1306,12 +1306,12 @@ class pdf_cyan extends ModelePDFPropales $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT1", $mysoc->country_code) : ''); $totalvat .= ' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1339,12 +1339,12 @@ class pdf_cyan extends ModelePDFPropales $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalLT2", $mysoc->country_code) : ''); $totalvat .= ' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1366,10 +1366,10 @@ class pdf_cyan extends ModelePDFPropales $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("TotalVAT", $mysoc->country_code) : ''); $totalvat .= ' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } @@ -1397,12 +1397,12 @@ class pdf_cyan extends ModelePDFPropales $totalvat .= ' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1437,12 +1437,12 @@ class pdf_cyan extends ModelePDFPropales $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; } - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $total_localtax = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? price2num($tvaval * $object->multicurrency_tx, 'MT') : $tvaval); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_localtax, 0, $outputlangs), 0, 'R', true); } } } @@ -1453,10 +1453,10 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("TotalTTC") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); } } @@ -1473,10 +1473,10 @@ class pdf_cyan extends ModelePDFPropales $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); /* if ($object->close_code == 'discount_vat') { @@ -1497,10 +1497,10 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("RemainderToPay") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -1923,7 +1923,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($posx, $tab_top); $pdf->SetFont('', '', $default_font_size - 2); - $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', 1); + $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities("ProposalCustomerSignature"), 0, 'L', true); $pdf->SetXY($posx, $tab_top + $tab_hl + 3); //$pdf->MultiCell($largcol, $tab_hl * 3, '', 1, 'R'); diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index f6464155003..d0ab88db2a2 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -539,9 +539,9 @@ class pdf_paiement extends CommonDocGenerator $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetFont('', 'B', $default_font_size - 1); $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', 1); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('SubTotal')." : ", 0, 'R', true); $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_page), 0, 'R', 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_page), 0, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetFillColor(220, 220, 220); $page++; @@ -554,16 +554,16 @@ class pdf_paiement extends CommonDocGenerator } $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->posxpaymenttype - $this->posxdate + 1, $this->line_height, $lines[$j][1], 0, 'L', 1); + $pdf->MultiCell($this->posxpaymenttype - $this->posxdate + 1, $this->line_height, $lines[$j][1], 0, 'L', true); $pdf->SetXY($this->posxpaymenttype, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->posxinvoiceamount - $this->posxpaymenttype, $this->line_height, $lines[$j][2].' '.$lines[$j][3], 0, 'L', 1); + $pdf->MultiCell($this->posxinvoiceamount - $this->posxpaymenttype, $this->line_height, $lines[$j][2].' '.$lines[$j][3], 0, 'L', true); $pdf->SetXY($this->posxinvoiceamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->posxpaymentamount - $this->posxinvoiceamount, $this->line_height, '', 0, 'R', 1); + $pdf->MultiCell($this->posxpaymentamount - $this->posxinvoiceamount, $this->line_height, '', 0, 'R', true); $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', true); $yp += 5; $total_page += (float) $lines[$j][9]; if (($this->doc_type == 'client' && getDolGlobalString('PAYMENTS_REPORT_GROUP_BY_MOD')) || ($this->doc_type == 'fourn' && getDolGlobalString('PAYMENTS_FOURN_REPORT_GROUP_BY_MOD'))) { @@ -573,19 +573,19 @@ class pdf_paiement extends CommonDocGenerator // Invoice number $pdf->SetXY($this->posxinvoice, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->posxinvoice - $this->posxbankaccount, $this->line_height, $lines[$j][0], 0, 'L', 0); + $pdf->MultiCell($this->posxinvoice - $this->posxbankaccount, $this->line_height, $lines[$j][0], 0, 'L', false); // BankAccount $pdf->SetXY($this->posxbankaccount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->posxbankaccount - $this->posxdate, $this->line_height, $lines[$j][8], 0, 'L', 0); + $pdf->MultiCell($this->posxbankaccount - $this->posxdate, $this->line_height, $lines[$j][8], 0, 'L', false); // Invoice amount $pdf->SetXY($this->posxinvoiceamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->posxpaymentamount - $this->posxinvoiceamount - 1, $this->line_height, $lines[$j][5], 0, 'R', 0); + $pdf->MultiCell($this->posxpaymentamount - $this->posxinvoiceamount - 1, $this->line_height, $lines[$j][5], 0, 'R', false); // Payment amount $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][6], 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][6], 0, 'R', false); $yp += 5; if ($oldprowid != $lines[$j][7]) { @@ -600,9 +600,9 @@ class pdf_paiement extends CommonDocGenerator $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'I', $default_font_size - 1); - $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', 1); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total').' '.$mod." : ", 0, 'R', true); $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_mod), 0, 'R', 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total_mod), 0, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $mod = $lines[$j + 1][2]; $total_mod = 0; @@ -624,9 +624,9 @@ class pdf_paiement extends CommonDocGenerator $pdf->line($this->marge_gauche, $this->tab_top + 15 + $yp, $this->page_largeur - $this->marge_droite, $this->tab_top + 15 + $yp); $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp); $pdf->SetFont('', 'B'); - $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', 1); + $pdf->MultiCell($this->posxpaymentamount - 2 - $this->marge_droite, $this->line_height, $langs->transnoentities('Total')." : ", 0, 'R', true); $pdf->SetXY($this->posxpaymentamount - 1, $this->tab_top + 10 + $yp); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total), 0, 'R', 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount + 1, $this->line_height, price($total), 0, 'R', true); $pdf->SetFillColor(220, 220, 220); } } diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 9d9a0d28f8e..910ba1c1c25 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -753,39 +753,39 @@ class pdf_squille extends ModelePdfReception $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', true); $index2 = 0; // Total Weight if ($totalWeighttoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * ($index + $index2)); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', true); $index2++; } if ($totalVolumetoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * ($index + $index2)); - $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); + $pdf->MultiCell(($this->posxqtyordered - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', true); $index2++; } // Total qty ordered if (!getDolGlobalString('RECEPTION_PDF_HIDE_ORDERED')) { $pdf->SetXY($this->posxqtyordered, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', 1); + $pdf->MultiCell($this->posxqtytoship - $this->posxqtyordered, $tab2_hl, $totalOrdered, 0, 'C', true); } // Total received $pdf->SetXY($this->posxqtytoship, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', 1); + $pdf->MultiCell($this->posxpuht - $this->posxqtytoship, $tab2_hl, $totalToShip, 0, 'C', true); // Amount if (getDolGlobalString('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT')) { $pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1); + $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', true); $pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($totalAmount, 0, $outputlangs), 0, 'C', 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($totalAmount, 0, $outputlangs), 0, 'C', true); } $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index 9b1d95ab7bd..ae2b65bac15 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -426,11 +426,11 @@ class pdf_standard_stock extends ModelePDFStock if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { $pricemin = $objp->price; $pdf->SetXY($this->posxdiscount, $curY); - $pdf->MultiCell($this->postotalht - $this->posxdiscount, 3, price(price2num($pricemin, 'MU'), 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($this->postotalht - $this->posxdiscount, 3, price(price2num($pricemin, 'MU'), 0, $outputlangs), 0, 'R', false); // Total sell min $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, price(price2num($pricemin * $objp->value, 'MT'), 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, price(price2num($pricemin * $objp->value, 'MT'), 0, $outputlangs), 0, 'R', false); } $totalvaluesell += price2num($pricemin * $objp->value, 'MT'); @@ -519,7 +519,7 @@ class pdf_standard_stock extends ModelePDFStock if (!getDolGlobalString('PRODUIT_MULTIPRICES')) { // Total sell min $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, price(price2num($totalvaluesell, 'MT'), 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, price(price2num($totalvaluesell, 'MT'), 0, $outputlangs), 0, 'R', false); } } } else { diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 702ffad456a..75a6f12b163 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -843,32 +843,32 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total"), 0, 'L', true); if (!getDolGlobalString('STOCKTRANSFER_PDF_HIDE_ORDERED')) { $pdf->SetXY($this->posxqty, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxwarehousesource - $this->posxqty, $tab2_hl, $totalQty, 0, 'C', 1); + $pdf->MultiCell($this->posxwarehousesource - $this->posxqty, $tab2_hl, $totalQty, 0, 'C', true); } if (getDolGlobalString('STOCKTRANSFER_PDF_DISPLAY_AMOUNT_HT')) { $pdf->SetXY($this->posxpuht, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', 1); + $pdf->MultiCell($this->posxtotalht - $this->posxpuht, $tab2_hl, '', 0, 'C', true); $pdf->SetXY($this->posxtotalht, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', 1); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalht, $tab2_hl, price($object->total_ht, 0, $outputlangs), 0, 'C', true); } if (!getDolGlobalString('STOCKTRANSFER_PDF_HIDE_WEIGHT_AND_VOLUME')) { // Total Weight if ($totalWeighttoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqty - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', 1); + $pdf->MultiCell(($this->posxqty - $this->posxweightvol), $tab2_hl, $totalWeighttoshow, 0, 'C', true); $index++; } if ($totalVolumetoshow) { $pdf->SetXY($this->posxweightvol, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell(($this->posxqty - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', 1); + $pdf->MultiCell(($this->posxqty - $this->posxweightvol), $tab2_hl, $totalVolumetoshow, 0, 'C', true); $index++; } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index de6a8693412..a2c0e496c5c 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -862,7 +862,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -975,26 +975,26 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - 3); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } if (getDolGlobalInt('FACTURE_CHQ_NUMBER') == -1) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - 3); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - 3); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -1081,10 +1081,10 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("Total", $mysoc->country_code) : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Total").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transcountrynoentities("Total", $mysoc->country_code) : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc, 0, $outputlangs), $useborder, 'R', true); $pdf->SetTextColor(0, 0, 0); @@ -1103,18 +1103,18 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay").(is_object($outputlangsbis) ? ' / '.$outputlangsbis->transnoentities("AlreadyPaid") : ''), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index d5f4c3e16a7..8e7219b19f9 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -443,7 +443,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Unit price before discount $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', false); // Quantity $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails); @@ -467,7 +467,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Total HT line $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', false); // Collection of totals by VAT value in $this->tva["taux"]=total_tva if (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) { @@ -651,11 +651,11 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -679,35 +679,35 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } if (!$this->atleastoneratenotnull) { // If no vat at all $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva, 0, $outputlangs), 0, 'R', true); // Total LocalTax1 if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on' && $object->total_localtax1 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1, 0, $outputlangs), 0, 'R', true); } // Total LocalTax2 if (getDolGlobalString('FACTURE_LOCAL_TAX2_OPTION') == 'localtax2on' && $object->total_localtax2 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2, 0, $outputlangs), 0, 'R', true); } } else { //if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') && getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on') @@ -727,10 +727,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price((string) $tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price((string) $tvaval, 0, $outputlangs), 0, 'R', true); } } //} @@ -752,10 +752,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price((string) $tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price((string) $tvaval, 0, $outputlangs), 0, 'R', true); } } //} @@ -766,10 +766,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($sign * $total_ttc, 0, $outputlangs), $useborder, 'R', true); $pdf->SetTextColor(0, 0, 0); $creditnoteamount = $object->getSumCreditNotesUsed((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0); // Warning, this also include excess received @@ -784,18 +784,18 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Already paid + Deposits $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("Paid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle + $depositsamount, 0, $outputlangs), 0, 'R', false); // Credit note if ($creditnoteamount) { $labeltouse = ($outputlangs->transnoentities("CreditNotesOrExcessReceived") != "CreditNotesOrExcessReceived") ? $outputlangs->transnoentities("CreditNotesOrExcessReceived") : $outputlangs->transnoentities("CreditNotes"); $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($creditnoteamount, 0, $outputlangs), 0, 'R', false); } // Escompte @@ -804,9 +804,9 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("EscompteOfferedShort"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder, 'R', true); $resteapayer = 0; } @@ -815,10 +815,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); } @@ -973,19 +973,19 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->SetFont('', '', $default_font_size - 3); $pdf->SetXY($tab3_posx, $tab3_top - 4); - $pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', 0); + $pdf->MultiCell(60, 3, $outputlangs->transnoentities("PaymentsAlreadyDone"), 0, 'L', false); $pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top); $pdf->SetFont('', '', $default_font_size - 4); $pdf->SetXY($tab3_posx, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Payment"), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Amount"), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Type"), 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top); - $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', 0); + $pdf->MultiCell(20, 3, $outputlangs->transnoentities("Num"), 0, 'L', false); $pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height); @@ -1012,15 +1012,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $row = $this->db->fetch_object($resql); $pdf->SetXY($tab3_posx, $tab3_top + $y); - $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', 0); + $pdf->MultiCell(20, 3, dol_print_date($this->db->jdate($row->date), 'day', false, $outputlangs, true), 0, 'L', false); $pdf->SetXY($tab3_posx + 21, $tab3_top + $y); - $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', 0); + $pdf->MultiCell(20, 3, price($sign * ((isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0, 'L', false); $pdf->SetXY($tab3_posx + 40, $tab3_top + $y); $oper = $outputlangs->transnoentitiesnoconv("PaymentTypeShort".$row->code); - $pdf->MultiCell(20, 3, $oper, 0, 'L', 0); + $pdf->MultiCell(20, 3, $oper, 0, 'L', false); $pdf->SetXY($tab3_posx + 58, $tab3_top + $y); - $pdf->MultiCell(30, 3, $row->num_payment, 0, 'L', 0); + $pdf->MultiCell(30, 3, $row->num_payment, 0, 'L', false); $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 4811fd9b1a0..94b6621ecf1 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -884,7 +884,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -963,11 +963,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -989,36 +989,36 @@ class pdf_cornas extends ModelePDFSuppliersOrders $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } if (!$this->atleastoneratenotnull) { // If no vat at all $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', true); // Total LocalTax1 if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on' && $object->total_localtax1 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', true); } // Total LocalTax2 if (getDolGlobalString('FACTURE_LOCAL_TAX2_OPTION') == 'localtax2on' && $object->total_localtax2 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', true); } } else { //if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') && getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on') @@ -1043,10 +1043,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -1073,10 +1073,10 @@ class pdf_cornas extends ModelePDFSuppliersOrders } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } } @@ -1087,11 +1087,11 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -1110,18 +1110,18 @@ class pdf_cornas extends ModelePDFSuppliersOrders $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index c0c3f1ef183..9f9ac87007c 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -504,7 +504,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE')) { $up_excl_tax = pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->posxup, $curY); - $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0, 'R', false); } // Quantity @@ -530,7 +530,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN')) { $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails); $pdf->SetXY($this->postotalht, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0, 'R', false); } // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva @@ -747,7 +747,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -825,11 +825,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -851,36 +851,36 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } if (!$this->atleastoneratenotnull) { // If no vat at all $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', true); // Total LocalTax1 if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on' && $object->total_localtax1 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', true); } // Total LocalTax2 if (getDolGlobalString('FACTURE_LOCAL_TAX2_OPTION') == 'localtax2on' && $object->total_localtax2 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', true); } } else { //if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') && getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on') @@ -905,10 +905,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -935,10 +935,10 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } } @@ -949,11 +949,11 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -972,18 +972,18 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index 3f9c8cc9288..a4265fe88e6 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -388,27 +388,27 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments // ref fourn $pdf->SetXY($this->posxreffacturefourn, $curY); - $pdf->MultiCell($this->posxreffacturefourn - 0.8, 3, $object->lines[$i]->ref_supplier, 0, 'L', 0); + $pdf->MultiCell($this->posxreffacturefourn - 0.8, 3, $object->lines[$i]->ref_supplier, 0, 'L', false); // ref facture fourn $pdf->SetXY($this->posxreffacture, $curY); - $pdf->MultiCell($this->posxreffacture - 0.8, 3, $object->lines[$i]->ref, 0, 'L', 0); + $pdf->MultiCell($this->posxreffacture - 0.8, 3, $object->lines[$i]->ref, 0, 'L', false); // type $pdf->SetXY($this->posxtype, $curY); - $pdf->MultiCell($this->posxtype - 0.8, 3, $object->lines[$i]->type, 0, 'L', 0); + $pdf->MultiCell($this->posxtype - 0.8, 3, $object->lines[$i]->type, 0, 'L', false); // Total ht $pdf->SetXY($this->posxtotalht, $curY); - $pdf->MultiCell($this->posxtotalht - 0.8, 3, price($object->lines[$i]->total_ht), 0, 'R', 0); + $pdf->MultiCell($this->posxtotalht - 0.8, 3, price($object->lines[$i]->total_ht), 0, 'R', false); // Total tva $pdf->SetXY($this->posxtva, $curY); - $pdf->MultiCell($this->posxtva - 0.8, 3, price($object->lines[$i]->total_tva), 0, 'R', 0); + $pdf->MultiCell($this->posxtva - 0.8, 3, price($object->lines[$i]->total_tva), 0, 'R', false); // Total TTC line $pdf->SetXY($this->posxtotalttc, $curY); - $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalttc, 3, price($object->lines[$i]->total_ttc), 0, 'R', 0); + $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxtotalttc, 3, price($object->lines[$i]->total_ttc), 0, 'R', false); // Add line @@ -533,15 +533,15 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments // N° payment $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(30, 4, 'N° '.$outputlangs->transnoentities("Payment"), 0, 'L', 1); + $pdf->MultiCell(30, 4, 'N° '.$outputlangs->transnoentities("Payment"), 0, 'L', true); // Ref payment $pdf->SetXY($this->marge_gauche + 30, $posy); - $pdf->MultiCell(50, 4, $object->ref, 0, 'L', 1); + $pdf->MultiCell(50, 4, $object->ref, 0, 'L', true); // Total payments $pdf->SetXY($this->page_largeur - $this->marge_droite - 50, $posy); - $pdf->MultiCell(50, 4, price($object->amount), 0, 'R', 1); + $pdf->MultiCell(50, 4, price($object->amount), 0, 'R', true); $posy += 20; // translate amount @@ -549,27 +549,27 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $translateinletter = strtoupper(dol_convertToWord((float) price2num($object->amount, 'MT'), $outputlangs, $currency)); $pdf->SetXY($this->marge_gauche + 50, $posy); $pdf->SetFont('', '', $default_font_size - 3); - $pdf->MultiCell(90, 8, $translateinletter, 0, 'L', 1); + $pdf->MultiCell(90, 8, $translateinletter, 0, 'L', true); $pdf->SetFont('', '', $default_font_size - 1); $posy += 8; // To $pdf->SetXY($this->marge_gauche + 50, $posy); - $pdf->MultiCell(150, 4, $object->thirdparty->name, 0, 'L', 1); + $pdf->MultiCell(150, 4, $object->thirdparty->name, 0, 'L', true); $LENGTHAMOUNT = 35; $pdf->SetXY($this->page_largeur - $this->marge_droite - $LENGTHAMOUNT, $posy); - $pdf->MultiCell($LENGTHAMOUNT, 4, str_pad(price($object->amount).' '.$currency, 18, '*', STR_PAD_LEFT), 0, 'R', 1); + $pdf->MultiCell($LENGTHAMOUNT, 4, str_pad(price($object->amount).' '.$currency, 18, '*', STR_PAD_LEFT), 0, 'R', true); $posy += 10; // City $pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy); - $pdf->MultiCell(150, 4, $mysoc->town, 0, 'L', 1); + $pdf->MultiCell(150, 4, $mysoc->town, 0, 'L', true); $posy += 4; // Date $pdf->SetXY($this->page_largeur - $this->marge_droite - 30, $posy); - $pdf->MultiCell(150, 4, date("d").' '.$outputlangs->transnoentitiesnoconv(date("F")).' '.date("Y"), 0, 'L', 1); + $pdf->MultiCell(150, 4, date("d").' '.$outputlangs->transnoentitiesnoconv(date("F")).' '.date("Y"), 0, 'L', true); return $posy; } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 4f1cd2887f1..e1434cb202e 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2024-2025 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify @@ -822,26 +822,26 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $account->owner_name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0, 'L', false); $posy = $pdf->GetY() + 2; } } 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); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo', $this->emetteur->name), 0, 'L', false); $posy = $pdf->GetY() + 1; if (!getDolGlobalString('MAIN_PDF_HIDE_CHQ_ADDRESS')) { $pdf->SetXY($this->marge_gauche, $posy); $pdf->SetFont('', '', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', false); $posy = $pdf->GetY() + 2; } } @@ -904,11 +904,11 @@ class pdf_aurore extends ModelePDFSupplierProposal // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -941,10 +941,10 @@ class pdf_aurore extends ModelePDFSupplierProposal } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -973,10 +973,10 @@ class pdf_aurore extends ModelePDFSupplierProposal } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -996,10 +996,10 @@ class pdf_aurore extends ModelePDFSupplierProposal } $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } @@ -1026,9 +1026,9 @@ class pdf_aurore extends ModelePDFSupplierProposal $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -1057,10 +1057,10 @@ class pdf_aurore extends ModelePDFSupplierProposal $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -1071,10 +1071,10 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc, 0, $outputlangs), $useborder, 'R', true); } } @@ -1089,19 +1089,19 @@ class pdf_aurore extends ModelePDFSupplierProposal $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle, 0, $outputlangs), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer, 0, $outputlangs), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 16cd7001f6d..ec3d19c9768 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2017 Ferran Marcet * Copyright (C) 2018-2025 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Nick Fragoulis * * This program is free software; you can redistribute it and/or modify @@ -866,7 +866,7 @@ class pdf_zenith extends ModelePDFSupplierProposal if ($this->emetteur->country_code == 'FR' && empty($mysoc->tva_assuj)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); $pdf->SetXY($this->marge_gauche, $posy); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', false); $posy = $pdf->GetY() + 4; } @@ -945,11 +945,11 @@ class pdf_zenith extends ModelePDFSupplierProposal // Total HT $pdf->SetFillColor(255, 255, 255); $pdf->SetXY($col1x, $tab2_top); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', true); $total_ht = ((isModEnabled("multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht); $pdf->SetXY($col2x, $tab2_top); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, 'R', true); // Show VAT by rates and total $pdf->SetFillColor(248, 248, 248); @@ -971,36 +971,36 @@ class pdf_zenith extends ModelePDFSupplierProposal $totalvat = $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code).' '; $totalvat .= vatrate($tvakey, true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } if (!$this->atleastoneratenotnull) { // If no vat at all $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalVAT", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', true); // Total LocalTax1 if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on' && $object->total_localtax1 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', true); } // Total LocalTax2 if (getDolGlobalString('FACTURE_LOCAL_TAX2_OPTION') == 'localtax2on' && $object->total_localtax2 > 0) { $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code), 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', true); } } else { //if (getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') && getDolGlobalString('FACTURE_LOCAL_TAX1_OPTION') == 'localtax1on') @@ -1025,10 +1025,10 @@ class pdf_zenith extends ModelePDFSupplierProposal } $totalvat = $outputlangs->transcountrynoentities("TotalLT1", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval, 0, $outputlangs), 0, 'R', true); } } } @@ -1055,10 +1055,10 @@ class pdf_zenith extends ModelePDFSupplierProposal } $totalvat = $outputlangs->transcountrynoentities("TotalLT2", $mysoc->country_code).' '; $totalvat .= vatrate((string) abs((float) $tvakey), true).$tvacompl; - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', true); } } } @@ -1069,11 +1069,11 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', true); $total_ttc = (isModEnabled("multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc; $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); @@ -1092,18 +1092,18 @@ class pdf_zenith extends ModelePDFSupplierProposal $index++; $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', false); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0); + $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', false); $index++; $pdf->SetTextColor(0, 0, 60); $pdf->SetFillColor(224, 224, 224); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1); + $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', true); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', true); $pdf->SetFont('', '', $default_font_size - 1); $pdf->SetTextColor(0, 0, 0); diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 1f227a8be10..96dfa1b9797 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -1108,7 +1108,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities("BillFrom").":", 0, $ltrdirection); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', true); $pdf->SetTextColor(0, 0, 60); } diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 165f96b6ad3..96fa3b5d001 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -887,7 +887,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pdf->MultiCell(66, 5, $outputlangs->transnoentities("BillFrom").":", 0, 'L'); $pdf->SetXY($posx, $posy); $pdf->SetFillColor(230, 230, 230); - $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', 1); + $pdf->MultiCell($widthrecbox, $hautcadre, "", 0, 'R', true); $pdf->SetTextColor(0, 0, 60); // Show sender name From 2117c5e55037244fcea59ad578271a6292e6103f Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 4 Feb 2025 23:12:31 +0100 Subject: [PATCH 166/375] Qual: Fix setPageOrientation 'autopagebreak' type --- .../asset/doc/pdf_standard_asset.modules.php | 16 +++++++------- .../commande/doc/pdf_einstein.modules.php | 8 +++---- .../commande/doc/pdf_eratosthene.modules.php | 20 ++++++++--------- .../contract/doc/pdf_strato.modules.php | 8 +++---- .../delivery/doc/pdf_storm.modules.php | 8 +++---- .../delivery/doc/pdf_typhon.modules.php | 8 +++---- .../expedition/doc/pdf_espadon.modules.php | 16 +++++++------- .../expedition/doc/pdf_merou.modules.php | 6 ++--- .../expedition/doc/pdf_rouget.modules.php | 8 +++---- .../pdf_standard_expensereport.modules.php | 12 +++++----- .../modules/facture/doc/pdf_crabe.modules.php | 8 +++---- .../facture/doc/pdf_sponge.modules.php | 22 +++++++++---------- .../fichinter/doc/pdf_soleil.modules.php | 8 +++---- .../doc/pdf_standard_evaluation.modules.php | 12 +++++----- .../pdf_standard_movementstock.modules.php | 8 +++---- .../modules/mrp/doc/pdf_vinci.modules.php | 14 ++++++------ .../project/doc/pdf_baleine.modules.php | 14 ++++++------ .../project/doc/pdf_beluga.modules.php | 14 ++++++------ .../project/doc/pdf_timespent.modules.php | 14 ++++++------ .../modules/propale/doc/pdf_azur.modules.php | 8 +++---- .../modules/propale/doc/pdf_cyan.modules.php | 22 +++++++++---------- .../reception/doc/pdf_squille.modules.php | 8 +++---- .../stock/doc/pdf_standard_stock.modules.php | 8 +++---- .../stocktransfer/doc/pdf_eagle.modules.php | 8 +++---- .../doc/pdf_eagle_proforma.modules.php | 16 +++++++------- .../doc/pdf_canelle.modules.php | 8 +++---- .../supplier_order/doc/pdf_cornas.modules.php | 14 ++++++------ .../doc/pdf_muscadet.modules.php | 8 +++---- .../pdf_standard_supplierpayment.modules.php | 8 +++---- .../doc/pdf_aurore.modules.php | 8 +++---- .../doc/pdf_zenith.modules.php | 14 ++++++------ ...tandard_recruitmentjobposition.modules.php | 16 +++++++------- 32 files changed, 185 insertions(+), 185 deletions(-) diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index 4854eb516c4..ca4f59699a1 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -345,12 +345,12 @@ class pdf_standard_asset extends ModelePDFAsset // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -364,7 +364,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -386,7 +386,7 @@ class pdf_standard_asset extends ModelePDFAsset } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -451,7 +451,7 @@ class pdf_standard_asset extends ModelePDFAsset $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -466,7 +466,7 @@ class pdf_standard_asset extends ModelePDFAsset if ($pageposafter > $pageposbefore) { // There is a pagebreak $pdf->rollbackTransaction(true); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); @@ -499,7 +499,7 @@ class pdf_standard_asset extends ModelePDFAsset $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -632,7 +632,7 @@ class pdf_standard_asset extends ModelePDFAsset $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 43733946c25..c18f93820ce 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -401,7 +401,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -416,7 +416,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); @@ -450,7 +450,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -585,7 +585,7 @@ class pdf_einstein extends ModelePDFCommandes $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index 65075ab0ba6..d0bc8af2e09 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -454,12 +454,12 @@ class pdf_eratosthene extends ModelePDFCommandes // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -473,7 +473,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -495,7 +495,7 @@ class pdf_eratosthene extends ModelePDFCommandes } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -585,7 +585,7 @@ class pdf_eratosthene extends ModelePDFCommandes } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $curYBefore = $curY; @@ -602,7 +602,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->useTemplate($tplidx); } $pdf->setPage($pageposbefore + 1); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage; $showpricebeforepagebreak = 0; } @@ -620,7 +620,7 @@ class pdf_eratosthene extends ModelePDFCommandes } // restore Page orientation for text - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // Description of product line if ($this->getColumnStatus('desc')) { @@ -631,7 +631,7 @@ class pdf_eratosthene extends ModelePDFCommandes $afterPosData = $this->getMaxAfterColsLinePositionsData(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 0, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($afterPosData['page'] > $pageposbefore && (empty($showpricebeforepagebreak) || ($curY + 4) > ($this->page_hauteur - $heightforfooter))) { @@ -800,7 +800,7 @@ class pdf_eratosthene extends ModelePDFCommandes for ($i = $pageposbeforeprintlines; $i <= $drawTabNumbPage; $i++) { $pdf->setPage($i); // reset page orientation each loop to override it if it was changed - $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, 0); // The only function to edit the bottom margin of current page to set it. $drawTabHideTop = $hidetop; $drawTabTop = $tab_top_newpage; @@ -833,7 +833,7 @@ class pdf_eratosthene extends ModelePDFCommandes $pdf->setPage($i); // in case of _pagefoot or _tableau change it // reset page orientation each loop to override it if it was changed by _pagefoot or _tableau change it - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // Don't print head on first page ($pageposbeforeprintlines) because already added previously if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') && $i != $pageposbeforeprintlines) { diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index ea44c428b90..65338574fe0 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -327,7 +327,7 @@ class pdf_strato extends ModelePDFContract $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -391,7 +391,7 @@ class pdf_strato extends ModelePDFContract $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txtpredefinedservice, dol_concatdesc($txt, $desc)), 0, 1, 0); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); @@ -426,7 +426,7 @@ class pdf_strato extends ModelePDFContract $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -447,7 +447,7 @@ class pdf_strato extends ModelePDFContract $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalString('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 4db4e14fe06..1d7a72a0d6e 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -381,7 +381,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -429,7 +429,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->getColumnContentWidth('desc'), 4, $this->getColumnContentXStart('desc'), $curY, $hideref, $hidedesc); $posyafter = $pdf->GetY(); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text @@ -463,7 +463,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -522,7 +522,7 @@ class pdf_storm extends ModelePDFDeliveryOrder $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 75249c60d89..b3557520f3f 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -346,7 +346,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -361,7 +361,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxcomm - $curX, 4, $curX, $curY, $hideref, $hidedesc); $posyafter = $pdf->GetY(); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text @@ -392,7 +392,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -462,7 +462,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index ec08b9cc21e..f7208018efd 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -5,7 +5,7 @@ * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2023 Charlene Benke - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Nick Fragoulis * Copyright (C) 2024 Alexandre Spangaro * @@ -418,12 +418,12 @@ class pdf_espadon extends ModelePdfExpedition // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -437,7 +437,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -469,7 +469,7 @@ class pdf_espadon extends ModelePdfExpedition } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -582,7 +582,7 @@ class pdf_espadon extends ModelePdfExpedition } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -662,7 +662,7 @@ class pdf_espadon extends ModelePdfExpedition $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -750,7 +750,7 @@ class pdf_espadon extends ModelePdfExpedition $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 6178f9efc1e..07b721b8038 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -296,7 +296,7 @@ class pdf_merou extends ModelePdfExpedition $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -306,7 +306,7 @@ class pdf_merou extends ModelePdfExpedition $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore) { @@ -354,7 +354,7 @@ class pdf_merou extends ModelePdfExpedition $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. } if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) { // @phan-suppress-current-line PhanUndeclaredProperty if ($pagenb == 1) { diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 1a9c3d34fd0..26b5791fcdf 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -475,7 +475,7 @@ class pdf_rouget extends ModelePdfExpedition } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -522,7 +522,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); @@ -559,7 +559,7 @@ class pdf_rouget extends ModelePdfExpedition $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -635,7 +635,7 @@ class pdf_rouget extends ModelePdfExpedition $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index d98ea1a7ec4..7cb520f98c4 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -369,9 +369,9 @@ class pdf_standard_expensereport extends ModeleExpenseReport $pdf->setTopMargin($tab_top_newpage); if (empty($showpricebeforepagebreak) && ($i !== ($nblines - 1))) { - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. } else { - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. } $pageposbefore = $pdf->getPage(); @@ -403,7 +403,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $pdf->setTopMargin($tab_top_newpage); continue; } else { - $pdf->setPageOrientation('', 1, $heightforfooter); + $pdf->setPageOrientation('', true, $heightforfooter); $showpricebeforepagebreak = 0; } @@ -442,7 +442,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. //$nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Add space between lines $nexY += ($pdf->getFontSize() * 1.3); // Add space between lines @@ -450,7 +450,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) { $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if ($pagenb == 1) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } else { @@ -459,7 +459,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 1e5d131662b..e2f67b56d65 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -586,7 +586,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->setTopMargin($tab_top_newpage); $page_bottom_margin = $heightforfooter + $heightforfreetext + $heightforinfotot + $this->getHeightForQRInvoice($pdf->getPage(), $object, $langs); - $pdf->setPageOrientation('', 1, $page_bottom_margin); + $pdf->setPageOrientation('', true, $page_bottom_margin); $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -632,7 +632,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX - $progress_width, 3, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); @@ -668,7 +668,7 @@ class pdf_crabe extends ModelePDFFactures $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -834,7 +834,7 @@ class pdf_crabe extends ModelePDFFactures $this->_pagefoot($pdf, $object, $outputlangs, 1, $this->getHeightForQRInvoice($pagenb, $object, $langs)); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $top_shift = $this->_pagehead($pdf, $object, 0, $outputlangs); $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index d34c7146710..1ae6c72f67e 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -601,12 +601,12 @@ class pdf_sponge extends ModelePDFFactures } $pdf->setTopMargin($this->tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); + $pdf->setPageOrientation('', true, $this->heightforfooter + $this->heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); + $pdf->setPageOrientation('', true, $this->heightforfooter + $this->heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $this->tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -620,7 +620,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->setPage($pageposafternote); $pdf->setTopMargin($this->tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); + $pdf->setPageOrientation('', true, $this->heightforfooter + $this->heightforfreetext); //$posyafter = $this->tab_top_newpage; } @@ -642,7 +642,7 @@ class pdf_sponge extends ModelePDFFactures } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1, $this->getHeightForQRInvoice($i, $object, $outputlangs)); $i++; @@ -730,7 +730,7 @@ class pdf_sponge extends ModelePDFFactures } $pdf->setTopMargin($this->tab_top_newpage); - $pdf->setPageOrientation('', 1, $this->heightforfooter); + $pdf->setPageOrientation('', true, $this->heightforfooter); $pageposbefore = $pdf->getPage(); $curYBefore = $curY; @@ -746,12 +746,12 @@ class pdf_sponge extends ModelePDFFactures $pdf->useTemplate($tplidx); } $pdf->setPage($pageposbefore + 1); - $pdf->setPageOrientation('', 1, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $this->tab_top_newpage; $showpricebeforepagebreak = 0; } - $pdf->setPageOrientation('', 0, $this->heightforfooter + $this->heightforfreetext); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, $this->heightforfooter + $this->heightforfreetext); // The only function to edit the bottom margin of current page to set it. // @phan-suppress-next-line PhanTypeMismatchProperty if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) { $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + $imageTopMargin, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi @@ -763,7 +763,7 @@ class pdf_sponge extends ModelePDFFactures } // restore Page orientation for text - $pdf->setPageOrientation('', 1, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. // Description of product line if ($this->getColumnStatus('desc')) { @@ -776,7 +776,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); $curY = $curYBefore; - $pdf->setPageOrientation('', 0, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($afterPosData['page'] > $pageposbefore && (empty($showpricebeforepagebreak) || ($curY + 4) > ($this->page_hauteur - $this->heightforfooter))) { @@ -984,7 +984,7 @@ class pdf_sponge extends ModelePDFFactures for ($i = $pageposbeforeprintlines; $i <= $drawTabNumbPage; $i++) { $pdf->setPage($i); // reset page orientation each loop to override it if it was changed - $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, 0); // The only function to edit the bottom margin of current page to set it. $drawTabHideTop = $hidetop; $drawTabTop = $this->tab_top_newpage; @@ -1018,7 +1018,7 @@ class pdf_sponge extends ModelePDFFactures $pdf->setPage($i); // in case of _pagefoot or _tableau change it // reset page orientation each loop to override it if it was changed by _pagefoot or _tableau change it - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // Don't print head on first page ($pageposbeforeprintlines) because already added previously if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') && $i != $pageposbeforeprintlines) { diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index b46621fd396..b233f9b3ada 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -305,7 +305,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -331,7 +331,7 @@ class pdf_soleil extends ModelePDFFicheinter $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt, $desc), 0, 1, 0); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); @@ -356,7 +356,7 @@ class pdf_soleil extends ModelePDFFicheinter $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore) { @@ -377,7 +377,7 @@ class pdf_soleil extends ModelePDFFicheinter $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index 9f8a685a31e..58c7961b866 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -313,9 +313,9 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $pdf->SetTextColor(0, 0, 0); if (empty($showmorebeforepagebreak) && ($i !== ($nblines - 1))) { - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. } else { - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. } $pdf->setTopMargin($tab_top_newpage); @@ -352,7 +352,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $pdf->setTopMargin($tab_top_newpage); continue; } else { - $pdf->setPageOrientation('', 1, $heightforfooter); + $pdf->setPageOrientation('', true, $heightforfooter); $showmorebeforepagebreak = 0; } @@ -392,7 +392,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $nexY += ($pdf->getFontSize() * 1.3); // Add space between lines @@ -400,7 +400,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation // Detect if some page were added automatically and output _tableau for past pages while ($pagenb < $pageposafter) { $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if ($pagenb == 1) { $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1); } else { @@ -409,7 +409,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index fcc366eb619..81afde6396b 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -513,7 +513,7 @@ class pdf_standard_movementstock extends ModelePDFMovement $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -528,7 +528,7 @@ class pdf_standard_movementstock extends ModelePDFMovement $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); $posyafter = $pdf->GetY(); @@ -563,7 +563,7 @@ class pdf_standard_movementstock extends ModelePDFMovement $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -671,7 +671,7 @@ class pdf_standard_movementstock extends ModelePDFMovement $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 276bd535801..5ccdd42956d 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -315,12 +315,12 @@ class pdf_vinci extends ModelePDFMo // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -334,7 +334,7 @@ class pdf_vinci extends ModelePDFMo $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -355,7 +355,7 @@ class pdf_vinci extends ModelePDFMo } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -425,7 +425,7 @@ class pdf_vinci extends ModelePDFMo $prod->fetch($bom->lines[$i]->fk_product); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -478,7 +478,7 @@ class pdf_vinci extends ModelePDFMo $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -529,7 +529,7 @@ class pdf_vinci extends ModelePDFMo $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 510d123b2f5..049f6b52e83 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -1,7 +1,7 @@ * Copyright (C) 2018 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Nick Fragoulis * @@ -299,7 +299,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of line @@ -321,7 +321,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // Label $pdf->SetXY($this->posxlabel, $curY); $posybefore = $pdf->GetY(); @@ -353,7 +353,7 @@ class pdf_baleine extends ModelePDFProjects if ($forcedesconsamepage) { $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->AddPage('', '', true); if (!empty($tplidx)) { @@ -367,7 +367,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage + $heightoftitleline + 1; // Label @@ -388,7 +388,7 @@ class pdf_baleine extends ModelePDFProjects $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -439,7 +439,7 @@ class pdf_baleine extends ModelePDFProjects $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 51ba7d63d1d..e19c4457a6b 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2015-2018 Charlene Benke * Copyright (C) 2018 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Nick Fragoulis * @@ -517,7 +517,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation($this->orientation, 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of line @@ -552,7 +552,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation($this->orientation, 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // Label $pdf->SetXY($this->posxref, $curY); $posybefore = $pdf->GetY(); @@ -584,7 +584,7 @@ class pdf_beluga extends ModelePDFProjects if ($forcedesconsamepage) { $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; - $pdf->setPageOrientation($this->orientation, 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->AddPage($this->orientation, '', true); if (!empty($tplidx)) { @@ -598,7 +598,7 @@ class pdf_beluga extends ModelePDFProjects $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $pdf->setPageOrientation($this->orientation, 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage + $heightoftitleline + 1; // Label @@ -619,7 +619,7 @@ class pdf_beluga extends ModelePDFProjects $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation($this->orientation, 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -716,7 +716,7 @@ class pdf_beluga extends ModelePDFProjects $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation($this->orientation, 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation($this->orientation, true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 630eff6d0e0..8837c2cca7c 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Nick Fragoulis * @@ -298,7 +298,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of line @@ -320,7 +320,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // Label $pdf->SetXY($this->posxlabel, $curY); $posybefore = $pdf->GetY(); @@ -352,7 +352,7 @@ class pdf_timespent extends ModelePDFProjects if ($forcedesconsamepage) { $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->AddPage('', '', true); if (!empty($tplidx)) { @@ -366,7 +366,7 @@ class pdf_timespent extends ModelePDFProjects $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage + $heightoftitleline + 1; // Label @@ -387,7 +387,7 @@ class pdf_timespent extends ModelePDFProjects $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -437,7 +437,7 @@ class pdf_timespent extends ModelePDFProjects $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 83e348cb0db..a8f99c8ddf7 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -483,7 +483,7 @@ class pdf_azur extends ModelePDFPropales } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -528,7 +528,7 @@ class pdf_azur extends ModelePDFPropales $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); @@ -565,7 +565,7 @@ class pdf_azur extends ModelePDFPropales $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -704,7 +704,7 @@ class pdf_azur extends ModelePDFPropales $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index f8db0c8030b..eed656eab7b 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -458,12 +458,12 @@ class pdf_cyan extends ModelePDFPropales // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -477,7 +477,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -499,7 +499,7 @@ class pdf_cyan extends ModelePDFPropales } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -587,7 +587,7 @@ class pdf_cyan extends ModelePDFPropales } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $curYBefore = $curY; @@ -605,12 +605,12 @@ class pdf_cyan extends ModelePDFPropales $pdf->useTemplate($tplidx); } $pdf->setPage($pageposbefore + 1); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $curY = $tab_top_newpage; $showpricebeforepagebreak = 0; } - $pdf->setPageOrientation('', 0, $heightforfooter + $heightforfreetext); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, $heightforfooter + $heightforfreetext); // The only function to edit the bottom margin of current page to set it. // @phan-suppress-next-line PhanTypeMismatchProperty if (!empty($this->cols['photo']) && isset($imglinesize['width']) && isset($imglinesize['height'])) { $pdf->Image($realpatharray[$i], $this->getColumnContentXStart('photo'), $curY + $imageTopMargin, $imglinesize['width'], $imglinesize['height'], '', '', '', 2, 300); // Use 300 dpi @@ -622,7 +622,7 @@ class pdf_cyan extends ModelePDFPropales } // restore Page orientation for text - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. if ($this->getColumnStatus('desc')) { $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); @@ -633,7 +633,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); $curY = $curYBefore; - $pdf->setPageOrientation('', 0, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, $heightforfooter); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page @@ -819,7 +819,7 @@ class pdf_cyan extends ModelePDFPropales for ($i = $pageposbeforeprintlines; $i <= $drawTabNumbPage; $i++) { $pdf->setPage($i); // reset page orientation each loop to override it if it was changed - $pdf->setPageOrientation('', 0, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', false, 0); // The only function to edit the bottom margin of current page to set it. $drawTabHideTop = $hidetop; $drawTabTop = $tab_top_newpage; @@ -852,7 +852,7 @@ class pdf_cyan extends ModelePDFPropales $pdf->setPage($i); // in case of _pagefoot or _tableau change it // reset page orientation each loop to override it if it was changed by _pagefoot or _tableau change it - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // Don't print head on first page ($pageposbeforeprintlines) because already added previously if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') && $i != $pageposbeforeprintlines) { diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index 910ba1c1c25..a4ad33d98c1 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -433,7 +433,7 @@ class pdf_squille extends ModelePdfReception } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -491,7 +491,7 @@ class pdf_squille extends ModelePdfReception $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc); @@ -529,7 +529,7 @@ class pdf_squille extends ModelePdfReception $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -612,7 +612,7 @@ class pdf_squille extends ModelePdfReception $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!empty($tplidx)) { $pdf->useTemplate($tplidx); } diff --git a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index ae2b65bac15..a4e44bad713 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -326,7 +326,7 @@ class pdf_standard_stock extends ModelePDFStock $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -342,7 +342,7 @@ class pdf_standard_stock extends ModelePDFStock $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $pdf->writeHTMLCell($this->wref, 4, $curX, $curY, $outputlangs->convToOutputCharset($objp->ref), 0, 1, false, true, 'J', true); //pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); @@ -378,7 +378,7 @@ class pdf_standard_stock extends ModelePDFStock $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -456,7 +456,7 @@ class pdf_standard_stock extends ModelePDFStock $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 75a6f12b163..3d2c7dbb03f 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -493,7 +493,7 @@ class pdf_eagle extends ModelePDFStockTransfer } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -557,7 +557,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxpicture - $curX, 3, $curX, $curY, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); @@ -594,7 +594,7 @@ class pdf_eagle extends ModelePDFStockTransfer $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -694,7 +694,7 @@ class pdf_eagle extends ModelePDFStockTransfer $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index a2c0e496c5c..dadaab85f50 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -420,12 +420,12 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -439,7 +439,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -461,7 +461,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -533,7 +533,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); @@ -583,7 +583,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); $pageposafter = $pdf->getPage(); @@ -620,7 +620,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -770,7 +770,7 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 8e7219b19f9..3b3d5ecc645 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -375,7 +375,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices //} $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -391,7 +391,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc, 1); $posyafter = $pdf->GetY(); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text @@ -423,7 +423,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -530,7 +530,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 94b6621ecf1..5c2ca83bf27 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -401,12 +401,12 @@ class pdf_cornas extends ModelePDFSuppliersOrders // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -420,7 +420,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -442,7 +442,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -520,7 +520,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -599,7 +599,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -771,7 +771,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 9f9ac87007c..86bd5637fd7 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -401,7 +401,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -452,7 +452,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); $posyafter = $pdf->GetY(); if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) { // There is no space left for total+free text @@ -483,7 +483,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -625,7 +625,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index a4265fe88e6..797bd8414d8 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -329,7 +329,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); // Description of product line @@ -344,7 +344,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. //pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,4,$curX,$curY,$hideref,$hidedesc,1); $pdf->writeHTMLCell($this->posxtva - $curX, 4, $curX, $curY, $object->lines[$i]->datef, 0, 1, false, true, 'J', true); $posyafter = $pdf->GetY(); @@ -376,7 +376,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -433,7 +433,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index e1434cb202e..64acd0ff7c8 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -394,7 +394,7 @@ class pdf_aurore extends ModelePDFSupplierProposal } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -445,7 +445,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; //print $pageposafter.'-'.$pageposbefore;exit; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. pdf_writelinedesc($pdf, $object, $i, $outputlangs, $descWidth, 3, $curX, $curY, $hideref, $hidedesc, 1); $pageposafter = $pdf->getPage(); @@ -481,7 +481,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -611,7 +611,7 @@ class pdf_aurore extends ModelePDFSupplierProposal $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index ec3d19c9768..2c49a6a51cc 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -392,12 +392,12 @@ class pdf_zenith extends ModelePDFSupplierProposal // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -411,7 +411,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -433,7 +433,7 @@ class pdf_zenith extends ModelePDFSupplierProposal } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -500,7 +500,7 @@ class pdf_zenith extends ModelePDFSupplierProposal } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -577,7 +577,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description is moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -744,7 +744,7 @@ class pdf_zenith extends ModelePDFSupplierProposal $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 96fa3b5d001..109149efab0 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -378,12 +378,12 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio // $this->_pagefoot($pdf,$object,$outputlangs,1); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -397,7 +397,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pdf->setPage($pageposafternote); $pdf->setTopMargin($tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext); + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext); //$posyafter = $tab_top_newpage; } @@ -419,7 +419,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -483,7 +483,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pdf->SetTextColor(0, 0, 0); $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -497,7 +497,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio if ($pageposafter > $pageposbefore) { // There is a pagebreak $pdf->rollbackTransaction(true); - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); @@ -530,7 +530,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -562,7 +562,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalString('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } From e5b1946bc7d7994f990ca496ca6d5377093fa70e Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 5 Feb 2025 00:52:48 +0100 Subject: [PATCH 167/375] Qual: Fix arguments types on TCPDF/TCPDI calls --- htdocs/core/lib/pdf.lib.php | 60 +++++++++---------- .../action/doc/pdf_standard_actions.class.php | 2 +- .../asset/doc/pdf_standard_asset.modules.php | 2 +- .../core/modules/bank/doc/pdf_ban.modules.php | 4 +- .../bank/doc/pdf_sepamandate.modules.php | 2 +- .../modules/cheque/doc/pdf_blochet.class.php | 2 +- .../commande/doc/pdf_einstein.modules.php | 2 +- .../commande/doc/pdf_eratosthene.modules.php | 2 +- .../contract/doc/pdf_strato.modules.php | 2 +- .../delivery/doc/pdf_storm.modules.php | 2 +- .../delivery/doc/pdf_typhon.modules.php | 2 +- .../expedition/doc/pdf_espadon.modules.php | 2 +- .../expedition/doc/pdf_merou.modules.php | 2 +- .../expedition/doc/pdf_rouget.modules.php | 2 +- .../pdf_standard_expensereport.modules.php | 2 +- .../modules/facture/doc/pdf_crabe.modules.php | 2 +- .../facture/doc/pdf_octopus.modules.php | 22 +++---- .../facture/doc/pdf_sponge.modules.php | 2 +- .../fichinter/doc/pdf_soleil.modules.php | 2 +- .../doc/pdf_standard_evaluation.modules.php | 2 +- .../member/doc/pdf_standard_member.class.php | 4 +- .../pdf_standard_movementstock.modules.php | 2 +- .../modules/mrp/doc/pdf_vinci.modules.php | 2 +- .../doc/pdf_standardlabel.class.php | 4 +- .../printsheet/doc/pdf_tcpdflabel.class.php | 4 +- .../product/doc/pdf_standard.modules.php | 2 +- .../project/doc/pdf_baleine.modules.php | 2 +- .../project/doc/pdf_beluga.modules.php | 2 +- .../project/doc/pdf_timespent.modules.php | 2 +- .../modules/propale/doc/pdf_azur.modules.php | 2 +- .../modules/propale/doc/pdf_cyan.modules.php | 2 +- .../modules/rapport/pdf_paiement.class.php | 2 +- .../reception/doc/pdf_squille.modules.php | 2 +- .../stock/doc/pdf_standard_stock.modules.php | 2 +- .../stocktransfer/doc/pdf_eagle.modules.php | 2 +- .../doc/pdf_eagle_proforma.modules.php | 4 +- .../doc/pdf_canelle.modules.php | 2 +- .../supplier_order/doc/pdf_cornas.modules.php | 2 +- .../doc/pdf_muscadet.modules.php | 2 +- .../pdf_standard_supplierpayment.modules.php | 2 +- .../doc/pdf_aurore.modules.php | 2 +- .../doc/pdf_zenith.modules.php | 2 +- .../doc/pdf_standard_myobject.modules.php | 10 ++-- ...tandard_recruitmentjobposition.modules.php | 2 +- 44 files changed, 92 insertions(+), 92 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3945810f622..a5d50d8c0bb 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -736,7 +736,7 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height) if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF') && (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF') != '-1')) { // Warning, this option make TCPDF generation being crazy and some content disappeared behind the image $filepath = $conf->mycompany->dir_output.'/logos/' . getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF'); if (file_exists($filepath)) { - $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak before adding image + $pdf->setAutoPageBreak(false, 0); // Disable auto pagebreak before adding image if (getDolGlobalString('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')) { $pdf->SetAlpha(getDolGlobalFloat('MAIN_USE_BACKGROUND_ON_PDF_ALPHA')); } // Option for change opacity of background @@ -745,7 +745,7 @@ function pdf_pagehead(&$pdf, $outputlangs, $page_height) $pdf->SetAlpha(1); } $pdf->SetPageMark(); // This option avoid to have the images missing on some pages - $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak + $pdf->setAutoPageBreak(true, 0); // Restore pagebreak } } if (getDolGlobalString('MAIN_ADD_PDF_BACKGROUND') && getDolGlobalString('MAIN_ADD_PDF_BACKGROUND') != '-1') { @@ -825,7 +825,7 @@ function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text) // set alpha to semi-transparency $pdf->SetAlpha(0.3); - $pdf->Cell($w - 20, 25, $outputlangs->convToOutputCharset($text), "", 2, "C", 0); + $pdf->Cell($w - 20, 25, $outputlangs->convToOutputCharset($text), "", 2, "C", false); // antirotate $pdf->_out('Q'); @@ -861,7 +861,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, if (empty($onlynumber)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizetitle); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByTransferOnThisBankAccount').':', 0, 'L', false); $cury += 4; } @@ -883,7 +883,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, if (empty($onlynumber)) { $pdf->SetFont('', '', $default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': '.$outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': '.$outputlangs->convToOutputCharset($account->bank), 0, 'L', false); $cury += 3; } @@ -927,11 +927,11 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, break; } - $pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($content), 0, 'C', 0); + $pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($content), 0, 'C', false); $pdf->SetXY($curx, $cury + 1); $curx += $tmplength; $pdf->SetFont('', 'B', $default_font_size - $diffsizecontent); - $pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities($val), 0, 'C', 0); + $pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities($val), 0, 'C', false); if (empty($onlynumber)) { $pdf->line($curx, $cury + 1, $curx, $cury + 7); } @@ -943,12 +943,12 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, } elseif (!empty($account->number)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': '.$outputlangs->convToOutputCharset($account->bank), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Bank").': '.$outputlangs->convToOutputCharset($account->bank), 0, 'L', false); $cury += 3; $pdf->SetFont('', 'B', $default_font_size - $diffsizecontent); $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': '.$outputlangs->convToOutputCharset($account->number), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("BankAccountNumber").': '.$outputlangs->convToOutputCharset($account->number), 0, 'L', false); $cury += 3; if ($diffsizecontent <= 2) { @@ -961,7 +961,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, if (empty($onlynumber) && !empty($account->address)) { $pdf->SetXY($curx, $cury); $val = $outputlangs->transnoentities("Residence").': '.$outputlangs->convToOutputCharset($account->address); - $pdf->MultiCell(100, 3, $val, 0, 'L', 0); + $pdf->MultiCell(100, 3, $val, 0, 'L', false); //$nboflines=dol_nboflines_bis($val,120); //$cury+=($nboflines*3)+2; $tmpy = $pdf->getStringHeight(100, $val); @@ -971,7 +971,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, if (!empty($account->owner_name)) { $pdf->SetXY($curx, $cury); $val = $outputlangs->transnoentities("BankAccountOwner").': '.$outputlangs->convToOutputCharset($account->owner_name); - $pdf->MultiCell(100, 3, $val, 0, 'L', 0); + $pdf->MultiCell(100, 3, $val, 0, 'L', false); $tmpy = $pdf->getStringHeight(100, $val); $cury += $tmpy; } elseif (!$usedetailedbban) { @@ -996,14 +996,14 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': '.$ibanDisplay, 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).': '.$ibanDisplay, 0, 'L', false); $cury += 3; } if (!empty($account->bic)) { $pdf->SetFont('', 'B', $default_font_size - 3); $pdf->SetXY($curx, $cury); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': '.$outputlangs->convToOutputCharset($account->bic), 0, 'L', 0); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).': '.$outputlangs->convToOutputCharset($account->bic), 0, 'L', false); } return $pdf->getY(); @@ -1253,25 +1253,25 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Option for footer background color (without freetext zone) if (getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) { list($r, $g, $b) = sscanf($conf->global->PDF_FOOTER_BACKGROUND_COLOR, '%d, %d, %d'); - $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak + $pdf->setAutoPageBreak(false, 0); // Disable auto pagebreak $pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', array(), $fill_color = array($r, $g, $b)); - $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak + $pdf->setAutoPageBreak(true, 0); // Restore pagebreak } if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { - $pdf->SetAutoPageBreak(0, 0); + $pdf->setAutoPageBreak(false, 0); } // Option for disable auto pagebreak if ($line) { // Free text $pdf->SetXY($dims['lm'], -$posy); if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default - $pdf->MultiCell(0, 3, $line, 0, $align, 0); + $pdf->MultiCell(0, 3, $line, 0, $align, false); } else { $pdf->writeHTMLCell($dims['wk'] - $dims['lm'] - $dims['rm'], $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); } $posy -= $freetextheight; } if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); } // Restore pagebreak $pdf->SetY(-$posy); @@ -1289,11 +1289,11 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ } if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { - $pdf->SetAutoPageBreak(0, 0); + $pdf->setAutoPageBreak(false, 0); } // Option for disable auto pagebreak $pdf->writeHTMLCell($dims['wk'] - $dims['lm'] - $dims['rm'], $mycustomfooterheight, $dims['lm'], $dims['hk'] - $posy, dol_htmlentitiesbr($mycustomfooter, 1, 'UTF-8', 0)); if (getDolGlobalInt('PDF_FOOTER_DISABLE_PAGEBREAK') === 1) { - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); } // Restore pagebreak $posy -= $mycustomfooterheight - 3; @@ -1305,25 +1305,25 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ // Option for footer background color (without freetext zone) if (getDolGlobalString('PDF_FOOTER_BACKGROUND_COLOR')) { list($r, $g, $b) = sscanf($conf->global->PDF_FOOTER_BACKGROUND_COLOR, '%d, %d, %d'); - $pdf->SetAutoPageBreak(0, 0); // Disable auto pagebreak + $pdf->setAutoPageBreak(false, 0); // Disable auto pagebreak $pdf->Rect(0, $dims['hk'] - $posy + $freetextheight, $dims['wk'] + 1, $marginwithfooter + 1, 'F', array(), $fill_color = array($r, $g, $b)); - $pdf->SetAutoPageBreak(1, 0); // Restore pagebreak + $pdf->setAutoPageBreak(true, 0); // Restore pagebreak } if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { - $pdf->SetAutoPageBreak(0, 0); + $pdf->setAutoPageBreak(false, 0); } // Option for disable auto pagebreak if ($line) { // Free text $pdf->SetXY($dims['lm'], -$posy); if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) { // by default - $pdf->MultiCell(0, 3, $line, 0, $align, 0); + $pdf->MultiCell(0, 3, $line, 0, $align, false); } else { $pdf->writeHTMLCell($dims['wk'] - $dims['lm'] - $dims['rm'], $freetextheight, $dims['lm'], $dims['hk'] - $marginwithfooter, dol_htmlentitiesbr($line, 1, 'UTF-8', 0)); } $posy -= $freetextheight; } if (getDolGlobalInt('PDF_FREETEXT_DISABLE_PAGEBREAK') === 1) { - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); } // Restore pagebreak $pdf->SetY(-$posy); @@ -1345,7 +1345,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ if (!empty($line1)) { $pdf->SetFont('', 'B', 7); $pdf->SetXY($dims['lm'], -$posy); - $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line1, 0, 'C', 0); + $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line1, 0, 'C', false); $posy -= 3; $pdf->SetFont('', '', 7); } @@ -1353,20 +1353,20 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ if (!empty($line2)) { $pdf->SetFont('', 'B', 7); $pdf->SetXY($dims['lm'], -$posy); - $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line2, 0, 'C', 0); + $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line2, 0, 'C', false); $posy -= 3; $pdf->SetFont('', '', 7); } if (!empty($line3)) { $pdf->SetXY($dims['lm'], -$posy); - $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line3, 0, 'C', 0); + $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line3, 0, 'C', false); } if (!empty($line4)) { $posy -= 3; $pdf->SetXY($dims['lm'], -$posy); - $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line4, 0, 'C', 0); + $pdf->MultiCell($dims['wk'] - $dims['rm'] - $dims['lm'], 2, $line4, 0, 'C', false); } } } @@ -1380,7 +1380,7 @@ function pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_ if (in_array(pdf_getPDFFont($outputlangs), array('freemono', 'DejaVuSans'))) { $fontRenderCorrection = 10; } - $pdf->MultiCell(18 + $fontRenderCorrection, 2, $pagination, 0, 'R', 0); + $pdf->MultiCell(18 + $fontRenderCorrection, 2, $pagination, 0, 'R', false); // Show Draft Watermark if (!empty($watermark)) { diff --git a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php index f61d8b09760..3cccf3e808f 100644 --- a/htdocs/core/modules/action/doc/pdf_standard_actions.class.php +++ b/htdocs/core/modules/action/doc/pdf_standard_actions.class.php @@ -220,7 +220,7 @@ class pdf_standard_actions $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php index ca4f59699a1..129aeae7262 100644 --- a/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php +++ b/htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php @@ -224,7 +224,7 @@ class pdf_standard_asset extends ModelePDFAsset // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index ab5c06aa008..f84c3745f1f 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 Nick Fragoulis * @@ -165,7 +165,7 @@ class pdf_ban extends ModeleBankAccountDoc if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index eef507075db..bcda206e9d3 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -197,7 +197,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $this->heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php index e69f8b24ac8..e41993f16d3 100644 --- a/htdocs/core/modules/cheque/doc/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/doc/pdf_blochet.class.php @@ -166,7 +166,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index c18f93820ce..b824ee320fb 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -258,7 +258,7 @@ class pdf_einstein extends ModelePDFCommandes // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php index d0bc8af2e09..4a8c3ce92dc 100644 --- a/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_eratosthene.modules.php @@ -306,7 +306,7 @@ class pdf_eratosthene extends ModelePDFCommandes // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index 65338574fe0..ce62ec155dc 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -221,7 +221,7 @@ class pdf_strato extends ModelePDFContract // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 1d7a72a0d6e..d83e5ff9846 100644 --- a/htdocs/core/modules/delivery/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -242,7 +242,7 @@ class pdf_storm extends ModelePDFDeliveryOrder if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index b3557520f3f..fc627f2e759 100644 --- a/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -218,7 +218,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php index f7208018efd..87d07f0e7cc 100644 --- a/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_espadon.modules.php @@ -264,7 +264,7 @@ class pdf_espadon extends ModelePdfExpedition if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php index 07b721b8038..bdc5dacba98 100644 --- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php @@ -216,7 +216,7 @@ class pdf_merou extends ModelePdfExpedition if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php index 26b5791fcdf..b40bdf24cbf 100644 --- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php @@ -295,7 +295,7 @@ class pdf_rouget extends ModelePdfExpedition if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php index 7cb520f98c4..002fd83daad 100644 --- a/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php +++ b/htdocs/core/modules/expensereport/doc/pdf_standard_expensereport.modules.php @@ -275,7 +275,7 @@ class pdf_standard_expensereport extends ModeleExpenseReport $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index e2f67b56d65..8b1f893cb43 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -304,7 +304,7 @@ class pdf_crabe extends ModelePDFFactures // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part if ($heightforinfotot > 220) { diff --git a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php index e80737f02f5..7c9df706b30 100644 --- a/htdocs/core/modules/facture/doc/pdf_octopus.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_octopus.modules.php @@ -414,7 +414,7 @@ class pdf_octopus extends ModelePDFFactures $pdf = pdf_getInstance($this->format); //$default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $default_font_size = 9; - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); // compute height for situation invoices $this->heightforinfotot = 45; // Height reserved to output the info and total part and payment part @@ -672,12 +672,12 @@ class pdf_octopus extends ModelePDFFactures } $pdf->setTopMargin($this->tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); + $pdf->setPageOrientation('', true, $this->heightforfooter + $this->heightforfreetext); } // back to start $pdf->setPage($pageposbeforenote); - $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); + $pdf->setPageOrientation('', true, $this->heightforfooter + $this->heightforfreetext); $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $this->tab_top, dol_htmlentitiesbr($notetoshow), 0, 1); $pageposafternote = $pdf->getPage(); @@ -691,7 +691,7 @@ class pdf_octopus extends ModelePDFFactures $pdf->setPage($pageposafternote); $pdf->setTopMargin($this->tab_top_newpage); // The only function to edit the bottom margin of current page to set it. - $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext); + $pdf->setPageOrientation('', true, $this->heightforfooter + $this->heightforfreetext); //$posyafter = $this->tab_top_newpage; } @@ -713,7 +713,7 @@ class pdf_octopus extends ModelePDFFactures } // Add footer - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $this->_pagefoot($pdf, $object, $outputlangs, 1); $i++; @@ -786,7 +786,7 @@ class pdf_octopus extends ModelePDFFactures } $pdf->setTopMargin($this->tab_top_newpage); - $pdf->setPageOrientation('', 1, $this->heightforfooter + $this->heightforfreetext + $this->heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $this->heightforfooter + $this->heightforfreetext + $this->heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -830,7 +830,7 @@ class pdf_octopus extends ModelePDFFactures if ($pageposafter > $pageposbefore) { // There is a pagebreak $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; - $pdf->setPageOrientation('', 1, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $this->heightforfooter); // The only function to edit the bottom margin of current page to set it. $this->printColDescContent($pdf, $posy, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); @@ -865,7 +865,7 @@ class pdf_octopus extends ModelePDFFactures $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -1082,7 +1082,7 @@ class pdf_octopus extends ModelePDFFactures $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs, $outputlangsbis); } @@ -3836,7 +3836,7 @@ class pdf_octopus extends ModelePDFFactures $this->_pagehead($pdf, $object, 0, $outputlangs); } $pdf->setPage($pageposafter + 1); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $posy = $this->tab_top_newpage + 1; } else { @@ -3868,7 +3868,7 @@ class pdf_octopus extends ModelePDFFactures $posy += 10; - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. $pdf->SetTextColor(0, 0, 60); $pdf->SetFont('', '', $default_font_size - 1); diff --git a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php index 1ae6c72f67e..52c587e62aa 100644 --- a/htdocs/core/modules/facture/doc/pdf_sponge.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_sponge.modules.php @@ -338,7 +338,7 @@ class pdf_sponge extends ModelePDFFactures // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $this->heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part $this->heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php index b233f9b3ada..3a3b9a4a873 100644 --- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php +++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php @@ -199,7 +199,7 @@ class pdf_soleil extends ModelePDFFicheinter if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php index 58c7961b866..482578c3fd2 100644 --- a/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php +++ b/htdocs/core/modules/hrm/doc/pdf_standard_evaluation.modules.php @@ -235,7 +235,7 @@ class pdf_standard_evaluation extends ModelePDFEvaluation $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/member/doc/pdf_standard_member.class.php b/htdocs/core/modules/member/doc/pdf_standard_member.class.php index 42113bb78cd..a75a1863120 100644 --- a/htdocs/core/modules/member/doc/pdf_standard_member.class.php +++ b/htdocs/core/modules/member/doc/pdf_standard_member.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2015 Francis Appels * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -419,7 +419,7 @@ class pdf_standard_member extends CommonStickerGenerator } $pdf->SetMargins(0, 0); - $pdf->SetAutoPageBreak(false); + $pdf->setAutoPageBreak(false); $this->_Metric_Doc = $this->Tformat['metric']; // Permet de commencer l'impression de l'etiquette desiree dans le cas ou la page a deja service diff --git a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php index 81afde6396b..ba5ab15d3de 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard_movementstock.modules.php @@ -422,7 +422,7 @@ class pdf_standard_movementstock extends ModelePDFMovement // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php index 5ccdd42956d..8dcb13bcfb9 100644 --- a/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php +++ b/htdocs/core/modules/mrp/doc/pdf_vinci.modules.php @@ -222,7 +222,7 @@ class pdf_vinci extends ModelePDFMo if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php index 6e81bbe71df..eed4da190ed 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2015 Francis Appels - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -299,7 +299,7 @@ class pdf_standardlabel extends CommonStickerGenerator } $pdf->SetMargins(0, 0); - $pdf->SetAutoPageBreak(false); + $pdf->setAutoPageBreak(false); $this->_Metric_Doc = $this->Tformat['metric']; // Enable printing the label when the page was already started diff --git a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php index 87ac116b2c3..0b2fe4836f9 100644 --- a/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php +++ b/htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2015 Francis Appels - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -335,7 +335,7 @@ class pdf_tcpdflabel extends CommonStickerGenerator } $pdf->SetMargins(0, 0); - $pdf->SetAutoPageBreak(false); + $pdf->setAutoPageBreak(false); $this->_Metric_Doc = $this->Tformat['metric']; // Permet de commencer l'impression de l'etiquette desiree dans le cas ou la page a deja service diff --git a/htdocs/core/modules/product/doc/pdf_standard.modules.php b/htdocs/core/modules/product/doc/pdf_standard.modules.php index adba3813d90..a90e4c064a9 100644 --- a/htdocs/core/modules/product/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/product/doc/pdf_standard.modules.php @@ -184,7 +184,7 @@ class pdf_standard extends ModelePDFProduct // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/project/doc/pdf_baleine.modules.php b/htdocs/core/modules/project/doc/pdf_baleine.modules.php index 049f6b52e83..8098896a64e 100644 --- a/htdocs/core/modules/project/doc/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/doc/pdf_baleine.modules.php @@ -199,7 +199,7 @@ class pdf_baleine extends ModelePDFProjects // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index e19c4457a6b..3b5cf8daf32 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -248,7 +248,7 @@ class pdf_beluga extends ModelePDFProjects // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/project/doc/pdf_timespent.modules.php b/htdocs/core/modules/project/doc/pdf_timespent.modules.php index 8837c2cca7c..70f83aec0e3 100644 --- a/htdocs/core/modules/project/doc/pdf_timespent.modules.php +++ b/htdocs/core/modules/project/doc/pdf_timespent.modules.php @@ -194,7 +194,7 @@ class pdf_timespent extends ModelePDFProjects // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index a8f99c8ddf7..31effee1731 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -316,7 +316,7 @@ class pdf_azur extends ModelePDFPropales // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php index eed656eab7b..9cefefeb228 100644 --- a/htdocs/core/modules/propale/doc/pdf_cyan.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_cyan.modules.php @@ -295,7 +295,7 @@ class pdf_cyan extends ModelePDFPropales // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/rapport/pdf_paiement.class.php b/htdocs/core/modules/rapport/pdf_paiement.class.php index d0ab88db2a2..0d80927958d 100644 --- a/htdocs/core/modules/rapport/pdf_paiement.class.php +++ b/htdocs/core/modules/rapport/pdf_paiement.class.php @@ -377,7 +377,7 @@ class pdf_paiement extends CommonDocGenerator // @phan-suppress-next-line PhanPluginSuspiciousParamOrder $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); // New page $pdf->AddPage(); diff --git a/htdocs/core/modules/reception/doc/pdf_squille.modules.php b/htdocs/core/modules/reception/doc/pdf_squille.modules.php index a4ad33d98c1..88e841dabce 100644 --- a/htdocs/core/modules/reception/doc/pdf_squille.modules.php +++ b/htdocs/core/modules/reception/doc/pdf_squille.modules.php @@ -253,7 +253,7 @@ class pdf_squille extends ModelePdfReception $heightforinfotot = 8; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php index a4e44bad713..84966bb0c70 100644 --- a/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php +++ b/htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php @@ -222,7 +222,7 @@ class pdf_standard_stock extends ModelePDFStock // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php index 3d2c7dbb03f..4413d742a92 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php @@ -311,7 +311,7 @@ class pdf_eagle extends ModelePDFStockTransfer if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php index dadaab85f50..9856be325d4 100644 --- a/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php +++ b/htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php @@ -279,12 +279,12 @@ class pdf_eagle_proforma extends ModelePDFStockTransfer // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 40; // Height reserved to output the info and total part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + (!getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin) - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php index 3b3d5ecc645..a60fc341832 100644 --- a/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php @@ -234,7 +234,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 50 + (4 * $nbpayments); // Height reserved to output the info and total part and payment part if ($heightforinfotot > 220) { diff --git a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php index 5c2ca83bf27..2f84cbf3b6c 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php @@ -282,7 +282,7 @@ class pdf_cornas extends ModelePDFSuppliersOrders if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php index 86bd5637fd7..1c69f02962b 100644 --- a/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php @@ -288,7 +288,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php index 797bd8414d8..3b0cb46ba1e 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php @@ -267,7 +267,7 @@ class pdf_standard_supplierpayment extends ModelePDFSuppliersPayments if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 64acd0ff7c8..150a39553eb 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -278,7 +278,7 @@ class pdf_aurore extends ModelePDFSupplierProposal if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php index 2c49a6a51cc..814e910b081 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php @@ -275,7 +275,7 @@ class pdf_zenith extends ModelePDFSupplierProposal if (getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS')) { $heightforfooter += 6; } - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php index 96dfa1b9797..7ac4f25e47e 100644 --- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php +++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php @@ -307,7 +307,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pdf = pdf_getInstance($this->format); '@phan-var-force TCPDI|TCPDF $pdf'; $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page @@ -544,7 +544,7 @@ class pdf_standard_myobject extends ModelePDFMyObject // } $pdf->setTopMargin($tab_top_newpage); - $pdf->setPageOrientation('', 1, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter + $heightforfreetext + $heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pageposbefore = $pdf->getPage(); $showpricebeforepagebreak = 1; @@ -587,7 +587,7 @@ class pdf_standard_myobject extends ModelePDFMyObject if ($pageposafter > $pageposbefore) { // There is a pagebreak $pdf->rollbackTransaction(true); $pageposafter = $pageposbefore; - $pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, $heightforfooter); // The only function to edit the bottom margin of current page to set it. $this->printColDescContent($pdf, $curY, 'desc', $object, $i, $outputlangs, $hideref, $hidedesc); @@ -623,7 +623,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $pageposafter = $pdf->getPage(); $pdf->setPage($pageposbefore); $pdf->setTopMargin($this->marge_haute); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. // We suppose that a too long description or photo were moved completely on next page if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) { @@ -752,7 +752,7 @@ class pdf_standard_myobject extends ModelePDFMyObject $this->_pagefoot($pdf, $object, $outputlangs, 1); $pagenb++; $pdf->setPage($pagenb); - $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it. + $pdf->setPageOrientation('', true, 0); // The only function to edit the bottom margin of current page to set it. if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) { $this->_pagehead($pdf, $object, 0, $outputlangs); } diff --git a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php index 109149efab0..d7859da8565 100644 --- a/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php +++ b/htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php @@ -257,7 +257,7 @@ class pdf_standard_recruitmentjobposition extends ModelePDFRecruitmentJobPositio // Create pdf instance $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance - $pdf->SetAutoPageBreak(1, 0); + $pdf->setAutoPageBreak(true, 0); $heightforinfotot = 50; // Height reserved to output the info and total part and payment part $heightforfreetext = getDolGlobalInt('MAIN_PDF_FREETEXT_HEIGHT', 5); // Height reserved to output the free text on last page From bb4ae71c750eee5ae34f285b4e2bb7df7968e479 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 5 Feb 2025 00:54:54 +0100 Subject: [PATCH 168/375] Qual: New fixers for phan --- dev/tools/phan/config_fixer.php | 22 ++- dev/tools/phan/plugins/CellFixer.php | 185 ++++++++++++++++++ dev/tools/phan/plugins/MultiCellFixer.php | 185 ++++++++++++++++++ .../phan/plugins/setAutoPageBreakFixer.php | 185 ++++++++++++++++++ .../phan/plugins/setPageOrientationFixer.php | 43 ++-- 5 files changed, 593 insertions(+), 27 deletions(-) create mode 100644 dev/tools/phan/plugins/CellFixer.php create mode 100644 dev/tools/phan/plugins/MultiCellFixer.php create mode 100644 dev/tools/phan/plugins/setAutoPageBreakFixer.php diff --git a/dev/tools/phan/config_fixer.php b/dev/tools/phan/config_fixer.php index b290e5ef5c7..8f5df967bca 100644 --- a/dev/tools/phan/config_fixer.php +++ b/dev/tools/phan/config_fixer.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France */ @@ -9,30 +9,40 @@ $config = include __DIR__.DIRECTORY_SEPARATOR."config.php"; +// Note: When more than one fixer is attached to the same Notice, only the last fix is applied. //require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; //require_once __DIR__.'/plugins/PriceFormFixer.php'; //require_once __DIR__.'/plugins/UrlEncodeStringifyFixer.php'; -require_once __DIR__.'/plugins/SelectDateFixer.php'; +//require_once __DIR__.'/plugins/SelectDateFixer.php'; +require_once __DIR__.'/plugins/setPageOrientationFixer.php'; +//require_once __DIR__.'/plugins/MultiCellFixer.php'; +//require_once __DIR__.'/plugins/setAutoPageBreakFixer.php'; +//require_once __DIR__.'/plugins/CellFixer.php'; //$deprecatedModuleNameRegex = '/^(?!(?:'.implode('|', array_keys($DEPRECATED_MODULE_MAPPING)).')$).*/'; -require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; +//require_once __DIR__.'/plugins/DeprecatedModuleNameFixer.php'; $config['exclude_file_regex'] = '@^(' // @phpstan-ignore-line .'dummy' // @phpstan-ignore-line + //.'|(?!htdocs/modulebuilderrtemplate/core/modules/mymodule/doc/pdf_standard_myobject.modules.php).*' // Only this file for test @php-stan-ignore-line + .'|htdocs/custom/.*' // Ignore all custom modules @phpstan-ignore-line .'|htdocs/.*/canvas/.*/tpl/.*.tpl.php' // @phpstan-ignore-line .'|htdocs/admin/tools/ui/.*' // @phpstan-ignore-line //.'|htdocs/modulebuilder/template/.*' // @phpstan-ignore-line + // Included as stub (better analysis) + .'|htdocs/includes/nusoap/.*' // @phpstan-ignore-line // Included as stub (old version + incompatible typing hints) .'|htdocs/includes/restler/.*' // @phpstan-ignore-line - // Included as stub (did not seem properly analysed by phan without it) + // Included as stub (did not seem properly analyzed by phan without it) .'|htdocs/includes/stripe/.*' // @phpstan-ignore-line .'|htdocs/conf/conf.php' // @phpstan-ignore-line - //.'|htdocs/[^c][^o][^r][^e][^/].*' // For testing @phpstan-ignore-line - //.'|htdocs/[^h].*' // For testing on restricted set @phpstan-ignore-line + //.'|htdocs/[^mi](?!.*(pdf_|tcpdf)).*\.php' // @phpstan-ignore-line + //.'|htdocs/(?!.*modules.*(pdf_|pdf.lib)).*\.php' // @phpstan-ignore-line .')@'; // @phpstan-ignore-line // $config['plugins'][] = __DIR__.'/plugins/ParamMatchRegexPlugin.php'; +$config['plugins'] = []; $config['plugins'][] = 'DeprecateAliasPlugin'; // $config['plugins'][] = __DIR__.'/plugins/GetPostFixerPlugin.php'; // $config['plugins'][] = 'PHPDocToRealTypesPlugin'; diff --git a/dev/tools/phan/plugins/CellFixer.php b/dev/tools/phan/plugins/CellFixer.php new file mode 100644 index 00000000000..bb49d415b47 --- /dev/null +++ b/dev/tools/phan/plugins/CellFixer.php @@ -0,0 +1,185 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDI::Cell()"; + $expected_functionlike2 = "\\TCPDF::Cell()"; + $expected_name = "Cell"; + if ($functionlike !== $expected_functionlike + && $functionlike !== $expected_functionlike2) { + print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "false","1" => "true"); + // Check if we fix any of this + if ( + ($argument_name === 'fill' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + // && $arg->expression instanceof StringLiteral + && $arg->expression instanceof NumericLiteral + ) { + // Get the value of the NumericLiteral + $fieldValue = (string) $arg->expression; + print "Number is '$fieldValue'".PHP_EOL; + /* + // Get the string value of the StringLiteral + $fieldValue = $arg->expression->getStringContentsText(); + print "String is '$fieldValue'".PHP_EOL; + */ + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + print "Not replacing $argument_name which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/MultiCellFixer.php b/dev/tools/phan/plugins/MultiCellFixer.php new file mode 100644 index 00000000000..e126d0c622e --- /dev/null +++ b/dev/tools/phan/plugins/MultiCellFixer.php @@ -0,0 +1,185 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDI::MultiCell()"; + $expected_functionlike2 = "\\TCPDF::MultiCell()"; + $expected_name = "MultiCell"; + if ($functionlike !== $expected_functionlike + && $functionlike !== $expected_functionlike2) { + print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "false","1" => "true"); + // Check if we fix any of this + if ( + ($argument_name === 'fill' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + // print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + // && $arg->expression instanceof StringLiteral + && $arg->expression instanceof NumericLiteral + ) { + // Get the value of the NumericLiteral + $fieldValue = (string) $arg->expression; + print "Number is '$fieldValue'".PHP_EOL; + /* + // Get the string value of the StringLiteral + $fieldValue = $arg->expression->getStringContentsText(); + print "String is '$fieldValue'".PHP_EOL; + */ + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + print "Not replacing $argument_name which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/setAutoPageBreakFixer.php b/dev/tools/phan/plugins/setAutoPageBreakFixer.php new file mode 100644 index 00000000000..2d0c0ba11a7 --- /dev/null +++ b/dev/tools/phan/plugins/setAutoPageBreakFixer.php @@ -0,0 +1,185 @@ + + * + * For 'price()', replace $form parameter that is '' with 0. + */ + +declare(strict_types=1); + +use ast\flags; +use Microsoft\PhpParser\Node\Expression\CallExpression; +use Microsoft\PhpParser\Node\QualifiedName; +use Phan\AST\TolerantASTConverter\NodeUtils; +use Phan\CodeBase; +use Phan\IssueInstance; +use Phan\Library\FileCacheEntry; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEdit; +use Phan\Plugin\Internal\IssueFixingPlugin\FileEditSet; +use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; +use Microsoft\PhpParser\Node\Expression\ArgumentExpression; +use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; +use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; +use Microsoft\PhpParser\Node\ReservedWord; +use Microsoft\PhpParser\Token; + +/** + * This is a prototype, there are various features it does not implement. + */ + +call_user_func(static function (): void { + /** + * @param $code_base @unused-param + * @return ?FileEditSet a representation of the edit to make to replace a call to a function alias with a call to the original function + */ + $fix = static function (CodeBase $code_base, FileCacheEntry $contents, IssueInstance $instance): ?FileEditSet { + + // Argument {INDEX} (${PARAMETER}) is {CODE} of type {TYPE}{DETAILS} but + // {FUNCTIONLIKE} takes {TYPE}{DETAILS} defined at {FILE}:{LINE} (the inferred real argument type has nothing in common with the parameter's phpdoc type) + + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) + // var_dump($instance->getTemplateParameters()); + $argument_index = (string) $instance->getTemplateParameters()[0]; + $argument_name = (string) $instance->getTemplateParameters()[1]; + $argument_code = (string) $instance->getTemplateParameters()[2]; + $argument_type = (string) $instance->getTemplateParameters()[3]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; + + $expected_functionlike = "\\TCPDI::setAutoPageBreak()"; + $expected_functionlike2 = "\\TCPDF::setAutoPageBreak()"; + $expected_name = "setAutoPageBreak"; + if ($functionlike !== $expected_functionlike + && $functionlike !== $expected_functionlike2) { + //print "$functionlike != '$expected_functionlike'|'$expected_functionlike2".PHP_EOL; + return null; + } + + $toBoolReplaceArray = array("0" => "false","1" => "true"); + // Check if we fix any of this + if ( + ($argument_name === 'auto' && in_array($argument_code, array_keys($toBoolReplaceArray))) + //|| ($argument_name === 'm' && $argument_code === "''") + //|| ($argument_name === 'empty' && $argument_code === "''") + ) { + $replacement = $toBoolReplaceArray[$argument_code]; + $argIdx = ($argument_index - 1) * 2; + $expectedStringValue = $argument_code; + } else { + //print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; + return null; + } + + // At this point we established that the notification + // matches some we fix. + + $line = $instance->getLine(); + + $edits = []; + foreach ($contents->getNodesAtLine($line) as $node) { + if (!$node instanceof ArgumentExpressionList) { + continue; + } + $arguments = $node->children; + if (count($arguments) <= $argIdx) { + // print "Arg Count is ".count($arguments)." - Skip $instance".PHP_EOL; + continue; + } + + $is_actual_call = $node->parent instanceof CallExpression; + if (!$is_actual_call) { + //print "Not actual call - Skip $instance".PHP_EOL; + continue; + } + + //print "Actual call - $instance".PHP_EOL; + $callable = $node->parent; + + $callableExpression = $callable->callableExpression; + + if ($callableExpression instanceof Microsoft\PhpParser\Node\QualifiedName) { + $actual_name = $callableExpression->getResolvedName(); + } elseif ($callableExpression instanceof Microsoft\PhpParser\Node\Expression\MemberAccessExpression) { + $memberNameToken = $callableExpression->memberName; + $actual_name = (new NodeUtils($contents->getContents()))->tokenToString($memberNameToken); + } else { + //print "Callable expression is ".get_class($callableExpression)."- Skip $instance".PHP_EOL; + continue; + } + + if ((string) $actual_name !== (string) $expected_name) { + print "Name unexpected '$actual_name'!='$expected_name' - Skip $instance".PHP_EOL; + continue; + } + + foreach ($arguments as $i => $argument) { + if ($argument instanceof ArgumentExpression) { + //print "Type$i: ".get_class($argument->expression).PHP_EOL; + } + } + + $fieldValue = null; + + + $arg = $arguments[$argIdx]; + + if ( + $arg instanceof ArgumentExpression + // && $arg->expression instanceof StringLiteral + && $arg->expression instanceof NumericLiteral + ) { + // Get the value of the NumericLiteral + $fieldValue = (string) $arg->expression; + print "Number is '$fieldValue'".PHP_EOL; + /* + // Get the string value of the StringLiteral + $fieldValue = $arg->expression->getStringContentsText(); + print "String is '$fieldValue'".PHP_EOL; + */ + } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { + $child = $arg->expression->children; + if (!$child instanceof Token) { + continue; + } + $token_str = (new NodeUtils($contents->getContents()))->tokenToString($child); + print "$token_str KIND:".($child->kind ?? 'no kind')." ".get_class($child).PHP_EOL; + + if ($token_str !== 'null') { + continue; + } + + $fieldValue = ''; // Fake empty + } else { + print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + if ($fieldValue !== $expectedStringValue) { + print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + continue; + } + + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; + + + + // Get the first argument (delimiter) + $argument_to_replace = $arg; + + $arg_start_pos = $argument_to_replace->getStartPosition(); + $arg_end_pos = $argument_to_replace->getEndPosition(); + + // Set edit instruction + $edits[] = new FileEdit($arg_start_pos, $arg_end_pos, $replacement); + } + if ($edits) { + return new FileEditSet($edits); + } + return null; + }; + IssueFixer::registerFixerClosure( + 'PhanTypeMismatchArgument', + $fix + ); +}); diff --git a/dev/tools/phan/plugins/setPageOrientationFixer.php b/dev/tools/phan/plugins/setPageOrientationFixer.php index 657241ca155..09658fe6d23 100644 --- a/dev/tools/phan/plugins/setPageOrientationFixer.php +++ b/dev/tools/phan/plugins/setPageOrientationFixer.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2024-2025 MDW * * For 'price()', replace $form parameter that is '' with 0. */ @@ -19,6 +19,7 @@ use Phan\Plugin\Internal\IssueFixingPlugin\IssueFixer; use Microsoft\PhpParser\Node\Expression\ArgumentExpression; use Microsoft\PhpParser\Node\DelimitedList\ArgumentExpressionList; use Microsoft\PhpParser\Node\StringLiteral; +use Microsoft\PhpParser\Node\NumericLiteral; use Microsoft\PhpParser\Node\ReservedWord; use Microsoft\PhpParser\Token; @@ -38,31 +39,31 @@ call_user_func(static function (): void { //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 3 ($h) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) //htdocs\supplier_proposal\card.php:1705 PhanTypeMismatchArgumentProbablyReal Argument 4 ($m) is '' of type '' but \Form::selectDate() takes int (no real type) defined at htdocs\core\class\html.form.class.php:6799 (the inferred real argument type has nothing in common with the parameter's phpdoc type) - + // var_dump($instance->getTemplateParameters()); $argument_index = (string) $instance->getTemplateParameters()[0]; $argument_name = (string) $instance->getTemplateParameters()[1]; $argument_code = (string) $instance->getTemplateParameters()[2]; $argument_type = (string) $instance->getTemplateParameters()[3]; - $details = (string) $instance->getTemplateParameters()[4]; - $functionlike = (string) $instance->getTemplateParameters()[5]; + $functionlike = (string) $instance->getTemplateParameters()[4]; + $functiontype = (string) $instance->getTemplateParameters()[5]; - $expected_functionlike = "\\TCPDI::setPageOrientation()"; + $expected_functionlike = "\\TCPDF::setPageOrientation()"; $expected_name = "setPageOrientation"; if ($functionlike !== $expected_functionlike) { - print "$functionlike != '$expected_functionlike'".PHP_EOL; + //print "$functionlike != '$expected_functionlike'".PHP_EOL; return null; } - $toBoolReplaceArray=array("0"=>"false","1"=>"true"); + $toBoolReplaceArray = array("0" => "false","1" => "true"); // Check if we fix any of this if ( - ($argument_name === 'argument_name' && in_array($argument_code, array_keys($toBoolReplaceArray))) + ($argument_name === 'autopagebreak' && in_array($argument_code, array_keys($toBoolReplaceArray))) //|| ($argument_name === 'm' && $argument_code === "''") //|| ($argument_name === 'empty' && $argument_code === "''") ) { - $replacement = $toBoolReplaceArray[$argument_name]; + $replacement = $toBoolReplaceArray[$argument_code]; $argIdx = ($argument_index - 1) * 2; - $expectedStringValue = ""; + $expectedStringValue = $argument_code; } else { print "ARG$argument_index:$argument_name CODE:$argument_name".PHP_EOL; return null; @@ -112,22 +113,22 @@ call_user_func(static function (): void { foreach ($arguments as $i => $argument) { if ($argument instanceof ArgumentExpression) { - print "Type$i: ".get_class($argument->expression).PHP_EOL; + // print "Type$i: ".get_class($argument->expression).PHP_EOL; } } - $stringValue = null; + $fieldValue = null; $arg = $arguments[$argIdx]; if ( $arg instanceof ArgumentExpression - && $arg->expression instanceof StringLiteral + && $arg->expression instanceof NumericLiteral ) { - // Get the string value of the StringLiteral - $stringValue = $arg->expression->getStringContentsText(); - print "String is '$stringValue'".PHP_EOL; + // Get the string value of the NumericLiteral + $fieldValue = (string) $arg->expression; + //print "Field is '$fieldValue'".PHP_EOL; } elseif ($arg instanceof ArgumentExpression && $arg->expression instanceof ReservedWord) { $child = $arg->expression->children; if (!$child instanceof Token) { @@ -140,18 +141,18 @@ call_user_func(static function (): void { continue; } - $stringValue = ''; // Fake empty + $fieldValue = ''; // Fake empty } else { - print "Expression is not string or null ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + // print "Expression is not expected type ".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; continue; } - if ($stringValue !== $expectedStringValue) { - print "Not replacing $argument_name which is '$stringValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; + if ($fieldValue !== $expectedStringValue) { + // print "Not replacing '$argument_name' which is '$fieldValue'/".get_class($arg)."/".get_class($arg->expression)."- Skip $instance".PHP_EOL; continue; } - print "Fixture elem on $line - $actual_name(...'$stringValue'...) - $instance".PHP_EOL; + print "Fixture elem on $line - $actual_name(...'$fieldValue'...) - $instance".PHP_EOL; From 3c39df33f55f3a037e3bb7bf4fdd5964221e9349 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 5 Feb 2025 01:38:23 +0100 Subject: [PATCH 169/375] Qual: Update phan baseline --- dev/tools/phan/baseline.txt | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 1c639a11b22..47f28a257ba 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,7 +9,7 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 3540+ occurrences + // PhanTypeMismatchArgument : 2570+ occurrences // PhanUndeclaredProperty : 530+ occurrences // PhanTypeMismatchArgumentNullable : 450+ occurrences // PhanUndeclaredGlobalVariable : 190+ occurrences @@ -412,12 +412,9 @@ return [ 'htdocs/core/login/functions_dolibarr.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/login/functions_ldap.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/core/menus/standard/auguria.lib.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/action/doc/pdf_standard_actions.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/asset/doc/pdf_standard_asset.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/asset/mod_asset_advanced.php' => ['PhanUndeclaredProperty'], - 'htdocs/core/modules/bank/doc/pdf_ban.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/barcode/mod_barcode_product_standard.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/barcode/mod_barcode_thirdparty_standard.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php' => ['PhanTypeMismatchArgument'], @@ -483,33 +480,28 @@ return [ 'htdocs/core/modules/printsheet/doc/pdf_standardlabel.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/product/doc/pdf_standard.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/project/doc/pdf_baleine.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/project/doc/pdf_beluga.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/project/doc/pdf_timespent.modules.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/propale/doc/pdf_azur.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/propale/doc/pdf_cyan.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/rapport/pdf_paiement.class.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/reception/doc/pdf_squille.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/core/modules/societe/doc/doc_generic_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/stock/doc/pdf_standard_stock.modules.php' => ['PhanTypeMismatchArgument'], 'htdocs/core/modules/stocktransfer/doc/pdf_eagle.modules.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], + 'htdocs/core/modules/stocktransfer/doc/pdf_eagle_proforma.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/stocktransfer/mod_stocktransfer_advanced.php' => ['PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], + 'htdocs/core/modules/supplier_invoice/doc/pdf_canelle.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty'], 'htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_payment/doc/pdf_standard_supplierpayment.modules.php' => ['PhanTypeMismatchArgument'], + 'htdocs/core/modules/supplier_order/doc/pdf_cornas.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_order/doc/pdf_muscadet.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], + 'htdocs/core/modules/supplier_proposal/doc/pdf_zenith.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchDimFetch', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], 'htdocs/core/modules/syslog/mod_syslog_file.php' => ['PhanPluginDuplicateArrayKey'], 'htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php' => ['PhanTypeMismatchArgument'], @@ -817,7 +809,7 @@ return [ 'htdocs/recruitment/class/recruitmentcandidature.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/class/recruitmentjobposition.class.php' => ['PhanUndeclaredProperty'], 'htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php' => ['PhanTypeMismatchArgument'], - 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], + 'htdocs/recruitment/core/modules/recruitment/doc/pdf_standard_recruitmentjobposition.modules.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentcandidature_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/recruitment/core/modules/recruitment/mod_recruitmentjobposition_advanced.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/recruitment/index.php' => ['PhanUndeclaredGlobalVariable'], From 14f3ee6cc09835e018d063b5121072198ec4a04c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 5 Feb 2025 03:04:11 +0100 Subject: [PATCH 170/375] Update ChangeLog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 44bf9938e38..c8f9e8bb857 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1216,7 +1216,7 @@ NEW: updating for display Help title when try to delete Don (issue #25314) NEW: Upgrade in module builder in menu section NEW: use account address in sepa mandate (#23642) NEW: VAT rate - Add entity -NEW: When an user unset the batch management of products, transformation of each batch stock mouvement in global stock mouvement +NEW: When an user unset the batch management of products, transformation of each batch stock movement in global stock movement NEW: PDF Generation for each Human Resource Evaluations. SEC: #25512 applicative anti bruteforce - security on too many login attempts (#25520) From e1ff669ca5121a0a723087073f6c334b86196fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Feb 2025 08:50:45 +0100 Subject: [PATCH 171/375] fix translations --- htdocs/langs/fr_CA/website.lang | 2 +- htdocs/langs/fr_FR/website.lang | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/fr_CA/website.lang b/htdocs/langs/fr_CA/website.lang index 589f08c1dd9..be642d35a98 100644 --- a/htdocs/langs/fr_CA/website.lang +++ b/htdocs/langs/fr_CA/website.lang @@ -50,7 +50,7 @@ NoPageYet=Pas encore de pages YouCanCreatePageOrImportTemplate=Vous pouvez créer une nouvelle page ou importer un modèle de site Web complet SyntaxHelp=Aide sur des astuces de syntaxe spécifiques YouCanEditHtmlSourceckeditor=Vous pouvez modifier le code source HTML en utilisant le bouton « Source » dans l'éditeur. -YouCanEditHtmlSource=
Vous pouvez inclure du code PHP dans cette source en utilisant les balises <?php ?>. Les variables globales suivantes sont disponibles : $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

Vous pouvez également inclure le contenu d'une autre page/conteneur avec la syntaxe suivante :
<?php includeContainer('alias_du_conteneur_à_inclure'); ?>

Vous pouvez créer une redirection vers une autre page/conteneur avec la syntaxe suivante (Remarque : n'affichez aucun contenu avant une redirection) :
<?php redirectToContainer('alias_du_conteneur_vers_la_rediriger'); ?>
Vous pouvez également effectuer une redirection avec des paramètres GET :
<?php redirectToContainer('alias_of_container_to_redirect_to', '', 0, 0, $array_of_get_params); ?>

Pour ajouter un lien vers une autre page, utilisez la syntaxe :
<a href="alias_de_la_page_à_lier_à.php">monlien<a>

Vous pouvez définir dynamiquement le titre de la page et les balises méta SEO (titre, mots-clés, description). Définissez simplement les variables suivantes :
$__PAGE__TITLE__ = "Valeur du titre …";
$__PAGE__KEYWORDS__ = "mot-clé1, mot-clé2, mot-clé3 …"; // Séparé par des virgules
$__PAGE__DESC__ = "Description …";


À inclure un lien pour télécharger un fichier stocké dans le répertoire documents, utilisez le wrapper document.php :
Exemple, pour un fichier dans documents/ecm (à enregistrer), la syntaxe est :
class='notranslate'>
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
Pour un fichier dans documents/medias (répertoire ouvert pour accès public), la syntaxe est :
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Pour un fichier partagé avec un lien de partage (accès ouvert à l'aide de la clé de hachage de partage du fichier), la syntaxe est :
<a href="/document.php?hashp=publicsharekeyoffile">b0342f ccfda19bz0 +YouCanEditHtmlSource=
Vous pouvez inclure du code PHP dans cette source en utilisant les balises <?php ?>. Les variables globales suivantes sont disponibles : $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

Vous pouvez également inclure le contenu d'une autre page/conteneur avec la syntaxe suivante :
<?php includeContainer('alias_du_conteneur_à_inclure'); ?>

Vous pouvez créer une redirection vers une autre page/conteneur avec la syntaxe suivante (Remarque : n'affichez aucun contenu avant une redirection) :
<?php redirectToContainer('alias_du_conteneur_vers_la_rediriger'); ?>
Vous pouvez également effectuer une redirection avec des paramètres GET :
<?php redirectToContainer('alias_of_container_to_redirect_to', '', 0, 0, $array_of_get_params); ?>

Pour ajouter un lien vers une autre page, utilisez la syntaxe :
<a href="alias_de_la_page_à_lier_à.php">monlien<a>

Vous pouvez définir dynamiquement le titre de la page et les balises méta SEO (titre, mots-clés, description). Définissez simplement les variables suivantes :
$__PAGE__TITLE__ = "Valeur du titre …";
$__PAGE__KEYWORDS__ = "mot-clé1, mot-clé2, mot-clé3 …"; // Séparé par des virgules
$__PAGE__DESC__ = "Description …";


À inclure un lien pour télécharger un fichier stocké dans le répertoire documents, utilisez le wrapper document.php :
Exemple, pour un fichier dans documents/ecm (à enregistrer), la syntaxe est :
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
Pour un fichier dans documents/medias (répertoire ouvert pour accès public), la syntaxe est :
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Pour un fichier partagé avec un lien de partage (accès ouvert à l'aide de la clé de hachage de partage du fichier), la syntaxe est :
<a href="/document.php?hashp=publicsharekeyoffile">b0342f ccfda19bz0 YouCanEditHtmlSource1=
Pour inclure une image stockée dans le répertoire medias (répertoire ouvert au public), utilisez le chemin relatif commençant par /medias, exemple :
<img src="/medias/image/myimagepath/filename.ext">
YouCanEditHtmlSource2=Pour une image partagée avec un lien de partage (accès libre à l'aide de la clé de hachage de partage du fichier), utilisez le wrapper :
<img src="/viewimage.php?hashp=12345679012...">
YouCanEditHtmlSource3=Pour obtenir l'URL de l'image d'un objet PHP, utilisez
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
diff --git a/htdocs/langs/fr_FR/website.lang b/htdocs/langs/fr_FR/website.lang index 423aefb5ee8..106bb9eb483 100644 --- a/htdocs/langs/fr_FR/website.lang +++ b/htdocs/langs/fr_FR/website.lang @@ -62,7 +62,7 @@ NoPageYet=Pas de page pour l'instant YouCanCreatePageOrImportTemplate=Vous pouvez créer une nouvelle page ou importer un modèle de site Web complet. SyntaxHelp=Aide sur quelques astuces spécifiques de syntaxe YouCanEditHtmlSourceckeditor=Vous pouvez éditer le code source en activant l'éditeur HTML avec le bouton "Source". -YouCanEditHtmlSource=
Vous pouvez inclure du code PHP dans cette source en utilisant les tags <?php ?>. Les variables globales suivantes sont disponibles : $conf, $db, $mysoc, $utilisateur, $website, $websitepage, $weblangs, $pagelangs.

Vous pouvez également inclure du contenu d'une autre page/conteneur avec la syntaxe suivante :
<?php includeContainer('alias_of_container_to_include'); ?>

Vous pouvez effectuer une redirection vers une autre page/conteneur avec la syntaxe suivante (Remarque : ne génère aucun contenu avant une redirection) :
<?php redirectToContainer(' alias_of_container_to_redirect_to'); ?>
Vous pouvez également effectuer une redirection avec les paramètres GET :
<?php redirectToContainer('alias_of_container_to_redirect_to', '', 0, 0, $array_of_get_params); ?>

Pour ajouter un lien vers une autre page, utilisez la syntaxe :
<a href="alias_of_page_to_link_to.php" >monlien<a>

Pour inclure un lien pour télécharger un fichier stocké dans le répertoire documents, utilisez l'encapsuleur document.php :
Exemple, pour un fichier dans documents/ecm (besoin d'être loggué), la syntaxe est :
<a href="/document.php?modulepart=ecm&fichier= [relative_dir/]filename.ext">
Pour un fichier dans des documents/médias (répertoire ouvert en accès public), la syntaxe est:
<a href="/document.php?modulepart=medias&fichier=[relative_dir/]filename.ext">
Pour un fichier partagé avec un lien de partage (accès ouvert en utilisant la clé de partage de fichier), la syntaxe est:
<a href="/document.php?hashp=publicsharekeyoffile">
+YouCanEditHtmlSource=
Vous pouvez inclure du code PHP dans cette source en utilisant les tags <?php ?>. Les variables globales suivantes sont disponibles : $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

Vous pouvez également inclure du contenu d'une autre page/conteneur avec la syntaxe suivante :
<?php includeContainer('alias_of_container_to_include'); ?>

Vous pouvez effectuer une redirection vers une autre page/conteneur avec la syntaxe suivante (Remarque : ne génère aucun contenu avant une redirection) :
<?php redirectToContainer(' alias_of_container_to_redirect_to'); ?>
Vous pouvez également effectuer une redirection avec les paramètres GET :
<?php redirectToContainer('alias_of_container_to_redirect_to', '', 0, 0, $array_of_get_params); ?>

Pour ajouter un lien vers une autre page, utilisez la syntaxe :
<a href="alias_of_page_to_link_to.php" >monlien<a>

Pour inclure un lien pour télécharger un fichier stocké dans le répertoire documents, utilisez l'encapsuleur document.php :
Exemple, pour un fichier dans documents/ecm (besoin d'être loggué), la syntaxe est :
<a href="/document.php?modulepart=ecm&fichier= [relative_dir/]filename.ext">
Pour un fichier dans des documents/médias (répertoire ouvert en accès public), la syntaxe est:
<a href="/document.php?modulepart=medias&fichier=[relative_dir/]filename.ext">
Pour un fichier partagé avec un lien de partage (accès ouvert en utilisant la clé de partage de fichier), la syntaxe est:
<a href="/document.php?hashp=publicsharekeyoffile">
YouCanEditHtmlSource1=
Pour inclure une image stockée dans le répertoire medias (répertoire ouvert au public), utilisez le chemin relatif commençant par /medias, exemple:
<img src="/medias/image/myimagepath/filename.ext">
YouCanEditHtmlSource2=Pour une image partagée avec un lien de partage (accès libre à l'aide de la clé de partage de fichier), utilisez l'encapsuleur :
<img src="/viewimage.php?hashp=12345679012...">
YouCanEditHtmlSource3=Pour obtenir l'adresse URL de l'image d'un objet PHP, utilisez
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
From e6e79fde1f3381ac111b83f86b66649ad2d0c0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Feb 2025 09:00:24 +0100 Subject: [PATCH 172/375] fix translations admin --- dev/translation/ignore_translation_keys.lst | 2 -- htdocs/langs/en_US/admin.lang | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index edb528c90de..34e7a95595f 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -428,7 +428,6 @@ FeatureNotAvailableWithThisDatabaseDriver FieldNotFoundInObject FieldsEdit FieldsInsert -FieldsLinked FieldsView File encoding FileDidAlreadyExist @@ -1097,7 +1096,6 @@ PDF/A-1b PDF/A-3b PartnershipSentByEMail PdfTitle -Privileges ProcessingError PurchaseOrder PurchaseOrders diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4166884bdf2..58a95356419 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2608,3 +2608,5 @@ PdfAddTermOfSaleHelp=You can upload the terms and conditions of sale file at the WarningOnlineSignature=Please note that this function allows a person (customer, supplier...) to insert, online, the image of his signature in the PDF document. As for a handwritten signature, such a signature can be made by anyone and might not have the same legal value as a legal electronic signature system going through an authorized trusted third party. If you need this level of security, you can contact an integrator for more information or check for addons on www.dolistore.org. UploadExtensionRestriction=List of forbidden file extensions to upload UploadExtensionRestrictionExemple=htm, html, shtml, js, php +Privileges=Privileges +FieldsLinked=Fields Linked From 51353339cff780c6800bb5b78628d563c7c2b4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Feb 2025 09:23:36 +0100 Subject: [PATCH 173/375] fix translations modulebuilder --- dev/translation/ignore_translation_keys.lst | 3 --- htdocs/langs/en_US/modulebuilder.lang | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index 34e7a95595f..a75b4fa5975 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -426,9 +426,6 @@ FailedtoSetToApprove FailedtoSetToDeny FeatureNotAvailableWithThisDatabaseDriver FieldNotFoundInObject -FieldsEdit -FieldsInsert -FieldsView File encoding FileDidAlreadyExist FileIsNotCorrect diff --git a/htdocs/langs/en_US/modulebuilder.lang b/htdocs/langs/en_US/modulebuilder.lang index 5a8117149c7..82256006853 100644 --- a/htdocs/langs/en_US/modulebuilder.lang +++ b/htdocs/langs/en_US/modulebuilder.lang @@ -190,3 +190,6 @@ EmailingSelectorFile=Emails selector file NoEmailingSelector=No emails selector file ModuleTranslatedIntoLangForKeyInto=Translated into a .lang file for key %s into "%s" PageLinkedByAMenuEntry=Page linked by at least one menu entry +FieldsEdit=Fields edit +FieldsInsert=Fields insert +FieldsView=Fields view From 7f53089663ab910f489b4cd7cbef2bd8ef4b83e7 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 10:42:16 +0100 Subject: [PATCH 174/375] Fix better way to use filter on cover --- htdocs/core/lib/website.lib.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index c243285abe2..ae13e84ebe6 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -1080,11 +1080,11 @@ function getNbOfImagePublicURLOfObject($object) * @param Object $object Object * @param int $no Numero of image (if there is several images. 1st one by default) * @param string $extName Extension to differentiate thumb file name ('', '_small', '_mini') - * @param int $cover 1=Add a filter on field "cover", 0=Exclude "cover" images, -1=No filter + * @param int $cover 1=Sort with cover then position, -1=Filter on cover last then position, 0=Exclude cover and filter on position first * @return string HTML img content or '' if no image found * @see getNbOfImagePublicURLOfObject(), getPublicFilesOfObject(), getImageFromHtmlContent() */ -function getImagePublicURLOfObject($object, $no = 1, $extName = '', $cover = -1) +function getImagePublicURLOfObject($object, $no = 1, $extName = '', $cover = 1) { global $db; @@ -1099,8 +1099,12 @@ function getImagePublicURLOfObject($object, $no = 1, $extName = '', $cover = -1) $sql .= " WHERE entity IN (".getEntity($object->element).")"; $sql .= " AND src_object_type = '".$db->escape($object->element)."' AND src_object_id = ".((int) $object->id); // Filter on object $sql .= " AND ".$db->regexpsql('filename', $regexforimg, 1); - $sql .= ($cover >= 0 ? " AND cover = ".((int) $cover) : ""); - $sql .= $db->order("cover,position,rowid", "ASC,ASC,ASC"); + $sql .= ($cover ? "" : " AND cover <> 1"); + if ($cover == 1) { + $sql .= $db->order("cover,position,rowid", "ASC,ASC,ASC"); + } else { + $sql .= $db->order("cover,position,rowid", "DESC,ASC,ASC"); + } $resql = $db->query($sql); if ($resql) { From ca5c511bb6613780c71205e3f315c5456d9d2e14 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 11:17:40 +0100 Subject: [PATCH 175/375] Fix warning --- htdocs/core/actions_massactions.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 9df8ba6334f..f1e44a4476f 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -961,10 +961,10 @@ if (!$error && $massaction == "builddoc" && $permissiontoread && !GETPOST('butto $filename .= '_'.strtolower(dol_sanitizeFileName($langs->transnoentities("Unpaid"))); } } - if ($year) { + if (!empty($year)) { $filename .= '_'.$year; } - if ($month) { + if (!empty($month)) { $filename .= '_'.$month; } if ($pagecount) { From bbbba45fc1d87c3c438226e2c22e814c8d280b7b Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 5 Feb 2025 11:19:36 +0100 Subject: [PATCH 176/375] FIX wrong message on update shipment --- htdocs/expedition/dispatch.php | 2 +- htdocs/langs/en_US/sendings.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index bf7b23b21d3..fd9f2f7f1b9 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -342,7 +342,7 @@ if ($action == 'updatelines' && $usercancreate) { setEventMessages($error, $errors, 'errors'); } else { $db->commit(); - setEventMessages($langs->trans("ReceptionUpdated"), null); + setEventMessages($langs->trans("ShipmentUpdated"), null); header("Location: ".DOL_URL_ROOT.'/expedition/dispatch.php?id='.$object->id); exit; diff --git a/htdocs/langs/en_US/sendings.lang b/htdocs/langs/en_US/sendings.lang index b3fc779dd2f..87975084a50 100644 --- a/htdocs/langs/en_US/sendings.lang +++ b/htdocs/langs/en_US/sendings.lang @@ -63,6 +63,7 @@ NoProductToShipFoundIntoStock=No product to ship found in warehouse %s. C WeightVolShort=Weight/Vol. ValidateOrderFirstBeforeShipment=You must first validate the order before being able to make shipments. NoLineGoOnTabToAddSome=No line, go on tab "%s" to add +ShipmentUpdated=Shipment successfully updated # Sending methods # ModelDocument From 27d5eada7a40d292277a1ef476e7b4732792a5b1 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 11:36:44 +0100 Subject: [PATCH 177/375] Fix translation --- htdocs/langs/en_US/website.lang | 5 ++++- htdocs/website/index.php | 3 +++ htdocs/website/samples/page-sample-dynamiccontent.html | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index 212147881ff..bc3cb7f6bc3 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -62,7 +62,10 @@ NoPageYet=No pages yet YouCanCreatePageOrImportTemplate=You can create a new page or import a full website template SyntaxHelp=Help on specific syntax tips YouCanEditHtmlSourceckeditor=You can edit HTML source code using the "Source" button in editor. -YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>
You can also make a redirection with GET parameters:
<?php redirectToContainer('alias_of_container_to_redirect_to', '', 0, 0, $array_of_get_params); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

You can dynamically set the page title and SEO meta tags (title, keywords, description). Simply define the following variables:
$__PAGE__TITLE__ = "Title value …";
$__PAGE__KEYWORDS__ = "keyword1, keyword2, keyword3 …"; // Comma separated
$__PAGE__DESC__ = "Description …";


To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">
+YouCanEditHtmlSource=
You can include PHP code into this source using tags <?php ?>. The following global variables are available: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

You can also include content of another Page/Container with the following syntax:
<?php includeContainer('alias_of_container_to_include'); ?>

You can make a redirect to another Page/Container with the following syntax (Note: do not output any content before a redirect):
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>
You can also make a redirection with GET parameters:
<?php redirectToContainer('alias_of_container_to_redirect_to', '', 0, 0, $array_of_get_params); ?>

To add a link to another page, use the syntax:
<a href="alias_of_page_to_link_to.php">mylink<a>

+YouCanEditHtmlSourceb= You can dynamically set SEO title and meta tags (title, keywords, description). Simply define the following variables:
$__PAGE_TITLE__ = "Title value …";
$__PAGE_KEYWORDS__ = "keyword1, keyword2, keyword3 …"; // Comma separated
$__PAGE_DESC__ = "Description …";
+YouCanEditHtmlSourcec= To include a link to download a file stored into the documents directory, use the document.php wrapper:
Example, for a file into documents/ecm (need to be logged), syntax is:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
For a file into documents/medias (open directory for public access), syntax is:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
+YouCanEditHtmlSourced=For a file shared with a share link (open access using the sharing hash key of file), syntax is:
<a href="/document.php?hashp=publicsharekeyoffile">
YouCanEditHtmlSource1=
To include an image stored into the medias directory (directory open for public access), use the relative path starting with /medias, example:
<img src="/medias/image/myimagepath/filename.ext">
YouCanEditHtmlSource2=For an image shared with a share link (open access using the sharing hash key of file), use the wrapper:
<img src="/viewimage.php?hashp=12345679012...">
YouCanEditHtmlSource3=To get the URL of the image of a PHP object, use
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
diff --git a/htdocs/website/index.php b/htdocs/website/index.php index f4c758417a7..baec057484e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -3788,6 +3788,9 @@ if (!GETPOST('hide_websitemenu')) { $htmltext = ''; $htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSource", $url); + $htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSourceb", $url); + $htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSourcec", $url); + $htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSourced", $url); $htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSource1", $url); $htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSource2", $url); $htmltext .= $langs->transnoentitiesnoconv("YouCanEditHtmlSource3", $url); diff --git a/htdocs/website/samples/page-sample-dynamiccontent.html b/htdocs/website/samples/page-sample-dynamiccontent.html index d66e04cfd01..2f33407960a 100644 --- a/htdocs/website/samples/page-sample-dynamiccontent.html +++ b/htdocs/website/samples/page-sample-dynamiccontent.html @@ -38,6 +38,9 @@ __(AnotherContainer)__


__(YouCanEditHtmlSource)__ +__(YouCanEditHtmlSourceb)__ +__(YouCanEditHtmlSourcec)__ +__(YouCanEditHtmlSourced)__

Page created by __WEBSITE_CREATED_BY__
From 01bda57d3a79dfae91bf24795dee220859986157 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 11:51:27 +0100 Subject: [PATCH 178/375] Fix translation --- htdocs/langs/ca_ES/website.lang | 6 +++--- htdocs/langs/da_DK/website.lang | 6 +++--- htdocs/langs/lv_LV/website.lang | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/langs/ca_ES/website.lang b/htdocs/langs/ca_ES/website.lang index 6c11449aed0..b496eaf6e50 100644 --- a/htdocs/langs/ca_ES/website.lang +++ b/htdocs/langs/ca_ES/website.lang @@ -62,11 +62,11 @@ NoPageYet=Encara sense pàgines YouCanCreatePageOrImportTemplate=Podeu crear una pàgina nova o importar una plantilla completa del lloc web SyntaxHelp=Ajuda sobre consells de sintaxi específica YouCanEditHtmlSourceckeditor=Podeu editar el codi font HTML usant el botó "Codi font" a l'editor. -YouCanEditHtmlSource=
Podeu incloure codi PHP en aquesta font utilitzant les etiquetes <?php ?>b70f65fc09 /span>. Les variables globals següents estan disponibles: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

També podeu incloure contingut d'una altra pàgina/contenidor amb la sintaxi següent:
span><?php includeContainer('alias_of_container_to_include'); ?>
b0342fc9bz0 /span> Podeu fer una redirecció a una altra pàgina/contenidor amb la sintaxi següent (Nota: no envieu cap contingut abans d'una redirecció) :
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>
També podeu fer una redirecció amb els paràmetres GET:
<?php redirectToContainer('alias_to', 'redirect,_0_to', 'redirectTo' 0, $array_of_get_params); ?>
b0342fc9bz0 /span> Per afegir un enllaç a una altra pàgina, utilitzeu la sintaxi:
<a href="alias_of_page_to_link_to.php">mylink<0 class='notranslate'><
a>b0319bzcc
b0319bzcc >

b014d7f165b Podeu configurar dinàmicament el títol de la pàgina i Metaetiquetes de SEO (títol, paraules clau, descripció). Simplement definiu les variables següents:
$__PAGE__TITLE__ = "Valor del títol...";b1z08a8b77
$__PAGE__KEYWORDS__ = "paraula clau1, paraula clau2, paraula clau3..."; // Separat per comes
$___PAGE =Descripció ;


b0d9a138z0
b0d9a138 Per incloure un enllaç per baixar un fitxer emmagatzemat al class='notranslate'>documents, utilitzeu el directori document.php wrapper:
Exemple, per a un fitxer en documents/ecm (cal registrar-se), la sintaxi és:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
Per a un fitxer en documents o mitjans (directori obert per a l'accés públic), la sintaxi és:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Per a un fitxer compartit amb un enllaç compartit (accés obert mitjançant la clau hash per compartir del fitxer), la sintaxi és:
<a href="/document.php?hashp=publicsharekeyoffile">
-YouCanEditHtmlSource1=
Per incloure un imatge emmagatzemat als mitjans de comunicació (directori obert per a l'accés públic), utilitzeu el camí relatiu que comença per /mediasb0a65dc071f , exemple:
<img src="/medias/image/myimagepath/filename ext">
+YouCanEditHtmlSource=
Podeu incloure codi PHP en aquesta font utilitzant les etiquetes <?php ?>b70f65fc09 /span>. Les variables globals següents estan disponibles: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

També podeu incloure contingut d'una altra pàgina/contenidor amb la sintaxi següent:
span><?php includeContainer('alias_of_container_to_include'); ?>
b0342fc9bz0 /span> Podeu fer una redirecció a una altra pàgina/contenidor amb la sintaxi següent (Nota: no envieu cap contingut abans d'una redirecció) :
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>
També podeu fer una redirecció amb els paràmetres GET:
<?php redirectToContainer('alias_to', 'redirect,_0_to', 'redirectTo' 0, $array_of_get_params); ?>
b0342fc9bz0 /span> Per afegir un enllaç a una altra pàgina, utilitzeu la sintaxi:
<a href="alias_of_page_to_link_to.php">mylink<0 class='notranslate'><
a>b0319bzcc
b0319bzcc >

b014d7f165b Podeu configurar dinàmicament el títol de la pàgina i Metaetiquetes de SEO (títol, paraules clau, descripció). Simplement definiu les variables següents:
$__PAGE__TITLE__ = "Valor del títol...";b1z08a8b77
$__PAGE__KEYWORDS__ = "paraula clau1, paraula clau2, paraula clau3..."; // Separat per comes
$___PAGE =Descripció ;


b0d9a138z0
b0d9a138 Per incloure un enllaç per baixar un fitxer emmagatzemat al documents, utilitzeu el directori document.php wrapper:
Exemple, per a un fitxer en documents/ecm (cal registrar-se), la sintaxi és:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
Per a un fitxer en documents o mitjans (directori obert per a l'accés públic), la sintaxi és:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Per a un fitxer compartit amb un enllaç compartit (accés obert mitjançant la clau hash per compartir del fitxer), la sintaxi és:
<a href="/document.php?hashp=publicsharekeyoffile">
+YouCanEditHtmlSource1=
Per incloure un imatge emmagatzemat als mitjans de comunicació (directori obert per a l'accés públic), utilitzeu el camí relatiu que comença per /mediasb0a65dc071f , exemple:
<img src="/medias/image/myimagepath/filename ext">
YouCanEditHtmlSource2=Per a una imatge compartida amb un enllaç per compartir (accés obert mitjançant la clau hash per compartir del fitxer), utilitzeu l'embolcall:
<img src="/viewimage.php?hashp=12345679012...">b0319bzcc YouCanEditHtmlSource3=Per a obtenir l'URL de la imatge d'un objecte PHP, utilitzeu
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
-YouCanEditHtmlSource4=Per obtenir l'URL d'una imatge dins del contingut html d'un article, utilitzeu
<img src="<?php print getImageFromHtmlContent($htmlcontent, 1) ?>"b0012c7z0 span class='notranslate'>
+YouCanEditHtmlSource4=Per obtenir l'URL d'una imatge dins del contingut html d'un article, utilitzeu
<img src="<?php print getImageFromHtmlContent($htmlcontent, 1) ?>">
YouCanEditHtmlSourceMore=
More examples of HTML or dynamic code available on the wiki documentation.
ClonePage=Clona la pàgina/contenidor CloneSite=Clona el lloc diff --git a/htdocs/langs/da_DK/website.lang b/htdocs/langs/da_DK/website.lang index 287f0beafe9..0c12d24c6e4 100644 --- a/htdocs/langs/da_DK/website.lang +++ b/htdocs/langs/da_DK/website.lang @@ -56,17 +56,17 @@ ReadPerm=Læs WritePerm=Skriv TestDeployOnWeb=Test / implementer på nettet PreviewSiteServedByWebServer= Se %s i en ny fane.

%s vil blive serveret af en ekstern webserver (som Apache, Nginx, IIS). Du skal installere og konfigurere denne server før du peger på biblioteket:
%s
URL serveret af ekstern server:
%s -PreviewSiteServedByDolibarr=Se forhåndsvisning af %s på en ny fane.

%s vil blive serveret af Dolibarr-serveren, så den behøver ikke nogen ekstra webserver (som Apache, Nginx, IIS) skal installeres.
Det ubelejlige er, at sidernes URL'er ikke er brugervenlige og starter med stien til din Dolibarr.
URL tjent af Dolibarr:
URL tjent af Dolibarr:


For at implementere eller teste ved hjælp af din egen eksterne webserver (som Apache, Nginx, Lighttp) bruger linket "%s". VirtualHostUrlNotDefined=URL til den virtuelle vært, der serveres af en ekstern webserver, der ikke er defineret NoPageYet=Ingen sider endnu YouCanCreatePageOrImportTemplate=Du kan oprette en ny side eller importere en fuld hjemmeside skabelon SyntaxHelp=Hjælp til specifikke syntax tips YouCanEditHtmlSourceckeditor=Du kan redigere HTML-kildekode ved hjælp af knappen "Kilde" i editoren. YouCanEditHtmlSource=
Du kan inkludere PHP-kode i denne kilde ved hjælp af tags <?php ?>
b03492bzfcc Du kan foretage en omdirigering til en anden side/beholder med følgende syntaks (Bemærk: udskriv ikke nogen indhold før en omdirigering):
<?php redirectToContainer alias_of_container_to_redirect_to'); ?>
Du kan også lave en omdirigering med GET-parametre:
<?php redirectToContainer('container_to', 'container_alias_of', 'container_to' 0, 0, $array_of_get_params); ?>
b03492bzfcc For at tilføje et link til en anden side skal du bruge syntaksen:
<a href="alias_of_page_to_link_to.php"b0012c7z0mylink<a>

b02bd88d791translate'> Du kan dynamisk indstille sidetitlen og SEO-metatags, søgeord, ). Definer blot følgende variabler:
$__PAGE__TITLE__ = "Titelværdi …";7d08a8a67b>b316dz0
$__PAGE__KEYWORDS__ = "søgeord1, søgeord2, søgeord3 …"; // Kommasepareret
____PAGE_DEscriptionSC ;


840d /span> At inkludere et link til download en fil gemt i mappen documents, skal du bruge document.php
wrapper:
Eksempel, for en fil til dokumenter/ecm (skal logges), er syntaksen:
<a href="/document.php?modulepart=[ecm&file relative_dir/]filename.ext">
tilFor en fil dokumenter/medier (åben mappe for offentlig adgang), syntaks er:
< /span>a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For en fil, der deles med et delingslink (åben adgang ved hjælp af filens hash-nøgle), er syntaksen:
<a href="/document.php?hashp=publicsharekeyoffile"b0012c7dcbe
-YouCanEditHtmlSource1=
At inkludere en image gemt i medier Bibliotek (bibliotek åben for offentlig adgang), brug den relative sti, der starter med /medias, eksempel:
<img src="/medias/image/.myimagepath/filename" span class='notranslate'>>
+YouCanEditHtmlSource1=
At inkludere en image gemt i medier Bibliotek (bibliotek åben for offentlig adgang), brug den relative sti, der starter med /medias, eksempel:
<img src="/medias/image/.myimagepath/filename">
YouCanEditHtmlSource2=For et billede, der er delt med et delelink (åben adgang ved hjælp af filens hashnøgle til deling), skal du bruge wrapperen:
<img src="/viewimage.php?hashp=12345679012...">
YouCanEditHtmlSource3=To get the URL of the image of a PHP object, use
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
-YouCanEditHtmlSource4=For at få URL'en til et billede i et html-indhold i en artikel brug
<img src="<?php print getImageFromHtmlContent($htmlcontent, 1) ?b0012c>b0012c>class ='notranslate'>>
+YouCanEditHtmlSource4=For at få URL'en til et billede i et html-indhold i en artikel brug
<img src="<?php print getImageFromHtmlContent($htmlcontent, 1) ?>">
YouCanEditHtmlSourceMore=
More examples of HTML or dynamic code available on the wiki documentation.
ClonePage=Klon side / container CloneSite=Klon website diff --git a/htdocs/langs/lv_LV/website.lang b/htdocs/langs/lv_LV/website.lang index 7d4929e545f..85de851d2e0 100644 --- a/htdocs/langs/lv_LV/website.lang +++ b/htdocs/langs/lv_LV/website.lang @@ -62,7 +62,7 @@ NoPageYet=Vēl nav nevienas lapas YouCanCreatePageOrImportTemplate=Jūs varat izveidot jaunu lapu vai importēt pilnu vietnes veidni SyntaxHelp=Palīdzība par konkrētiem sintakses padomiem YouCanEditHtmlSourceckeditor=Jūs varat rediģēt HTML avota kodu, izmantojot redaktorā pogu "Avots". -YouCanEditHtmlSource=
Šajā avotā varat iekļaut PHP kodu, izmantojot tagus <?php ?>
ccfda192bz0 /span> Varat veikt novirzīšanu uz citu lapu/konteineru, izmantojot šādu sintaksi (piezīme: neizvadiet nevienu saturs pirms novirzīšanas):
<?php redirectToContainer alias_of_container_to_redirect_to'); ?>
Varat arī veikt novirzīšanu, izmantojot GET parametrus.
<?php redirectToContainer,'alias_of_container, 0, 0, $array_of_get_params); ?>
ccfda192bz0 /span> Lai pievienotu saiti uz citu lapu, izmantojiet sintaksi:
<a href="alias_of_page_to_link_to.php"b0012c7d0bemana saite<a>

b02bd88d791f12 classz0'no '> Varat dinamiski iestatīt lapas nosaukumu un SEO metatagus, ti, aprakstu ). Vienkārši definējiet šādus mainīgos:
$__PAGE__TITLE__ = "Nosaukuma vērtība…";7b05d
$__PAGE__KEYWORDS__ = "atslēgvārds1, atslēgvārds2, atslēgvārds…"; // Atdalīts ar komatu
DESC___PAGE__ ; /span> Lai iekļautu saiti, lai lejupielādētu failu kas saglabāti dokumentu direktorijā, izmantojiet . iesaiņojums:
Piemērs, failam dokumentos/ecm (jāreģistrē), sintakse ir:
<a href="/document.php?modulepart=[ecm&fi relation_dir/]filename.ext">
failā dokumenti/mediji (atvērts direktorijs publiskai piekļuvei), sintakse ir:
< /span>a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Failam, kas kopīgots ar kopīgošanas saiti (atvērta piekļuve, izmantojot faila koplietošanas jaucējatslēgu), sintakse ir šāda:
<. span class='notranslate'><a href="/document.php?hashp=publicsharekeyoffile"b0012c7dc0
+YouCanEditHtmlSource=
Šajā avotā varat iekļaut PHP kodu, izmantojot tagus <?php ?>. Ir pieejami šādi globālie mainīgie: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

Varat iekļaut arī citas lapas/konteinera saturu ar šādu sintaksi:
<?php includeContainer('alias_of_includeer'); ?>
ccfda192bz0 /span> Varat veikt novirzīšanu uz citu lapu/konteineru, izmantojot šādu sintaksi (piezīme: neizvadiet nevienu saturs pirms novirzīšanas):
<?php redirectToContainer alias_of_container_to_redirect_to'); ?>
Varat arī veikt novirzīšanu, izmantojot GET parametrus.
<?php redirectToContainer,'alias_of_container, 0, 0, $array_of_get_params); ?>
ccfda192bz0 /span> Lai pievienotu saiti uz citu lapu, izmantojiet sintaksi:
<a href="alias_of_page_to_link_to.php"b0012c7d0bemana saite<a>

b02bd88d791f12 classz0'no '> Varat dinamiski iestatīt lapas nosaukumu un SEO metatagus, ti, aprakstu ). Vienkārši definējiet šādus mainīgos:
$__PAGE__TITLE__ = "Nosaukuma vērtība…";7b05d
$__PAGE__KEYWORDS__ = "atslēgvārds1, atslēgvārds2, atslēgvārds…"; // Atdalīts ar komatu
DESC___PAGE__ ; /span> Lai iekļautu saiti, lai lejupielādētu failu kas saglabāti dokumentu direktorijā, izmantojiet . iesaiņojums:
Piemērs, failam dokumentos/ecm (jāreģistrē), sintakse ir:
<a href="/document.php?modulepart=[ecm&fi relation_dir/]filename.ext">
failā dokumenti/mediji (atvērts direktorijs publiskai piekļuvei), sintakse ir:
< /span>a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Failam, kas kopīgots ar kopīgošanas saiti (atvērta piekļuve, izmantojot faila koplietošanas jaucējatslēgu), sintakse ir šāda:
<. span class='notranslate'><a href="/document.php?hashp=publicsharekeyoffile"b0012c7dc0
YouCanEditHtmlSource1=
To include an image stored into the medias directory (directory open for public access), use the relative path starting with /medias, example:
<img src="/medias/image/myimagepath/filename.ext">
YouCanEditHtmlSource2=For an image shared with a share link (open access using the sharing hash key of file), use the wrapper:
<img src="/viewimage.php?hashp=12345679012...">
YouCanEditHtmlSource3=To get the URL of the image of a PHP object, use
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
From 8cbdc82dc0676ba30978123d3171becff019ec46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Feb 2025 12:07:54 +0100 Subject: [PATCH 179/375] fix CI --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index a2fd416be65..94e39d68610 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1295,7 +1295,7 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa } } elseif (getDolGlobalString('PRODUIT_MULTIPRICES')) { $maxlevel = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); - for ($level = 1; $level <= $malevel; $level++) { + for ($level = 1; $level <= $maxlevel; $level++) { if ($object->price_base_type == 'TTC') { $newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100; $minprice = $object->multiprices_min_ttc[$level]; From 38820af10f6b8b4a2540a1a7ff1de9a22ccddc7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 5 Feb 2025 12:29:19 +0100 Subject: [PATCH 180/375] Update html.formticket.class.php --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 76c1ed3dda0..94517d5e4b1 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1277,7 +1277,7 @@ class FormTicket print ' selected="selected"'; } elseif ($arrayseverities['use_default'] == "1" && empty($selected) && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; - } elseif (count($ticketstat->cache_severity_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it + } elseif (count($conf->cache['severity_tickets']) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; } From 932b34e76eac0e5ba259bfe5ba736fbfb449dbc4 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 12:55:10 +0100 Subject: [PATCH 181/375] Debug v21 --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- htdocs/societe/class/societe.class.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 96cfc189c13..4547984cf9f 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -499,7 +499,7 @@ if ($nolinesbefore) { if (getDolGlobalInt('PRODUCT_USE_UNITS')) { $coldisplay++; print ''; - print $form->selectUnits(empty($line->fk_unit) ? $conf->global->PRODUCT_USE_UNITS : $line->fk_unit, "units"); + print $form->selectUnits(empty($line->fk_unit) ? getDolGlobalInt('PRODUCT_USE_UNITS') : $line->fk_unit, "units"); print ''; } $remise_percent = $buyer->remise_percent; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 8d664fda47f..95a40d04e12 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4231,7 +4231,7 @@ class Societe extends CommonObject public function isACompany() { // Define if third party is treated as company (or not) when nature is unknown - $isACompany = getDolGlobalInt('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES'); + $isACompany = getDolGlobalInt('MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES', 1); // default if not set is 1 because it was like this in all past versions // Now try to guess using different tips if (!empty($this->tva_intra)) { @@ -4239,12 +4239,9 @@ class Societe extends CommonObject } elseif (!empty($this->idprof1) || !empty($this->idprof2) || !empty($this->idprof3) || !empty($this->idprof4) || !empty($this->idprof5) || !empty($this->idprof6)) { $isACompany = 1; } else { - if (!getDolGlobalString('MAIN_CUSTOMERS_ARE_COMPANIES_EVEN_IF_SET_AS_INDIVIDUAL')) { - // TODO Add a field is_a_company into dictionary - if (preg_match('/^TE_PRIVATE/', $this->typent_code)) { + if (!getDolGlobalString('MAIN_CUSTOMERS_ARE_COMPANIES_EVEN_IF_SET_AS_INDIVIDUAL')) { // never or rarely set + if (preg_match('/^TE_PRIVATE/', $this->typent_code)) { // TODO Add a field is_a_company into dictionary $isACompany = 0; - } else { - $isACompany = 1; } } else { $isACompany = 1; From b1132131f307b7fa85ceeaad5d0ffd32cef8fcfa Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 13:09:06 +0100 Subject: [PATCH 182/375] Fix regression --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 62280a7cce2..57dbaecd040 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1375,7 +1375,7 @@ if (!$error && ($action == 'updateprice' && $confirm == 'yes') && $permissiontoa } } elseif (getDolGlobalString('PRODUIT_MULTIPRICES')) { $maxlevel = getDolGlobalInt('PRODUIT_MULTIPRICES_LIMIT'); - for ($level = 1; $level <= $malevel; $level++) { + for ($level = 1; $level <= $maxlevel; $level++) { if ($object->price_base_type == 'TTC') { $newprice = $object->multiprices_ttc[$level] * (100 + $pricepercentage) / 100; $minprice = $object->multiprices_min_ttc[$level]; From 0a5bf30ef7b61dbe8501fda8db812150d4ca50a6 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 13:24:48 +0100 Subject: [PATCH 183/375] Fix var not defined --- htdocs/core/class/html.formticket.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index b95d057d48b..39c1336930b 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1388,8 +1388,6 @@ class FormTicket print ' selected="selected"'; } elseif ($arrayseverities['use_default'] == "1" && empty($selected) && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; - } elseif (count($ticketstat->cache_severity_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it - print ' selected="selected"'; } elseif (count($conf->cache['severity_tickets']) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; } From f885d1e05b1ca69ae7732c6290132efa1661045b Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 13:26:16 +0100 Subject: [PATCH 184/375] Fix use of cache --- htdocs/core/class/html.formticket.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 76c1ed3dda0..94517d5e4b1 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1277,7 +1277,7 @@ class FormTicket print ' selected="selected"'; } elseif ($arrayseverities['use_default'] == "1" && empty($selected) && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; - } elseif (count($ticketstat->cache_severity_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it + } elseif (count($conf->cache['severity_tickets']) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; } From c9f9d549e6221cb999b28d6bc429dc51435d3022 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 13:27:41 +0100 Subject: [PATCH 185/375] Fix cache --- htdocs/core/class/html.formticket.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 27f45a9ecab..9503d073268 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1388,8 +1388,6 @@ class FormTicket print ' selected="selected"'; } elseif ($arrayseverities['use_default'] == "1" && empty($selected) && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; - } elseif (count($ticketstat->cache_severity_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it - print ' selected="selected"'; } elseif (count($conf->cache['severity_tickets']) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; } From 4ee2bf542825a52b2835cf96ba611579a1294584 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 13:35:43 +0100 Subject: [PATCH 186/375] Clean cache. Must use conf->cache --- htdocs/core/class/html.formticket.class.php | 6 ++--- htdocs/ticket/class/api_tickets.class.php | 1 - htdocs/ticket/class/ticket.class.php | 25 +++++++++------------ 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 9503d073268..5ba1465f7b4 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -1000,8 +1000,8 @@ class FormTicket print ''; } - if (is_array($ticketstat->cache_category_tickets) && count($ticketstat->cache_category_tickets)) { - foreach ($ticketstat->cache_category_tickets as $id => $arraycategories) { + if (is_array($conf->cache['category_tickets']) && count($conf->cache['category_tickets'])) { + foreach ($conf->cache['category_tickets'] as $id => $arraycategories) { // Exclude some record if ($publicgroups) { if (empty($arraycategories['public'])) { @@ -1044,7 +1044,7 @@ class FormTicket print ' selected="selected"'; } elseif ($arraycategories['use_default'] == "1" && empty($selected) && (!$empty || $empty == 'ifone')) { print ' selected="selected"'; - } elseif (count($ticketstat->cache_category_tickets) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it + } elseif (count($conf->cache['category_tickets']) == 1 && (!$empty || $empty == 'ifone')) { // If only 1 choice, we autoselect it print ' selected="selected"'; } diff --git a/htdocs/ticket/class/api_tickets.class.php b/htdocs/ticket/class/api_tickets.class.php index 2d0fca7f77a..6b2d9e759c9 100644 --- a/htdocs/ticket/class/api_tickets.class.php +++ b/htdocs/ticket/class/api_tickets.class.php @@ -554,7 +554,6 @@ class Tickets extends DolibarrApi "cache_msgs_ticket", "cache_logs_ticket", "cache_types_tickets", - "cache_category_tickets", "regeximgext", "labelStatus", "labelStatusShort", diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 35bf143e0fe..92c95699183 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -216,11 +216,6 @@ class Ticket extends CommonObject */ public $cache_types_tickets; - /** - * @var array Cache of Ticket categories - */ - public $cache_category_tickets; - /** * @var array cache msgs ticket */ @@ -1384,9 +1379,9 @@ class Ticket extends CommonObject */ public function loadCacheCategoriesTickets($publicgroup = -1) { - global $langs; + global $conf, $langs; - if ($publicgroup == -1 && !empty($this->cache_category_tickets) && count($this->cache_category_tickets)) { + if ($publicgroup == -1 && !empty($conf->cache['category_tickets']) && count($conf->cache['category_tickets'])) { // Cache already loaded return 0; } @@ -1408,18 +1403,18 @@ class Ticket extends CommonObject $i = 0; while ($i < $num) { $obj = $this->db->fetch_object($resql); - $this->cache_category_tickets[$obj->rowid]['code'] = $obj->code; - $this->cache_category_tickets[$obj->rowid]['use_default'] = $obj->use_default; - $this->cache_category_tickets[$obj->rowid]['pos'] = $obj->pos; - $this->cache_category_tickets[$obj->rowid]['public'] = $obj->public; - $this->cache_category_tickets[$obj->rowid]['active'] = $obj->active; - $this->cache_category_tickets[$obj->rowid]['force_severity'] = $obj->force_severity; - $this->cache_category_tickets[$obj->rowid]['fk_parent'] = $obj->fk_parent; + $conf->cache['category_tickets'][$obj->rowid]['code'] = $obj->code; + $conf->cache['category_tickets'][$obj->rowid]['use_default'] = $obj->use_default; + $conf->cache['category_tickets'][$obj->rowid]['pos'] = $obj->pos; + $conf->cache['category_tickets'][$obj->rowid]['public'] = $obj->public; + $conf->cache['category_tickets'][$obj->rowid]['active'] = $obj->active; + $conf->cache['category_tickets'][$obj->rowid]['force_severity'] = $obj->force_severity; + $conf->cache['category_tickets'][$obj->rowid]['fk_parent'] = $obj->fk_parent; // If translation exists, we use it to store already translated string. // Warning: You should not use this and recompute the translated string into caller code to get the value into expected language $label = ($langs->trans("TicketCategoryShort".$obj->code) != "TicketCategoryShort".$obj->code ? $langs->trans("TicketCategoryShort".$obj->code) : ($obj->label != '-' ? $obj->label : '')); - $this->cache_category_tickets[$obj->rowid]['label'] = $label; + $conf->cache['category_tickets'][$obj->rowid]['label'] = $label; $i++; } From af5dbfe0a739fb5b0f268b96aa8434bd51461ed0 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 5 Feb 2025 13:41:03 +0100 Subject: [PATCH 187/375] Fix phpunit --- htdocs/langs/ca_ES/website.lang | 1 - htdocs/langs/da_DK/website.lang | 1 - htdocs/langs/lv_LV/website.lang | 1 - 3 files changed, 3 deletions(-) diff --git a/htdocs/langs/ca_ES/website.lang b/htdocs/langs/ca_ES/website.lang index b496eaf6e50..685518d716b 100644 --- a/htdocs/langs/ca_ES/website.lang +++ b/htdocs/langs/ca_ES/website.lang @@ -62,7 +62,6 @@ NoPageYet=Encara sense pàgines YouCanCreatePageOrImportTemplate=Podeu crear una pàgina nova o importar una plantilla completa del lloc web SyntaxHelp=Ajuda sobre consells de sintaxi específica YouCanEditHtmlSourceckeditor=Podeu editar el codi font HTML usant el botó "Codi font" a l'editor. -YouCanEditHtmlSource=
Podeu incloure codi PHP en aquesta font utilitzant les etiquetes <?php ?>b70f65fc09 /span>. Les variables globals següents estan disponibles: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

També podeu incloure contingut d'una altra pàgina/contenidor amb la sintaxi següent:
span><?php includeContainer('alias_of_container_to_include'); ?>
b0342fc9bz0 /span> Podeu fer una redirecció a una altra pàgina/contenidor amb la sintaxi següent (Nota: no envieu cap contingut abans d'una redirecció) :
<?php redirectToContainer('alias_of_container_to_redirect_to'); ?>
També podeu fer una redirecció amb els paràmetres GET:
<?php redirectToContainer('alias_to', 'redirect,_0_to', 'redirectTo' 0, $array_of_get_params); ?>
b0342fc9bz0 /span> Per afegir un enllaç a una altra pàgina, utilitzeu la sintaxi:
<a href="alias_of_page_to_link_to.php">mylink<0 class='notranslate'><
a>b0319bzcc
b0319bzcc >

b014d7f165b Podeu configurar dinàmicament el títol de la pàgina i Metaetiquetes de SEO (títol, paraules clau, descripció). Simplement definiu les variables següents:
$__PAGE__TITLE__ = "Valor del títol...";b1z08a8b77
$__PAGE__KEYWORDS__ = "paraula clau1, paraula clau2, paraula clau3..."; // Separat per comes
$___PAGE =Descripció ;


b0d9a138z0
b0d9a138 Per incloure un enllaç per baixar un fitxer emmagatzemat al documents, utilitzeu el directori document.php wrapper:
Exemple, per a un fitxer en documents/ecm (cal registrar-se), la sintaxi és:
<a href="/document.php?modulepart=ecm&file=[relative_dir/]filename.ext">
Per a un fitxer en documents o mitjans (directori obert per a l'accés públic), la sintaxi és:
<a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Per a un fitxer compartit amb un enllaç compartit (accés obert mitjançant la clau hash per compartir del fitxer), la sintaxi és:
<a href="/document.php?hashp=publicsharekeyoffile">
YouCanEditHtmlSource1=
Per incloure un imatge emmagatzemat als mitjans de comunicació (directori obert per a l'accés públic), utilitzeu el camí relatiu que comença per /mediasb0a65dc071f , exemple:
<img src="/medias/image/myimagepath/filename ext">
YouCanEditHtmlSource2=Per a una imatge compartida amb un enllaç per compartir (accés obert mitjançant la clau hash per compartir del fitxer), utilitzeu l'embolcall:
<img src="/viewimage.php?hashp=12345679012...">b0319bzcc YouCanEditHtmlSource3=Per a obtenir l'URL de la imatge d'un objecte PHP, utilitzeu
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
diff --git a/htdocs/langs/da_DK/website.lang b/htdocs/langs/da_DK/website.lang index 0c12d24c6e4..967a994c7a4 100644 --- a/htdocs/langs/da_DK/website.lang +++ b/htdocs/langs/da_DK/website.lang @@ -62,7 +62,6 @@ NoPageYet=Ingen sider endnu YouCanCreatePageOrImportTemplate=Du kan oprette en ny side eller importere en fuld hjemmeside skabelon SyntaxHelp=Hjælp til specifikke syntax tips YouCanEditHtmlSourceckeditor=Du kan redigere HTML-kildekode ved hjælp af knappen "Kilde" i editoren. -YouCanEditHtmlSource=
Du kan inkludere PHP-kode i denne kilde ved hjælp af tags <?php ?>
b03492bzfcc Du kan foretage en omdirigering til en anden side/beholder med følgende syntaks (Bemærk: udskriv ikke nogen indhold før en omdirigering):
<?php redirectToContainer alias_of_container_to_redirect_to'); ?>
Du kan også lave en omdirigering med GET-parametre:
<?php redirectToContainer('container_to', 'container_alias_of', 'container_to' 0, 0, $array_of_get_params); ?>
b03492bzfcc For at tilføje et link til en anden side skal du bruge syntaksen:
<a href="alias_of_page_to_link_to.php"b0012c7z0mylink<a>

b02bd88d791translate'> Du kan dynamisk indstille sidetitlen og SEO-metatags, søgeord, ). Definer blot følgende variabler:
$__PAGE__TITLE__ = "Titelværdi …";7d08a8a67b>b316dz0
$__PAGE__KEYWORDS__ = "søgeord1, søgeord2, søgeord3 …"; // Kommasepareret
____PAGE_DEscriptionSC ;


840d /span> At inkludere et link til download en fil gemt i mappen documents, skal du bruge document.php
wrapper:
Eksempel, for en fil til dokumenter/ecm (skal logges), er syntaksen:
<a href="/document.php?modulepart=[ecm&file relative_dir/]filename.ext">
tilFor en fil dokumenter/medier (åben mappe for offentlig adgang), syntaks er:
< /span>a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
For en fil, der deles med et delingslink (åben adgang ved hjælp af filens hash-nøgle), er syntaksen:
<a href="/document.php?hashp=publicsharekeyoffile"b0012c7dcbe
YouCanEditHtmlSource1=
At inkludere en image gemt i medier Bibliotek (bibliotek åben for offentlig adgang), brug den relative sti, der starter med /medias, eksempel:
<img src="/medias/image/.myimagepath/filename">
YouCanEditHtmlSource2=For et billede, der er delt med et delelink (åben adgang ved hjælp af filens hashnøgle til deling), skal du bruge wrapperen:
<img src="/viewimage.php?hashp=12345679012...">
YouCanEditHtmlSource3=To get the URL of the image of a PHP object, use
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
diff --git a/htdocs/langs/lv_LV/website.lang b/htdocs/langs/lv_LV/website.lang index 85de851d2e0..0892b5d653c 100644 --- a/htdocs/langs/lv_LV/website.lang +++ b/htdocs/langs/lv_LV/website.lang @@ -62,7 +62,6 @@ NoPageYet=Vēl nav nevienas lapas YouCanCreatePageOrImportTemplate=Jūs varat izveidot jaunu lapu vai importēt pilnu vietnes veidni SyntaxHelp=Palīdzība par konkrētiem sintakses padomiem YouCanEditHtmlSourceckeditor=Jūs varat rediģēt HTML avota kodu, izmantojot redaktorā pogu "Avots". -YouCanEditHtmlSource=
Šajā avotā varat iekļaut PHP kodu, izmantojot tagus <?php ?>. Ir pieejami šādi globālie mainīgie: $conf, $db, $mysoc, $user, $website, $websitepage, $weblangs, $pagelangs.

Varat iekļaut arī citas lapas/konteinera saturu ar šādu sintaksi:
<?php includeContainer('alias_of_includeer'); ?>
ccfda192bz0 /span> Varat veikt novirzīšanu uz citu lapu/konteineru, izmantojot šādu sintaksi (piezīme: neizvadiet nevienu saturs pirms novirzīšanas):
<?php redirectToContainer alias_of_container_to_redirect_to'); ?>
Varat arī veikt novirzīšanu, izmantojot GET parametrus.
<?php redirectToContainer,'alias_of_container, 0, 0, $array_of_get_params); ?>
ccfda192bz0 /span> Lai pievienotu saiti uz citu lapu, izmantojiet sintaksi:
<a href="alias_of_page_to_link_to.php"b0012c7d0bemana saite<a>

b02bd88d791f12 classz0'no '> Varat dinamiski iestatīt lapas nosaukumu un SEO metatagus, ti, aprakstu ). Vienkārši definējiet šādus mainīgos:
$__PAGE__TITLE__ = "Nosaukuma vērtība…";7b05d
$__PAGE__KEYWORDS__ = "atslēgvārds1, atslēgvārds2, atslēgvārds…"; // Atdalīts ar komatu
DESC___PAGE__ ; /span> Lai iekļautu saiti, lai lejupielādētu failu kas saglabāti dokumentu direktorijā, izmantojiet . iesaiņojums:
Piemērs, failam dokumentos/ecm (jāreģistrē), sintakse ir:
<a href="/document.php?modulepart=[ecm&fi relation_dir/]filename.ext">
failā dokumenti/mediji (atvērts direktorijs publiskai piekļuvei), sintakse ir:
< /span>a href="/document.php?modulepart=medias&file=[relative_dir/]filename.ext">
Failam, kas kopīgots ar kopīgošanas saiti (atvērta piekļuve, izmantojot faila koplietošanas jaucējatslēgu), sintakse ir šāda:
<. span class='notranslate'><a href="/document.php?hashp=publicsharekeyoffile"b0012c7dc0
YouCanEditHtmlSource1=
To include an image stored into the medias directory (directory open for public access), use the relative path starting with /medias, example:
<img src="/medias/image/myimagepath/filename.ext">
YouCanEditHtmlSource2=For an image shared with a share link (open access using the sharing hash key of file), use the wrapper:
<img src="/viewimage.php?hashp=12345679012...">
YouCanEditHtmlSource3=To get the URL of the image of a PHP object, use
<img src="<?php print getImagePublicURLOfObject($object, 1, "_small") ?>">
From 3e45bf00eb0ba476c2ef27f79f77a8337cef6670 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 5 Feb 2025 13:54:36 +0100 Subject: [PATCH 188/375] FIX missing company name if dontaion is linked to third party --- htdocs/compta/index.php | 16 ++++++++++++---- htdocs/don/card.php | 4 ++-- htdocs/don/index.php | 16 ++++++++++++---- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index a238b4f6a2b..5fc3880c600 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -422,7 +422,7 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) { $langs->load("boxes"); $donationstatic = new Don($db); - $sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status"; + $sql = "SELECT d.rowid, d.lastname, d.firstname, d.societe, d.datedon as date, d.tms as dm, d.amount, d.fk_statut as status, d.fk_soc as socid"; $sql .= " FROM ".MAIN_DB_PREFIX."don as d"; $sql .= " WHERE d.entity IN (".getEntity('donation').")"; // Add where from hooks @@ -473,9 +473,17 @@ if (isModEnabled('don') && $user->hasRight('don', 'lire')) { $donationstatic->statut = $obj->status; $donationstatic->status = $obj->status; - $label = $donationstatic->getFullName($langs); - if ($obj->societe) { - $label .= ($label ? ' - ' : '').$obj->societe; + if (!empty($obj->socid)) { + $companystatic = new Societe($db); + $ret = $companystatic->fetch($obj->socid); + if ($ret > 0) { + $label = $companystatic->getNomUrl(1); + } + } else { + $label = $donationstatic->getFullName($langs); + if ($obj->societe) { + $label .= ($label ? ' - ' : '').$obj->societe; + } } print ''; diff --git a/htdocs/don/card.php b/htdocs/don/card.php index abb8560727f..675a8655c30 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -398,7 +398,7 @@ if ($action == 'create') { // Company if (isModEnabled("societe") && getDolGlobalString('DONATION_USE_THIRDPARTIES')) { // Thirdparty - if ($soc->id > 0) { + if (!empty($soc) && $soc->id > 0) { print ''.$langs->trans('ThirdParty').''; print ''; print $soc->getNomUrl(1); @@ -420,7 +420,7 @@ if ($action == 'create') { print ''.$langs->trans('ThirdParty').''; print ''; $filter = '((s.client:IN:1,2,3) AND (status:=:1))'; - print $form->select_company($soc->id, 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); + print $form->select_company($socid, 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300'); // Option to reload page to retrieve customer information. Note, this clear other input if (getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) { print ''."\n"; } - if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { - print ''."\n"; - } else { - print ''."\n"; + if (!defined('DISABLE_JQUERY_UI')) { + if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { + print '' . "\n"; + } else { + print '' . "\n"; + } } // jQuery jnotify if (!getDolGlobalString('MAIN_DISABLE_JQUERY_JNOTIFY') && !defined('DISABLE_JQUERY_JNOTIFY')) { From 15dec468cb555e43e3454d431b7c23b87e89d093 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 10:05:06 +0100 Subject: [PATCH 238/375] NEW: add const to not include JQuery UI in top_htmlhead DISABLE_JQUERY_UI --- htdocs/main.inc.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 9004839fa99..3ddad620a92 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2120,6 +2120,8 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } else { print ''."\n"; } + + if (!defined('DISABLE_JQUERY_UI')) { if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { print '' . "\n"; From 867215e2eae009af0b4e5f11b84f01363fed2104 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 10:05:17 +0100 Subject: [PATCH 239/375] NEW: add const to not include JQuery UI in top_htmlhead DISABLE_JQUERY_UI --- htdocs/main.inc.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 3ddad620a92..9004839fa99 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2120,8 +2120,6 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr } else { print ''."\n"; } - - if (!defined('DISABLE_JQUERY_UI')) { if (defined('JS_JQUERY_UI') && constant('JS_JQUERY_UI')) { print '' . "\n"; From a8811551092404b7ea028c21001033173884af5d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 7 Feb 2025 10:10:45 +0100 Subject: [PATCH 240/375] NEW: add const to not include default CSS in top_htmlhead with DISABLE_CSS_DEFAULT_THEME --- htdocs/main.inc.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d25d87140b9..9b126b49724 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2036,21 +2036,21 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr print ''."\n"; } - if (!defined('DISABLE_CSS_DEFAULT_THEME')) { - print ''."\n"; - // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' - $themepath = dol_buildpath($conf->css, 1); - $themesubdir = ''; - if (!empty($conf->modules_parts['theme'])) { // This slow down - foreach ($conf->modules_parts['theme'] as $reldir) { - if (file_exists(dol_buildpath($reldir.$conf->css, 0))) { - $themepath = dol_buildpath($reldir.$conf->css, 1); - $themesubdir = $reldir; - break; - } + // Output style sheets (optioncss='print' or ''). Note: $conf->css looks like '/theme/eldy/style.css.php' + $themepath = dol_buildpath($conf->css, 1); + $themesubdir = ''; + if (!empty($conf->modules_parts['theme'])) { // This slow down + foreach ($conf->modules_parts['theme'] as $reldir) { + if (file_exists(dol_buildpath($reldir.$conf->css, 0))) { + $themepath = dol_buildpath($reldir.$conf->css, 1); + $themesubdir = $reldir; + break; } } + } + if (!defined('DISABLE_CSS_DEFAULT_THEME')) { + print ''."\n"; print '' . "\n"; } From e0a8caec45b9d9dece3ec63a54a484bc7618d357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 7 Feb 2025 10:45:03 +0100 Subject: [PATCH 241/375] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/core/class/commondocgenerator.class.php | 6 +++--- .../modules/asset/doc/doc_generic_asset_odt.modules.php | 6 +++--- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 4f95b73a9fb..deba1cbbeb2 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -8862,12 +8862,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/commondocgenerator.class.php - - - message: '#^Parameter \#2 \$array_to_fill of method CommonDocGenerator\:\:fill_substitutionarray_with_extrafields\(\) expects array\, array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/core/class/commondocgenerator.class.php - - message: '#^Property CommonObject\:\:\$element \(string\) in isset\(\) is not nullable\.$#' identifier: isset.property diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 884639b234e..1f52f57bc31 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Marcos García * Copyright (C) 2016-2023 Charlene Benke - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2020 Josep Lluís Amador * Copyright (C) 2024 MDW * Copyright (C) 2024 Mélina Joum @@ -1174,11 +1174,11 @@ abstract class CommonDocGenerator * Note that vars into substitutions array are formatted. * * @param CommonObject $object Object with extrafields (must have $object->array_options filled) - * @param array $array_to_fill Substitution array + * @param array $array_to_fill Substitution array * @param Extrafields $extrafields Extrafields object * @param string $array_key Prefix for name of the keys into returned array * @param Translate $outputlangs Lang object to use for output - * @return array Substitution array + * @return array Substitution array */ public function fill_substitutionarray_with_extrafields($object, $array_to_fill, $extrafields, $array_key, $outputlangs) { diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php index 92792da10e8..9848d61fbbd 100644 --- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php +++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php @@ -4,7 +4,7 @@ * Copyright (C) 2014 Marcos García * Copyright (C) 2016 Charlie Benke * Copyright (C) 2018-2021 Philippe Grand - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -398,7 +398,7 @@ class doc_generic_asset_odt extends ModelePDFAsset } } // Replace tags of lines - $foundtagforlines = 1; + /*$foundtagforlines = 1; try { $listlines = $odfHandler->setSegment('lines'); } catch (OdfExceptionSegmentNotFound $e) { @@ -431,7 +431,7 @@ class doc_generic_asset_odt extends ModelePDFAsset dol_syslog($this->error, LOG_WARNING); return -1; } - } + }*/ // Replace labels translated $tmparray = $outputlangs->get_translations_for_substitutions(); From 712a2b544a3b4e058934736d21aa1872df2400fb Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 10:46:13 +0100 Subject: [PATCH 242/375] Fix false positive --- htdocs/core/class/commondocgenerator.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index ba37cce06b2..ba2c7d0ae94 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -927,6 +927,7 @@ abstract class CommonDocGenerator foreach ($date_specs as $date_spec) { $propertyname = $date_spec[1]; if (property_exists($line, $propertyname)) { + // @phan-suppress-next-line PhanUndeclaredProperty $resarray[$date_spec[0]] = dol_print_date($line->$propertyname, $date_spec[2], $date_spec[3], $date_spec[4]); } } From 28724db69e1e64e294b3dc871561e5c1b19b1669 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 10:52:23 +0100 Subject: [PATCH 243/375] Try to fix phpstan false positive --- htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php index f8a99d51d40..006d797f5b6 100644 --- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php +++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php @@ -405,6 +405,7 @@ class doc_generic_bom_odt extends ModelePDFBom if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var BOMLine $line */ $linenumber++; if ($line->fk_product > 0) { From d01274ef4c5966b873476b40d30c75b55590d5d3 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Fri, 7 Feb 2025 11:28:13 +0100 Subject: [PATCH 244/375] Fix phan --- .../modules/commande/doc/doc_generic_order_odt.modules.php | 1 + .../contract/doc/doc_generic_contract_odt.modules.php | 1 + .../modules/facture/doc/doc_generic_invoice_odt.modules.php | 1 + htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php | 1 + .../project/task/doc/doc_generic_task_odt.modules.php | 2 +- .../modules/propale/doc/doc_generic_proposal_odt.modules.php | 1 + .../reception/doc/doc_generic_reception_odt.modules.php | 1 + .../doc/doc_generic_supplier_invoice_odt.modules.php | 1 + .../doc/doc_generic_supplier_order_odt.modules.php | 1 + .../doc/doc_generic_supplier_proposal_odt.modules.php | 1 + htdocs/supplier_proposal/class/supplier_proposal.class.php | 5 +++++ 11 files changed, 15 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index 5ee13332781..3495cc57265 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -426,6 +426,7 @@ class doc_generic_order_odt extends ModelePDFCommandes if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var OrderLine $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php index 27a295e61e4..6c68888cebc 100644 --- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php +++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php @@ -420,6 +420,7 @@ class doc_generic_contract_odt extends ModelePDFContract if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var ContratLigne $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index f4435c982ed..7b081f4d4bd 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -482,6 +482,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var FactureLigne $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php index ff22719c4ab..93ce87f2be5 100644 --- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php +++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php @@ -408,6 +408,7 @@ class doc_generic_mo_odt extends ModelePDFMo if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var MoLine $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index a0c7210392a..2eb87a0189f 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -458,7 +458,7 @@ class doc_generic_task_odt extends ModelePDFTask /** * Function to build a document on disk using the generic odt module. * - * @param Project $object Object source to build document + * @param Task $object Object source to build document * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @return int<-1,1> 1 if OK, <=0 if KO diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index 86266b76b16..4e3f9adb01b 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -463,6 +463,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var PropaleLigne $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php index bf7247fdde8..68b20c45977 100644 --- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php +++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php @@ -412,6 +412,7 @@ class doc_generic_reception_odt extends ModelePdfReception if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var ReceptionLineBatch $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php index d59451d9be9..6ec79297018 100644 --- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php +++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php @@ -417,6 +417,7 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var CommonInvoiceLine $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php index fcfa4212862..2c26e3fb876 100644 --- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php +++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php @@ -412,6 +412,7 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var CommonOrderLine $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php index a17f724a5fa..b207a616be8 100644 --- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php @@ -441,6 +441,7 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal if ($foundtagforlines) { $linenumber = 0; foreach ($object->lines as $line) { + /** @var SupplierProposalLine $line */ $linenumber++; $tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber); complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines"); diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index e33cdc6c377..fd534683010 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -192,7 +192,12 @@ class SupplierProposal extends CommonObject * @var array (Encoded as JSON in database) */ public $extraparams = array(); + + /** + * @var SupplierProposalLine[] + */ public $lines = array(); + /** * @var SupplierProposalLine */ From b3f40b2c83a9727738c51b719736afc127f2b6a9 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Fri, 7 Feb 2025 12:21:44 +0100 Subject: [PATCH 245/375] fix some naming and add comment --- htdocs/website/index.php | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 18b9cc8790a..ae94a5b920e 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -4343,8 +4343,9 @@ if ($action == 'editcss') { } if ($action == 'editsecurity') { - $selectarraySP = websiteGetContentPolicyDirectives(); - $selectarraySPlevel2 = websiteGetContentPolicySources(); + $selectarrayCSPDirectives = websiteGetContentPolicyDirectives(); + $selectarrayCSPSources = websiteGetContentPolicySources(); + $forceCSPArr = websiteGetContentPolicyToArray($forceCSP); print '

'; print '
'; @@ -4376,17 +4377,19 @@ if ($action == 'editsecurity') { print ''; print '
'; - // Security Policy + // Content Security Policy print '
'; print ''; print ''; print ''; + print ''; + print ''; - print ''; + print ''; print '
'.$langs->trans("SecurityPolicy").'
'.$langs->trans("Value").':
'.$form->selectarray("select_identifier_WEBSITE_SECURITY_FORCECSP", $selectarraySP, "select_identifier_WEBSITE_SECURITY_FORCECSP", 1, 0, 0, '', 0, 0, 0, '', 'minwidth300').''.$form->selectarray("select_identifier_WEBSITE_SECURITY_FORCECSP", $selectarrayCSPDirectives, "select_identifier_WEBSITE_SECURITY_FORCECSP", 1, 0, 0, '', 0, 0, 0, '', 'minwidth300').''; print ''; - foreach ($selectarraySPlevel2 as $key => $values) { + foreach ($selectarrayCSPSources as $key => $values) { print ''; @@ -4398,9 +4401,7 @@ if ($action == 'editsecurity') { print '
'; print '
'; - //TODO: add comment to explain + better look - - $forceCSPArr = websiteGetContentPolicyToArray($forceCSP); + // Content Security Policy list of selected rules print '
'; print '
    '; foreach ($forceCSPArr as $directive => $sources) { @@ -4424,7 +4425,7 @@ if ($action == 'editsecurity') { } print '
'; print '
'; - //TODO: add console.log in js + print ''."\n"; - $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, 0, 1, 0, 0, 'maxwidth500', $object->fk_project); + $formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $object->fk_element, 'fk_element', 24, 0, '', 1, 0, 0, 'maxwidth500', (string) $object->fk_project); print ''; print ''; diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 7e0da30d5c8..f815cd849ed 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Lenin Rivas * Copyright (C) 2023 William Mead - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -2164,7 +2164,7 @@ if ($action == 'create') { $sday = date("d", $tmpdte); print $form->selectDate($syear."-".$smonth."-".$sday, 'date_livraison', 0, 0, 0, "addprop"); } else { - $tmp_date_delivery = GETPOST('date_delivery') ? : -1; + $tmp_date_delivery = GETPOST('date_delivery') ?: -1; print $form->selectDate($tmp_date_delivery, 'date_livraison', 0, 0, 0, "addprop", 1, 1); } print ''; @@ -2174,7 +2174,7 @@ if ($action == 'create') { $langs->load("projects"); print ''; print ''.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(($soc->id > 0 ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' id).'">'; print ''; print ''; diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 5f3e292e106..7457acd4e36 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -19,7 +19,7 @@ * Copyright (C) 2022 OpenDSI * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 William Mead - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -3771,7 +3771,7 @@ class Propal extends CommonObject if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetchProject(); if ($res > 0 && $this->project instanceof Project) { - $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); + $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, '1'); } } } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index f448bf25154..5fb70cfcc54 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3728,7 +3728,7 @@ class Commande extends CommonOrder if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetchProject(); if ($res > 0 && $this->project instanceof Project) { - $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); + $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, '1'); } } } diff --git a/htdocs/compta/accounting-files.php b/htdocs/compta/accounting-files.php index 5ccd1ffa2d8..94bd781bcdd 100644 --- a/htdocs/compta/accounting-files.php +++ b/htdocs/compta/accounting-files.php @@ -5,7 +5,7 @@ * Copyright (C) 2020 Maxime DEMAREST * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2022-2025 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -673,7 +673,7 @@ if (isModEnabled('project')) { $formproject = new FormProjets($db); $langs->load('projects'); print ''.$langs->trans('Project').":"; - print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, ''); + print img_picto('', 'project').$formproject->select_projects(($socid > 0 ? $socid : -1), (string) $projectid, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, ''); print ''; print '
'; } diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php index fe6102bbf61..5d985f68ce0 100644 --- a/htdocs/compta/bank/various_payment/card.php +++ b/htdocs/compta/bank/various_payment/card.php @@ -514,7 +514,7 @@ if ($action == 'create') { print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); + print $formproject->select_projects(-1, (string) $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); print ''; } @@ -626,7 +626,7 @@ if ($id) { $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects(-1, $object->fk_project, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + $morehtmlref .= $formproject->select_projects(-1, (string) $object->fk_project, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); $morehtmlref .= ''; $morehtmlref .= '
'; } else { diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 932f72d8864..e374e52450e 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -17,7 +17,7 @@ * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Gauthier VERDOL * Copyright (C) 2023 Nick Fragoulis - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Alexandre Spangaro * * This program is free software; you can redistribute it and/or modify @@ -892,27 +892,27 @@ if (empty($reshook)) { $keyforvatrate = $line->tva_tx.($line->vat_src_code ? ' ('.$line->vat_src_code.')' : ''); if (!isset($amount_ht[$keyforvatrate])) { - $amount_ht[$keyforvatrate]=0; + $amount_ht[$keyforvatrate] = 0; } $amount_ht[$keyforvatrate] += $line->total_ht; if (!isset($amount_tva[$keyforvatrate])) { - $amount_tva[$keyforvatrate]=0; + $amount_tva[$keyforvatrate] = 0; } $amount_tva[$keyforvatrate] += $line->total_tva; if (!isset($amount_ttc[$keyforvatrate])) { - $amount_ttc[$keyforvatrate]=0; + $amount_ttc[$keyforvatrate] = 0; } $amount_ttc[$keyforvatrate] += $line->total_ttc; if (!isset($multicurrency_amount_ht[$keyforvatrate])) { - $multicurrency_amount_ht[$keyforvatrate]=0; + $multicurrency_amount_ht[$keyforvatrate] = 0; } $multicurrency_amount_ht[$keyforvatrate] += $line->multicurrency_total_ht; if (!isset($multicurrency_amount_tva[$keyforvatrate])) { - $multicurrency_amount_tva[$keyforvatrate]=0; + $multicurrency_amount_tva[$keyforvatrate] = 0; } $multicurrency_amount_tva[$keyforvatrate] += $line->multicurrency_total_tva; if (!isset($multicurrency_amount_ttc[$keyforvatrate])) { - $multicurrency_amount_ttc[$keyforvatrate]=0; + $multicurrency_amount_ttc[$keyforvatrate] = 0; } $multicurrency_amount_ttc[$keyforvatrate] += $line->multicurrency_total_ttc; $i++; @@ -4070,7 +4070,7 @@ if ($action == 'create') { $langs->load('projects'); print ''.$langs->trans('Project').''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(($socid > 0 ? $socid : -1), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); + print $formproject->select_projects(($socid > 0 ? $socid : -1), (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx'); print ' id.($fac_rec ? '&fac_rec='.$fac_rec : '')).'">'; print ''; } diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 4bda1228b91..9c37b76e37b 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2016-2024 Frédéric France * Copyright (C) 2017-2024 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -431,7 +431,7 @@ if ($action == 'create') { print ''.$langs->trans("Project").''; - print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, $fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); + print img_picto('', 'project', 'class="pictofixedwidth"').$formproject->select_projects(-1, (string) $fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); print ''; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index f1ea95f0024..e2e5496e0c8 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2068,7 +2068,7 @@ class Contrat extends CommonObject if (is_null($this->project) || (is_object($this->project) && $this->project->isEmpty())) { $res = $this->fetchProject(); if ($res > 0 && $this->project instanceof Project) { - $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, 1); + $datas['project'] = '
'.$langs->trans('Project').': '.$this->project->getNomUrl(1, '', 0, '1'); } } } diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php index f817c7b98bb..2534c04a58c 100644 --- a/htdocs/core/class/html.formprojet.class.php +++ b/htdocs/core/class/html.formprojet.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2015 Marcos García * Copyright (C) 2018 Charlene Benke * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Benjamin Falière * * This program is free software; you can redistribute it and/or modify @@ -113,7 +113,7 @@ class FormProjets extends Form } $out .= ''; - $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array()); + $out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT . '/projet/ajax/projects.php', $urloption, getDolGlobalInt('PROJECT_USE_SEARCH_TO_SELECT'), 0, array()); } else { $out .= $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss, $morefilter); } @@ -153,7 +153,6 @@ class FormProjets extends Form * @param string $morecss More CSS * @param string $morefilter More filters (Must be a sql sanitized string) * @return int|string|array HTML string or array of option or <0 if KO - */ public function select_projects_list($socid = -1, $selected = 0, $htmlname = 'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $htmlid = '', $morecss = 'maxwidth500', $morefilter = '') { @@ -333,16 +332,16 @@ class FormProjets extends Form * @param int $selected Id task preselected * @param string $htmlname Name of HTML select * @param int $maxlength Maximum length of label - * @param int $option_only Return only html options lines without the select tag + * @param int<0,1> $option_only Return only html options lines without the select tag * @param string $show_empty Add an empty line ('1' or string to show for empty line) - * @param int $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable) - * @param int $forcefocus Force focus on field (works with javascript only) - * @param int $disabled Disabled + * @param int<0,2> $discard_closed Discard closed projects (0=Keep, 1=hide completely, 2=Disable) + * @param int<0,1> $forcefocus Force focus on field (works with javascript only) + * @param int<0,1> $disabled Disabled * @param string $morecss More css added to the select component * @param string $projectsListId ''=Automatic filter on project allowed. List of id=Filter on project ids. - * @param string $showmore 'all' = Show project info, 'progress' = Show task progression, ''=Show nothing more - * @param User $usertofilter User object to use for filtering - * @param int $nooutput 1=Return string, do not send to output + * @param 'all'|'progress'|'' $showmore 'all' = Show project info, 'progress' = Show task progression, ''=Show nothing more + * @param ?User $usertofilter User object to use for filtering + * @param int<0,1> $nooutput 1=Return string, do not send to output * * @return int|string Nbr of tasks if OK, <0 if KO. If nooutput=1: Return a HTML select string. */ @@ -694,17 +693,17 @@ class FormProjets extends Form * Build a HTML select list of element of same thirdparty to suggest to link them to project * * @param string $htmlname HTML name - * @param string $preselected Preselected (int or 'all' or 'none') - * @param int $showempty Add an empty line - * @param int $useshortlabel Use short label - * @param int $showallnone Add choice "All" and "None" - * @param int $showpercent Show default probability for status - * @param string $morecss Add more css - * @param int $noadmininfo 0=Add admin info, 1=Disable admin info - * @param int $addcombojs 1=Add a js combo + * @param int|'all'|'none'|'notopenedopp' $preselected Preselected (int or 'all' or 'none') + * @param int<0,1> $showempty Add an empty line + * @param int<0,1> $useshortlabel Use short label + * @param int<0,1> $showallnone Add choice "All" and "None" + * @param int<0,1> $showpercent Show default probability for status + * @param string $morecss Add more css + * @param int<0,1> $noadmininfo 0=Add admin info, 1=Disable admin info + * @param int<0,1> $addcombojs 1=Add a js combo * @return int<-1,-1>|string The HTML select list of element or '' if nothing or -1 if KO */ - public function selectOpportunityStatus($htmlname, $preselected = '-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0, $addcombojs = 0) + public function selectOpportunityStatus($htmlname, $preselected = -1, $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss = '', $noadmininfo = 0, $addcombojs = 0) { global $conf, $langs, $user; @@ -780,12 +779,12 @@ class FormProjets extends Form /** * Return combo list of different statuses of orders * - * @param string $selected Preselected value - * @param int $short Use short labels - * @param string $hmlname Name of HTML select element + * @param string $selected Preselected value + * @param int<0,1> $short Use short labels + * @param string $htmlname Name of HTML select element * @return void */ - public function selectProjectsStatus($selected = '', $short = 0, $hmlname = 'order_status') + public function selectProjectsStatus($selected = '', $short = 0, $htmlname = 'order_status') { $options = array(); @@ -813,7 +812,7 @@ class FormProjets extends Form $selectedarray = explode(',', $selected); } - print Form::multiselectarray($hmlname, $options, $selectedarray, 0, 0, 'minwidth100'); + print Form::multiselectarray($htmlname, $options, $selectedarray, 0, 0, 'minwidth100'); } /** @@ -947,11 +946,11 @@ class FormProjets extends Form * * @param string $page Page * @param string $selected Id preselected - * @param int $percent_value percentage of the opportunity + * @param ''|int $percent_value percentage of the opportunity * @param string $htmlname_status name of HTML element for status select * @param string $htmlname_percent name of HTML element for percent input * @param string $filter optional filters criteras - * @param int $nooutput No print output. Return it only. + * @param int<0,1> $nooutput No print output. Return it only. * @return void|string */ public function formOpportunityStatus($page, $selected = '', $percent_value = 0, $htmlname_status = 'none', $htmlname_percent = 'none', $filter = '', $nooutput = 0) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 6143ed6ac5b..6945ef93e8c 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2022-2025 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -138,7 +138,7 @@ function print_actions_filter( print '
'; print img_picto($langs->trans("Project"), 'project', 'class="pictofixedwidth inline-block"'); - print $formproject->select_projects($socid ? $socid : -1, $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'minwidth100 maxwidth250 widthcentpercentminusx'); + print $formproject->select_projects($socid ? $socid : -1, (string) $pid, 'search_projectid', 0, 0, 1, 0, 0, 0, 0, '', 1, 0, 'minwidth100 maxwidth250 widthcentpercentminusx'); print '
'; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 4c5e77fb0a3..f7b1f3e7203 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -5,7 +5,7 @@ * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2022 Charlene Benke * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Vincent de Grandpré * * This program is free software; you can redistribute it and/or modify @@ -587,7 +587,7 @@ function project_admin_prepare_head() * @param int $level Level (start to 0, then increased/decrease by recursive call), or -1 to show all level in order of $lines without the recursive groupment feature. * @param string $var Not used * @param int $showproject Show project columns - * @param int $taskrole Array of roles of user for each tasks + * @param array $taskrole Array of roles of user for each tasks * @param string $projectsListId List of id of projects allowed to user (string separated with comma) * @param int $addordertick Add a tick to move task * @param int $projectidfortotallink 0 or Id of project to use on total line (link to see all time consumed for project) @@ -1182,8 +1182,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t * @param ?User $fuser Restrict list to user if defined * @param Task[] $lines Array of lines * @param int $level Level (start to 0, then increased/decrease by recursive call) - * @param string $projectsrole Array of roles user has on project - * @param string $tasksrole Array of roles user has on task + * @param array $projectsrole Array of roles user has on project + * @param array $tasksrole Array of roles user has on task * @param string $mine Show only task lines I am assigned to * @param int<0,1> $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @param int $preselectedday Preselected day @@ -1412,8 +1412,8 @@ function projectLinesPerAction(&$inc, $parent, $fuser, $lines, &$level, &$projec * @param ?User $fuser Restrict list to user if defined * @param Task[] $lines Array of lines * @param int $level Level (start to 0, then increased/decrease by recursive call) - * @param string $projectsrole Array of roles user has on project - * @param string $tasksrole Array of roles user has on task + * @param array $projectsrole Array of roles user has on project + * @param array $tasksrole Array of roles user has on task * @param int<0,1> $mine Show only task lines I am assigned to * @param int<0,2> $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others * @param int $preselectedday Preselected day @@ -1816,8 +1816,8 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr * @param int $parent Id of parent task to show (0 to show all) * @param Task[] $lines Array of lines (list of tasks but we will show only if we have a specific role on task) * @param int $level Level (start to 0, then increased/decrease by recursive call) - * @param string $projectsrole Array of roles user has on project - * @param string $tasksrole Array of roles user has on task + * @param array $projectsrole Array of roles user has on project + * @param array $tasksrole Array of roles user has on task * @param int<0,1> $mine Show only task lines I am assigned to * @param int<0,2> $restricteditformytask 0=No restriction, 1=Enable add time only if task is assigned to me, 2=Enable add time only if tasks is assigned to me and hide others * @param array,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon @@ -2222,13 +2222,13 @@ function projectLinesPerWeek(&$inc, $firstdaytoshow, $fuser, $parent, $lines, &$ * @param int $parent Id of parent task to show (0 to show all) * @param Task[] $lines Array of lines (list of tasks but we will show only if we have a specific role on task) * @param int $level Level (start to 0, then increased/decrease by recursive call) - * @param string $projectsrole Array of roles user has on project - * @param string $tasksrole Array of roles user has on task + * @param array $projectsrole Array of roles user has on project + * @param array $tasksrole Array of roles user has on task * @param int<0,1> $mine Show only task lines I am assigned to * @param int<0,1> $restricteditformytask 0=No restriction, 1=Enable add time only if task is a task i am affected to * @param array,afternoon:int<0,1>}> $isavailable Array with data that say if user is available for several days for morning and afternoon * @param int $oldprojectforbreak Old project id of last project break - * @param string[] $TWeek Array of week numbers ('02', ... + * @param string[] $TWeek Array of week numbers ('02', ... * @param array> $arrayfields Array of additional column * @param Extrafields $extrafields Object extrafields * @return array Array with time spent for $fuser for each day of week on tasks in $lines and subtasks (index is string, month is '01', ...) @@ -2525,7 +2525,7 @@ function projectLinesPerMonth(&$inc, $firstdaytoshow, $fuser, $parent, $lines, & * @param int $inc Counter that count number of lines legitimate to show (for return) * @param int $parent Id of parent task to start * @param Task[] $lines Array of all tasks - * @param string $taskrole Array of task filtered on a particular user + * @param array $taskrole Array of task filtered on a particular user * @return int 1 if there is */ function searchTaskInChild(&$inc, $parent, &$lines, &$taskrole) diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 92afd4da700..b7a37c346d6 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -1113,10 +1113,10 @@ function checkUserAccessToObject($user, array $featuresarray, $object = 0, $tabl } $checkonentitydone = 1; } - if (in_array($feature, $checktask) && $objectid > 0) { + if (in_array($feature, $checktask) && (int) $objectid > 0) { if (isModEnabled('project') && !$user->hasRight('projet', 'all', 'lire')) { $task = new Task($db); - $task->fetch($objectid); + $task->fetch((int) $objectid); $projectid = $task->fk_project; include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; diff --git a/htdocs/core/modules/mailings/eventorganization.modules.php b/htdocs/core/modules/mailings/eventorganization.modules.php index 528072d76e9..79ee29df177 100644 --- a/htdocs/core/modules/mailings/eventorganization.modules.php +++ b/htdocs/core/modules/mailings/eventorganization.modules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2018-2018 Andre Schild * Copyright (C) 2005-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This file is an example to follow to add your own email selector inside @@ -204,7 +204,7 @@ class mailing_eventorganization extends MailingTargets $formproject = new FormProjets($this->db); $s = img_picto($langs->trans("OrganizedEvent"), 'project', 'class="pictofixedwidth"'); - $s .= $formproject->select_projects(-1, 0, "filter_eventorganization", 0, 0, $langs->trans("OrganizedEvent"), 1, 0, 0, 0, '', 1, 0, '', '', 'usage_organize_event=1'); + $s .= $formproject->select_projects(-1, '0', "filter_eventorganization", 0, 0, $langs->trans("OrganizedEvent"), 1, 0, 0, 0, '', 1, 0, '', '', 'usage_organize_event=1'); return $s; } diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php index 63f17a6a644..94878e5d2ae 100644 --- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php +++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php @@ -5,7 +5,7 @@ * Copyright (C) 2016-2023 Charlene Benke * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -183,7 +183,6 @@ class doc_generic_project_odt extends ModelePDFProjects * @param Task $task Task Object * @param Translate $outputlangs Lang object to use for output * @return array{task_ref:string,task_fk_project:string,task_projectref:string,task_projectlabel:string,task_label:string,task_description:string,task_fk_parent:string,task_duration:string,task_duration_hour:string,task_planned_workload:string,task_planned_workload_hour:string,task_progress:string,task_public:string,task_date_start:string,task_date_end:string,task_note_private:string,task_note_public:string} Return a substitution array + extrafields - */ public function get_substitutionarray_tasks(Task $task, $outputlangs) { @@ -1053,7 +1052,7 @@ class doc_generic_project_odt extends ModelePDFProjects $ref_array['type'] = (string) $langs->trans($classname); $element = new $classname($this->db); - $element->fetch($elementarray[$i]); + $element->fetch((int) $elementarray[$i]); $element->fetch_thirdparty(); //Ref object diff --git a/htdocs/core/modules/project/doc/pdf_beluga.modules.php b/htdocs/core/modules/project/doc/pdf_beluga.modules.php index 3b5cf8daf32..0c0a6527da8 100644 --- a/htdocs/core/modules/project/doc/pdf_beluga.modules.php +++ b/htdocs/core/modules/project/doc/pdf_beluga.modules.php @@ -467,7 +467,7 @@ class pdf_beluga extends ModelePDFProjects //var_dump("$key, $tablename, $datefieldname, $dates, $datee"); $elementarray = $object->get_element_list($key, $tablename, $datefieldname, 0, 0, $projectField); - $num = count($elementarray); + $num = is_array($elementarray) ? count($elementarray) : $elementarray; if ($num >= 0) { $nexY = $pdf->GetY() + 5; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 082111cd7f0..2ddcc41a1c0 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2016 Juanjo Menent * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -887,7 +887,7 @@ class Holiday extends CommonObject * * @param User $user User that approve * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @return int Return integer <0 if KO, >0 if OK */ public function approve($user = null, $notrigger = 0) { @@ -1151,9 +1151,9 @@ class Holiday extends CommonObject /** * Delete object in database * - * @param User $user User that delete - * @param int $notrigger 0=launch triggers after, 1=disable triggers - * @return int Return integer <0 if KO, >0 if OK + * @param User $user User that delete + * @param int<0,1> $notrigger 0=launch triggers after, 1=disable triggers + * @return int Return integer <0 if KO, >0 if OK */ public function delete($user, $notrigger = 0) { @@ -1202,12 +1202,12 @@ class Holiday extends CommonObject * This function can be used to avoid to have 2 leave requests on same period for example. * Warning: It consumes a lot of memory because it load in ->holiday all holiday of a dedicated user at each call. * - * @param int $fk_user Id user - * @param integer $dateStart Start date of period to check - * @param integer $dateEnd End date of period to check - * @param int $halfday Tag to define how start and end the period to check: + * @param int $fk_user Id user + * @param int $dateStart Start date of period to check + * @param int $dateEnd End date of period to check + * @param int<-1,2> $halfday Tag to define how start and end the period to check: * 0:Full days, 2:Start afternoon end morning, -1:Start afternoon end afternoon, 1:Start morning end morning - * @return boolean False = New range overlap an existing holiday, True = no overlapping (is never on holiday during checked period). + * @return bool False = New range overlap an existing holiday, True = no overlapping (is never on holiday during checked period). * @see verifDateHolidayForTimestamp() */ public function verifDateHolidayCP($fk_user, $dateStart, $dateEnd, $halfday = 0) @@ -1287,9 +1287,9 @@ class Holiday extends CommonObject * Check that a user is not on holiday for a particular timestamp. Can check approved leave requests and not into public holidays of company. * * @param int $fk_user Id user - * @param integer $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00) + * @param int $timestamp Time stamp date for a day (YYYY-MM-DD) without hours (= 12:00AM in english and not 12:00PM that is 12:00) * @param string $status Filter on holiday status. '-1' = no filter. - * @return array{morning_reason?:string,afternoon_reason?:string} array('morning'=> ,'afternoon'=> ), Boolean is true if user is available for day timestamp. + * @return array{morning:int<0,1>,afternoon:int<0,1>,morning_reason?:string,afternoon_reason?:string} array('morning'=> ,'afternoon'=> ), Boolean is true if user is available for day timestamp. * @see verifDateHolidayCP() */ public function verifDateHolidayForTimestamp($fk_user, $timestamp, $status = '-1') @@ -1349,7 +1349,7 @@ class Holiday extends CommonObject dol_print_error($this->db); } - $result = array('morning' => $isavailablemorning, 'afternoon' => $isavailableafternoon); + $result = array('morning' => (int) $isavailablemorning, 'afternoon' => (int) $isavailableafternoon); if (!$isavailablemorning) { $result['morning_reason'] = 'leave_request'; } diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php index 3a784e4db5e..e5958376156 100644 --- a/htdocs/projet/activity/perday.php +++ b/htdocs/projet/activity/perday.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010 François Legastelois * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -90,9 +90,9 @@ $search_declared_progress = GETPOST('search_declared_progress', 'alpha'); $sortfield = GETPOST('sortfield', 'aZ09comma'); $sortorder = GETPOST('sortorder', 'aZ09comma'); -$monthofday = GETPOST('addtimemonth'); -$dayofday = GETPOST('addtimeday'); -$yearofday = GETPOST('addtimeyear'); +$monthofday = GETPOSTINT('addtimemonth'); +$dayofday = GETPOSTINT('addtimeday'); +$yearofday = GETPOSTINT('addtimeyear'); //var_dump(GETPOST('remonth')); //var_dump(GETPOST('button_search_x')); @@ -134,9 +134,9 @@ $extrafields->fetch_name_optionals_label($object->table_element); // Definition of fields for list $arrayfields = array(); -$arrayfields['t.planned_workload'] = array('label' => 'PlannedWorkload', 'checked' => 1, 'enabled' => 1, 'position' => 0); -$arrayfields['t.progress'] = array('label' => 'ProgressDeclared', 'checked' => 1, 'enabled' => 1, 'position' => 0); -$arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => 1, 'enabled' => 1, 'position' => 15); +$arrayfields['t.planned_workload'] = array('label' => 'PlannedWorkload', 'checked' => '1', 'enabled' => '1', 'position' => 0); +$arrayfields['t.progress'] = array('label' => 'ProgressDeclared', 'checked' => '1', 'enabled' => '1', 'position' => 0); +$arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => '1', 'enabled' => '1', 'position' => 15); /*$arrayfields=array( // Project 'p.opp_amount'=>array('label'=>$langs->trans("OpportunityAmountShort"), 'checked'=>0, 'enabled'=>($conf->global->PROJECT_USE_OPPORTUNITIES?1:0), 'position'=>103), @@ -150,7 +150,7 @@ $arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => 1, if (!empty($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) { foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) { if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) { - $arrayfields["efpt.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => (($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1), 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => (abs((int) $extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); + $arrayfields["efpt.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => (($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? '0' : '1'), 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => (string) (int) (abs((int) $extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])); } } } @@ -407,14 +407,14 @@ $search_options_pattern = 'search_task_options_'; $extrafieldsobjectkey = 'projet_task'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; -$tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. +$tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, (string) $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. $tasksarraywithoutfilter = array(); if ($morewherefilter) { // Get all task without any filter, so we can show total of time spent for not visible tasks - $tasksarraywithoutfilter = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, '', $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. + $tasksarraywithoutfilter = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, '', (string) $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all task of opened project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. } -$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? $project->id : 0), 0, $onlyopenedproject); -$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject); +$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? (string) $project->id : '0'), 0, $onlyopenedproject); +$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? (string) $project->id : '0'), 0, $onlyopenedproject); llxHeader('', $title, '', '', 0, 0, array('/core/js/timesheet.js'), '', '', 'mod-project project-activity page-activity_perday'); @@ -521,7 +521,7 @@ if (!$user->hasRight('user', 'user', 'lire')) { $includeonly = array($user->id); } $selecteduser = $search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id; -$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, '', '0', 0, 0, '', 0, '', 'maxwidth200'); if ($form->num > 1 || empty($conf->dol_optimize_smallscreen)) { $moreforfilter .= '
'; $moreforfilter .= '
'; @@ -656,7 +656,7 @@ if (getDolGlobalString('MAIN_DEFAULT_WORKING_DAYS')) { } $statusofholidaytocheck = Holiday::STATUS_APPROVED; -$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse, $statusofholidaytocheck); // $daytoparse is a date with hours = 0 +$isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $daytoparse, (string) $statusofholidaytocheck); // $daytoparse is a date with hours = 0 $isavailable[$daytoparse] = $isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day $test = num_public_holiday($daytoparsegmt, $daytoparsegmt + 86400, $mysoc->country_code); diff --git a/htdocs/projet/activity/permonth.php b/htdocs/projet/activity/permonth.php index 502e85e1cba..dbb30f61c91 100644 --- a/htdocs/projet/activity/permonth.php +++ b/htdocs/projet/activity/permonth.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010 François Legastelois - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2025 Alexandre Spangaro * @@ -137,9 +137,9 @@ $arrayfields = array(); 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), 'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), );*/ -$arrayfields['t.planned_workload'] = array('label' => 'PlannedWorkload', 'checked' => 1, 'enabled' => 1, 'position' => 5); -$arrayfields['t.progress'] = array('label' => 'ProgressDeclared', 'checked' => 1, 'enabled' => 1, 'position' => 10); -$arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => 1, 'enabled' => 1, 'position' => 15); +$arrayfields['t.planned_workload'] = array('label' => 'PlannedWorkload', 'checked' => '1', 'enabled' => '1', 'position' => 5); +$arrayfields['t.progress'] = array('label' => 'ProgressDeclared', 'checked' => '1', 'enabled' => '1', 'position' => 10); +$arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => '1', 'enabled' => '1', 'position' => 15); /*foreach($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field @@ -150,7 +150,7 @@ $arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => 1, if (!empty($extrafields->attributes['projet_task']['label']) && is_array($extrafields->attributes['projet_task']['label']) && count($extrafields->attributes['projet_task']['label']) > 0) { foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) { if (!empty($extrafields->attributes['projet_task']['list'][$key])) { - $arrayfields["efpt.".$key] = array('label' => $extrafields->attributes['projet_task']['label'][$key], 'checked' => (($extrafields->attributes['projet_task']['list'][$key] < 0) ? 0 : 1), 'position' => $extrafields->attributes['projet_task']['pos'][$key], 'enabled' => (abs((int) $extrafields->attributes['projet_task']['list'][$key]) != 3 && $extrafields->attributes['projet_task']['perms'][$key])); + $arrayfields["efpt.".$key] = array('label' => $extrafields->attributes['projet_task']['label'][$key], 'checked' => (($extrafields->attributes['projet_task']['list'][$key] < 0) ? '0' : '1'), 'position' => $extrafields->attributes['projet_task']['pos'][$key], 'enabled' => (string) (int) (abs((int) $extrafields->attributes['projet_task']['list'][$key]) != 3 && $extrafields->attributes['projet_task']['perms'][$key])); } } } @@ -424,12 +424,12 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; $tasksarraywithoutfilter = array(); // Default -$tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. +$tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, (string) $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. if ($morewherefilter) { // Get all task without any filter, so we can show total of time spent for not visible tasks - $tasksarraywithoutfilter = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, '', $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. + $tasksarraywithoutfilter = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, '', (string) $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. } -$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? $project->id : 0), 0, $onlyopenedproject); -$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject); +$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? (string) $project->id : '0'), 0, $onlyopenedproject); +$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? (string) $project->id : '0'), 0, $onlyopenedproject); //var_dump($tasksarray); //var_dump($projectsrole); //var_dump($taskrole); @@ -536,7 +536,7 @@ if (!$user->hasRight('user', 'user', 'lire')) { $includeonly = array($user->id); } $selecteduser = $search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id; -$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, array(), 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, array(), '0', 0, 0, '', 0, '', 'maxwidth200'); if ($form->num > 1 || empty($conf->dol_optimize_smallscreen)) { $moreforfilter .= '
'; $moreforfilter .= '
'; @@ -774,8 +774,8 @@ if (count($tasksarray) > 0) { if (!empty($THolidays[$weekNb]["ids"]) && in_array($h->rowid, $THolidays[$weekNb]["ids"])) { continue; } - $startweekholiday =(int) (($h["date_debut"] <= $weekstart) ? $weekstart : $h["date_debut"] ); - $endweekholiday =(int) (($h["date_fin"] >= $weekend) ? $weekend : $h["date_fin"]); + $startweekholiday = (int) (($h["date_debut"] <= $weekstart) ? $weekstart : $h["date_debut"]); + $endweekholiday = (int) (($h["date_fin"] >= $weekend) ? $weekend : $h["date_fin"]); $halfdays = (int) $h["halfday"]; $nbdays = num_open_day($startweekholiday, $endweekholiday, 0, 1, $halfdays); diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php index a7f799d74aa..a2a96bb2b01 100644 --- a/htdocs/projet/activity/perweek.php +++ b/htdocs/projet/activity/perweek.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010 François Legastelois * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -139,9 +139,9 @@ $arrayfields = array(); 'p.budget_amount'=>array('label'=>$langs->trans("Budget"), 'checked'=>0, 'position'=>110), 'p.usage_bill_time'=>array('label'=>$langs->trans("BillTimeShort"), 'checked'=>0, 'position'=>115), );*/ -$arrayfields['t.planned_workload'] = array('label' => 'PlannedWorkload', 'checked' => 1, 'enabled' => 1, 'position' => 5); -$arrayfields['t.progress'] = array('label' => 'ProgressDeclared', 'checked' => 1, 'enabled' => 1, 'position' => 10); -$arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => 1, 'enabled' => 1, 'position' => 15); +$arrayfields['t.planned_workload'] = array('label' => 'PlannedWorkload', 'checked' => '1', 'enabled' => '1', 'position' => 5); +$arrayfields['t.progress'] = array('label' => 'ProgressDeclared', 'checked' => '1', 'enabled' => '1', 'position' => 10); +$arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => '1', 'enabled' => '1', 'position' => 15); /*foreach($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field @@ -152,7 +152,7 @@ $arrayfields['timeconsumed'] = array('label' => 'TimeConsumed', 'checked' => 1, if (!empty($extrafields->attributes['projet_task']['label']) && is_array($extrafields->attributes['projet_task']['label']) && count($extrafields->attributes['projet_task']['label']) > 0) { foreach ($extrafields->attributes['projet_task']['label'] as $key => $val) { if (!empty($extrafields->attributes['projet_task']['list'][$key])) { - $arrayfields["efpt.".$key] = array('label' => $extrafields->attributes['projet_task']['label'][$key], 'checked' => (($extrafields->attributes['projet_task']['list'][$key] < 0) ? 0 : 1), 'position' => $extrafields->attributes['projet_task']['pos'][$key], 'enabled' => (abs((int) $extrafields->attributes['projet_task']['list'][$key]) != 3 && $extrafields->attributes['projet_task']['perms'][$key])); + $arrayfields["efpt.".$key] = array('label' => $extrafields->attributes['projet_task']['label'][$key], 'checked' => (($extrafields->attributes['projet_task']['list'][$key] < 0) ? '0' : '1'), 'position' => $extrafields->attributes['projet_task']['pos'][$key], 'enabled' => (string) (int) (abs((int) $extrafields->attributes['projet_task']['list'][$key]) != 3 && $extrafields->attributes['projet_task']['perms'][$key])); } } } @@ -422,13 +422,13 @@ $search_options_pattern = 'search_task_options_'; $extrafieldsobjectkey = 'projet_task'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; -$tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. +$tasksarray = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, $search_project_ref, (string) $onlyopenedproject, $morewherefilter, ($search_usertoprocessid ? $search_usertoprocessid : 0), 0, $extrafields); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. $tasksarraywithoutfilter = array(); if ($morewherefilter) { // Get all task without any filter, so we can show total of time spent for not visible tasks - $tasksarraywithoutfilter = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, '', $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. + $tasksarraywithoutfilter = $taskstatic->getTasksArray(null, null, ($project->id ? $project->id : 0), $socid, 0, '', (string) $onlyopenedproject, '', ($search_usertoprocessid ? $search_usertoprocessid : 0)); // We want to see all tasks of open project i am allowed to see and that match filter, not only my tasks. Later only mine will be editable later. } -$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? $project->id : 0), 0, $onlyopenedproject); -$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? $project->id : 0), 0, $onlyopenedproject); +$projectsrole = $taskstatic->getUserRolesForProjectsOrTasks($usertoprocess, null, ($project->id ? (string) $project->id : '0'), 0, (int) $onlyopenedproject); +$tasksrole = $taskstatic->getUserRolesForProjectsOrTasks(null, $usertoprocess, ($project->id ? (string) $project->id : '0'), 0, (int) $onlyopenedproject); //var_dump($tasksarray); //var_dump($projectsrole); //var_dump($taskrole); @@ -542,7 +542,7 @@ for ($idw = 0; $idw < 7; $idw++) { $statusofholidaytocheck = Holiday::STATUS_APPROVED; - $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow, $statusofholidaytocheck); + $isavailablefordayanduser = $holiday->verifDateHolidayForTimestamp($usertoprocess->id, $dayinloopfromfirstdaytoshow, (string) $statusofholidaytocheck); $isavailable[$dayinloopfromfirstdaytoshow] = $isavailablefordayanduser; // in projectLinesPerWeek later, we are using $firstdaytoshow and dol_time_plus_duree to loop on each day $test = num_public_holiday($dayinloopfromfirstdaytoshowgmt, $dayinloopfromfirstdaytoshowgmt + 86400, $mysoc->country_code); @@ -571,7 +571,7 @@ if (!$user->hasRight('user', 'user', 'lire')) { $includeonly = array($user->id); } $selecteduser = $search_usertoprocessid ? $search_usertoprocessid : $usertoprocess->id; -$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth200'); +$moreforfiltertmp = $form->select_dolusers($selecteduser, 'search_usertoprocessid', 0, null, 0, $includeonly, '', '0', 0, 0, '', 0, '', 'maxwidth200'); if ($form->num > 1 || empty($conf->dol_optimize_smallscreen)) { $moreforfilter .= '
'; $moreforfilter .= '
'; diff --git a/htdocs/projet/ajax/projects.php b/htdocs/projet/ajax/projects.php index 81ffe73f17d..8b2dc432e60 100644 --- a/htdocs/projet/ajax/projects.php +++ b/htdocs/projet/ajax/projects.php @@ -4,6 +4,7 @@ * Copyright (C) 2007-2020 Laurent Destailleur * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -78,7 +79,7 @@ if (empty($mode) || $mode != 'gettasks') { $searchkey = (GETPOSTISSET($htmlname) ? GETPOST($htmlname, 'aZ09') : ''); $formproject = new FormProjets($db); - $arrayresult = $formproject->select_projects_list($socid, '', '', 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey); + $arrayresult = $formproject->select_projects_list($socid, 0, '', 0, 0, 1, $discard_closed, 0, 0, 1, $searchkey); $db->close(); @@ -93,7 +94,7 @@ if ($mode == 'gettasks') { top_httphead(); $formproject = new FormProjets($db); - $formproject->selectTasks((!empty($socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', GETPOSTINT('projectid'), ''); + $formproject->selectTasks((!empty($socid) ? $socid : -1), 0, 'taskid', 24, 1, '1', 1, 0, 0, 'maxwidth500', (string) GETPOSTINT('projectid'), ''); $db->close(); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index dba5f48db1c..08625a71259 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -4,7 +4,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2023 Charlene Benke * Copyright (C) 2023 Christian Foellmann - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Alexandre Spangaro * @@ -313,7 +313,7 @@ if (empty($reshook)) { } $db->begin(); - $old_start_date = null; + $old_start_date = 0; if (!$error) { $object->oldcopy = clone $object; @@ -1095,7 +1095,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { if (getDolGlobalInt('PROJECT_ENABLE_SUB_PROJECT')) { print ''.$langs->trans("Parent").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - $formproject->select_projects(-1, $object->fk_project, 'fk_project', 64, 0, 1, 1, 0, 0, 0, '', 0, 0, '', '', ''); + $formproject->select_projects(-1, (string) $object->fk_project, 'fk_project', 64, 0, 1, 1, 0, 0, 0, '', 0, 0, '', '', ''); print ''; } @@ -1240,7 +1240,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print ''.$langs->trans("OpportunityStatus").''; print ''; print '
'; - print $formproject->selectOpportunityStatus('opp_status', $object->opp_status, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1); + print $formproject->selectOpportunityStatus('opp_status', (string) $object->opp_status, 1, 0, 0, 0, 'minwidth150 inline-block valignmiddle', 1, 1); // Opportunity probability print ' %'; @@ -1442,8 +1442,8 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { print ''; $html_name_status = ($action == 'edit_opp_status') ? 'opp_status' : 'none'; $html_name_percent = ($action == 'edit_opp_status') ? 'opp_percent' : 'none'; - $percent_value = (GETPOSTISSET('opp_percent') ? GETPOST('opp_percent') : (strcmp($object->opp_percent, '') ? vatrate($object->opp_percent) : '')); - $formproject->formOpportunityStatus($_SERVER['PHP_SELF'].'?socid='.$object->id, $object->opp_status, $percent_value, $html_name_status, $html_name_percent); + $percent_value = (GETPOSTISSET('opp_percent') ? GETPOSTINT('opp_percent') : (strcmp($object->opp_percent, '') ? vatrate($object->opp_percent) : '')); + $formproject->formOpportunityStatus($_SERVER['PHP_SELF'].'?socid='.$object->id, (string) $object->opp_status, $percent_value, $html_name_status, $html_name_percent); print ''; // Opportunity Amount @@ -1808,7 +1808,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer')) { $genallowed = ($user->hasRight('projet', 'lire') && $userAccess > 0); $delallowed = ($user->hasRight('projet', 'creer') && $userWrite > 0); - print $formfile->showdocuments('project', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', '', '', $object); + print $formfile->showdocuments('project', $filename, $filedir, $urlsource, (int) $genallowed, (int) $delallowed, $object->model_pdf, 1, 0, 0, 0, 0, '', '', '', '', '', $object); print '
'; diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index 979745c3805..842522ff561 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; class Projects extends DolibarrApi { /** - * @var string[] $FIELDS Mandatory fields, checked when create and update object + * @var string[] Mandatory fields, checked when create and update object */ public static $FIELDS = array( 'ref', @@ -39,12 +39,12 @@ class Projects extends DolibarrApi ); /** - * @var Project $project {@type Project} + * @var Project {@type Project} */ public $project; /** - * @var Task $task {@type Task} + * @var Task {@type Task} */ public $task; @@ -459,7 +459,7 @@ class Projects extends DolibarrApi $userp = new User($this->db); $userp->fetch($userid); } - $this->project->roles = $taskstatic->getUserRolesForProjectsOrTasks($userp, null, $id, 0); + $this->project->roles = $taskstatic->getUserRolesForProjectsOrTasks($userp, null, (string) $id, 0); $result = array(); foreach ($this->project->roles as $line) { array_push($result, $this->_cleanObjectDatas($line)); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index fa22c00d98b..fa328d51da8 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -861,13 +861,13 @@ class Project extends CommonObject /** * Return list of elements for type, linked to a project * - * @param string $type 'propal','order','invoice','order_supplier','invoice_supplier',... - * @param string $tablename name of table associated of the type - * @param string $datefieldname name of date field for filter - * @param int $date_start Start date - * @param int $date_end End date - * @param string $projectkey Equivalent key to fk_projet for actual type - * @return mixed Array list of object ids linked to project, < 0 or string if error + * @param string $type 'propal','order','invoice','order_supplier','invoice_supplier',... + * @param string $tablename name of table associated of the type + * @param string $datefieldname name of date field for filter + * @param ?int $date_start Start date + * @param ?int $date_end End date + * @param string $projectkey Equivalent key to fk_projet for actual type + * @return array|int<-1,-1>|string Array list of object ids linked to project, < 0 or string if error */ public function get_element_list($type, $tablename, $datefieldname = '', $date_start = null, $date_end = null, $projectkey = 'fk_projet') { @@ -884,23 +884,23 @@ class Project extends CommonObject $ids = $this->id; if ($type == 'agenda') { - $sql = "SELECT id as rowid FROM ".MAIN_DB_PREFIX."actioncomm WHERE fk_project IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity('agenda').")"; + $sql = "SELECT id as rowid FROM ".MAIN_DB_PREFIX."actioncomm WHERE fk_project IN (".$this->db->sanitize((string) $ids).") AND entity IN (".getEntity('agenda').")"; } elseif ($type == 'expensereport') { - $sql = "SELECT ed.rowid FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND e.entity IN (".getEntity('expensereport').") AND ed.fk_projet IN (".$this->db->sanitize($ids).")"; + $sql = "SELECT ed.rowid FROM ".MAIN_DB_PREFIX."expensereport as e, ".MAIN_DB_PREFIX."expensereport_det as ed WHERE e.rowid = ed.fk_expensereport AND e.entity IN (".getEntity('expensereport').") AND ed.fk_projet IN (".$this->db->sanitize((string) $ids).")"; } elseif ($type == 'project_task') { - $sql = "SELECT DISTINCT pt.rowid FROM ".MAIN_DB_PREFIX."projet_task as pt WHERE pt.fk_projet IN (".$this->db->sanitize($ids).")"; + $sql = "SELECT DISTINCT pt.rowid FROM ".MAIN_DB_PREFIX."projet_task as pt WHERE pt.fk_projet IN (".$this->db->sanitize((string) $ids).")"; } elseif ($type == 'element_time') { // Case we want to duplicate line foreach user - $sql = "SELECT DISTINCT pt.rowid, ptt.fk_user FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."element_time as ptt WHERE pt.rowid = ptt.fk_element AND ptt.elementtype = 'task' AND pt.fk_projet IN (".$this->db->sanitize($ids).")"; + $sql = "SELECT DISTINCT pt.rowid, ptt.fk_user FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."element_time as ptt WHERE pt.rowid = ptt.fk_element AND ptt.elementtype = 'task' AND pt.fk_projet IN (".$this->db->sanitize((string) $ids).")"; } elseif ($type == 'stocktransfer_stocktransfer') { - $sql = "SELECT ms.rowid, ms.fk_user_author as fk_user FROM ".MAIN_DB_PREFIX."stocktransfer_stocktransfer as ms, ".MAIN_DB_PREFIX."entrepot as e WHERE e.rowid = ms.fk_entrepot AND e.entity IN (".getEntity('stock').") AND ms.origintype = 'project' AND ms.fk_origin IN (".$this->db->sanitize($ids).") AND ms.type_mouvement = 1"; + $sql = "SELECT ms.rowid, ms.fk_user_author as fk_user FROM ".MAIN_DB_PREFIX."stocktransfer_stocktransfer as ms, ".MAIN_DB_PREFIX."entrepot as e WHERE e.rowid = ms.fk_entrepot AND e.entity IN (".getEntity('stock').") AND ms.origintype = 'project' AND ms.fk_origin IN (".$this->db->sanitize((string) $ids).") AND ms.type_mouvement = 1"; } elseif ($type == 'loan') { - $sql = "SELECT l.rowid, l.fk_user_author as fk_user FROM ".MAIN_DB_PREFIX."loan as l WHERE l.entity IN (".getEntity('loan').") AND l.fk_projet IN (".$this->db->sanitize($ids).")"; + $sql = "SELECT l.rowid, l.fk_user_author as fk_user FROM ".MAIN_DB_PREFIX."loan as l WHERE l.entity IN (".getEntity('loan').") AND l.fk_projet IN (".$this->db->sanitize((string) $ids).")"; } else { - $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize($ids).") AND entity IN (".getEntity($type).")"; + $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX.$tablename." WHERE ".$projectkey." IN (".$this->db->sanitize((string) $ids).") AND entity IN (".getEntity($type).")"; } if (isDolTms($date_start) && $type == 'loan') { - $sql .= " AND (dateend > '".$this->db->idate($date_start)."' OR dateend IS NULL)"; + $sql .= " AND (dateend > '".$this->db->idate((int) $date_start)."' OR dateend IS NULL)"; } elseif (isDolTms($date_start) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table if (empty($datefieldname) && !empty($this->table_element_date)) { $datefieldname = $this->table_element_date; @@ -908,11 +908,11 @@ class Project extends CommonObject if (empty($datefieldname)) { return 'Error this object has no date field defined'; } - $sql .= " AND (".$datefieldname." >= '".$this->db->idate($date_start)."' OR ".$datefieldname." IS NULL)"; + $sql .= " AND (".$datefieldname." >= '".$this->db->idate((int) $date_start)."' OR ".$datefieldname." IS NULL)"; } if (isDolTms($date_end) && $type == 'loan') { - $sql .= " AND (datestart < '".$this->db->idate($date_end)."' OR datestart IS NULL)"; + $sql .= " AND (datestart < '".$this->db->idate((int) $date_end)."' OR datestart IS NULL)"; } elseif (isDolTms($date_end) && ($type != 'project_task')) { // For table project_taks, we want the filter on date apply on project_time_spent table if (empty($datefieldname) && !empty($this->table_element_date)) { $datefieldname = $this->table_element_date; @@ -920,7 +920,7 @@ class Project extends CommonObject if (empty($datefieldname)) { return 'Error this object has no date field defined'; } - $sql .= " AND (".$datefieldname." <= '".$this->db->idate($date_end)."' OR ".$datefieldname." IS NULL)"; + $sql .= " AND (".$datefieldname." <= '".$this->db->idate((int) $date_end)."' OR ".$datefieldname." IS NULL)"; } $parameters = array( @@ -1411,18 +1411,18 @@ class Project extends CommonObject } /** - * Return clickable name (with picto eventually) + * Return clickable name (with optional picto) * - * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param string $option Variant where the link point to ('', 'nolink') - * @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string - * @param string $moreinpopup Text to add into popup - * @param string $sep Separator between ref and label if option addlabel is set - * @param int $notooltip 1=Disable tooltip - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @param string $morecss More css on a link - * @param string $save_pageforbacktolist Back to this page 'context:url' - * @return string String with URL + * @param int<0,2> $withpicto 0=No picto, 1=Include picto into link, 2=Only picto + * @param string $option Variant where the link point to ('', 'nolink') + * @param int $addlabel 0=Default, 1=Add label into string, >1=Add first chars into string + * @param string $moreinpopup Text to add into popup + * @param string $sep Separator between ref and label if option addlabel is set + * @param int<0,1> $notooltip 1=Disable tooltip + * @param int<-1,1> $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param string $morecss More css on a link + * @param string $save_pageforbacktolist Back to this page 'context:url' + * @return string String with URL */ public function getNomUrl($withpicto = 0, $option = '', $addlabel = 0, $moreinpopup = '', $sep = ' - ', $notooltip = 0, $save_lastsearch_value = -1, $morecss = '', $save_pageforbacktolist = '') { @@ -1740,17 +1740,17 @@ class Project extends CommonObject /** * Load an object from its id and create a new one in database * - * @param User $user User making the clone - * @param int $fromid Id of object to clone - * @param bool $clone_contact Clone contact of project - * @param bool $clone_task Clone task of project - * @param bool $clone_project_file Clone file of project - * @param bool $clone_task_file Clone file of task (if task are copied) - * @param bool $clone_note Clone note of project - * @param bool $move_date Move task date on clone - * @param int $notrigger No trigger flag - * @param int $newthirdpartyid New thirdparty id - * @return int New id of clone + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @param bool|int<0,1> $clone_contact Clone contact of project + * @param bool|int<0,1> $clone_task Clone task of project + * @param bool|int<0,1> $clone_project_file Clone file of project + * @param bool|int<0,1> $clone_task_file Clone file of task (if task are copied) + * @param bool|int<0,1> $clone_note Clone note of project + * @param bool|int<0,1> $move_date Move task date on clone + * @param int<0,1> $notrigger No trigger flag + * @param int $newthirdpartyid New thirdparty id + * @return int New id of clone */ public function createFromClone(User $user, $fromid, $clone_contact = false, $clone_task = true, $clone_project_file = false, $clone_task_file = false, $clone_note = true, $move_date = true, $notrigger = 0, $newthirdpartyid = 0) { diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 90eb6b41040..892171de15e 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -1,7 +1,7 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -224,7 +224,7 @@ class ProjectStats extends Stats } if (!empty($this->status)) { - $sqlwhere[] = " t.fk_statut IN (".$this->db->sanitize($this->status).")"; + $sqlwhere[] = " t.fk_statut IN (".$this->db->sanitize((string) $this->status).")"; } if (!empty($this->opp_status)) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index d76e3a605f4..da26f12997b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -674,7 +674,7 @@ class Task extends CommonObjectLine // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task SET"; $sql .= " fk_projet=".(isset($this->fk_project) ? $this->fk_project : "null").","; - $sql .= " ref=".(isset($this->ref) ? "'".$this->db->escape($this->ref)."'" : "'".$this->db->escape($this->id)."'").","; + $sql .= " ref=".(isset($this->ref) ? "'".$this->db->escape($this->ref)."'" : "'".$this->db->escape((string) $this->id)."'").","; $sql .= " fk_task_parent=".(isset($this->fk_task_parent) ? $this->fk_task_parent : "null").","; $sql .= " label=".(isset($this->label) ? "'".$this->db->escape($this->label)."'" : "null").","; $sql .= " description=".(isset($this->description) ? "'".$this->db->escape($this->description)."'" : "null").","; @@ -1121,24 +1121,24 @@ class Task extends CommonObjectLine * Return list of tasks for all projects or for one particular project * Sort order is on project, then on position of task, and last on start date of first level task * - * @param ?User $usert Object user to limit tasks affected to a particular user - * @param ?User $userp Object user to limit projects of a particular user and public projects - * @param int $projectid Project id - * @param int $socid Third party id - * @param int $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists - * @param string $filteronproj Filter on project ref or label - * @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only) - * @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...') - * @param int $filteronprojuser Filter on user that is a contact of project - * @param int $filterontaskuser Filter on user assigned to task - * @param ?Extrafields $extrafields Show additional column from project or task - * @param int $includebilltime Calculate also the time to bill and billed + * @param ?User $usert Object user to limit tasks affected to a particular user + * @param ?User $userp Object user to limit projects of a particular user and public projects + * @param int $projectid Project id + * @param int $socid Third party id + * @param int<0,1> $mode 0=Return list of tasks and their projects, 1=Return projects and tasks if exists + * @param string $filteronproj Filter on project ref or label + * @param string $filteronprojstatus Filter on project status ('-1'=no filter, '0,1'=Draft+Validated only) + * @param string $morewherefilter Add more filter into where SQL request (must start with ' AND ...') + * @param int<0,1> $filteronprojuser Filter on user that is a contact of project + * @param int<0,1> $filterontaskuser Filter on user assigned to task + * @param ?Extrafields $extrafields Show additional column from project or task + * @param int<0,1> $includebilltime Calculate also the time to bill and billed * @param array $search_array_options Array of search filters. Not Used yet. - * @param int $loadextras Fetch all Extrafields on each project and task - * @param int $loadRoleMode 1= will test Roles on task; 0 used in delete project action - * @param string $sortfield Sort field - * @param string $sortorder Sort order - * @return Task[]|string Array of tasks + * @param int<0,1> $loadextras Fetch all Extrafields on each project and task + * @param int<0,1> $loadRoleMode 1= will test Roles on task; 0 used in delete project action + * @param string $sortfield Sort field + * @param string $sortorder Sort order + * @return Task[]|string Array of tasks */ public function getTasksArray($usert = null, $userp = null, $projectid = 0, $socid = 0, $mode = 0, $filteronproj = '', $filteronprojstatus = '-1', $morewherefilter = '', $filteronprojuser = 0, $filterontaskuser = 0, $extrafields = null, $includebilltime = 0, $search_array_options = array(), $loadextras = 0, $loadRoleMode = 1, $sortfield = '', $sortorder = '') { @@ -1244,7 +1244,7 @@ class Task extends CommonObjectLine $sql .= " AND p.fk_soc = ".((int) $socid); } if ($projectid) { - $sql .= " AND p.rowid IN (".$this->db->sanitize($projectid).")"; + $sql .= " AND p.rowid IN (".$this->db->sanitize((string) $projectid).")"; } if ($filteronproj) { $sql .= natural_search(array("p.ref", "p.title"), $filteronproj); @@ -1907,11 +1907,11 @@ class Task extends CommonObjectLine } if ($dates > 0) { $datefieldname = "element_datehour"; - $sql .= " AND (".$datefieldname." >= '".$this->db->idate($dates)."' OR ".$datefieldname." IS NULL)"; + $sql .= " AND (".$datefieldname." >= '".$this->db->idate((int) $dates)."' OR ".$datefieldname." IS NULL)"; } if ($datee > 0) { $datefieldname = "element_datehour"; - $sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)"; + $sql .= " AND (".$datefieldname." <= '".$this->db->idate((int) $datee)."' OR ".$datefieldname." IS NULL)"; } //print $sql; @@ -2220,7 +2220,7 @@ class Task extends CommonObjectLine if (!$error) { $sql = "UPDATE ".MAIN_DB_PREFIX."projet_task"; - $sql .= " SET duration_effective = duration_effective - ".$this->db->escape($this->timespent_duration ? $this->timespent_duration : 0); + $sql .= " SET duration_effective = duration_effective - ".$this->db->escape($this->timespent_duration ? (string) $this->timespent_duration : '0'); $sql .= " WHERE rowid = ".((int) $this->id); dol_syslog(get_class($this)."::delTimeSpent", LOG_DEBUG); @@ -2291,7 +2291,7 @@ class Task extends CommonObjectLine require_once DOL_DOCUMENT_ROOT."/core/modules/project/task/" . getDolGlobalString('PROJECT_TASK_ADDON').'.php'; $modTask = new $obj(); '@phan-var-force ModeleNumRefTask $modTask'; - $defaultref = $modTask->getNextValue(0, $clone_task); + $defaultref = $modTask->getNextValue(null, $clone_task); } $ori_project_id = $clone_task->fk_project; diff --git a/htdocs/projet/class/taskstats.class.php b/htdocs/projet/class/taskstats.class.php index 3db3f872217..99a176c9470 100644 --- a/htdocs/projet/class/taskstats.class.php +++ b/htdocs/projet/class/taskstats.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -162,7 +162,7 @@ class TaskStats extends Stats $sqlwhere[] = " t.datec BETWEEN '".$this->db->idate(dol_get_first_day($this->year, $this->month))."' AND '".$this->db->idate(dol_get_last_day($this->year, $this->month))."'"; } if (!empty($this->priority)) { - $sqlwhere[] = " t.priority IN (".$this->db->sanitize($this->priority, 1).")"; + $sqlwhere[] = " t.priority IN (".$this->db->sanitize((string) $this->priority, 1).")"; } if (count($sqlwhere) > 0) { diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index f04c1df9ae6..22f4d4a33a9 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -1,7 +1,7 @@ * Copyright (C) 2012-2015 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -88,16 +88,16 @@ if ($reshook < 0) { setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); } +$formconfirmtoaddtasks = ''; if (empty($reshook)) { // Test if we can add contact to the tasks at the same times, if not or not required, make a redirect - $formconfirmtoaddtasks = ''; if ($action == 'addcontact' && $permissiontoadd) { $form = new Form($db); $source = GETPOST("source", 'aZ09'); $taskstatic = new Task($db); - $task_array = $taskstatic->getTasksArray(0, 0, $object->id, 0, 0); + $task_array = $taskstatic->getTasksArray(null, null, $object->id, 0, 0); $nbTasks = count($task_array); //If no task available, redirec to to add confirm @@ -191,7 +191,7 @@ if (empty($reshook)) { if ($result > 0) { $excludefilter = 'statut = 1'; $tmpcontactarray = $usergroup->listUsersForGroup($excludefilter, 0); - if ($contactarray <= 0) { + if (!is_array($tmpcontactarray)) { $error++; } else { foreach ($tmpcontactarray as $tmpuser) { @@ -245,7 +245,7 @@ if (empty($reshook)) { foreach ($task_to_affect as $task_id) { if (GETPOSTISSET('person_'.$task_id) && GETPOST('person_'.$task_id, 'san_alpha')) { $tasksToAffect = new Task($db); - $result = $tasksToAffect->fetch($task_id); + $result = $tasksToAffect->fetch((int) $task_id); if ($result < 0) { setEventMessages($tasksToAffect->error, null, 'errors'); } else { diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 21fea1424d9..7d03c54a5b6 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -737,7 +737,7 @@ if (!empty($hookmanager->resArray)) { if ($action == "addelement") { $tablename = GETPOST("tablename"); - $elementselectid = GETPOST("elementselect"); + $elementselectid = GETPOSTINT("elementselect"); $result = $object->update_element($tablename, $elementselectid); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -766,10 +766,10 @@ if (!$showdatefilter) { print ''; print ''; print '
'; - print $form->selectDate($dates, 'dates', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); + print $form->selectDate((int) $dates, 'dates', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From")); print '
'; print '
'; - print $form->selectDate($datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); + print $form->selectDate((int) $datee, 'datee', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to")); print '
'; print '
'; print ''; @@ -866,8 +866,8 @@ foreach ($listofreferent as $key => $value) { $num = count($elementarray); for ($i = 0; $i < $num; $i++) { $tmp = explode('_', $elementarray[$i]); - $idofelement = $tmp[0]; - $idofelementuser = !empty($tmp[1]) ? $tmp[1] : ""; + $idofelement = (int) $tmp[0]; + $idofelementuser = !empty($tmp[1]) ? (int) $tmp[1] : 0; $element->fetch($idofelement); if ($idofelementuser) { @@ -896,15 +896,20 @@ foreach ($listofreferent as $key => $value) { // Define $total_ht_by_line if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { + '@phan-var-force ChargeSociales|PaymentVarious|Salary $element'; $total_ht_by_line = $element->amount; } elseif ($tablename == 'fichinter') { + '@phan-var-force Fichinter $element'; $total_ht_by_line = $element->getAmount(); } elseif ($tablename == 'stock_mouvement') { + '@phan-var-force MouvementStock $element'; $total_ht_by_line = $element->price * abs($element->qty); } elseif ($tablename == 'projet_task') { - $tmp = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); + '@phan-var-force Task $element'; + $tmp = $element->getSumOfAmount($idofelementuser ? $elementuser : '', (string) $dates, (string) $datee); $total_ht_by_line = price2num($tmp['amount'], 'MT'); } elseif ($key == 'loan') { + '@phan-var-force Loan $element'; if ((empty($dates) && empty($datee)) || (intval($dates) <= $element->datestart && intval($datee) >= $element->dateend)) { // Get total loan $total_ht_by_line = -$element->capital; @@ -933,12 +938,16 @@ foreach ($listofreferent as $key => $value) { // Define $total_ttc_by_line if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { + '@phan-var-force ChargeSociales|PaymentVarious|Salary $element'; $total_ttc_by_line = $element->amount; } elseif ($tablename == 'fichinter') { + '@phan-var-force Fichinter $element'; $total_ttc_by_line = $element->getAmount(); } elseif ($tablename == 'stock_mouvement') { + '@phan-var-force MouvementStock $element'; $total_ttc_by_line = $element->price * abs($element->qty); } elseif ($tablename == 'projet_task') { + '@phan-var-force Task $element'; $defaultvat = get_default_tva($mysoc, $mysoc); $reg = array(); if (preg_replace('/^(\d+\.)\s\(.*\)/', $defaultvat, $reg)) { @@ -1101,7 +1110,7 @@ foreach ($listofreferent as $key => $value) { $exclude_select_element[] = $value['exclude_select_element']; } - if ($qualified) { + if ($qualified && $tablename !== null) { // If we want the project task array to have details of users //if ($key == 'project_task') $key = 'project_task_time'; @@ -1268,8 +1277,8 @@ foreach ($listofreferent as $key => $value) { $total_time = 0; for ($i = 0; $i < $num; $i++) { $tmp = explode('_', $elementarray[$i]); - $idofelement = $tmp[0]; - $idofelementuser = isset($tmp[1]) ? $tmp[1] : ""; + $idofelement = (int) $tmp[0]; + $idofelementuser = isset($tmp[1]) ? (int) $tmp[1] : 0; $element->fetch($idofelement); if ($idofelementuser) { @@ -1390,6 +1399,7 @@ foreach ($listofreferent as $key => $value) { print "\n"; // Product and qty on stock movement if ('MouvementStock' == $classname) { + '@phan-var-force MouvementStock $element'; $mvsProd = new Product($element->db); $mvsProd->fetch($element->product_id); print ''.$mvsProd->getNomUrl(1).''; @@ -1397,28 +1407,38 @@ foreach ($listofreferent as $key => $value) { } // Date or TimeSpent $date = ''; - $total_time_by_line = null; + $total_time_by_line = 0; if ($tablename == 'expensereport_det') { + '@phan-var-force ExpenseReportLine $element'; $date = $element->date; // No draft status on lines } elseif ($tablename == 'stock_mouvement') { + '@phan-var-force MouvementStock $element'; $date = $element->datem; } elseif ($tablename == 'salary') { + '@phan-var-force Salary $element'; $date = $element->datesp; } elseif ($tablename == 'payment_various') { + '@phan-var-force PaymentVarious $element'; $date = $element->datev; } elseif ($tablename == 'chargesociales') { + '@phan-var-force ChargeSociales $element'; $date = $element->date_ech; } elseif (!empty($element->status) || !empty($element->statut) || !empty($element->fk_status)) { if ($tablename == 'don') { - $date = $element->datedon; + '@phan-var-force Don $element'; + $date = $element->date; } if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') { + '@phan-var-force CommandeFournisseur $element'; $date = ($element->date_commande ? $element->date_commande : $element->date_valid); } elseif ($tablename == 'supplier_proposal') { + '@phan-var-force SupplierProposal $element'; $date = $element->date_validation; // There is no other date for this } elseif ($tablename == 'fichinter') { + '@phan-var-force Fichinter $element'; $date = $element->datev; // There is no other date for this } elseif ($tablename == 'projet_task') { + '@phan-var-force Task $element'; $date = ''; // We show no date. Showing date of beginning of task make user think it is date of time consumed } else { $date = $element->date; // invoice, ... @@ -1429,21 +1449,25 @@ foreach ($listofreferent as $key => $value) { $date = $element->datev; } if (empty($date) && !empty($datefieldname)) { + // @phan-suppress-next-line PhanUndeclaredProperty $date = $element->$datefieldname; } } } elseif ($key == 'loan') { + '@phan-var-force Loan $element'; $date = $element->datestart; } print ''; if ($tablename == 'actioncomm') { + '@phan-var-force ActionComm $element'; print dol_print_date($element->datep, 'dayhour'); if ($element->datef && $element->datef > $element->datep) { print " - ".dol_print_date($element->datef, 'dayhour'); } } elseif (in_array($tablename, array('projet_task'))) { - $tmpprojtime = $element->getSumOfAmount($idofelementuser ? $elementuser : '', $dates, $datee); // $element is a task. $elementuser may be empty + '@phan-var-force Task $element'; + $tmpprojtime = $element->getSumOfAmount($idofelementuser ? $elementuser : '', (string) $dates, (string) $datee); // $element is a task. $elementuser may be empty print ''; print convertSecondToTime($tmpprojtime['nbseconds'], 'allhourmin'); print ''; @@ -1466,6 +1490,7 @@ foreach ($listofreferent as $key => $value) { $tmpuser->fetch($element->fk_user); print $tmpuser->getNomUrl(1, '', 48); } elseif ($tablename == 'don' || $tablename == 'stock_mouvement') { + '@phan-var-force Don|MouvementStock $element'; if ($element->fk_user_author > 0) { $tmpuser2 = new User($db); $tmpuser2->fetch($element->fk_user_author); @@ -1474,12 +1499,14 @@ foreach ($listofreferent as $key => $value) { } elseif ($tablename == 'projet_task' && $key == 'element_time') { // if $key == 'project_task', we don't want details per user print $elementuser->getNomUrl(1); } elseif ($tablename == 'payment_various') { // payment label + '@phan-var-force PaymentVarious $element'; print $element->label; } print ''; // Add duration and store it in counter for fichinter if ($tablename == 'fichinter') { + '@phan-var-force FichInter $element'; print ''; print convertSecondToTime($element->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); $total_duration += $element->duration; @@ -1492,10 +1519,13 @@ foreach ($listofreferent as $key => $value) { $total_ht_by_line = null; $othermessage = ''; if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { + '@phan-var-force Don|ChargeSociales|PaymentVarious|Salary $element'; $total_ht_by_line = $element->amount; } elseif ($tablename == 'fichinter') { + '@phan-var-force FichInter $element'; $total_ht_by_line = $element->getAmount(); } elseif ($tablename == 'stock_mouvement') { + '@phan-var-force MouvementStock $element'; $total_ht_by_line = $element->price * abs($element->qty); } elseif (in_array($tablename, array('projet_task'))) { if (isModEnabled('salaries')) { @@ -1509,6 +1539,7 @@ foreach ($listofreferent as $key => $value) { $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); } } elseif ($key == 'loan') { + '@phan-var-force Loan $element'; $total_ht_by_line = $element->capital; } else { $total_ht_by_line = $element->total_ht; @@ -1546,10 +1577,13 @@ foreach ($listofreferent as $key => $value) { if (empty($value['disableamount'])) { $total_ttc_by_line = null; if ($tablename == 'don' || $tablename == 'chargesociales' || $tablename == 'payment_various' || $tablename == 'salary') { + '@phan-var-force Don|ChargeSociales|PaymentVarious $element'; $total_ttc_by_line = $element->amount; } elseif ($tablename == 'fichinter') { + '@phan-var-force Fichinter $element'; $total_ttc_by_line = $element->getAmount(); } elseif ($tablename == 'stock_mouvement') { + '@phan-var-force MouvementStock $element'; $total_ttc_by_line = $element->price * abs($element->qty); } elseif ($tablename == 'projet_task') { if (isModEnabled('salaries')) { @@ -1560,6 +1594,7 @@ foreach ($listofreferent as $key => $value) { $othermessage = $form->textwithpicto($langs->trans("NotAvailable"), $langs->trans("ModuleSalaryToDefineHourlyRateMustBeEnabled")); } } elseif ($key == 'loan') { + '@phan-var-force Loan $element'; $total_ttc_by_line = $element->capital - $element->getSumPayment(); } else { $total_ttc_by_line = $element->total_ttc; @@ -1605,6 +1640,7 @@ foreach ($listofreferent as $key => $value) { print $element->progress.' %'; } } elseif ($tablename == 'stock_mouvement') { + '@phan-var-force MouvementStock $element'; print $element->getLibStatut(3); } else { print $element->getLibStatut(5); @@ -1662,7 +1698,7 @@ foreach ($listofreferent as $key => $value) { print ''.$langs->trans("Number").': '.$i.''; if (in_array($tablename, array('projet_task'))) { print ''; - print convertSecondToTime($total_time, 'allhourmin'); + print convertSecondToTime((int) $total_time, 'allhourmin'); print ''; print ''; print ''; @@ -1746,8 +1782,8 @@ function canApplySubtotalOn($tablename) /** * sortElementsByClientName * - * @param int[] $elementarray Element array - * @return int[] Element array sorted + * @param array $elementarray Element array + * @return array Element array sorted */ function sortElementsByClientName($elementarray) { diff --git a/htdocs/projet/ganttchart.inc.php b/htdocs/projet/ganttchart.inc.php index a887f6d24b5..c2a68c65d7c 100644 --- a/htdocs/projet/ganttchart.inc.php +++ b/htdocs/projet/ganttchart.inc.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -26,6 +26,13 @@ * @var DoliDB $db * @var Translate $langs */ +' +@phan-var-force string $dateformatinput +@phan-var-force string $dateformat +@phan-var-force string $datehourformat +@phan-var-force array,task_css:string,task_position:int,task_planned_workload:int,task_milestone:int,task_percent_complete:float,task_name:string,task_start_date:int,task_end_date:int,task_color:string,task_resources:string,note:string,task_parent_alternate_id:int}> $tasks +@phan-var-force array{} $task_dependencies +'; ?>
@@ -129,14 +136,14 @@ if (g.getDivId() != null) $projecttmp = new Project($db); $projecttmp->fetch($t['task_project_id']); $tmpt = array( - 'task_id' => '-'.$t['task_project_id'], - 'task_alternate_id' => '-'.$t['task_project_id'], + 'task_id' => (int) -$t['task_project_id'], + 'task_alternate_id' => (int) -$t['task_project_id'], 'task_name' => $projecttmp->ref.' '.$projecttmp->title, 'task_resources' => '', - 'task_start_date' => '', - 'task_end_date' => '', + 'task_start_date' => 0, + 'task_end_date' => 0, 'task_is_group' => 1, 'task_position' => 0, 'task_css' => 'ggroupblack', 'task_milestone' => 0, 'task_parent' => 0, 'task_parent_alternate_id' => 0, - 'task_notes' => '', + 'note' => '', 'task_planned_workload' => 0 ); constructGanttLine($tasks, $tmpt, array(), 0, $t['task_project_id']); @@ -166,10 +173,10 @@ else ,task_position:int,task_css:string,task_milestone:int,task_parent:int,task_parent_alternate_id:int}> $tarr Array of all tasks - * @param array{task_id:string,task_alternate_id:string,task_name:string,task_resources:string,task_start_date:string,task_end_date:string,task_is_group:int<0,1>,task_position:int,task_css:string,task_milestone:int,task_parent:int,task_parent_alternate_id:int} $task Array with properties of one task + * @param array,task_position:int,task_css:string,task_milestone:int,task_parent:int,task_parent_alternate_id:int}> $tarr Array of all tasks + * @param array{task_id:int,task_alternate_id:int,task_name:string,task_resources:string,task_start_date:int,task_end_date:int,task_is_group:int<0,1>,task_position:int,task_css:string,task_milestone:int,task_parent:int,task_parent_alternate_id:int} $task Array with properties of one task * @param array $task_dependencies Task dependencies (array(array(0=>idtask,1=>idtasktofinishfisrt)) * @param int $level Level * @param int $project_id Id of project @@ -280,8 +287,8 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level = 0, $proje /** * Find child Gantt line * - * @param array,task_position:int,task_css:string,task_milestone:int,task_parent:int,task_parent_alternate_id:int}> $tarr tarr - * @param string $parent Parent + * @param array,task_position:int,task_css:string,task_milestone:int,task_parent:int,task_parent_alternate_id:int}> $tarr tarr + * @param int $parent Parent * @param array $task_dependencies Task dependencies * @param int $level Level * @return void @@ -298,12 +305,12 @@ function findChildGanttLine($tarr, $parent, $task_dependencies, $level) { $tmpt = array( 'task_id'=> -98, 'task_name'=>'Level '.$level, 'task_resources'=>'', 'task_start_date'=>'', 'task_end_date'=>'', - 'task_is_group'=>1, 'task_css'=>'ggroupblack', 'task_milestone'=> 0, 'task_parent'=>$tarr[$x]["task_parent"], 'task_notes'=>''); + 'task_is_group'=>1, 'task_css'=>'ggroupblack', 'task_milestone'=> 0, 'task_parent'=>$tarr[$x]["task_parent"], 'note'=>''); constructGanttLine($tasks, $tmpt, array(), 0, $tarr[$x]['task_project_id']); $old_parent_id = $tarr[$x]['task_project_id']; }*/ - constructGanttLine($tarr, $tarr[$x], $task_dependencies, $level, null); + constructGanttLine($tarr, $tarr[$x], $task_dependencies, $level, 0); findChildGanttLine($tarr, $tarr[$x]["task_id"], $task_dependencies, $level + 1); } } diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 33f7122723b..97ea895d75f 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2004-2017 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -101,6 +101,8 @@ $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("", $title, $help_url, '', 0, 0, $arrayofjs, $arrayofcss, '', 'mod-project page-card_ganttview'); +$userWrite = 0; + if (($id > 0 && is_numeric($id)) || !empty($ref)) { // To verify role of users //$userAccess = $object->restrictedProjectArea($user,'read'); @@ -272,7 +274,7 @@ print load_fiche_titre($title, $linktotasks.'   '.$linktocreatetask, 'proje // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user // can have a parent that is not affected to him). -$tasksarray = $task->getTasksArray(0, 0, ($object->id ? $object->id : $id), $socid, 0); +$tasksarray = $task->getTasksArray(null, null, ($object->id ? $object->id : $id), $socid, 0); // We load also tasks limited to a particular user //$tasksrole=($_REQUEST["mode"]=='mine' ? $task->getUserRolesForProjectsOrTasks(null, $user, $object->id, 0) : ''); //var_dump($tasksarray); @@ -313,7 +315,7 @@ if (count($tasksarray) > 0) { $tasks[$taskcursor]['task_css'] = 'ggroupblack'; //$tasks[$taskcursor]['task_css'] = 'gtaskblue'; } - $tasks[$taskcursor]['task_milestone'] = '0'; + $tasks[$taskcursor]['task_milestone'] = 0; $tasks[$taskcursor]['task_percent_complete'] = $val->progress; //$tasks[$taskcursor]['task_name']=$task->getNomUrl(1); //print dol_print_date($val->date_start).dol_print_date($val->date_end).'
'."\n"; diff --git a/htdocs/projet/graph_opportunities.inc.php b/htdocs/projet/graph_opportunities.inc.php index 78d3ead854d..9ddb37a5d26 100644 --- a/htdocs/projet/graph_opportunities.inc.php +++ b/htdocs/projet/graph_opportunities.inc.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -29,6 +29,13 @@ * @var int $socid * @var string[] $listofoppstatus */ +' +@phan-var-force string $projectsListId +@phan-var-force int $socid +@phan-var-force string[] $listofoppstatus +@phan-var-force ?array $listofopplabel +@phan-var-force array $colorseries +'; if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { $sql = "SELECT p.fk_opp_status as opp_status, cls.code, COUNT(p.rowid) as nb, SUM(p.opp_amount) as opp_amount, SUM(p.opp_amount * p.opp_percent) as ponderated_opp_amount"; diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index c606b0d14f1..71c71590c54 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -8,7 +8,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2019 Juanjo Menent * Copyright (C) 2020 Tobias Sean - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * Copyright (C) 2024 Benjamin Falière * Copyright (C) 2024 William Mead @@ -246,8 +246,8 @@ foreach ($object->fields as $key => $val) { $visible = (int) dol_eval((string) $val['visible'], 1, 1, '1'); $arrayfields['p.'.$key] = array( 'label' => $val['label'], - 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'checked' => (($visible < 0) ? '0' : '1'), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -257,38 +257,48 @@ foreach ($object->fields as $key => $val) { include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; // Add non object fields to fields for list -$arrayfields['s.nom'] = array('label' => "ThirdParty", 'checked' => 1, 'position' => 21, 'enabled' => (!isModEnabled('societe') ? 0 : 1)); -$arrayfields['s.name_alias'] = array('label' => "AliasNameShort", 'checked' => 0, 'position' => 22); -$arrayfields['co.country_code'] = array('label' => "Country", 'checked' => -1, 'position' => 23); -$arrayfields['commercial'] = array('label' => "SaleRepresentativesOfThirdParty", 'checked' => 0, 'position' => 25); -$arrayfields['c.assigned'] = array('label' => "AssignedTo", 'checked' => 1, 'position' => 120); -$arrayfields['opp_weighted_amount'] = array('label' => 'OpportunityWeightedAmountShort', 'checked' => 0, 'enabled' => (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES') ? 0 : 1), 'position' => 106); -$arrayfields['u.login'] = array('label' => "Author", 'checked' => -1, 'position' => 165); +$arrayfields['s.nom'] = array('label' => "ThirdParty", 'checked' => '1', 'position' => 21, 'enabled' => (!isModEnabled('societe') ? '0' : '1')); +$arrayfields['s.name_alias'] = array('label' => "AliasNameShort", 'checked' => '0', 'position' => 22); +$arrayfields['co.country_code'] = array('label' => "Country", 'checked' => '-1', 'position' => 23); +$arrayfields['commercial'] = array('label' => "SaleRepresentativesOfThirdParty", 'checked' => '0', 'position' => 25); +$arrayfields['c.assigned'] = array('label' => "AssignedTo", 'checked' => '1', 'position' => 120); +$arrayfields['opp_weighted_amount'] = array('label' => 'OpportunityWeightedAmountShort', 'checked' => '0', 'enabled' => (!getDolGlobalString('PROJECT_USE_OPPORTUNITIES') ? '0' : '1'), 'position' => 106); +$arrayfields['u.login'] = array('label' => "Author", 'checked' => '-1', 'position' => 165); // Force some fields according to search_usage filter... //if (GETPOST('search_usage_opportunity')) { //$arrayfields['p.usage_opportunity']['visible'] = 1; // Not required, filter on search_opp_status is enough //$arrayfields['p.usage_opportunity']['checked'] = 1; // Not required, filter on search_opp_status is enough //} if (GETPOST('search_usage_event_organization')) { - $arrayfields['p.fk_opp_status']['enabled'] = 0; - $arrayfields['p.opp_amount']['enabled'] = 0; - $arrayfields['p.opp_percent']['enabled'] = 0; - $arrayfields['opp_weighted_amount']['enabled'] = 0; - $arrayfields['p.usage_organize_event']['visible'] = 1; - $arrayfields['p.usage_organize_event']['checked'] = 1; + if (array_key_exists('p.fk_opp_status', $arrayfields)) { + $arrayfields['p.fk_opp_status']['enabled'] = '0'; + } + if (array_key_exists('p.fk_opp_amount', $arrayfields)) { + $arrayfields['p.opp_amount']['enabled'] = '0'; + } + if (array_key_exists('p.fk_opp_percent', $arrayfields)) { + $arrayfields['p.opp_percent']['enabled'] = '0'; + } + $arrayfields['opp_weighted_amount']['enabled'] = '0'; + if (array_key_exists('p.usage_organize_event', $arrayfields)) { + $arrayfields['p.usage_organize_event']['visible'] = '1'; + $arrayfields['p.usage_organize_event']['checked'] = '1'; + } } -$arrayfields['p.fk_project']['enabled'] = 0; +$arrayfields['p.fk_project']['enabled'] = '0'; // Force this field to be visible if ($contextpage == 'lead') { - $arrayfields['p.fk_opp_status']['enabled'] = 1; - $arrayfields['p.fk_opp_status']['visible'] = 1; + if (array_key_exists('p.fk_opp_status', $arrayfields)) { + $arrayfields['p.fk_opp_status']['enabled'] = '1'; + $arrayfields['p.fk_opp_status']['visible'] = '1'; + } } $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan +// '@phan-var-force array $arrayfields'; // dol_sort_array looses type for Phan // Add a groupby field. Set $groupby and $groupbyvalues. // TODO Move this into a inc file @@ -1203,7 +1213,7 @@ $includeonly = ''; if (!$user->hasRight('user', 'user', 'lire')) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); +$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, null, 0, $includeonly, '', '0', 0, 0, '', 0, '', 'maxwidth300 widthcentpercentminusx'); $moreforfilter .= '
'; $moreforfilter .= '
'; @@ -1291,7 +1301,7 @@ if (!empty($arrayfields['s.nom']['checked'])) { $tmpthirdparty->fetch($socid); $search_societe = $tmpthirdparty->name; } - print ''; + print ''; print ''; } @@ -1527,14 +1537,17 @@ if (!empty($arrayfields['c.assigned']['checked'])) { $totalarray['nbfield']++; } if (!empty($arrayfields['p.fk_opp_status']['checked'])) { + // @phan-suppress-next-line PhanTypeInvalidDimOffset print_liste_field_titre($arrayfields['p.fk_opp_status']['label'], $_SERVER["PHP_SELF"], 'p.fk_opp_status', "", $param, '', $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['p.opp_amount']['checked'])) { + // @phan-suppress-next-line PhanTypeInvalidDimOffset print_liste_field_titre($arrayfields['p.opp_amount']['label'], $_SERVER["PHP_SELF"], 'p.opp_amount', "", $param, '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; } if (!empty($arrayfields['p.opp_percent']['checked'])) { + // @phan-suppress-next-line PhanTypeInvalidDimOffset print_liste_field_titre($arrayfields['p.opp_percent']['label'], $_SERVER['PHP_SELF'], 'p.opp_percent', "", $param, '', $sortfield, $sortorder, 'right '); $totalarray['nbfield']++; } @@ -1559,6 +1572,7 @@ if (!empty($arrayfields['p.usage_bill_time']['checked'])) { $totalarray['nbfield']++; } if (!empty($arrayfields['p.usage_organize_event']['checked'])) { + // @phan-suppress-next-line PhanTypeInvalidDimOffset print_liste_field_titre($arrayfields['p.usage_organize_event']['label'], $_SERVER["PHP_SELF"], 'p.usage_organize_event', "", $param, '', $sortfield, $sortorder, ''); $totalarray['nbfield']++; } diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index 4f9091a3df4..87921d46d99 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -420,7 +420,7 @@ function getProject($authentication, $id = '', $ref = '') foreach ($listofreferent as $key => $tablename) { $elements[$key] = array(); $element_array = $project->get_element_list($key, $tablename); - if (count($element_array) > 0 && is_array($element_array)) { + if (is_array($element_array) && count($element_array) > 0) { foreach ($element_array as $element) { $tmp = explode('_', $element); $idofelement = count($tmp) > 0 ? $tmp[0] : ""; From d04ac67ecdc70fa84189ade0490560598840d65a Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Tue, 11 Feb 2025 00:31:59 +0100 Subject: [PATCH 330/375] backport 20.0 solution --- htdocs/admin/dict.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index e1a38d4c750..c9f44885d2c 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2004,6 +2004,11 @@ if ($id > 0) { $canbemodified = 1; } + if ($tabname[$id] == "c_product_nature" && in_array($obj->code, array(0, 1))) { + $canbedisabled = 0; + $canbemodified = 0; + $iserasable = 0; + } // Build Url. The table is id=, the id of line is rowid= $rowidcol = $tabrowid[$id]; // If rowidcol not defined From 94eaf5d0891320bbf94a975295ff8fc7fe946f23 Mon Sep 17 00:00:00 2001 From: Eric Seigne Date: Tue, 11 Feb 2025 00:32:57 +0100 Subject: [PATCH 331/375] cancel first idea --- htdocs/admin/dict.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index c9f44885d2c..859ef271a85 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -2081,7 +2081,7 @@ if ($id > 0) { //var_dump($fieldlist); $class = ''; $showfield = 1; - $valuetoshow = !isset($obj->$value) ? '' : $obj->$value; + $valuetoshow = empty($obj->$value) ? '' : $obj->$value; $titletoshow = ''; if ($value == 'entity') { @@ -2450,7 +2450,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } if (in_array($value, array('code', 'libelle', 'type')) && $tabname == "c_actioncomm" && isset($obj->$value) && in_array($obj->type, array('system', 'systemauto'))) { - $hidden = (isset($obj->{$value}) ? $obj->{$value}:''); + $hidden = (!empty($obj->{$value}) ? $obj->{$value}:''); print ''; print ''; print $langs->trans($hidden); @@ -2563,7 +2563,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '') } elseif ($value == 'price' || preg_match('/^amount/i', $value)) { print ''; } elseif ($value == 'code' && isset($obj->{$value})) { - print ''; + print ''; } elseif ($value == 'unit') { print ''; $units = array( From 94e12da9069b3f2be8f4990a8a5285eae12f93d1 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 11 Feb 2025 09:46:06 +0100 Subject: [PATCH 332/375] fix as asked --- htdocs/admin/pdf_other.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 1510c34a9c9..73b4d52596c 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -209,7 +209,7 @@ print '
'; print ''; -/*if (isModEnabled('propal')) { +if (isModEnabled('propal')) { print load_fiche_titre($langs->trans("Proposal"), '', 'proposal'); print '
'; @@ -227,6 +227,7 @@ print ''; print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); } print ''; + */ print ''; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); @@ -252,7 +253,7 @@ print ''; print ''; print '
'; -}*/ +} if (isModEnabled('order')) { $langs->load("orders"); From fa35c6e776447814332da3a9bbcbff2007ed3892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 Feb 2025 09:57:01 +0100 Subject: [PATCH 333/375] fix missing translations --- dev/translation/ignore_translation_keys.lst | 2 -- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/en_US/receptions.lang | 1 + 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index c8e2dfc5294..0afd3d9d139 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -134,8 +134,6 @@ AuthorityDidntReconizeFingerprintConformity AuthorityReconizeFingerprintConformity Auto AutoGenerateDoc -AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation -Automatic AvailabilityType BAN BI diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index cf6093a6061..65ff3c054bb 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1350,3 +1350,4 @@ GroupingLine=Grouping line AllTime=From start Transferred=Transferred Anonymous=Anonymous +Automatic=Automatic diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index 34b2276fca7..e3b748a983a 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -53,3 +53,4 @@ RestoreWithCurrentQtySaved=Fill quantities with latest saved values ReceptionsRecorded=Receptions recorded ReceptionUpdated=Reception successfully updated ReceptionDistribution=Reception distribution +AutoValidationNotPossibleWhenStockIsDecreasedOnInvoiceValidation=Automatic validation is not possible when stock is decreased on invoice validation From 33475b8e92efea7112b9ca2cdc86cb2982c11135 Mon Sep 17 00:00:00 2001 From: MarcVJ <38230768+MarcVJ@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:00:06 +0100 Subject: [PATCH 334/375] Added one line to allow use of price_ttc in calculated extra fields price_ttc sometimes needs to be used in extra fields to compute price ttc per kilo or per liter. Currently price_ttc does not compute in the product list, so price per kilo cannot compute either. This allows to add an extra field "Price TTC per kilo" like this : $object->price_ttc / $object->weight. $object->price_ttc will work because the added line puts price_ttc into $products_static, which is put in $object. --- htdocs/product/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index aa378d1c85c..d262f757909 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -1628,6 +1628,7 @@ while ($i < $imaxinloop) { } $product_static->price = $obj->price; + $product_static->price_ttc = $obj->price_ttc; // Allows to use price_ttc in calculated extra fields (ex : price per kilo) $object = $product_static; From ec4d6bf7c8beefbeb18412a2d7d3218ba02df593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 11 Feb 2025 10:09:34 +0100 Subject: [PATCH 335/375] fix missing translations --- dev/translation/ignore_translation_keys.lst | 1 - htdocs/langs/en_US/bills.lang | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/translation/ignore_translation_keys.lst b/dev/translation/ignore_translation_keys.lst index 0afd3d9d139..ae2bf3581d6 100644 --- a/dev/translation/ignore_translation_keys.lst +++ b/dev/translation/ignore_translation_keys.lst @@ -174,7 +174,6 @@ CalcModeLT CalculatedFromProductsToConsume CancelReception Candidatures -CantBeNullOrPositive CantConvertToReducAnInvoiceOfThisType CardFichinter CardProduct diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index e6f04f74572..01f77814edf 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -612,6 +612,7 @@ DisabledBecauseNotLastInCycle=The next situation already exists. DisabledBecauseFinal=This situation is final. situationInvoiceShortcode_AS=AS situationInvoiceShortcode_S=S +CantBeNullOrPositive=The progress of a credit note invoice can't be null or positive CantBeLessThanMinPercent=The progress can't be smaller than its value in the previous situation. NoSituations=No open situations InvoiceSituationLast=Final and general invoice From b4f06c8f1c49209072860e249aec4ccbc931ba63 Mon Sep 17 00:00:00 2001 From: NefiteTifall | Nicolas Date: Tue, 11 Feb 2025 10:20:23 +0100 Subject: [PATCH 336/375] =?UTF-8?q?=F0=9F=94=A7=20Remove=20escape?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Eliminated unnecessary escaping of help text in button titles, simplifying the code and ensuring that the title attribute directly uses the provided help text without modification. --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b21a6f45fe9..0c3ce6892f0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13024,7 +13024,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u ); if (!empty($helpText)) { - $attr['title'] = dol_escape_php($helpText); + $attr['title'] = $helpText; } elseif ($label) { // empty($attr['title']) && $attr['title'] = $label; $useclassfortooltip = 0; From 39a844ff9beb5c5927ea13ed5fcaabd95a033156 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 11 Feb 2025 10:20:45 +0100 Subject: [PATCH 337/375] Fix CI --- htdocs/admin/propal_pdf.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/propal_pdf.php b/htdocs/admin/propal_pdf.php index 470cc328345..b8fea1c31f9 100644 --- a/htdocs/admin/propal_pdf.php +++ b/htdocs/admin/propal_pdf.php @@ -186,7 +186,8 @@ print 'propal->dir_output.'/'.$termofsale)) { - print '
'.$termofsale.''.$formfile->showPreview(array("name" => $termofsale), $modulepart, $termofsale, 0, ''); + $file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale); + print '
'.$termofsale.''.$formfile->showPreview($file, $modulepart, $termofsale, 0, ''); print ''; } } From d29fff8a13d18ac8b5e2fce2369a67fab75652a4 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 11 Feb 2025 10:27:47 +0100 Subject: [PATCH 338/375] Fix CI --- htdocs/admin/propal_pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/propal_pdf.php b/htdocs/admin/propal_pdf.php index b8fea1c31f9..5dc4e5064e4 100644 --- a/htdocs/admin/propal_pdf.php +++ b/htdocs/admin/propal_pdf.php @@ -187,7 +187,7 @@ if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) { $termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE"); if (file_exists($conf->propal->dir_output.'/'.$termofsale)) { $file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale); - print '
'.$termofsale.''.$formfile->showPreview($file, $modulepart, $termofsale, 0, ''); + print '
'.$termofsale.''.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, ''); print ''; } } From 9055ab3b4c908447ad84b2c9b4cfc98119e148b9 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 10:55:34 +0100 Subject: [PATCH 339/375] css --- htdocs/theme/eldy/global.inc.php | 4 ++-- htdocs/theme/md/style.css.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 082c4bc1ff5..2b42d7f9937 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -5509,8 +5509,8 @@ div.boximport { .fieldrequired { font-weight: bold; color: var(--fieldrequiredcolor) !important; } -td.widthpictotitle, .table-fiche-title img.widthpictotitle { width: 38px; text-align: ; } -span.widthpictotitle { font-size: 1.7em; } +td.widthpictotitle, .table-fiche-title img.widthpictotitle { width: 34px; text-align: ; } +span.widthpictotitle { font-size: 1.5em; } table.titlemodulehelp tr td img.widthpictotitle { width: 80px; } .dolgraphtitle { margin-top: 6px; margin-bottom: 4px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index afa4c41ddf7..185e9916abb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2835,7 +2835,7 @@ td.nobordernopadding.widthpictotitle.col-picto { width: 14px; } span.widthpictotitle { - font-size: 1.3em; + font-size: 1em; } .table-list-of-attached-files .col-picto, .table-list-of-links .col-picto { opacity: 0.7 !important; From a4e39ba1be5e2fb50dc4702686d619489c61f1d2 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 11:01:24 +0100 Subject: [PATCH 340/375] Debug v21 --- htdocs/core/lib/functions.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0c3ce6892f0..87edd5fc92e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13001,7 +13001,7 @@ function getFieldErrorIcon($fieldValidationErrorMsg) */ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $url = '', $id = '', $status = 1, $params = array()) { - global $langs, $conf, $user; + global $langs, $user; // Actually this conf is used in css too for external module compatibility and smooth transition to this function if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin) && $status <= 0) { @@ -13038,9 +13038,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u $attr['href'] = ''; if ($status == -1) { // disable - $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("FeatureDisabled")); + $attr['title'] = $langs->transnoentitiesnoconv("FeatureDisabled"); } elseif ($status == 0) { // Not enough permissions - $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")); + $attr['title'] = $langs->transnoentitiesnoconv("NotEnoughPermissions"); } } @@ -13071,6 +13071,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u // TODO : add a hook + // Generate attributes with escapement $TCompiledAttr = array(); foreach ($attr as $key => $value) { $TCompiledAttr[] = $key.'="'.dol_escape_htmltag($value).'"'; // Do not use dolPrintHTMLForAttribute() here, we must accept "javascript:string" From e090f09cedb02a51cd84f85265f3e0c46da5817a Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 11:01:24 +0100 Subject: [PATCH 341/375] Debug v21 --- htdocs/core/lib/functions.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 7f9633a2d8e..b5f9b289561 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12995,7 +12995,7 @@ function getFieldErrorIcon($fieldValidationErrorMsg) */ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $url = '', $id = '', $status = 1, $params = array()) { - global $langs, $conf, $user; + global $langs, $user; // Actually this conf is used in css too for external module compatibility and smooth transition to this function if (getDolGlobalString('MAIN_BUTTON_HIDE_UNAUTHORIZED') && (!$user->admin) && $status <= 0) { @@ -13032,9 +13032,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u $attr['href'] = ''; if ($status == -1) { // disable - $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("FeatureDisabled")); + $attr['title'] = $langs->transnoentitiesnoconv("FeatureDisabled"); } elseif ($status == 0) { // Not enough permissions - $attr['title'] = dol_escape_htmltag($langs->transnoentitiesnoconv("NotEnoughPermissions")); + $attr['title'] = $langs->transnoentitiesnoconv("NotEnoughPermissions"); } } @@ -13065,6 +13065,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u // TODO : add a hook + // Generate attributes with escapement $TCompiledAttr = array(); foreach ($attr as $key => $value) { $TCompiledAttr[] = $key.'="'.dol_escape_htmltag($value).'"'; // Do not use dolPrintHTMLForAttribute() here, we must accept "javascript:string" From e76c3961782caa1c70ba454521ffebe2978c01a4 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 11:03:10 +0100 Subject: [PATCH 342/375] Debug v21 --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b5f9b289561..7f9379d1116 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -13018,7 +13018,7 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u ); if (!empty($helpText)) { - $attr['title'] = dol_escape_htmltag($helpText); + $attr['title'] = $helpText; } elseif ($label) { // empty($attr['title']) && $attr['title'] = $label; $useclassfortooltip = 0; From 9264608bb50e36e418b813861f1fc1e3d4a01709 Mon Sep 17 00:00:00 2001 From: Dolibot Date: Tue, 11 Feb 2025 12:06:50 +0000 Subject: [PATCH 343/375] PHPStan > Update baseline --- dev/build/phpstan/phpstan-baseline.neon | 304 +----------------------- 1 file changed, 2 insertions(+), 302 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 8e8123cefb0..46ea0b4ff05 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -9627,7 +9627,7 @@ parameters: - message: '#^Parameter \#1 \$array of function dol_sort_array contains unresolvable type\.$#' identifier: argument.unresolvableType - count: 4 + count: 3 path: ../../../htdocs/core/class/html.form.class.php - @@ -9660,12 +9660,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.form.class.php - - - message: '#^Property Form\:\:\$cache_availability has no type specified\.$#' - identifier: missingType.property - count: 1 - path: ../../../htdocs/core/class/html.form.class.php - - message: '#^Property Form\:\:\$cache_conditions_paiements has no type specified\.$#' identifier: missingType.property @@ -9711,7 +9705,7 @@ parameters: - message: '#^Return type of call to function dol_sort_array contains unresolvable type\.$#' identifier: function.unresolvableReturnType - count: 4 + count: 3 path: ../../../htdocs/core/class/html.form.class.php - @@ -9762,12 +9756,6 @@ parameters: count: 1 path: ../../../htdocs/core/class/html.formcompany.class.php - - - message: '#^Call to function is_numeric\(\) with float\|int\\|int\<1, max\>\|\(non\-falsy\-string&numeric\-string\) will always evaluate to true\.$#' - identifier: function.alreadyNarrowedType - count: 1 - path: ../../../htdocs/core/class/html.formcompany.class.php - - message: '#^Parameter \#1 \$array of function dol_sort_array contains unresolvable type\.$#' identifier: argument.unresolvableType @@ -13410,12 +13398,6 @@ parameters: count: 2 path: ../../../htdocs/core/modules/printsheet/doc/pdf_tcpdflabel.class.php - - - message: '#^Property Product\:\:\$weight_units \(int\|string\) in isset\(\) is not nullable\.$#' - identifier: isset.property - count: 1 - path: ../../../htdocs/core/modules/product/doc/pdf_standard.modules.php - - message: '#^Method ModeleProductCode\:\:liste_modeles\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -13440,12 +13422,6 @@ parameters: count: 1 path: ../../../htdocs/core/modules/project/doc/pdf_baleine.modules.php - - - message: '#^Comparison operation "\>\=" between int\<0, max\> and 0 is always true\.$#' - identifier: greaterOrEqual.alwaysTrue - count: 1 - path: ../../../htdocs/core/modules/project/doc/pdf_beluga.modules.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -21618,12 +21594,6 @@ parameters: count: 2 path: ../../../htdocs/product/admin/product.php - - - message: '#^Variable \$mc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/admin/product.php - - message: '#^Variable \$obj might not be defined\.$#' identifier: variable.undefined @@ -21684,12 +21654,6 @@ parameters: count: 1 path: ../../../htdocs/product/card.php - - - message: '#^Variable \$prod might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/card.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -22218,18 +22182,6 @@ parameters: count: 1 path: ../../../htdocs/product/document.php - - - message: '#^Variable \$upload_dir might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/document.php - - - - message: '#^Variable \$upload_dirold might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/document.php - - message: '#^Negated boolean expression is always true\.$#' identifier: booleanNot.alwaysTrue @@ -22308,12 +22260,6 @@ parameters: count: 1 path: ../../../htdocs/product/inventory/card.php - - - message: '#^Variable \$text might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/inventory/card.php - - message: '#^Call to function method_exists\(\) with \$this\(Inventory\) and ''getLibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -22338,18 +22284,6 @@ parameters: count: 2 path: ../../../htdocs/product/list.php - - - message: '#^Variable \$perm might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/list.php - - - - message: '#^Variable \$workstation_static might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/product/list.php - - message: '#^Loose comparison using \=\= between ''add_customer_price'' and ''add_customer_price'' will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -22374,12 +22308,6 @@ parameters: count: 2 path: ../../../htdocs/product/price.php - - - message: '#^Parameter \#4 \$txtva of function calcul_price_total expects float, string given\.$#' - identifier: argument.type - count: 2 - path: ../../../htdocs/product/price.php - - message: '#^Result of && is always false\.$#' identifier: booleanAnd.alwaysFalse @@ -22410,24 +22338,12 @@ parameters: count: 1 path: ../../../htdocs/product/price.php - - - message: '#^Variable \$ii might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/price.php - - message: '#^Variable \$lineid might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/product/price.php - - - message: '#^Variable \$maxpricesupplier might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/price.php - - message: '#^Variable \$obj might not be defined\.$#' identifier: variable.undefined @@ -22446,12 +22362,6 @@ parameters: count: 2 path: ../../../htdocs/product/price.php - - - message: '#^Variable \$soc might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/price.php - - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue @@ -22662,24 +22572,6 @@ parameters: count: 1 path: ../../../htdocs/product/stats/supplier_proposal.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/card.php - - - - message: '#^Variable \$lastmovementdate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/card.php - - - - message: '#^Variable \$pricemin might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/card.php - - message: '#^Method StockMovements\:\:index\(\) return type has no value type specified in iterable type array\.$#' identifier: missingType.iterableValue @@ -22866,12 +22758,6 @@ parameters: count: 2 path: ../../../htdocs/product/stock/info.php - - - message: '#^Variable \$formproject might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/info.php - - message: '#^Variable \$socid might not be defined\.$#' identifier: variable.undefined @@ -22986,12 +22872,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$comref might not be defined\.$#' identifier: variable.undefined @@ -23016,18 +22896,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$eatby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/movement_card.php - - - - message: '#^Variable \$lastmovementdate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$massaction might not be defined\.$#' identifier: variable.undefined @@ -23040,36 +22908,12 @@ parameters: count: 3 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$result1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - - - message: '#^Variable \$result2 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$sall might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/product/stock/movement_card.php - - - message: '#^Variable \$sellby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/movement_card.php - - - - message: '#^Variable \$srcwarehouseid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/movement_card.php - - message: '#^Variable \$toselect might not be defined\.$#' identifier: variable.undefined @@ -23184,42 +23028,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/product.php - - - message: '#^Variable \$batch might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$eatby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$lastmovementdate might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$result1 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$result2 might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$sellby might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/product.php - - message: '#^Variable \$sortfield might not be defined\.$#' identifier: variable.undefined @@ -23232,18 +23040,6 @@ parameters: count: 1 path: ../../../htdocs/product/stock/product.php - - - message: '#^Variable \$srcwarehouseid might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/product.php - - - - message: '#^Variable \$variants might not be defined\.$#' - identifier: variable.undefined - count: 3 - path: ../../../htdocs/product/stock/product.php - - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue @@ -23268,36 +23064,18 @@ parameters: count: 1 path: ../../../htdocs/product/stock/replenish.php - - - message: '#^Variable \$lastWarehouseID might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/product/stock/replenish.php - - message: '#^Variable \$contextpage in empty\(\) always exists and is not falsy\.$#' identifier: empty.variable count: 1 path: ../../../htdocs/product/stock/replenishorders.php - - - message: '#^Variable \$nbofmovement might not be defined\.$#' - identifier: variable.undefined - count: 2 - path: ../../../htdocs/product/stock/stockatdate.php - - message: '#^Variable \$resql might not be defined\.$#' identifier: variable.undefined count: 1 path: ../../../htdocs/product/stock/stockatdate.php - - - message: '#^Variable \$virtualstock might not be defined\.$#' - identifier: variable.undefined - count: 4 - path: ../../../htdocs/product/stock/stockatdate.php - - message: '#^Call to function property_exists\(\) with \$this\(StockTransfer\) and ''socid'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -23466,42 +23244,6 @@ parameters: count: 1 path: ../../../htdocs/projet/activity/perday.php - - - message: '#^Parameter \#11 \$isavailable of function projectLinesPerDay expects array\, afternoon\: int\<0, 1\>\}\>, non\-empty\-array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#4 \$month of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#5 \$day of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#6 \$projectsrole of function projectLinesPerDay expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#6 \$year of function dol_mktime expects int, array\\|string given\.$#' - identifier: argument.type - count: 4 - path: ../../../htdocs/projet/activity/perday.php - - - - message: '#^Parameter \#7 \$tasksrole of function projectLinesPerDay expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perday.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -23538,18 +23280,6 @@ parameters: count: 1 path: ../../../htdocs/projet/activity/permonth.php - - - message: '#^Parameter \#7 \$projectsrole of function projectLinesPerMonth expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/permonth.php - - - - message: '#^Parameter \#8 \$tasksrole of function projectLinesPerMonth expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/permonth.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -23586,24 +23316,6 @@ parameters: count: 1 path: ../../../htdocs/projet/activity/perweek.php - - - message: '#^Parameter \#11 \$isavailable of function projectLinesPerWeek expects array\, afternoon\: int\<0, 1\>\}\>, non\-empty\-array\ given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perweek.php - - - - message: '#^Parameter \#7 \$projectsrole of function projectLinesPerWeek expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perweek.php - - - - message: '#^Parameter \#8 \$tasksrole of function projectLinesPerWeek expects string, array\\|int given\.$#' - identifier: argument.type - count: 1 - path: ../../../htdocs/projet/activity/perweek.php - - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse @@ -23934,12 +23646,6 @@ parameters: count: 1 path: ../../../htdocs/projet/contact.php - - - message: '#^Variable \$formconfirmtoaddtasks might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/projet/contact.php - - message: '#^Call to function method_exists\(\) with Project and ''fetchComments'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType @@ -24012,12 +23718,6 @@ parameters: count: 1 path: ../../../htdocs/projet/ganttview.php - - - message: '#^Variable \$userWrite might not be defined\.$#' - identifier: variable.undefined - count: 1 - path: ../../../htdocs/projet/ganttview.php - - message: '#^Variable \$colorseries might not be defined\.$#' identifier: variable.undefined From 1c24333b57483370db10f1cb5257ddf1b6c799c6 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 11 Feb 2025 14:46:46 +0100 Subject: [PATCH 344/375] fix Ci --- htdocs/website/index.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index bc96a9213d4..9f003cd8a3b 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1958,14 +1958,16 @@ if ($action == "updatesecurity" && $usercanedit && GETPOST("btn_WEBSITE_SECURITY } if (!$error) { $directivetype = $directivesarray[$directivecsp]["data-directivetype"]; - $sourcetype = $sourcesarray[$directivetype][$sourcecsp]["data-sourcetype"]; + if (isset($sourcecsp)) { + $sourcetype = $sourcesarray[$directivetype][$sourcecsp]["data-sourcetype"]; + } $securityspstring = ""; - if ($sourcetype == "data") { + if (isset($sourcetype) && $sourcetype == "data") { if (empty($forceCSPArr[$directivecsp]["data"])) { $forceCSPArr[$directivecsp]["data"] = array(); } $forceCSPArr[$directivecsp]["data"][] = $sourcedatacsp; - } elseif ($sourcetype == "input") { + } elseif (isset($sourcetype) && $sourcetype == "input") { if (empty($forceCSPArr[$directivecsp])) { $forceCSPArr[$directivecsp] = array(); } @@ -1984,10 +1986,12 @@ if ($action == "updatesecurity" && $usercanedit && GETPOST("btn_WEBSITE_SECURITY } else { $directivetype = $directivesarray[$directive]["data-directivetype"]; $sourcetype = $sourcesarray[$directivetype][$source]["data-sourcetype"]; - if ($sourcetype == "quoted") { - $sourcestring .= " '".$source."'"; - } elseif ($directivetype != "none") { - $sourcestring .= " ".$source; + if (isset($sourcetype)) { + if ($sourcetype == "quoted") { + $sourcestring .= " '".$source."'"; + } elseif ($directivetype != "none") { + $sourcestring .= " ".$source; + } } } } From 44807b14523d1f3a2cc492044444afd80e700e14 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 11 Feb 2025 14:54:50 +0100 Subject: [PATCH 345/375] Fix Ci + error --- htdocs/website/index.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index a8fa5fd367e..ef151c5ef9c 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1973,6 +1973,9 @@ if ($action == "updatesecurity" && $usercanedit && GETPOST("btn_WEBSITE_SECURITY } $forceCSPArr[$directivecsp] = array_merge(explode(" ", $sourcedatacsp), $forceCSPArr[$directivecsp]); } else { + if (empty($forceCSPArr[$directivecsp])) { + $forceCSPArr[$directivecsp] = array(); + } array_unshift($forceCSPArr[$directivecsp], $sourcecsp); } foreach ($forceCSPArr as $directive => $sourcekeys) { @@ -1986,12 +1989,10 @@ if ($action == "updatesecurity" && $usercanedit && GETPOST("btn_WEBSITE_SECURITY } else { $directivetype = $directivesarray[$directive]["data-directivetype"]; $sourcetype = $sourcesarray[$directivetype][$source]["data-sourcetype"]; - if (isset($sourcetype)) { - if ($sourcetype == "quoted") { - $sourcestring .= " '".$source."'"; - } elseif ($directivetype != "none") { - $sourcestring .= " ".$source; - } + if (isset($sourcetype) && $sourcetype == "quoted") { + $sourcestring .= " '".$source."'"; + } elseif ($directivetype != "none") { + $sourcestring .= " ".$source; } } } From 8a1ff96622814ec3e3478be833a5125bebceb29a Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 11 Feb 2025 15:10:28 +0100 Subject: [PATCH 346/375] try fix CI --- htdocs/website/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/website/index.php b/htdocs/website/index.php index ef151c5ef9c..6e23d4a8b60 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -1976,6 +1976,9 @@ if ($action == "updatesecurity" && $usercanedit && GETPOST("btn_WEBSITE_SECURITY if (empty($forceCSPArr[$directivecsp])) { $forceCSPArr[$directivecsp] = array(); } + if (!isset($sourcecsp)) { + $sourcecsp = ""; + } array_unshift($forceCSPArr[$directivecsp], $sourcecsp); } foreach ($forceCSPArr as $directive => $sourcekeys) { From 6f87dc441e77024826c2a3b1459016fd56d67834 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 15:27:37 +0100 Subject: [PATCH 347/375] Debug v21 --- htdocs/core/lib/admin.lib.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 1bf8f9e06b8..7d9beb89411 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1941,9 +1941,9 @@ function form_constantes($tableau, $strictw3c = 2, $helptext = '', $text = 'Valu */ function showModulesExludedForExternal($modules) { - global $conf, $langs; + global $langs; - $text = $langs->trans("OnlyFollowingModulesAreOpenedToExternalUsers"); + $text = $langs->transnoentitiesnoconv("OnlyFollowingModulesAreOpenedToExternalUsers"); $listofmodules = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL')); // List of modules qualified for external user management $i = 0; @@ -1967,11 +1967,11 @@ function showModulesExludedForExternal($modules) } $i++; - $tmptext = $langs->trans('Module'.$module->numero.'Name'); + $tmptext = $langs->transnoentitiesnoconv('Module'.$module->numero.'Name'); if ($tmptext != 'Module'.$module->numero.'Name') { - $text .= $langs->trans('Module'.$module->numero.'Name'); + $text .= $langs->transnoentitiesnoconv('Module'.$module->numero.'Name'); } else { - $text .= $langs->trans($module->name); + $text .= $langs->transnoentitiesnoconv($module->name); } } } From 5401791247322cd9ea17af8ffa7e95fc2bd81dfa Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 15:40:47 +0100 Subject: [PATCH 348/375] Debug v21 --- htdocs/core/lib/product.lib.php | 37 +++++++++++++++++++------------- htdocs/product/admin/product.php | 4 +++- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/htdocs/core/lib/product.lib.php b/htdocs/core/lib/product.lib.php index f13d2df07b8..1c9b0910bc0 100644 --- a/htdocs/core/lib/product.lib.php +++ b/htdocs/core/lib/product.lib.php @@ -328,7 +328,7 @@ function productlot_prepare_head($object) */ function product_admin_prepare_head() { - global $langs, $conf, $user, $db; + global $langs, $conf, $db; $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label('product'); @@ -368,24 +368,31 @@ function product_admin_prepare_head() $head[$h][2] = 'attributes'; $h++; - $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_price_extrafields.php'; - $head[$h][1] = $langs->trans("ProductLevelExtraFields"); - $nbExtrafields = $extrafields->attributes['product_price']['count']; - if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + // Extrafields for price levels + if (getDolGlobalString('PRODUIT_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES')) { + $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_price_extrafields.php'; + $head[$h][1] = $langs->trans("ProductLevelExtraFields"); + $nbExtrafields = $extrafields->attributes['product_price']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } + $head[$h][2] = 'levelAttributes'; + $h++; } - $head[$h][2] = 'levelAttributes'; - $h++; - $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_customer_extrafields.php'; - $head[$h][1] = $langs->trans("ProductCustomerExtraFields"); - $nbExtrafields = $extrafields->attributes['product_customer_price']['count']; - if ($nbExtrafields > 0) { - $head[$h][1] .= ''.$nbExtrafields.''; + //Extrafields for price per customer + if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES')) { + $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_customer_extrafields.php'; + $head[$h][1] = $langs->trans("ProductCustomerExtraFields"); + $nbExtrafields = $extrafields->attributes['product_customer_price']['count']; + if ($nbExtrafields > 0) { + $head[$h][1] .= ''.$nbExtrafields.''; + } + $head[$h][2] = 'customerAttributes'; + $h++; } - $head[$h][2] = 'customerAttributes'; - $h++; + // Supplier prices $head[$h][0] = DOL_URL_ROOT.'/product/admin/product_supplier_extrafields.php'; $head[$h][1] = $langs->trans("ProductSupplierExtraFields"); $nbExtrafields = $extrafields->attributes['product_fournisseur_price']['count']; diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index d38409f9eaa..742e4a8de52 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -122,9 +122,11 @@ if ($action == 'other') { if ($tmprule == $princingrules) { // We are on selected rule, we enable it if ($princingrules == 'PRODUCT_PRICE_UNIQ') { // For this case, we disable entries manually $res = dolibarr_set_const($db, 'PRODUIT_MULTIPRICES', 0, 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES', 0, 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_AND_MULTIPRICES', 0, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_BY_QTY', 0, 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'PRODUIT_CUSTOMER_PRICES_BY_QTY_MULTIPRICES', 0, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, 'PRODUCT_PRICE_UNIQ', 1, 'chaine', 0, '', $conf->entity); } else { $multirule = explode('&', $princingrules); From ef802d426ed27e1ac865ea57c6e277c8f9ea0850 Mon Sep 17 00:00:00 2001 From: Norbert Penel Date: Tue, 11 Feb 2025 15:44:46 +0100 Subject: [PATCH 349/375] not enough test can be a problem with objects who don't have required socid Furthermore it is impossible to unset a property : https://www.php.net/manual/en/function.property-exists.php#116824 --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b8b04f032aa..53a60c21064 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5387,7 +5387,7 @@ abstract class CommonObject // Define output language and label if (getDolGlobalInt('MAIN_MULTILANGS')) { - if (property_exists($this, 'socid') && !is_object($this->thirdparty)) { + if (property_exists($this, 'socid') && !empty($this->socid) && !is_object($this->thirdparty)) { dol_print_error(null, 'Error: Method printObjectLine was called on an object and object->fetch_thirdparty was not done before'); return; } From d6aac69d90ecbd711175c9f1a459efbfd6993f7f Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 16:28:37 +0100 Subject: [PATCH 350/375] Debug v21 --- htdocs/commande/class/commande.class.php | 17 +++++++++++------ htdocs/commande/list.php | 14 +++++++++----- htdocs/langs/en_US/errors.lang | 1 + 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a3fb1c4d3e2..b18bcac8aca 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -113,9 +113,16 @@ class Commande extends CommonOrder /** * Status of the order * @var int + * @deprecated Use status */ public $statut; + /** + * Status of the order + * @var int + */ + public $status; + /** * @var int Status Billed or not */ @@ -792,12 +799,10 @@ class Commande extends CommonOrder * * @param User $user Object user that close * @param int $notrigger 1=Does not execute triggers, 0=Execute triggers - * @return int Return integer <0 if KO, >0 if OK + * @return int Return integer <0 if KO, 0=Nothing done, >0 if OK */ public function cloture($user, $notrigger = 0) { - global $conf; - $error = 0; $usercanclose = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'creer')) @@ -1890,7 +1895,7 @@ class Commande extends CommonOrder return -1; } - $sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_user_modif, c.fk_statut'; + $sql = 'SELECT c.rowid, c.entity, c.date_creation, c.ref, c.fk_soc, c.fk_user_author, c.fk_user_valid, c.fk_user_modif, c.fk_statut as status'; $sql .= ', c.amount_ht, c.total_ht, c.total_ttc, c.total_tva, c.localtax1 as total_localtax1, c.localtax2 as total_localtax2, c.fk_cond_reglement, c.deposit_percent, c.fk_mode_reglement, c.fk_availability, c.fk_input_reason'; $sql .= ', c.fk_account'; $sql .= ', c.date_commande, c.date_valid, c.tms'; @@ -1946,8 +1951,8 @@ class Commande extends CommonOrder $this->fk_project = $obj->fk_project; $this->project = null; // Clear if another value was already set by fetch_projet - $this->statut = $obj->fk_statut; - $this->status = $obj->fk_statut; + $this->statut = $obj->status; + $this->status = $obj->status; $this->user_author_id = $obj->fk_user_author; $this->user_creation_id = $obj->fk_user_author; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 245c4f4072f..b5d9785da63 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -766,14 +766,16 @@ if (empty($reshook)) { } } } + if ($action == 'validate' && $permissiontoadd && $objectclass !== null) { if (GETPOST('confirm') == 'yes') { + /** @var Commande $objecttmp */ $objecttmp = new $objectclass($db); $db->begin(); $error = 0; foreach ($toselect as $checked) { if ($objecttmp->fetch($checked)) { - if ($objecttmp->statut == 0) { + if ($objecttmp->status == $objecttmp::STATUS_DRAFT) { if (!empty($objecttmp->fk_warehouse)) { $idwarehouse = $objecttmp->fk_warehouse; } else { @@ -804,21 +806,23 @@ if ($action == 'validate' && $permissiontoadd && $objectclass !== null) { } if ($action == 'shipped' && $permissiontoadd && $objectclass !== null) { if (GETPOST('confirm') == 'yes') { + /** @var Commande $objecttmp */ $objecttmp = new $objectclass($db); $db->begin(); $error = 0; foreach ($toselect as $checked) { if ($objecttmp->fetch($checked)) { - if ($objecttmp->statut == 1 || $objecttmp->statut == 2) { - if ($objecttmp->cloture($user)) { + if ($objecttmp->status == $objecttmp::STATUS_VALIDATED || $objecttmp->status == $objecttmp::STATUS_SHIPMENTONPROCESS || $objecttmp->status == $objecttmp::STATUS_CLOSED) { + $result = $objecttmp->cloture($user); + if ($result > 0) { setEventMessages($langs->trans('StatusOrderDelivered', $objecttmp->ref), null, 'mesgs'); - } else { + } elseif ($result < 0) { setEventMessages($langs->trans('ErrorOrderStatusCantBeSetToDelivered'), null, 'errors'); $error++; } } else { $langs->load("errors"); - setEventMessages($langs->trans('ErrorIsNotADraft', $objecttmp->ref), null, 'errors'); + setEventMessages($langs->trans('ErrorObjectHasWrongStatus', $objecttmp->ref), null, 'errors'); $error++; } } else { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index ed6c0f707c8..fc7a83c44e6 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -232,6 +232,7 @@ ErrorBadLinkSourceSetButBadValueForRef=The link you use is not valid. A 'source' ErrorTooManyErrorsProcessStopped=Too many errors. Process was stopped. ErrorMassValidationNotAllowedWhenStockIncreaseOnAction=Mass validation is not possible when option to increase/decrease stock is set on this action (you must validate one by one so you can define the warehouse to increase/decrease) ErrorObjectMustHaveStatusDraftToBeValidated=Object %s must have status 'Draft' to be validated. +ErrorObjectHasWrongStatus=Object %s must have another status for this operation. ErrorObjectMustHaveLinesToBeValidated=Object %s must have lines to be validated. ErrorOnlyInvoiceValidatedCanBeSentInMassAction=Only validated invoices can be sent using the "Send by email" mass action. ErrorChooseBetweenFreeEntryOrPredefinedProduct=You must choose if article is a predefined product or not From edea44bccba3e580950b1f8310891b416bef3c68 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Tue, 11 Feb 2025 17:12:15 +0100 Subject: [PATCH 351/375] FIX display full tree on shipment card when a kit contains a same component in other sub-kit --- htdocs/product/class/product.class.php | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4860fe9c34a..7f8de67a96a 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4966,8 +4966,6 @@ class Product extends CommonObject */ public function getChildsArbo($id, $firstlevelonly = 0, $level = 1, $parents = array()) { - global $alreadyfound; - if (empty($id)) { return array(); } @@ -4984,9 +4982,6 @@ class Product extends CommonObject dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents)?implode(',', $parents):$parents), LOG_DEBUG); - if ($level == 1) { - $alreadyfound = array($id=>1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediatly - } // Protection against infinite loop if ($level > 30) { return array(); @@ -4995,14 +4990,16 @@ class Product extends CommonObject $res = $this->db->query($sql); if ($res) { $prods = array(); + if ($this->db->num_rows($res) > 0) { + $parents[] = $id; + } + while ($rec = $this->db->fetch_array($res)) { - if (!empty($alreadyfound[$rec['rowid']])) { + if (in_array($rec['id'], $parents)) { dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING); - if (in_array($rec['id'], $parents)) { - continue; // We discard this child if it is already found at a higher level in tree in the same branch. - } + continue; // We discard this child if it is already found at a higher level in tree in the same branch. } - $alreadyfound[$rec['rowid']] = 1; + $prods[$rec['rowid']] = array( 0=>$rec['rowid'], 1=>$rec['qty'], @@ -5016,7 +5013,6 @@ class Product extends CommonObject //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); if (empty($firstlevelonly)) { - $parents[] = $rec['rowid']; $listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1, $parents); foreach ($listofchilds as $keyChild => $valueChild) { $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; From 2fc2e045be168834a6751adea6ac77606e3f3359 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 18:45:39 +0100 Subject: [PATCH 352/375] NEW Add link to create shipment on picto --- htdocs/commande/list.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 59148913edd..e588d00475f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -151,7 +151,7 @@ $search_deliveryyear = ''; $search_import_key = trim(GETPOST("search_import_key", "alpha")); -$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; +$diroutputmassaction = $conf->order->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; // Load variable for pagination $limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit; @@ -376,7 +376,7 @@ if (empty($reshook)) { $permissiontocancel = $user->hasRight("commande", "creer"); $permissiontosendbymail = $user->hasRight("commande", "creer"); } - $uploaddir = $conf->commande->multidir_output[$conf->entity]; + $uploaddir = $conf->order->multidir_output[$conf->entity]; $triggersendname = 'ORDER_SENTBYMAIL'; $year = ""; $month = ""; @@ -997,7 +997,7 @@ if ($search_status != '') { } } if ($search_option == 'late') { - $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'"; + $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'"; } if ($search_datecloture_start) { $sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'"; @@ -2294,7 +2294,7 @@ while ($i < $imaxinloop) { print $generic_commande->getNomUrl(1, $getNomUrlOption, 0, 0, 0, 1, 1); $filename = dol_sanitizeFileName($obj->ref); - $filedir = $conf->commande->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); + $filedir = $conf->order->multidir_output[$conf->entity].'/'.dol_sanitizeFileName($obj->ref); $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid; print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); @@ -2882,8 +2882,10 @@ while ($i < $imaxinloop) { } } - if ($nbprod) { + if ($nbprod) { // If there is at least one product to ship, we show the shippable icon + print ''; print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2); + print ''; } if ($warning) { // Always false in default mode print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders').'
'.$text_warning, 2, 1, img_picto('', 'error'), '', 2); From dd9655c22cc5fffb57862337a87b18293aec712f Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 18:49:30 +0100 Subject: [PATCH 353/375] Debug v21 --- htdocs/fourn/commande/list.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index 5fd1c22b0ce..17e43f5f1c5 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -2063,7 +2063,11 @@ if ($resql) { } // Billed if (!empty($arrayfields['cf.billed']['checked'])) { - print ''.yn($obj->billed).''; + print ''; + if ($obj->billed) { + print yn($obj->billed, $langs->trans("Billed")); + } + print ''; if (!$i) { $totalarray['nbfield']++; } From 3327875ee4939d0b081f534348c236cbe45ee27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 11 Feb 2025 20:22:06 +0100 Subject: [PATCH 354/375] fix phpstan --- dev/build/phpstan/phpstan-baseline.neon | 12 ------------ htdocs/public/members/public_card.php | 6 +++++- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 8e8123cefb0..6c2b779f38a 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -24744,18 +24744,6 @@ parameters: count: 1 path: ../../../htdocs/public/members/public_card.php - - - message: '#^Variable \$db might not be defined\.$#' - identifier: variable.undefined - count: 5 - path: ../../../htdocs/public/members/public_card.php - - - - message: '#^Variable \$langs might not be defined\.$#' - identifier: variable.undefined - count: 17 - path: ../../../htdocs/public/members/public_card.php - - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index ed2a67f24ee..a9adb98c407 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -4,7 +4,7 @@ * Copyright (C) 2007-2012 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -52,6 +52,10 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; +/** + * @var DoliDB $db + * @var Translate $langs + */ // Security check if (!isModEnabled('member')) { From cba2737c3760f225a32522c53655af3ed47c8bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Tue, 11 Feb 2025 20:28:41 +0100 Subject: [PATCH 355/375] fix phpstan --- htdocs/societe/canvas/company/tpl/card_view.tpl.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php index f1246e4bb66..9526b60176a 100644 --- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -19,6 +19,7 @@ * @var Canvas $this * @var Conf $conf * @var CommonObject $this + * @var DoliDB $db * @var Translate $langs * @var User $user * From ad8f6f75e634bff886f70da0d8ce16ee8f08af0b Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 20:32:05 +0100 Subject: [PATCH 356/375] Debug v21 --- htdocs/projet/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index c606b0d14f1..b905b0e51bf 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1503,7 +1503,7 @@ if (!empty($arrayfields['s.name_alias']['checked'])) { $totalarray['nbfield']++; } if (!empty($arrayfields['co.country_code']['checked'])) { - print_liste_field_titre($arrayfields['co.country_code']['label'], $_SERVER["PHP_SELF"], "co.country_code", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['co.country_code']['label'], $_SERVER["PHP_SELF"], "country.code", "", $param, "", $sortfield, $sortorder); $totalarray['nbfield']++; } if (!empty($arrayfields['commercial']['checked'])) { @@ -1875,7 +1875,7 @@ while ($i < $imaxinloop) { } // Country code if (!empty($arrayfields['co.country_code']['checked'])) { - print ''; + print ''; print $obj->country_code; print ''; if (!$i) { From 37c8f6436644d1f9b431ee70dac6cef3ed75c19b Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 20:35:23 +0100 Subject: [PATCH 357/375] Debug v21 --- htdocs/projet/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index b905b0e51bf..9eebe13d211 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -1503,7 +1503,7 @@ if (!empty($arrayfields['s.name_alias']['checked'])) { $totalarray['nbfield']++; } if (!empty($arrayfields['co.country_code']['checked'])) { - print_liste_field_titre($arrayfields['co.country_code']['label'], $_SERVER["PHP_SELF"], "country.code", "", $param, "", $sortfield, $sortorder); + print_liste_field_titre($arrayfields['co.country_code']['label'], $_SERVER["PHP_SELF"], "country.code", "", $param, "", $sortfield, $sortorder, 'center '); $totalarray['nbfield']++; } if (!empty($arrayfields['commercial']['checked'])) { From 288aca6423ad18d9cf21d74ab44d6254428fbd61 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 11 Feb 2025 02:12:49 +0100 Subject: [PATCH 358/375] Qual: Fix phan (project-2) --- dev/tools/phan/baseline.txt | 22 +++---- htdocs/compta/facture/class/facture.class.php | 8 +-- htdocs/core/class/commonobject.class.php | 16 ++--- htdocs/core/class/html.form.class.php | 4 +- .../class/html.formintervention.class.php | 5 +- htdocs/projet/class/projectstats.class.php | 2 +- htdocs/projet/class/task.class.php | 20 +++---- htdocs/projet/stats/index.php | 6 +- htdocs/projet/tasks.php | 49 +++++++-------- htdocs/projet/tasks/comment.php | 4 +- htdocs/projet/tasks/contact.php | 7 ++- htdocs/projet/tasks/document.php | 3 +- htdocs/projet/tasks/list.php | 58 +++++++++--------- htdocs/projet/tasks/note.php | 3 +- htdocs/projet/tasks/task.php | 6 +- htdocs/projet/tasks/time.php | 60 ++++++++++--------- htdocs/public/project/suggestbooth.php | 4 +- htdocs/public/project/suggestconference.php | 4 +- htdocs/public/project/viewandvote.php | 3 +- htdocs/reception/card.php | 2 +- .../recruitmentjobposition_applications.php | 4 +- .../recruitmentjobposition_card.php | 4 +- htdocs/salaries/card.php | 4 +- htdocs/takepos/admin/terminal.php | 4 +- htdocs/webservices/server_project.php | 4 +- 25 files changed, 154 insertions(+), 152 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index ccbaaf9a33f..202b45b10d6 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,15 +9,15 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 1900+ occurrences + // PhanTypeMismatchArgument : 1840+ occurrences // PhanUndeclaredProperty : 520+ occurrences // PhanTypeMismatchArgumentNullable : 380+ occurrences // PhanPluginUnknownArrayMethodReturnType : 170+ occurrences // PhanUndeclaredGlobalVariable : 170+ occurrences // PhanTypeMismatchProperty : 130+ occurrences // PhanPluginUnknownArrayMethodParamType : 110+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 100+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 100+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 95+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 90+ occurrences // PhanRedefineFunction : 40+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences // PhanTypeInvalidDimOffset : 25+ occurrences @@ -32,12 +32,12 @@ return [ // PhanPluginUnknownObjectMethodCall : 6 occurrences // PhanTypeArraySuspiciousNull : 6 occurrences // PhanParamTooMany : 5 occurrences - // PhanEmptyForeach : 4 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences // PhanPluginEmptyStatementIf : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences // PhanPluginBothLiteralsBinaryOp : 3 occurrences + // PhanEmptyForeach : 2 occurrences // PhanTypeMismatchDimAssignment : 2 occurrences // PhanTypeMismatchDimFetchNullable : 2 occurrences // PhanTypeSuspiciousStringExpression : 2 occurrences @@ -613,15 +613,7 @@ return [ 'htdocs/projet/admin/project.php' => ['PhanTypeMismatchArgumentProbablyReal'], 'htdocs/projet/card.php' => ['PhanTypeMismatchArgumentNullable', 'PhanUndeclaredGlobalVariable'], 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], - 'htdocs/projet/stats/index.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'], - 'htdocs/projet/tasks.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/comment.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/contact.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/document.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/list.php' => ['PhanTypeMismatchArgument'], - 'htdocs/projet/tasks/note.php' => ['PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/task.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], - 'htdocs/projet/tasks/time.php' => ['PhanEmptyForeach', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], + 'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'], 'htdocs/public/bookcal/index.php' => ['PhanRedefineFunction'], @@ -645,7 +637,7 @@ return [ 'htdocs/public/project/new.php' => ['PhanRedefineFunction'], 'htdocs/public/project/suggestbooth.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/public/project/suggestconference.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'], + 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], @@ -802,7 +794,7 @@ return [ 'htdocs/webservices/server_order.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanTypeSuspiciousStringExpression', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_payment.php' => ['PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_productorservice.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], - 'htdocs/webservices/server_project.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], + 'htdocs/webservices/server_project.php' => ['PhanUndeclaredProperty'], 'htdocs/webservices/server_supplier_invoice.php' => ['PhanUndeclaredProperty'], 'htdocs/webservices/server_thirdparty.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/webservices/server_user.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d7583b42d62..21f5607d7ce 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3835,13 +3835,13 @@ class Facture extends CommonInvoice * @param string $desc Description of line * @param float $pu_ht Unit price without tax (> 0 even for credit note) * @param float $qty Quantity - * @param float $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') + * @param float|string $txtva Force Vat rate, -1 for auto (Can contain the vat_src_code too with syntax '9.9 (CODE)') * @param float $txlocaltax1 Local tax 1 rate (deprecated, use instead txtva with code inside) * @param float $txlocaltax2 Local tax 2 rate (deprecated, use instead txtva with code inside) * @param int $fk_product Id of predefined product/service * @param float $remise_percent Percent of discount on line - * @param int|string $date_start Date start of service - * @param int|string $date_end Date end of service + * @param int|'' $date_start Date start of service + * @param int|'' $date_end Date end of service * @param int $fk_code_ventilation Code of dispatching into accountancy * @param int $info_bits Bits of type of lines * @param int $fk_remise_except Id discount used @@ -3854,7 +3854,7 @@ class Facture extends CommonInvoice * @param int $origin_id Depend on global conf MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION can be Id of origin object (aka line id), else object id * @param int $fk_parent_line Id of parent line * @param int $fk_fournprice Supplier price id (to calculate margin) or '' - * @param int $pa_ht Buying price of line (to calculate margin) or '' + * @param float|'' $pa_ht Buying price of line (to calculate margin) or '' * @param string $label Label of the line (deprecated, do not use) * @param array $array_options extrafields array * @param int $situation_percent Situation advance percentage diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b8b04f032aa..69a01288c74 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -17,7 +17,7 @@ * Copyright (C) 2023 Gauthier VERDOL * Copyright (C) 2021 Grégory Blémand * Copyright (C) 2023 Lenin Rivas - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify @@ -152,7 +152,7 @@ abstract class CommonObject public $array_languages = null; // Value is array() when load already tried /** - * @var array To store result of ->liste_contact() + * @var array To store result of ->liste_contact() */ public $contacts_ids; @@ -270,13 +270,13 @@ abstract class CommonObject public $user; /** - * @var string The type of originating object. Combined with $origin_id, it allows to reload $origin_object + * @var string The type of originating object. Combined with `$origin_type`, it allows to reload `$origin_object` * @see fetch_origin() */ public $origin_type; /** - * @var int The id of originating object. Combined with $origin_type, it allows to reload $origin_object + * @var int The id of originating object. Combined with `$origin_type`, it allows to reload `$origin_object` * @see fetch_origin() */ public $origin_id; @@ -1489,7 +1489,7 @@ abstract class CommonObject * @param string $code Filter on this code of contact type ('SHIPPING', 'BILLING', ...) * @param int $status Status of user or company * @param int[] $arrayoftcids Array with ID of type of contacts. If we provide this, we can filter on ec.fk_c_type_contact IN ($arrayoftcids) to avoid a link on c_type_contact table (faster). - * @return array|int<-1,-1> Array of contacts, -1 if error + * @return array|int<-1,-1> Array of contacts, -1 if error */ public function liste_contact($statusoflink = -1, $source = 'external', $list = 0, $code = '', $status = -1, $arrayoftcids = array()) { @@ -1580,7 +1580,7 @@ abstract class CommonObject 'rowid' => $obj->rowid, 'code' => $obj->code, 'libelle' => $libelle_type, - 'status' => $obj->statuslink, + 'status' => (int) $obj->statuslink, 'fk_c_type_contact' => $obj->fk_c_type_contact ); } else { @@ -6544,8 +6544,8 @@ abstract class CommonObject } } else { /** - We are in a situation where the current object has no values in its extra fields. - We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation). + * We are in a situation where the current object has no values in its extra fields. + * We want to initialize all the values to null so that the array_option is accessible in other contexts (especially in document generation). **/ if (is_array($extrafields->attributes[$this->table_element]['label'])) { foreach ($extrafields->attributes[$this->table_element]['label'] as $key => $val) { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 537a0be605b..2c562114011 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1408,11 +1408,11 @@ class Form * @param int<0,3>|string $showempty 0=no empty value, 1=add an empty value, 2=add line 'Internal' (used by user edit), 3=add an empty value only if more than one record into list * @param string $exclude List of contacts id to exclude * @param string $limitto Not used - * @param integer $showfunction Add function into label + * @param int<0,1> $showfunction Add function into label * @param string $morecss Add more class to class style * @param bool $nokeyifsocid When 1, we force the option "Press a key to show list" to 0 if there is a value for $socid * @param integer $showsoc Add company into label - * @param int $forcecombo 1=Force to use combo box (so no ajax beautify effect) + * @param int<0,1> $forcecombo 1=Force to use combo box (so no ajax beautify effect) * @param array}> $events Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param string $moreparam Add more parameters onto the select tag. For example 'style="width: 95%"' to avoid select2 component to go over parent container * @param string $htmlid Html id to use instead of htmlname diff --git a/htdocs/core/class/html.formintervention.class.php b/htdocs/core/class/html.formintervention.class.php index be136a5db91..484ff337738 100644 --- a/htdocs/core/class/html.formintervention.class.php +++ b/htdocs/core/class/html.formintervention.class.php @@ -1,5 +1,6 @@ + * Copyright (C) 2025 MDW * * 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 @@ -57,11 +58,11 @@ class FormIntervention * @param int $selected Id intervention preselected * @param string $htmlname Nom de la zone html * @param int $maxlength Maximum length of label - * @param int $showempty Show empty line ('1' or string to show for empty line) + * @param string $showempty Show empty line ('1' or string to show for empty line) * @param bool $draftonly Show only drafts intervention * @return string HTML code for the select list if OK, empty if KO */ - public function select_interventions($socid = -1, $selected = 0, $htmlname = 'interventionid', $maxlength = 16, $showempty = 1, $draftonly = false) + public function select_interventions($socid = -1, $selected = 0, $htmlname = 'interventionid', $maxlength = 16, $showempty = '1', $draftonly = false) { // phpcs:enable global $user, $conf, $langs; diff --git a/htdocs/projet/class/projectstats.class.php b/htdocs/projet/class/projectstats.class.php index 892171de15e..ef306e70d5c 100644 --- a/htdocs/projet/class/projectstats.class.php +++ b/htdocs/projet/class/projectstats.class.php @@ -314,7 +314,7 @@ class ProjectStats extends Stats * @param int $startyear End year * @param int $cachedelay Delay we accept for cache file (0=No read, no save of cache, -1=No read but save) * @param int $wonlostfilter Add a filter on status won/lost - * @return int<-1,-1>|array,array{0:int<1,12>,1:int|float}>> Array of values or <0 if error + * @return int<-1,-1>|array,array{0:string,1:int,2?:int,3?:int,4?:int}> Array of values or <0 if error */ public function getWeightedAmountByMonthWithPrevYear($endyear, $startyear, $cachedelay = 0, $wonlostfilter = 1) { diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index da26f12997b..1e9c9483c56 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -2248,16 +2248,16 @@ class Task extends CommonObjectLine /** Load an object from its id and create a new one in database * - * @param User $user User making the clone - * @param int $fromid Id of object to clone - * @param int $project_id Id of project to attach clone task - * @param int $parent_task_id Id of task to attach clone task - * @param bool $clone_change_dt recalculate date of task regarding new project start date - * @param bool $clone_affectation clone affectation of project - * @param bool $clone_time clone time of project - * @param bool $clone_file clone file of project - * @param bool $clone_note clone note of project - * @param bool $clone_prog clone progress of project + * @param User $user User making the clone + * @param int $fromid Id of object to clone + * @param int $project_id Id of project to attach clone task + * @param int $parent_task_id Id of task to attach clone task + * @param bool|int<0,1> $clone_change_dt recalculate date of task regarding new project start date + * @param bool|int<0,1> $clone_affectation clone affectation of project + * @param bool|int<0,1> $clone_time clone time of project + * @param bool|int<0,1> $clone_file clone file of project + * @param bool|int<0,1> $clone_note clone note of project + * @param bool|int<0,1> $clone_prog clone progress of project * @return int New id of clone */ public function createFromClone(User $user, $fromid, $project_id, $parent_task_id, $clone_change_dt = false, $clone_affectation = false, $clone_time = false, $clone_file = false, $clone_note = false, $clone_prog = false) diff --git a/htdocs/projet/stats/index.php b/htdocs/projet/stats/index.php index ee84b6a91b4..b59130655f4 100644 --- a/htdocs/projet/stats/index.php +++ b/htdocs/projet/stats/index.php @@ -1,7 +1,7 @@ * Copyright (C) 2015-2021 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -134,6 +134,7 @@ if (!$mesg) { } +$px2 = null; if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { // Build graphic amount of object $data = $stats_project->getAmountByMonthWithPrevYear($endyear, $startyear); @@ -170,6 +171,7 @@ if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { } } +$px3 = null; if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { // Build graphic with transformation rate $data = $stats_project->getWeightedAmountByMonthWithPrevYear($endyear, $startyear, 0, 0); @@ -326,7 +328,7 @@ if ($mesg) { } else { $stringtoshow .= $px1->show(); $stringtoshow .= "
\n"; - if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES')) { + if (getDolGlobalString('PROJECT_USE_OPPORTUNITIES') && $px2 !== null && $px3 !== null) { //$stringtoshow .= $px->show(); //$stringtoshow .= "
\n"; $stringtoshow .= $px2->show(); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 26f471e6ab4..958021c32ac 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -2,7 +2,7 @@ /* Copyright (C) 2005 Rodolphe Quiedeville * Copyright (C) 2004-2019 Laurent Destailleur * Copyright (C) 2005-2017 Regis Houssin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -172,25 +172,25 @@ if (GETPOSTISSET('planned_workloadhour') || GETPOSTISSET('planned_workloadmin')) // Definition of fields for list $arrayfields = array( - 't.ref' => array('label' => "RefTask", 'checked' => 1, 'position' => 1), - 't.label' => array('label' => "LabelTask", 'checked' => 1, 'position' => 2), - 't.description' => array('label' => "Description", 'checked' => 0, 'position' => 3), - 't.dateo' => array('label' => "DateStart", 'checked' => 1, 'position' => 4), - 't.datee' => array('label' => "Deadline", 'checked' => 1, 'position' => 5), - 't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => 1, 'position' => 6), - 't.duration_effective' => array('label' => "TimeSpent", 'checked' => 1, 'position' => 7), - 't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => 1, 'position' => 8), - 't.progress' => array('label' => "ProgressDeclared", 'checked' => 1, 'position' => 9), - 't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => 1, 'position' => 10), - 't.fk_statut' => array('label' => "Status", 'checked' => 1, 'position' => 11), - 't.budget_amount' => array('label' => "Budget", 'checked' => 0, 'position' => 12), - 'c.assigned' => array('label' => "TaskRessourceLinks", 'checked' => 1, 'position' => 13), + 't.ref' => array('label' => "RefTask", 'checked' => '1', 'position' => 1), + 't.label' => array('label' => "LabelTask", 'checked' => '1', 'position' => 2), + 't.description' => array('label' => "Description", 'checked' => '0', 'position' => 3), + 't.dateo' => array('label' => "DateStart", 'checked' => '1', 'position' => 4), + 't.datee' => array('label' => "Deadline", 'checked' => '1', 'position' => 5), + 't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => '1', 'position' => 6), + 't.duration_effective' => array('label' => "TimeSpent", 'checked' => '1', 'position' => 7), + 't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => '1', 'position' => 8), + 't.progress' => array('label' => "ProgressDeclared", 'checked' => '1', 'position' => 9), + 't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => '1', 'position' => 10), + 't.fk_statut' => array('label' => "Status", 'checked' => '1', 'position' => 11), + 't.budget_amount' => array('label' => "Budget", 'checked' => '0', 'position' => 12), + 'c.assigned' => array('label' => "TaskRessourceLinks", 'checked' => '1', 'position' => 13), ); if ($object->usage_bill_time) { - $arrayfields['t.tobill'] = array('label' => $langs->trans("TimeToBill"), 'checked' => 0, 'position' => 11); - $arrayfields['t.billed'] = array('label' => $langs->trans("TimeBilled"), 'checked' => 0, 'position' => 12); - $arrayfields['t.billable'] = array('label' => $langs->trans("Billable"), 'checked' => 1, 'position' => 13); + $arrayfields['t.tobill'] = array('label' => $langs->trans("TimeToBill"), 'checked' => '0', 'position' => 11); + $arrayfields['t.billed'] = array('label' => $langs->trans("TimeBilled"), 'checked' => '0', 'position' => 12); + $arrayfields['t.billable'] = array('label' => $langs->trans("Billable"), 'checked' => '1', 'position' => 13); } // Extra fields @@ -199,7 +199,7 @@ $extrafieldsobjectprefix = 'efpt.'; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $arrayfields = dol_sort_array($arrayfields, 'position'); -'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan +// '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; @@ -456,6 +456,7 @@ llxHeader("", $title, $help_url, '', 0, 0, '', '', '', 'mod-project page-card_ta $arrayofselected = is_array($toselect) ? $toselect : array(); $param = ''; +$userWrite = 0; if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); @@ -810,9 +811,9 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- print ''.$langs->trans("ChildOfProjectTask").''; print img_picto('', 'project', 'class="pictofixedwidth"'); if ($projectoktoentertime) { - $formother->selectProjectTasks(GETPOST('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500 widthcentpercentminusxx'); + $formother->selectProjectTasks(GETPOSTINT('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '0,1', 'maxwidth500 widthcentpercentminusxx'); } else { - $formother->selectProjectTasks(GETPOST('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '', 'maxwidth500 widthcentpercentminusxx'); + $formother->selectProjectTasks(GETPOSTINT('task_parent'), empty($projectid) ? $object->id : $projectid, 'task_parent', 0, 0, 1, 1, 0, '', 'maxwidth500 widthcentpercentminusxx'); } print ''; @@ -822,12 +823,12 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- print ''.$langs->trans("AffectedTo").''; print img_picto('', 'user', 'class="pictofixedwidth"'); if (is_array($contactsofproject) && count($contactsofproject)) { - print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx'); + print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx'); } else { if ((isset($projectid) && $projectid > 0) || $object->id > 0) { print ''.$langs->trans("NoUserAssignedToTheProject").''; } else { - print $form->select_dolusers($user->id, 'userid', 0, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx'); + print $form->select_dolusers($user->id, 'userid', 0, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth500 widthcentpercentminusx'); } } print ''; @@ -942,7 +943,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- // Get list of tasks in tasksarray and taskarrayfiltered // We need all tasks (even not limited to a user because a task to user can have a parent that is not affected to him). $filteronthirdpartyid = $socid; - $tasksarray = $taskstatic->getTasksArray(0, 0, $object->id, $filteronthirdpartyid, 0, '', -1, $morewherefilter, 0, 0, $extrafields, 1, $search_array_options, 1, 1, $sortfield, $sortorder); + $tasksarray = $taskstatic->getTasksArray(null, null, $object->id, $filteronthirdpartyid, 0, '', '-1', $morewherefilter, 0, 0, $extrafields, 1, $search_array_options, 1, 1, $sortfield, $sortorder); // We load also tasks limited to a particular user $tmpuser = new User($db); @@ -950,7 +951,7 @@ if ($action == 'create' && $user->hasRight('projet', 'creer') && (empty($object- $tmpuser->fetch($search_user_id); } - $tasksrole = ($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(null, $tmpuser, $object->id, 0) : ''); + $tasksrole = ($tmpuser->id > 0 ? $taskstatic->getUserRolesForProjectsOrTasks(null, $tmpuser, (string) $object->id, 0) : ''); //var_dump($tasksarray); //var_dump($tasksrole); diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index beac0f4cbb2..3988543d94a 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -3,7 +3,7 @@ * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -76,7 +76,7 @@ $socid = 0; // Retrieve First Task ID of Project if withprojet is on to allow project prev next to work if (!empty($project_ref) && !empty($withproject)) { if ($projectstatic->fetch(0, $project_ref) > 0) { - $objectsarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0); + $objectsarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0); if (count($objectsarray) > 0) { $id = $objectsarray[0]->id; } else { diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php index ef379748e77..ce05328daea 100644 --- a/htdocs/projet/tasks/contact.php +++ b/htdocs/projet/tasks/contact.php @@ -3,6 +3,7 @@ * Copyright (C) 2006-2024 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -136,7 +137,7 @@ if ($action == 'deleteline' && $user->hasRight('projet', 'creer')) { // Retrieve First Task ID of Project if withprojet is on to allow project prev next to work if (!empty($project_ref) && !empty($withproject)) { if ($projectstatic->fetch(0, $project_ref) > 0) { - $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0); + $tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0); if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; } else { @@ -426,7 +427,7 @@ if ($id > 0 || !empty($ref)) { } else { $contactsofproject = $projectstatic->getListContactId('internal'); } - print $form->select_dolusers((GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 1, $langs->trans("ResourceNotAssignedToProject")); + print $form->select_dolusers((GETPOSTISSET('userid') ? GETPOSTINT('userid') : $user->id), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 1, $langs->trans("ResourceNotAssignedToProject")); print ''; print ''; $formcompany->selectTypeContact($object, '', 'type', 'internal', 'position'); @@ -451,7 +452,7 @@ if ($id > 0 || !empty($ref)) { print ''; $contactofproject = $projectstatic->getListContactId('external'); //print $form->selectcontacts($selectedCompany, '', 'contactid', 0, '', $contactofproject, 0, '', false, 0, 0); - print $form->select_contact($selectedCompany, '', 'contactid', 0, '', $contactofproject, 0, 'maxwidth300 widthcentpercentminusx', true); + print $form->select_contact($selectedCompany, '', 'contactid', 0, '', ''/* arg not used - $contactofproject */, 0, 'maxwidth300 widthcentpercentminusx', true); $nbofcontacts = $form->num; print ''; print ''; diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index a85d451efa8..9bdd5b0fbba 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -4,6 +4,7 @@ * Copyright (C) 2012 Florian Henry * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -94,7 +95,7 @@ $permissiontoadd = $user->hasRight('projet', 'creer'); // Used by the include of // Retrieve First Task ID of Project if withprojet is on to allow project prev next to work if (!empty($project_ref) && !empty($withproject)) { if ($projectstatic->fetch(0, $project_ref) > 0) { - $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0); + $tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0); if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; $object->fetch($id); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index ca1f5cd3a25..66f6a1e91a4 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -5,7 +5,7 @@ * Copyright (C) 2018 Ferran Marcet * Copyright (C) 2021 Alexandre Spangaro * Copyright (C) 2023 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -165,28 +165,28 @@ if (empty($user->socid)) { } $arrayfields = array( - 't.ref' => array('label' => "RefTask", 'checked' => 1, 'position' => 50), - 't.fk_task_parent' => array('label' => "RefTaskParent", 'checked' => 0, 'position' => 70), - 't.label' => array('label' => "LabelTask", 'checked' => 1, 'position' => 75), - 't.description' => array('label' => "Description", 'checked' => 0, 'position' => 80), - 't.dateo' => array('label' => "DateStart", 'checked' => 1, 'position' => 100), - 't.datee' => array('label' => "Deadline", 'checked' => 1, 'position' => 101), - 'p.ref' => array('label' => "ProjectRef", 'checked' => 1, 'position' => 151), - 'p.title' => array('label' => "ProjectLabel", 'checked' => 0, 'position' => 152), - 's.nom' => array('label' => "ThirdParty", 'checked' => -1, 'csslist' => 'tdoverflowmax125', 'position' => 200), - 's.name_alias' => array('label' => "AliasNameShort", 'checked' => 0, 'csslist' => 'tdoverflowmax125', 'position' => 201), - 'p.fk_statut' => array('label' => "ProjectStatus", 'checked' => 1, 'position' => 205), - 't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => 1, 'position' => 302), - 't.duration_effective' => array('label' => "TimeSpent", 'checked' => 1, 'position' => 303), - 't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => -1, 'position' => 304), - 't.progress' => array('label' => "ProgressDeclared", 'checked' => 1, 'position' => 305), - 't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => 1, 'position' => 306), - 't.budget_amount' => array('label' => "Budget", 'checked' => 0, 'position' => 307), - 't.fk_statut' => array('label' => "TaskStatus", 'checked' => 0, 'position' => 308), - 't.tobill' => array('label' => "TimeToBill", 'checked' => 0, 'position' => 310), - 't.billed' => array('label' => "TimeBilled", 'checked' => 0, 'position' => 311), - 't.datec' => array('label' => "DateCreation", 'checked' => 0, 'position' => 500), - 't.tms' => array('label' => "DateModificationShort", 'checked' => 0, 'position' => 501), + 't.ref' => array('label' => "RefTask", 'checked' => '1', 'position' => 50), + 't.fk_task_parent' => array('label' => "RefTaskParent", 'checked' => '0', 'position' => 70), + 't.label' => array('label' => "LabelTask", 'checked' => '1', 'position' => 75), + 't.description' => array('label' => "Description", 'checked' => '0', 'position' => 80), + 't.dateo' => array('label' => "DateStart", 'checked' => '1', 'position' => 100), + 't.datee' => array('label' => "Deadline", 'checked' => '1', 'position' => 101), + 'p.ref' => array('label' => "ProjectRef", 'checked' => '1', 'position' => 151), + 'p.title' => array('label' => "ProjectLabel", 'checked' => '0', 'position' => 152), + 's.nom' => array('label' => "ThirdParty", 'checked' => '-1', 'csslist' => 'tdoverflowmax125', 'position' => 200), + 's.name_alias' => array('label' => "AliasNameShort", 'checked' => '0', 'csslist' => 'tdoverflowmax125', 'position' => 201), + 'p.fk_statut' => array('label' => "ProjectStatus", 'checked' => '1', 'position' => 205), + 't.planned_workload' => array('label' => "PlannedWorkload", 'checked' => '1', 'position' => 302), + 't.duration_effective' => array('label' => "TimeSpent", 'checked' => '1', 'position' => 303), + 't.progress_calculated' => array('label' => "ProgressCalculated", 'checked' => '-1', 'position' => 304), + 't.progress' => array('label' => "ProgressDeclared", 'checked' => '1', 'position' => 305), + 't.progress_summary' => array('label' => "TaskProgressSummary", 'checked' => '1', 'position' => 306), + 't.budget_amount' => array('label' => "Budget", 'checked' => '0', 'position' => 307), + 't.fk_statut' => array('label' => "TaskStatus", 'checked' => '0', 'position' => 308), + 't.tobill' => array('label' => "TimeToBill", 'checked' => '0', 'position' => 310), + 't.billed' => array('label' => "TimeBilled", 'checked' => '0', 'position' => 311), + 't.datec' => array('label' => "DateCreation", 'checked' => '0', 'position' => 500), + 't.tms' => array('label' => "DateModificationShort", 'checked' => '0', 'position' => 501), //'t.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000), ); // Extra fields @@ -194,7 +194,7 @@ include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php'; $object->fields = dol_sort_array($object->fields, 'position'); $arrayfields = dol_sort_array($arrayfields, 'position'); -'@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan +// '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $permissiontoread = $user->hasRight('projet', 'lire'); $permissiontocreate = $user->hasRight('projet', 'creer'); @@ -296,10 +296,10 @@ $morejs = array(); $morecss = array(); if ($search_project_user > 0) { - $puser->fetch($search_project_user); + $puser->fetch((int) $search_project_user); } if ($search_task_user > 0) { - $tuser->fetch($search_task_user); + $tuser->fetch((int) $search_task_user); } @@ -802,7 +802,7 @@ if (isModEnabled('category') && $user->hasRight('categorie', 'lire')) { require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; $moreforfilter .= '
'; $tmptitle = $langs->trans('ProjectCategories'); - $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', $search_categ, 'search_categ', 1, $tmptitle, 'maxwidth300'); + $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('project', (int) $search_categ, 'search_categ', 1, $tmptitle, 'maxwidth300'); $moreforfilter .= '
'; } @@ -813,7 +813,7 @@ $includeonly = ''; if (!$user->hasRight('user', 'user', 'lire')) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth250'); +$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_project_user ? $search_project_user : '', 'search_project_user', $tmptitle, null, 0, $includeonly, '', '0', 0, 0, '', 0, '', 'maxwidth250'); $moreforfilter .= '
'; // If the user can view users @@ -823,7 +823,7 @@ $includeonly = ''; if (!$user->hasRight('user', 'user', 'lire')) { $includeonly = array($user->id); } -$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_task_user, 'search_task_user', $tmptitle, '', 0, $includeonly, '', 0, 0, 0, '', 0, '', 'maxwidth250'); +$moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_task_user, 'search_task_user', $tmptitle, null, 0, $includeonly, '', '0', 0, 0, '', 0, '', 'maxwidth250'); $moreforfilter .= '
'; // Filter on customer categories diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php index c938650cef5..e473a7f0458 100644 --- a/htdocs/projet/tasks/note.php +++ b/htdocs/projet/tasks/note.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -83,7 +84,7 @@ if ($id > 0 || !empty($ref)) { // Retrieve First Task ID of Project if withprojet is on to allow project prev next to work if (!empty($project_ref) && !empty($withproject)) { if ($projectstatic->fetch(0, $project_ref) > 0) { - $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0); + $tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0); if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; $object->fetch($id); diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 93e6ff146ce..6afc01197d9 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -3,7 +3,7 @@ * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2010-2012 Regis Houssin * Copyright (C) 2018-2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Vincent de Grandpré * * This program is free software; you can redistribute it and/or modify @@ -633,7 +633,7 @@ if ($id > 0 || !empty($ref)) { 'name' => 'task_origin', 'label' => $langs->trans('MergeOriginTask'), 'type' => 'other', - 'value' => $formproject->selectTasks(-1, '', 'task_origin', 24, 0, $langs->trans('SelectTask'), 0, 0, 0, 'maxwidth500 minwidth200', '', '', null, 1) + 'value' => $formproject->selectTasks(-1, 0, 'task_origin', 24, 0, $langs->trans('SelectTask'), 0, 0, 0, 'maxwidth500 minwidth200', '', '', null, 1) ) ); print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(GETPOST('withproject') ? "&withproject=1" : ""), $langs->trans("MergeTasks"), $langs->trans("ConfirmMergeTasks"), "confirm_merge", $formquestion, 'yes', 1, 250); @@ -830,7 +830,7 @@ if ($id > 0 || !empty($ref)) { $htmltoenteralink = $tmparray['htmltoenteralink']; print $htmltoenteralink; - $compatibleImportElementsList = false; + $compatibleImportElementsList = array(); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem, $compatibleImportElementsList); print '
'; diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 87a14b45e92..9f70e49f969 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -378,10 +378,10 @@ if ($action == 'confirm_deleteline' && $confirm == "yes" && ($user->hasRight('pr } } -// Retrieve First Task ID of Project if withprojet is on to allow project prev next to work +// Retrieve First Task ID of Project if withproject is on to allow project prev next to work if (!empty($project_ref) && !empty($withproject)) { if ($projectstatic->fetch(0, $project_ref) > 0) { - $tasksarray = $object->getTasksArray(0, 0, $projectstatic->id, $socid, 0); + $tasksarray = $object->getTasksArray(null, null, $projectstatic->id, $socid, 0); if (count($tasksarray) > 0) { $id = $tasksarray[0]->id; } else { @@ -410,6 +410,7 @@ if (GETPOSTINT('projectid') > 0) { $result = $projectstatic->fetch($object->fk_project); } // If not task selected and no project selected +$allprojectforuser = 0; if ($id <= 0 && $projectidforalltimes == 0) { $allprojectforuser = $user->id; } @@ -495,7 +496,7 @@ if ($action == 'confirm_generateinvoice') { $arrayoftasks[$object->timespent_fk_user][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); } - foreach ($arrayoftasks as $userid => $data) { + foreach ($arrayoftasks as $userid => $data) { // @phan-suppress-current-line PhanEmptyForeach $fuser->fetch($userid); $username = $fuser->getFullName($langs); @@ -563,7 +564,7 @@ if ($action == 'confirm_generateinvoice') { } // Add lines - $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject); + $lineid = $tmpinvoice->addline($langs->trans("TimeSpentForInvoice", $username) . ' : ' . $qtyhourtext, $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject); if ($lineid < 0) { $error++; setEventMessages(null, $tmpinvoice->errors, 'errors'); @@ -662,7 +663,7 @@ if ($action == 'confirm_generateinvoice') { } $idprodline = $value['fk_product']; } - $lineid = $tmpinvoice->addline($value['note'], $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject); + $lineid = $tmpinvoice->addline($value['note'], $pu_htline, round($qtyhour / $prodDurationHours, 2), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject); if ($lineid < 0) { $error++; setEventMessages(null, $tmpinvoice->errors, 'errors'); @@ -683,13 +684,13 @@ if ($action == 'confirm_generateinvoice') { $arrayoftasks = array(); foreach ($toselect as $key => $value) { // Get userid, timepent - $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utiliy method found into Task object) + $object->fetchTimeSpent($value); // Call method to get list of timespent for a timespent line id (We use the utility method found into Task object) // $object->id is now the task id $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['timespent'] += $object->timespent_duration; $arrayoftasks[$object->id][(int) $object->timespent_fk_product]['totalvaluetodivideby3600'] += ($object->timespent_duration * $object->timespent_thm); } - foreach ($arrayoftasks as $task_id => $data) { + foreach ($arrayoftasks as $task_id => $data) { // @phan-suppress-current-line PhanEmptyForeach $ftask = new Task($db); $ftask->fetch($task_id); @@ -760,7 +761,7 @@ if ($action == 'confirm_generateinvoice') { $date_start = ''; $date_end = ''; $lineName = $ftask->ref . ' - ' . $ftask->label; - $lineid = $tmpinvoice->addline($lineName, $pu_ht_for_task, price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), $remiseproject, $date_start, $date_end, 0, 0, '', 'HT', 0, 1, -1, 0, '', 0, 0, null, $pa_ht); + $lineid = $tmpinvoice->addline($lineName, (float) $pu_ht_for_task, (float) price2num($qtyhour / $prodDurationHours, 'MS'), $txtvaline, $localtax1line, $localtax2line, ($idprodline > 0 ? $idprodline : 0), (float) $remiseproject, $date_start, $date_end, 0, 0, 0, 'HT', 0, 1, -1, 0, '', 0, 0, 0, $pa_ht); if ($lineid < 0) { $error++; setEventMessages($tmpinvoice->error, $tmpinvoice->errors, 'errors'); @@ -1281,30 +1282,30 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Definition of fields for list $arrayfields = array(); - $arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => 1); - $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => 1); + $arrayfields['t.element_date'] = array('label' => $langs->trans("Date"), 'checked' => '1'); + $arrayfields['p.fk_soc'] = array('label' => $langs->trans("ThirdParty"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1','checked' => '1'); $arrayfields['s.name_alias'] = array('label' => $langs->trans("AliasNameShort"), 'type' => 'integer:Societe:/societe/class/societe.class.php:1'); if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task if (! empty($allprojectforuser)) { - $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => 1]; - $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => 1]; + $arrayfields['p.project_ref'] = ['label' => $langs->trans('RefProject'), 'checked' => '1']; + $arrayfields['p.project_label'] = ['label' => $langs->trans('ProjectLabel'), 'checked' => '1']; } - $arrayfields['t.element_ref'] = array('label' => $langs->trans("RefTask"), 'checked' => 1); - $arrayfields['t.element_label'] = array('label' => $langs->trans("LabelTask"), 'checked' => 1); + $arrayfields['t.element_ref'] = array('label' => $langs->trans("RefTask"), 'checked' => '1'); + $arrayfields['t.element_label'] = array('label' => $langs->trans("LabelTask"), 'checked' => '1'); } - $arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => 1); - $arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => 1); + $arrayfields['author'] = array('label' => $langs->trans("By"), 'checked' => '1'); + $arrayfields['t.note'] = array('label' => $langs->trans("Note"), 'checked' => '1'); if (isModEnabled('service') && !empty($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0 && $projectstatic->usage_bill_time) { - $arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => 1); + $arrayfields['t.fk_product'] = array('label' => $langs->trans("Product"), 'checked' => '1'); } - $arrayfields['t.element_duration'] = array('label' => $langs->trans("Duration"), 'checked' => 1); - $arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => 1, 'enabled' => isModEnabled("salaries")); - $arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => 1, 'enabled' => (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); + $arrayfields['t.element_duration'] = array('label' => $langs->trans("Duration"), 'checked' => '1'); + $arrayfields['value'] = array('label' => $langs->trans("Value"), 'checked' => '1', 'enabled' => (string) (int) isModEnabled("salaries")); + $arrayfields['valuebilled'] = array('label' => $langs->trans("Billed"), 'checked' => '1', 'enabled' => (string) (int) (((getDolGlobalInt('PROJECT_HIDE_TASKS') || !getDolGlobalInt('PROJECT_BILL_TIME_SPENT')) ? 0 : 1) && $projectstatic->usage_bill_time)); // Extra fields include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php'; $arrayfields = dol_sort_array($arrayfields, 'position'); - '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan + // '@phan-var-force array,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan $param = ''; if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) { @@ -1478,7 +1479,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser print $langs->trans('ServiceToUseOnLines'); print ''; print ''; - $form->select_produits('', 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500'); + $form->select_produits(0, 'productid', '1', 0, $projectstatic->thirdparty->price_level, 1, 2, '', 0, array(), $projectstatic->thirdparty->id, 'None', 0, 'maxwidth500'); print ''; print ''; } @@ -1625,7 +1626,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $sql .= " AND t.fk_element =".((int) $object->id); } elseif (!empty($projectidforalltimes)) { // Limit on one project - $sql .= " AND pt.fk_projet IN (" . $db->sanitize($projectidforalltimes) . ")"; + $sql .= " AND pt.fk_projet IN (" . $db->sanitize((string) $projectidforalltimes) . ")"; } elseif (!empty($allprojectforuser)) { // Limit on on user if (empty($search_user)) { @@ -1819,7 +1820,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser $nboftasks = 0; if (empty($id)) { print ''; - $nboftasks = $formproject->selectTasks(-1, GETPOSTINT('taskid'), 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth300', $projectstatic->id, 'progress'); + $nboftasks = $formproject->selectTasks(-1, GETPOSTINT('taskid'), 'taskid', 0, 0, '1', 1, 0, 0, 'maxwidth300', (string) $projectstatic->id, 'progress'); print ''; } @@ -1837,7 +1838,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if ($projectstatic->public) { $contactsofproject = array(); } - print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, '', 0, '', $contactsofproject, 0, 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); + print $form->select_dolusers((GETPOSTINT('userid') ? GETPOSTINT('userid') : $userid), 'userid', 0, null, 0, '', $contactsofproject, '0', 0, 0, '', 0, $langs->trans("ResourceNotAssignedToProject"), 'minwidth150imp maxwidth200'); } else { if ($nboftasks) { print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . ' ' . $langs->trans('FirstAddRessourceToAllocateTime'); @@ -1967,7 +1968,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } // Author if (!empty($arrayfields['author']['checked'])) { - print ''.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth125').''; + print ''.$form->select_dolusers(($search_user > 0 ? $search_user : -1), 'search_user', 1, null, 0, '', '', '0', 0, 0, '', 0, '', 'maxwidth125').''; } // Note if (!empty($arrayfields['t.note']['checked'])) { @@ -2228,6 +2229,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Thirdparty alias if (!empty($arrayfields['s.name_alias']['checked'])) { + $valtoshow = ''; if ($task_time->fk_soc > 0) { if (empty($conf->cache['thirdparty'][$task_time->fk_soc])) { $tmpsociete = new Societe($db); @@ -2285,7 +2287,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser if ((empty($id) && empty($ref)) || !empty($projectidforalltimes)) { // Not a dedicated task print ''; if ($action == 'editline' && GETPOSTINT('lineid') == $task_time->rowid) { - $formproject->selectTasks(-1, GETPOSTINT('taskid') ? GETPOSTINT('taskid') : $task_time->fk_element, 'taskid', 0, 0, 1, 1, 0, 0, 'maxwidth250', $projectstatic->id, ''); + $formproject->selectTasks(-1, GETPOSTINT('taskid') ? GETPOSTINT('taskid') : $task_time->fk_element, 'taskid', 0, 0, '1', 1, 0, 0, 'maxwidth250', (string) $projectstatic->id, ''); } else { $tasktmp->id = $task_time->fk_element; $tasktmp->ref = $task_time->ref; @@ -2633,7 +2635,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } if (count($contactsoftask) > 0) { print img_object('', 'user', 'class="hideonsmartphone"'); - print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, '', 0, '', $contactsoftask); + print $form->select_dolusers($task_time->fk_user, 'userid_line', 0, null, 0, '', $contactsoftask); } else { print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); } @@ -2798,7 +2800,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser } if (count($contactsoftask) > 0) { print img_object('', 'user', 'class="hideonsmartphone"'); - print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, '', 0, '', $contactsoftask); + print $form->select_dolusers($task_time->fk_user, 'userid_line_2', 0, null, 0, '', $contactsoftask); } else { print img_error($langs->trans('FirstAddRessourceToAllocateTime')) . $langs->trans('FirstAddRessourceToAllocateTime'); } diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 9247e6d9159..4136c172d97 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -86,7 +86,7 @@ $dateend = dol_mktime(23, 59, 59, GETPOSTINT('dateendmonth'), GETPOSTINT('dateen $id = GETPOST('id'); $project = new Project($db); -$resultproject = $project->fetch($id); +$resultproject = $project->fetch((int) $id); if ($resultproject < 0) { $error++; $errmsg .= $project->error; diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index e3ddf9c4260..ed927a0bd8d 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -86,7 +86,7 @@ $dateend = dol_mktime(23, 59, 59, GETPOSTINT('dateendmonth'), GETPOSTINT('dateen $id = GETPOST('id'); $project = new Project($db); -$resultproject = $project->fetch($id); +$resultproject = $project->fetch((int) $id); if ($resultproject < 0) { $error++; $errmsg .= $project->error; diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 250a7b4c5df..336c695d0bc 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -97,7 +98,7 @@ $listofvotes = explode(',', $_SESSION["savevotes"]); $urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost. $project = new Project($db); -$resultproject = $project->fetch($id); +$resultproject = $project->fetch((int) $id); if ($resultproject < 0) { $error++; $errmsg .= $project->error; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 37a0f4a7af6..2ba3f4752ef 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -888,7 +888,7 @@ if ($action == 'create') { print ''; print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="paddingright"'); - print $formproject->select_projects((!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $soc->id : -1), $projectid, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); + print $formproject->select_projects((!getDolGlobalString('PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS') ? $soc->id : -1), (string) $projectid, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500'); print '   id).'">'; print ''; print ''; diff --git a/htdocs/recruitment/recruitmentjobposition_applications.php b/htdocs/recruitment/recruitmentjobposition_applications.php index 646f63e6922..20c3a1d771e 100644 --- a/htdocs/recruitment/recruitmentjobposition_applications.php +++ b/htdocs/recruitment/recruitmentjobposition_applications.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -245,7 +245,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= ''; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= ''; } else { diff --git a/htdocs/recruitment/recruitmentjobposition_card.php b/htdocs/recruitment/recruitmentjobposition_card.php index cfc7e4458ac..9b46406018c 100644 --- a/htdocs/recruitment/recruitmentjobposition_card.php +++ b/htdocs/recruitment/recruitmentjobposition_card.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -345,7 +345,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $morehtmlref .= '
'; $morehtmlref .= ''; $morehtmlref .= ''; - $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); + $morehtmlref .= $formproject->select_projects($object->socid, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1); $morehtmlref .= ''; $morehtmlref .= '
'; } else { diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index dfa0395f574..27bdbe08014 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -7,7 +7,7 @@ * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2023 Maxime Nicolas * Copyright (C) 2023 Benjamin GREMBI - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -615,7 +615,7 @@ if ($action == 'create' && $permissiontoadd) { print ''.$langs->trans("Project").''; print img_picto('', 'project', 'class="pictofixedwidth"'); - print $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); + print $formproject->select_projects(-1, (string) $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1); print ''; } diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 597319c1686..06a8424daac 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -4,7 +4,7 @@ * Copyright (C) 2021 Thibault FOUCART * Copyright (C) 2022 Alexandre Spangaro * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -364,7 +364,7 @@ if (isModEnabled('project')) { print img_picto('', 'project', 'class="pictofixedwidth"'); // select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey = '', $nooutput = 0, $forceaddid = 0, $morecss = '', $htmlid = '', $morefilter = '') $projectid = getDolGlobalInt('CASHDESK_ID_PROJECT'.$terminaltouse); - print $formproject->select_projects(-1, $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 1, 'maxwidth500 widthcentpercentminusxx'); + print $formproject->select_projects(-1, (string) $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 1, 'maxwidth500 widthcentpercentminusxx'); print ''; } diff --git a/htdocs/webservices/server_project.php b/htdocs/webservices/server_project.php index 87921d46d99..49ce2d4d2f6 100644 --- a/htdocs/webservices/server_project.php +++ b/htdocs/webservices/server_project.php @@ -2,7 +2,7 @@ /* Copyright (C) 2006-2016 Laurent Destailleur * Copyright (C) 2016 Ion Agorria * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -385,7 +385,7 @@ function getProject($authentication, $id = '', $ref = '') if ($fuser->hasRight('projet', 'lire')) { $project = new Project($db); - $result = $project->fetch($id, $ref); + $result = $project->fetch((int) $id, $ref); if ($result > 0) { $project_result_fields = array( 'id' => $project->id, From 56f5232358315b3029f55b73ee3df992ca7574c2 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Tue, 11 Feb 2025 22:21:59 +0100 Subject: [PATCH 359/375] Debug v21 --- htdocs/core/class/html.formfile.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index c95f857a4a9..abb2d604b95 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -73,7 +73,7 @@ class FormFile * @param string $htmlname HTML name * @param string $modulepart Module part * @param string $dirformainimage Main directory of module - * @param string $subdirformainimage Subdirectory into main directory. Often ''. + * @param string $subdirformainimage Subdirectory into main directory. Often '', can be 'logos/'. * @param string $fileformainimage File name of image to show * @return string HTML code to show and edit image */ @@ -103,8 +103,8 @@ class FormFile $maxfilesizearray = getMaxFileSizeArray(); $maxmin = $maxfilesizearray['maxmin']; - $fileformainimagesmall = getImageFileNameForSize($fileformainimage, '_small'); - $fileformainimagemini = getImageFileNameForSize($fileformainimage, '_mini'); + $fileformainimagesmall = getImageFileNameForSize($fileformainimage, '_small'); // This include the "thumbs/..." in path + $fileformainimagemini = getImageFileNameForSize($fileformainimage, '_mini'); // This include the "thumbs/..." in path $out = ''; @@ -118,16 +118,16 @@ class FormFile $out .= ''; - if (file_exists($dirformainimage.'/'.$subdirformainimage.'thumbs/'.$fileformainimagesmall)) { + if (file_exists($dirformainimage.'/'.$subdirformainimage.$fileformainimagesmall)) { $out .= '
'; - $out .= ''; + $out .= ''; $out .= '
'; } elseif (!empty($fileformainimage)) { // Regenerate the thumbs - if (!file_exists($dirformainimage.'/'.$subdirformainimage.'thumbs/'.$fileformainimagemini)) { + if (!file_exists($dirformainimage.'/'.$subdirformainimage.$fileformainimagemini)) { $imgThumbMini = vignette($dirformainimage.'/'.$subdirformainimage.$fileformainimage, $maxwidthmini, $maxheightmini, '_mini', $quality); } - $imgThumbSmall = vignette($dirformainimage.'/'.$subdirformainimage.$fileformainimage, $maxwidthmini, $maxheightmini, '_small', $quality); + $imgThumbSmall = vignette($dirformainimage.'/'.$subdirformainimage.$fileformainimage, $maxwidthsmall, $maxheightsmall, '_small', $quality); $out .= '
'; $out .= ''; $out .= '
'; From f214d76d3510cf29d3d24a9e7ba363a39da94e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Fali=C3=A8re?= Date: Wed, 12 Feb 2025 10:57:58 +0100 Subject: [PATCH 360/375] ENH: accessibility on commonfields_add tpl --- htdocs/core/tpl/commonfields_add.tpl.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/tpl/commonfields_add.tpl.php b/htdocs/core/tpl/commonfields_add.tpl.php index 8e1c87a7a2e..787537d1381 100644 --- a/htdocs/core/tpl/commonfields_add.tpl.php +++ b/htdocs/core/tpl/commonfields_add.tpl.php @@ -1,7 +1,8 @@ - * Copyright (C) 2024 MDW +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2024 MDW * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 Benjamin Falière * * 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 @@ -69,11 +70,13 @@ foreach ($object->fields as $key => $val) { } print '"'; print '>'; + print ''; print ''; print ''; if (!empty($val['picto'])) { From f00c288e855f6c1c6f57b6f2657e43494e73597d Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 12:53:15 +0100 Subject: [PATCH 361/375] Debug v21 --- htdocs/public/members/new.php | 2 +- htdocs/public/onlinesign/newonlinesign.php | 63 +++++++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index df26dbf783a..40c79fc427e 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -978,7 +978,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR } } - +//htmlPrintOnlineFooter($mysoc, $langs); llxFooterVierge(); $db->close(); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 17506fc264a..641e5413771 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -185,6 +185,62 @@ $hookmanager->initHooks(array('onlinesign')); $error = 0; +/** + * Show header for online signature + * + * @param string $title Title + * @param string $head Head array + * @param int $disablejs More content into html header + * @param int $disablehead More content into html header + * @param string[]|string $arrayofjs Array of complementary js files + * @param string[]|string $arrayofcss Array of complementary css files + * @return void + */ +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +{ + global $conf, $langs, $mysoc; + + top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers + + print ''; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { + print ''; + } + print '
'; + } + + if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { + print '
'; + print ''; + print '
'; + } + + print '
'; + + print '
'; +} + + /* * Actions @@ -233,6 +289,7 @@ if ($action == 'confirm_refusepropal' && $confirm == 'yes') { // Test on pemriss */ $form = new Form($db); + $head = ''; if (getDolGlobalString('MAIN_SIGN_CSS_URL')) { $head = ''."\n"; @@ -241,8 +298,12 @@ if (getDolGlobalString('MAIN_SIGN_CSS_URL')) { $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; +$title = $langs->trans("OnlineSignature"); + $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); +llxHeader($head, $title, '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); + +llxHeaderVierge($title); if ($action == 'refusepropal') { print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); From bcca177bdf4e719d209abac6e770fb32919dc544 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 14:00:50 +0100 Subject: [PATCH 362/375] Debug v21 - fix pb with setup of mandatory vat number --- htdocs/compta/facture/class/facture.class.php | 13 +++-- htdocs/langs/en_US/accountancy.lang | 1 + htdocs/langs/en_US/errors.lang | 1 + htdocs/societe/admin/societe.php | 51 ++++++++++++++----- 4 files changed, 49 insertions(+), 17 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 43859ecab23..d8075c86fb8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -3325,10 +3325,17 @@ class Facture extends CommonInvoice } } if ($key == 'TVA_INTRA') { - // Check for mandatory - if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') && ($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra)) { + // Check for mandatory vat number + if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') == 'eeconly') { + if (($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra) && $this->thirdparty->isInEEC()) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorProdIdIsMandatoryForEuThirdparties', $langs->transnoentitiesnoconv('VATIntra')).' ('.$langs->transnoentitiesnoconv("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); + return -1; + } + } elseif (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') && ($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra)) { $langs->load("errors"); - $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->trans('VATIntra')).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transnoentitiesnoconv('VATIntra')).' ('.$langs->transnoentitiesnoconv("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); return -1; } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index d0984b30ca3..78cc4145ab6 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -409,6 +409,7 @@ SaleExport=Export sale SaleEEC=Sale in EEC SaleEECWithVAT=Sale in EEC with a VAT not null, so we suppose this is NOT an intracommunautary sale and the suggested account is the standard product account. SaleEECWithoutVATNumber=Sale in EEC with no VAT but the VAT ID of third party is not defined. We fall back on the account for standard sales. You can fix the VAT ID of the third party, or change the product account suggested for binding if needed. +AnySale=Any sale ForbiddenTransactionAlreadyExported=Forbidden: The transaction has been validated and/or exported. ForbiddenTransactionAlreadyValidated=Forbidden: The transaction has been validated. DataMustHaveBeenTransferredInAccounting=The transfer of data in accounting must have been done diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index fc7a83c44e6..c66ece16b31 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -31,6 +31,7 @@ ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be differen ErrorBadThirdPartyName=Bad value for third-party name ForbiddenBySetupRules=Forbidden by setup rules ErrorProdIdIsMandatory=The %s is mandatory +ErrorProdIdIsMandatoryForEuThirdparties=The %s is mandatory for customers in EEC ErrorAccountancyCodeCustomerIsMandatory=The accountancy code of customer %s is mandatory ErrorAccountancyCodeSupplierIsMandatory=The accountancy code of supplier %s is mandatory ErrorBadCustomerCodeSyntax=Bad syntax for customer code diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index 29b48fb1e7b..da898296d82 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; * @var User $user */ -$langs->loadLangs(array("admin", "companies", "other")); +$langs->loadLangs(array("admin", "accountancy", "companies", "other")); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); @@ -329,9 +329,11 @@ if ($action == 'setprofidmandatory') { } //Activate ProfId invoice mandatory -if ($action == 'setprofidinvoicemandatory') { +if ($action == 'setprofidinvoicemandatory' || $action == 'setprofidinvoicemandatoryeeconly') { $status = GETPOST('status', 'alpha'); - + if ($status == '1' && $action == 'setprofidinvoicemandatoryeeconly') { + $status = 'eeconly'; + } $idprof = "SOCIETE_".$value."_INVOICE_MANDATORY"; $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); if ($result <= 0) { @@ -777,31 +779,52 @@ print ''.$langs->trans('VATIntra')."\n"; $key = 'VAT_INTRA'; if (getDolGlobalString('SOCIETE_VAT_INTRA_UNIQUE')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle"'); print ''; } else { print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle"'); print ''; } if (getDolGlobalString('SOCIETE_VAT_INTRA_MANDATORY')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle"'); print ''; } else { print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle"'); print ''; } -if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; +print ''; +if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') == 'eeconly') { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("SaleEEC").'
'; + print ''; + print img_picto($langs->trans("Activated"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("AnySale"); +} elseif (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY')) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("SaleEEC").'
'; + print ''; + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("AnySale"); } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("SaleEEC").'
'; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("AnySale"); } +print ''; print "\n"; print "\n"; From 2b5295497b04616e8a7dc4dab3f17db82ece3a82 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 16:22:06 +0100 Subject: [PATCH 363/375] Debug v21 --- htdocs/ecm/class/ecmfiles.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 142aaf70270..28db17eceb0 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -1013,9 +1013,17 @@ class EcmFiles extends CommonObject } elseif ($option == 'commande_fournisseur') { $tmppath = preg_replace('/^fournisseur\/commande\//', '', $this->filepath); } else { - $tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath); + if ((int) $this->entity > 1) { + // Remove the part "entityid/commande/" into "entityid/commande/REFXXX" to get only the ref + $tmppath = preg_replace('/^\d+\/[^\/]+\//', '', $this->filepath); + } else { + // Remove the part "commande/" into "commande/REFXXX" to get only the ref + $tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath); + } } - $url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.$this->entity; + //var_dump($this->filepath); + + $url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.((int) $this->entity); } else { $url = DOL_URL_ROOT.'/ecm/file_card.php?id='.$this->id; } From 922e58e1e186643763015f2dafb16264ee562b74 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 19:10:36 +0100 Subject: [PATCH 364/375] WIP Add option MAIN_MAIL_EMAIL_FROM_PASSWORDRESET --- htdocs/admin/mails.php | 14 ++++--- htdocs/admin/mails_passwordreset.php | 55 ++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index afda0e31733..b32c64b8b35 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -382,6 +382,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -613,11 +614,11 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; - + print '
'; print '
'; - + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -664,6 +665,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("OtherOptions").'
'; + print '
'; print dol_get_fiche_end(); @@ -868,7 +870,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -892,7 +894,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -910,7 +912,7 @@ if ($action == 'edit') { if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) { print img_warning($langs->trans("Mandatory")); } elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))); } print ''; @@ -958,7 +960,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; print ''.(getDolGlobalString('MAIN_MAIL_ERRORS_TO')); if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_ERRORS_TO'))); } print ''; diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index 5f3b07ce7ee..6433b63486c 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -104,6 +104,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET")) { + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + } + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -349,6 +353,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -553,6 +558,26 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; + print '
'; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print '
'; + print '
'; print dol_get_fiche_end(); @@ -685,6 +710,36 @@ if ($action == 'edit') { print ''; print '
'; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print ''; + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').''; + } else { + print getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'); + } + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && !getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print img_warning($langs->trans("Mandatory")); + } elseif (getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET') && !isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))) { + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))); + } + print '
'; + print '
'; + print dol_get_fiche_end(); From fe3669621a216aadc15709110f5c3fa483668247 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 19:10:36 +0100 Subject: [PATCH 365/375] NEW Add option MAIN_MAIL_EMAIL_FROM_PASSWORDRESET --- htdocs/admin/mails.php | 14 ++++--- htdocs/admin/mails_passwordreset.php | 55 ++++++++++++++++++++++++++++ htdocs/user/class/user.class.php | 10 ++--- 3 files changed, 68 insertions(+), 11 deletions(-) diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index afda0e31733..b32c64b8b35 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -382,6 +382,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -613,11 +614,11 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; - + print '
'; print '
'; - + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -664,6 +665,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("OtherOptions").'
'; + print '
'; print dol_get_fiche_end(); @@ -868,7 +870,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -892,7 +894,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -910,7 +912,7 @@ if ($action == 'edit') { if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) { print img_warning($langs->trans("Mandatory")); } elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))); } print ''; @@ -958,7 +960,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; print ''.(getDolGlobalString('MAIN_MAIL_ERRORS_TO')); if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_ERRORS_TO'))); } print ''; diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index 5f3b07ce7ee..6433b63486c 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -104,6 +104,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET")) { + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + } + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -349,6 +353,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -553,6 +558,26 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; + print '
'; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print '
'; + print '
'; print dol_get_fiche_end(); @@ -685,6 +710,36 @@ if ($action == 'edit') { print ''; print '
'; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print ''; + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').''; + } else { + print getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'); + } + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && !getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print img_warning($langs->trans("Mandatory")); + } elseif (getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET') && !isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))) { + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))); + } + print '
'; + print '
'; + print dol_get_fiche_end(); diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 3c46fd80675..bec40c850f7 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2663,12 +2663,12 @@ class User extends CommonObject $outputlangs = new Translate("", $conf); if (isset($this->conf->MAIN_LANG_DEFAULT) - && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) - $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); + && getDolGlobalString('MAIN_LANG_DEFAULT') != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) + $outputlangs->getDefaultLang(getDolGlobalString('MAIN_LANG_DEFAULT')); } - if ($this->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($this->conf->MAIN_LANG_DEFAULT); + if (getDolGlobalString('MAIN_LANG_DEFAULT')) { + $outputlangs->setDefaultLang(getDolGlobalString('MAIN_LANG_DEFAULT')); } else { // If user has not defined its own language, we used current language $outputlangs = $langs; } @@ -2729,7 +2729,7 @@ class User extends CommonObject $mailfile = new CMailFile( $subject, $this->email, - $conf->global->MAIN_MAIL_EMAIL_FROM, + getDolGlobalString("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", getDolGlobalString("MAIN_MAIL_EMAIL_FROM")), $mesg, array(), array(), From 48354a6d73fec5db5296b4d470195aae922f5e03 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 19:16:56 +0100 Subject: [PATCH 366/375] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/user/class/user.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index bec40c850f7..5e7686e6d52 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2650,7 +2650,7 @@ class User extends CommonObject public function send_password($user, $password = '', $changelater = 0) { // phpcs:enable - global $conf, $langs, $mysoc; + global $conf, $langs; global $dolibarr_main_url_root; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; From 073a6eeae32060864b8d23e0d2741e4c6478531b Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 21:02:50 +0100 Subject: [PATCH 367/375] NEW Add options PDF_XXX_SHOW_PRICE_INCL_TAX into PDF setup --- htdocs/admin/pdf_other.php | 237 +++++++++++------- .../commande/doc/pdf_proforma.modules.php | 2 +- htdocs/langs/en_US/admin.lang | 3 + 3 files changed, 152 insertions(+), 90 deletions(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 73b4d52596c..80986a883b4 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -224,11 +224,33 @@ if (isModEnabled('propal')) { print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); + print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')); } print ''; */ + print ''; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_PROPAL_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_PROPAL_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX')); + } + print ''; + + print ''; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getdolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')); + } + print ''; + print ''; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -236,18 +258,7 @@ if (isModEnabled('propal')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL); - } - print ''; - - print ''; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')); } print ''; @@ -261,7 +272,31 @@ if (isModEnabled('order')) { print '
'; print ''; + print ''; + + print ''; + + print ''; + print ''; - print ''; @@ -289,74 +324,6 @@ if (isModEnabled('order')) { } -if (isModEnabled('supplier_proposal')) { - $langs->load("supplier_proposal"); - print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal'); - - print '
'; - print '
'.$langs->trans("Parameters").'
'; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_ORDER_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_ORDER_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_ORDERS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getdolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE')); + } + print '
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -269,18 +304,18 @@ if (isModEnabled('order')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_ORDER')); } print '
'; + print '
'; print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS); + print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('SALES_ORDER_SHOW_SHIPPING_ADDRESS')); } print '
'; - print ''; - - print ''; - - print ''; - - print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE); - } - print '
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN); - } - print '
'; - print '
'; -} - - -if (isModEnabled('supplier_order')) { - $langs->load("supplier_order"); - print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal'); - - print '
'; - print ''; - print ''; - - print ''; - - print ''; - - print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE); - } - print '
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN); - } - print '
'; - print '
'; -} if (isModEnabled('invoice')) { print load_fiche_titre($langs->trans("Invoices"), '', 'bill'); @@ -365,6 +332,28 @@ if (isModEnabled('invoice')) { print ''; print ''; + print ''; + + print ''; + print ''; + print ''; @@ -466,7 +456,77 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('INVOICE_HIDE_LINKED_OBJECT'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, $conf->global->INVOICE_HIDE_LINKED_OBJECT); + print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT')); + } + print ''; + + print '
'.$langs->trans("Parameters").'
'; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_INVOICE_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_INVOICE_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_INVOICE_SHOW_PRICE_INCL_TAX')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_INVOICES_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getdolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE')); + } + print '
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -372,9 +361,10 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_INVOICE); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')); } print '
'; print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore")); print ''; @@ -430,7 +420,7 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS); + print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('INVOICE_SHOW_SHIPPING_ADDRESS')); } print '
'; + print '
'; +} + + +if (isModEnabled('supplier_proposal')) { + $langs->load("supplier_proposal"); + print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal'); + + print '
'; + print ''; + print ''; + + print ''; + + print ''; + + print '
'.$langs->trans("Parameter").'
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN')); + } + print '
'; + print '
'; +} + + +if (isModEnabled('supplier_order')) { + $langs->load("supplier_order"); + print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal'); + + print '
'; + print ''; + print ''; + + print ''; + + print ''; @@ -495,7 +555,6 @@ if (isModEnabled('shipping')) { print ''; } - if (isModEnabled('reception')) { print load_fiche_titre($langs->trans("Receptions"), '', 'reception'); @@ -572,7 +631,7 @@ $maxfilesizearray = getMaxFileSizeArray(); $tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : ''; $documenturl = DOL_URL_ROOT.'/document.php'; if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { - $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; + $documenturl = getDolGlobalString('DOL_URL_ROOT_DOCUMENT_PHP'); } $modulepart = 'mycompany'; diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index e4199a5bf8e..0b068fbfa22 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -47,7 +47,7 @@ class pdf_proforma extends pdf_eratosthene */ public function __construct($db) { - global $conf, $langs, $mysoc; + global $langs; parent::__construct($db); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index df17e0ee429..a8c61ef799f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2137,6 +2137,7 @@ MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF DOC_SHOW_FIRST_SALES_REP=Show first sales representative MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add column for picture on proposal lines +MAIN_GENERATE_DOCUMENTS_WITH_PICTURE=Add column for picture on document lines MAIN_DOCUMENTS_WITH_PICTURE_WIDTH=Width of the column if a picture is added on lines MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE=Hide the unit price column on quotation requests MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN=Hide the total price column on quotation requests @@ -2611,3 +2612,5 @@ UploadExtensionRestriction=List of forbidden file extensions to upload UploadExtensionRestrictionExemple=htm, html, shtml, js, php Privileges=Privileges FieldsLinked=Fields Linked +PDF_XXX_SHOW_PRICE_INCL_TAX=Show column Price including tax +AvailableWithSomePDFTemplatesOnly=Feature not supported on old PDF templates From 0ef79d47d89e044a86d6a093ffd4c9edef737c85 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 22:43:01 +0100 Subject: [PATCH 368/375] Fix warning --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e6198c8bb6e..32796db2147 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -701,7 +701,7 @@ abstract class CommonObject public $user_creation; /** - * @var int User id author/creation + * @var int|null User id author/creation */ public $user_creation_id; From a1ce8272acbbbb72f0aee83ddf740a0ca49b9fd7 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 22:46:09 +0100 Subject: [PATCH 369/375] Fix warning --- htdocs/compta/facture/class/facture.class.php | 14 ++--- htdocs/core/lib/company.lib.php | 47 ++++++++++++++- htdocs/public/onlinesign/newonlinesign.php | 59 +------------------ 3 files changed, 55 insertions(+), 65 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 311c8df539a..53867a36681 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2555,12 +2555,12 @@ class Facture extends CommonInvoice if (isset($this->retained_warranty)) { $this->retained_warranty = (float) $this->retained_warranty; } - if (!isset($this->fk_user_author) && isset($this->user_author) ) { - $this->fk_user_author = $this->user_author; + if (!isset($this->user_creation_id) && isset($this->fk_user_author) ) { + $this->user_creation_id = $this->fk_user_author; + } + if (!isset($this->user_validation_id) && isset($this->fk_user_valid) ) { + $this->user_validation_id = $this->fk_user_valid; } - - // Check parameters - // Put here code to add control on parameters values // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; @@ -2585,8 +2585,8 @@ class Facture extends CommonInvoice $sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").","; $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").","; $sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").","; - $sql .= " fk_user_author=".(isset($this->fk_user_author) ? ((int) $this->fk_user_author) : "null").","; - $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").","; + $sql .= " fk_user_author=".(isset($this->user_creation_id) ? ((int) $this->user_creation_id) : "null").","; + $sql .= " fk_user_valid=".(isset($this->user_validation_id) ? (int) $this->user_validation_id : "null").","; $sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? (int) $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? (int) $this->cond_reglement_id : "null").","; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ba8b55c69d7..eb1b72a3846 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2659,9 +2659,54 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) } +/** + * Show header of company in HTML public pages + * + * @param Societe $mysoc Third party + * @param Translate $langs Output language + * @return void + */ +function htmlPrintOnlineHeader($mysoc, $langs) +{ + global $conf; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { + print ''; + } + print '
'; + } + + if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { + print '
'; + print ''; + print '
'; + } + + print '
'; +} + /** - * Show footer of company in HTML pages + * Show footer of company in HTML public pages * * @param Societe $fromcompany Third party * @param Translate $langs Output language diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 641e5413771..566b45618cc 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -185,62 +185,6 @@ $hookmanager->initHooks(array('onlinesign')); $error = 0; -/** - * Show header for online signature - * - * @param string $title Title - * @param string $head Head array - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param string[]|string $arrayofjs Array of complementary js files - * @param string[]|string $arrayofcss Array of complementary css files - * @return void - */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) -{ - global $conf, $langs, $mysoc; - - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - - print ''; - - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '
'; - - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - } - - if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { - print '
'; - print ''; - print '
'; - } - - print '
'; - - print '
'; -} - - /* * Actions @@ -303,7 +247,7 @@ $title = $langs->trans("OnlineSignature"); $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $title, '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); -llxHeaderVierge($title); +htmlPrintOnlineHeader($mysoc, $langs); if ($action == 'refusepropal') { print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); @@ -923,6 +867,7 @@ if ($action == "dosign" && empty($cancel)) { } print ''."\n"; print '
'.$langs->trans("Parameter").'
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN')); } print '
'."\n"; + print ''."\n"; print '
'."\n"; print '
'; From 8c082525fd0c2516b5c440c4e69154015ae1b0d5 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 22:50:59 +0100 Subject: [PATCH 370/375] Fix warning --- htdocs/admin/pdf_other.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 80986a883b4..8e5bbe44ae5 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -247,7 +247,7 @@ if (isModEnabled('propal')) { print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getdolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')); + print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')); } print ''; @@ -293,7 +293,7 @@ if (isModEnabled('order')) { print ajax_constantonoff('MAIN_GENERATE_ORDERS_WITH_PICTURE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getdolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE')); + print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE')); } print ''; @@ -350,7 +350,7 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('MAIN_GENERATE_INVOICES_WITH_PICTURE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getdolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE')); + print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE')); } print ''; From 382394575d1f8818ce9a0ae4a21bec8a9d18e8ff Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 22:58:51 +0100 Subject: [PATCH 371/375] Fix warning --- htdocs/expedition/shipment.php | 2 +- htdocs/webportal/class/webportalorder.class.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index c0d84059027..a964ea621b4 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -94,7 +94,7 @@ $result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, becaus $permissiontoread = $user->hasRight('expedition', 'lire'); $permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && ((int) $object->status == $object::STATUS_DRAFT)); $permissionnote = $user->hasRight('expedition', 'creer'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php diff --git a/htdocs/webportal/class/webportalorder.class.php b/htdocs/webportal/class/webportalorder.class.php index 1cbf082dccb..8c11ba5d92f 100644 --- a/htdocs/webportal/class/webportalorder.class.php +++ b/htdocs/webportal/class/webportalorder.class.php @@ -166,7 +166,7 @@ class WebPortalOrder extends Commande */ public function getTooltipContentArray($params) { - global $conf, $langs; + global $langs; $datas = []; @@ -174,9 +174,8 @@ class WebPortalOrder extends Commande return ['optimize' => $langs->trans("WebPortalOrder")]; } $datas['picto'] = img_picto('', $this->picto) . ' ' . $langs->trans("WebPortalOrder") . ''; - if (isset($this->status)) { - $datas['picto'] .= ' ' . $this->getLibStatut(5); - } + $datas['picto'] .= ' ' . $this->getLibStatut(5); + $datas['ref'] .= '
' . $langs->trans('Ref') . ': ' . $this->ref; return $datas; From d59421ff84bacbe14cae740b83e26033dccaa406 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 23:11:48 +0100 Subject: [PATCH 372/375] Fix warning --- dev/build/phpstan/phpstan-baseline.neon | 2 +- htdocs/compta/facture/class/facture.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 13c5539c16e..c092f13c4fd 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -10749,7 +10749,7 @@ parameters: - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue - count: 1 + count: 2 path: ../../../htdocs/core/lib/company.lib.php - diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index eb5d0c5165d..081725e89e3 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -104,7 +104,7 @@ class Facture extends CommonInvoice protected $table_ref_field = 'ref'; /** - * @var int ID + * @var int|null ID * @deprecated Use $user_creation_id */ public $fk_user_author; From f352a68150a0d66b1128cdc4bcf26c7c33f33835 Mon Sep 17 00:00:00 2001 From: MDW Date: Tue, 11 Feb 2025 22:06:34 +0100 Subject: [PATCH 373/375] Qual: Fix phan notices (public-1) --- dev/tools/phan/baseline.txt | 41 +++++++------------ htdocs/public/agenda/agendaexport.php | 25 +++++------ htdocs/public/bookcal/index.php | 10 ++--- htdocs/public/company/new.php | 15 ++++--- htdocs/public/cron/cron_run_jobs_by_url.php | 3 +- htdocs/public/demo/index.php | 10 ++--- htdocs/public/donations/donateurs_code.php | 10 ++--- htdocs/public/emailing/mailing-read.php | 5 ++- .../public/eventorganization/attendee_new.php | 20 ++++----- .../eventorganization/subscriptionok.php | 5 ++- htdocs/public/members/new.php | 16 ++++---- htdocs/public/members/public_card.php | 17 ++++---- htdocs/public/members/public_list.php | 9 ++-- htdocs/public/onlinesign/newonlinesign.php | 8 ++-- htdocs/public/opensurvey/studs.php | 6 ++- htdocs/public/partnership/new.php | 18 ++++---- htdocs/public/payment/newpayment.php | 16 ++++---- htdocs/public/payment/paymentko.php | 7 +++- htdocs/public/payment/paymentok.php | 31 +++++++------- 19 files changed, 136 insertions(+), 136 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 202b45b10d6..22c1223b0fd 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,35 +9,35 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 1840+ occurrences - // PhanUndeclaredProperty : 520+ occurrences - // PhanTypeMismatchArgumentNullable : 380+ occurrences + // PhanTypeMismatchArgument : 1810+ occurrences + // PhanUndeclaredProperty : 510+ occurrences + // PhanTypeMismatchArgumentNullable : 360+ occurrences // PhanPluginUnknownArrayMethodReturnType : 170+ occurrences // PhanUndeclaredGlobalVariable : 170+ occurrences // PhanTypeMismatchProperty : 130+ occurrences // PhanPluginUnknownArrayMethodParamType : 110+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 95+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 90+ occurrences - // PhanRedefineFunction : 40+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 85+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 85+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences // PhanTypeInvalidDimOffset : 25+ occurrences + // PhanRedefineFunction : 20+ occurrences // PhanTypeMismatchDimFetch : 20+ occurrences // PhanPluginUndeclaredVariableIsset : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences // PhanTypeMismatchArgumentNullableInternal : 10+ occurrences // PhanUndeclaredMethod : 10+ occurrences // PhanTypeComparisonFromArray : 8 occurrences - // PhanPluginSuspiciousParamPosition : 7 occurrences // PhanPluginDuplicateExpressionBinaryOp : 6 occurrences // PhanPluginUnknownObjectMethodCall : 6 occurrences // PhanTypeArraySuspiciousNull : 6 occurrences // PhanParamTooMany : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences - // PhanPluginEmptyStatementIf : 4 occurrences + // PhanPluginSuspiciousParamPosition : 4 occurrences // PhanEmptyFQSENInClasslike : 3 occurrences // PhanInvalidFQSENInClasslike : 3 occurrences // PhanPluginBothLiteralsBinaryOp : 3 occurrences // PhanEmptyForeach : 2 occurrences + // PhanPluginEmptyStatementIf : 2 occurrences // PhanTypeMismatchDimAssignment : 2 occurrences // PhanTypeMismatchDimFetchNullable : 2 occurrences // PhanTypeSuspiciousStringExpression : 2 occurrences @@ -241,7 +241,7 @@ return [ 'htdocs/compta/facture/agenda.php' => ['PhanTypeMismatchArgument'], 'htdocs/compta/facture/card-rec.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], 'htdocs/compta/facture/card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchProperty', 'PhanUndeclaredProperty'], - 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/compta/facture/class/api_invoices.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeComparisonFromArray', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/compta/facture/class/facture-rec.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/class/facture.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/compta/facture/class/factureligne.class.php' => ['PhanTypeMismatchArgument'], @@ -615,24 +615,11 @@ return [ 'htdocs/projet/class/api_tasks.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType', 'PhanTypeMismatchArgument'], 'htdocs/projet/tasks/time.php' => ['PhanTypeInvalidDimOffset', 'PhanTypeMismatchArgument', 'PhanUndeclaredProperty'], 'htdocs/projet/tasks/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/public/agenda/agendaexport.php' => ['PhanRedefineFunction'], - 'htdocs/public/bookcal/index.php' => ['PhanRedefineFunction'], - 'htdocs/public/company/new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'], - 'htdocs/public/cron/cron_run_jobs_by_url.php' => ['PhanUndeclaredProperty'], - 'htdocs/public/demo/index.php' => ['PhanRedefineFunction'], - 'htdocs/public/donations/donateurs_code.php' => ['PhanRedefineFunction'], - 'htdocs/public/emailing/mailing-read.php' => ['PhanRedefineFunction'], - 'htdocs/public/eventorganization/attendee_new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/public/eventorganization/subscriptionok.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/members/new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/members/public_card.php' => ['PhanRedefineFunction'], - 'htdocs/public/members/public_list.php' => ['PhanRedefineFunction'], - 'htdocs/public/onlinesign/newonlinesign.php' => ['PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentNullableInternal'], - 'htdocs/public/opensurvey/studs.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument'], - 'htdocs/public/partnership/new.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'], - 'htdocs/public/payment/newpayment.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], - 'htdocs/public/payment/paymentko.php' => ['PhanPluginEmptyStatementIf', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentNullable'], - 'htdocs/public/payment/paymentok.php' => ['PhanPluginSuspiciousParamPosition', 'PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeExpectedObjectPropAccess', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], + 'htdocs/public/company/new.php' => ['PhanTypeMismatchArgument'], + 'htdocs/public/eventorganization/subscriptionok.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'], + 'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/project/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], 'htdocs/public/project/new.php' => ['PhanRedefineFunction'], 'htdocs/public/project/suggestbooth.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 12046197b2a..c3d75a02842 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -66,7 +67,7 @@ if (!defined('NOIPCHECK')) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderAgendaExport($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { print 'Export agenda cal'; } @@ -75,7 +76,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterAgendaExport() { print ''; } @@ -179,9 +180,9 @@ if (!getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) { top_httphead(); - llxHeaderVierge(""); + llxHeaderAgendaExport(""); print '
Module Agenda was not configured properly.
'; - llxFooterVierge(); + llxFooterAgendaExport(); exit; } @@ -192,13 +193,13 @@ $reshook = $hookmanager->executeHooks('doActions', $filters); // Note that $acti if ($reshook < 0) { top_httphead(); - llxHeaderVierge(""); + llxHeaderAgendaExport(""); if (!empty($hookmanager->errors) && is_array($hookmanager->errors)) { print '
'.implode('
', $hookmanager->errors).'
'; } else { print '
'.$hookmanager->error.'
'; } - llxFooterVierge(); + llxFooterAgendaExport(); } elseif (empty($reshook)) { // Check exportkey if (!GETPOST("exportkey") || getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY') != GETPOST("exportkey")) { @@ -206,9 +207,9 @@ if ($reshook < 0) { top_httphead(); - llxHeaderVierge(""); + llxHeaderAgendaExport(""); print '
Bad value for key.
'; - llxFooterVierge(); + llxFooterAgendaExport(); exit; } } @@ -281,9 +282,9 @@ if ($shortfilename == 'dolibarrcalendar') { top_httphead(); - llxHeaderVierge(""); + llxHeaderAgendaExport(""); print '
'.$langs->trans("ErrorWrongValueForParameterX", 'format').'
'; - llxFooterVierge(); + llxFooterAgendaExport(); exit; } @@ -406,6 +407,6 @@ if ($format == 'rss') { top_httphead(); -llxHeaderVierge(""); +llxHeaderAgendaExport(""); print '
'.$agenda->error.'
'; -llxFooterVierge(); +llxFooterAgendaExport(); diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php index fc41027d6a8..9f5b7fee892 100644 --- a/htdocs/public/bookcal/index.php +++ b/htdocs/public/bookcal/index.php @@ -3,7 +3,7 @@ * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2023 anthony Berton - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -133,7 +133,7 @@ $errmsg = ''; * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderBookCal($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $conf, $langs, $mysoc; @@ -190,7 +190,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * Actions */ -if ($action == 'add' ) { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls) +if ($action == 'add') { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls) $error = 0; $idcontact = 0; $calendar = $object; @@ -272,7 +272,7 @@ if ($action == 'add' ) { // Test on permission not required here (anonymous acti 'id' => $contact->id, 'mandatory' => 0, 'answer_status' => 0, - 'transparency' =>0, + 'transparency' => 0, ] ]; $actioncomm->ip = getUserRemoteIP(); @@ -304,7 +304,7 @@ if ($action == 'add' ) { // Test on permission not required here (anonymous acti $form = new Form($db); -llxHeaderVierge('BookingCalendar'); +llxHeaderBookCal('BookingCalendar'); print '

'.(!empty($object->label) ? $object->label : $object->ref).'

'; diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index f7942e267c5..f9928fcd274 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -8,7 +8,7 @@ * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2021 Waël Almoman * Copyright (C) 2022 Udo Tamm - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -28,7 +28,6 @@ * \file htdocs/public/company/new.php * \ingroup prospect * \brief Example of form to add a new prospect - * */ if (!defined('NOLOGIN')) { @@ -118,7 +117,7 @@ $extrafields->fetch_name_optionals_label($objectsoc->table_element); // fetch op * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderCompanyNew($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $conf, $langs, $mysoc; @@ -167,7 +166,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterCompanyNew() { global $conf, $langs; @@ -289,7 +288,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // backtopage parameter with an url was set on prospect submit page, we never go here because a redirect was done to this url. if (empty($reshook) && $action == 'added') { // Test on permission not required here - llxHeaderVierge("newSocieteAdded"); + llxHeaderCompanyNew("newSocieteAdded"); // If we have not been redirected print '

'; @@ -297,7 +296,7 @@ if (empty($reshook) && $action == 'added') { // Test on permission not required print $langs->trans("newSocieteAdded"); print '
'; - llxFooterVierge(); + llxFooterCompanyNew(); exit; } @@ -313,7 +312,7 @@ $adht = new AdherentType($db); $formadmin = new FormAdmin($db); -llxHeaderVierge($langs->trans("ContactUs")); +llxHeaderCompanyNew($langs->trans("ContactUs")); print '
'; print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . '   ' . $langs->trans("ContactUs"), '', '', 0, '', 'center'); @@ -490,6 +489,6 @@ print '
'; -llxFooterVierge(); +llxFooterCompanyNew(); $db->close(); diff --git a/htdocs/public/cron/cron_run_jobs_by_url.php b/htdocs/public/cron/cron_run_jobs_by_url.php index 2c2bd2e7670..bb27393d688 100644 --- a/htdocs/public/cron/cron_run_jobs_by_url.php +++ b/htdocs/public/cron/cron_run_jobs_by_url.php @@ -3,7 +3,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2013-2015 Laurent Destailleur * Copyright (C) 2017 Regis Houssin - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -161,6 +161,7 @@ if (is_array($object->lines) && (count($object->lines) > 0)) { // Loop over job foreach ($object->lines as $line) { + '@phan-var-force Cronjob $line'; dol_syslog("cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label, LOG_DEBUG); echo "cron_run_jobs.php cronjobid: ".$line->id." priority=".$line->priority." entity=".$line->entity." label=".$line->label; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 2c23ea5420c..700b5e19b24 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -4,7 +4,7 @@ * Copyright (C) 2010 Regis Houssin * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -283,7 +283,7 @@ jQuery(document).ready(function () { }); '; -llxHeaderVierge($langs->trans("DolibarrDemo"), $head); +llxHeaderDemoIndex($langs->trans("DolibarrDemo"), $head); print "\n"; @@ -468,7 +468,7 @@ if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AD_CLIENT') && get } } -llxFooterVierge(); +llxFooterDemoIndex(); $db->close(); @@ -484,7 +484,7 @@ $db->close(); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderDemoIndex($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { top_httphead(); @@ -498,7 +498,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterDemoIndex() { printCommonFooter('public'); diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 8c84311b6c6..34a80c707e7 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -1,6 +1,7 @@ * Copyright (C) 2018-2025 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -34,7 +35,6 @@ if (!defined('NOIPCHECK')) { // C'est un wrapper, donc header vierge /** - * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -43,7 +43,7 @@ if (!defined('NOIPCHECK')) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderDonatorCodes($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { print 'List of donators'; } @@ -52,7 +52,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterDonatorCodes() { print ''; } @@ -74,7 +74,7 @@ $langs->load("donations"); * View */ -llxHeaderVierge(""); +llxHeaderDonatorCodes(""); $sql = "SELECT d.datedon as datedon, d.lastname, d.firstname, d.amount, d.public, d.societe"; $sql .= " FROM ".MAIN_DB_PREFIX."don as d"; @@ -116,4 +116,4 @@ if ($resql) { $db->close(); -llxFooterVierge(); +llxFooterDonatorCodes(); diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 9504034a64a..8530271fcba 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -4,6 +4,7 @@ * Copyright (C) 2005-2011 Laurent Destailleur * Copyright (C) 2012 Florian Henry * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -71,7 +72,7 @@ if (!defined('NOSESSION')) { * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeaderReadMailing($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { } @@ -84,7 +85,7 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooterReadMailing($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { } diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 5359e60e2b0..5199143d38b 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -1,7 +1,7 @@ * Copyright (C) 2023 Laurent Destailleur - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -179,7 +179,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderNewAttendee($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $conf, $langs, $mysoc; @@ -228,7 +228,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterNewAttendee() { print '
'; @@ -546,7 +546,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $resultprod = 0; if (getDolGlobalInt('SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION') > 0) { - $resultprod = $productforinvoicerow->fetch(getDolGlobalString('SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION')); + $resultprod = $productforinvoicerow->fetch(getDolGlobalInt('SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION')); } $facture = null; @@ -664,7 +664,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen // Get email content from template $arraydefaultmessage = null; - $labeltouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'); + $labeltouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'); if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'eventorganization_send', $user, $outputlangs, $labeltouse, 1, ''); } @@ -673,8 +673,8 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $subject = $arraydefaultmessage->topic; $msg = $arraydefaultmessage->content; } else { - $subject = null; - $msg = null; + $subject = ''; + $msg = ''; } $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty); @@ -719,7 +719,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $form = new Form($db); $formcompany = new FormCompany($db); -llxHeaderVierge($langs->trans("NewRegistration")); +llxHeaderNewAttendee($langs->trans("NewRegistration")); print '
'; @@ -909,7 +909,7 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print '' . $langs->trans('State') . ''; if ($country_code) { print img_picto('', 'state', 'class="pictofixedwidth"'); - print $formcompany->select_state(GETPOST("state_id"), $country_code); + print $formcompany->select_state(GETPOSTINT("state_id"), $country_code); } else { print ''; } @@ -964,6 +964,6 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print '
'; -llxFooterVierge(); +llxFooterNewAttendee(); $db->close(); diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index 5b3be5058eb..d0ac5f4020d 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -5,6 +5,7 @@ * Copyright (C) 2021 Waël Almoman * Copyright (C) 2021 Dorian Vabre * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -104,7 +105,7 @@ if (empty($conf->eventorganization->enabled)) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderSubscriptionOk($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $user, $conf, $langs, $mysoc; @@ -177,7 +178,7 @@ if (getDolGlobalString('ONLINE_PAYMENT_CSS_URL')) { $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; -llxHeaderVierge($langs->trans("PaymentForm")); +llxHeaderSubscriptionOk($langs->trans("PaymentForm")); // Show message diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 40c79fc427e..6b65f81e284 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -8,7 +8,7 @@ * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2021 Waël Almoman * Copyright (C) 2022 Udo Tamm - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -121,7 +121,7 @@ $user->loadDefaultValues(); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderMembersNew($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $conf, $langs, $mysoc; @@ -170,7 +170,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterMembersNew() { global $conf, $langs; @@ -500,7 +500,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. if (empty($reshook) && $action == 'added') { // Test on permission not required here - llxHeaderVierge($langs->trans("NewMemberForm")); + llxHeaderMembersNew($langs->trans("NewMemberForm")); // If we have not been redirected print '

'; @@ -508,7 +508,7 @@ if (empty($reshook) && $action == 'added') { // Test on permission not required print $langs->trans("NewMemberbyWeb"); print '
'; - llxFooterVierge(); + llxFooterMembersNew(); exit; } @@ -524,7 +524,7 @@ $adht = new AdherentType($db); $extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels -llxHeaderVierge($langs->trans("NewSubscription")); +llxHeaderMembersNew($langs->trans("NewSubscription")); print '
'; print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"').'   '.$langs->trans("NewSubscription"), '', '', 0, '', 'center'); @@ -697,7 +697,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR print ''.$langs->trans('State').''; if ($country_code) { print img_picto('', 'state', 'class="pictofixedwidth paddingright"'); - print $formcompany->select_state(GETPOST("state_id"), $country_code); + print $formcompany->select_state(GETPOSTINT("state_id"), $country_code); } print ''; } @@ -979,6 +979,6 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR } //htmlPrintOnlineFooter($mysoc, $langs); -llxFooterVierge(); +llxFooterMembersNew(); $db->close(); diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index a9adb98c407..cd76656de90 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2024-2025 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -90,7 +91,7 @@ if (getDolGlobalString('MEMBER_PUBLIC_CSS')) { $morehead = ''; } -llxHeaderVierge($langs->trans("MemberCard"), $morehead); +llxHeaderMembersPubCard($langs->trans("MemberCard"), $morehead); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -139,7 +140,7 @@ if ($id > 0) { } -llxFooterVierge(); +llxFooterMembersPubCard(); $db->close(); @@ -156,7 +157,7 @@ $db->close(); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderMembersPubCard($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { top_htmlhead($head, $title); @@ -164,11 +165,11 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ } /** -* Show footer for card member -* -* @return void -*/ -function llxFooterVierge() + * Show footer for card member + * + * @return void + */ +function llxFooterMembersPubCard() { printCommonFooter('public'); diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 0df9b10a12b..b655475d954 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -73,7 +74,7 @@ $langs->loadLangs(array("main", "members", "companies", "other")); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderMembersPubList($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { top_htmlhead($head, $title); @@ -85,7 +86,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterMembersPubList() { printCommonFooter('public'); @@ -133,7 +134,7 @@ if (getDolGlobalString('MEMBER_PUBLIC_CSS')) { $morehead = ''; } -llxHeaderVierge($langs->trans("ListOfValidatedPublicMembers"), $morehead); +llxHeaderMembersPubList($langs->trans("ListOfValidatedPublicMembers"), $morehead); $sql = "SELECT rowid, firstname, lastname, societe, zip, town, email, birth, photo"; @@ -215,6 +216,6 @@ if ($result) { } -llxFooterVierge(); +llxFooterMembersPubList(); $db->close(); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 566b45618cc..e9fdba6a042 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -4,7 +4,7 @@ * Copyright (C) 2009-2012 Regis Houssin * Copyright (C) 2023 anthony Berton * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -91,13 +91,13 @@ $message = GETPOST('message', 'aZ09'); // currency (iso code) $suffix = GETPOST("suffix", 'aZ09'); -$source = GETPOST("source", 'alpha'); +$source = (string) GETPOST("source", 'alpha'); $ref = $REF = GETPOST("ref", 'alpha'); $urlok = ''; $urlko = ''; -if (empty($source)) { +if ($source == '') { $source = 'proposal'; } if (!empty($refusepropal)) { @@ -254,7 +254,7 @@ if ($action == 'refusepropal') { } // Check link validity for param 'source' to avoid use of the examples as value -if (!empty($source) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'proposal_ref', ''))) { +if (/* $source !== '' :never empty && */ in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', 'proposal_ref', ''))) { $langs->load("errors"); dol_print_error_email('BADREFINONLINESIGNFORM', $langs->trans("ErrorBadLinkSourceSetButBadValueForRef", $source, $ref)); // End of page diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index bd8e73efa7f..8f8630126f5 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -1,7 +1,7 @@ * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -60,7 +60,7 @@ if (GETPOST('sondage')) { } $object = new Opensurveysondage($db); -$result = $object->fetch(0, $numsondage); +$result = $object->fetch('', $numsondage); $nblines = $object->fetch_lines(); @@ -255,6 +255,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x")) { // bo $testmodifier = false; $testligneamodifier = false; $ligneamodifier = -1; +$modifier = -1; for ($i = 0; $i < $nblines; $i++) { if (GETPOSTISSET('modifierligne'.$i)) { $ligneamodifier = $i; @@ -726,6 +727,7 @@ if ($ligneamodifier < 0 && (!isset($_SESSION['nom']))) { // Select value of best choice (for checkbox columns only) $nbofcheckbox = 0; +$meilleurecolonne = null; for ($i = 0; $i < $nbcolonnes; $i++) { if (empty($listofanswers[$i]['format']) || !in_array($listofanswers[$i]['format'], array('yesno', 'foragainst'))) { $nbofcheckbox++; diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index 14fdfee4b99..3a7ad036925 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -7,7 +7,7 @@ * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Alexandre Spangaro * Copyright (C) 2021 Waël Almoman - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -108,7 +108,7 @@ $user->loadDefaultValues(); * @param string[] $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderPartnershipNew($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) { global $conf, $langs, $mysoc; @@ -157,7 +157,7 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ * * @return void */ -function llxFooterVierge() +function llxFooterPartnershipNew() { global $conf, $langs; @@ -267,7 +267,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he $company = new Societe($db); $result = $company->fetch(0, GETPOST('societe')); if ($result == 0) { // if entry with name not found, we search using the email - $result1 = $company->fetch(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, GETPOST('email')); + $result1 = $company->fetch(0, '', '', '', '', '', '', '', '', '', GETPOST('email')); if ($result1 > 0) { $error++; $errmsg = $langs->trans("EmailAlreadyExistsPleaseRewriteYourCompanyName"); @@ -535,7 +535,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // If PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. if (empty($reshook) && $action == 'added') { // Test on permission not required here - llxHeaderVierge($langs->trans("NewPartnershipForm")); + llxHeaderPartnershipNew($langs->trans("NewPartnershipForm")); // Si on a pas ete redirige print '

'; @@ -543,7 +543,7 @@ if (empty($reshook) && $action == 'added') { // Test on permission not required print $langs->trans("NewPartnershipbyWeb"); print '
'; - llxFooterVierge(); + llxFooterPartnershipNew(); exit; } @@ -559,7 +559,7 @@ $formcompany = new FormCompany($db); $extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels -llxHeaderVierge($langs->trans("NewPartnershipRequest")); +llxHeaderPartnershipNew($langs->trans("NewPartnershipRequest")); print '
'; print load_fiche_titre(img_picto('', 'hands-helping', 'class="pictofixedwidth"').'   '.$langs->trans("NewPartnershipRequest"), '', '', 0, '', 'center'); @@ -683,7 +683,7 @@ print ''; if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) { print ''.$langs->trans('State').''; if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); + print $formcompany->select_state(GETPOSTINT("state_id"), $country_code); } print ''; } @@ -717,6 +717,6 @@ print "
"; print '
'; -llxFooterVierge(); +llxFooterPartnershipNew(); $db->close(); diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 2eca6baf62a..d1ccd9df208 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -191,7 +191,7 @@ if ($source == 'organizedeventregistration') { // Test on permission not requir } } elseif ($source == 'boothlocation') { // Test on permission not required here (anonymous action protected by mitigation of /public/... urls) // Getting the amount to pay, the invoice, finding the thirdparty - $invoiceid = GETPOST('ref'); + $invoiceid = GETPOSTINT('ref'); $invoice = new Facture($db); $resultinvoice = $invoice->fetch($invoiceid); if ($resultinvoice <= 0) { @@ -478,7 +478,7 @@ if ($action == 'dopayment') { // Test on permission not required here (anonymous dol_syslog("SCRIPT_URI: ".(empty($_SERVER["SCRIPT_URI"]) ? '' : $_SERVER["SCRIPT_URI"]), LOG_DEBUG); // If defined script uri must match domain of PAYPAL_API_OK and PAYPAL_API_KO // A redirect is added if API call successful - $mesg = print_paypal_redirect($PAYPAL_API_PRICE, $PAYPAL_API_DEVISE, $PAYPAL_PAYMENT_TYPE, $PAYPAL_API_OK, $PAYPAL_API_KO, $FULLTAG); + $mesg = print_paypal_redirect((float) $PAYPAL_API_PRICE, $PAYPAL_API_DEVISE, $PAYPAL_PAYMENT_TYPE, $PAYPAL_API_OK, $PAYPAL_API_KO, $FULLTAG); // If we are here, it means the Paypal redirect was not done, so we show error message $action = ''; @@ -990,7 +990,7 @@ if (getDolGlobalString('MAIN_IMAGE_PUBLIC_PAYMENT')) { print ''."\n"; -print ''."\n"; +print ''."\n"; // Additional information for each payment system if (isModEnabled('paypal')) { print ''."\n"; @@ -1022,7 +1022,7 @@ if (getDolGlobalString('PAYMENT_NEWFORM_TEXT')) { } if (empty($text)) { $text .= '
'.$langs->trans("WelcomeOnPaymentPage").''."\n"; - $text .= ''.$langs->trans("ThisScreenAllowsYouToPay", $creditor).'

'."\n"; + $text .= ''.$langs->trans("ThisScreenAllowsYouToPay", (string) $creditor).'

'."\n"; } print $text; @@ -1260,7 +1260,7 @@ if ($source == 'invoice') { print ''; print img_picto('', 'company', 'class="pictofixedwidth"'); print ''.$creditor.''; - print ''; + print ''; print ''."\n"; // Debitor @@ -1810,7 +1810,7 @@ if ($source == 'donation') { $don = new Don($db); // @phan-suppress-next-line PhanPluginSuspiciousParamPosition - $result = $don->fetch($ref); + $result = $don->fetch((int) $ref); if ($result <= 0) { $mesg = $don->error; $error++; @@ -1998,7 +1998,7 @@ if ($source == 'organizedeventregistration' && is_object($thirdparty)) { print ''.$langs->trans("Designation"); print ''.$text.''; print ''; - print ''; + print ''; print ''."\n"; // Amount @@ -2082,7 +2082,7 @@ if ($source == 'boothlocation') { print ''.$langs->trans("Designation"); print ''.$text; print ''; - print ''; + print ''; print ''."\n"; // Amount diff --git a/htdocs/public/payment/paymentko.php b/htdocs/public/payment/paymentko.php index bcb33857397..88de37b4b11 100644 --- a/htdocs/public/payment/paymentko.php +++ b/htdocs/public/payment/paymentko.php @@ -3,7 +3,7 @@ * Copyright (C) 2006-2013 Laurent Destailleur * Copyright (C) 2012 Regis Houssin * Copyright (C) 2024-2025 Frédéric France - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -93,10 +93,12 @@ if (isModEnabled('paypal')) { $PAYPALPAYERID = GETPOST('PayerID'); } } +/* if (isModEnabled('paybox')) { } if (isModEnabled('stripe')) { } +*/ $FULLTAG = GETPOST('FULLTAG'); if (empty($FULLTAG)) { @@ -180,6 +182,7 @@ dol_syslog("POST=".$tracepost, LOG_DEBUG, 0, '_payment'); // Set $appli for emails title $appli = $mysoc->name; $error = 0; +$FinalPaymentAmt = 0; if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice @@ -214,7 +217,7 @@ if (!empty($_SESSION['ipaddress'])) { // To avoid to make action twice if (empty($myCompanyDefaultLang) || $myCompanyDefaultLang === 'auto') { // We must guess the language from the company country. We must not use the language of the visitor. This is a technical email for supervision // so it must always be into the same language. - $myCompanyDefaultLang = getLanguageCodeFromCountryCode($mysoc->country_code); + $myCompanyDefaultLang = (string) getLanguageCodeFromCountryCode($mysoc->country_code); } $companylangs = new Translate('', $conf); diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php index 26b2db6e80b..24757d2b4a9 100644 --- a/htdocs/public/payment/paymentok.php +++ b/htdocs/public/payment/paymentok.php @@ -425,6 +425,7 @@ $appli = $mysoc->name; // Make complementary actions (post payment actions if payment is ok) $ispostactionok = 0; +$paymentTypeId = 0; $postactionmessages = array(); if ($ispaymentok) { // Set permission for the anonymous user @@ -466,7 +467,6 @@ if ($ispaymentok) { dol_syslog("We have to process member with id=".$tmptag['MEM']." result1=".$result1." result2=".$result2, LOG_DEBUG, 0, '_payment'); if ($result1 > 0 && $result2 > 0) { - $paymentTypeId = 0; if ($paymentmethod == 'paybox') { $paymentTypeId = getDolGlobalInt('PAYBOX_PAYMENT_MODE_FOR_PAYMENTS'); } @@ -576,7 +576,7 @@ if ($ispaymentok) { $datesubscription = dol_get_first_day((int) dol_print_date($datesubscription, "%Y")); } - $datesubend = null; + $datesubend = 0; if ($datesubscription && $defaultdelay && $defaultdelayunit) { $datesubend = dol_time_plus_duree($datesubscription, $defaultdelay, $defaultdelayunit); // the new end date of subscription must be in futur @@ -643,6 +643,7 @@ if ($ispaymentok) { $option = 'none'; } $sendalsoemail = 1; + $crowid = 0; // Record the subscription then complementary actions $db->begin(); @@ -663,10 +664,12 @@ if ($ispaymentok) { } } + $autocreatethirdparty = 0; + if (!$error) { dol_syslog("Call ->subscriptionComplementaryActions option=".$option, LOG_DEBUG, 0, '_payment'); - $autocreatethirdparty = 1; // will create thirdparty if member not yet linked to a thirdparty + $autocreatethirdparty = 1; // will create third party if member not yet linked to a thirdparty $result = $object->subscriptionComplementaryActions($crowid, $option, $accountid, $datesubscription, $paymentdate, $operation, $label, $amount, $num_chq, $emetteur_nom, $emetteur_banque, $autocreatethirdparty, $TRANSACTIONID, $service); if ($result < 0) { @@ -708,7 +711,7 @@ if ($ispaymentok) { $service = 'StripeLive'; $servicestatus = 1; } - $stripeacc = null; // No Oauth/connect use for public pages + $stripeacc = ''; // No Oauth/connect use for public pages $thirdparty = new Societe($db); $thirdparty->fetch($thirdparty_id); @@ -1298,7 +1301,7 @@ if ($ispaymentok) { require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); - $result = $object->fetch($ref); + $result = $object->fetch((int) $ref); // @phan-suppress-curren-line PhanPluginSuspiciousParamPosition if ($result) { $paymentTypeId = 0; if ($paymentmethod == 'paybox') { @@ -1439,7 +1442,7 @@ if ($ispaymentok) { $thirdparty = new Societe($db); $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc); if ($resultthirdparty < 0) { - setEventMessages($resultthirdparty->error, $resultthirdparty->errors, "errors"); + setEventMessages($thirdparty->error, $thirdparty->errors, "errors"); } else { require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php'; @@ -1452,7 +1455,7 @@ if ($ispaymentok) { // Get email content from template $arraydefaultmessage = null; - $idoftemplatetouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'); // Email to send for Event organization registration + $idoftemplatetouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'); // Email to send for Event organization registration if (!empty($idoftemplatetouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $idoftemplatetouse, 1, ''); @@ -1529,7 +1532,7 @@ if ($ispaymentok) { require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php'; include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $object = new Facture($db); - $result = $object->fetch($ref); + $result = $object->fetch((int) $ref); // @phan-suppress-current-line PhanPluginSuspiciousParamPosition if ($result) { $FinalPaymentAmt = $_SESSION["FinalPaymentAmt"]; @@ -1655,9 +1658,9 @@ if ($ispaymentok) { $booth->status = ConferenceOrBooth::STATUS_SUGGESTED; $resultboothupdate = $booth->update($user); if ($resultboothupdate < 0) { - // Finding the thirdparty by getting the invoice + // Finding the third party by getting the invoice $invoice = new Facture($db); - $resultinvoice = $invoice->fetch($ref); + $resultinvoice = $invoice->fetch((int) $ref); // @phan-suppress-current-line PhanPluginSuspiciousParamPosition if ($resultinvoice < 0) { $postactionmessages[] = 'Could not find the associated invoice.'; $ispostactionok = -1; @@ -1681,7 +1684,7 @@ if ($ispaymentok) { // Get email content from template $arraydefaultmessage = null; - $idoftemplatetouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'); // Email sent after registration for a Booth + $idoftemplatetouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'); // Email sent after registration for a Booth if (!empty($idoftemplatetouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $idoftemplatetouse, 1, ''); @@ -1960,11 +1963,11 @@ if ($ispaymentok) { // Send an email to the admins if ($sendemail) { // Get default language to use for the company for supervision emails - $myCompanyDefaultLang = $mysoc->default_lang; + $myCompanyDefaultLang = (string) $mysoc->default_lang; if (empty($myCompanyDefaultLang) || $myCompanyDefaultLang === 'auto') { // We must guess the language from the company country. We must not use the language of the visitor. This is a technical email for supervision // so it must always be into the same language. - $myCompanyDefaultLang = getLanguageCodeFromCountryCode($mysoc->country_code); + $myCompanyDefaultLang = (string) getLanguageCodeFromCountryCode($mysoc->country_code); } $companylangs = new Translate('', $conf); @@ -2125,7 +2128,7 @@ unset($_SESSION["TRANSACTIONID"]); if (empty($doactionsthenredirect)) { print "\n\n"; - print "\n"; + print "\n"; } From 3b1200df77a55ffa49f52933cc16033021ff679d Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 12 Feb 2025 00:52:24 +0100 Subject: [PATCH 374/375] Qual: Fix phan notices (public-2) --- dev/tools/phan/baseline.txt | 31 +++++-------- htdocs/core/class/commonpeople.class.php | 6 +-- htdocs/public/project/index.php | 9 +++- htdocs/public/project/new.php | 10 +++-- htdocs/public/project/suggestbooth.php | 16 ++++--- htdocs/public/project/suggestconference.php | 14 +++--- htdocs/public/project/viewandvote.php | 1 + htdocs/public/recruitment/view.php | 4 +- htdocs/public/stripe/ipn.php | 18 ++++---- htdocs/public/test/test_arrays.php | 5 ++- htdocs/public/ticket/create_ticket.php | 37 +++++++++------- htdocs/public/ticket/list.php | 43 +++++++++---------- htdocs/public/ticket/view.php | 9 ++-- .../public/webportal/webportal.main.inc.php | 12 +++--- htdocs/public/website/index.php | 28 ++++++------ htdocs/public/website/javascript.js.php | 24 ++++++----- htdocs/public/website/styles.css.php | 24 ++++++----- 17 files changed, 158 insertions(+), 133 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index 22c1223b0fd..ee7622c3050 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -9,18 +9,17 @@ */ return [ // # Issue statistics: - // PhanTypeMismatchArgument : 1810+ occurrences + // PhanTypeMismatchArgument : 1790+ occurrences // PhanUndeclaredProperty : 510+ occurrences // PhanTypeMismatchArgumentNullable : 360+ occurrences // PhanPluginUnknownArrayMethodReturnType : 170+ occurrences // PhanUndeclaredGlobalVariable : 170+ occurrences - // PhanTypeMismatchProperty : 130+ occurrences + // PhanTypeMismatchProperty : 120+ occurrences // PhanPluginUnknownArrayMethodParamType : 110+ occurrences - // PhanPossiblyUndeclaredGlobalVariable : 85+ occurrences - // PhanTypeMismatchArgumentProbablyReal : 85+ occurrences + // PhanTypeMismatchArgumentProbablyReal : 80+ occurrences + // PhanPossiblyUndeclaredGlobalVariable : 75+ occurrences // PhanTypeExpectedObjectPropAccess : 40+ occurrences // PhanTypeInvalidDimOffset : 25+ occurrences - // PhanRedefineFunction : 20+ occurrences // PhanTypeMismatchDimFetch : 20+ occurrences // PhanPluginUndeclaredVariableIsset : 15+ occurrences // PhanUndeclaredConstant : 15+ occurrences @@ -29,6 +28,7 @@ return [ // PhanTypeComparisonFromArray : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 6 occurrences // PhanPluginUnknownObjectMethodCall : 6 occurrences + // PhanRedefineFunction : 6 occurrences // PhanTypeArraySuspiciousNull : 6 occurrences // PhanParamTooMany : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences @@ -39,7 +39,6 @@ return [ // PhanEmptyForeach : 2 occurrences // PhanPluginEmptyStatementIf : 2 occurrences // PhanTypeMismatchDimAssignment : 2 occurrences - // PhanTypeMismatchDimFetchNullable : 2 occurrences // PhanTypeSuspiciousStringExpression : 2 occurrences // PhanAccessMethodProtected : 1 occurrence // PhanPluginDuplicateExpressionAssignmentOperation : 1 occurrence @@ -620,22 +619,12 @@ return [ 'htdocs/public/members/new.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/public/payment/newpayment.php' => ['PhanUndeclaredProperty'], 'htdocs/public/payment/paymentok.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/project/index.php' => ['PhanRedefineFunction', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/project/new.php' => ['PhanRedefineFunction'], - 'htdocs/public/project/suggestbooth.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/public/project/suggestconference.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], - 'htdocs/public/project/viewandvote.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/recruitment/view.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/stripe/ipn.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], - 'htdocs/public/test/test_arrays.php' => ['PhanPluginUndeclaredVariableIsset'], - 'htdocs/public/ticket/create_ticket.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchDimFetchNullable', 'PhanTypeMismatchProperty'], - 'htdocs/public/ticket/list.php' => ['PhanTypeMismatchArgument'], - 'htdocs/public/ticket/view.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgumentProbablyReal'], + 'htdocs/public/project/index.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/public/project/suggestbooth.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/public/project/suggestconference.php' => ['PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], + 'htdocs/public/project/viewandvote.php' => ['PhanUndeclaredGlobalVariable'], + 'htdocs/public/recruitment/view.php' => ['PhanUndeclaredGlobalVariable'], 'htdocs/public/webportal/tpl/menu.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/public/webportal/webportal.main.inc.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'], - 'htdocs/public/website/index.php' => ['PhanRedefineFunction', 'PhanTypeMismatchArgument'], - 'htdocs/public/website/javascript.js.php' => ['PhanRedefineFunction'], - 'htdocs/public/website/styles.css.php' => ['PhanRedefineFunction'], 'htdocs/reception/card.php' => ['PhanPossiblyUndeclaredGlobalVariable', 'PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'], 'htdocs/reception/class/api_receptions.class.php' => ['PhanTypeMismatchArgumentNullable'], 'htdocs/reception/class/reception.class.php' => ['PhanUndeclaredProperty'], diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index 9d80dbdd518..a4e9096b067 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -99,8 +99,8 @@ trait CommonPeople * Return full name (civility+' '+name+' '+lastname) * * @param Translate $langs Language object for translation of civility (used only if option is 1) - * @param int $option 0=No option, 1=Add civility - * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname + * @param int<0,1> $option 0=No option, 1=Add civility + * @param int<-1,5> $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname, 2=Firstname, 3=Firstname if defined else lastname, 4=Lastname, 5=Lastname if defined else firstname * @param int $maxlen Maximum length * @return string String with full name */ diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php index 8b399217059..cf1cfb715f2 100644 --- a/htdocs/public/project/index.php +++ b/htdocs/public/project/index.php @@ -1,6 +1,7 @@ * Copyright (C) 2024 Frédéric France + * Copyright (C) 2025 MDW * * 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 @@ -111,6 +112,8 @@ if (empty($conf->project->enabled)) { /** * Show header for new member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -119,7 +122,7 @@ if (empty($conf->project->enabled)) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -168,9 +171,11 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ /** * Show footer for new member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterVierge() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { print ''; diff --git a/htdocs/public/project/new.php b/htdocs/public/project/new.php index a794d2f5735..35dece5c502 100644 --- a/htdocs/public/project/new.php +++ b/htdocs/public/project/new.php @@ -6,7 +6,7 @@ * Copyright (C) 2012 J. Fernando Lagrange * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2018 Alexandre Spangaro - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -98,6 +98,8 @@ if (empty($conf->project->enabled)) { /** * Show header for new member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -106,7 +108,7 @@ if (empty($conf->project->enabled)) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -154,9 +156,11 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ /** * Show footer for new member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterVierge() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { print ''; diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 4136c172d97..6e57db70241 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -125,6 +125,8 @@ if (empty($conf->eventorganization->enabled)) { /** * Show header for new member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -133,7 +135,7 @@ if (empty($conf->eventorganization->enabled)) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -181,9 +183,11 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ /** * Show footer for new member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterVierge() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { print ''; @@ -331,7 +335,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - $resultcategory = $category->fetch(getDolGlobalString('EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH')); + $resultcategory = $category->fetch(getDolGlobalInt('EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH')); if ($resultcategory <= 0) { $error++; @@ -433,7 +437,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he $facture = null; if (!empty((float) $project->price_booth)) { $productforinvoicerow = new Product($db); - $resultprod = $productforinvoicerow->fetch(getDolGlobalString('SERVICE_BOOTH_LOCATION')); + $resultprod = $productforinvoicerow->fetch(getDolGlobalInt('SERVICE_BOOTH_LOCATION')); if ($resultprod < 0) { $error++; $errmsg .= $productforinvoicerow->error; @@ -516,7 +520,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // Get email content from template $arraydefaultmessage = null; - $labeltouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'); + $labeltouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'); if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); } @@ -699,7 +703,7 @@ print ''; if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) { print ''.$langs->trans('State').''; if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); + print $formcompany->select_state(GETPOSTINT("state_id"), $country_code); } else { print ''; } diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index ed927a0bd8d..26f4be49abd 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -126,6 +126,8 @@ if (empty($conf->eventorganization->enabled)) { /** * Show header for new member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -134,7 +136,7 @@ if (empty($conf->eventorganization->enabled)) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -182,9 +184,11 @@ function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $ /** * Show footer for new member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterVierge() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { print ''; @@ -330,7 +334,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // Adding supplier tag and tag from setup to thirdparty $category = new Categorie($db); - $resultcategory = $category->fetch(getDolGlobalString('EVENTORGANIZATION_CATEG_THIRDPARTY_CONF')); + $resultcategory = $category->fetch(getDolGlobalInt('EVENTORGANIZATION_CATEG_THIRDPARTY_CONF')); if ($resultcategory <= 0) { $error++; @@ -446,7 +450,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // Get email content from template $arraydefaultmessage = null; - $labeltouse = getDolGlobalString('EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'); + $labeltouse = getDolGlobalInt('EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'); if (!empty($labeltouse)) { $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, ''); } @@ -635,7 +639,7 @@ print ''; if (!getDolGlobalString('SOCIETE_DISABLE_STATE')) { print ''.$langs->trans('State').''; if ($country_code) { - print $formcompany->select_state(GETPOST("state_id"), $country_code); + print $formcompany->select_state(GETPOSTINT("state_id"), $country_code); } else { print ''; } diff --git a/htdocs/public/project/viewandvote.php b/htdocs/public/project/viewandvote.php index 336c695d0bc..d36defc47b1 100644 --- a/htdocs/public/project/viewandvote.php +++ b/htdocs/public/project/viewandvote.php @@ -178,6 +178,7 @@ $idvote = GETPOSTINT("vote"); $hashedvote = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'vote'.$idvote); if ($idvote > 0) { + $votestatus = 'err'; if (in_array($hashedvote, $listofvotes)) { // Has already voted $votestatus = 'ko'; diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 87127f7f906..33869758f48 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -363,7 +363,7 @@ if (empty($emailforcontact)) { } } print ''; -print $tmpuser->getFullName(-1); +print $tmpuser->getFullName($langs); print '   '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 'envelope'); print ''; print '
'; diff --git a/htdocs/public/stripe/ipn.php b/htdocs/public/stripe/ipn.php index e04053634d7..f47bfb3a322 100644 --- a/htdocs/public/stripe/ipn.php +++ b/htdocs/public/stripe/ipn.php @@ -2,7 +2,7 @@ /* Copyright (C) 2018-2020 Thibault FOUCART * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -96,7 +96,7 @@ if (empty($endpoint_secret)) { if (getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS')) { // We set the user to use for all ipn actions in Dolibarr $user = new User($db); - $user->fetch(getDolGlobalString('STRIPE_USER_ACCOUNT_FOR_ACTIONS')); + $user->fetch(getDolGlobalInt('STRIPE_USER_ACCOUNT_FOR_ACTIONS')); $user->loadRights(); } else { httponly_accessforbidden('Error: Setup of module Stripe not complete for mode '.dol_escape_htmltag($service).'. The STRIPE_USER_ACCOUNT_FOR_ACTIONS is not defined.', 400, 1); @@ -252,13 +252,13 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $db->begin(); if (!$error) { - $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * (float) price2num($amount), '', '', $user); + $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * (float) price2num($amount), '', 0, $user); } if (!($bank_line_id_from > 0)) { $error++; } if (!$error) { - $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amount), '', '', $user); + $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, (float) price2num($amount), '', 0, $user); } if (!($bank_line_id_to > 0)) { $error++; @@ -367,12 +367,12 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $obj = $db->fetch_object($result); if ($obj) { if ($obj->type == 'ban') { + $pdid = $obj->rowid; + $directdebitorcreditransfer_id = $obj->fk_prelevement_bons; if ($obj->traite == 1) { // This is a direct-debit with an order (llx_bon_prelevement) ALREADY generated, so // it means we received here the confirmation that payment request is finished. - $pdid = $obj->rowid; $invoice_id = $obj->fk_facture; - $directdebitorcreditransfer_id = $obj->fk_prelevement_bons; $payment_amountInDolibarr = $obj->amount; $paymentTypeCodeInDolibarr = $obj->type; @@ -382,9 +382,9 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P } } if ($obj->type == 'card' || empty($obj->type)) { + $pdid = $obj->rowid; if ($obj->traite == 0) { // This is a card payment not already flagged as sent to Stripe. - $pdid = $obj->rowid; $invoice_id = $obj->fk_facture; $payment_amountInDolibarr = $obj->amount; $paymentTypeCodeInDolibarr = empty($obj->type) ? 'card' : $obj->type; @@ -827,7 +827,7 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $amountdisputestripe = $object->amoutndispute; // In stripe format $amountdispute = $amountdisputestripe; // In real currency format - $invoice_id = ""; + $invoice_id = 0; $paymentTypeCode = ""; // payment type according to Stripe $paymentTypeCodeInDolibarr = ""; // payment type according to Dolibarr $payment_amount = 0; @@ -861,7 +861,7 @@ if ($event->type == 'payout.created' && getDolGlobalString('STRIPE_AUTO_RECORD_P $payment_amountInDolibarr = $obj->amount; $paymentTypeCodeInDolibarr = empty($obj->type) ? 'card' : $obj->type; - dol_syslog("Found the payment intent for card in database (pdid = ".$pdid." directdebitorcreditransfer_id=".$directdebitorcreditransfer_id.")"); + dol_syslog("Found the payment intent for card in database (pdid = ".$pdid.")"); } } else { dol_syslog("Payment intent ".$TRANSACTIONID." not found into database, so ignored."); diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php index 2a34c55d129..bbb87be938d 100644 --- a/htdocs/public/test/test_arrays.php +++ b/htdocs/public/test/test_arrays.php @@ -1,5 +1,6 @@ + * Copyright (C) 2025 MDW * * 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 @@ -201,7 +202,7 @@ $sortfield = 'aaa'; $sortorder = 'ASC'; $tasksarray = array(1, 2, 3); // To force having several lines $tagidfortablednd = 'tablelines3'; -if (!isset($moreforfilter)) { +if (!isset($moreforfilter)) { // @phan-suppress-current-line PhanPluginUndeclaredVariableIsset $moreforfilter = ''; } if (!empty($conf->use_javascript_ajax)) { @@ -228,7 +229,7 @@ if ($socid) { if (isset($showbirthday) && $showbirthday) { $nav .= ''; } -if (isset($pid) && $pid) { +if (isset($pid) && $pid) { // @phan-suppress-current-line PhanPluginUndeclaredVariableIsset $nav .= ''; } if ($type) { diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index dd72277cfb2..1f04dca7251 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -2,7 +2,7 @@ /* Copyright (C) 2013-2016 Jean-François FERRY * Copyright (C) 2016 Christophe Battarel * Copyright (C) 2023 Laurent Destailleur - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -153,12 +153,13 @@ if (empty($reshook)) { $upload_dir_tmp = $vardir.'/temp/'.session_id(); // TODO Delete only files that was uploaded from form - dol_remove_file_process(GETPOST('removedfile'), 0, 0); + dol_remove_file_process(GETPOSTINT('removedfile'), 0, 0); $action = 'create_ticket'; } if ($action == 'create_ticket' && GETPOST('save', 'alpha')) { // Test on permission not required. This is a public form. Security is managed by mitigation. $error = 0; + $cid = -1; $origin_email = GETPOST('email', 'email'); if (empty($origin_email)) { $error++; @@ -166,16 +167,18 @@ if (empty($reshook)) { $action = ''; } else { // Search company saved with email - $searched_companies = $object->searchSocidByEmail($origin_email, '0'); + $searched_companies = $object->searchSocidByEmail($origin_email, 0); // Chercher un contact existent avec cette address email // Le premier contact trouvé est utilisé pour déterminer le contact suivi $contacts = $object->searchContactByEmail($origin_email); + if (!is_array($contacts)) { + $contacts = array(); + } // Ensure that contact is active and select first active contact - $cid = -1; foreach ($contacts as $key => $contact) { - if ((int) $contact->statut == 1) { + if ((int) $contact->status == 1) { $cid = $key; break; } @@ -195,7 +198,7 @@ if (empty($reshook)) { $contact_phone = ''; if ($with_contact) { // set linked contact to add in form - if (is_array($contacts) && count($contacts) == 1) { + if (/* is_array($contacts) && */ count($contacts) == 1) { $with_contact = current($contacts); } @@ -309,7 +312,7 @@ if (empty($reshook)) { if ($result < 0) { $error++; $errors = ($company->error ? array($company->error) : $company->errors); - array_push($object->errors, $errors); + $object->errors = array_merge($object->errors, $errors); $action = 'create_ticket'; } @@ -324,7 +327,7 @@ if (empty($reshook)) { if ($result < 0) { $error++; $errors = ($with_contact->error ? array($with_contact->error) : $with_contact->errors); - array_push($object->errors, $errors); + $object->errors = array_merge($object->errors, $errors); $action = 'create_ticket'; } else { $contacts = array($with_contact); @@ -336,7 +339,7 @@ if (empty($reshook)) { $object->fk_soc = $searched_companies[0]->id; } - if (is_array($contacts) && count($contacts) > 0 && $cid >= 0) { + if (/* is_array($contacts) && */ count($contacts) > 0 && $cid >= 0) { $object->fk_soc = $contacts[$cid]->socid; $usertoassign = $contacts[$cid]->id; } @@ -363,7 +366,9 @@ if (empty($reshook)) { if ($id <= 0) { $error++; $errors = ($object->error ? array($object->error) : $object->errors); - array_push($object->errors, $object->error ? array($object->error) : $object->errors); + if ($object->error) { + array_push($object->errors, $object->error); + } $action = 'create_ticket'; } } @@ -421,8 +426,8 @@ if (empty($reshook)) { $sendtocc = ''; $deliveryreceipt = 0; - if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') { - $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO'); + $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO'); + if ($old_MAIN_MAIL_AUTOCOPY_TO !== '') { $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; @@ -432,7 +437,7 @@ if (empty($reshook)) { } else { $result = $mailfile->sendfile(); } - if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') { + if ($old_MAIN_MAIL_AUTOCOPY_TO !== '') { $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; } @@ -464,8 +469,8 @@ if (empty($reshook)) { $from = getDolGlobalString('MAIN_INFO_SOCIETE_NOM') . ' <' . getDolGlobalString('TICKET_NOTIFICATION_EMAIL_FROM').'>'; $replyto = $from; - if (getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '') { - $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO'); + $old_MAIN_MAIL_AUTOCOPY_TO = getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO'); + if ($old_MAIN_MAIL_AUTOCOPY_TO !== '') { $conf->global->MAIN_MAIL_AUTOCOPY_TO = ''; } include_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; @@ -475,7 +480,7 @@ if (empty($reshook)) { } else { $result = $mailfile->sendfile(); } - if ((getDolGlobalString('TICKET_DISABLE_MAIL_AUTOCOPY_TO') !== '')) { + if ($old_MAIN_MAIL_AUTOCOPY_TO !== '') { $conf->global->MAIN_MAIL_AUTOCOPY_TO = $old_MAIN_MAIL_AUTOCOPY_TO; } } diff --git a/htdocs/public/ticket/list.php b/htdocs/public/ticket/list.php index d769ac209a0..a4a3b4697a9 100644 --- a/htdocs/public/ticket/list.php +++ b/htdocs/public/ticket/list.php @@ -1,8 +1,7 @@ +/* Copyright (C) 2013-2016 Jean-François FERRY + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France - */ -/* Copyright (C) 2013-2016 Jean-François FERRY * * 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 @@ -253,25 +252,25 @@ if ($action == "view_ticketlist") { // Definition of fields for list $arrayfields = array( - 't.datec' => array('label' => $langs->trans("Date"), 'checked' => 1), - 't.date_read' => array('label' => $langs->trans("TicketReadOn"), 'checked' => 0), - 't.date_close' => array('label' => $langs->trans("TicketCloseOn"), 'checked' => 0), - 't.ref' => array('label' => $langs->trans("Ref"), 'checked' => 1), - //'t.track_id' => array('label' => $langs->trans("IDTracking"), 'checked' => 0), - 't.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => 1), - 't.subject' => array('label' => $langs->trans("Subject"), 'checked' => 1), - 'type.code' => array('label' => $langs->trans("Type"), 'checked' => 1), - 'category.code' => array('label' => $langs->trans("Category"), 'checked' => 1), - 'severity.code' => array('label' => $langs->trans("Severity"), 'checked' => 1), - 't.progress' => array('label' => $langs->trans("Progression"), 'checked' => 0), - //'t.fk_contract' => array('label' => $langs->trans("Contract"), 'checked' => 0), - 't.fk_user_create' => array('label' => $langs->trans("Author"), 'checked' => 1), - 't.fk_user_assign' => array('label' => $langs->trans("AssignedTo"), 'checked' => 0), + 't.datec' => array('label' => $langs->trans("Date"), 'checked' => '1'), + 't.date_read' => array('label' => $langs->trans("TicketReadOn"), 'checked' => '0'), + 't.date_close' => array('label' => $langs->trans("TicketCloseOn"), 'checked' => '0'), + 't.ref' => array('label' => $langs->trans("Ref"), 'checked' => '1'), + //'t.track_id' => array('label' => $langs->trans("IDTracking"), 'checked' => '0'), + 't.fk_statut' => array('label' => $langs->trans("Status"), 'checked' => '1'), + 't.subject' => array('label' => $langs->trans("Subject"), 'checked' => '1'), + 'type.code' => array('label' => $langs->trans("Type"), 'checked' => '1'), + 'category.code' => array('label' => $langs->trans("Category"), 'checked' => '1'), + 'severity.code' => array('label' => $langs->trans("Severity"), 'checked' => '1'), + 't.progress' => array('label' => $langs->trans("Progression"), 'checked' => '0'), + //'t.fk_contract' => array('label' => $langs->trans("Contract"), 'checked' => '0'), + 't.fk_user_create' => array('label' => $langs->trans("Author"), 'checked' => '1'), + 't.fk_user_assign' => array('label' => $langs->trans("AssignedTo"), 'checked' => '0'), - //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked'=>1, 'enabled'=>(isModEnabled('multicompany') && empty($conf->multicompany->transverse_mode))), - //'t.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => 0, 'position' => 500), - //'t.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => 0, 'position' => 2) - //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), + //'t.entity'=>array('label'=>$langs->trans("Entity"), 'checked' => '1', 'enabled'=>(isModEnabled('multicompany') && empty($conf->multicompany->transverse_mode))), + //'t.datec' => array('label' => $langs->trans("DateCreation"), 'checked' => '0', 'position' => 500), + //'t.tms' => array('label' => $langs->trans("DateModificationShort"), 'checked' => '0', 'position' => 2) + //'t.statut'=>array('label'=>$langs->trans("Status"), 'checked' => '1', 'position'=>1000), ); if (!getDolGlobalString('TICKET_SHOW_PROGRESSION')) { @@ -284,7 +283,7 @@ if ($action == "view_ticketlist") { if ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate') { $enabled = abs((int) dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1, 1, '2')); $enabled = (($enabled == 0 || $enabled == 3) ? 0 : $enabled); - $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1, 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => $enabled && $extrafields->attributes[$object->table_element]['perms'][$key]); + $arrayfields["ef.".$key] = array('label' => $extrafields->attributes[$object->table_element]['label'][$key], 'checked' => ($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? '0' : '1', 'position' => $extrafields->attributes[$object->table_element]['pos'][$key], 'enabled' => (string) (int) ($enabled && $extrafields->attributes[$object->table_element]['perms'][$key])); } } } diff --git a/htdocs/public/ticket/view.php b/htdocs/public/ticket/view.php index 41a51463b2d..63a4df51b62 100644 --- a/htdocs/public/ticket/view.php +++ b/htdocs/public/ticket/view.php @@ -2,6 +2,7 @@ /* Copyright (C) 2013-2016 Jean-François FERRY * Copyright (C) 2018-2024 Frédéric France * Copyright (C) 2023 Benjamin Falière + * Copyright (C) 2025 MDW * * 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 @@ -103,9 +104,9 @@ if ($cancel) { $action = 'view_ticket'; } +$display_ticket = false; if (in_array($action, array("view_ticket", "presend", "close", "confirm_public_close", "add_message", "add_contact"))) { // Test on permission not required here. Done later by using the $track_id + check email in session $error = 0; - $display_ticket = false; if (!strlen($track_id)) { $error++; array_push($object->errors, $langs->trans("ErrorFieldRequired", $langs->transnoentities("TicketTrackId"))); @@ -124,7 +125,7 @@ if (in_array($action, array("view_ticket", "presend", "close", "confirm_public_c } if (!$error) { - $ret = $object->fetch('', '', $track_id); + $ret = $object->fetch(0, '', $track_id); if ($ret && $object->dao->id > 0) { // Check if emails provided is the one of author $emailofticket = CMailFile::getValidAddress($object->dao->origin_email, 2); @@ -404,7 +405,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a $baseurl = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.'/public/ticket/'); $formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1', - 'returnurl' => $baseurl.'view.php'.(!empty($entity) && isModEnabled('multicompany')?'?entity='.$entity:'')); + 'returnurl' => $baseurl.'view.php'.(!empty($entity) && isModEnabled('multicompany') ? '?entity='.$entity : '')); $formticket->withfile = 2; $formticket->withcancel = 1; @@ -415,7 +416,7 @@ if ($action == "view_ticket" || $action == "presend" || $action == "close" || $a if ($action != 'presend') { $baseurl = getDolGlobalString('TICKET_URL_PUBLIC_INTERFACE', DOL_URL_ROOT.'/public/ticket/'); - print '
'; + print ''; print ''; print ''; print ''; diff --git a/htdocs/public/webportal/webportal.main.inc.php b/htdocs/public/webportal/webportal.main.inc.php index 7e2373aa07e..f09d3e6cb5e 100644 --- a/htdocs/public/webportal/webportal.main.inc.php +++ b/htdocs/public/webportal/webportal.main.inc.php @@ -2,7 +2,7 @@ /* Copyright (C) 2023-2024 Laurent Destailleur * Copyright (C) 2023-2024 Lionel Vessiller * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -57,7 +57,7 @@ if (!function_exists('dol_getprefix')) { * @param string $mode '' (prefix for session name) or 'email' (prefix for email id) * @return string A calculated prefix */ - function dol_getprefix($mode = '') + function dol_getprefix($mode = '') // @phan-suppress-current-line PhanRedefineFunction { global $dolibarr_main_instance_unique_id, $dolibarr_main_cookie_cryptkey; // This is loaded by filefunc.inc.php @@ -225,7 +225,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access $result = $logged_user->fetch($user_id); if ($result <= 0) { $error++; - $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedUser', $user_id); + $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedUser', (string) $user_id); dol_syslog($error_msg, LOG_ERR); $context->setEventMessages($error_msg, null, 'errors'); } @@ -237,7 +237,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access if (!$logged_thirdparty || !($logged_thirdparty->id > 0)) { $result = $websiteaccount->fetch_thirdparty(); if ($result < 0) { - $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedThirdParty', $websiteaccount->fk_soc); + $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedThirdParty', (string) $websiteaccount->fk_soc); //dol_syslog("Can't load third-party (ID: ".$websiteaccount->fk_soc.") even if session logged.", LOG_ERR); dol_syslog($error_msg, LOG_ERR); $context->setEventMessage($error_msg, 'errors'); @@ -253,7 +253,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access $result = $logged_member->fetch(0, '', $websiteaccount->thirdparty->id); if ($result < 0) { $error++; - $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedMember', $websiteaccount->thirdparty->id); + $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedMember', (string) $websiteaccount->thirdparty->id); dol_syslog($error_msg, LOG_ERR); $context->setEventMessage($error_msg, 'errors'); } @@ -265,7 +265,7 @@ if (!defined('WEBPORTAL_NOLOGIN') && !empty($context->controllerInstance->access $result = $logged_partnership->fetch(0, '', $logged_member->id, $websiteaccount->thirdparty->id); if ($result < 0) { $error++; - $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedPartnership', $websiteaccount->thirdparty->id, $logged_member->id); + $error_msg = $langs->transnoentitiesnoconv('WebPortalErrorFetchLoggedPartnership', (string) $websiteaccount->thirdparty->id, (string) $logged_member->id); dol_syslog($error_msg, LOG_ERR); $context->setEventMessage($error_msg, 'errors'); } diff --git a/htdocs/public/website/index.php b/htdocs/public/website/index.php index 8e2e029ce67..0b71ed384a4 100644 --- a/htdocs/public/website/index.php +++ b/htdocs/public/website/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -60,35 +60,39 @@ if (!defined('NOBROWSERNOTIF')) { /** * Header empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage * For other external page: http://server/url * @param string $target Target to use on links - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header + * @param int<0,1> $disablejs More content into html header + * @param int<0,1> $disablehead More content into html header * @param string[]|string $arrayofjs Array of complementary js files * @param string[]|string $arrayofcss Array of complementary css files * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. * @param string $replacemainareaby Replace call to main_area() by a print of this string - * @param int $disablenofollow Disable the "nofollow" on meta robot header - * @param int $disablenoindex Disable the "noindex" on meta robot header + * @param int<0,1> $disablenofollow Disable the "nofollow" on meta robot header + * @param int<0,1> $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { } /** * Footer empty * - * @param string $comment A text to add as HTML comment into HTML generated page - * @param string $zone 'private' (for private pages) or 'public' (for public pages) - * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them + * Note: also called by functions.lib:recordNotFound + * + * @param string $comment A text to add as HTML comment into HTML generated page + * @param 'private'|'public' $zone 'private' (for private pages) or 'public' (for public pages) + * @param int<0,1> $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { } @@ -131,13 +135,13 @@ if (empty($pageid)) { if ($pageref) { // @phan-suppress-next-line PhanPluginSuspiciousParamPosition - $result = $objectpage->fetch(0, $object->id, $pageref); + $result = $objectpage->fetch(0, (string) $object->id, $pageref); if ($result > 0) { $pageid = $objectpage->id; } elseif ($result == 0) { // Page not found from ref=pageurl, we try using alternative alias // @phan-suppress-next-line PhanPluginSuspiciousParamPosition - $result = $objectpage->fetch(0, $object->id, null, $pageref); + $result = $objectpage->fetch(0, (string) $object->id, null, $pageref); if ($result > 0) { $pageid = $objectpage->id; } diff --git a/htdocs/public/website/javascript.js.php b/htdocs/public/website/javascript.js.php index 7cd0a22b073..77494b08a6c 100644 --- a/htdocs/public/website/javascript.js.php +++ b/htdocs/public/website/javascript.js.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -51,35 +51,39 @@ if (!defined('NOBROWSERNOTIF')) { /** * Header empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage * For other external page: http://server/url * @param string $target Target to use on links - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header + * @param int<0,1> $disablejs More content into html header + * @param int<0,1> $disablehead More content into html header * @param string[]|string $arrayofjs Array of complementary js files * @param string[]|string $arrayofcss Array of complementary css files * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. * @param string $replacemainareaby Replace call to main_area() by a print of this string - * @param int $disablenofollow Disable the "nofollow" on meta robot header - * @param int $disablenoindex Disable the "noindex" on meta robot header + * @param int<0,1> $disablenofollow Disable the "nofollow" on meta robot header + * @param int<0,1> $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { } /** * Footer empty * - * @param string $comment A text to add as HTML comment into HTML generated page - * @param string $zone 'private' (for private pages) or 'public' (for public pages) - * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them + * Note: also called by functions.lib:recordNotFound + * + * @param string $comment A text to add as HTML comment into HTML generated page + * @param 'private'|'public' $zone 'private' (for private pages) or 'public' (for public pages) + * @param int<0,1> $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { } diff --git a/htdocs/public/website/styles.css.php b/htdocs/public/website/styles.css.php index f26ee0a2683..7d2d0c6d746 100644 --- a/htdocs/public/website/styles.css.php +++ b/htdocs/public/website/styles.css.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify @@ -51,35 +51,39 @@ if (!defined('NOBROWSERNOTIF')) { /** * Header empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page * Syntax is: For a wiki page: EN:EnglishPage|FR:FrenchPage|ES:SpanishPage|DE:GermanPage * For other external page: http://server/url * @param string $target Target to use on links - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header + * @param int<0,1> $disablejs More content into html header + * @param int<0,1> $disablehead More content into html header * @param string[]|string $arrayofjs Array of complementary js files * @param string[]|string $arrayofcss Array of complementary css files * @param string $morequerystring Query string to add to the link "print" to get same parameters (use only if autodetect fails) * @param string $morecssonbody More CSS on body tag. For example 'classforhorizontalscrolloftabs'. * @param string $replacemainareaby Replace call to main_area() by a print of this string - * @param int $disablenofollow Disable the "nofollow" on meta robot header - * @param int $disablenoindex Disable the "noindex" on meta robot header + * @param int<0,1> $disablenofollow Disable the "nofollow" on meta robot header + * @param int<0,1> $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { } /** * Footer empty * - * @param string $comment A text to add as HTML comment into HTML generated page - * @param string $zone 'private' (for private pages) or 'public' (for public pages) - * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them + * Note: also called by functions.lib:recordNotFound + * + * @param string $comment A text to add as HTML comment into HTML generated page + * @param 'private'|'public' $zone 'private' (for private pages) or 'public' (for public pages) + * @param int<0,1> $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { } From 45868680a7ad91ce1051cd1ff9fdd4d07d580a54 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 12 Feb 2025 11:24:02 +0100 Subject: [PATCH 375/375] Qual: Revert renaming of llxHeader/Footer(Vierge) because used in functions.lib:recordNotFound --- dev/tools/phan/baseline.txt | 5 ++-- htdocs/asterisk/wrapper.php | 10 +++++-- htdocs/document.php | 4 +++ htdocs/imports/emptyexample.php | 12 +++++--- htdocs/main.inc.php | 8 ++++-- htdocs/public/agenda/agendaexport.php | 28 +++++++++++-------- htdocs/public/bookcal/index.php | 6 ++-- htdocs/public/company/new.php | 16 +++++++---- htdocs/public/demo/index.php | 12 +++++--- htdocs/public/donations/donateurs_code.php | 16 +++++++---- htdocs/public/emailing/mailing-read.php | 8 ++++-- .../public/eventorganization/attendee_new.php | 12 +++++--- .../eventorganization/subscriptionok.php | 4 ++- htdocs/public/members/new.php | 16 +++++++---- htdocs/public/members/public_card.php | 12 +++++--- htdocs/public/members/public_list.php | 12 +++++--- htdocs/public/partnership/new.php | 16 +++++++---- htdocs/viewimage.php | 10 +++++-- 18 files changed, 136 insertions(+), 71 deletions(-) diff --git a/dev/tools/phan/baseline.txt b/dev/tools/phan/baseline.txt index ee7622c3050..f98253d5219 100644 --- a/dev/tools/phan/baseline.txt +++ b/dev/tools/phan/baseline.txt @@ -28,7 +28,6 @@ return [ // PhanTypeComparisonFromArray : 8 occurrences // PhanPluginDuplicateExpressionBinaryOp : 6 occurrences // PhanPluginUnknownObjectMethodCall : 6 occurrences - // PhanRedefineFunction : 6 occurrences // PhanTypeArraySuspiciousNull : 6 occurrences // PhanParamTooMany : 5 occurrences // PhanPluginDuplicateArrayKey : 4 occurrences @@ -38,6 +37,7 @@ return [ // PhanPluginBothLiteralsBinaryOp : 3 occurrences // PhanEmptyForeach : 2 occurrences // PhanPluginEmptyStatementIf : 2 occurrences + // PhanRedefineFunction : 2 occurrences // PhanTypeMismatchDimAssignment : 2 occurrences // PhanTypeSuspiciousStringExpression : 2 occurrences // PhanAccessMethodProtected : 1 occurrence @@ -142,7 +142,6 @@ return [ 'htdocs/asset/tpl/accountancy_codes_edit.tpl.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentProbablyReal'], 'htdocs/asset/tpl/depreciation_options_edit.tpl.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredProperty'], 'htdocs/asset/tpl/linkedobjectblock.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/asterisk/wrapper.php' => ['PhanRedefineFunction'], 'htdocs/barcode/printsheet.php' => ['PhanPluginDuplicateExpressionBinaryOp', 'PhanTypeMismatchArgumentNullable'], 'htdocs/bom/bom_card.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable', 'PhanUndeclaredProperty'], 'htdocs/bom/bom_list.php' => ['PhanTypeMismatchArgument'], @@ -751,7 +750,7 @@ return [ 'htdocs/variants/list.php' => ['PhanTypeMismatchArgument'], 'htdocs/variants/tpl/productattributevalueline_edit.tpl.php' => ['PhanUndeclaredProperty'], 'htdocs/variants/tpl/productattributevalueline_view.tpl.php' => ['PhanUndeclaredProperty'], - 'htdocs/viewimage.php' => ['PhanRedefineFunction', 'PhanUndeclaredMethod'], + 'htdocs/viewimage.php' => ['PhanUndeclaredMethod'], 'htdocs/webhook/class/api_webhook.class.php' => ['PhanPluginUnknownArrayMethodParamType', 'PhanPluginUnknownArrayMethodReturnType'], 'htdocs/webhook/class/target.class.php' => ['PhanUndeclaredMethod'], 'htdocs/webhook/target_card.php' => ['PhanTypeMismatchArgumentProbablyReal', 'PhanUndeclaredGlobalVariable'], diff --git a/htdocs/asterisk/wrapper.php b/htdocs/asterisk/wrapper.php index 952dec310b6..5fa452e781f 100644 --- a/htdocs/asterisk/wrapper.php +++ b/htdocs/asterisk/wrapper.php @@ -1,7 +1,7 @@ * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -51,6 +51,8 @@ if (!defined('NOREQUIREAJAX')) { /** * Empty header * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page @@ -68,7 +70,7 @@ if (!defined('NOREQUIREAJAX')) { * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { print ''."\n"; print ''."\n"; @@ -79,12 +81,14 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab /** * Empty footer * + * Note: also called by functions.lib:recordNotFound + * * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { print "\n".''."\n"; } diff --git a/htdocs/document.php b/htdocs/document.php index 7f8a17c3d0e..bab5a9b5b5e 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -79,6 +79,8 @@ if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias')) { /** * Header empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page @@ -103,6 +105,8 @@ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disab /** * Footer empty * + * Note: also called by functions.lib:recordNotFound + * * @ignore * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) diff --git a/htdocs/imports/emptyexample.php b/htdocs/imports/emptyexample.php index cd05fcfe1ac..6673681f83d 100644 --- a/htdocs/imports/emptyexample.php +++ b/htdocs/imports/emptyexample.php @@ -31,6 +31,8 @@ if (!defined('NOTOKENRENEWAL')) { /** * This file is a wrapper, so empty header * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page @@ -48,7 +50,7 @@ if (!defined('NOTOKENRENEWAL')) { * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeaderEmptyExample($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { print 'Build an import example file'; } @@ -56,12 +58,14 @@ function llxHeaderEmptyExample($head = '', $title = '', $help_url = '', $target /** * This file is a wrapper, so empty footer * + * Note: also called by functions.lib:recordNotFound + * * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooterEmptyExample($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { print ''; } @@ -90,9 +94,9 @@ $langs->load("exports"); if (empty($datatoimport)) { $user->loadRights(); - llxHeaderEmptyExample(); + llxHeader(); print '
Bad value for datatoimport.
'; - llxFooterEmptyExample(); + llxFooter(); exit; } diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 0b07dd0b80a..b08badda776 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1633,6 +1633,8 @@ if (!function_exists("llxHeader")) { /** * Show HTML header HTML + BODY + Top menu + left menu + DIV * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page @@ -1649,7 +1651,7 @@ if (!function_exists("llxHeader")) { * @param int $disablenofollow Disable the "nofollow" on meta robot header * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void - * @phan-suppress PhanRedefineFunction (Also defined in htdocs/asterisk/wrapper) + * @phan-suppress PhanRedefineFunction */ function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) { @@ -3876,11 +3878,13 @@ if (!function_exists("llxFooter")) { * Close div /DIV class=fiche + /DIV id-right + /DIV id-container + /BODY + /HTML. * If global var $delayedhtmlcontent was filled, we output it just before closing the body. * + * Note: also called by functions.lib:recordNotFound + * * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void - * @phan-suppress PhanRedefineFunction // Also defined at asterisk/wrapper.php + * @phan-suppress PhanRedefineFunction */ function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) { diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index c3d75a02842..921d652d1a5 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -59,6 +59,8 @@ if (!defined('NOIPCHECK')) { /** * Header function * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -67,16 +69,18 @@ if (!defined('NOIPCHECK')) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderAgendaExport($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { print 'Export agenda cal'; } /** * Footer function * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterAgendaExport() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { print ''; } @@ -180,9 +184,9 @@ if (!getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY')) { top_httphead(); - llxHeaderAgendaExport(""); + llxHeaderVierge(""); print '
Module Agenda was not configured properly.
'; - llxFooterAgendaExport(); + llxFooterVierge(); exit; } @@ -193,13 +197,13 @@ $reshook = $hookmanager->executeHooks('doActions', $filters); // Note that $acti if ($reshook < 0) { top_httphead(); - llxHeaderAgendaExport(""); + llxHeaderVierge(""); if (!empty($hookmanager->errors) && is_array($hookmanager->errors)) { print '
'.implode('
', $hookmanager->errors).'
'; } else { print '
'.$hookmanager->error.'
'; } - llxFooterAgendaExport(); + llxFooterVierge(); } elseif (empty($reshook)) { // Check exportkey if (!GETPOST("exportkey") || getDolGlobalString('MAIN_AGENDA_XCAL_EXPORTKEY') != GETPOST("exportkey")) { @@ -207,9 +211,9 @@ if ($reshook < 0) { top_httphead(); - llxHeaderAgendaExport(""); + llxHeaderVierge(""); print '
Bad value for key.
'; - llxFooterAgendaExport(); + llxFooterVierge(); exit; } } @@ -282,9 +286,9 @@ if ($shortfilename == 'dolibarrcalendar') { top_httphead(); - llxHeaderAgendaExport(""); + llxHeaderVierge(""); print '
'.$langs->trans("ErrorWrongValueForParameterX", 'format').'
'; - llxFooterAgendaExport(); + llxFooterVierge(); exit; } @@ -407,6 +411,6 @@ if ($format == 'rss') { top_httphead(); -llxHeaderAgendaExport(""); +llxHeaderVierge(""); print '
'.$agenda->error.'
'; -llxFooterAgendaExport(); +llxFooterVierge(); diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php index 9f5b7fee892..41e25d9d24e 100644 --- a/htdocs/public/bookcal/index.php +++ b/htdocs/public/bookcal/index.php @@ -125,6 +125,8 @@ $errmsg = ''; /** * Show header for booking * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -133,7 +135,7 @@ $errmsg = ''; * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderBookCal($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -304,7 +306,7 @@ if ($action == 'add') { // Test on permission not required here (anonymous actio $form = new Form($db); -llxHeaderBookCal('BookingCalendar'); +llxHeaderVierge('BookingCalendar'); print '

'.(!empty($object->label) ? $object->label : $object->ref).'

'; diff --git a/htdocs/public/company/new.php b/htdocs/public/company/new.php index f9928fcd274..e52cc805ecd 100644 --- a/htdocs/public/company/new.php +++ b/htdocs/public/company/new.php @@ -109,6 +109,8 @@ $extrafields->fetch_name_optionals_label($objectsoc->table_element); // fetch op /** * Show header for new prospect * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -117,7 +119,7 @@ $extrafields->fetch_name_optionals_label($objectsoc->table_element); // fetch op * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderCompanyNew($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -164,9 +166,11 @@ function llxHeaderCompanyNew($title, $head = "", $disablejs = 0, $disablehead = /** * Show footer for new societe * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterCompanyNew() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs; @@ -288,7 +292,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // backtopage parameter with an url was set on prospect submit page, we never go here because a redirect was done to this url. if (empty($reshook) && $action == 'added') { // Test on permission not required here - llxHeaderCompanyNew("newSocieteAdded"); + llxHeaderVierge("newSocieteAdded"); // If we have not been redirected print '

'; @@ -296,7 +300,7 @@ if (empty($reshook) && $action == 'added') { // Test on permission not required print $langs->trans("newSocieteAdded"); print ''; - llxFooterCompanyNew(); + llxFooterVierge(); exit; } @@ -312,7 +316,7 @@ $adht = new AdherentType($db); $formadmin = new FormAdmin($db); -llxHeaderCompanyNew($langs->trans("ContactUs")); +llxHeaderVierge($langs->trans("ContactUs")); print '
'; print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"') . '   ' . $langs->trans("ContactUs"), '', '', 0, '', 'center'); @@ -489,6 +493,6 @@ print ''; -llxFooterCompanyNew(); +llxFooterVierge(); $db->close(); diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 700b5e19b24..386ed8cf212 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -283,7 +283,7 @@ jQuery(document).ready(function () { }); '; -llxHeaderDemoIndex($langs->trans("DolibarrDemo"), $head); +llxHeaderVierge($langs->trans("DolibarrDemo"), $head); print "\n"; @@ -468,7 +468,7 @@ if (isModEnabled('google') && getDolGlobalString('MAIN_GOOGLE_AD_CLIENT') && get } } -llxFooterDemoIndex(); +llxFooterVierge(); $db->close(); @@ -476,6 +476,8 @@ $db->close(); /** * Show header for demo * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -484,7 +486,7 @@ $db->close(); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderDemoIndex($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { top_httphead(); @@ -496,9 +498,11 @@ function llxHeaderDemoIndex($title, $head = "", $disablejs = 0, $disablehead = 0 /** * Show footer for demo * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterDemoIndex() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { printCommonFooter('public'); diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index 34a80c707e7..f9c5e526c62 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -35,6 +35,10 @@ if (!defined('NOIPCHECK')) { // C'est un wrapper, donc header vierge /** + * Header function + * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -43,16 +47,18 @@ if (!defined('NOIPCHECK')) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderDonatorCodes($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { print 'List of donators'; } /** - * Header function + * Footer function + * + * Note: also called by functions.lib:recordNotFound * * @return void */ -function llxFooterDonatorCodes() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { print ''; } @@ -74,7 +80,7 @@ $langs->load("donations"); * View */ -llxHeaderDonatorCodes(""); +llxHeaderVierge(""); $sql = "SELECT d.datedon as datedon, d.lastname, d.firstname, d.amount, d.public, d.societe"; $sql .= " FROM ".MAIN_DB_PREFIX."don as d"; @@ -116,4 +122,4 @@ if ($resql) { $db->close(); -llxFooterDonatorCodes(); +llxFooterVierge(); diff --git a/htdocs/public/emailing/mailing-read.php b/htdocs/public/emailing/mailing-read.php index 8530271fcba..20e4fde4f5a 100644 --- a/htdocs/public/emailing/mailing-read.php +++ b/htdocs/public/emailing/mailing-read.php @@ -55,6 +55,8 @@ if (!defined('NOSESSION')) { /** * Header empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page @@ -72,7 +74,7 @@ if (!defined('NOSESSION')) { * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeaderReadMailing($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { } @@ -80,12 +82,14 @@ function llxHeaderReadMailing($head = '', $title = '', $help_url = '', $target = /** * Footer empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooterReadMailing($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { } diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index 5199143d38b..e477f039a7e 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -171,6 +171,8 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio /** * Show header for new member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -179,7 +181,7 @@ $extrafields->fetch_name_optionals_label($object->table_element); // fetch optio * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderNewAttendee($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -226,9 +228,11 @@ function llxHeaderNewAttendee($title, $head = "", $disablejs = 0, $disablehead = /** * Show footer for new member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterNewAttendee() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { print ''; @@ -719,7 +723,7 @@ if (empty($reshook) && $action == 'add' && (!empty($conference->id) && $conferen $form = new Form($db); $formcompany = new FormCompany($db); -llxHeaderNewAttendee($langs->trans("NewRegistration")); +llxHeaderVierge($langs->trans("NewRegistration")); print '
'; @@ -964,6 +968,6 @@ if ((!empty($conference->id) && $conference->status == ConferenceOrBooth::STATUS print '
'; -llxFooterNewAttendee(); +llxFooterVierge(); $db->close(); diff --git a/htdocs/public/eventorganization/subscriptionok.php b/htdocs/public/eventorganization/subscriptionok.php index d0ac5f4020d..daebe11fe54 100644 --- a/htdocs/public/eventorganization/subscriptionok.php +++ b/htdocs/public/eventorganization/subscriptionok.php @@ -97,6 +97,8 @@ if (empty($conf->eventorganization->enabled)) { /** * Show header for new member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -105,7 +107,7 @@ if (empty($conf->eventorganization->enabled)) { * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderSubscriptionOk($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderSubscriptionOk($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $user, $conf, $langs, $mysoc; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 6b65f81e284..51c4191195d 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -113,6 +113,8 @@ $user->loadDefaultValues(); /** * Show header for new member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -121,7 +123,7 @@ $user->loadDefaultValues(); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderMembersNew($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -168,9 +170,11 @@ function llxHeaderMembersNew($title, $head = "", $disablejs = 0, $disablehead = /** * Show footer for new member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterMembersNew() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs; @@ -500,7 +504,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. if (empty($reshook) && $action == 'added') { // Test on permission not required here - llxHeaderMembersNew($langs->trans("NewMemberForm")); + llxHeaderVierge($langs->trans("NewMemberForm")); // If we have not been redirected print '

'; @@ -508,7 +512,7 @@ if (empty($reshook) && $action == 'added') { // Test on permission not required print $langs->trans("NewMemberbyWeb"); print ''; - llxFooterMembersNew(); + llxFooterVierge(); exit; } @@ -524,7 +528,7 @@ $adht = new AdherentType($db); $extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels -llxHeaderMembersNew($langs->trans("NewSubscription")); +llxHeaderVierge($langs->trans("NewSubscription")); print '
'; print load_fiche_titre(img_picto('', 'member_nocolor', 'class="pictofixedwidth"').'   '.$langs->trans("NewSubscription"), '', '', 0, '', 'center'); @@ -979,6 +983,6 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR } //htmlPrintOnlineFooter($mysoc, $langs); -llxFooterMembersNew(); +llxFooterVierge(); $db->close(); diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index cd76656de90..02a959dcd4b 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -91,7 +91,7 @@ if (getDolGlobalString('MEMBER_PUBLIC_CSS')) { $morehead = ''; } -llxHeaderMembersPubCard($langs->trans("MemberCard"), $morehead); +llxHeaderVierge($langs->trans("MemberCard"), $morehead); // fetch optionals attributes and labels $extrafields->fetch_name_optionals_label($object->table_element); @@ -140,7 +140,7 @@ if ($id > 0) { } -llxFooterMembersPubCard(); +llxFooterVierge(); $db->close(); @@ -149,6 +149,8 @@ $db->close(); /** * Show header for card member * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -157,7 +159,7 @@ $db->close(); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderMembersPubCard($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { top_htmlhead($head, $title); @@ -167,9 +169,11 @@ function llxHeaderMembersPubCard($title, $head = "", $disablejs = 0, $disablehea /** * Show footer for card member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterMembersPubCard() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { printCommonFooter('public'); diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index b655475d954..545be243193 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -66,6 +66,8 @@ $langs->loadLangs(array("main", "members", "companies", "other")); /** * Show header for member list * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int $disablejs More content into html header @@ -74,7 +76,7 @@ $langs->loadLangs(array("main", "members", "companies", "other")); * @param string[]|string $arrayofcss Array of complementary css files * @return void */ -function llxHeaderMembersPubList($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { top_htmlhead($head, $title); @@ -84,9 +86,11 @@ function llxHeaderMembersPubList($title, $head = "", $disablejs = 0, $disablehea /** * Show footer for member list * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterMembersPubList() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { printCommonFooter('public'); @@ -134,7 +138,7 @@ if (getDolGlobalString('MEMBER_PUBLIC_CSS')) { $morehead = ''; } -llxHeaderMembersPubList($langs->trans("ListOfValidatedPublicMembers"), $morehead); +llxHeaderVierge($langs->trans("ListOfValidatedPublicMembers"), $morehead); $sql = "SELECT rowid, firstname, lastname, societe, zip, town, email, birth, photo"; @@ -216,6 +220,6 @@ if ($result) { } -llxFooterMembersPubList(); +llxFooterVierge(); $db->close(); diff --git a/htdocs/public/partnership/new.php b/htdocs/public/partnership/new.php index 3a7ad036925..b84fc790aa8 100644 --- a/htdocs/public/partnership/new.php +++ b/htdocs/public/partnership/new.php @@ -100,6 +100,8 @@ $user->loadDefaultValues(); /** * Show header for new partnership * + * Note: also called by functions.lib:recordNotFound + * * @param string $title Title * @param string $head Head array * @param int<0,1> $disablejs More content into html header @@ -108,7 +110,7 @@ $user->loadDefaultValues(); * @param string[] $arrayofcss Array of complementary css files * @return void */ -function llxHeaderPartnershipNew($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) +function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs, $mysoc; @@ -155,9 +157,11 @@ function llxHeaderPartnershipNew($title, $head = "", $disablejs = 0, $disablehea /** * Show footer for new member * + * Note: also called by functions.lib:recordNotFound + * * @return void */ -function llxFooterPartnershipNew() +function llxFooterVierge() // @phan-suppress-current-line PhanRedefineFunction { global $conf, $langs; @@ -535,7 +539,7 @@ if (empty($reshook) && $action == 'add') { // Test on permission not required he // If PARTNERSHIP_URL_REDIRECT_SUBSCRIPTION is set to url we never go here because a redirect was done to this url. // backtopage parameter with an url was set on member submit page, we never go here because a redirect was done to this url. if (empty($reshook) && $action == 'added') { // Test on permission not required here - llxHeaderPartnershipNew($langs->trans("NewPartnershipForm")); + llxHeaderVierge($langs->trans("NewPartnershipForm")); // Si on a pas ete redirige print '

'; @@ -543,7 +547,7 @@ if (empty($reshook) && $action == 'added') { // Test on permission not required print $langs->trans("NewPartnershipbyWeb"); print ''; - llxFooterPartnershipNew(); + llxFooterVierge(); exit; } @@ -559,7 +563,7 @@ $formcompany = new FormCompany($db); $extrafields->fetch_name_optionals_label($object->table_element); // fetch optionals attributes and labels -llxHeaderPartnershipNew($langs->trans("NewPartnershipRequest")); +llxHeaderVierge($langs->trans("NewPartnershipRequest")); print '
'; print load_fiche_titre(img_picto('', 'hands-helping', 'class="pictofixedwidth"').'   '.$langs->trans("NewPartnershipRequest"), '', '', 0, '', 'center'); @@ -717,6 +721,6 @@ print "
"; print ''; -llxFooterPartnershipNew(); +llxFooterVierge(); $db->close(); diff --git a/htdocs/viewimage.php b/htdocs/viewimage.php index 1bbf7224a02..f2f38ee3c05 100644 --- a/htdocs/viewimage.php +++ b/htdocs/viewimage.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2016 Laurent Destailleur * Copyright (C) 2005-2016 Regis Houssin * Copyright (C) 2024 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2024-2025 MDW * * 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 @@ -114,6 +114,8 @@ if (is_numeric($entity)) { /** * Header empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $head Optional head lines * @param string $title HTML title * @param string $help_url Url links to help page @@ -131,18 +133,20 @@ if (is_numeric($entity)) { * @param int $disablenoindex Disable the "noindex" on meta robot header * @return void */ -function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) +function llxHeader($head = '', $title = '', $help_url = '', $target = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $morequerystring = '', $morecssonbody = '', $replacemainareaby = '', $disablenofollow = 0, $disablenoindex = 0) // @phan-suppress-current-line PhanRedefineFunction { } /** * Footer empty * + * Note: also called by functions.lib:recordNotFound + * * @param string $comment A text to add as HTML comment into HTML generated page * @param string $zone 'private' (for private pages) or 'public' (for public pages) * @param int $disabledoutputofmessages Clear all messages stored into session without displaying them * @return void */ -function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) +function llxFooter($comment = '', $zone = 'private', $disabledoutputofmessages = 0) // @phan-suppress-current-line PhanRedefineFunction { }