Merged in gproly/processmaker/HOR-2163 (pull request #5129)

HOR-2163
This commit is contained in:
Julio Cesar Laura Avendaño
2016-11-14 13:46:53 +00:00
6 changed files with 519 additions and 10 deletions

View File

@@ -274,6 +274,10 @@ class Task
}
}
if (isset($arrayProperty["TAS_RECEIVE_LAST_EMAIL"])) {
$arrayProperty["TAS_RECEIVE_LAST_EMAIL"] = $arrayProperty["TAS_RECEIVE_LAST_EMAIL"] === "TRUE" ? "TRUE" : "FALSE";
}
//Validating TAS_ASSIGN_VARIABLE value
if (!isset($arrayProperty["TAS_ASSIGN_TYPE"])) {
$derivateType = $task->kgetassigType($arrayProperty["PRO_UID"], $arrayProperty["TAS_UID"]);
@@ -432,6 +436,42 @@ class Task
$this->unsetVar($arrayProperty, "TAS_DEF_MESSAGE_TEMPLATE");
}
if ($arrayProperty["TAS_RECEIVE_LAST_EMAIL"] == "TRUE") {
if (empty($arrayProperty["TAS_RECEIVE_SERVER_UID"])) {
throw (new \Exception("Invalid value specified for 'tas_receive_server_uid'"));
}
if (empty($arrayProperty["TAS_RECEIVE_SUBJECT_MESSAGE"])) {
throw (new \Exception("Invalid value specified for 'tas_receive_subject_message'"));
}
if (!isset($arrayProperty["TAS_RECEIVE_MESSAGE_TYPE"])) {
$arrayProperty["TAS_RECEIVE_MESSAGE_TYPE"] = "text";
}
$valuesDefMessageType = array('text', 'template');
if (!in_array($arrayProperty["TAS_RECEIVE_MESSAGE_TYPE"], $valuesDefMessageType)) {
throw (new \Exception("Invalid value specified for 'tas_receive_message_type'"));
}
if (!isset($arrayProperty["TAS_RECEIVE_MESSAGE_TEMPLATE"])) {
$arrayProperty["TAS_RECEIVE_MESSAGE_TEMPLATE"] = "alert_message.html";
}
if ($arrayProperty["TAS_RECEIVE_MESSAGE_TYPE"] == 'template') {
if (empty($arrayProperty["TAS_RECEIVE_MESSAGE_TEMPLATE"])) {
throw (new \Exception("Invalid value specified for 'tas_receive_message_template'"));
}
$this->unsetVar($arrayProperty, "TAS_RECEIVE_MESSAGE");
} else {
if (empty($arrayProperty["TAS_RECEIVE_MESSAGE"])) {
throw (new \Exception("Invalid value specified for 'tas_receive_message'"));
}
$this->unsetVar($arrayProperty, "TAS_RECEIVE_MESSAGE_TEMPLATE");
}
} else {
$this->unsetVar($arrayProperty, "TAS_RECEIVE_SERVER_UID");
$this->unsetVar($arrayProperty, "TAS_RECEIVE_SUBJECT_MESSAGE");
$this->unsetVar($arrayProperty, "TAS_RECEIVE_MESSAGE");
$this->unsetVar($arrayProperty, "TAS_RECEIVE_MESSAGE_TYPE");
$this->unsetVar($arrayProperty, "TAS_RECEIVE_MESSAGE_TEMPLATE");
}
$result = $task->update($arrayProperty);
if (!empty($arrayProperty['CONSOLIDATE_DATA'])) {
if (!empty($arrayProperty['CONSOLIDATE_DATA']['consolidated_dynaform'])) {