PM-2765 "Processmaker Email Servers Disabled" SOLVED
> Code Isuue: Processmaker Email Servers Disabled > Solution: Se agrega validacion cuando se realizar el upgrade de la version 2.5.2 a 3.0 community de processmaker, la configuracion de correo que se tenia en la version 2.5.2, se visualizar en la version 3.0 mostrando como unico registro, el mismo podra ser editado.
This commit is contained in:
@@ -327,6 +327,7 @@ function database_upgrade($command, $args) {
|
||||
print_r("Checking database in ".pakeColor::colorize($workspace->name, "INFO")."\n");
|
||||
else
|
||||
print_r("Upgrading database in ".pakeColor::colorize($workspace->name, "INFO")."\n");
|
||||
|
||||
try {
|
||||
$changes = $workspace->upgradeDatabase($checkOnly);
|
||||
if ($changes != false) {
|
||||
@@ -346,51 +347,6 @@ function database_upgrade($command, $args) {
|
||||
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
//There records in table "EMAIL_SERVER"
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(EmailServerPeer::MESS_UID);
|
||||
$criteria->setOffset(0);
|
||||
$criteria->setLimit(1);
|
||||
|
||||
$rsCriteria = EmailServerPeer::doSelectRS($criteria);
|
||||
|
||||
if (!$rsCriteria->next()) {
|
||||
//Insert the first record
|
||||
$emailSever = new \ProcessMaker\BusinessModel\EmailServer();
|
||||
|
||||
$emailConfiguration = System::getEmailConfiguration();
|
||||
|
||||
if (count($emailConfiguration) > 0) {
|
||||
$arrayData = array();
|
||||
|
||||
$arrayData["MESS_ENGINE"] = $emailConfiguration["MESS_ENGINE"];
|
||||
$arrayData["MESS_SERVER"] = $emailConfiguration["MESS_SERVER"];
|
||||
$arrayData["MESS_PORT"] = (int)($emailConfiguration["MESS_PORT"]);
|
||||
$arrayData["MESS_RAUTH"] = (int)($emailConfiguration["MESS_RAUTH"]);
|
||||
$arrayData["MESS_ACCOUNT"] = $emailConfiguration["MESS_ACCOUNT"];
|
||||
$arrayData["MESS_PASSWORD"] = $emailConfiguration["MESS_PASSWORD"];
|
||||
$arrayData["MESS_FROM_MAIL"] = isset($emailConfiguration["MESS_FROM_MAIL"]) ? $emailConfiguration["MESS_FROM_MAIL"] : "";
|
||||
$arrayData["MESS_FROM_NAME"] = isset($emailConfiguration["MESS_FROM_NAME"]) ? $emailConfiguration["MESS_FROM_NAME"] : "";
|
||||
$arrayData["SMTPSECURE"] = $emailConfiguration["SMTPSecure"];
|
||||
$arrayData["MESS_TRY_SEND_INMEDIATLY"] = (int)($emailConfiguration["MESS_TRY_SEND_INMEDIATLY"]);
|
||||
$arrayData["MAIL_TO"] = $emailConfiguration["MAIL_TO"];
|
||||
$arrayData["MESS_DEFAULT"] = (isset($emailConfiguration["MESS_ENABLED"]) && $emailConfiguration["MESS_ENABLED"] . "" == "1")? 1 : 0;
|
||||
|
||||
$arrayData = $emailSever->create($arrayData);
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (true) {
|
||||
//
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$arrayData = $emailSever->create2(array("MESS_ENGINE" => "MAIL"));
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function delete_app_from_table($con, $tableName, $appUid, $col="APP_UID") {
|
||||
@@ -680,7 +636,7 @@ function run_check_workspace_disabled_code($args, $opts)
|
||||
}
|
||||
}
|
||||
|
||||
function migrate_new_cases_lists($command, $args) {
|
||||
function migrate_new_cases_lists($command, $args) {
|
||||
$workspaces = get_workspaces_from_args($args);
|
||||
$checkOnly = (strcmp($command, "migrate") == 0);
|
||||
foreach ($workspaces as $workspace) {
|
||||
@@ -701,11 +657,11 @@ function migrate_new_cases_lists($command, $args) {
|
||||
$changes = $workspace->listFirstExecution('check');
|
||||
if ($workspace->onedb && $changes != true) {
|
||||
$workspace->migrateList($workspace->name);
|
||||
}
|
||||
}
|
||||
if ($changes) {
|
||||
if ($checkOnly) {
|
||||
echo "-> List tables are done\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "> List tables are done\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user