BUG 6910 "Error al pasar a otra ventana con una alerta en mail" solved

- a validation was missing, bug fixed
This commit is contained in:
Erik Amaru Ortiz
2011-06-30 14:59:40 -04:00
parent ad5c2a152f
commit 0e896f4763
2 changed files with 100 additions and 86 deletions

View File

@@ -4135,14 +4135,23 @@ class Cases {
$aConfiguration = array();
}
}
if (isset($aConfiguration['MESS_ENABLED']) && $aConfiguration['MESS_ENABLED'] == '1') {
if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
return false;
}
//Send derivation notification - Start
$oTask = new Task();
$aTaskInfo = $oTask->load($sCurrentTask);
if ($aTaskInfo['TAS_SEND_LAST_EMAIL'] == 'TRUE') {
if ($aTaskInfo['TAS_SEND_LAST_EMAIL'] != 'TRUE') {
return false;
}
if ($sFrom == '') {
$sFrom = '"ProcessMaker"';
}
if (($aConfiguration['MESS_ENGINE'] != 'MAIL') && ($aConfiguration['MESS_ACCOUNT'] != '')) {
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
} else {
@@ -4188,13 +4197,14 @@ class Cases {
$sBody = nl2br(G::replaceDataField($aTaskInfo['TAS_DEF_MESSAGE'], $aFields));
}
G::LoadClass('spool');
$oUser = new Users();
foreach ($aTasks as $aTask) {
if (isset($aTask['USR_UID'])) {
$aUser = $oUser->load($aTask['USR_UID']);
$sTo = ((($aUser['USR_FIRSTNAME'] != '') || ($aUser['USR_LASTNAME'] != '')) ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
$oSpool = new spoolRun();
$oSpool->setConfig(array('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],
'MESS_SERVER' => $aConfiguration['MESS_SERVER'],
@@ -4223,9 +4233,9 @@ class Cases {
}
}
}
}
//Send derivation notification - End
}
} catch (Exception $oException) {
throw $oException;
}

View File

@@ -111,7 +111,11 @@ try {
$oUser = new Users();
$aUser = $oUser->load($_SESSION['USER_LOGGED']);
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '"';
try {
$oCase->sendNotifications($_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName);
} catch(Exception $e){
G::SendTemporalMessage(G::loadTranslation('ID_NOTIFICATION_ERROR').' - '. $e->getMessage(), 'warning', 'string', null, '100%');
}
// Send notifications - End
// Events - Start