Merge remote-tracking branch 'origin/support/2.7' into develop

# Conflicts:
#	application/dashboard.class.inc.php
#	core/action.class.inc.php
#	datamodels/2.x/combodo-db-tools/dictionaries/es_cr.dict.combodo-db-tools.php
#	datamodels/2.x/itop-attachments/dictionaries/es_cr.dict.itop-attachments.php
#	datamodels/2.x/itop-config-mgmt/dictionaries/es_cr.dict.itop-config-mgmt.php
#	datamodels/2.x/itop-core-update/dictionaries/es_cr.dict.itop-core-update.php
#	datamodels/2.x/itop-hub-connector/dictionaries/es_cr.dict.itop-hub-connector.php
#	datamodels/2.x/itop-knownerror-mgmt/dictionaries/es_cr.dict.itop-knownerror-mgmt.php
#	datamodels/2.x/itop-portal-base/dictionaries/es_cr.dict.itop-portal-base.php
#	datamodels/2.x/itop-request-mgmt-itil/dictionaries/es_cr.dict.itop-request-mgmt-itil.php
#	datamodels/2.x/itop-request-mgmt/dictionaries/es_cr.dict.itop-request-mgmt.php
#	datamodels/2.x/itop-sla-computation/dictionaries/es_cr.dict.itop-sla-computation.php
#	datamodels/2.x/itop-storage-mgmt/dictionaries/es_cr.dict.itop-storage-mgmt.php
#	datamodels/2.x/itop-tickets/dictionaries/es_cr.dict.itop-tickets.php
#	datamodels/2.x/itop-virtualization-mgmt/dictionaries/es_cr.dict.itop-virtualization-mgmt.php
#	datamodels/2.x/itop-welcome-itil/es_cr.dict.itop-welcome-itil.php
#	dictionaries/es_cr.dictionary.itop.core.php
#	dictionaries/es_cr.dictionary.itop.ui.php
#	pages/ajax.render.php
#	setup/wizardsteps.class.inc.php
#	synchro/synchro_import.php
This commit is contained in:
Pierre Goiffon
2021-11-19 10:28:46 +01:00
42 changed files with 793 additions and 713 deletions

View File

@@ -367,8 +367,7 @@ class ActionEmail extends ActionNotification
{
$this->m_iRecipients = 0;
$this->m_aMailErrors = array();
$bRes = false; // until we do succeed in sending the email
// Determine recipients
//
$sTo = $this->FindRecipients('to', $aContextArgs);
@@ -382,29 +381,42 @@ class ActionEmail extends ActionNotification
$sSubject = MetaModel::ApplyParams($this->Get('subject'), $aContextArgs);
$sBody = MetaModel::ApplyParams($this->Get('body'), $aContextArgs);
$oObj = $aContextArgs['this->object()'];
$sMessageId = sprintf('iTop_%s_%d_%f@%s.openitop.org', get_class($oObj), $oObj->GetKey(), microtime(true /* get as float*/), MetaModel::GetEnvironmentId());
$sMessageId = sprintf('iTop_%s_%d_%f@%s.openitop.org', get_class($oObj), $oObj->GetKey(), microtime(true /* get as float*/),
MetaModel::GetEnvironmentId());
$sReference = '<'.$sMessageId.'>';
}
catch(Exception $e)
{
ApplicationContext::SetUrlMakerClass($sPreviousUrlMaker);
throw $e;
}
ApplicationContext::SetUrlMakerClass($sPreviousUrlMaker);
if (!is_null($oLog))
{
catch (Exception $e) {
/** @noinspection PhpUnhandledExceptionInspection */
throw $e;
}
finally {
ApplicationContext::SetUrlMakerClass($sPreviousUrlMaker);
}
if (!is_null($oLog)) {
// Note: we have to secure this because those values are calculated
// inside the try statement, and we would like to keep track of as
// many data as we could while some variables may still be undefined
if (isset($sTo)) $oLog->Set('to', $sTo);
if (isset($sCC)) $oLog->Set('cc', $sCC);
if (isset($sBCC)) $oLog->Set('bcc', $sBCC);
if (isset($sFrom)) $oLog->Set('from', empty($sFromLabel) ? $sFrom : "$sFromLabel <$sFrom>");
if (isset($sSubject)) $oLog->Set('subject', $sSubject);
if (isset($sBody)) $oLog->Set('body', $sBody);
if (isset($sTo)) {
$oLog->Set('to', $sTo);
}
if (isset($sCC)) {
$oLog->Set('cc', $sCC);
}
if (isset($sBCC)) {
$oLog->Set('bcc', $sBCC);
}
if (isset($sFrom)) {
$oLog->Set('from', $sFrom);
}
if (isset($sSubject)) {
$oLog->Set('subject', $sSubject);
}
if (isset($sBody)) {
$oLog->Set('body', $sBody);
}
}
$sStyles = file_get_contents(APPROOT.'css/email.css');
$sStyles .= MetaModel::GetConfig()->Get('email_css');