Merge remote branch 'upstream/master'
This commit is contained in:
@@ -29,7 +29,7 @@ class PMLicensedFeatures
|
||||
private $features = array ();
|
||||
private $newFeatures = array(
|
||||
0 => array(
|
||||
"description" => "Enables de Actions By Email feature.",
|
||||
"description" => "Actions By Email allows users to enter information and route cases via email.",
|
||||
"enabled" => false,
|
||||
"id" => "actionsByEmail",
|
||||
"latest_version" => "",
|
||||
@@ -46,7 +46,7 @@ class PMLicensedFeatures
|
||||
"version" => ""
|
||||
),
|
||||
1 => array(
|
||||
"description" => "Enables de Batch Routing feature.",
|
||||
"description" => "Batch Routing allows a user to route multiple cases at a time onto the next task in the process. ",
|
||||
"enabled" => false,
|
||||
"id" => "pmConsolidatedCL",
|
||||
"latest_version" => "",
|
||||
@@ -97,7 +97,7 @@ class PMLicensedFeatures
|
||||
"version" => ""
|
||||
),
|
||||
4 => array(
|
||||
"description" => "Registers every admin action in a log. The actions in administration settings options are registered in the log.",
|
||||
"description" => "Registers every administrator action in a log. Any change in the settings under the Admin menu is registered in the log.",
|
||||
"enabled" => false,
|
||||
"id" => "auditLog",
|
||||
"latest_version" => "",
|
||||
@@ -131,7 +131,7 @@ class PMLicensedFeatures
|
||||
"version" => ""
|
||||
),
|
||||
6 => array(
|
||||
"description" => "This functionality enables the flexibility to send mails from different email servers or configurations.",
|
||||
"description" => "This features allows ProcessMaker to send out notifications using different email accounts and email servers.",
|
||||
"enabled" => false,
|
||||
"id" => "sendEmailFromDifferentEmailServers",
|
||||
"latest_version" => "",
|
||||
@@ -423,4 +423,3 @@ class PMLicensedFeatures
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
|
||||
@@ -68,8 +68,15 @@ class pmDynaform
|
||||
|
||||
public function getCredentials()
|
||||
{
|
||||
$flagTrackerUser = false;
|
||||
|
||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
return;
|
||||
if (!preg_match("/^.*\/" . SYS_SKIN . "\/tracker\/.*$/", $_SERVER["REQUEST_URI"])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$_SESSION["USER_LOGGED"] = "00000000000000000000000000000001";
|
||||
$flagTrackerUser = true;
|
||||
}
|
||||
if ($this->credentials != null) {
|
||||
return $this->credentials;
|
||||
@@ -84,6 +91,11 @@ class pmDynaform
|
||||
"clientId" => $a["client_id"],
|
||||
"clientSecret" => $a["client_secret"]
|
||||
);
|
||||
|
||||
if ($flagTrackerUser) {
|
||||
unset($_SESSION["USER_LOGGED"]);
|
||||
}
|
||||
|
||||
return $this->credentials;
|
||||
}
|
||||
|
||||
@@ -163,7 +175,7 @@ class pmDynaform
|
||||
array_push($json->options, $option);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if (isset($json->options[0])) {
|
||||
|
||||
@@ -111,70 +111,18 @@ class workspaceTools
|
||||
$final = $stop - $start;
|
||||
CLI::logging("<*> Backup log files Process took $final seconds.\n");
|
||||
|
||||
CLI::logging("> Updating Files Manager...\n\n");
|
||||
$this->upgradeFilesManager($workSpace);
|
||||
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Migrate new lists...\n");
|
||||
$this->migrateList($workSpace);
|
||||
$stop = microtime(true);
|
||||
$final = $stop - $start;
|
||||
CLI::logging("<*> Migrate new lists Process took $final seconds.\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Function upgradeFilesManager
|
||||
* access public
|
||||
*/
|
||||
public function upgradeFilesManager($workSpace) {
|
||||
$this->initPropel(true);
|
||||
$con = Propel::getConnection("root");
|
||||
$stmt = $con->createStatement();
|
||||
$sDirectory = glob(PATH_DATA . "sites/" . $workSpace . "/" . "mailTemplates/*");
|
||||
$sDirectoryPublic = glob(PATH_DATA . "sites/" . $workSpace . "/" . "public/*");
|
||||
$files = array();
|
||||
foreach($sDirectory as $mailTemplate) {
|
||||
if (is_dir($mailTemplate)) {
|
||||
$inner_files = listFiles($mailTemplate);
|
||||
if (is_array($inner_files)) $files = array_merge($files, $inner_files);
|
||||
}
|
||||
if (is_file($mailTemplate)) {
|
||||
array_push($files, $mailTemplate);
|
||||
}
|
||||
}
|
||||
foreach($sDirectoryPublic as $publicFile) {
|
||||
if (is_dir($publicFile)) {
|
||||
$inner_files = listFiles($publicFile);
|
||||
if (is_array($inner_files)) $files = array_merge($files, $inner_files);
|
||||
}
|
||||
if (is_file($publicFile)) {
|
||||
array_push($files, $publicFile);
|
||||
}
|
||||
}
|
||||
$sDir = PATH_DATA . "sites/" . $workSpace . "/" . "mailTemplates/";
|
||||
$sDirPublic = PATH_DATA . "sites/" . $workSpace . "/" . "public/";
|
||||
foreach ($files as $aFile) {
|
||||
if (strpos($aFile, $sDir) !== false){
|
||||
$processUid = current(explode("/", str_replace($sDir,'',$aFile)));
|
||||
} else {
|
||||
$processUid = current(explode("/", str_replace($sDirPublic,'',$aFile)));
|
||||
}
|
||||
$sql = "SELECT PROCESS_FILES.PRF_PATH FROM PROCESS_FILES WHERE PROCESS_FILES.PRF_PATH='" . $aFile ."'";
|
||||
$appRows = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
$fileUid = '';
|
||||
foreach ($appRows as $row) {
|
||||
$fileUid = $row["PRF_PATH"];
|
||||
}
|
||||
if ($fileUid !== $aFile) {
|
||||
$sPkProcessFiles = G::generateUniqueID();
|
||||
$sDate = date('Y-m-d H:i:s');
|
||||
$sql = "INSERT INTO PROCESS_FILES (PRF_UID, PRO_UID, USR_UID, PRF_UPDATE_USR_UID,
|
||||
PRF_PATH, PRF_TYPE, PRF_EDITABLE, PRF_CREATE_DATE, PRF_UPDATE_DATE)
|
||||
VALUES ('".$sPkProcessFiles."', '".$processUid."', '00000000000000000000000000000001', '',
|
||||
'".$aFile."', 'file', 'true', '".$sDate."', NULL)";
|
||||
$stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
}
|
||||
}
|
||||
$start = microtime(true);
|
||||
CLI::logging("> Updating Files Manager...\n");
|
||||
$this->processFilesUpgrade();
|
||||
$stop = microtime(true);
|
||||
CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1564,10 +1512,10 @@ class workspaceTools
|
||||
$version = explode('-', $version);
|
||||
$versionPresent = ( isset($version[0])) ? $version[0] : '';
|
||||
CLI::logging(CLI::warning("
|
||||
Warning: A workspace from a newer version of ProcessMaker can NOT be restored in an older version of
|
||||
ProcessMaker. For example, restoring from v.3.0 to v.2.5 will not work. However, it may be possible
|
||||
to restore a workspace from an older version to an newer version of ProcessMaker, although error
|
||||
messages may be displayed during the restore process. Make sure to run the \"processmaker cacheview-repair\"
|
||||
Warning: A workspace from a newer version of ProcessMaker can NOT be restored in an older version of
|
||||
ProcessMaker. For example, restoring from v.3.0 to v.2.5 will not work. However, it may be possible
|
||||
to restore a workspace from an older version to an newer version of ProcessMaker, although error
|
||||
messages may be displayed during the restore process. Make sure to run the \"processmaker cacheview-repair\"
|
||||
and \"processmaker migrate-new-cases-lists\" commands after restoring a workspace.") . "\n");
|
||||
|
||||
foreach ($metaFiles as $metaFile) {
|
||||
@@ -2226,5 +2174,31 @@ class workspaceTools
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process-Files upgrade
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function processFilesUpgrade()
|
||||
{
|
||||
try {
|
||||
if (!defined("PATH_DATA_MAILTEMPLATES")) {
|
||||
define("PATH_DATA_MAILTEMPLATES", PATH_DATA_SITE . "mailTemplates" . PATH_SEP);
|
||||
}
|
||||
|
||||
if (!defined("PATH_DATA_PUBLIC")) {
|
||||
define("PATH_DATA_PUBLIC", PATH_DATA_SITE . "public" . PATH_SEP);
|
||||
}
|
||||
|
||||
$this->initPropel(true);
|
||||
|
||||
$filesManager = new \ProcessMaker\BusinessModel\FilesManager();
|
||||
|
||||
$filesManager->processFilesUpgrade();
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60026,10 +60026,10 @@ INSERT INTO CATALOG (CAT_UID, CAT_LABEL_ID, CAT_TYPE, CAT_FLAG, CAT_OBSERVATION,
|
||||
('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04');
|
||||
|
||||
INSERT INTO ADDONS_MANAGER (ADDON_DESCRIPTION,ADDON_ID,ADDON_NAME,ADDON_NICK,ADDON_PUBLISHER,ADDON_RELEASE_TYPE,ADDON_STATUS,STORE_ID,ADDON_TYPE,ADDON_DOWNLOAD_URL,ADDON_VERSION,ADDON_DOWNLOAD_PROGRESS) VALUES
|
||||
('Enables de Actions By Email feature.','actionsByEmail','actionsByEmail','actionsByEmail','Colosa','localRegistry','ready','00000000000000000000000000010004','features','','','0'),
|
||||
('Enables de Batch Routing feature.','pmConsolidatedCL','pmConsolidatedCL','pmConsolidatedCL','Colosa','localRegistry','ready','00000000000000000000000000010005','features','','','0'),
|
||||
('Actions By Email allows users to enter information and route cases via email.','actionsByEmail','actionsByEmail','actionsByEmail','Colosa','localRegistry','ready','00000000000000000000000000010004','features','','','0'),
|
||||
('Batch Routing allows a user to route multiple cases at a time onto the next task in the process.','pmConsolidatedCL','pmConsolidatedCL','pmConsolidatedCL','Colosa','localRegistry','ready','00000000000000000000000000010005','features','','','0'),
|
||||
('Dashboard with improved charting graphics and optimized to show strategic information like Process Efficiency and User Efficiency indicators.','strategicDashboards','strategicDashboards','Strategic Dashboards','Colosa','localRegistry','ready','00000000000000000000000000010006','features','','','0'),
|
||||
('Enables the configuration of a second database connection in order to divide the database requests in read and write operations. This features is used with database clusters to improve the application performance.','secondDatabaseConnection','secondDatabaseConnection','secondDatabaseConnection','Colosa','localRegistry','ready','00000000000000000000000000010000','features','','','0'),
|
||||
('A more secure option to store user passwords in ProcessMaker. The modern algorithm SHA-2 is used to store the passwords.','secureUserPasswordHash','secureUserPasswordHash','secureUserPasswordHash','Colosa','localRegistry','ready','00000000000000000000000000010002','features','','','0'),
|
||||
('This functionality enables the flexibility to send mails from different email servers or configurations.','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','Colosa','localRegistry','ready','00000000000000000000000000010003','features','','','0'),
|
||||
('Registers every admin action in a log. The actions in administration settings options are registered in the log.','auditLog','auditLog','auditLog','Colosa','localRegistry','ready','00000000000000000000000000010001','features','','','0');
|
||||
('This features allows ProcessMaker to send out notifications using different email accounts and email servers.','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','sendEmailFromDifferentEmailServers','Colosa','localRegistry','ready','00000000000000000000000000010003','features','','','0'),
|
||||
('Registers every administrator action in a log. Any change in the settings under the Admin menu is registered in the log.','auditLog','auditLog','auditLog','Colosa','localRegistry','ready','00000000000000000000000000010001','features','','','0');
|
||||
|
||||
@@ -86,14 +86,17 @@ $html .= '</td>';
|
||||
|
||||
$html .= '<td width="25%">';
|
||||
$html .= '<select name="prefix" id="prefix">';
|
||||
|
||||
$html .= '<option value="ID_TO_STRING">@@</option>';
|
||||
$html .= '<option value="ID_TO_FLOAT">@#</option>';
|
||||
$html .= '<option value="ID_TO_INTEGER">@%</option>';
|
||||
$html .= '<option value="ID_TO_URL">@?</option>';
|
||||
$html .= '<option value="ID_SQL_ESCAPE">@$</option>';
|
||||
$html .= '<option value="ID_REPLACE_WITHOUT_CHANGES">@=</option>';
|
||||
|
||||
if ($isBpmn) {
|
||||
$html .= '<option value="ID_TO_STRING">@@</option>';
|
||||
$html .= '<option value="ID_TO_FLOAT">@#</option>';
|
||||
$html .= '<option value="ID_TO_INTEGER">@%</option>';
|
||||
$html .= '<option value="ID_TO_URL">@?</option>';
|
||||
$html .= '<option value="ID_SQL_ESCAPE">@$</option>';
|
||||
$html .= '<option value="ID_REPLACE_WITHOUT_CHANGES">@=</option>';
|
||||
} else {
|
||||
$html .= '<option value="ID_TO_STRING">@@</option>';
|
||||
$html .= '<option value="ID_TO_FLOAT">@#</option>';
|
||||
}
|
||||
$html .= '</select> ';
|
||||
$html .= '</td>';
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ class FilesManager
|
||||
$directory = $sMainDirectory. PATH_SEP . $sSubDirectory . $aData['prf_filename'];
|
||||
throw new \Exception(\G::LoadTranslation("ID_EXISTS_FILE", array($directory)));
|
||||
}
|
||||
|
||||
|
||||
if (!file_exists($sCheckDirectory)) {
|
||||
$sPkProcessFiles = \G::generateUniqueID();
|
||||
$oProcessFiles = new \ProcessFiles();
|
||||
@@ -242,31 +242,31 @@ class FilesManager
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function addProcessFilesManagerInDb($aData)
|
||||
{
|
||||
try {
|
||||
$oProcessFiles = new \ProcessFiles();
|
||||
$aData = array_change_key_case($aData, CASE_UPPER);
|
||||
$oProcessFiles->fromArray($aData, \BasePeer::TYPE_FIELDNAME);
|
||||
|
||||
|
||||
if($this->existsProcessFile($aData['PRF_UID'])) {
|
||||
$sPkProcessFiles = \G::generateUniqueID();
|
||||
$oProcessFiles->setPrfUid($sPkProcessFiles);
|
||||
|
||||
|
||||
$sDirectory = PATH_DATA_MAILTEMPLATES . $aData['PRO_UID'] . PATH_SEP . basename($aData['PRF_PATH']);
|
||||
$oProcessFiles->setPrfPath($sDirectory);
|
||||
|
||||
|
||||
$emailEvent = new \ProcessMaker\BusinessModel\EmailEvent();
|
||||
$emailEvent->updatePrfUid($aData['PRF_UID'], $sPkProcessFiles, $aData['PRO_UID']);
|
||||
}
|
||||
|
||||
|
||||
$result = $oProcessFiles->save();
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function existsProcessFile($prfUid)
|
||||
{
|
||||
try {
|
||||
@@ -462,10 +462,10 @@ class FilesManager
|
||||
if ($path == '') {
|
||||
throw new \Exception(\G::LoadTranslation("ID_INVALID_VALUE_FOR", array('prf_uid')));
|
||||
}
|
||||
|
||||
|
||||
$sFile = end(explode("/",$path));
|
||||
$path = PATH_DATA_MAILTEMPLATES.$sProcessUID.DIRECTORY_SEPARATOR.$sFile;
|
||||
|
||||
|
||||
if (file_exists($path) && !is_dir($path)) {
|
||||
unlink($path);
|
||||
}
|
||||
@@ -601,4 +601,115 @@ class FilesManager
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Process-Files upgrade
|
||||
*
|
||||
* @param string $projectUid Unique id of Project
|
||||
*
|
||||
* return void
|
||||
*/
|
||||
public function processFilesUpgrade($projectUid = "")
|
||||
{
|
||||
try {
|
||||
//Set variables
|
||||
$conf = new \Configuration();
|
||||
|
||||
//Create/Get PROCESS_FILES_CHECKED
|
||||
$arrayProjectUid = array();
|
||||
|
||||
$configuration = \ConfigurationPeer::retrieveByPK("PROCESS_FILES_CHECKED", "", "", "", "");
|
||||
|
||||
if (is_null($configuration)) {
|
||||
$result = $conf->create(array(
|
||||
"CFG_UID" => "PROCESS_FILES_CHECKED",
|
||||
"OBJ_UID" => "",
|
||||
"CFG_VALUE" => serialize($arrayProjectUid),
|
||||
"PRO_UID" => "",
|
||||
"USR_UID" => "",
|
||||
"APP_UID" => ""
|
||||
));
|
||||
} else {
|
||||
$arrayProjectUid = unserialize($configuration->getCfgValue());
|
||||
}
|
||||
|
||||
//Set variables
|
||||
$arrayPath = array("templates" => PATH_DATA_MAILTEMPLATES, "public" => PATH_DATA_PUBLIC);
|
||||
$flagProjectUid = false;
|
||||
|
||||
//Query
|
||||
$criteria = new \Criteria("workflow");
|
||||
|
||||
$criteria->addSelectColumn(\BpmnProjectPeer::PRJ_UID);
|
||||
|
||||
if ($projectUid != "") {
|
||||
$criteria->add(
|
||||
$criteria->getNewCriterion(\BpmnProjectPeer::PRJ_UID, $arrayProjectUid, \Criteria::NOT_IN)->addAnd(
|
||||
$criteria->getNewCriterion(\BpmnProjectPeer::PRJ_UID, $projectUid, \Criteria::EQUAL))
|
||||
);
|
||||
} else {
|
||||
$criteria->add(\BpmnProjectPeer::PRJ_UID, $arrayProjectUid, \Criteria::NOT_IN);
|
||||
}
|
||||
|
||||
$rsCriteria = \BpmnProjectPeer::doSelectRS($criteria);
|
||||
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
|
||||
foreach ($arrayPath as $key => $value) {
|
||||
$path = $key;
|
||||
$dir = $value . $row["PRJ_UID"];
|
||||
|
||||
if (is_dir($dir)) {
|
||||
if ($dirh = opendir($dir)) {
|
||||
while (($file = readdir($dirh)) !== false) {
|
||||
if ($file != "" && $file != "." && $file != "..") {
|
||||
$f = $dir . PATH_SEP . $file;
|
||||
|
||||
if (is_file($f)) {
|
||||
$arrayProcessFilesData = $this->getFileManagerUid($f);
|
||||
|
||||
if (is_null($arrayProcessFilesData["PRF_UID"])) {
|
||||
rename($dir . PATH_SEP . $file, $dir . PATH_SEP . $file . ".tmp");
|
||||
|
||||
$arrayData = array(
|
||||
"prf_path" => $path,
|
||||
"prf_filename" => $file,
|
||||
"prf_content" => ""
|
||||
);
|
||||
|
||||
$arrayData = $this->addProcessFilesManager($row["PRJ_UID"], "00000000000000000000000000000001", $arrayData);
|
||||
|
||||
rename($dir . PATH_SEP . $file . ".tmp", $dir . PATH_SEP . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closedir($dirh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$arrayProjectUid[$row["PRJ_UID"]] = $row["PRJ_UID"];
|
||||
$flagProjectUid = true;
|
||||
}
|
||||
|
||||
//Update PROCESS_FILES_CHECKED
|
||||
if ($flagProjectUid) {
|
||||
$result = $conf->update(array(
|
||||
"CFG_UID" => "PROCESS_FILES_CHECKED",
|
||||
"OBJ_UID" => "",
|
||||
"CFG_VALUE" => serialize($arrayProjectUid),
|
||||
"PRO_UID" => "",
|
||||
"USR_UID" => "",
|
||||
"APP_UID" => ""
|
||||
));
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -402,6 +402,11 @@ abstract class Importer
|
||||
|
||||
$workflow->update($arrayWorkflowTables["process"]);
|
||||
|
||||
//Process-Files upgrade
|
||||
$filesManager = new \ProcessMaker\BusinessModel\FilesManager();
|
||||
|
||||
$filesManager->processFilesUpgrade($projectUid);
|
||||
|
||||
//Return
|
||||
return $projectUid;
|
||||
}
|
||||
@@ -559,7 +564,7 @@ abstract class Importer
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function saveAs($prj_uid, $prj_name, $prj_description, $prj_category)
|
||||
{
|
||||
try {
|
||||
@@ -594,3 +599,4 @@ abstract class Importer
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -581,6 +581,26 @@ class Workflow extends Handler
|
||||
$oCaseTracker = new \CaseTracker();
|
||||
$oCaseTrackerObject = new \CaseTrackerObject();
|
||||
|
||||
//Update PROCESS_FILES_CHECKED
|
||||
$configuration = \ConfigurationPeer::retrieveByPK("PROCESS_FILES_CHECKED", "", "", "", "");
|
||||
|
||||
if (!is_null($configuration)) {
|
||||
$arrayProjectUid = unserialize($configuration->getCfgValue());
|
||||
|
||||
unset($arrayProjectUid[$sProcessUID]);
|
||||
|
||||
$conf = new \Configuration();
|
||||
|
||||
$result = $conf->update(array(
|
||||
"CFG_UID" => "PROCESS_FILES_CHECKED",
|
||||
"OBJ_UID" => "",
|
||||
"CFG_VALUE" => serialize($arrayProjectUid),
|
||||
"PRO_UID" => "",
|
||||
"USR_UID" => "",
|
||||
"APP_UID" => ""
|
||||
));
|
||||
}
|
||||
|
||||
//Delete the applications of process
|
||||
if ($flagRemoveCases) {
|
||||
$case = new \Cases();
|
||||
|
||||
Reference in New Issue
Block a user