Skip to content

Commit

Permalink
Ajout backport v22 mail depuis produit
Browse files Browse the repository at this point in the history
  • Loading branch information
atm-lucasmantegari committed Jan 24, 2025
1 parent 38ec412 commit e254b25
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ChangeLogWeneos.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
NEW : Backport d'un développement proposé dans le standard en develop (22.0)
* https://github.com/Dolibarr/dolibarr/pull/32689
* A supprimer lors du passage en, 22.0 si le développement est mergé dans le standard

* https://github.com/Dolibarr/dolibarr/pull/32773
* Ajout de la possibilité d'envoyer un mail depuis un produit/service
* A supprimer lors du passage en, 22.0 si le développement est mergé dans le standard
6 changes: 6 additions & 0 deletions htdocs/core/tpl/card_presend.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@
}
if ($forcebuilddoc) { // If there is no default value for supplier invoice, we do not generate file, even if modelpdf was set by a manual generation
if ((!$file || !is_readable($file)) && method_exists($object, 'generateDocument')) {
// START BACKPORT WENEOS - A SUPP EN V22.0
$hidedetails = $hidedetails?$hidedetails:'';
$hidedesc = $hidedetails?$hidedetails:'';
$hideref = $hidedetails?$hidedetails:'';
// END BACKPORT WENEOS - A SUPP EN V22.0

$result = $object->generateDocument(GETPOST('model') ? GETPOST('model') : $object->model_pdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
if ($result < 0) {
dol_print_error($db, $object->error, $object->errors);
Expand Down
25 changes: 25 additions & 0 deletions htdocs/product/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,15 @@
setEventMessages($langs->trans("WarningSelectOneDocument"), null, 'warnings');
}
}

// START BACKPORT WENEOS - A SUPP EN V22.0
// Actions to send emails
$triggersendname = 'PRODUCT_SENTBYMAIL';
$paramname = 'id';
$autocopy = 'MAIN_MAIL_AUTOCOPY_PRODUCT_TO';
$trackid = 'prod'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
// END BACKPORT WENEOS - A SUPP EN V22.0
}


Expand Down Expand Up @@ -2831,6 +2840,11 @@
print dolGetButtonAction('', $langs->trans('Modify'), 'default', $_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'&id='.$object->id, '', $usercancreate);
}

// START BACKPORT WENEOS - A SUPP EN V22.0
//Send
print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=presend&mode=init&token=' . newToken() . '#formmailbeforetitle');
// END BACKPORT WENEOS - A SUPP EN V22.0

if (!isset($object->no_button_copy) || $object->no_button_copy <> 1) {
if (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) {
$cloneProductUrl = '';
Expand Down Expand Up @@ -2998,6 +3012,17 @@
$somethingshown = $formactions->showactions($object, 'product', 0, 1, '', $MAXEVENT, '', $morehtmlcenter); // Show all action for product

print '</div></div>';


// START BACKPORT WENEOS - A SUPP EN V22.0
// Presend form
$modelmail = 'product_send';
$defaulttopic = $object->label;
$diroutput = $conf->product->multidir_output[$object->entity];
$trackid = 'prod' . $object->id;

include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
// END BACKPORT WENEOS - A SUPP EN V22.0
}

// End of page
Expand Down

0 comments on commit e254b25

Please sign in to comment.