Merged in mcuiza/processmaker/PM-1468 (pull request #1384)

PM-1468
This commit is contained in:
Julio Cesar Laura Avendaño
2015-02-05 10:39:23 -04:00

View File

@@ -533,8 +533,21 @@ function resendEmails()
setExecutionResultMessage("DONE");
} catch (Exception $e) {
setExecutionResultMessage("WITH ERRORS", "error");
eprintln(" '-" . $e->getMessage(), "red");
$c = new Criteria("workflow");
$c->clearSelectColumns();
$c->addSelectColumn(ConfigurationPeer::CFG_UID);
$c->add(ConfigurationPeer::CFG_UID, "Emails");
$result = ConfigurationPeer::doSelectRS($c);
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
if($result->next()) {
setExecutionResultMessage("WARNING", "warning");
$message = "Emails won't be sent, but the cron will continue its execution";
eprintln(" '-" . $message, "yellow");
} else {
setExecutionResultMessage("WITH ERRORS", "error");
eprintln(" '-" . $e->getMessage(), "red");
}
saveLog("resendEmails", "error", "Error Resending Emails: " . $e->getMessage());
}
}
@@ -990,6 +1003,10 @@ function setExecutionResultMessage($m, $t='')
if ($t == 'info') {
$c = 'yellow';
}
if ($t == 'warning') {
$c = 'yellow';
}
eprintln("[$m]", $c);
}