diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 32e6be85b11..da4f4d1f9ea 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -168,6 +168,7 @@ if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$la if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty'); if ($conf->adherent->enabled) $elementList['member']=$langs->trans('MailToMember'); if ($conf->contrat->enabled) $elementList['contract']=$langs->trans('MailToSendContract'); +if ($conf->projet->enabled) $elementList['project']=$langs->trans('MailToProject'); $elementList['user']=$langs->trans('MailToUser'); $elementList['all'] =$langs->trans('VisibleEverywhere'); $elementList['none']=$langs->trans('VisibleNowhere'); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index be46a1e15c8..655e5d46884 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1729,6 +1729,7 @@ MailToSendContract=To send a contract MailToThirdparty=To send email from third party page MailToMember=To send email from member page MailToUser=To send email from user page +MailToProject= To send email from project page ByDefaultInList=Show by default on list view YouUseLastStableVersion=You use the latest stable version TitleExampleForMajorRelease=Example of message you can use to announce this major release (feel free to use it on your web sites) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 4e1f755894b..5cc94c39309 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -226,3 +226,4 @@ AllowCommentOnProject=Allow user comments on projects DontHavePermissionForCloseProject=You do not have permissions to close the project %s DontHaveTheValidateStatus=The project %s must be open to be closed RecordsClosed=%s project(s) closed +SendProjectRef=About project %s diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c5cfb9b3756..466bb8729c2 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -446,6 +446,13 @@ if (empty($reshook)) $comefromclone=true; } } + + // Actions to send emails + $trigger_name='PROJECT_SENTBYMAIL'; + $paramname='id'; + $autocopy='MAIN_MAIL_AUTOCOPY_ORDER_TO'; // used to know the automatic BCC to add + $trackid='proj'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php'; } @@ -1064,7 +1071,7 @@ elseif ($object->id > 0) // modified by hook if (empty($reshook)) { - if ($action != "edit" ) + if ($action != "edit" && $action != 'presend' ) { // Create event @@ -1075,6 +1082,12 @@ elseif ($object->id > 0) print '
' . $langs->trans("AddAction") . '
'; }*/ + // Send + if ($object->statut != 2) + { + print '
' . $langs->trans('SendMail').'
'; + } + // Modify if ($object->statut != 2 && $user->rights->projet->creer) { @@ -1212,6 +1225,10 @@ elseif ($object->id > 0) print ""; + if (GETPOST('modelselected')) { + $action = 'presend'; + } + if ($action != 'presend') { print '
'; @@ -1244,6 +1261,14 @@ elseif ($object->id > 0) print '
'; } + // Presend form + $modelmail='project'; + $defaulttopic='SendProjectRef'; + $diroutput = $conf->projet->dir_output; + $trackid = 'proj'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + // Hook to add more things on page $parameters=array(); $reshook=$hookmanager->executeHooks('mainCardTabAddMore',$parameters,$object,$action); // Note that $action and $object may have been modified by hook