From 8c790818fbedea7394b3960ee0dbfa3fcc7a8c69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 21 Nov 2022 12:20:44 +0100 Subject: [PATCH 1/4] add hook in productlot tooltip --- htdocs/product/stock/class/productlot.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 7009d0d55fc..f8574e919a5 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2014 Juanjo Menent * Copyright (C) 2015 Florian Henry * Copyright (C) 2015 Raphaël Doursenaud - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2022 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 @@ -596,7 +596,7 @@ class Productlot extends CommonObject */ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $maxlen = 24, $morecss = '', $save_lastsearch_value = -1) { - global $langs, $conf, $db; + global $langs, $conf, $hookmanager, $db; global $dolibarr_main_authentication, $dolibarr_main_demo; global $menumanager; @@ -658,6 +658,16 @@ class Productlot extends CommonObject } $result .= $linkend; + global $action; + $hookmanager->initHooks(array('productlotdao')); + $parameters = array('id' => $this->id, 'getnomurl' => $result); + $reshook = $hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks + if ($reshook > 0) { + $result = $hookmanager->resPrint; + } else { + $result .= $hookmanager->resPrint; + } + return $result; } From 15d26a4b591203b6f5f183e0d631385b304756b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 21 Nov 2022 14:13:15 +0100 Subject: [PATCH 2/4] Update product.php --- htdocs/product/stock/product.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index b0771bc39d9..0be0ac52945 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2018 Juanjo Menent * Copyright (C) 2014-2015 Cédric Gross * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2019 Frédéric France + * Copyright (C) 2018-2022 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -1132,6 +1132,7 @@ if (!$variants) { } foreach ($details as $pdluo) { $product_lot_static->id = $pdluo->lotid; + $product_lot_static->fk_product = $pdluo->fk_product_stock; $product_lot_static->batch = $pdluo->batch; $product_lot_static->eatby = $pdluo->eatby; $product_lot_static->sellby = $pdluo->sellby; From be7d11aaff9e9106961fa814b115ab63da073156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 29 Nov 2022 12:16:15 +0100 Subject: [PATCH 3/4] Update product.php --- htdocs/product/stock/product.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 0be0ac52945..b0771bc39d9 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -8,7 +8,7 @@ * Copyright (C) 2013-2018 Juanjo Menent * Copyright (C) 2014-2015 Cédric Gross * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2022 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * * This program is free software; you can redistribute it and/or modify @@ -1132,7 +1132,6 @@ if (!$variants) { } foreach ($details as $pdluo) { $product_lot_static->id = $pdluo->lotid; - $product_lot_static->fk_product = $pdluo->fk_product_stock; $product_lot_static->batch = $pdluo->batch; $product_lot_static->eatby = $pdluo->eatby; $product_lot_static->sellby = $pdluo->sellby; From ca95d26f17d29426a6d12e45610b3f75246ffb60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Wed, 21 Dec 2022 14:21:16 +0100 Subject: [PATCH 4/4] NEW option filter in proposals NEW option filter for NoSalesRepresentativeAffected in proposals list --- htdocs/comm/propal/list.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index ed86a61d7bd..2426abad9f4 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -16,6 +16,7 @@ * Copyright (C) 2019-2021 Alexandre Spangaro * Copyright (C) 2021 Anthony Berton * Copyright (C) 2021 Frédéric France + * Copyright (C) 2022 Josep Lluís Amador * * 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 @@ -610,7 +611,9 @@ $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_availability as ava on (ava.rowid = p.fk_availability)"; // We'll need this table joined to the select in order to filter by sale -if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { +if ($search_sale == -2) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON (sc.fk_soc = p.fk_soc)"; +} elseif ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; } if ($search_user > 0) { @@ -746,7 +749,9 @@ if ($search_date_delivery_start) { if ($search_date_delivery_end) { $sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'"; } -if ($search_sale > 0) { +if ($search_sale == -2) { + $sql .= " AND sc.fk_user IS NULL"; +} elseif ($search_sale > 0) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale); } if ($search_user > 0) { @@ -1117,7 +1122,7 @@ if ($resql) { $langs->load("commercial"); $moreforfilter .= '
'; $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative'); - $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250 widthcentpercentminusx'); + $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250 widthcentpercentminusx', 1); $moreforfilter .= '
'; } // If the user can view prospects other than his'