From a6c6f9eb08443c2dd4e0c4e7568573ed08002521 Mon Sep 17 00:00:00 2001 From: Pierre Payet Date: Mon, 19 Apr 2021 10:20:51 +0200 Subject: [PATCH 1/4] add missing printFieldListFrom hook --- htdocs/fichinter/list.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index d054f5e5bcc..d690feb7407 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -223,6 +223,10 @@ if (!empty($conf->contrat->enabled)) { } if (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 (f.rowid = ef.fk_object)"; if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; if (!$user->rights->societe->client->voir && empty($socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE f.entity IN (".getEntity('intervention').")"; From 379cb74cd921764f522f4331d678a2a36d24037c Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 22 Apr 2021 17:09:33 +0200 Subject: [PATCH 2/4] FIX tag selector error if supplier disable --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 00c74544d17..ff278ccd719 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -575,7 +575,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) $moreforfilter .= $formother->select_categories(Categorie::TYPE_CUSTOMER, $search_categ_thirdparty, 'search_categ_thirdparty', 1); $moreforfilter .= ''; } - if (empty($type) || $type == 'f') + if (!empty($conf->fournisseur->enabled) && (empty($type) || $type == 'f')) { $moreforfilter .= '
'; $moreforfilter .= $langs->trans('SuppliersCategoriesShort').': '; From ed923253bd2c9017249420bfbcce6e5fd01b26c2 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Thu, 22 Apr 2021 15:23:37 +0000 Subject: [PATCH 3/4] Fixing style errors. --- htdocs/contact/list.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 9b034438f2c..05328999cf5 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -723,8 +723,7 @@ if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) { $moreforfilter .= '
'; } - if (!empty($conf->fournisseur->enabled) && (empty($type) || $type == 'f')) - { + if (!empty($conf->fournisseur->enabled) && (empty($type) || $type == 'f')) { $moreforfilter .= '
'; $tmptitle = $langs->trans('SuppliersCategoriesShort'); $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"'); From 3d5002b8f63bdf3e518ace6ffcc31ef526331017 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Apr 2021 22:42:40 +0200 Subject: [PATCH 4/4] Update list.php --- htdocs/fichinter/list.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 3a09dab777f..77842037763 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -245,13 +245,19 @@ if (!empty($conf->contrat->enabled)) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contrat as c on f.fk_contrat = c.rowid"; } -if (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 (f.rowid = ef.fk_object)"; -if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; +if (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 (f.rowid = ef.fk_object)"; +} +if (empty($conf->global->FICHINTER_DISABLE_DETAILS) && $atleastonefieldinlines) { + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; +} // Add table from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; -if (!$user->rights->societe->client->voir && empty($socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +if (!$user->rights->societe->client->voir && empty($socid)) { + $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; +} $sql .= ", ".MAIN_DB_PREFIX."societe as s"; $sql .= " WHERE f.entity IN (".getEntity('intervention').")";