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";
|
||||
}
|
||||
|
||||
@@ -781,7 +781,75 @@ class workspaceTools
|
||||
$this->upgradeSchema( $systemSchema );
|
||||
$this->upgradeSchema( $systemSchemaRbac, false, true, $onedb ); // perform Upgrade to Rbac
|
||||
$this->upgradeData();
|
||||
|
||||
//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
|
||||
$arrayData = array();
|
||||
|
||||
$emailSever = new \ProcessMaker\BusinessModel\EmailServer();
|
||||
$emailConfiguration = System::getEmailConfiguration();
|
||||
|
||||
if (count($emailConfiguration) > 0) {
|
||||
$arrayData["MESS_ENGINE"] = $emailConfiguration["MESS_ENGINE"];
|
||||
|
||||
switch ($emailConfiguration["MESS_ENGINE"]) {
|
||||
case "PHPMAILER":
|
||||
$arrayData["MESS_SERVER"] = $emailConfiguration["MESS_SERVER"];
|
||||
$arrayData["MESS_PORT"] = (int)($emailConfiguration["MESS_PORT"]);
|
||||
$arrayData["MESS_RAUTH"] = (is_numeric($emailConfiguration["MESS_RAUTH"]))? (int)($emailConfiguration["MESS_RAUTH"]) : (($emailConfiguration["MESS_RAUTH"] . "" == "true")? 1 : 0);
|
||||
$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"] = (isset($emailConfiguration["MESS_TRY_SEND_INMEDIATLY"]) && ($emailConfiguration["MESS_TRY_SEND_INMEDIATLY"] . "" == "true" || $emailConfiguration["MESS_TRY_SEND_INMEDIATLY"] . "" == "1"))? 1 : 0;
|
||||
$arrayData["MAIL_TO"] = $emailConfiguration["MAIL_TO"];
|
||||
$arrayData["MESS_DEFAULT"] = (isset($emailConfiguration["MESS_ENABLED"]) && $emailConfiguration["MESS_ENABLED"] . "" == "1")? 1 : 0;
|
||||
break;
|
||||
case "MAIL":
|
||||
$arrayData["MESS_SERVER"] = "";
|
||||
$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["MESS_TRY_SEND_INMEDIATLY"] = (isset($emailConfiguration["MESS_TRY_SEND_INMEDIATLY"]) && ($emailConfiguration["MESS_TRY_SEND_INMEDIATLY"] . "" == "true" || $emailConfiguration["MESS_TRY_SEND_INMEDIATLY"] . "" == "1"))? 1 : 0;
|
||||
$arrayData["MESS_ACCOUNT"] = "";
|
||||
$arrayData["MESS_PASSWORD"] = "";
|
||||
$arrayData["MAIL_TO"] = (isset($emailConfiguration["MAIL_TO"]))? $emailConfiguration["MAIL_TO"] : "";
|
||||
$arrayData["MESS_DEFAULT"] = (isset($emailConfiguration["MESS_ENABLED"]) && $emailConfiguration["MESS_ENABLED"] . "" == "1")? 1 : 0;
|
||||
break;
|
||||
}
|
||||
|
||||
$arrayData = $emailSever->create($arrayData);
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (true) {
|
||||
//
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$arrayData["MESS_ENGINE"] = "MAIL";
|
||||
$arrayData["MESS_SERVER"] = "";
|
||||
$arrayData["MESS_ACCOUNT"] = "";
|
||||
$arrayData["MESS_PASSWORD"] = "";
|
||||
$arrayData["MAIL_TO"] = "";
|
||||
$arrayData["MESS_DEFAULT"] = 1;
|
||||
|
||||
$arrayData = $emailSever->create2($arrayData);
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
}
|
||||
|
||||
p11835::execute();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1886,7 +1954,7 @@ class workspaceTools
|
||||
$users = new Users();
|
||||
G::LoadClass("case");
|
||||
$case = new Cases();
|
||||
|
||||
|
||||
//Select data CANCELLED
|
||||
$canCriteria = $appCache->getSelAllColumns();
|
||||
$canCriteria->add(AppCacheViewPeer::APP_STATUS, "CANCELLED", CRITERIA::EQUAL);
|
||||
@@ -1902,7 +1970,7 @@ class workspaceTools
|
||||
$listCanceled->create($row);
|
||||
}
|
||||
CLI::logging("> Completed table LIST_CANCELED\n");
|
||||
|
||||
|
||||
//Select data COMPLETED
|
||||
$comCriteria = $appCache->getSelAllColumns();
|
||||
$comCriteria->add(AppCacheViewPeer::APP_STATUS, "COMPLETED", CRITERIA::EQUAL);
|
||||
@@ -1918,7 +1986,7 @@ class workspaceTools
|
||||
$listCompleted->create($row);
|
||||
}
|
||||
CLI::logging("> Completed table LIST_COMPLETED\n");
|
||||
|
||||
|
||||
//Select data TO_DO OR DRAFT
|
||||
$inbCriteria = $appCache->getSelAllColumns();
|
||||
$rsCriteria = AppCacheViewPeer::doSelectRS($inbCriteria);
|
||||
@@ -1967,14 +2035,14 @@ class workspaceTools
|
||||
$listParticipatedLast = new ListParticipatedLast();
|
||||
$listParticipatedLast->refresh($row);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
CLI::logging("> Completed table LIST_INBOX\n");
|
||||
//With this List is populated the LIST_PARTICIPATED_HISTORY and LIST_PARTICIPATED_LAST
|
||||
CLI::logging("> Completed table LIST_PARTICIPATED_HISTORY\n");
|
||||
CLI::logging("> Completed table LIST_PARTICIPATED_LAST\n");
|
||||
|
||||
|
||||
//Select data TO_DO OR DRAFT CASES CREATED BY AN USER
|
||||
$myiCriteria = $appCache->getSelAllColumns();
|
||||
$myiCriteria->add(AppCacheViewPeer::DEL_INDEX, "1", CRITERIA::EQUAL);
|
||||
@@ -1982,14 +2050,14 @@ class workspaceTools
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
//Insert new data LIST_MY_INBOX
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$row = $rsCriteria->getRow();
|
||||
$listMyInbox = new ListMyInbox();
|
||||
$listMyInbox ->remove($row["APP_UID"],$row["USR_UID"]);
|
||||
$listMyInbox->setDeleted(false);
|
||||
$listMyInbox->create($row);
|
||||
}
|
||||
CLI::logging("> Completed table LIST_MY_INBOX\n");
|
||||
|
||||
|
||||
//Select data PAUSED
|
||||
$delaycriteria = new Criteria("workflow");
|
||||
$delaycriteria->addSelectColumn(AppDelayPeer::APP_UID);
|
||||
@@ -2015,7 +2083,7 @@ class workspaceTools
|
||||
$listPaused->create($data);
|
||||
}
|
||||
CLI::logging("> Completed table LIST_PAUSED\n");
|
||||
|
||||
|
||||
//Select and Insert LIST_UNASSIGNED
|
||||
$unaCriteria = $appCache->getSelAllColumns();
|
||||
$unaCriteria->add(AppCacheViewPeer::USR_UID, "", CRITERIA::EQUAL);
|
||||
@@ -2024,12 +2092,12 @@ class workspaceTools
|
||||
$del = new ListUnassignedPeer();
|
||||
$del->doDeleteAll();
|
||||
$del = new ListUnassignedGroupPeer();
|
||||
$del->doDeleteAll();
|
||||
$del->doDeleteAll();
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$listUnassigned = new ListUnassigned();
|
||||
$unaUid = $listUnassigned->generateData($row["APP_UID"],$row["PREVIOUS_USR_UID"]);
|
||||
}
|
||||
$unaUid = $listUnassigned->generateData($row["APP_UID"],$row["PREVIOUS_USR_UID"]);
|
||||
}
|
||||
CLI::logging("> Completed table LIST_UNASSIGNED\n");
|
||||
CLI::logging("> Completed table LIST_UNASSIGNED_GROUP\n");
|
||||
|
||||
@@ -2070,7 +2138,7 @@ class workspaceTools
|
||||
}
|
||||
|
||||
/**
|
||||
* This function checks if List tables are going to migrated
|
||||
* This function checks if List tables are going to migrated
|
||||
*
|
||||
* return boolean value
|
||||
*/
|
||||
@@ -2109,6 +2177,6 @@ class workspaceTools
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user