PMC-541
This commit is contained in:
@@ -233,8 +233,8 @@ try {
|
||||
define('DB_PASS', $DB_PASS);
|
||||
}
|
||||
if (!defined('SYS_SKIN')) {
|
||||
$conf = new Configurations();
|
||||
define('SYS_SKIN', $conf->getConfiguration('SKIN_CRON', ''));
|
||||
$config = System::getSystemConfiguration();
|
||||
define('SYS_SKIN', $config['default_skin']);
|
||||
}
|
||||
|
||||
$dateSystem = date('Y-m-d H:i:s');
|
||||
|
||||
@@ -1325,16 +1325,16 @@ function run_clear_dyn_content_history_data($args, $opts)
|
||||
* @param array $opts
|
||||
*
|
||||
* @return void
|
||||
* @see workflow/engine/bin/tasks/cliWorkspaces.php CLI::taskRun()
|
||||
*/
|
||||
|
||||
function run_sync_forms_with_info_from_input_documents($args, $opts) {
|
||||
if (count($args) === 1) {
|
||||
//This variable is not defined and does not involve its value in this
|
||||
//task, it is removed at the end of the method.
|
||||
$_SERVER['REQUEST_URI'] = '';
|
||||
if (!defined('SYS_SKIN')) {
|
||||
$conf = new Configurations();
|
||||
define('SYS_SKIN', $conf->getConfiguration('SKIN_CRON', ''));
|
||||
$config = System::getSystemConfiguration();
|
||||
define('SYS_SKIN', $config['default_skin']);
|
||||
}
|
||||
CLI::logging('Sync JSON definition of the Forms with Input Documents information from workspace: ' . pakeColor::colorize($args[0], 'INFO') . "\n");
|
||||
$workspaceTools = new WorkspaceTools($args[0]);
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use ProcessMaker\BusinessModel\Process as BmProcess;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\ChangeLog\ChangeLog;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
use ProcessMaker\BusinessModel\Process as BmProcess;
|
||||
use ProcessMaker\Core\Installer;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\Adapters\PluginAdapter;
|
||||
use ProcessMaker\Project\Adapter\BpmnWorkflow;
|
||||
use ProcessMaker\Util\FixReferencePath;
|
||||
|
||||
/**
|
||||
@@ -3739,53 +3740,62 @@ class WorkspaceTools
|
||||
CLI::logging("|--> Clean data in table " . OauthRefreshTokensPeer::TABLE_NAME . " rows " . $refreshToken . "\n");
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate the Intermediate throw Email Event to Dummy task, specify the workspaces.
|
||||
* The processes in this workspace will be updated.
|
||||
*
|
||||
* @param string $workspaceName
|
||||
* @see workflow/engine/bin/tasks/cliWorkspaces.php::run_migrate_itee_to_dummytask()
|
||||
* @see workflow/engine/classes/WorkspaceTools.php->upgradeDatabase()
|
||||
* @link https://wiki.processmaker.com/3.3/processmaker_command#migrate-itee-to-dummytask
|
||||
*/
|
||||
public function migrateIteeToDummytask($workspaceName)
|
||||
{
|
||||
$this->initPropel(true);
|
||||
$arraySystemConfiguration = System::getSystemConfiguration('', '', $workspaceName);
|
||||
$conf = new Configurations();
|
||||
\G::$sysSys = $workspaceName;
|
||||
\G::$pathDataSite = PATH_DATA . "sites" . PATH_SEP . \G::$sysSys . PATH_SEP;
|
||||
\G::$pathDocument = PATH_DATA . 'sites' . DIRECTORY_SEPARATOR . $workspaceName . DIRECTORY_SEPARATOR . 'files';
|
||||
\G::$memcachedEnabled = $arraySystemConfiguration['memcached'];
|
||||
\G::$pathDataPublic = \G::$pathDataSite . "public" . PATH_SEP;
|
||||
\G::$sysSkin = $conf->getConfiguration('SKIN_CRON', '');
|
||||
if (is_file(\G::$pathDataSite . PATH_SEP . ".server_info")) {
|
||||
$serverInfo = file_get_contents(\G::$pathDataSite . PATH_SEP . ".server_info");
|
||||
$config = System::getSystemConfiguration('', '', $workspaceName);
|
||||
G::$sysSys = $workspaceName;
|
||||
G::$pathDataSite = PATH_DATA . "sites" . PATH_SEP . G::$sysSys . PATH_SEP;
|
||||
G::$pathDocument = PATH_DATA . 'sites' . DIRECTORY_SEPARATOR . $workspaceName . DIRECTORY_SEPARATOR . 'files';
|
||||
G::$memcachedEnabled = $config['memcached'];
|
||||
G::$pathDataPublic = G::$pathDataSite . "public" . PATH_SEP;
|
||||
G::$sysSkin = $config['default_skin'];
|
||||
if (is_file(G::$pathDataSite . PATH_SEP . ".server_info")) {
|
||||
$serverInfo = file_get_contents(G::$pathDataSite . PATH_SEP . ".server_info");
|
||||
$serverInfo = unserialize($serverInfo);
|
||||
$envHost = $serverInfo["SERVER_NAME"];
|
||||
$envPort = ($serverInfo["SERVER_PORT"] . "" != "80") ? ":" . $serverInfo["SERVER_PORT"] : "";
|
||||
if (!empty($envPort) && strpos($envHost, $envPort) === false) {
|
||||
$envHost = $envHost . $envPort;
|
||||
}
|
||||
\G::$httpHost = $envHost;
|
||||
G::$httpHost = $envHost;
|
||||
}
|
||||
|
||||
//Search All process
|
||||
$oCriteria = new Criteria("workflow");
|
||||
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
|
||||
$oCriteria->addSelectColumn(ProcessPeer::PRO_ITEE);
|
||||
$oCriteria->add(ProcessPeer::PRO_ITEE, '0', Criteria::EQUAL);
|
||||
$rsCriteria = ProcessPeer::doSelectRS($oCriteria);
|
||||
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$criteria = new Criteria("workflow");
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_UID);
|
||||
$criteria->addSelectColumn(ProcessPeer::PRO_ITEE);
|
||||
$criteria->add(ProcessPeer::PRO_ITEE, '0', Criteria::EQUAL);
|
||||
$resultSet = ProcessPeer::doSelectRS($criteria);
|
||||
$resultSet->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$message = "-> Migrating the Intermediate Email Event \n";
|
||||
CLI::logging($message);
|
||||
while ($rsCriteria->next()) {
|
||||
$row = $rsCriteria->getRow();
|
||||
$prj_uid = $row['PRO_UID'];
|
||||
$bpmnProcess = new Process();
|
||||
if ($bpmnProcess->isBpmnProcess($prj_uid)) {
|
||||
$project = new \ProcessMaker\Project\Adapter\BpmnWorkflow();
|
||||
$diagram = $project->getStruct($prj_uid);
|
||||
$res = $project->updateFromStruct($prj_uid, $diagram);
|
||||
$bpmnProcess->setProUid($prj_uid);
|
||||
$oProcess = new Process();
|
||||
$aProcess['PRO_UID'] = $prj_uid;
|
||||
$aProcess['PRO_ITEE'] = '1';
|
||||
if ($oProcess->processExists($prj_uid)) {
|
||||
$oProcess->update($aProcess);
|
||||
while ($resultSet->next()) {
|
||||
$row = $resultSet->getRow();
|
||||
$prjUid = $row['PRO_UID'];
|
||||
$process = new Process();
|
||||
if ($process->isBpmnProcess($prjUid)) {
|
||||
$project = new BpmnWorkflow();
|
||||
$diagram = $project->getStruct($prjUid);
|
||||
$project->updateFromStruct($prjUid, $diagram);
|
||||
$process->setProUid($prjUid);
|
||||
$updateProcess = new Process();
|
||||
$updateProcessData = [];
|
||||
$updateProcessData['PRO_UID'] = $prjUid;
|
||||
$updateProcessData['PRO_ITEE'] = '1';
|
||||
if ($updateProcess->processExists($prjUid)) {
|
||||
$updateProcess->update($updateProcessData);
|
||||
}
|
||||
$message = " Process updated " . $bpmnProcess->getProTitle() . "\n";
|
||||
$message = " Process updated " . $process->getProTitle() . "\n";
|
||||
CLI::logging($message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
//
|
||||
// License: LGPL, see LICENSE
|
||||
////////////////////////////////////////////////////
|
||||
use ProcessMaker\BusinessModel\Cases as BusinessModelCases;
|
||||
use ProcessMaker\Core\System;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use ProcessMaker\Util\ElementTranslation;
|
||||
|
||||
|
||||
/**
|
||||
* ProcessMaker has made a number of its PHP functions available be used in triggers and conditions.
|
||||
* Most of these functions are wrappers for internal functions used in Gulliver, which is the development framework
|
||||
@@ -3470,38 +3470,26 @@ function PMFGetNextDerivationInfo($caseUid, $delIndex)
|
||||
* @param string | $skin = null | Skin | The skin
|
||||
*
|
||||
* @return string | $url | Direct case link | Returns the direct case link, FALSE otherwise
|
||||
* @link https://wiki.processmaker.com/3.2/Direct_Case_Link
|
||||
*/
|
||||
function PMFCaseLink($caseUid, $workspace = null, $language = null, $skin = null)
|
||||
{
|
||||
try {
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
|
||||
$case = new BusinessModelCases();
|
||||
$arrayApplicationData = $case->getApplicationRecordByPk($caseUid, [], false);
|
||||
|
||||
if ($arrayApplicationData === false) {
|
||||
return false;
|
||||
}
|
||||
$conf = new Configurations();
|
||||
$envSkin = defined("SYS_SKIN") ? SYS_SKIN : $conf->getConfiguration('SKIN_CRON', '');
|
||||
$workspace = (!empty($workspace)) ? $workspace : config("system.workspace");
|
||||
$language = (!empty($language)) ? $language : SYS_LANG;
|
||||
$skin = (!empty($skin)) ? $skin : $envSkin;
|
||||
|
||||
$workspace = !empty($workspace) ? $workspace : config("system.workspace");
|
||||
$language = !empty($language) ? $language : SYS_LANG;
|
||||
if (empty($skin)) {
|
||||
$config = System::getSystemConfiguration();
|
||||
$skin = defined("SYS_SKIN") ? SYS_SKIN : $config['default_skin'];
|
||||
}
|
||||
|
||||
$uri = '/sys' . $workspace . '/' . $language . '/' . $skin . '/cases/opencase/' . $caseUid;
|
||||
|
||||
$envHost = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : SERVER_NAME;
|
||||
$envProtocol = defined("REQUEST_SCHEME") && REQUEST_SCHEME === "https";
|
||||
if (isset($_SERVER['SERVER_PORT'])) {
|
||||
$envPort = ($_SERVER['SERVER_PORT'] != "80") ? ":" . $_SERVER['SERVER_PORT'] : "";
|
||||
} else if (defined('SERVER_PORT')) {
|
||||
$envPort = (SERVER_PORT . "" != "80") ? ":" . SERVER_PORT : "";
|
||||
} else {
|
||||
$envPort = "";
|
||||
}
|
||||
if (!empty($envPort) && strpos($envHost, $envPort) === false) {
|
||||
$envHost = $envHost . $envPort;
|
||||
}
|
||||
$link = (G::is_https() || $envProtocol ? 'https://' : 'http://') . $envHost . $uri;
|
||||
$link = System::getServerProtocolHost() . $uri;
|
||||
return $link;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
|
||||
@@ -1597,11 +1597,25 @@ class System
|
||||
* Get server main path (protocol + host + port + workspace + lang + skin).
|
||||
*
|
||||
* @return string
|
||||
* @see ProcessMaker\BusinessModel\ProjectUser->projectWsUserCanStartTask()
|
||||
* @see ProcessMaker\BusinessModel\ProjectUser->userLogin()
|
||||
* @see ProcessMaker\BusinessModel\WebEntry->getWebEntryDataFromRecord()
|
||||
* @see ProcessMaker\BusinessModel\WebEntryEvent->getGeneratedLink()
|
||||
* @see ProcessMaker\Core\System\ActionsByEmailCoreClass->sendActionsByEmail()
|
||||
* @see ProcessMaker\Core\System\webEntryProxy->checkCredentials()
|
||||
* @see ProcessMaker\Core\System\webEntryProxy->save()
|
||||
* @see workflow/engine/classes/ProcessMap.php ProcessMap->listNewWebEntry()
|
||||
* @see workflow/engine/classes/ProcessMap.php ProcessMap->webEntry()
|
||||
* @see workflow/engine/controllers/caseSchedulerProxy.php caseSchedulerProxy->checkCredentials()
|
||||
* @see workflow/engine/methods/cases/cases_SchedulerValidateUser.php
|
||||
* @see workflow/engine/methods/processes/processes_webEntryGenerate.php
|
||||
* @see workflow/engine/methods/processes/processes_webEntryValidate.php
|
||||
* @see workflow/engine/methods/processes/webEntry_Val_Assig.php
|
||||
*/
|
||||
public static function getServerMainPath()
|
||||
{
|
||||
$conf = new Configurations();
|
||||
$skin = defined("SYS_SKIN") ? SYS_SKIN : $conf->getConfiguration('SKIN_CRON', '');
|
||||
$config = self::getSystemConfiguration();
|
||||
$skin = defined("SYS_SKIN") ? SYS_SKIN : $config['default_skin'];
|
||||
return self::getServerProtocolHost() . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $skin;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
|
||||
namespace ProcessMaker\Util;
|
||||
|
||||
use Configurations;
|
||||
use Criteria;
|
||||
use ResultSet;
|
||||
use FieldsPeer;
|
||||
use ReportTablePeer;
|
||||
use CaseConsolidatedCorePeer;
|
||||
use ConsolidatedCases;
|
||||
use AdditionalTablesPeer;
|
||||
use PmTable;
|
||||
use ReportVarPeer;
|
||||
use AdditionalTables;
|
||||
use AdditionalTablesPeer;
|
||||
use CaseConsolidatedCorePeer;
|
||||
use Configurations;
|
||||
use ConsolidatedCases;
|
||||
use Criteria;
|
||||
use FieldsPeer;
|
||||
use PmTable;
|
||||
use ProcessMaker\Core\System;
|
||||
use ReportTablePeer;
|
||||
use ReportVarPeer;
|
||||
use ResultSet;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
@@ -73,6 +74,7 @@ class FixReferencePath
|
||||
* @param string $directory
|
||||
* @param string $pathData
|
||||
* @return void
|
||||
* @see workflow/engine/classes/WorkspaceTools.php WorkspaceTools->fixReferencePathFiles()
|
||||
*/
|
||||
public function runProcess($directory, $pathData)
|
||||
{
|
||||
@@ -81,8 +83,8 @@ class FixReferencePath
|
||||
//task, it is removed at the end of the method.
|
||||
$_SERVER["REQUEST_URI"] = "";
|
||||
if (!defined("SYS_SKIN")) {
|
||||
$conf = new Configurations();
|
||||
define("SYS_SKIN", $conf->getConfiguration('SKIN_CRON', ''));
|
||||
$config = System::getSystemConfiguration();
|
||||
define("SYS_SKIN", $config['default_skin']);
|
||||
}
|
||||
|
||||
$criteria = new Criteria("workflow");
|
||||
|
||||
Reference in New Issue
Block a user