PM 940 "ProcessMaker" Email Server Frontend" SOLVED
> Se agrega marcas para el modulo Email Server para la version de la Comunidad.
This commit is contained in:
@@ -788,6 +788,60 @@ class EmailServer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create Email Server by data
|
||||
*
|
||||
* @param array $arrayData Data
|
||||
*
|
||||
* return array Return data of the new Email Server created
|
||||
*/
|
||||
public function create2(array $arrayData)
|
||||
{
|
||||
try {
|
||||
//Create
|
||||
$cnn = \Propel::getConnection("workflow");
|
||||
|
||||
try {
|
||||
$emailServer = new \EmailServer();
|
||||
|
||||
$emailServer->fromArray($arrayData, \BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
$emailServerUid = \ProcessMaker\Util\Common::generateUID();
|
||||
|
||||
$emailServer->setMessUid($emailServerUid);
|
||||
|
||||
if ($emailServer->validate()) {
|
||||
$cnn->begin();
|
||||
|
||||
$result = $emailServer->save();
|
||||
|
||||
$cnn->commit();
|
||||
|
||||
if (isset($arrayData["MESS_DEFAULT"]) && (int)($arrayData["MESS_DEFAULT"]) == 1) {
|
||||
$this->setEmailServerDefaultByUid($emailServerUid);
|
||||
}
|
||||
|
||||
//Return
|
||||
return $this->getEmailServer($emailServerUid);
|
||||
} else {
|
||||
$msg = "";
|
||||
|
||||
foreach ($emailServer->getValidationFailures() as $validationFailure) {
|
||||
$msg = $msg . (($msg != "")? "\n" : "") . $validationFailure->getMessage();
|
||||
}
|
||||
|
||||
throw new \Exception(\G::LoadTranslation("ID_RECORD_CANNOT_BE_CREATED") . (($msg != "")? "\n" . $msg : ""));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
$cnn->rollback();
|
||||
|
||||
throw $e;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update Email Server
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user