From 853f62dfaccc867897ddeb3d23f566b3cb70ceb0 Mon Sep 17 00:00:00 2001 From: Baptiste Boulongne Date: Thu, 24 Oct 2024 00:20:55 +0200 Subject: [PATCH 1/3] FIX #31486 Add missing url params considering filtertype (#31488) Add missing url params to the BOM's create product (or service) button taking into account the filtertype --- htdocs/bom/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_create.tpl.php b/htdocs/bom/tpl/objectline_create.tpl.php index 72e764322b4..ae53dd2f173 100644 --- a/htdocs/bom/tpl/objectline_create.tpl.php +++ b/htdocs/bom/tpl/objectline_create.tpl.php @@ -142,7 +142,7 @@ if (isModEnabled("product") || isModEnabled("service")) { } else { print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), 0, $statustoshow, 2, '', 1, array(), 0, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOSTINT('combinations'), 1); } - $urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); + $urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create'.(($filtertype == 1) ? '&leftmenu=service&type=1' : '&leftmenu=product&type=0').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id); print ''; echo ''; From 2f81c32315d603e61a8ccd0054ca49eb7c40cff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 24 Oct 2024 00:26:36 +0200 Subject: [PATCH 2/3] fix phpstan (#31481) * fix phpstan * fix phpstan --- htdocs/delivery/class/delivery.class.php | 8 +++----- phpstan.neon.dist | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 6dedf4f6ebd..dcc64cb67db 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -273,7 +273,7 @@ class Delivery extends CommonObject * Create a line * * @param int $origin_id Id of order - * @param string $qty Quantity + * @param float $qty Quantity * @param int $fk_product Id of predefined product * @param string $description Description * @param array $array_options Array options @@ -637,8 +637,6 @@ class Delivery extends CommonObject */ public function addline($origin_id, $qty, $array_options = []) { - global $conf; - $num = count($this->lines); $line = new DeliveryLine($this->db); @@ -763,8 +761,8 @@ class Delivery extends CommonObject $datas = []; - $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("ShowReceiving").':
'; - $datas['picto'] .= ''.$langs->trans("Status").': '.$this->ref; + $datas['picto'] = img_picto('', $this->picto, '', 0, 0, 0, '', 'paddingrightonly').' '.$langs->trans("ShowReceiving").':
'; + $datas['ref'] = ''.$langs->trans("Ref").': '.$this->ref; return $datas; } diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ad0b9ecb33b..328d5e51d64 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -94,7 +94,6 @@ parameters: - '#(?:F(?:acture(?:(?:Fournisseur)?Rec::addline\(\))|ichinterRec::addLineRec\(\))|dolMd2Html|setEventMessages) expects string\|null,#' - '#::printStdColumnContent\(\) expects string, float(\|(int|array)(\<.*\>)?)* given.#' - '#::HTML2OpenIDServer\(\) expects string, array given.#' - - '#create_line\(\) expects string, float given.#' - '# dol_stringtotime expects string, DateTime given.#' - '#expects string, bool\|mysqli_result\|resource given.#' - '#( |::)((multi)?selectarray)\(\) expects array#' From e2ac3330a880bd7fb694c003f50f7ec97afc85c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 24 Oct 2024 00:27:53 +0200 Subject: [PATCH 3/3] fix phpstan (#31480) --- htdocs/core/lib/salaries.lib.php | 8 ++++---- htdocs/salaries/virement_request.php | 9 +++++---- phpstan.neon.dist | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/htdocs/core/lib/salaries.lib.php b/htdocs/core/lib/salaries.lib.php index 4a6133a54a7..47e6b2c04c0 100644 --- a/htdocs/core/lib/salaries.lib.php +++ b/htdocs/core/lib/salaries.lib.php @@ -1,9 +1,9 @@ - * Copyright (C) 2019 Alexandre Spangaro + * Copyright (C) 2015 Charlie BENKE + * Copyright (C) 2019 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2023 Frédéric France + * Copyright (C) 2023-2024 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -25,7 +25,7 @@ * Returns an array with the tabs for the "salaries" section * It loads tabs from modules looking for the entity salaries * - * @param Paiement $object Current salaries object + * @param Salary $object Current salaries object * @return array Tabs for the salaries section */ function salaries_prepare_head($object) diff --git a/htdocs/salaries/virement_request.php b/htdocs/salaries/virement_request.php index a2733f878b4..e3c85b76ca4 100644 --- a/htdocs/salaries/virement_request.php +++ b/htdocs/salaries/virement_request.php @@ -1,9 +1,10 @@ - * Copyright (C) 2015 Charlie BENKE - * Copyright (C) 2017-2019 Alexandre Spangaro +/* Copyright (C) 2005-2015 Laurent Destailleur + * Copyright (C) 2015 Charlie BENKE + * Copyright (C) 2017-2019 Alexandre Spangaro * Copyright (C) 2021 Gauthier VERDOL - * Copyright (C) 2024 MDW + * Copyright (C) 2024 MDW + * Copyright (C) 2024 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 diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 328d5e51d64..a0a27d6606b 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -111,7 +111,6 @@ parameters: - '#(?:ldap_(?:(?:ad|bin)d|delete|err(?:no|or)|first_entry|get_(?:(?:attribut|entri)es|(?:optio|values_le)n)|mod_(?:add|del|replace)|rename|set_option|unbind)) expects LDAP\\Connection#' - '#(?:MultiCurrencies::_cleanObjectDatasRate\(\)) expects MultiCurrency#' - '# (?:pdf_(?:(?:eagle_proforma::drawTotalTable|muscadet::_tableau_tot)\(\))) expects Facture#' - - '# (?:salaries_prepare_head) expects Paiement#' - '# (?:pg_(?:affected_rows|f(?:etch_(?:array|object|row)|ree_result)|num_rows)) expects PgSql\\Result#' - '# (?:Holiday::getNextNumRef\(\)|get_localtax|pdf_pagefoot|societe_prepare_head) expects Societe#' - '# (?:Common(?:DocGenerator::get(?:(?:ExtrafieldsInHtml|_substitutionarray_lines)\(\))|Object::printO(?:(?:bject|rigin)Line\(\)))) expects CommonObjectLine#'