Merge pull request #8501 from ATM-Consulting/develop_atm

NEW: send mails from project card
This commit is contained in:
Laurent Destailleur 2018-04-05 16:39:06 +02:00 committed by GitHub
commit b59d8a6473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 1 deletions

View File

@ -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');

View File

@ -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)

View File

@ -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

View File

@ -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 '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid . '&amp;projectid=' . $object->id . '">' . $langs->trans("AddAction") . '</a></div>';
}*/
// Send
if ($object->statut != 2)
{
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?id='.$object->id.'&amp;action=presend&mode=init#formmailbeforetitle">' . $langs->trans('SendMail').'</a></div>';
}
// Modify
if ($object->statut != 2 && $user->rights->projet->creer)
{
@ -1212,6 +1225,10 @@ elseif ($object->id > 0)
print "</div>";
if (GETPOST('modelselected')) {
$action = 'presend';
}
if ($action != 'presend')
{
print '<div class="fichecenter"><div class="fichehalfleft">';
@ -1244,6 +1261,14 @@ elseif ($object->id > 0)
print '</div></div></div>';
}
// 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