From cccae8fa737893030a2d6884e2b90a722be4bdb0 Mon Sep 17 00:00:00 2001 From: ATM-Lucas Date: Fri, 24 Jan 2025 16:44:05 +0100 Subject: [PATCH 1/2] adding model mail --- htdocs/admin/mails_templates.php | 3 +++ htdocs/core/class/html.formmail.class.php | 2 +- htdocs/product/card.php | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 6d0267f802a71..7504bd223a758 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -239,6 +239,9 @@ if (isModEnabled('partnership') && !empty($user->rights->partnership->read)) { $elementList['partnership_send'] = img_picto('', 'partnership', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToPartnership')); } +if (isModEnabled('product') && !empty($user->rights->produit->lire)) { + $elementList['product_send'] = img_picto('', 'product', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('Product')); +} $parameters = array('elementList'=>$elementList); $reshook = $hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 49669a4c02cbb..760fb0de337c3 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -521,7 +521,7 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove } elseif (!empty($this->param['models']) && in_array($this->param['models'], array( 'propal_send', 'order_send', 'facture_send', 'shipping_send', 'fichinter_send', 'supplier_proposal_send', 'order_supplier_send', - 'invoice_supplier_send', 'thirdparty', 'contract', 'user', 'recruitmentcandidature_send', 'all' + 'invoice_supplier_send', 'thirdparty', 'contract', 'user', 'recruitmentcandidature_send', 'product_send', 'all' ))) { // If list of template is empty $out .= '
'."\n"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 521b357c58f23..aa8b694fe1c15 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2982,6 +2982,10 @@ * Generated documents */ +if (GETPOST('modelselected')) { + $action = 'presend'; +} + if ($action != 'create' && $action != 'edit' && $action != 'delete') { print '
'; print ''; // ancre From 53d12fe5a7225ab8d7ff7e4aca835d78e886eeed Mon Sep 17 00:00:00 2001 From: ATM-Lucas Date: Fri, 24 Jan 2025 16:49:44 +0100 Subject: [PATCH 2/2] ajout comm backport --- htdocs/admin/mails_templates.php | 2 ++ htdocs/core/class/html.formmail.class.php | 7 ++++++- htdocs/product/card.php | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 7504bd223a758..42c365d0bfb5d 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -239,9 +239,11 @@ if (isModEnabled('partnership') && !empty($user->rights->partnership->read)) { $elementList['partnership_send'] = img_picto('', 'partnership', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToPartnership')); } +// START BACKPORT WENEOS - A SUPP EN V22.0 if (isModEnabled('product') && !empty($user->rights->produit->lire)) { $elementList['product_send'] = img_picto('', 'product', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('Product')); } +// END BACKPORT WENEOS - A SUPP EN V22.0 $parameters = array('elementList'=>$elementList); $reshook = $hookmanager->executeHooks('emailElementlist', $parameters); // Note that $action and $object may have been modified by some hooks diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 760fb0de337c3..e9ef6fb74ede2 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -521,7 +521,12 @@ public function get_form($addfileaction = 'addfile', $removefileaction = 'remove } elseif (!empty($this->param['models']) && in_array($this->param['models'], array( 'propal_send', 'order_send', 'facture_send', 'shipping_send', 'fichinter_send', 'supplier_proposal_send', 'order_supplier_send', - 'invoice_supplier_send', 'thirdparty', 'contract', 'user', 'recruitmentcandidature_send', 'product_send', 'all' + 'invoice_supplier_send', 'thirdparty', 'contract', 'user', 'recruitmentcandidature_send', + // START BACKPORT WENEOS - A SUPP EN V22.0 + 'product_send', + // END BACKPORT WENEOS - A SUPP EN V22.0 + 'all' + ))) { // If list of template is empty $out .= '
'."\n"; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index aa8b694fe1c15..bb6b7067a12cd 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -2982,9 +2982,11 @@ * Generated documents */ +// START BACKPORT WENEOS - A SUPP EN V22.0 if (GETPOST('modelselected')) { $action = 'presend'; } +// END BACKPORT WENEOS - A SUPP EN V22.0 if ($action != 'create' && $action != 'edit' && $action != 'delete') { print '
';