Skip to content

Commit

Permalink
Merge pull request #562 from atm-lucasmantegari/NEW/SP133/T5440/MailD…
Browse files Browse the repository at this point in the history
…epuisProduit

NEW - Adding mail model
  • Loading branch information
atm-adrien authored Jan 24, 2025
2 parents 6ed2464 + 53d12fe commit 4b67e62
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions htdocs/admin/mails_templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +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
Expand Down
7 changes: 6 additions & 1 deletion htdocs/core/class/html.formmail.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', '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 .= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
Expand Down
6 changes: 6 additions & 0 deletions htdocs/product/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -2982,6 +2982,12 @@
* 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 '<div class="fichecenter"><div class="fichehalfleft">';
print '<a name="builddoc"></a>'; // ancre
Expand Down

0 comments on commit 4b67e62

Please sign in to comment.