mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 22:18:46 +02:00
N°4096 - Automatic email sending retry in case of error.
This commit is contained in:
@@ -51,6 +51,30 @@ function DBPasswordInNewConfigIsOk($sSafeContent)
|
||||
return true;
|
||||
}
|
||||
|
||||
function CheckAsyncTasksRetryConfig(Config $oTempConfig, iTopWebPage $oP)
|
||||
{
|
||||
$iWarnings = 0;
|
||||
foreach(get_declared_classes() as $sPHPClass)
|
||||
{
|
||||
$oRefClass = new ReflectionClass($sPHPClass);
|
||||
if ($oRefClass->isSubclassOf('AsyncTask') && !$oRefClass->isAbstract())
|
||||
{
|
||||
$aMessages = AsyncTask::CheckRetryConfig($oTempConfig, $oRefClass->getName());
|
||||
|
||||
if (count($aMessages) !== 0)
|
||||
{
|
||||
foreach($aMessages as $sMessage)
|
||||
{
|
||||
$oAlert = AlertUIBlockFactory::MakeForWarning('', $sMessage);
|
||||
$oP->AddUiBlock($oAlert);
|
||||
$iWarnings ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $iWarnings;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Main program
|
||||
//
|
||||
@@ -142,6 +166,10 @@ try {
|
||||
$iEditorTopMargin += 5;
|
||||
}
|
||||
$oP->AddUiBlock($oAlert);
|
||||
|
||||
$iWarnings = CheckAsyncTasksRetryConfig($oTempConfig, $oP);
|
||||
$iEditorTopMargin += 5*$iWarnings;
|
||||
|
||||
$sOriginalConfig = str_replace("\r\n", "\n", file_get_contents($sConfigFile));
|
||||
} catch (Exception $e) {
|
||||
$oAlert = AlertUIBlockFactory::MakeForDanger('', $e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user