From db06de0ac2e1e6c499184789ff86433c3647c351 Mon Sep 17 00:00:00 2001 From: atm-greg Date: Tue, 30 Nov 2021 16:27:50 +0100 Subject: [PATCH 1/3] add printFieldListHaving hook --- htdocs/comm/propal/list.php | 5 +++++ htdocs/commande/list.php | 5 +++++ htdocs/expedition/list.php | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 4f59682abb8..3e467539c88 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -696,6 +696,11 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= $db->order($sortfield, $sortorder); $sql .= ', p.ref DESC'; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 9c278359acc..b534d915914 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -628,6 +628,11 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= $db->order($sortfield, $sortorder); // Count total nb of records diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 6a1b26fa19f..79ed3b52215 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -373,6 +373,11 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; +// Add HAVING from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= !empty($hookmanager->resPrint) ? (' HAVING 1=1 ' . $hookmanager->resPrint) : ''; + $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; From 202b123aaaf0d5b5615e607d364a9009b38850b7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 2 Dec 2021 15:10:29 +0100 Subject: [PATCH 2/3] FIX compatibility with multicompany --- htdocs/societe/card.php | 4 ++-- htdocs/societe/website.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index e5a624ec07f..fdff7c1940a 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -900,7 +900,7 @@ if (empty($reshook)) { // Actions to build doc $id = $socid; - $upload_dir = $conf->societe->dir_output; + $upload_dir = $conf->societe->multidir_output[$object->entity]; $permissiontoadd = $user->rights->societe->creer; include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -3006,7 +3006,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Presend form $modelmail = 'thirdparty'; $defaulttopic = 'Information'; - $diroutput = $conf->societe->dir_output; + $diroutput = $conf->societe->multidir_output[$object->entity]; $trackid = 'thi'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 0740200867d..7d79a429eea 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -159,7 +159,7 @@ if (empty($reshook)) { $objectlabel = 'WebsiteAccount'; $permissiontoread = $user->rights->societe->lire; $permissiontodelete = $user->rights->societe->supprimer; - $uploaddir = $conf->societe->dir_output; + $uploaddir = $conf->societe->multidir_output[$object->entity]; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; } From 6af2626f081e18f736f92dbf30d980039ea56659 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Mon, 6 Dec 2021 16:55:51 +0100 Subject: [PATCH 3/3] FIX: contact card: bad colspan value for separator extrafield in creation/modification form --- htdocs/contact/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 5110e08e2fc..a43c7c34e7f 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -850,7 +850,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Other attributes - $parameters = array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3); + $parameters = array('socid' => $socid, 'objsoc' => $objsoc, 'colspan' => ' colspan="3"', 'cols' => 3, 'colspanvalue' => 3); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; print "
"; @@ -1161,7 +1161,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Other attributes - $parameters = array('colspan' => ' colspan="3"', 'cols'=> '3'); + $parameters = array('colspan' => ' colspan="3"', 'cols'=> '3', 'colspanvalue'=> '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; $object->load_ref_elements();