From 7161ca9e70d00dd4f55294df753f4b01892fb77f Mon Sep 17 00:00:00 2001 From: quentin Date: Wed, 6 Jan 2021 09:54:02 +0100 Subject: [PATCH 1/3] FIX issue 15659 : Missing test if conf is enabled --- htdocs/societe/card.php | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ea121acc4c7..052d681b0a0 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1542,12 +1542,12 @@ else //} // Supplier - //if ($object->fournisseur) { - print ''.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); - print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, null, "90%"); - print ""; - //} + if (!empty($conf->fournisseur->enabled)) { + print ''.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, 'parent', null, null, 1); + print $form->multiselectarray('suppcats', $cate_arbo, GETPOST('suppcats', 'array'), null, null, null, null, "90%"); + print ""; + } } // Multicurrency @@ -2180,17 +2180,19 @@ else print ""; // Supplier - print ''.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; - print ''; - $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); - $c = new Categorie($db); - $cats = $c->containing($object->id, Categorie::TYPE_SUPPLIER); - $arrayselected = array(); - foreach ($cats as $cat) { - $arrayselected[] = $cat->id; + if (!empty($conf->fournisseur->enabled)) { + print ''.$form->editfieldkey('SuppliersCategoriesShort', 'suppcats', '', $object, 0).''; + print ''; + $cate_arbo = $form->select_all_categories(Categorie::TYPE_SUPPLIER, null, null, null, null, 1); + $c = new Categorie($db); + $cats = $c->containing($object->id, Categorie::TYPE_SUPPLIER); + $arrayselected = array(); + foreach($cats as $cat) { + $arrayselected[] = $cat->id; + } + print $form->multiselectarray('suppcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); + print ""; } - print $form->multiselectarray('suppcats', $cate_arbo, $arrayselected, '', 0, '', 0, '90%'); - print ""; } // Multicurrency @@ -2560,7 +2562,7 @@ else } // Supplier - if ($object->fournisseur) { + if (!empty($conf->fournisseur->enabled) && $object->fournisseur) { print ''.$langs->trans("SuppliersCategoriesShort").''; print ''; print $form->showCategories($object->id, Categorie::TYPE_SUPPLIER, 1); From 2f932330d3d4ed6561385d089189de4bd4be5aa1 Mon Sep 17 00:00:00 2001 From: quentin Date: Wed, 6 Jan 2021 10:10:39 +0100 Subject: [PATCH 2/3] FIX wrong name for search status param --- htdocs/expedition/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 999bde3fb32..a7f44bf483e 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -340,7 +340,7 @@ if ($resql) if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category); if ($search_categ_cus > 0) $param .= '&search_categ_cus='.urlencode($search_categ_cus); - if ($search_status != '') $param .= '&viewstatut='.urlencode($search_status); + if ($search_status != '') $param .= '&search_status='.urlencode($search_status); if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; From 6f15683709893d12fcc0e0a78259f91230534c9f Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 6 Jan 2021 10:42:48 +0100 Subject: [PATCH 3/3] FIX create ticket : thirdparty/contact notification #15629 --- ...terface_50_modTicket_TicketEmail.class.php | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 6bd33c5b2f9..22ad6415b40 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -251,11 +251,21 @@ class InterfaceTicketEmail extends DolibarrTriggers if (empty($conf->global->TICKET_DISABLE_CUSTOMER_MAILS) && empty($object->context['disableticketemail']) && $object->notify_tiers_at_create) { $sendto = ''; - if (empty($user->socid) && empty($user->email)) { - $object->fetch_thirdparty(); - $sendto = $object->thirdparty->email; - } else { - $sendto = $user->email; + + //if contact selected send to email's contact else send to email's thirdparty + + $contactid = GETPOST('contactid', 'alpha'); + + if(!empty($contactid)) { + $contact = new Contact($this->db); + $res = $contact->fetch($contactid); + } + + if($res > 0 && !empty($contact->email) && !empty($contact->statut)) { + $sendto = $contact->email; + } elseif (!empty($object->fk_soc)) { + $object->fetch_thirdparty(); + $sendto = $object->thirdparty->email; } if ($sendto) {