release/3.2.2 to develop conflicts

This commit is contained in:
Paula Quispe
2017-10-23 11:37:41 -04:00
185 changed files with 2479 additions and 2209 deletions

View File

@@ -239,11 +239,10 @@ class PmBootstrap extends Bootstrap
public function initPropel($sys = '')
{
if (empty($sys)) {
if (! defined(SYS_SYS)) {
throw new Exception("Error: Undefined syemtem env. constant 'SYS_SYS'");
$sys = config("system.workspace");
if (empty($sys)) {
throw new Exception("Error: Undefined system environment (workspace).");
}
$sys = SYS_SYS;
}
// setup propel definitions and logging

View File

@@ -132,12 +132,13 @@ try {
if (is_dir(PATH_DB . $workspace) && file_exists(PATH_DB . $workspace . PATH_SEP . 'db.php')) {
define('SYS_SYS', $workspace);
config(["system.workspace" => $workspace]);
include_once(PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php');
include_once(PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
//PM Paths DATA
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
define('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
define('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
define('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
@@ -417,7 +418,7 @@ function executePlugins()
}
if ($handle = opendir($pathCronPlugins)) {
setExecutionMessage('Executing cron files in bin/plugins directory in Workspace: ' . SYS_SYS);
setExecutionMessage('Executing cron files in bin/plugins directory in Workspace: ' . config("system.workspace"));
while (false !== ($file = readdir($handle))) {
if (strpos($file, '.php',1) && is_file($pathCronPlugins . $file)) {
$filename = str_replace('.php' , '', $file);
@@ -437,7 +438,7 @@ function executePlugins()
// -> Execute functions
if (!empty($cronFiles)) {
setExecutionMessage('Executing registered cron files for Workspace: ' . SYS_SYS);
setExecutionMessage('Executing registered cron files for Workspace: ' . config("system.workspace"));
foreach($cronFiles as $cronFile) {
executeCustomCronFunction(PATH_PLUGINS . $cronFile->namespace . PATH_SEP . 'bin' . PATH_SEP . $cronFile->cronFile . '.php', $cronFile->cronFile);
}
@@ -819,7 +820,7 @@ function executeCaseSelfService()
unset($appFields['APP_PIN']);
$case->updateCase($appFields["APP_UID"], $appFields);
saveLog("unassignedCase", "action", "OK Executed tigger to the case $appcacheAppNumber");
saveLog("unassignedCase", "action", "OK Executed trigger to the case $appcacheAppNumber");
}
}

View File

@@ -128,7 +128,7 @@ print "PATH_DB: " . PATH_DB . "\n";
print "PATH_CORE: " . PATH_CORE . "\n";
// define the site name (instance name)
if (! defined ('SYS_SYS')) {
if (empty(config("system.workspace"))) {
$sObject = $workspaceName;
$sNow = ''; // $argv[2];
$sFilter = '';
@@ -144,11 +144,12 @@ if (! defined ('SYS_SYS')) {
if (file_exists (PATH_DB . $sObject . PATH_SEP . 'db.php')) {
define ('SYS_SYS', $sObject);
config(["system.workspace" => $sObject]);
// ****************************************
// read initialize file
require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php';
$config = System::getSystemConfiguration ('', '', SYS_SYS);
$config = System::getSystemConfiguration ('', '', config("system.workspace"));
define ('MEMCACHED_ENABLED', $config ['memcached']);
define ('MEMCACHED_SERVER', $config ['memcached_server']);
define ('TIME_ZONE', $config ['time_zone']);
@@ -170,7 +171,7 @@ if (! defined ('SYS_SYS')) {
include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
// ***************** PM Paths DATA **************************
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
define ('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
define ('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
define ('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
@@ -264,7 +265,7 @@ function processWorkspace()
try {
if (($solrConf = System::solrEnv (SYS_SYS)) !== false) {
if (($solrConf = System::solrEnv (config("system.workspace"))) !== false) {
print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n";
print "solr_enabled: " . $solrConf ['solr_enabled'] . "\n";
print "solr_host: " . $solrConf ['solr_host'] . "\n";

View File

@@ -46,11 +46,12 @@ function run_addon_core_install($args)
$storeId = $args[1];
$addonName = $args[2];
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace);
config(["system.workspace" => $workspace]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
}
if (!defined("DB_ADAPTER")) {
define("DB_ADAPTER", $args[3]);
@@ -102,11 +103,12 @@ function change_hash($command, $opts)
$response = new stdclass();
$response->workspace = $workspace;
$response->hash = $hash;
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace->name);
config(["system.workspace" => $workspace->name]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
}
$_SESSION['__sw__'] = '';
if (!$workspace->changeHashPassword($workspace->name, $response)) {

View File

@@ -132,12 +132,13 @@ function run_upgrade($command, $args)
$flagUpdateXml = !array_key_exists('noxml', $args);
foreach ($workspaces as $index => $workspace) {
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace->name);
config(["system.workspace" => $workspace->name]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP);
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP);
}
if(!defined('DB_ADAPTER')) {

View File

@@ -358,12 +358,13 @@ function run_workspace_upgrade($args, $opts)
foreach ($workspaces as $workspace) {
try {
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspace->name);
config(["system.workspace" => $workspace->name]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP);
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP);
}
$workspace->upgrade($buildCacheView, $workspace->name, false, $lang, ['updateXml' => $flagUpdateXml, 'updateMafe' => $first]);

View File

@@ -98,7 +98,7 @@ print "PATH_DB: " . PATH_DB . "\n";
print "PATH_CORE: " . PATH_CORE . "\n";
// define the site name (instance name)
if (! defined ('SYS_SYS')) {
if (empty(config("system.workspace"))) {
$sObject = $workspaceName;
$sNow = ''; // $argv[2];
/*
@@ -115,11 +115,12 @@ if (! defined ('SYS_SYS')) {
if (file_exists (PATH_DB . $sObject . PATH_SEP . 'db.php')) {
define ('SYS_SYS', $sObject);
config(["system.workspace" => $sObject]);
// ****************************************
// read initialize file
require_once PATH_HOME . 'engine' . PATH_SEP . 'classes' . PATH_SEP . 'class.system.php';
$config = System::getSystemConfiguration ('', '', SYS_SYS);
$config = System::getSystemConfiguration ('', '', config("system.workspace"));
define ('MEMCACHED_ENABLED', $config ['memcached']);
define ('MEMCACHED_SERVER', $config ['memcached_server']);
define ('TIME_ZONE', $config ['time_zone']);
@@ -142,7 +143,7 @@ if (! defined ('SYS_SYS')) {
print "MEMCACHED_SERVER: " . $MEMCACHED_SERVER . "\n";
// ***************** PM Paths DATA **************************
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . config("system.workspace") . '/');
define ('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
define ('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
define ('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
@@ -337,7 +338,7 @@ function displayMissingCases($aAppUidsDB, $aAppUidsSolr)
function getListUids($usrUid, $action)
{
if (($solrConf = System::solrEnv (SYS_SYS)) !== false) {
if (($solrConf = System::solrEnv (config("system.workspace"))) !== false) {
print "Solr Configuration file: " . PATH_DATA_SITE . "env.ini\n";
print "solr_enabled: " . $solrConf ['solr_enabled'] . "\n";

View File

@@ -160,7 +160,7 @@ class ActionsByEmailCoreClass extends PMPlugin
if (!empty($envPort) && strpos($envHost, $envPort) === false) {
$envHost = $envHost . $envPort;
}
$link = (G::is_https() || $envProtocol ? 'https://' : 'http://') . $envHost . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $envSkin . '/services/ActionsByEmail';
$link = (G::is_https() || $envProtocol ? 'https://' : 'http://') . $envHost . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $envSkin . '/services/ActionsByEmail';
switch ($configuration['ABE_TYPE']) {
case 'CUSTOM':

View File

@@ -110,8 +110,10 @@ class Applications
$sqlData .= " AND APPLICATION.APP_STATUS = 'TO_DO'";
break;
default: //All status
//When the status is TO_DO, we will get all the open threads
$sqlData .= " AND (APP_DELEGATION.DEL_THREAD_STATUS = 'OPEN' ";
$sqlData .= " OR (APP_DELEGATION.DEL_THREAD_STATUS = 'CLOSED' AND APP_DELEGATION.DEL_LAST_INDEX = 1)) ";
//When the status is COMPLETED, we will get the last task that with completed the case
$sqlData .= " OR (APP_DELEGATION.DEL_THREAD_STATUS = 'CLOSED' AND APP_DELEGATION.DEL_LAST_INDEX = 1 AND APPLICATION.APP_STATUS_ID = 3)) ";
break;
}
@@ -703,7 +705,7 @@ class Applications
$tableName = implode( '', $newTableName );
// so the pm table class can be invoqued from the pm table model clases
if (! class_exists( $tableName )) {
require_once (PATH_DB . SYS_SYS . PATH_SEP . "classes" . PATH_SEP . $tableName . ".php");
require_once (PATH_DB . config("system.workspace") . PATH_SEP . "classes" . PATH_SEP . $tableName . ".php");
}
}
$totalCount = AppCacheViewPeer::doCount($CriteriaCount, $distinct);

View File

@@ -1068,7 +1068,7 @@ class Cases
$oDerivation->verifyIsCaseChild($sAppUid);
}
} catch (Exception $e) {
Bootstrap::registerMonolog('DeleteCases', 200, 'Error in sub-process when trying to route a child case related to the case', ['application_uid' => $sAppUid, 'error' => $e->getMessage()], SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('DeleteCases', 200, 'Error in sub-process when trying to route a child case related to the case', ['application_uid' => $sAppUid, 'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
}
//Delete the registries in the table SUB_APPLICATION
@@ -2211,7 +2211,7 @@ class Cases
"delIndex" => $iDelIndex,
"appInitDate" => $Fields['APP_INIT_DATE']
];
Bootstrap::registerMonolog('CreateCase', 200, "Create case", $data, SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('CreateCase', 200, "Create case", $data, config("system.workspace"), 'processmaker.log');
//call plugin
if (class_exists('folderData')) {
@@ -3375,7 +3375,7 @@ class Cases
$oPMScript->setFields($aFields);
/*----------------------------------********---------------------------------*/
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$strFoundDisabledCode = "";
/*----------------------------------********---------------------------------*/
@@ -6969,11 +6969,20 @@ class Cases
return $response;
}
/**
* This method return the cases notes
* @param $applicationID
* @param string $type
* @param string $userUid
* @return array|stdclass|string
*/
public function getCaseNotes($applicationID, $type = 'array', $userUid = '')
{
require_once("classes/model/AppNotes.php");
$appNotes = new AppNotes();
$appNotes = $appNotes->getNotesList($applicationID, $userUid);
$appNotes = AppNotes::applyHtmlentitiesInNotes($appNotes);
$response = '';
if (is_array($appNotes)) {
switch ($type) {
@@ -7005,10 +7014,10 @@ class Cases
$response = '';
foreach ($appNotes['array']['notes'] as $key => $value) {
$response .= $value['USR_FIRSTNAME'] . " " .
$value['USR_LASTNAME'] . " " .
"(" . $value['USR_USERNAME'] . ")" .
" " . $value['NOTE_CONTENT'] . " " . " (" . $value['NOTE_DATE'] . " ) " .
" \n";
$value['USR_LASTNAME'] . " " .
"(" . $value['USR_USERNAME'] . ")" .
" " . $value['NOTE_CONTENT'] . " " . " (" . $value['NOTE_DATE'] . " ) " .
" \n";
}
break;
}

View File

@@ -146,7 +146,7 @@ class ConsolidatedCases
}
$sClassName = $TableName;
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
@unlink($sPath . $sClassName . '.php');
@unlink($sPath . $sClassName . 'Peer.php');

View File

@@ -856,7 +856,7 @@ class Derivation
*/
function derivate(array $currentDelegation, array $nextDelegations, $removeList = true)
{
$this->sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";
$this->sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
$this->context = Bootstrap::getDefaultContextLog();
$aContext = $this->context;
$this->removeList = $removeList;

View File

@@ -101,11 +101,11 @@ class EnterpriseClass extends PMPlugin
{
$oServerConf = &ServerConf::getSingleton();
$infoLicense =$oServerConf->getProperty('LICENSE_INFO');
if (isset($infoLicense[SYS_SYS]['LIMIT_USERS'])) {
if (isset($infoLicense[config("system.workspace")]['LIMIT_USERS'])) {
$criteria = new Criteria('workflow');
$criteria->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
$count = UsersPeer::doCount($criteria);
if ($count >= $infoLicense[SYS_SYS]['LIMIT_USERS'] ) {
if ($count >= $infoLicense[config("system.workspace")]['LIMIT_USERS'] ) {
throw new Exception("You can\'t add more users to the System, this reach the limit of allowed users by license that it has installed now");
}
}

View File

@@ -650,7 +650,7 @@ class IndicatorsCalculator
}
private function pdoConnection() {
$currentWS = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
$currentWS = !empty(config("system.workspace")) ? config("system.workspace") : 'Wokspace Undefined';
$workSpace = new WorkspaceTools($currentWS);
$arrayHost = explode(':', $workSpace->dbHost);
$host = "host=".$arrayHost[0];

File diff suppressed because it is too large Load Diff

View File

@@ -337,7 +337,7 @@ class PMLicensedFeatures
/*----------------------------------********---------------------------------*/
public function verifyfeature ($featureName)
{
$cached = Cache::get(PmLicenseManager::CACHE_KEY . '.' . SYS_SYS, []);
$cached = Cache::get(PmLicenseManager::CACHE_KEY . '.' . config("system.workspace"), []);
if (isset($cached[$featureName])) {
return $cached[$featureName];
}
@@ -360,7 +360,7 @@ class PMLicensedFeatures
$this->featuresDetails[$value[0]]->enabled = $enable;
$cached[$featureName] = $enable;
Cache::put(PmLicenseManager::CACHE_KEY . '.' . SYS_SYS, $cached, Carbon::now()->addDay(1));
Cache::put(PmLicenseManager::CACHE_KEY . '.' . config("system.workspace"), $cached, Carbon::now()->addDay(1));
return $enable;
}

View File

@@ -1102,8 +1102,9 @@ class PMPluginRegistry
{
try {
$iPlugins = 0;
$oServerConf = &ServerConf::getSingleton();
$oServerConf->addPlugin(SYS_SYS, $this->_aPluginDetails);
$oServerConf = & ServerConf::getSingleton();
$oServerConf->addPlugin( config("system.workspace"), $this->_aPluginDetails );
foreach ($this->_aPluginDetails as $namespace => $detail) {
if (isset($detail->enabled) && $detail->enabled) {
if (!empty($detail->sFilename) && file_exists($detail->sFilename)) {

View File

@@ -31,7 +31,7 @@ class PmDrive extends PmGoogleApi
$this->folderIdPMDrive = empty($dataUser['USR_PMDRIVE_FOLDER_UID']) ? '' : $dataUser['USR_PMDRIVE_FOLDER_UID'];
$conf = $this->getConfigGmail();
$this->folderNamePMDrive = empty($conf->aConfig['folderNamePMDrive']) ? 'PMDrive (' . SYS_SYS . ')' : $conf->aConfig['folderNamePMDrive'];
$this->folderNamePMDrive = empty($conf->aConfig['folderNamePMDrive']) ? 'PMDrive (' . config("system.workspace") . ')' : $conf->aConfig['folderNamePMDrive'];
if ($this->folderIdPMDrive == '') {
$folderid = $this->createFolder($this->folderNamePMDrive);

View File

@@ -2,6 +2,7 @@
use ProcessMaker\Core\System;
use ProcessMaker\BusinessModel\DynaForm\SuggestTrait;
use ProcessMaker\BusinessModel\Cases;
/**
* Implementing pmDynaform library in the running case.
@@ -34,7 +35,7 @@ class PmDynaform
public function __construct($fields = array())
{
$this->sysSys = (defined("SYS_SYS")) ? SYS_SYS : "Undefined";
$this->sysSys = (!empty(config("system.workspace"))) ? config("system.workspace") : "Undefined";
$this->context = \Bootstrap::getDefaultContextLog();
$this->dataSources = array("database", "dataVariable");
$this->pathRTLCss = '/lib/pmdynaform/build/css/PMDynaform-rtl.css';
@@ -250,11 +251,6 @@ class PmDynaform
$dtFields = $json->queryInputData;
} else {
$dtFields = $this->getValuesDependentFields($json);
foreach ($dtFields as $keyF => $valueF) {
if (isset($this->fields["APP_DATA"][$keyF])) {
$dtFields[$keyF] = $this->fields["APP_DATA"][$keyF];
}
}
}
$sql = G::replaceDataField($json->sql, $dtFields);
if ($value === "suggest") {
@@ -610,7 +606,8 @@ class PmDynaform
$json->dataGridEnvironment = "onDataGridEnvironment";
if (isset($this->fields["APP_DATA"])) {
$dataGridEnvironment = $this->fields["APP_DATA"];
$this->fields["APP_DATA"] = [];
//Grids only access the global variables of 'ProcessMaker', other variables are removed.
$this->fields["APP_DATA"] = Cases::getGlobalVariables($this->fields["APP_DATA"]);
//restore AppData with dataVariable definition, only for columns control
foreach ($columnsDataVariable as $dge) {
if (isset($dataGridEnvironment[$dge])) {
@@ -691,7 +688,14 @@ class PmDynaform
if (!isset($this->record["DYN_CONTENT"])) {
return array();
}
$data = array();
$data = [];
if (isset($this->fields["APP_DATA"])) {
foreach ($this->fields["APP_DATA"] as $keyF => $valueF) {
if (!isset($data[$keyF]) && !is_array($valueF)) {
$data[$keyF] = $valueF;
}
}
}
if (isset($json->dbConnection) && isset($json->sql)) {
$result = array();
preg_match_all('/\@(?:([\@\%\#\=\!Qq])([a-zA-Z\_]\w*)|([a-zA-Z\_][\w\-\>\:]*)\(((?:[^\\\\\)]*?)*)\))/', $json->sql, $result, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE);
@@ -708,18 +712,12 @@ class PmDynaform
}
}
if ($json->dbConnection !== "" && $json->dbConnection !== "none" && $json->sql !== "") {
if (isset($this->fields["APP_DATA"])) {
foreach ($this->fields["APP_DATA"] as $keyA => $valueA) {
if (!isset($data[$keyA]) && !is_array($valueA)) {
$data[$keyA] = $valueA;
}
}
}
$sql = G::replaceDataField($json->sql, $data);
$dt = $this->getCacheQueryData($json->dbConnection, $sql, $json->type);
$row = isset($dt[0]) ? $dt[0] : [];
if (isset($row[0]) && $json->type !== "suggest" && $json->type !== "radio") {
$data[$json->variable === "" ? $json->id : $json->variable] = $row[0];
$index = $json->variable === "" ? $json->id : $json->variable;
if (!isset($data[$index]) && isset($row[0]) && $json->type !== "suggest" && $json->type !== "radio") {
$data[$index] = $row[0];
}
}
}
@@ -1009,7 +1007,7 @@ class PmDynaform
var app_uid = \"" . $this->fields["APP_UID"] . "\";
var prj_uid = \"" . $this->fields["PRO_UID"] . "\";
var step_mode = \"\";
var workspace = \"" . SYS_SYS . "\";
var workspace = \"" . config("system.workspace") . "\";
var credentials = " . G::json_encode($this->credentials) . ";
var filePost = \"\";
var fieldsRequired = null;
@@ -1070,7 +1068,7 @@ class PmDynaform
"var app_uid = '" . $this->fields["APP_UID"] . "';\n" .
"var prj_uid = '" . $this->fields["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = null;\n" .
"var fieldsRequired = null;\n" .
@@ -1149,7 +1147,7 @@ class PmDynaform
"var app_uid = '" . $this->fields["APP_UID"] . "';\n" .
"var prj_uid = '" . $this->fields["PRO_UID"] . "';\n" .
"var step_mode = '" . $this->fields["STEP_MODE"] . "';\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = null;\n" .
"var fieldsRequired = null;\n" .
@@ -1206,7 +1204,7 @@ class PmDynaform
var app_uid = \"" . $this->fields["APP_UID"] . "\";
var prj_uid = \"" . $this->fields["PRO_UID"] . "\";
var step_mode = null;
var workspace = \"" . SYS_SYS . "\";
var workspace = \"" . config("system.workspace") . "\";
var credentials = " . G::json_encode($this->credentials) . ";
var filePost = \"cases_SaveDataSupervisor?UID=" . $this->fields["CURRENT_DYNAFORM"] . "\";
var fieldsRequired = null;
@@ -1250,7 +1248,7 @@ class PmDynaform
"var app_uid = null;\n" .
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = '" . $filename . "';\n" .
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
@@ -1292,7 +1290,7 @@ class PmDynaform
"var app_uid = '" . G::decrypt($record['APP_UID'], URL_KEY) . "';\n" .
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var filePost = '" . $filename . "';\n" .
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
@@ -1356,7 +1354,7 @@ class PmDynaform
"var app_uid = null;\n" .
"var prj_uid = '" . $this->record["PRO_UID"] . "';\n" .
"var step_mode = null;\n" .
"var workspace = '" . SYS_SYS . "';\n" .
"var workspace = '" . config("system.workspace") . "';\n" .
"var credentials = " . G::json_encode($this->credentials) . ";\n" .
"var fieldsRequired = " . G::json_encode(array()) . ";\n" .
"var triggerDebug = null;\n" .
@@ -2102,7 +2100,7 @@ class PmDynaform
400,
'JSON encoded string error ' . $jsonLastError . ': ' . $jsonLastErrorMsg,
['token' => $token, 'projectUid' => $this->record['PRO_UID'], 'dynaFormUid' => $this->record['DYN_UID']],
SYS_SYS,
config("system.workspace"),
'processmaker.log'
);
}

View File

@@ -26,11 +26,11 @@ class PmLicenseManager
$activeLicenseSetting = $oServerConf->getProperty('ACTIVE_LICENSE');
if ((isset($activeLicenseSetting[SYS_SYS])) && (file_exists($activeLicenseSetting[SYS_SYS]))) {
$licenseFile = $activeLicenseSetting[SYS_SYS];
if ((isset($activeLicenseSetting[config("system.workspace")])) && (file_exists($activeLicenseSetting[config("system.workspace")]))) {
$licenseFile = $activeLicenseSetting[config("system.workspace")];
} else {
$activeLicense = $this->getActiveLicense();
$oServerConf->setProperty('ACTIVE_LICENSE', [SYS_SYS => $activeLicense['LICENSE_PATH']]);
$oServerConf->setProperty('ACTIVE_LICENSE', [config("system.workspace") => $activeLicense['LICENSE_PATH']]);
$licenseFile = $activeLicense['LICENSE_PATH'];
}
@@ -77,7 +77,7 @@ class PmLicenseManager
$this->supportEndDate = date("Y-m-d H:i:s", strtotime($this->supportEndDate));
$conf = new Configurations();
if (defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
if (!empty(config("system.workspace")) && $conf->exists("ENVIRONMENT_SETTINGS")) {
$this->supportStartDate = $conf->getSystemDate($this->supportStartDate);
$this->supportEndDate = $conf->getSystemDate($this->supportEndDate);
} else {
@@ -103,14 +103,14 @@ class PmLicenseManager
$licInfoA = $oServerConf->getProperty('LICENSE_INFO');
// The HUMAN attribute varies according to the timezone configured in the server, therefore it does not need
// to be considered in the comparison if the value was changed or not, it is only comparing with te "timestamp"
if (isset($licInfoA[SYS_SYS]['date']['HUMAN'])) {
unset($licInfoA[SYS_SYS]['date']['HUMAN']);
if (isset($licInfoA[config("system.workspace")]['date']['HUMAN'])) {
unset($licInfoA[config("system.workspace")]['date']['HUMAN']);
}
} else {
$licInfoA = [];
}
if (empty($licInfoA[SYS_SYS]) || ($licInfoA[SYS_SYS] != $resultsRegister)) {
$licInfoA[SYS_SYS] = $resultsRegister;
if (empty($licInfoA[config("system.workspace")]) || ($licInfoA[config("system.workspace")] != $resultsRegister)) {
$licInfoA[config("system.workspace")] = $resultsRegister;
$oServerConf->setProperty('LICENSE_INFO', $licInfoA);
}
}
@@ -337,11 +337,11 @@ class PmLicenseManager
}
if (class_exists('pmTrialPlugin')) {
$linkText = $linkText . "<a href='/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/pmTrial/services/buyNow?n=true" . "'> <img align='absmiddle' src='/plugin/pmLicenseManager/btn_buy_now.gif' border='0' /></a>";
$linkText = $linkText . "<a href='/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/pmTrial/services/buyNow?n=true" . "'> <img align='absmiddle' src='/plugin/pmLicenseManager/btn_buy_now.gif' border='0' /></a>";
}
if (isset($_SESSION["__ENTERPRISE_SYSTEM_UPDATE__"]) && $_SESSION["__ENTERPRISE_SYSTEM_UPDATE__"] == 1) {
$aOnclick = "onclick=\"this.href='" . EnterpriseUtils::getUrlServerName() . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PMENTERPRISE';\"";
$aOnclick = "onclick=\"this.href='" . EnterpriseUtils::getUrlServerName() . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PMENTERPRISE';\"";
if (EnterpriseUtils::skinIsUx() == 1) {
$aOnclick = "onclick=\"Ext.ComponentMgr.get('mainTabPanel').setActiveTab('pm-option-setup'); Ext.ComponentMgr.get('pm-option-setup').setLocation(Ext.ComponentMgr.get('pm-option-setup').defaultSrc + 's=PMENTERPRISE', true); return (false);\"";
}
@@ -385,7 +385,7 @@ class PmLicenseManager
} else {
$oServerConf = &ServerConf::getSingleton();
$oServerConf->setProperty('ACTIVE_LICENSE', [SYS_SYS => $path]);
$oServerConf->setProperty('ACTIVE_LICENSE', [config("system.workspace") => $path]);
$this->saveDataLicense($results, $path, $redirect);
if ($redirect) {
G::Header('location: ../enterprise/addonsStore');
@@ -482,7 +482,7 @@ class PmLicenseManager
$tr->setLicenseType($LicenseType);
$res = $tr->save();
Cache::forget(PmLicenseManager::CACHE_KEY . '.' . SYS_SYS);
Cache::forget(PmLicenseManager::CACHE_KEY . '.' . config("system.workspace"));
} catch (Exception $e) {
G::pr($e);
}

View File

@@ -212,7 +212,7 @@ class PmTable
}
$this->schemaFilename = 'schema.xml';
$this->baseDir = PATH_DB . SYS_SYS . PATH_SEP;
$this->baseDir = PATH_DB . config("system.workspace") . PATH_SEP;
$this->targetDir = $this->baseDir . 'pmt-propel' . PATH_SEP . $this->dataSource . PATH_SEP;
$this->configDir = $this->targetDir . 'config' . PATH_SEP;
$this->dataDir = $this->targetDir . 'data' . PATH_SEP;

View File

@@ -2755,7 +2755,7 @@ class ProcessMap
$http = 'http://';
}
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$row = array();
$c = 0;
@@ -2767,8 +2767,8 @@ class ProcessMap
$TaskFields['TAS_ASSIGN_TYPE'] = '';
$row[] = array('W_TITLE' => '', 'W_DELETE' => '', 'TAS_ASSIGN_TYPE' => $TaskFields['TAS_ASSIGN_TYPE'] );
if (is_dir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
if (is_dir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
while ($archivo = readdir($dir)) {
//print $archivo." **** <hr>";
if ($archivo != '.') {
@@ -3115,7 +3115,7 @@ class ProcessMap
public function listNoProcessesUser($sProcessUID)
{
$memcache = & PMmemcached::getSingleton(SYS_SYS);
$memcache = & PMmemcached::getSingleton(config("system.workspace"));
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);
@@ -4777,7 +4777,7 @@ class ProcessMap
$http = 'http://';
}
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$row = array();
$c = 0;
@@ -4790,8 +4790,8 @@ class ProcessMap
//$row [] = array ('W_TITLE' => '', 'W_DELETE' => '', 'TAS_ASSIGN_TYPE' => $TaskFields ['TAS_ASSIGN_TYPE'] );
if (is_dir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
if (is_dir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
$dynTitle = str_replace(' ', '_', str_replace('/', '_', $dynTitle));
$arlink = $link . $dynTitle . '.php';
//$arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>";
@@ -5812,7 +5812,7 @@ class ProcessMap
public function listExtNoProcessesUser($sProcessUID)
{
$memcache = & PMmemcached::getSingleton(SYS_SYS);
$memcache = & PMmemcached::getSingleton(config("system.workspace"));
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(ProcessUserPeer::USR_UID);

View File

@@ -4131,7 +4131,7 @@ class Processes
try {
$result = $scriptTask->create($processUid, $record);
} catch (Exception $e) {
Bootstrap::registerMonolog('DataError', 400, $e->getMessage(), $record, SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('DataError', 400, $e->getMessage(), $record, config("system.workspace"), 'processmaker.log');
}
}
} catch (Exception $e) {
@@ -4499,7 +4499,7 @@ class Processes
$proTitle = (substr(G::inflect($data->process['PRO_TITLE']), 0, 245));
$proTitle = preg_replace("/[^A-Za-z0-9_]/", "", $proTitle);
//Calculating the maximum length of file name
$pathLength = strlen(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP);
$pathLength = strlen(PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP);
$length = strlen($proTitle) + $pathLength;
$limit = 200;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
@@ -4578,7 +4578,7 @@ class Processes
// for mailtemplates files
$MAILS_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'mailTemplates' . PATH_SEP . $data->process['PRO_UID'];
$MAILS_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'mailTemplates' . PATH_SEP . $data->process['PRO_UID'];
$isMailTempSent = false;
$isPublicSent = false;
@@ -4615,7 +4615,7 @@ class Processes
}
// for public files
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP . $data->process['PRO_UID'];
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP . $data->process['PRO_UID'];
//Get WebEntry file names
$arrayWebEntryFile = array();
@@ -4671,7 +4671,7 @@ class Processes
/*
// for public files
$PUBLIC_ROOT_PATH = PATH_DATA.'sites'.PATH_SEP.SYS_SYS.PATH_SEP.'public'.PATH_SEP.$data->process['PRO_UID'];
$PUBLIC_ROOT_PATH = PATH_DATA.'sites'.PATH_SEP.config("system.workspace").PATH_SEP.'public'.PATH_SEP.$data->process['PRO_UID'];
//if this process have any mailfile
if ( is_dir( $PUBLIC_ROOT_PATH ) ) {
//get mail files list from this directory
@@ -5067,7 +5067,7 @@ class Processes
$context['url'] = SYS_CURRENT_URI . '?' . SYS_CURRENT_PARMS;
}
$context['usrUid'] = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : '';
$sysSys = defined("SYS_SYS") ? SYS_SYS : "Undefined";
$sysSys = !empty(config("system.workspace")) ? config("system.workspace") : "Undefined";
$message = 'The imported template has a number of byes different than the original template, please verify if the file \'' . $newFileName . '\' is correct.';
$level = 400;
Bootstrap::registerMonolog($channel, $level, $message, $context, $sysSys, 'processmaker.log');
@@ -6079,7 +6079,7 @@ class Processes
}
//Set variables
$cs = new CodeScanner((!is_null($workspaceName))? $workspaceName : SYS_SYS);
$cs = new CodeScanner((!is_null($workspaceName))? $workspaceName : config("system.workspace"));
$delimiter = DBAdapter::getStringDelimiter();

View File

@@ -599,6 +599,16 @@ class ReportTables
}
$sQuery = substr($sQuery, 0, -1);
$sQuery .= " WHERE APP_UID = '" . $sApplicationUid . "'";
//Only we will to executeQuery if we have additional field
if (count($aTableFields) > 0) {
try {
$rs = $stmt->executeQuery($sQuery);
} catch (Exception $e) {
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
}
}
} else {
$sQuery = 'INSERT INTO `' . $aRow['REP_TAB_NAME'] . '` (';
$sQuery .= '`APP_UID`,`APP_NUMBER`';
@@ -630,8 +640,13 @@ class ReportTables
}
}
$sQuery .= ')';
try {
$rs = $stmt->executeQuery($sQuery);
} catch (Exception $e) {
Bootstrap::registerMonolog('sqlExecution', 400, 'Sql Execution', ['sql' => $sQuery,'error' => $e->getMessage()], config("system.workspace"), 'processmaker.log');
}
}
$rs = $stmt->executeQuery($sQuery);
} else {
//remove old rows from database
$sqlDelete = 'DELETE FROM `' . $aRow['REP_TAB_NAME'] . "` WHERE APP_UID = '" . $sApplicationUid . "'";

View File

@@ -152,12 +152,12 @@ class ServerConf
public function sucessfulLogin()
{
$this->logins++;
if (isset($this->workspaces[SYS_SYS]) && isset($this->workspaces[SYS_SYS]['WSP_LOGINS'])) {
$this->workspaces[SYS_SYS]['WSP_LOGINS']++;
if (isset($this->workspaces[config("system.workspace")]) && isset($this->workspaces[config("system.workspace")]['WSP_LOGINS'])) {
$this->workspaces[config("system.workspace")]['WSP_LOGINS']++;
}
if (isset($this->workspaces[SYS_SYS]) && !isset($this->workspaces[SYS_SYS]['WSP_LOGINS'])) {
$this->workspaces[SYS_SYS]['WSP_LOGINS'] = 1;
if (isset($this->workspaces[config("system.workspace")]) && !isset($this->workspaces[config("system.workspace")]['WSP_LOGINS'])) {
$this->workspaces[config("system.workspace")]['WSP_LOGINS'] = 1;
}
$this->saveSingleton();

View File

@@ -100,7 +100,7 @@ class Upgrade
try {
$num += 1;
printf("Upgrading workspaces ($num/$count): {$workspace->name}\n");
$workspace->upgrade(false, SYS_SYS, false, 'en', ['updateXml' => $first, 'updateMafe' => $first]);
$workspace->upgrade(false, config("system.workspace"), false, 'en', ['updateXml' => $first, 'updateMafe' => $first]);
$workspace->close();
$first = false;
} catch (Exception $e) {

View File

@@ -99,8 +99,11 @@ class WorkspaceTools
*
* @return void
*/
public function upgrade($buildCacheView = false, $workSpace = SYS_SYS, $onedb = false, $lang = 'en', array $arrayOptTranslation = null)
public function upgrade($buildCacheView = false, $workSpace = null, $onedb = false, $lang = 'en', array $arrayOptTranslation = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
if (is_null($arrayOptTranslation)) {
$arrayOptTranslation = ['updateXml' => true, 'updateMafe' => true];
}
@@ -220,8 +223,11 @@ class WorkspaceTools
* Updating cases directories structure
*
*/
public function updateStructureDirectories($workSpace = SYS_SYS)
public function updateStructureDirectories($workSpace = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
$start = microtime(true);
CLI::logging("> Updating cases directories structure...\n");
$this->upgradeCasesDirectoryStructure($workSpace);
@@ -470,8 +476,11 @@ class WorkspaceTools
/**
* Upgrade this workspace Content.
*/
public function upgradeContent($workSpace = SYS_SYS)
public function upgradeContent($workSpace = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
$this->initPropel(true);
//require_once 'classes/model/Translation.php';
$translation = new Translation();
@@ -1739,12 +1748,13 @@ class WorkspaceTools
$aParameters = array('dbHost' => $dbHost, 'dbUser' => $dbUser, 'dbPass' => $dbPass);
//Restore
if (!defined("SYS_SYS")) {
if (empty(config("system.workspace"))) {
define("SYS_SYS", $workspaceName);
config(["system.workspace" => $workspaceName]);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP);
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP);
}
$pmVersionWorkspaceToRestore = (preg_match("/^([\d\.]+).*$/", $metadata->PM_VERSION, $arrayMatch)) ? $arrayMatch[1] : "";
@@ -3937,8 +3947,11 @@ class WorkspaceTools
* Updating framework directory structure
*
*/
private function updateFrameworkPaths($workSpace = SYS_SYS)
private function updateFrameworkPaths($workSpace = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
$paths = [
PATH_DATA.'framework' => 0770,
PATH_DATA.'framework' . DIRECTORY_SEPARATOR . 'cache' => 0770,

View File

@@ -2037,15 +2037,23 @@ class WsBase
* This function is used when the case is derived from abe, Soap, PMFDerivateCase
*
* @param string $caseId, Uid related to the case
* @param array $appData, contain all the information about the case
* @param array $appData, contain all the information about the case related to the index [APP_DATA]
* @param string $tasUid, Uid related to the task
* @param string $stepType, before or after step
* @param string $stepUidObj, can be -1, -2
* @param string $triggerType, can be BEFORE, AFTER
* @param string $labelAssigment, label related to the triggerType
* @param string $labelAssignment, label related to the triggerType
*
* @return string $varTriggers updated
*/
public function executeTriggerFromDerivate(
$caseId, $appData, $tasUid, $stepType, $stepUidObj, $triggerType, $labelAssigment = ''
$caseId,
$appData,
$tasUid,
$stepType,
$stepUidObj,
$triggerType,
$labelAssignment = ''
) {
$varTriggers = "";
$oCase = new Cases();
@@ -2054,7 +2062,7 @@ class WsBase
$aTriggers = $oCase->loadTriggers($tasUid, $stepType, $stepUidObj, $triggerType);
if (count($aTriggers) > 0) {
$varTriggers = $varTriggers . "<br /><b>" . $labelAssigment . "</b><br />";
$varTriggers = $varTriggers . "<br /><b>" . $labelAssignment . "</b><br />";
$oPMScript = new PMScript();
@@ -2068,6 +2076,7 @@ class WsBase
$params->SID = $this->wsSessionId;
}
//We can set the index APP_DATA
$appFields["APP_DATA"] = array_merge($appData, G::getSystemConstants($params));
//PMScript
@@ -2093,6 +2102,9 @@ class WsBase
unset($appFields['APP_PROC_CODE']);
unset($appFields['APP_PIN']);
$oCase->updateCase($caseId, $appFields);
//We need to update the variable $appData for use the new variables in the next trigger
$appData = array_merge($appData, $appFields['APP_DATA']);
}
}
}
@@ -2792,7 +2804,7 @@ class WsBase
public function getCaseNotes($applicationID, $userUid = '')
{
try {
$result = new wsGetCaseNotesResponse(0, G::loadTranslation('ID_SUCCESS'), Cases::getCaseNotes($applicationID, 'array', $userUid));
$result = new WsGetCaseNotesResponse(0, G::loadTranslation('ID_SUCCESS'), Cases::getCaseNotes($applicationID, 'array', $userUid));
$var = [];

View File

@@ -239,7 +239,7 @@ function literalDate ($date, $lang = 'en')
*/
function executeQuery ($SqlStatement, $DBConnectionUID = 'workflow', $aParameter = array())
{
$sysSys = (defined("SYS_SYS"))? SYS_SYS : "Undefined";
$sysSys = (!empty(config("system.workspace")))? config("system.workspace") : "Undefined";
$aContext = \Bootstrap::getDefaultContextLog();
$con = Propel::getConnection( $DBConnectionUID );
$con->begin();
@@ -537,7 +537,7 @@ function WSOpen ($force = false)
);
if (! isset( $_SESSION["WS_END_POINT"] )) {
$defaultEndpoint = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "/sys" . SYS_SYS . "/en/classic/services/wsdl2";
$defaultEndpoint = $_SERVER["REQUEST_SCHEME"] . "://" . $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . "/sys" . config("system.workspace") . "/en/classic/services/wsdl2";
}
$endpoint = isset( $_SESSION["WS_END_POINT"] ) ? $_SESSION["WS_END_POINT"] : $defaultEndpoint;
@@ -2098,7 +2098,7 @@ function PMFDerivateCase ($caseId, $delIndex, $bExecuteTriggersBeforeAssignment
* @param string(32) | $processId | Process ID | The unique ID of the process.
* @param string(32) | $userId | User ID | The unique ID of the user.
* @param array | $variables | Array of variables | An associative array of the variables which will be sent to the case.
* @param string(32) | $taskId | The unique ID of the task taha is in the starting group.
* @param string(32) | $taskId | The unique ID of the task that is in the starting group.
* @return int | $result | Result | Returns 1 if new case was created successfully; otherwise, returns 0 if an error occurred.
*
*/
@@ -3455,7 +3455,7 @@ function PMFCaseLink($caseUid, $workspace = null, $language = null, $skin = null
if ($arrayApplicationData === false) {
return false;
}
$workspace = (!empty($workspace)) ? $workspace : SYS_SYS;
$workspace = (!empty($workspace)) ? $workspace : config("system.workspace");
$language = (!empty($language)) ? $language : SYS_LANG;
$skin = (!empty($skin)) ? $skin : SYS_SKIN;

View File

@@ -45,16 +45,16 @@ use ProcessMaker\Plugins\PluginRegistry;
*/
function __autoload ($sClassName)
{
if (defined( 'SYS_SYS' )) {
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
if (!empty(config("system.workspace"))) {
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (file_exists( $sPath . $sClassName . '.php' )) {
require_once $sPath . $sClassName . '.php';
}
}
}
if (defined('SYS_SYS') && (!defined('PATH_DATA_SITE') || !defined('PATH_WORKSPACE'))) {
Bootstrap::setConstantsRelatedWs(SYS_SYS);
if (!empty(config("system.workspace")) && (!defined('PATH_DATA_SITE') || !defined('PATH_WORKSPACE'))) {
Bootstrap::setConstantsRelatedWs(config("system.workspace"));
}
//Add External Triggers

View File

@@ -39,7 +39,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
public function ServeRequest($base = false)
{
//$this->base = '/';
$this->uriBase = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/webdav/';
$this->uriBase = '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/webdav/';
// let the base class do all the work
parent::ServeRequest();
@@ -72,7 +72,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
// prepare property array
$files["files"] = array();
$pathClasses = PATH_DB . PATH_SEP . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$pathClasses = PATH_DB . PATH_SEP . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (count($paths) == 0 && is_dir($pathClasses)) {
$props = array();
$props[] = $this->mkprop("displayname", 'Classes');
@@ -110,7 +110,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
} //path classes
$pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
$pathProcesses = PATH_DB . config("system.workspace") . PATH_SEP;
if (count($paths) == 0 && is_dir($pathProcesses)) {
$props = array();
$props[] = $this->mkprop("displayname", 'Processes');
@@ -404,7 +404,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
$options = $filter->xssFilterHard($options);
$paths = $filter->xssFilterHard($this->paths);
$pathClasses = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$pathClasses = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (count($paths) > 0 && $paths[0] == 'classes' && is_dir($pathClasses)) {
$fsFile = $pathClasses . $paths[1];
$fsFile = $filter->xssFilterHard($fsFile);
@@ -419,7 +419,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
}
}
$pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
$pathProcesses = PATH_DB . config("system.workspace") . PATH_SEP;
if (count($paths) > 0 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
if (count($paths) == 4 && $paths[2] == 'xmlforms') {
$pathXmlform = $pathProcesses . 'xmlForms' . PATH_SEP . $paths[1] . PATH_SEP;
@@ -636,7 +636,7 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
}
}
$pathProcesses = PATH_DB . SYS_SYS . PATH_SEP;
$pathProcesses = PATH_DB . config("system.workspace") . PATH_SEP;
if (count($paths) > 0 && $paths[0] == 'processes' && is_dir($pathProcesses)) {
if ($paths[2] == 'xmlforms') {
$pathTemplates = $pathProcesses . 'xmlForms' . PATH_SEP . $paths[1] . PATH_SEP;

View File

@@ -332,7 +332,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -383,7 +383,7 @@ class AdditionalTables extends BaseAdditionalTables
$_SESSION["PROCESS"] = $aData['PRO_UID'];
}
$aData['DBS_UID'] = $aData['DBS_UID'] ? $aData['DBS_UID'] : 'workflow';
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -531,7 +531,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -550,7 +550,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -604,7 +604,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -632,7 +632,7 @@ class AdditionalTables extends BaseAdditionalTables
try {
//$sPMUID = $aFields['PM_UNIQUE_ID'];
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -679,7 +679,7 @@ class AdditionalTables extends BaseAdditionalTables
{
try {
$aData = $this->load($sUID, true);
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
$sClassName = ($aData['ADD_TAB_CLASS_NAME'] != ''
? $aData['ADD_TAB_CLASS_NAME']
: $this->getPHPName($aData['ADD_TAB_NAME']));
@@ -1159,7 +1159,7 @@ class AdditionalTables extends BaseAdditionalTables
$sClassName = $this->getPHPName($sTableName);
}
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (!file_exists($sPath)) {
G::mk_dir($sPath);
}

View File

@@ -367,7 +367,7 @@ class AddonsStore extends BaseAddonsStore
$sStatus = $oDetails->isEnabled() ? G::LoadTranslation('ID_ENABLED') : G::LoadTranslation('ID_DISABLED');
if ($oDetails->getWorkspaces()) {
if (!in_array(SYS_SYS, $oDetails->getWorkspaces())) {
if (!in_array(config("system.workspace"), $oDetails->getWorkspaces())) {
continue;
}
}

View File

@@ -788,18 +788,26 @@ class AppDelegation extends BaseAppDelegation
return $data['TAS_UID'];
}
/**
* This function get the current user related to the specific case and index
* @param string $appUid, Uid related to the case
* @param integer $index, Index to review
* @return array
*/
public function getCurrentUsers($appUid, $index)
{
$oCriteria = new Criteria();
$oCriteria->addSelectColumn( AppDelegationPeer::USR_UID );
$oCriteria->add( AppDelegationPeer::APP_UID, $appUid );
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $index );
$oRuleSet = AppDelegationPeer::doSelectRS( $oCriteria );
$oRuleSet->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oRuleSet->next();
$data = $oRuleSet->getRow();
return $data;
$criteria = new Criteria();
$criteria->addSelectColumn( AppDelegationPeer::USR_UID );
$criteria->add( AppDelegationPeer::APP_UID, $appUid );
$criteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'OPEN' );
$criteria->add( AppDelegationPeer::DEL_INDEX, $index );
$dataResult = AppDelegationPeer::doSelectRS( $criteria );
$dataResult->setFetchmode( ResultSet::FETCHMODE_ASSOC );
if($dataResult->next()) {
return $dataResult->getRow();
} else {
return [];
}
}
/**

View File

@@ -83,7 +83,7 @@ class AppNotes extends BaseAppNotes
$oDataset->next();
while ($aRow = $oDataset->getRow()) {
$aRow['NOTE_CONTENT'] = htmlentities(stripslashes($aRow['NOTE_CONTENT']), ENT_QUOTES, 'UTF-8');
$aRow['NOTE_CONTENT'] = stripslashes($aRow['NOTE_CONTENT']);
$response['notes'][] = $aRow;
$oDataset->next();
}
@@ -240,5 +240,21 @@ class AppNotes extends BaseAppNotes
return $response;
}
/**
* Add htmlEntities to notes in node_content
* @param $notes
* @return array
*/
public static function applyHtmlentitiesInNotes($notes)
{
if (isset($notes) && isset($notes["array"])) {
foreach ($notes["array"]["notes"] as &$note) {
$note["NOTE_CONTENT"] = htmlentities($note["NOTE_CONTENT"], ENT_QUOTES, 'UTF-8');
}
}
return $notes;
}
}

View File

@@ -332,7 +332,7 @@ class CaseScheduler extends BaseCaseScheduler
}
}
$url = SERVER_NAME . $port . "/sys" . SYS_SYS . "/" . SYS_LANG . "/classic/services/wsdl2";
$url = SERVER_NAME . $port . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/classic/services/wsdl2";
$testConnection = true;
try {

View File

@@ -312,8 +312,11 @@ class Content extends BaseContent
*
* @param array $langs
*/
public function regenerateContent ($langs, $workSpace = SYS_SYS)
public function regenerateContent ($langs, $workSpace = null)
{
if ($workSpace === null) {
$workSpace = config("system.workspace");
}
//Search the language
$key = array_search( 'en', $langs );
if ($key === false) {

View File

@@ -121,34 +121,31 @@ class Language extends BaseLanguage
}
}
/*
/**
* Import a language file
*
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail>
* @param string $sLanguageFile
* @param string $bXml
* @return void
* @param string $languageFile
* @param bool $updateXml
* @param bool $updateDB
* @param bool $generateMafe
* @return Object
* @throws Exception
*/
public function import ($sLanguageFile, $updateXml = true, $updateDB = true, $generateMafe = true)
public function import($languageFile, $updateXml = true, $updateDB = true, $generateMafe = true)
{
try {
//get labels MichelangeloFE
$translation = new Translation();
try {
$oTranslation = new Translation();
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
if (file_exists($MichelangeloFE)) {
$labels = self::readLabelsDirectory($MichelangeloFE, true);
foreach ($labels as $label) {
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
}
//We get all MichelangeloFE and PMDynaform translatable labels.
$labels = array_merge(self::getLabelsMafe(), self::getLabelsPMDynaform());
foreach ($labels as $label) {
$translation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
}
} catch (Exception $e) {
error_log($e->getMessage());
}
$POFile = new i18n_PO( $sLanguageFile );
$POFile = new i18n_PO($languageFile);
$POFile->readInit();
$POHeaders = $POFile->getHeaders();
@@ -156,13 +153,13 @@ class Language extends BaseLanguage
$langName = $POHeaders['X-Poedit-Language'];
//find the lang id
$language = new Language();
$langRecord = $language->findByLanName( $langName );
$langRecord = $language->findByLanName($langName);
if (! isset( $langRecord['LAN_ID'] )) {
$langRecord = $language->findById( $langName );
if (! isset( $langRecord['LAN_ID'] )) {
if (!isset($langRecord['LAN_ID'])) {
$langRecord = $language->findById($langName);
if (!isset($langRecord['LAN_ID'])) {
//if the language doesn't exist abort
throw new Exception( 'The .po file has a invalid X-Poedit-Language definition!' );
throw new Exception('The .po file has a invalid X-Poedit-Language definition!');
}
}
@@ -172,11 +169,11 @@ class Language extends BaseLanguage
$countryName = $POHeaders['X-Poedit-Country'];
if ($countryName != '.') {
$isoCountry = new IsoCountry();
$countryRecord = $isoCountry->findByIcName( $countryName );
$countryRecord = $isoCountry->findByIcName($countryName);
if (! isset( $countryRecord['IC_UID'] )) {
if (!isset($countryRecord['IC_UID'])) {
//if the language doesn't exist abort
throw new Exception( 'The .po file has a invalid X-Poedit-Country definition!' );
throw new Exception('The .po file has a invalid X-Poedit-Country definition!');
}
$countryID = $countryRecord['IC_UID'];
@@ -186,23 +183,22 @@ class Language extends BaseLanguage
$LOCALE = $languageID;
}
$oTranslation = new Translation();
$countItems = 0;
$countItemsSuccess = 0;
$errorMsg = '';
while ($rowTranslation = $POFile->getTranslation()) {
$countItems ++;
if (! isset( $POFile->translatorComments[0] ) || ! isset( $POFile->translatorComments[1] ) || ! isset( $POFile->references[0] )) {
throw new Exception( 'The .po file doesn\'t have valid directives for Processmaker!' );
$countItems++;
if (!isset($POFile->translatorComments[0]) || !isset($POFile->translatorComments[1]) || !isset($POFile->references[0])) {
throw new Exception('The .po file doesn\'t have valid directives for Processmaker!');
}
foreach ($POFile->translatorComments as $a => $aux) {
$aux = trim( $aux );
$aux = trim($aux);
if ($aux == 'TRANSLATION') {
$identifier = $aux;
} else {
$var = explode( '/', $aux );
$var = explode('/', $aux);
if ($var[0] == 'LABEL') {
$context = $aux;
}
@@ -210,10 +206,10 @@ class Language extends BaseLanguage
$context = $aux;
}
}
if (preg_match( '/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml\?)/', $aux, $match )) {
if (preg_match('/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml\?)/', $aux, $match)) {
$identifier = $aux;
} else {
if (preg_match( '/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml$)/', $aux, $match )) {
if (preg_match('/^([\w-]+)\/([\w-]+\/*[\w-]*\.xml$)/', $aux, $match)) {
$context = $aux;
}
}
@@ -224,10 +220,10 @@ class Language extends BaseLanguage
// it is a Sql insert on TRANSLATIONS TAble
if ($identifier == 'TRANSLATION') {
if ($updateDB) {
list ($category, $id) = explode( '/', $context );
$result = $oTranslation->addTranslation( $category, $id, $LOCALE, trim( stripcslashes( str_replace( chr( 10 ), '', $rowTranslation['msgstr'] ) ) ) );
list ($category, $id) = explode('/', $context);
$result = $translation->addTranslation($category, $id, $LOCALE, trim(stripcslashes(str_replace(chr(10), '', $rowTranslation['msgstr']))));
if ($result['codError'] == 0) {
$countItemsSuccess ++;
$countItemsSuccess++;
} else {
$errorMsg .= $id . ': ' . $result['message'] . "\n";
}
@@ -236,52 +232,52 @@ class Language extends BaseLanguage
elseif ($updateXml) {
$xmlForm = $context;
//erik: expresion to prevent and hable correctly dropdown values like -1, -2 etc.
preg_match( '/^([\w_]+)\s-\s([\w_]+)\s*-*\s*([\w\W]*)$/', $reference, $match );
preg_match('/^([\w_]+)\s-\s([\w_]+)\s*-*\s*([\w\W]*)$/', $reference, $match);
if (! file_exists( PATH_XMLFORM . $xmlForm )) {
if (!file_exists(PATH_XMLFORM . $xmlForm)) {
$errorMsg .= 'file doesn\'t exist: ' . PATH_XMLFORM . $xmlForm . "\n";
continue;
}
if (count( $match ) < 4) {
$near = isset( $rowTranslation['msgid'] ) ? $rowTranslation['msgid'] : (isset( $rowTranslation['msgstr'] ) ? $rowTranslation['msgstr'] : '');
if (count($match) < 4) {
$near = isset($rowTranslation['msgid']) ? $rowTranslation['msgid'] : (isset($rowTranslation['msgstr']) ? $rowTranslation['msgstr'] : '');
$errorMsg .= "Invalid Translation reference: \"$reference\", near -> " . strip_tags($near) . "\n";
continue;
}
$dynaform = new DynaformHandler( PATH_XMLFORM . $xmlForm );
$dynaform = new DynaformHandler(PATH_XMLFORM . $xmlForm);
$fieldName = $match[2];
$codes = explode( '-', $reference );
$codes = explode('-', $reference);
if (sizeof( $codes ) == 2) {
if (sizeof($codes) == 2) {
//is a normal node
$dynaform->addChilds( $fieldName, Array ($LOCALE => stripcslashes( str_replace( chr( 10 ), '', $rowTranslation['msgstr'] ) )
) );
} elseif (sizeof( $codes ) > 2) {
$dynaform->addChilds($fieldName, Array($LOCALE => stripcslashes(str_replace(chr(10), '', $rowTranslation['msgstr']))
));
} elseif (sizeof($codes) > 2) {
//is a node child for a language node
$name = $match[3] == "''" ? '' : $match[3];
$childNode = Array (Array ('name' => 'option','value' => $rowTranslation['msgstr'],'attributes' => Array ('name' => $name
$childNode = Array(Array('name' => 'option', 'value' => $rowTranslation['msgstr'], 'attributes' => Array('name' => $name
)
)
);
$dynaform->addChilds( $fieldName, Array ($LOCALE => null
), $childNode );
$dynaform->addChilds($fieldName, Array($LOCALE => null
), $childNode);
}
$countItemsSuccess ++;
$countItemsSuccess++;
}
}
$oLanguage = new Language();
$oLanguage->update( array ('LAN_ID' => $languageID,'LAN_ENABLED' => '1'
) );
$language = new Language();
$language->update(array('LAN_ID' => $languageID, 'LAN_ENABLED' => '1'
));
if ($updateXml) {
$trn = new Translation();
$trn->generateFileTranslation( $LOCALE );
$trn->addTranslationEnvironment( $LOCALE, $POHeaders, $countItemsSuccess );
$trn->generateFileTranslation($LOCALE);
$trn->addTranslationEnvironment($LOCALE, $POHeaders, $countItemsSuccess);
}
if ($generateMafe) {
@@ -297,26 +293,26 @@ class Language extends BaseLanguage
$results->headers = $POHeaders;
$results->errMsg = $errorMsg;
G::auditLog("UploadLanguage", "Language: ".$languageID);
G::auditLog("UploadLanguage", "Language: " . $languageID);
return $results;
} catch (Exception $oError) {
throw ($oError);
} catch (Exception $error) {
throw ($error);
}
}
//export
/**
* Export language to Download
* @throws Exception
*/
public function export ()
{
//get labels MichelangeloFE
$translation = new Translation();
try {
$oTranslation = new Translation();
$MichelangeloFE = PATH_HOME . "../workflow/public_html/lib/js";
if (file_exists($MichelangeloFE)) {
$labels = self::readLabelsDirectory($MichelangeloFE, true);
foreach ($labels as $label) {
$oTranslation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
}
//We get all MichelangeloFE and PMDynaform translatable labels.
$labels = array_merge(self::getLabelsMafe(), self::getLabelsPMDynaform());
foreach ($labels as $label) {
$translation->addTranslation('LABEL', 'ID_MAFE_' . G::encryptOld($label), 'en', $label);
}
} catch (Exception $e) {
error_log($e->getMessage());
@@ -412,8 +408,7 @@ class Language extends BaseLanguage
// IF the translations id "TRN_ID" has invalid characteres or has not accepted categories
if ($sTestResult[0] !== $trnCategory || ($trnCategory != 'LABEL' && $trnCategory != 'JAVASCRIPT')) {
$oTranslation = new Translation();
$oTranslation->remove( $aRow1['TRN_CATEGORY'], $aRow1['TRN_ID'], 'en' ); //remove not accepted translations
$translation->remove( $aRow1['TRN_CATEGORY'], $aRow1['TRN_ID'], 'en' ); //remove not accepted translations
continue; //jump to next iteration
}
@@ -561,6 +556,67 @@ class Language extends BaseLanguage
G::auditLog("ExportLanguage", "Language: ".$_GET['LOCALE']);
G::streamFile( $sPOFile, true );
}
/**
* Get Labels MAFE (Michelangelo Project)
* @return array
*/
public static function getLabelsMafe()
{
$labels = [];
$buildhash = PATH_HTML . "lib/buildhash";
if (!file_exists($buildhash)) {
throw new RuntimeException("Unable to generate labels for MAFE!.\nMissing file '{$buildhash}'.");
}
$buildhash = file_get_contents($buildhash);
$michelangeloFE = PATH_HTML . "lib/js";
$pathFileMafe = array_pop(glob($michelangeloFE . '/' . '*' . $buildhash . '*', GLOB_BRACE));
if (file_exists($pathFileMafe) && is_readable($pathFileMafe)) {
$labels = self::readLabelsDirectory($pathFileMafe, true);
}
return $labels;
}
/**
* Get Labels PMDynaform (PMDynaform Project)
* @return array
*/
public static function getLabelsPMDynaform()
{
$labels = [];
$pathFilePMDynaform = PATH_HTML . "lib/pmdynaform/build/js/PMDynaform.js";
if (file_exists($pathFilePMDynaform) && is_readable($pathFilePMDynaform)) {
$labels = self::readLabelsDirectory($pathFilePMDynaform, true);
}
return $labels;
}
/**
* We read all labels
* @param $path
* @param bool $unique
* @return array
*/
public static function readLabelsDirectory($path, $unique = false)
{
$labels = [];
if (is_file($path)) {
$info = pathinfo($path);
if (strtolower($info["extension"]) === "js") {
$file = file_get_contents($path);
//search string 'xx\'xx\'xx'.translate()
$labels = array_merge($labels, self::readLabelsFile($file, "'"));
//search string "xx\"xx\"xx".translate()
$labels = array_merge($labels, self::readLabelsFile($file, "\""));
}
}
if ($unique) {
$labels = array_unique($labels);
}
return $labels;
}
public function updateLanguagePlugin ($plugin, $idLanguage)
{
if (!file_exists(PATH_PLUGINS . $plugin)) {
@@ -835,33 +891,6 @@ class Language extends BaseLanguage
} //end foreach
}
}
public static function readLabelsDirectory($path, $unique = false)
{
$labels = array();
$items = opendir($path);
while (false !== ($item = readdir($items))) {
$a = $path . "/" . $item;
if ($item !== "." && $item !== ".." && is_dir($a)) {
$labels = array_merge($labels, self::readLabelsDirectory($a, false));
}
if (is_file($a)) {
$info = pathinfo($a);
if ($info["extension"] === "js" || $info["extension"] === "JS") {
$file = file_get_contents($a);
//search string 'xx\'xx\'xx'.translate()
$labels = array_merge($labels, self::readLabelsFile($file, "'"));
//search string "xx\"xx\"xx".translate()
$labels = array_merge($labels, self::readLabelsFile($file, "\""));
}
}
}
if ($unique) {
$labels = array_unique($labels);
}
closedir($items);
return $labels;
}
public static function readLabelsFile($file, $sep)
{

View File

@@ -645,10 +645,9 @@ class ListInbox extends BaseListInbox
$filters['usr_uid'] = $usrUid;
$criteria = new Criteria();
$criteria->addSelectColumn('COUNT(*) AS TOTAL');
$criteria->add(ListInboxPeer::USR_UID, $usrUid, Criteria::EQUAL);
if (count($filters)) {
self::loadFilters($criteria, $filters);
}
//The function loadFilters will add some condition in the query
$this->loadFilters($criteria, $filters);
$dataset = ListInboxPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();

View File

@@ -739,7 +739,7 @@ class Process extends BaseProcess
}
$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memcache = & PMmemcached::getSingleton( config("system.workspace") );
if (isset($memcache) && $memcache->enabled == 1 ) {
return $aProcesses;
}
@@ -766,7 +766,7 @@ class Process extends BaseProcess
GROUP BY PRO_UID, APP_STATUS*/
require_once 'classes/model/Application.php';
$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memcache = & PMmemcached::getSingleton( config("system.workspace") );
$memkey = 'getCasesCountInAllProcesses';
if (($aProcesses = $memcache->get( $memkey )) === false) {
$oCriteria = new Criteria( 'workflow' );
@@ -877,7 +877,7 @@ class Process extends BaseProcess
$limit = 25;
$start = 0;
$memcache = PMmemcached::getSingleton( SYS_SYS );
$memcache = PMmemcached::getSingleton( config("system.workspace") );
for ($start = 0; $start <= 50 - 1; $start ++) {
$memkey = "processList-allProcesses-" . ($start * $limit) . "-" . $limit;

View File

@@ -258,10 +258,10 @@ class UsersProperties extends BaseUsersProperties
$url = $this->_getDefaultLocation();
return $url;
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/main';
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/main';
}
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/main';
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/main';
}
global $RBAC;
$oConf = new Configurations();
@@ -330,9 +330,9 @@ class UsersProperties extends BaseUsersProperties
$pathMethod = $detail->getPathMethod();
if (isset($pathMethod) && $detail->equalRoleCodeTo($userRole)) {
if (isset($_COOKIE['workspaceSkin'])) {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $pathMethod;
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $pathMethod;
} else {
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/' . $pathMethod;
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/' . $pathMethod;
}
}
}
@@ -376,7 +376,7 @@ class UsersProperties extends BaseUsersProperties
case 'SINGLE':
$_SESSION['user_experience'] = $uxType;
$_SESSION['user_last_skin'] = SYS_SKIN;
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/uxs/' . 'home';
$url = '/sys' . config("system.workspace") . '/' . $this->lang . '/uxs/' . 'home';
break;
}
@@ -393,11 +393,10 @@ class UsersProperties extends BaseUsersProperties
$oConf = new Configurations();
$oConf->loadConfig( $x, 'USER_PREFERENCES', '', '', $_SESSION['USER_LOGGED'], '' );
//$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
if (isset($_COOKIE['workspaceSkin'])) {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
$baseUrl = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/';
} else {
$baseUrl = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/';
$baseUrl = '/sys' . config("system.workspace") . '/' . $this->lang . '/' . SYS_SKIN . '/';
}
$url = '';

View File

@@ -305,10 +305,10 @@ function getFolderChildren($alfrescoServerUrl, $folderId, $user, $pwd)
/**
* @method
*
* Uplaod file/document in Alfresco Repository
* Upload file/document in Alfresco Repository
*
* @name uploadDoc
* @label Uplaod file/document in Alfresco Repository
* @label Upload file/document in Alfresco Repository
*
* @param string | $alfrescoServerUrl | Server name and port where Alfresco exists | http://localhost:8080/alfresco
* @param string | $fileSource | File Source

View File

@@ -23,12 +23,12 @@
*
*/
if (defined('PATH_DB') && defined('SYS_SYS')) {
if (defined('PATH_DB') && !empty(config("system.workspace"))) {
if (!file_exists(PATH_DB . SYS_SYS . '/db.php'))
throw new Exception("Could not find db.php in current workspace " . SYS_SYS);
if (!file_exists(PATH_DB . config("system.workspace") . '/db.php'))
throw new Exception("Could not find db.php in current workspace " . config("system.workspace"));
require_once(PATH_DB . SYS_SYS . '/db.php');
require_once(PATH_DB . config("system.workspace") . '/db.php');
//to do: enable for other databases
$dbType = DB_ADAPTER;
$dsn = DB_ADAPTER . '://' . DB_USER . ':' . urlencode(DB_PASS) . '@' . DB_HOST . '/' . DB_NAME;

View File

@@ -1747,11 +1747,71 @@ msgstr "Databases Source List"
msgid "Changes saved"
msgstr "Changes saved"
# TRANSLATION
# LABEL/ID_SELECT_USER_OR_GROUP
#: LABEL/ID_SELECT_USER_OR_GROUP
msgid "Please select the name of a user or a group in the Group or User field"
msgstr "Please select the name of a user or a group in the Group or User field"
# TRANSLATION
# LABEL/ID_EMAILS
#: LABEL/ID_EMAILS
msgid "EMAILS"
msgstr "EMAILS"
msgid "Emails"
msgstr "Emails"
# TRANSLATION
# LABEL/ID_NO_PREVIOUS_USR_UID
#: LABEL/ID_NO_PREVIOUS_USR_UID
msgid "The previous task doesn't have any users."
msgstr "The previous task doesn't have any users."
# TRANSLATION
# LABEL/ID_SET_NO_MANAGER
#: LABEL/ID_SET_NO_MANAGER
msgid "Unassign Manager"
msgstr "Unassign Manager"
# TRANSLATION
# LABEL/ID_ERROR_EMAIL
#: LABEL/ID_ERROR_EMAIL
msgid "Error"
msgstr "Error"
# TRANSLATION
# LABEL/ID_CASE_SCHEDULER_CLASSIC
#: LABEL/ID_CASE_SCHEDULER_CLASSIC
msgid "Case Scheduler (classic processes)"
msgstr "Case Scheduler (classic processes)"
# TRANSLATION
# LABEL/ID_PROCESS_IS_REQUIRED
#: LABEL/ID_PROCESS_IS_REQUIRED
msgid "Process field is required"
msgstr "Process field is required"
# TRANSLATION
# LABEL/ID_DELEGATE_DATE_FROM
#: LABEL/ID_DELEGATE_DATE_FROM
msgid "Date from"
msgstr "Date from"
# TRANSLATION
# LABEL/ID_REASSIGN_CONFIRM
#: LABEL/ID_REASSIGN_CONFIRM
msgid "Do you want to reassign the case?"
msgstr "Do you want to reassign the case?"
# TRANSLATION
# LABEL/ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION
#: LABEL/ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION
msgid "A note has been added to the case"
msgstr "A note has been added to the case"
# TRANSLATION
# LABEL/ID_EVENTS_CLASSIC
#: LABEL/ID_EVENTS_CLASSIC
msgid "Events (classic processes)"
msgstr "Events (classic processes)"
# TRANSLATION
# LABEL/ID_REPORT2
@@ -5360,12 +5420,6 @@ msgstr "Can not save, because, there is an Output Document with the same name in
msgid "User or password is empty."
msgstr "User or password is empty."
# TRANSLATION
# LABEL/ID_DELEGATE_DATE_FROM
#: LABEL/ID_DELEGATE_DATE_FROM
msgid "Delegated date from"
msgstr "Delegated date from"
# TRANSLATION
# JAVASCRIPT/ID_DUPLICATE_CATEGORY_NAME
#: JAVASCRIPT/ID_DUPLICATE_CATEGORY_NAME
@@ -6872,12 +6926,6 @@ msgstr "Last Name"
msgid "Case #{APP_NUMBER} was reassigned to user {USER}."
msgstr "Case #{APP_NUMBER} was reassigned to user {USER}."
# TRANSLATION
# LABEL/ID_REASSIGN_CONFIRM
#: LABEL/ID_REASSIGN_CONFIRM
msgid "Are you sure to reassign the current case?"
msgstr "Are you sure to reassign the current case?"
# TRANSLATION
# LABEL/ID_CASE_PAUSED_SUCCESSFULLY
#: LABEL/ID_CASE_PAUSED_SUCCESSFULLY
@@ -10508,12 +10556,6 @@ msgstr "From each table select at least one Schema/Data to export."
msgid "Do you want to delete the selected skin?"
msgstr "Do you want to delete the selected skin?"
# TRANSLATION
# LABEL/ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION
#: LABEL/ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION
msgid "A note has been added to the case."
msgstr "A note has been added to the case."
# TRANSLATION
# LABEL/ID_MSG_CANNOT_EXPORT_DEFAULT_SKIN
#: LABEL/ID_MSG_CANNOT_EXPORT_DEFAULT_SKIN
@@ -18685,12 +18727,6 @@ msgstr "Compare"
msgid "You can click on one of the dashboards to view the data or click on the favorite icon to make it your main dashboard."
msgstr "You can click on one of the dashboards to view the data or click on the favorite icon to make it your main dashboard."
# TRANSLATION
# LABEL/ID_SET_NO_MANAGER
#: LABEL/ID_SET_NO_MANAGER
msgid "No set Manager"
msgstr "No set Manager"
# TRANSLATION
# LABEL/ID_NO_SET_MANAGER_SUCCES
#: LABEL/ID_NO_SET_MANAGER_SUCCES
@@ -18895,12 +18931,6 @@ msgstr "(Goal value)"
msgid "Please enter your credentials below"
msgstr "Please enter your credentials below"
# TRANSLATION
# LABEL/ID_ERROR_EMAIL
#: LABEL/ID_ERROR_EMAIL
msgid "Error email"
msgstr "Error email"
# TRANSLATION
# LABEL/ID_AVAILABLE_DATABASE
#: LABEL/ID_AVAILABLE_DATABASE
@@ -27473,12 +27503,6 @@ msgstr "Error: The application {0} is not canceled."
msgid "Error: Thread status does not exist for the application {0}."
msgstr "Error: Thread status does not exist for the application {0}."
# TRANSLATION
# LABEL/ID_NO_PREVIOUS_USR_UID
#: LABEL/ID_NO_PREVIOUS_USR_UID
msgid "The previuos task doesn't have any users."
msgstr "The previuos task doesn't have any users."
# TRANSLATION
# LABEL/ID_WARNING_GATEWAY_CONVERGENT_WITH_CONDITION
#: LABEL/ID_WARNING_GATEWAY_CONVERGENT_WITH_CONDITION

View File

@@ -319,7 +319,7 @@ class Admin extends Controller
);
}
$properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection
$properties[] = array(G::LoadTranslation('ID_WORKSPACE'), !empty(config("system.workspace")) ? config("system.workspace") : "Not defined", $pmSection
);
$properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection

View File

@@ -117,7 +117,7 @@ class adminProxy extends HttpProxyController
$this->success = true;
$this->restart = $restart;
$this->url = "/sys" . SYS_SYS . "/" . (($sysConf["default_lang"] != "")? $sysConf["default_lang"] : ((defined("SYS_LANG") && SYS_LANG != "")? SYS_LANG : "en")) . "/" . $sysConf["default_skin"] . $urlPart;
$this->url = "/sys" . config("system.workspace") . "/" . (($sysConf["default_lang"] != "")? $sysConf["default_lang"] : ((defined("SYS_LANG") && SYS_LANG != "")? SYS_LANG : "en")) . "/" . $sysConf["default_skin"] . $urlPart;
$this->message = 'Saved Successfully';
$msg = "";
if ($httpData->proxy_host != '' || $httpData->proxy_port != '' || $httpData->proxy_user != '') {
@@ -1191,7 +1191,7 @@ class adminProxy extends HttpProxyController
$snameLogo = self::changeNamelogo($snameLogo);
$oConf = new Configurations;
$aConf = Array(
'WORKSPACE_LOGO_NAME' => SYS_SYS,
'WORKSPACE_LOGO_NAME' => config("system.workspace"),
'DEFAULT_LOGO_NAME' => $snameLogo
);
@@ -1356,7 +1356,7 @@ class adminProxy extends HttpProxyController
'%s://%s/sys%s/%s/%s/oauth2/grant',
$http,
$host,
SYS_SYS,
config("system.workspace"),
$lang,
SYS_SKIN
);
@@ -1416,7 +1416,7 @@ class adminProxy extends HttpProxyController
//On premise or cloud
$licInfo = $oServerConf->getProperty( 'LICENSE_INFO' );
$params['lt'] = isset($licInfo[SYS_SYS]) ? isset($licInfo[SYS_SYS]['TYPE'])? $licInfo[SYS_SYS]['TYPE'] : '' : '';
$params['lt'] = isset($licInfo[config("system.workspace")]) ? isset($licInfo[config("system.workspace")]['TYPE'])? $licInfo[config("system.workspace")]['TYPE'] : '' : '';
//ProcessMaker Version
$params['v'] = System::getVersion();
@@ -1511,7 +1511,7 @@ class adminProxy extends HttpProxyController
$params['t'] = (defined('TIME_ZONE') && TIME_ZONE != "Unknown") ? TIME_ZONE : date_default_timezone_get();
$params['w'] = count(System::listWorkspaces());
$support = PATH_DATA_SITE . G::sanitizeString($licenseManager->info['FIRST_NAME'] . '-' . $licenseManager->info['LAST_NAME'] . '-' . SYS_SYS . '-' . date('YmdHis'), false, false) . '.spm';
$support = PATH_DATA_SITE . G::sanitizeString($licenseManager->info['FIRST_NAME'] . '-' . $licenseManager->info['LAST_NAME'] . '-' . config("system.workspace") . '-' . date('YmdHis'), false, false) . '.spm';
file_put_contents($support, serialize($params));
G::streamFile($support, true);
G::rm_dir($support);

View File

@@ -73,14 +73,11 @@ class AppProxy extends HttpProxyController
$proUid = $httpData->pro;
}
if(!isset($httpData->tas) || empty($httpData->tas))
{
$tasUid = $_SESSION['TASK'];
if (!isset($httpData->tas) || empty($httpData->tas)) {
$tasUid = isset($_SESSION['TASK']) ? $_SESSION['TASK'] : "";
} else {
$tasUid = $httpData->tas;
}
//$proUid = (!isset($httpData->pro)) ? $_SESSION['PROCESS'] : $httpData->pro;
//$tasUid = (!isset($httpData->tas)) ? ((isset($_SESSION['TASK'])) ? $_SESSION['TASK'] : '') : $httpData->tas;
$usrUid = $_SESSION['USER_LOGGED'];
$respView = $case->getAllObjectsFrom($proUid, $appUid, $tasUid, $usrUid, "VIEW", $delIndex);
@@ -91,11 +88,12 @@ class AppProxy extends HttpProxyController
);
}
$usrUid = isset( $_SESSION['USER_LOGGED'] ) ? $_SESSION['USER_LOGGED'] : "";
$usrUid = isset($_SESSION['USER_LOGGED']) ? $_SESSION['USER_LOGGED'] : "";
$appNotes = new AppNotes();
$response = $appNotes->getNotesList( $appUid, '', $httpData->start, $httpData->limit );
$response = $appNotes->getNotesList($appUid, '', $httpData->start, $httpData->limit);
$response = AppNotes::applyHtmlentitiesInNotes($response);
require_once ("classes/model/Application.php");
require_once("classes/model/Application.php");
$oApplication = new Application();
$aApplication = $oApplication->Load($appUid);
$response['array']['appTitle'] = $aApplication['APP_TITLE'];

View File

@@ -97,7 +97,7 @@ class caseSchedulerProxy extends HttpProxyController
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$user = $sWS_USER;

View File

@@ -62,7 +62,7 @@ class Designer extends Controller
$this->setVar('credentials', base64_encode(json_encode($clientToken)));
$this->setVar('isDebugMode', $debug);
$this->setVar("distribution", $distribution);
$this->setVar("SYS_SYS", SYS_SYS);
$this->setVar("SYS_SYS", config("system.workspace"));
$this->setVar("SYS_LANG", SYS_LANG);
$this->setVar("SYS_SKIN", SYS_SKIN);
$this->setVar('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());
@@ -219,7 +219,7 @@ class Designer extends Controller
}
Tracker::authentication($_SESSION['CASE'], $_SESSION['PIN']);
} catch (\Exception $e) {
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], SYS_SYS, 'processmaker.log');
Bootstrap::registerMonolog('CaseTracker', 400, $e->getMessage(), [], config("system.workspace"), 'processmaker.log');
\G::header('Location: /errors/error403.php');
die();
}

View File

@@ -131,7 +131,7 @@ class Home extends Controller
if (!isset($_COOKIE['workspaceSkin'])) {
if (substr( $sysConf['default_skin'], 0, 2 ) == 'ux') {
$_SESSION['_defaultUserLocation'] = $switchLink;
$switchLink = '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
$switchLink = '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . $sysConf['default_skin'] . '/main';
}
}
@@ -531,7 +531,7 @@ class Home extends Controller
$conf = new Configurations();
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$cases['data'][$i]['DEL_DELEGATE_DATE'] = '';
if (defined('SYS_SYS')) {
if (!empty(config("system.workspace"))) {
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
$cases['data'][$i]['DEL_DELEGATE_DATE'] = $conf->getSystemDate($row['DEL_DELEGATE_DATE'], 'casesListDateFormat');
}
@@ -544,7 +544,9 @@ class Home extends Controller
$cases['data'][$i]['APP_DEL_PREVIOUS_USER'] = ucwords( $row['APP_DEL_PREVIOUS_USER'] );
}
// Completting with Notes
$notes = $appNotes->getNotesList( $row['APP_UID'], '', $notesStart, $notesLimit );
$notes = $appNotes->getNotesList($row['APP_UID'], '', $notesStart, $notesLimit);
$notes = AppNotes::applyHtmlentitiesInNotes($notes);
$notes = $notes['array'];
$cases['data'][$i]['NOTES_COUNT'] = $notes['totalCount'];

View File

@@ -919,6 +919,7 @@ class InstallerModule extends Controller
define( 'SYSTEM_HASH', $sh );
define( 'PATH_DB', $pathShared . 'sites' . PATH_SEP );
define( 'SYS_SYS', $workspace );
config(["system.workspace" => $workspace]);
require_once ("propel/Propel.php");

View File

@@ -17,7 +17,7 @@ class Main extends Controller
public function __construct ()
{
$this->memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
$this->memcache = & PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
define( 'ERROR_EXCEPTION', 1 );
define( 'INFO_EXCEPTION', 3 );
@@ -40,7 +40,7 @@ class Main extends Controller
$this->setVar( 'pipe', isset( $_SESSION['USR_USERNAME'] ) ? ' | ' : '' );
$this->setVar( 'rolename', $this->getUserRole() );
$this->setVar( 'logout', G::LoadTranslation( 'ID_LOGOUT' ) );
$this->setVar( 'workspace', defined( 'SYS_SYS' ) ? ucfirst( SYS_SYS ) : '' );
$this->setVar( 'workspace', !empty(config("system.workspace")) ? ucfirst( config("system.workspace") ) : '' );
$this->setVar( 'user_avatar', 'users/users_ViewPhotoGrid?pUID=' . $_SESSION['USER_LOGGED'] . '&h=' . rand() );
// license notification
@@ -464,7 +464,7 @@ class Main extends Controller
{
$sCompanyLogo = '/images/processmaker2.logo2.png';
if (defined( "SYS_SYS" )) {
if (!empty(config("system.workspace"))) {
if (($aFotoSelect = $this->memcache->get( 'aFotoSelect' )) === false) {
$oLogoR = new ReplacementLogo();
$aFotoSelect = $oLogoR->getNameLogo( (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : '' );
@@ -480,9 +480,9 @@ class Main extends Controller
$logoPlugin = $oPluginRegistry->getCompanyLogo( $sCompanyLogo );
if ($logoPlugin != '/images/processmaker2.logo2.png') {
$sCompanyLogo = $logoPlugin;
} elseif (isset( $sFotoSelect ) && $sFotoSelect != '' && ! (strcmp( $sWspaceSelect, SYS_SYS ))) {
} elseif (isset( $sFotoSelect ) && $sFotoSelect != '' && ! (strcmp( $sWspaceSelect, config("system.workspace") ))) {
$sCompanyLogo = $oPluginRegistry->getCompanyLogo( $sFotoSelect );
$sCompanyLogo = "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/adminProxy/showLogoFile?id=" . base64_encode( $sCompanyLogo );
$sCompanyLogo = "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/adminProxy/showLogoFile?id=" . base64_encode( $sCompanyLogo );
}
}
return $sCompanyLogo;
@@ -778,7 +778,7 @@ class Main extends Controller
);
}
$properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,defined( "SYS_SYS" ) ? SYS_SYS : "Not defined",$pmSection
$properties[] = array ( G::LoadTranslation('ID_WORKSPACE') ,!empty(config("system.workspace")) ? config("system.workspace") : "Not defined",$pmSection
);
$properties[] = array ( G::LoadTranslation('ID_SERVER_PROTOCOL') ,getenv( 'SERVER_PROTOCOL' ),$sysSection

View File

@@ -147,7 +147,7 @@ class pmTables extends Controller
public function streamExported ($httpData)
{
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$sFileName = $httpData->f;
$realPath = $PUBLIC_ROOT_PATH . $sFileName;

View File

@@ -117,7 +117,7 @@ class pmTablesProxy extends HttpProxyController
$dbConn = new DbConnections();
$dbConnections = $dbConn->getConnectionsProUid( $proUid, array('mysql') );
$workSpace = new WorkspaceTools(SYS_SYS);
$workSpace = new WorkspaceTools(config("system.workspace"));
$workspaceDB = $workSpace->getDBInfo();
if ($workspaceDB['DB_NAME'] == $workspaceDB['DB_RBAC_NAME']) {
@@ -399,7 +399,7 @@ class pmTablesProxy extends HttpProxyController
$primaryKeys = $oAdditionalTables->getPrimaryKeys( 'keys' );
$this->className = $table['ADD_TAB_CLASS_NAME'];
$this->classPeerName = $this->className . 'Peer';
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (! file_exists( $sPath . $this->className . '.php' )) {
throw new Exception( 'Update:: ' . G::loadTranslation( 'ID_PMTABLE_CLASS_DOESNT_EXIST', $this->className ) );
@@ -440,7 +440,7 @@ class pmTablesProxy extends HttpProxyController
$table = $oAdditionalTables->load( $httpData->id, true );
$this->className = $table['ADD_TAB_CLASS_NAME'];
$this->classPeerName = $this->className . 'Peer';
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (! file_exists( $sPath . $this->className . '.php' )) {
throw new Exception( 'Destroy:: ' . G::loadTranslation( 'ID_PMTABLE_CLASS_DOESNT_EXIST', $this->className ) );
@@ -664,7 +664,7 @@ class pmTablesProxy extends HttpProxyController
$rows = $resultData['rows'];
$count = $resultData['count'];
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$filenameOnly = strtolower($aAdditionalTables['ADD_TAB_NAME'] . "_" . date("Y-m-d") . '_' . date("Hi") . ".csv");
$filename = $PUBLIC_ROOT_PATH . $filenameOnly;
$fp = fopen($filename, "wb");
@@ -733,7 +733,7 @@ class pmTablesProxy extends HttpProxyController
$_SESSION['FILES_FORM'] = $_FILES['form'];
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$filename = $_FILES['form']['name']['FILENAME'];
$tempName = $_FILES['form']['tmp_name']['FILENAME'];
@@ -923,7 +923,7 @@ class pmTablesProxy extends HttpProxyController
$result = new stdClass();
$net = new Net( G::getIpAddress() );
$META = " \n-----== ProcessMaker Open Source Private Tables ==-----\n" . " @Ver: 1.0 Oct-2009\n" . " @Processmaker version: " . System::getVersion() . "\n" . " -------------------------------------------------------\n" . " @Export Date: " . date( "l jS \of F Y h:i:s A" ) . "\n" . " @Server address: " . getenv( 'SERVER_NAME' ) . " (" . getenv( 'SERVER_ADDR' ) . ")\n" . " @Client address: " . $net->hostname . "\n" . " @Workspace: " . SYS_SYS . "\n" . " @Export trace back:\n\n";
$META = " \n-----== ProcessMaker Open Source Private Tables ==-----\n" . " @Ver: 1.0 Oct-2009\n" . " @Processmaker version: " . System::getVersion() . "\n" . " -------------------------------------------------------\n" . " @Export Date: " . date( "l jS \of F Y h:i:s A" ) . "\n" . " @Server address: " . getenv( 'SERVER_NAME' ) . " (" . getenv( 'SERVER_ADDR' ) . ")\n" . " @Client address: " . $net->hostname . "\n" . " @Workspace: " . config("system.workspace") . "\n" . " @Export trace back:\n\n";
$EXPORT_TRACEBACK = Array ();
$c = 0;
@@ -947,9 +947,9 @@ class pmTablesProxy extends HttpProxyController
$META .= $sTrace;
///////////////EXPORT PROCESS
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . SYS_SYS . PATH_SEP . 'public' . PATH_SEP;
$PUBLIC_ROOT_PATH = PATH_DATA . 'sites' . PATH_SEP . config("system.workspace") . PATH_SEP . 'public' . PATH_SEP;
$filenameOnly = strtolower( 'SYS-' . SYS_SYS . "_" . date( "Y-m-d" ) . '_' . date( "Hi" ) . ".pmt" );
$filenameOnly = strtolower( 'SYS-' . config("system.workspace") . "_" . date( "Y-m-d" ) . '_' . date( "Hi" ) . ".pmt" );
$filename = $PUBLIC_ROOT_PATH . $filenameOnly;
$fp = fopen( $filename, "wb" );

View File

@@ -33,7 +33,7 @@ class StrategicDashboard extends Controller
$user = new Users();
$user = $user->load($RBAC->aUserInfo['USER_INFO']['USR_UID']);
$this->usrUnitCost = $this->currencySymbolToShow($user);
$this->urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/';
$this->urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . config("system.workspace") . '/';
//change
$clientId = 'x-pm-local-client';
$client = $this->getClientCredentials($clientId);
@@ -194,7 +194,7 @@ class StrategicDashboard extends Controller
$this->setView( 'strategicDashboard/viewDashboard' );
$this->setVar('urlProxy', $this->urlProxy);
$this->setVar('SYS_SYS', SYS_SYS);
$this->setVar('SYS_SYS', config("system.workspace"));
$this->setVar('usrId', $this->usrId);
$this->setVar('credentials', $this->clientToken);
$this->setVar('unitCost', $this->usrUnitCost);

View File

@@ -21,8 +21,8 @@ class webEntryProxy extends HttpProxyController
$editEvent['EVN_CONDITIONS'] = null;
$event->update( $editEvent );
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
$this->success = true;
$this->msg = G::LoadTranslation( 'ID_WEB_ENTRY_SUCCESS_DELETE' );
@@ -46,7 +46,7 @@ class webEntryProxy extends HttpProxyController
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$user = $sWS_USER;
@@ -122,8 +122,8 @@ class webEntryProxy extends HttpProxyController
$pro_uid = $params->pro_uid;
$filename = $xDYNA;
$filename = $filename . '.php';
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename );
unlink( PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace( ".php", "Post", $filename ) . ".php" );
}
$pathProcess = PATH_DATA_SITE . 'public' . PATH_SEP . $sPRO_UID . PATH_SEP;
@@ -167,8 +167,8 @@ class webEntryProxy extends HttpProxyController
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
$template = new TemplatePower( $pluginTpl );
$template->prepare();
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'processUid', $sPRO_UID );
$template->assign( 'dynaformUid', $sDYNAFORM );
$template->assign( 'taskUid', $sTASKS );
@@ -184,7 +184,7 @@ class webEntryProxy extends HttpProxyController
$template->assign( 'dynaform', $dynTitle );
$template->assign( 'timestamp', date( 'l jS \of F Y h:i:s A' ) );
$template->assign( 'ws', SYS_SYS );
$template->assign( 'ws', config("system.workspace") );
$template->assign( 'version', System::getVersion() );
$fileName = $pathProcess . $dynTitle . 'Post.php';
@@ -218,7 +218,7 @@ class webEntryProxy extends HttpProxyController
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update( $aDataEvent );
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$this->success = true;
$this->msg = G::LoadTranslation( 'ID_WEB_ENTRY_SUCCESS_NEW' );

View File

@@ -45,6 +45,7 @@ INSERT INTO CONTENT (CON_CATEGORY,CON_PARENT,CON_ID,CON_LANG,CON_VALUE) VALUES
('PER_NAME','','00000000000000000000000000000036','en','Delete process cases'),
('PER_NAME','','00000000000000000000000000000037','en','Edit personal info Calendar'),
('PER_NAME','','00000000000000000000000000000038','en','Undo cancel case'),
('PER_NAME','','00000000000000000000000000000039','en','Register External Applications'),
('PER_NAME','','00000000000000000000000000000040','en','Edit User profile First Name'),
('PER_NAME','','00000000000000000000000000000041','en','Edit User profile Last Name'),
('PER_NAME','','00000000000000000000000000000042','en','Edit User profile Username'),
@@ -1731,7 +1732,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'JAVASCRIPT','ID_DBS_NEW','en','Add new Database Source','2014-01-15') ,
( 'JAVASCRIPT','ID_DBS_LIST','en','Databases Source List','2014-01-15') ,
( 'LABEL','ID_CHANGES_SAVED','en','Changes saved','2014-01-15') ,
( 'LABEL','ID_EMAILS','en','EMAILS','2014-01-15') ,
( 'LABEL','ID_EMAILS','en','Emails','2017-10-18') ,
( 'LABEL','ID_REPORT2','en','Number of cases per process','2014-01-15') ,
( 'LABEL','ID_REPORT1','en','Case duration by process and task','2014-01-15') ,
( 'LABEL','ID_IUD','en','#','2014-01-15') ,
@@ -2347,7 +2348,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'JAVASCRIPT','ID_EXIST_INPUTDOCUMENT','en','Can not save, because there is an Input Document with the same name in this process.','2014-01-15') ,
( 'JAVASCRIPT','ID_EXIST_OUTPUTDOCUMENT','en','Can not save, because, there is an Output Document with the same name in this process.','2014-01-15') ,
( 'LABEL','ID_CASE_SCHEDULER_VALIDATE_ALERT','en','User or password is empty.','2014-10-21') ,
( 'LABEL','ID_DELEGATE_DATE_FROM','en','Delegated date from','2014-01-15') ,
( 'LABEL','ID_DELEGATE_DATE_FROM','en','Date from','2017-10-18') ,
( 'JAVASCRIPT','ID_DUPLICATE_CATEGORY_NAME','en','Duplicate category name.','2014-01-15') ;
INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE ) VALUES
@@ -2607,7 +2608,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_FIRSTNAME','en','First Name','2014-01-15') ,
( 'LABEL','ID_LASTNAME','en','Last Name','2014-01-15') ,
( 'LABEL','ID_REASSIGNMENT_SUCCESS','en','Case #{APP_NUMBER} was reassigned to user {USER}.','2014-01-15') ,
( 'LABEL','ID_REASSIGN_CONFIRM','en','Are you sure to reassign the current case?','2014-01-15') ,
( 'LABEL','ID_REASSIGN_CONFIRM','en','Do you want to reassign the case?','2017-10-18') ,
( 'LABEL','ID_CASE_PAUSED_SUCCESSFULLY','en','The Case {APP_NUMBER} was paused successfully and it will be unpaused on date {UNPAUSE_DATE}','2014-01-15') ,
( 'LABEL','ID_VACATION','en','Vacation','2014-01-15') ,
( 'JAVASCRIPT','ID_DB_CONNECTION_ASSIGN','en','You cannot delete this database connection. It is assigned to a step.','2014-01-15') ,
@@ -3227,7 +3228,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_TABLES_TO_EXPORT','en','Tables To Export','2014-01-15') ,
( 'LABEL','ID_PMTABLES_NOTICE_EXPORT','en','From each table select at least one Schema/Data to export.','2014-10-21') ,
( 'LABEL','ID_CONFIRM_DELETE_SKIN','en','Do you want to delete the selected skin?','2017-04-21') ,
( 'LABEL','ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION','en','A note has been added to the case.','2014-10-21') ,
( 'LABEL','ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION','en','A note has been added to the case','2017-10-18') ,
( 'LABEL','ID_MSG_CANNOT_EXPORT_DEFAULT_SKIN','en','Default skin can''t be exported. Instead create new one based on default','2014-01-15') ,
( 'LABEL','ID_MSG_CANNOT_EXPORT_SKIN','en','Can''t export skin. Server Error','2014-01-15') ,
( 'LABEL','ID_NEW_SKIN','en','New Skin','2014-01-15') ,
@@ -3868,6 +3869,9 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_EVENT_DESCRIPTION','en','Event Description','2014-01-15') ,
( 'LABEL','ID_EVENT_ACTION','en','Event Type','2014-01-15') ,
( 'LABEL','ID_EVENTS','en','Events','2014-01-15') ,
( 'LABEL','ID_EVENTS_CLASSIC','en','Events (classic processes)','2017-13-10') ,
( 'LABEL','ID_CASE_SCHEDULER_CLASSIC','en','Case Scheduler (classic processes)','2017-13-10') ,
( 'LABEL','ID_PROCESS_IS_REQUIRED','en','Process field is required','2017-13-10') ,
( 'LABEL','ID_EVENT_LIST','en','Log of events','2014-01-15') ,
( 'LABEL','ID_EMPTY_TYPE','en','Select a Type','2014-01-15') ,
( 'LABEL','ID_GRID_PAGE_NO_EVENT_MESSAGE','en','No Events to display','2014-01-15') ,
@@ -4625,7 +4629,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_DASH_COMPARE_MONTH','en','Compare this month with','2015-05-26') ,
( 'LABEL','ID_DASH_COMPARE','en','Compare','2015-03-18') ,
( 'LABEL','ID_DASH_CLICK_TO_VIEW','en','You can click on one of the dashboards to view the data or click on the favorite icon to make it your main dashboard.','2015-03-18') ,
( 'LABEL','ID_SET_NO_MANAGER','en','No set Manager','2015-03-18') ,
( 'LABEL','ID_SET_NO_MANAGER','en','Unassign Manager','2017-10-18') ,
( 'LABEL','ID_NO_SET_MANAGER_SUCCES','en','Manager unassigned correctly','2015-03-18') ,
( 'LABEL','ID_INDICATOR_PROCESS_REQUIRED','en','The field Process of indicator "{0}" is required.','2015-03-18') ,
( 'LABEL','ID_INDICATOR_TITLE_REQUIRED','en','The field Title of indicator "{0}" is required.','2015-03-18') ,
@@ -4662,7 +4666,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_UNTITLED_TASK','en','Untitled task','2015-04-01') ,
( 'LABEL','ID_GOAL_HELP','en','(Goal value)','2015-04-06') ,
( 'LABEL','ID_PLEASE_ENTER_CREDENTIALS','en','Please enter your credentials below','2015-04-09') ,
( 'LABEL','ID_ERROR_EMAIL','en','Error email','2015-04-20') ,
( 'LABEL','ID_ERROR_EMAIL','en','Error','2017-10-18') ,
( 'LABEL','ID_AVAILABLE_DATABASE','en','Available.','2015-04-21') ,
( 'LABEL','ID_NOT_AVAILABLE_DATABASE','en','Not available.','2015-04-21') ,
( 'LABEL','ID_WRONG_USER_PASS','en','Wrong username or password.','2015-04-22') ,
@@ -6125,7 +6129,7 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_YOU_DO_NOT_HAVE_PERMISSION','en','Error: You do not have permission.','2016-06-15') ,
( 'LABEL','ID_THE_APPLICATION_IS_NOT_CANCELED','en','Error: The application {0} is not canceled.','2016-06-15') ,
( 'LABEL','ID_THREAD_STATUS_DOES_NOT_EXIST_FOR_THE_APPLICATION','en','Error: Thread status does not exist for the application {0}.','2016-06-15') ,
( 'LABEL','ID_NO_PREVIOUS_USR_UID','en','The previuos task doesn''t have any users.','2016-06-17') ,
( 'LABEL','ID_NO_PREVIOUS_USR_UID','en','The previous task doesn''t have any users.','2017-10-18') ,
( 'LABEL','ID_WARNING_GATEWAY_CONVERGENT_WITH_CONDITION','en','Your Gateway Convergent has a condition, save again your process.','2016-06-23') ,
( 'LABEL','ID_RT_RENAME_NAME_TABLE','en','All references to the previous table name are going to be invalid. Do you really want to change the table name?','2016-06-29') ,
( 'LABEL','ID_RT_CONTINUE_TABLE_RENAME','en','Continue renaming the table','2016-06-30') ;
@@ -6186,7 +6190,8 @@ INSERT INTO TRANSLATION (TRN_CATEGORY,TRN_ID,TRN_LANG,TRN_VALUE,TRN_UPDATE_DATE
( 'LABEL','ID_CASE_ROUTED_TO','en','Case routed to','2017-06-02'),
( 'LABEL','ID_IMPORTED','en','IMPORTED','2017-10-03'),
( 'LABEL','ID_NOT_IMPORTED','en','NOT IMPORTED','2017-10-03'),
( 'LABEL','ID_CANNOT_IMPORT','en','CANNOT IMPORT','2017-10-03');
( 'LABEL','ID_CANNOT_IMPORT','en','CANNOT IMPORT','2017-10-03'),
( 'LABEL','ID_SELECT_USER_OR_GROUP','en','Please select the name of a user or a group in the Group or User field','2017-10-19');
INSERT INTO ISO_LOCATION (IC_UID,IL_UID,IL_NAME,IL_NORMAL_NAME,IS_UID) VALUES
('AD','','',' ','') ,

View File

@@ -25,6 +25,8 @@
global $G_TMP_MENU;
global $sStatus;
global $RBAC;
$viewSteps = true;
$statusSendAndUnassigned = false;
//caseOptions
@@ -40,12 +42,9 @@ switch ($_SESSION['actionCaseOptions']) {
$statusSendAndUnassigned = true;
break;
case 'paused':
if (isset($_SESSION['bNoShowSteps'])) {
unset($_SESSION['bNoShowSteps']);
}
$viewSteps = false;
break;
case 'to_revise':
case 'to_reassign':
$access = $RBAC->requirePermissions('PM_REASSIGNCASE', 'PM_SUPERVISOR');
if ($access) {
if (isset($_SESSION['bNoShowSteps'])) {
@@ -53,8 +52,21 @@ switch ($_SESSION['actionCaseOptions']) {
}
}
break;
case 'to_reassign':
$access = $RBAC->requirePermissions('PM_REASSIGNCASE', 'PM_SUPERVISOR');
if ($access) {
$aData = AppDelegation::getCurrentUsers($_SESSION['APPLICATION'], $_SESSION['INDEX']);
if (isset($aData) && !in_array($_SESSION['USER_LOGGED'], $aData)) {
$viewSteps = false;
}
}
break;
default:
$aData = AppDelegation::getCurrentUsers($_SESSION['APPLICATION'], $_SESSION['INDEX']);
unset($_SESSION['bNoShowSteps']);
if (isset($aData) && !in_array($_SESSION['USER_LOGGED'], $aData)) {
$viewSteps = false;
}
break;
}
@@ -64,7 +76,9 @@ if ((($sStatus === 'DRAFT') || ($sStatus === 'TO_DO')) && !$statusSendAndUnassig
if (isset($_SESSION['bNoShowSteps'])) {
unset($_SESSION['bNoShowSteps']);
} else {
$G_TMP_MENU->AddIdOption('STEPS', G::LoadTranslation('ID_STEPS'), 'javascript:showSteps();', 'absolute');
if ($viewSteps === true) {
$G_TMP_MENU->AddIdOption('STEPS', G::LoadTranslation('ID_STEPS'), 'javascript:showSteps();', 'absolute');
}
$G_TMP_MENU->AddIdOption('INFO', G::LoadTranslation('ID_INFORMATION'), 'javascript:showInformation();', 'absolute');
}
$G_TMP_MENU->AddIdOption('ACTIONS', G::LoadTranslation('ID_ACTIONS'), 'javascript:showActions();', 'absolute');

View File

@@ -202,10 +202,10 @@ if ($RBAC->userCanAccess('PM_SETUP_ADVANCE') === 1 && $RBAC->userCanAccess('PM_U
}
if ($RBAC->userCanAccess('PM_SETUP') === 1 && $RBAC->userCanAccess('PM_SETUP_LOGS') === 1) {
$G_TMP_MENU->AddIdRawOption('EVENT', '../events/eventList', G::LoadTranslation('ID_EVENTS'), '', '', 'logs');
$G_TMP_MENU->AddIdRawOption('EVENT', '../events/eventList', G::LoadTranslation('ID_EVENTS_CLASSIC'), '', '', 'logs');
$G_TMP_MENU->AddIdRawOption(
'LOG_CASE_SCHEDULER', '../cases/cases_Scheduler_Log',
G::LoadTranslation('ID_CASE_SCHEDULER'),
G::LoadTranslation('ID_CASE_SCHEDULER_CLASSIC'),
"icon-logs-list.png", '', 'logs'
);
$G_TMP_MENU->AddIdRawOption("CRON", "../setup/cron", G::LoadTranslation("ID_CRON_ACTIONS"), null, null, 'logs');

View File

@@ -263,7 +263,7 @@ if ($sStatus == '1') {
$oAdditionalTables->createPropelClasses($tableName, $sClassName, $aFieldsClases, $sTasUid);
} else {
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
@unlink($sPath . $sClassName . '.php');
@unlink($sPath . $sClassName . 'Peer.php');
@unlink($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName . 'MapBuilder.php');

View File

@@ -101,8 +101,6 @@ if ($actionAjax == 'messageHistoryGridList_JXP') {
if ($respMess == 'BLOCK' || $respMess == '') {
$appMessageArray[$index]['APP_MSG_BODY'] = "";
}
$appMessageArray[$index]['APP_MSG_BODY'] = str_replace('\"','"',$appMessageArray[$index]['APP_MSG_BODY']);
$appMessageArray[$index]['APP_MSG_BODY'] = str_replace('"','\"',$appMessageArray[$index]['APP_MSG_BODY']);
$aProcesses[] = array_merge($appMessageArray[$index], array('MSGS_HISTORY' => $respMess));
$totalCount ++;
}

View File

@@ -71,7 +71,7 @@ while ($rsSql->next()) {
}
if (count($arrayTabItem) > 0) {
$urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . SYS_SYS . '/consolidated/';
$urlProxy = System::getHttpServerHostnameRequestsFrontEnd() . '/api/1.0/' . config("system.workspace") . '/consolidated/';
$clientId = 'x-pm-local-client';
$client = getClientCredentials($clientId);
$authCode = getAuthorizationCode($client);

View File

@@ -176,9 +176,9 @@ if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjB
if (isset($_COOKIE['dashboardListInbox'])) {
$oHeadPublisher->assign('valueFilterStatus', $_COOKIE['dashboardListInbox']);
if (PHP_VERSION < 5.2) {
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, "; HttpOnly");
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
} else {
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);
setcookie("dashboardListInbox", '', time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false, true);
}
}
}

View File

@@ -142,8 +142,8 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
if($res->status == 0){
$message = $res->message;
G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}
@@ -156,8 +156,8 @@ if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
if ($inpDocMaxFilesize > 0 && $fileSizeByField > 0) {
if ($fileSizeByField > $inpDocMaxFilesize) {
G::SendMessageText(G::LoadTranslation("ID_SIZE_VERY_LARGE_PERMITTED"), "ERROR");
$arrayAux1 = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . SYS_SYS . $arrayAux1[1]);
$arrayAux1 = explode("sys" . config("system.workspace"), $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . config("system.workspace") . $arrayAux1[1]);
exit(0);
}
}

View File

@@ -54,8 +54,8 @@ if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME']
break;
}
G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}
@@ -106,8 +106,8 @@ if(isset($_FILES["form"]["name"]["APP_DOC_FILENAME"]) && isset($_FILES["form"]["
if($res->status == 0){
$message = $res->message;
G::SendMessageText( $message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}
@@ -134,8 +134,8 @@ if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
} catch (Exception $e) {
G::SendMessageText($e->getMessage(), "ERROR");
$arrayAux = explode("sys" . SYS_SYS, $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . SYS_SYS . $arrayAux[1]);
$arrayAux = explode("sys" . config("system.workspace"), $_SERVER["HTTP_REFERER"]);
G::header("location: /sys" . config("system.workspace") . $arrayAux[1]);
exit(0);
}
}

View File

@@ -40,7 +40,7 @@ if (G::is_https()) {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$client = new SoapClient($endpoint, $streamContext);
$user = $sWS_USER;

View File

@@ -109,8 +109,8 @@ if (! $sw_file_exists) {
print G::json_encode( $res );
} else {
G::SendMessageText( $error_message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}

View File

@@ -122,8 +122,8 @@ if (!$sw_file_exists) {
print G::json_encode( $res );
} else {
G::SendMessageText( $error_message, "ERROR" );
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj = explode( "sys" . config("system.workspace"), $_SERVER['HTTP_REFERER'] );
G::header( "location: " . "/sys" . config("system.workspace") . $backUrlObj[1] );
die();
}
@@ -159,7 +159,7 @@ if (!$sw_file_exists) {
}
/*----------------------------------********---------------------------------*/
if (!$downloadStatus) {
G::streamFile( $realPath, $download, $nameFile); //download
G::streamFile( $realPath, $download, G::inflect($nameFile)); //download
}
}
}

View File

@@ -29,7 +29,7 @@ $oHeadPublisher->addExtJsScript( "cases/main", false ); //Adding a javascript fi
$oHeadPublisher->addContent( "cases/main" ); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = &PMmemcached::getSingleton( SYS_SYS );
$memcache = &PMmemcached::getSingleton( config("system.workspace") );
if (($arrayConfig = $memcache->get( $keyMem )) === false) {
$conf->loadConfig( $x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "" );

View File

@@ -29,7 +29,7 @@
*/
$tBarGmail = false;
if(isset( $_GET['gmail']) && $_GET['gmail'] == 1){
if (isset($_GET['gmail']) && $_GET['gmail'] == 1) {
$_SESSION['gmail'] = 1;
$tBarGmail = true;
}
@@ -42,7 +42,7 @@ if (!isset($_GET['APP_UID']) && !isset($_GET['APP_NUMBER']) && !isset($_GET['DEL
if (!isset($_GET['APP_UID']) && isset($_GET['APP_NUMBER'])) {
$oCase = new Cases();
$appUid = $oCase->getApplicationUIDByNumber(htmlspecialchars($_GET['APP_NUMBER']));
if (is_null( $appUid )) {
if (is_null($appUid)) {
throw new Exception(G::LoadTranslation('ID_CASE_DOES_NOT_EXISTS'));
}
} else {
@@ -52,7 +52,7 @@ if (!isset($_GET['APP_UID']) && isset($_GET['APP_NUMBER'])) {
if (!isset($_GET['DEL_INDEX'])) {
$oCase = new Cases();
$delIndex = $oCase->getCurrentDelegation($appUid, $_SESSION['USER_LOGGED']);
if (is_null( $delIndex )) {
if (is_null($delIndex)) {
throw new Exception(G::LoadTranslation('ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER'));
}
$_GET['DEL_INDEX'] = $delIndex;
@@ -65,7 +65,7 @@ $tasUid = (isset($_GET['TAS_UID'])) ? $tasUid = htmlspecialchars($_GET['TAS_UID'
$oCase = new Cases();
$conf = new Configurations();
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher = &headPublisher::getSingleton();
$urlToRedirectAfterPause = 'casesListExtJs';
@@ -75,34 +75,34 @@ if ($licensedFeatures->verifyfeature('7qhYmF1eDJWcEdwcUZpT0k4S0xTRStvdz09')) {
$pmGoogle = new PmGoogleApi();
if (array_key_exists('gmail', $_SESSION) && $_SESSION['gmail'] == 1 && $pmGoogle->getServiceGmailStatus()) {
$_SESSION['gmail'] = 0;
$urlToRedirectAfterPause = '/sys'. $_SESSION['WORKSPACE'] .'/en/neoclassic/cases/cases_Open?APP_UID='.$_SESSION['APPLICATION'].'&DEL_INDEX='.$_SESSION['INDEX'].'&action=sent';
$urlToRedirectAfterPause = '/sys' . $_SESSION['WORKSPACE'] . '/en/neoclassic/cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=sent';
}
}
/*----------------------------------********---------------------------------*/
$oHeadPublisher->assign( 'urlToRedirectAfterPause', $urlToRedirectAfterPause );
$oHeadPublisher->assign('urlToRedirectAfterPause', $urlToRedirectAfterPause);
$oHeadPublisher->addExtJsScript( 'app/main', true );
$oHeadPublisher->addExtJsScript( 'cases/open', true );
$oHeadPublisher->assign( 'FORMATS', $conf->getFormats() );
$oHeadPublisher->addExtJsScript('app/main', true);
$oHeadPublisher->addExtJsScript('cases/open', true);
$oHeadPublisher->assign('FORMATS', $conf->getFormats());
$uri = '';
foreach ($_GET as $k => $v) {
$uri .= ($uri == '') ? "$k=$v" : "&$k=$v";
}
if( isset($_GET['action']) && ($_GET['action'] == 'jump') ) {
if (isset($_GET['action']) && ($_GET['action'] == 'jump')) {
$oNewCase = new \ProcessMaker\BusinessModel\Cases();
//We need to get the last index OPEN or CLOSED (by Paused cases)
//Set true because we need to check if the case is paused
$delIndex = $oNewCase->getOneLastThread($appUid, true);
$case = $oCase->loadCase( $appUid, $delIndex, $_GET['action']);
$case = $oCase->loadCase($appUid, $delIndex, $_GET['action']);
} else {
$case = $oCase->loadCase( $appUid, $delIndex );
$case = $oCase->loadCase($appUid, $delIndex);
}
if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') ){
if (isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise')) {
$oSupervisor = new \ProcessMaker\BusinessModel\ProcessSupervisor();
$caseCanBeReview = $oSupervisor->reviewCaseStatusForSupervisor($appUid, $delIndex);
//Check if the case has the correct status for update the information from supervisor/review
@@ -112,9 +112,9 @@ if(isset($_GET['actionFromList']) && ($_GET['actionFromList'] === 'to_revise') )
} else {
//The supervisor can edit the information, the case are in TO_DO
$script = 'cases_OpenToRevise?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex . '&TAS_UID=' . $tasUid;
$oHeadPublisher->assign( 'treeToReviseTitle', G::loadtranslation( 'ID_STEP_LIST' ) );
$oHeadPublisher->assign('treeToReviseTitle', G::loadtranslation('ID_STEP_LIST'));
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
$oHeadPublisher->assign('casesPanelUrl', $casesPanelUrl); //translations
echo "<div id='toReviseTree'></div>";
}
} else {
@@ -133,24 +133,24 @@ while ($ds->next()) {
$bpmnProjects[] = $row['PRJ_UID'];
}
$oStep = new Step();
$oStep = $oStep->loadByProcessTaskPosition( $case['PRO_UID'], $case['TAS_UID'], 1 );
$oHeadPublisher->assign( 'uri', $script . $uri );
$oHeadPublisher->assign( '_APP_NUM', '#: ' . $case['APP_NUMBER'] );
$oHeadPublisher->assign( '_PROJECT_TYPE', in_array($case['PRO_UID'], $bpmnProjects) ? 'bpmn' : 'classic' );
$oHeadPublisher->assign( '_PRO_UID', $case['PRO_UID']);
$oHeadPublisher->assign( '_APP_UID', $appUid);
$oHeadPublisher->assign( '_ENV_CURRENT_DATE', $conf->getSystemDate( date( 'Y-m-d' ) ) );
$oHeadPublisher->assign( '_ENV_CURRENT_DATE_NO_FORMAT', date( 'Y-m-d-h-i-A' ) );
$oHeadPublisher->assign( 'idfirstform', is_null( $oStep ) ? '' : $oStep->getStepUidObj() );
$oHeadPublisher->assign( 'appStatus', $case['APP_STATUS'] );
$oHeadPublisher->assign( 'tbarGmail', $tBarGmail);
$oStep = $oStep->loadByProcessTaskPosition($case['PRO_UID'], $case['TAS_UID'], 1);
$oHeadPublisher->assign('uri', $script . $uri);
$oHeadPublisher->assign('_APP_NUM', '#: ' . $case['APP_NUMBER']);
$oHeadPublisher->assign('_PROJECT_TYPE', in_array($case['PRO_UID'], $bpmnProjects) ? 'bpmn' : 'classic');
$oHeadPublisher->assign('_PRO_UID', $case['PRO_UID']);
$oHeadPublisher->assign('_APP_UID', $appUid);
$oHeadPublisher->assign('_ENV_CURRENT_DATE', $conf->getSystemDate(date('Y-m-d')));
$oHeadPublisher->assign('_ENV_CURRENT_DATE_NO_FORMAT', date('Y-m-d-h-i-A'));
$oHeadPublisher->assign('idfirstform', is_null($oStep) ? '-1' : $oStep->getStepUidObj());
$oHeadPublisher->assign('appStatus', $case['APP_STATUS']);
$oHeadPublisher->assign('tbarGmail', $tBarGmail);
if(!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
if (!isset($_SESSION['APPLICATION']) || !isset($_SESSION['TASK']) || !isset($_SESSION['INDEX'])) {
$_SESSION['PROCESS'] = $case['PRO_UID'];
$_SESSION['APPLICATION'] = $case['APP_UID'];
$_SESSION['TASK'] = $case['TAS_UID'];
$_SESSION['INDEX'] = $case['DEL_INDEX'];
}
$_SESSION['actionCaseOptions'] = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
G::RenderPage( 'publish', 'extJs' );
G::RenderPage('publish', 'extJs');

View File

@@ -9,7 +9,7 @@ $oHeadPublisher = &headPublisher::getSingleton();
if (isset($licenseManager->date) && is_array($licenseManager->date)) {
$conf = new Configurations();
if ( defined('SYS_SYS') && $conf->exists("ENVIRONMENT_SETTINGS")) {
if (!empty(config("system.workspace")) && $conf->exists("ENVIRONMENT_SETTINGS")) {
$licenseManager->date['START'] = date("Y-m-d H:i:s", strtotime($licenseManager->date['HUMAN']['START']));
$licenseManager->date['END'] = date("Y-m-d H:i:s", strtotime($licenseManager->date['HUMAN']['END']));
$licenseManager->date['START'] = $conf->getSystemDate($licenseManager->date['START']);
@@ -63,7 +63,7 @@ $oHeadPublisher->assign("supportStartDate", (isset($licenseManager->supportStart
$oHeadPublisher->assign("supportEndDate", (isset($licenseManager->supportEndDate))? $licenseManager->supportEndDate : '');
$oHeadPublisher->assign("PROCESSMAKER_VERSION", System::getVersion());
$oHeadPublisher->assign("PROCESSMAKER_URL", "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN );
$oHeadPublisher->assign("PROCESSMAKER_URL", "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN );
$oHeadPublisher->assign("SYS_SKIN", SYS_SKIN);
$oHeadPublisher->assign("URL_PART_LOGIN", ((substr(SYS_SKIN, 0, 2) == "ux" && SYS_SKIN != "uxs")? "main/login" : "login/login"));
$oHeadPublisher->assign("URL_PART_SETUP", EnterpriseUtils::getUrlPartSetup());

View File

@@ -160,7 +160,7 @@ try {
}
///////
$workspace = SYS_SYS;
$workspace = config("system.workspace");
$dbAdapter = DB_ADAPTER;
$addon->setAddonState("download-start");

View File

@@ -8,7 +8,7 @@ if (!defined("PATH_PM_ENTERPRISE")) {
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . config("system.workspace") . "/");
}
set_include_path(PATH_PM_ENTERPRISE . PATH_SEPARATOR . get_include_path());
@@ -78,12 +78,10 @@ class enterprisePlugin extends PMPlugin
unset($_SESSION["__EE_SW_PMLICENSEMANAGER__"]);
///////
$js = "window.open(\"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PLUGINS\", \"_top\", \"\");";
$js = "window.open(\"/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main?s=PLUGINS\", \"_top\", \"\");";
if (substr(SYS_SKIN, 0, 2) == "ux" && SYS_SKIN != "uxs") {
//$js = "parent.window.location.href = \"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/main_init?s=PLUGINS\";";
//$js = "window.location.href = \"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/setup/pluginsImport\";";
$js = "window.open(\"/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/main\", \"_top\", \"\");";
$js = "window.open(\"/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/main\", \"_top\", \"\");";
}
///////

View File

@@ -63,7 +63,7 @@ function install($file)
$context = stream_context_create($option);
///////
$fileData = @fopen(EnterpriseUtils::getUrlServerName() . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/enterprise/services/processMakerUpgrade", "rb", false, $context);
$fileData = @fopen(EnterpriseUtils::getUrlServerName() . "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN . "/enterprise/services/processMakerUpgrade", "rb", false, $context);
if ($fileData === false) {
throw (new Exception("Could not open services url."));

View File

@@ -146,7 +146,7 @@ try {
$errLabel = G::LoadTranslation('ID_ACCOUNT') . ' "' . $usr . '" ' . G::LoadTranslation('ID_ACCOUNT_DISABLED_CONTACT_ADMIN');
}
//Log failed authentications
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS;
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . config("system.workspace");
$message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'];
G::log($message, PATH_DATA, 'loginFailed.log');
@@ -171,7 +171,7 @@ try {
}
if (!isset( $_SESSION['WORKSPACE'] ) ) {
$_SESSION['WORKSPACE'] = SYS_SYS;
$_SESSION['WORKSPACE'] = config("system.workspace");
}
//Execute the SSO Script from plugin
@@ -246,7 +246,7 @@ try {
$userTimeZone = $user->getUsrTimeZone();
if (trim($userTimeZone) == '') {
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
$userTimeZone = $arraySystemConfiguration['time_zone'];
}
@@ -407,7 +407,7 @@ try {
die;
}
$configS = System::getSystemConfiguration('', '', SYS_SYS);
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block']:true;
if ($activeSession){
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');

View File

@@ -20,7 +20,7 @@ try {
}
header(
'Location: /sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN .
'Location: /sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN .
'/login/login' . (($u != '')? '?u=' . $u : '')
);
@@ -40,7 +40,7 @@ try {
}
/*----------------------------------********---------------------------------*/
$arraySystemConfiguration = System::getSystemConfiguration('', '', SYS_SYS);
$arraySystemConfiguration = System::getSystemConfiguration('', '', config("system.workspace"));
//Set User Time Zone
$user = UsersPeer::retrieveByPK($userUid);

View File

@@ -188,9 +188,9 @@ session_start();
session_regenerate_id();
if (PHP_VERSION < 5.2) {
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . SYS_SYS, "; HttpOnly");
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), "; HttpOnly");
} else {
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . SYS_SYS, null, false, true);
setcookie("workspaceSkin", SYS_SKIN, time() + (24 * 60 * 60), "/sys" . config("system.workspace"), null, false, true);
}
if (strlen($msg) > 0) {
@@ -361,7 +361,7 @@ $flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])
setcookie('PM-Warning', trim(G::LoadTranslation('ID_BLOCKER_MSG'), '*'), time() + (24 * 60 * 60), SYS_URI);
$configS = System::getSystemConfiguration('', '', SYS_SYS);
$configS = System::getSystemConfiguration('', '', config("system.workspace"));
$activeSession = isset($configS['session_block']) ? !(int)$configS['session_block'] : true;
if ($activeSession) {
setcookie("PM-TabPrimary", 101010010, time() + (24 * 60 * 60), '/');

View File

@@ -9,7 +9,7 @@ if (! empty($_GET['error'])) {
$http = G::is_https() ? 'https' : 'http';
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, SYS_SYS);
$endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, config("system.workspace"));
$code = empty($_GET['code']) ? 'NN' : $_GET['code'];
$clientId = 'x-pm-local-client';

View File

@@ -19,7 +19,7 @@ class AdditionalTablesConsolidated extends AdditionalTables
$sClassName = $this->getPHPName($sTableName);
}
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
if (!file_exists($sPath)) {
G::mk_dir($sPath);
G::mk_dir($sPath . 'map');
@@ -626,7 +626,7 @@ class ajax_con extends WebResource
$oAdditionalTables->createPropelClasses($tableName, $sClassName, $aFieldsClases, $sTasUid);
} else {
$sPath = PATH_DB . SYS_SYS . PATH_SEP . 'classes' . PATH_SEP;
$sPath = PATH_DB . config("system.workspace") . PATH_SEP . 'classes' . PATH_SEP;
@unlink($sPath . $sClassName . '.php');
@unlink($sPath . $sClassName . 'Peer.php');
@unlink($sPath . PATH_SEP . 'map' . PATH_SEP . $sClassName . 'MapBuilder.php');

View File

@@ -92,7 +92,7 @@ $oHeadPublisher->assign("arrayContextMenuOptionPlugin", $arrayContextMenuOptionP
$oHeadPublisher->assign('extJsViewState', $oHeadPublisher->getExtJsViewState());
$designer = new Designer();
$oHeadPublisher->assign('SYS_SYS', SYS_SYS);
$oHeadPublisher->assign('SYS_SYS', config("system.workspace"));
$oHeadPublisher->assign('SYS_LANG', SYS_LANG);
$oHeadPublisher->assign('SYS_SKIN', SYS_SKIN);
$oHeadPublisher->assign('HTTP_SERVER_HOSTNAME', System::getHttpServerHostnameRequestsFrontEnd());

View File

@@ -33,8 +33,6 @@ $oProcess = new Process();
$oProcess->dir = $dir;
$oProcess->sort = $sort;
//$memcache = & PMmemcached::getSingleton( SYS_SYS );
$memkey = 'no memcache';
$memcacheUsed = 'not used';
$totalCount = 0;

View File

@@ -189,13 +189,13 @@ try {
$filter = new InputFilter();
$form = $_REQUEST;
$filePath = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'];
$filePath = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . $form['FILENAME'];
if (file_exists($filePath)) {
unlink($filter->validateInput($filePath, 'path'));
$webEntry = new \ProcessMaker\BusinessModel\WebEntry();
$webEntry->deleteClassic($form['PRO_UID'], $filePath);
}
$filePath = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php";
$filePath = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "public" . PATH_SEP . $form['PRO_UID'] . PATH_SEP . str_replace(".php", "Post", $form['FILENAME']) . ".php";
if (file_exists($filePath)) {
unlink($filter->validateInput($filePath, 'path'));
}
@@ -900,8 +900,8 @@ try {
$resultArray = array();
$proUid = isset($_REQUEST['PRO_UID']) ? $_REQUEST['PRO_UID'] : '';
$dynUid = isset($_REQUEST['DYN_UID']) ? $_REQUEST['DYN_UID'] : '';
if (is_file(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . SYS_SYS . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
if (is_file(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') && filesize(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml') > 0) {
$dyn = new DynaformHandler(PATH_DATA . '/sites/' . config("system.workspace") . '/xmlForms/' . $proUid . '/' . $dynUid . '.xml');
$dynaformFields[] = $dyn->getFields();
}
foreach ($dynaformFields as $aDynFormFields) {

View File

@@ -6,7 +6,7 @@ if (!isset($_GET["file_hash"])) {
}
$httpStream = new \ProcessMaker\Util\IO\HttpStream();
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$outputDir = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$fileName = urldecode(base64_decode($_GET["file_hash"]));
$processFile = $outputDir . $fileName;

View File

@@ -24,7 +24,7 @@
use ProcessMaker\Util\Common;
$response = new StdClass();
$outputDir = PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
$outputDir = PATH_DATA . "sites" . PATH_SEP . config("system.workspace") . PATH_SEP . "files" . PATH_SEP . "output" . PATH_SEP;
try {
if(empty($_GET)){

View File

@@ -1,18 +1,32 @@
<?php
switch ($_GET['MAIN_DIRECTORY']) {
global $RBAC;
$RBAC->allows(basename(__FILE__), $_GET['MAIN_DIRECTORY']);
$mainDirectory = !empty($_GET['MAIN_DIRECTORY']) ? $_GET['MAIN_DIRECTORY'] : '';
$proUid = !empty($_GET['PRO_UID']) ? $_GET['PRO_UID'] : '';
$currentDirectory = !empty($_GET['CURRENT_DIRECTORY']) ? realpath($_GET['CURRENT_DIRECTORY']) . PATH_SEP : '';
$file = !empty($_GET['FILE']) ? realpath($_GET['FILE']) : '';
$extension = (!empty($_GET['sFilextension']) && $_GET['sFilextension'] === 'javascript') ? '.js' : '';
//validated process exists, return throw if not exists.
$process = new Process();
$process->load($proUid);
switch ($mainDirectory) {
case 'mailTemplates':
$sDirectory = PATH_DATA_MAILTEMPLATES . $_GET['PRO_UID'] . PATH_SEP . ($_GET['CURRENT_DIRECTORY'] != '' ? $_GET['CURRENT_DIRECTORY'] . PATH_SEP : '');
$directory = PATH_DATA_MAILTEMPLATES;
break;
case 'public':
$sDirectory = PATH_DATA_PUBLIC . $_GET['PRO_UID'] . PATH_SEP . ($_GET['CURRENT_DIRECTORY'] != '' ? $_GET['CURRENT_DIRECTORY'] . PATH_SEP : '');
$directory = PATH_DATA_PUBLIC;
break;
default:
die();
break;
}
//fixed: added a file extension when is a javascript file by krlos
$_GET['FILE'] .= ($_GET['sFilextension'] != '' && $_GET['sFilextension'] == 'javascript') ? '.js' : '';
if (file_exists( $sDirectory . $_GET['FILE'] )) {
G::streamFile( $sDirectory . $_GET['FILE'], true );
$directory .= $proUid . PATH_SEP . $currentDirectory;
$file .= $extension;
if (file_exists($directory . $file)) {
G::streamFile($directory . $file, true);
}

View File

@@ -70,7 +70,7 @@ if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm
if (!empty($arrayTrigger)) {
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$strFoundDisabledCode = "";

View File

@@ -68,8 +68,8 @@ try {
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . 'processes' . PATH_SEP . 'webentryPost.tpl';
$template = new TemplatePower( $pluginTpl );
$template->prepare();
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'wsdlUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2' );
$template->assign( 'wsUploadUrl', $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/upload' );
$template->assign( 'processUid', $sPRO_UID );
$template->assign( 'dynaformUid', $sDYNAFORM );
$template->assign( 'taskUid', $sTASKS );
@@ -88,7 +88,7 @@ try {
$template->assign( 'dynaform', $dynTitle );
$template->assign( 'timestamp', date( 'l jS \of F Y h:i:s A' ) );
$template->assign( 'ws', SYS_SYS );
$template->assign( 'ws', config("system.workspace") );
$template->assign( 'version', System::getVersion() );
$fileName = $pathProcess . $dynTitle . 'Post.php';
@@ -134,13 +134,13 @@ try {
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update( $aDataEvent );
//Show link
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sPRO_UID . '/' . $dynTitle . '.php';
print $link;
//print "\n<a href='$link' target='_new' > $link </a>";
} else {
$G_FORM = new Form( $sPRO_UID . '/' . $sDYNAFORM, PATH_DYNAFORM, SYS_LANG, false );
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
$G_FORM->action = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/cases_StartExternal.php';
$scriptCode = '';
$scriptCode = $G_FORM->render( PATH_CORE . 'templates/' . 'xmlform' . '.html', $scriptCode );
@@ -158,7 +158,7 @@ try {
$template->assign("URL_MABORAK_JS", G::browserCacheFilesUrl("/js/maborak/core/maborak.js"));
$template->assign("URL_TRANSLATION_ENV_JS", G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]);
$template->assign("sysSys", SYS_SYS);
$template->assign("sysSys", config("system.workspace"));
$template->assign("sysLang", SYS_LANG);
$template->assign("sysSkin", SYS_SKIN);
$template->assign("processUid", $sPRO_UID);

View File

@@ -29,7 +29,7 @@ if (G::is_https()) {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$client = new SoapClient( $endpoint, $streamContext );
$user = $sWS_USER;

View File

@@ -14,7 +14,7 @@ if (G::is_https())
else
$http = 'http://';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . config("system.workspace") . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@$client = new SoapClient( $endpoint );
$oTask = new Task();

View File

@@ -60,363 +60,314 @@ class ldapadvancedClassCron
$aDepartments = $plugin->getDepartments("");
$aGroups = $plugin->getGroups();
//$arrayDepartmentUserAd = array(); //(D) Update Users
//$arrayGroupUserAd = array(); //(G) Update Users
//echo "\n";
$plugin->frontEndShow("START");
$plugin->debugLog("START");
foreach ($arrayAuthenticationSource as $value) {
$arrayAuthenticationSourceData = $value;
try {
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$arrayAuthenticationSourceData ---->\n" . print_r($arrayAuthenticationSourceData, true));
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$arrayAuthenticationSourceData ---->\n" . print_r($arrayAuthenticationSourceData, true));
$plugin->sAuthSource = $arrayAuthenticationSourceData["AUTH_SOURCE_UID"];
$plugin->ldapcnn = null;
$plugin->sAuthSource = $arrayAuthenticationSourceData["AUTH_SOURCE_UID"];
$plugin->ldapcnn = null;
$plugin->setArrayDepartmentUserSynchronizedChecked(array());
$plugin->setArrayUserUpdateChecked(array());
$plugin->setArrayDepartmentUserSynchronizedChecked(array());
$plugin->setArrayUserUpdateChecked(array());
//Get all User (USR_UID, USR_USERNAME, USR_AUTH_USER_DN) registered in RBAC with this Authentication Source
$plugin->setArrayAuthenticationSourceUsers($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]); //INITIALIZE DATA
//Get all User (USR_UID, USR_USERNAME, USR_AUTH_USER_DN) registered in RBAC with this Authentication Source
$plugin->setArrayAuthenticationSourceUsers($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]); //INITIALIZE DATA
$plugin->frontEndShow("TEXT", "Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
$plugin->frontEndShow("TEXT", "Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
$plugin->log(null, "Executing cron for Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
$plugin->log(null, "Executing cron for Authentication Source: " . $arrayAuthenticationSourceData["AUTH_SOURCE_NAME"]);
//Get all departments from Ldap/ActiveDirectory and build a hierarchy using dn (ou->ou parent)
$aLdapDepts = $plugin->searchDepartments();
//Get all departments from Ldap/ActiveDirectory and build a hierarchy using dn (ou->ou parent)
$aLdapDepts = $plugin->searchDepartments();
//Obtain all departments from PM with a valid department in LDAP/ActiveDirectory
$aRegisteredDepts = $plugin->getRegisteredDepartments($aLdapDepts, $aDepartments);
//Obtain all departments from PM with a valid department in LDAP/ActiveDirectory
$aRegisteredDepts = $plugin->getRegisteredDepartments($aLdapDepts, $aDepartments);
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredDepts ---->\n" . print_r($aRegisteredDepts, true));
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredDepts ---->\n" . print_r($aRegisteredDepts, true));
//Get all group from Ldap/ActiveDirectory
$aLdapGroups = $plugin->searchGroups();
//Get all group from Ldap/ActiveDirectory
$aLdapGroups = $plugin->searchGroups();
//Obtain all groups from PM with a valid group in LDAP/ActiveDirectory
$aRegisteredGroups = $plugin->getRegisteredGroups($aLdapGroups, $aGroups);
//Obtain all groups from PM with a valid group in LDAP/ActiveDirectory
$aRegisteredGroups = $plugin->getRegisteredGroups($aLdapGroups, $aGroups);
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredGroups ---->\n" . print_r($aRegisteredGroups, true));
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$aRegisteredGroups ---->\n" . print_r($aRegisteredGroups, true));
//Get all users from Removed OU
$this->usersRemovedOu = $plugin->getUsersFromRemovedOu($arrayAuthenticationSourceData);
$plugin->deactiveArrayOfUsers($this->usersRemovedOu);
//Get all users from Removed OU
$this->usersRemovedOu = $plugin->getUsersFromRemovedOu($arrayAuthenticationSourceData);
$plugin->deactiveArrayOfUsers($this->usersRemovedOu);
//Variables
$this->deletedRemoved = count($this->usersRemovedOu);
$this->deletedRemovedUsers = "";
//Variables
$this->deletedRemoved = count($this->usersRemovedOu);
$this->deletedRemovedUsers = "";
$this->dAlready = 0;
$this->dMoved = 0;
$this->dImpossible = 0;
$this->dCreated = 0;
$this->dRemoved = 0;
$this->dAlreadyUsers = "";
$this->dMovedUsers = "";
$this->dImpossibleUsers = "";
$this->dCreatedUsers = "";
$this->dRemovedUsers = "";
$this->dAlready = 0;
$this->dMoved = 0;
$this->dImpossible = 0;
$this->dCreated = 0;
$this->dRemoved = 0;
$this->dAlreadyUsers = "";
$this->dMovedUsers = "";
$this->dImpossibleUsers = "";
$this->dCreatedUsers = "";
$this->dRemovedUsers = "";
$this->gAlready = 0;
$this->gMoved = 0;
$this->gImpossible = 0;
$this->gCreated = 0;
$this->gRemoved = 0;
$this->gAlreadyUsers = "";
$this->gMovedUsers = "";
$this->gImpossibleUsers = "";
$this->gCreatedUsers = "";
$this->gRemovedUsers = "";
$this->gAlready = 0;
$this->gMoved = 0;
$this->gImpossible = 0;
$this->gCreated = 0;
$this->gRemoved = 0;
$this->gAlreadyUsers = "";
$this->gMovedUsers = "";
$this->gImpossibleUsers = "";
$this->gCreatedUsers = "";
$this->gRemovedUsers = "";
//Department - Synchronize Users
$numDepartments = count($aRegisteredDepts);
$count = 0;
//Department - Synchronize Users
$numDepartments = count($aRegisteredDepts);
$count = 0;
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numDepartments ----> $numDepartments");
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numDepartments ----> $numDepartments");
foreach ($aRegisteredDepts as $registeredDept) {
$count++;
//(D) Update Users
//if (!isset($arrayDepartmentUserAd[$registeredDept["DEP_UID"]])) {
// $arrayDepartmentUserAd[$registeredDept["DEP_UID"]] = array(); //Current users in department based in Active Directory
//}
//
//$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
//$arrayAux = array_merge($arrayDepartmentUserAd[$registeredDept["DEP_UID"]], $arrayAux);
//
//$arrayDepartmentUserAd[$registeredDept["DEP_UID"]] = array_unique($arrayAux);
$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
}
//Department - Print log
$logResults = sprintf(
"- Departments -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
$this->dAlready,
$this->dMoved,
$this->dImpossible,
$this->dCreated,
$this->dRemoved
);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
//Group - Synchronize Users
$numGroups = count($aRegisteredGroups);
$count = 0;
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numGroups ----> $numGroups");
foreach ($aRegisteredGroups as $registeredGroup) {
$count++;
//(G) Update Users
//if (!isset($arrayGroupUserAd[$registeredGroup["GRP_UID"]])) {
// $arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array(); //Current users in group based in Active Directory
//}
//
//$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
//$arrayAux = array_merge($arrayGroupUserAd[$registeredGroup["GRP_UID"]], $arrayAux);
//
//$arrayGroupUserAd[$registeredGroup["GRP_UID"]] = array_unique($arrayAux);
$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
}
//Group - Print log
$logResults = sprintf(
"- Groups -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
$this->gAlready,
$this->gMoved,
$this->gImpossible,
$this->gCreated,
$this->gRemoved
);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
//Manager
$plugin->clearManager($this->managersToClear);
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"] as $departmentUID) {
// Delete manager assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete department assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::DEP_UID, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$this->dMoved += UsersPeer::doCount($criteriaWhere);
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
}
foreach ($aRegisteredDepts as $registeredDept) {
$count++;
$arrayAux = $this->departmentSynchronizeUsers($plugin, $numDepartments, $count, $registeredDept);
}
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"]);
//Department - Print log
$logResults = sprintf(
"- Departments -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
$this->dAlready,
$this->dMoved,
$this->dImpossible,
$this->dCreated,
$this->dRemoved
);
$rbac = &RBAC::getSingleton();
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
}
$plugin->frontEndShow("TEXT", $logResults);
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"] as $groupUID) {
// Delete manager assignments
$groupsInstance = new Groups();
$criteria = $groupsInstance->getUsersGroupCriteria($groupUID);
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$users = array();
$plugin->log(null, $logResults);
while ($row = $dataset->getRow()) {
$users[] = $row["USR_UID"];
//Group - Synchronize Users
$numGroups = count($aRegisteredGroups);
$count = 0;
$plugin->debugLog("ldapadvanced.php > function executeCron() > foreach > \$numGroups ----> $numGroups");
foreach ($aRegisteredGroups as $registeredGroup) {
$count++;
$arrayAux = $this->groupSynchronizeUsers($plugin, $numGroups, $count, $registeredGroup);
}
//Group - Print log
$logResults = sprintf(
"- Groups -> Existing users: %d, moved: %d, impossible: %d, created: %d, removed: %d",
$this->gAlready,
$this->gMoved,
$this->gImpossible,
$this->gCreated,
$this->gRemoved
);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
//Manager
$plugin->clearManager($this->managersToClear);
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"] as $departmentUID) {
// Delete manager assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete department assignments
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::DEP_UID, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::DEP_UID, $departmentUID);
$this->dMoved += UsersPeer::doCount($criteriaWhere);
BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
}
}
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["DEPARTMENTS_TO_UNASSIGN"]);
$rbac = &RBAC::getSingleton();
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
}
if (isset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
if (is_array($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"])) {
foreach ($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"] as $groupUID) {
// Delete manager assignments
$groupsInstance = new Groups();
$criteria = $groupsInstance->getUsersGroupCriteria($groupUID);
$dataset = UsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
}
$users = array();
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::USR_UID, $users, Criteria::IN);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete group assignments
$criteria = new Criteria("workflow");
$criteria->add(GroupUserPeer::GRP_UID, $groupUID);
$this->gMoved += GroupUserPeer::doCount($criteria);
BasePeer::doDelete($criteria, Propel::getConnection("workflow"));
}
}
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"]);
$rbac = &RBAC::getSingleton();
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
}
// Delete the managers that not exists in PM
$criteria = new Criteria("rbac");
$criteria->addSelectColumn(RbacUsersPeer::USR_AUTH_USER_DN);
$criteria->add(RbacUsersPeer::USR_AUTH_USER_DN, "", Criteria::NOT_EQUAL);
$dataset = RbacUsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$existingUsers = array();
while ($row = $dataset->getRow()) {
$existingUsers[] = $row["USR_AUTH_USER_DN"];
$dataset->next();
}
foreach ($this->managersHierarchy as $managerDN => $subordinates) {
if (!in_array($managerDN, $existingUsers)) {
unset($this->managersHierarchy[$managerDN]);
}
}
// Get the managers assigments counters
$plugin->synchronizeManagers($this->managersHierarchy);
$deletedManagersAssignments = self::array_diff_assoc_recursive($this->oldManagersHierarchy, $this->managersHierarchy);
$newManagersAssignments = self::array_diff_assoc_recursive($this->managersHierarchy, $this->oldManagersHierarchy);
$deletedManagers = array();
$newManagers = array();
$movedManagers = array();
if (is_array($deletedManagersAssignments)) {
foreach ($deletedManagersAssignments as $dn1 => $subordinates1) {
foreach ($subordinates1 as $subordinate) {
if (!in_array($subordinate, $deletedManagers)) {
$deletedManagers[] = $subordinate;
}
foreach ($newManagersAssignments as $dn2 => $subordinates2) {
if (isset($subordinates2[$subordinate])) {
$movedManagers[] = $subordinate;
while ($row = $dataset->getRow()) {
$users[] = $row["USR_UID"];
$dataset->next();
}
$criteriaSet = new Criteria("workflow");
$criteriaSet->add(UsersPeer::USR_REPORTS_TO, "");
$criteriaWhere = new Criteria("workflow");
$criteriaWhere->add(UsersPeer::USR_UID, $users, Criteria::IN);
$criteriaWhere->add(UsersPeer::USR_REPORTS_TO, "", Criteria::NOT_EQUAL);
$this->deletedManager = BasePeer::doUpdate($criteriaWhere, $criteriaSet, Propel::getConnection("workflow"));
// Delete group assignments
$criteria = new Criteria("workflow");
$criteria->add(GroupUserPeer::GRP_UID, $groupUID);
$this->gMoved += GroupUserPeer::doCount($criteria);
BasePeer::doDelete($criteria, Propel::getConnection("workflow"));
}
}
unset($arrayAuthenticationSourceData["AUTH_SOURCE_DATA"]["GROUPS_TO_UNASSIGN"]);
$rbac = &RBAC::getSingleton();
$rbac->authSourcesObj->update($arrayAuthenticationSourceData);
}
}
if (is_array($newManagersAssignments)) {
foreach ($newManagersAssignments as $dn1 => $subordinates1) {
foreach ($subordinates1 as $subordinate) {
if (!in_array($subordinate, $newManagers)) {
$newManagers[] = $subordinate;
}
// Delete the managers that not exists in PM
$criteria = new Criteria("rbac");
$criteria->addSelectColumn(RbacUsersPeer::USR_AUTH_USER_DN);
$criteria->add(RbacUsersPeer::USR_AUTH_USER_DN, "", Criteria::NOT_EQUAL);
$dataset = RbacUsersPeer::doSelectRS($criteria);
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$dataset->next();
$existingUsers = array();
foreach ($deletedManagersAssignments as $dn2 => $subordinates2) {
if (isset($subordinates2[$subordinate])) {
if (!in_array($subordinate, $movedManagers)) {
while ($row = $dataset->getRow()) {
$existingUsers[] = $row["USR_AUTH_USER_DN"];
$dataset->next();
}
foreach ($this->managersHierarchy as $managerDN => $subordinates) {
if (!in_array($managerDN, $existingUsers)) {
unset($this->managersHierarchy[$managerDN]);
}
}
// Get the managers assigments counters
$plugin->synchronizeManagers($this->managersHierarchy);
$deletedManagersAssignments = self::array_diff_assoc_recursive($this->oldManagersHierarchy, $this->managersHierarchy);
$newManagersAssignments = self::array_diff_assoc_recursive($this->managersHierarchy, $this->oldManagersHierarchy);
$deletedManagers = array();
$newManagers = array();
$movedManagers = array();
if (is_array($deletedManagersAssignments)) {
foreach ($deletedManagersAssignments as $dn1 => $subordinates1) {
foreach ($subordinates1 as $subordinate) {
if (!in_array($subordinate, $deletedManagers)) {
$deletedManagers[] = $subordinate;
}
foreach ($newManagersAssignments as $dn2 => $subordinates2) {
if (isset($subordinates2[$subordinate])) {
$movedManagers[] = $subordinate;
}
}
}
}
}
if (is_array($newManagersAssignments)) {
foreach ($newManagersAssignments as $dn1 => $subordinates1) {
foreach ($subordinates1 as $subordinate) {
if (!in_array($subordinate, $newManagers)) {
$newManagers[] = $subordinate;
}
foreach ($deletedManagersAssignments as $dn2 => $subordinates2) {
if (isset($subordinates2[$subordinate])) {
if (!in_array($subordinate, $movedManagers)) {
$movedManagers[] = $subordinate;
}
}
}
}
}
}
//Print and log the users's information
//Deleted/Removed Users
$logResults = sprintf("- Deleted/Removed Users: %d", $this->deletedRemoved);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
if ($this->deletedRemoved > 0) {
$plugin->log(null, "Deleted/Removed Users: ");
$plugin->log(null, $this->deletedRemovedUsers);
}
if ($this->dAlready + $this->gAlready > 0) {
$plugin->log(null, "Existing Users: ");
$plugin->log(null, $this->dAlreadyUsers . " " . $this->gAlreadyUsers);
}
if ($this->dMoved + $this->gMoved > 0) {
$plugin->log(null, "Moved Users: ");
$plugin->log(null, $this->dMovedUsers . " " . $this->gMovedUsers);
}
if ($this->dImpossible + $this->gImpossible > 0) {
$plugin->log(null, "Impossible Users: ");
$plugin->log(null, $this->dImpossibleUsers . " " . $this->gImpossibleUsers);
}
if ($this->dCreated + $this->gCreated > 0) {
$plugin->log(null, "Created Users: ");
$plugin->log(null, $this->dCreatedUsers . " " . $this->gCreatedUsers);
}
if ($this->dRemoved + $this->gRemoved > 0) {
$plugin->log(null, "Removed Users: ");
$plugin->log(null, $this->dRemovedUsers . " " . $this->gRemovedUsers);
}
//Print and log the managers assignments"s information
$logResults = sprintf(
"- Managers assignments: created %d, moved %d, removed %d",
count($newManagers) - count($movedManagers),
count($movedManagers),
count($deletedManagers) - count($movedManagers) + $this->deletedManager
);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
//Update Users data based on the LDAP Server
$plugin->usersUpdateData($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]);
} catch (Exception $e) {
$context = Bootstrap::getDefaultContextLog();
$context["action"] = "ldapSynchronize";
$context["authSource"] = $arrayAuthenticationSourceData;
Bootstrap::registerMonolog("ldapSynchronize", 400, $e->getMessage(), $context, $context["workspace"], "processmaker.log");
}
//Print and log the users's information
//Deleted/Removed Users
$logResults = sprintf("- Deleted/Removed Users: %d", $this->deletedRemoved);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
if ($this->deletedRemoved > 0) {
$plugin->log(null, "Deleted/Removed Users: ");
$plugin->log(null, $this->deletedRemovedUsers);
}
if ($this->dAlready + $this->gAlready > 0) {
$plugin->log(null, "Existing Users: ");
$plugin->log(null, $this->dAlreadyUsers . " " . $this->gAlreadyUsers);
}
if ($this->dMoved + $this->gMoved > 0) {
$plugin->log(null, "Moved Users: ");
$plugin->log(null, $this->dMovedUsers . " " . $this->gMovedUsers);
}
if ($this->dImpossible + $this->gImpossible > 0) {
$plugin->log(null, "Impossible Users: ");
$plugin->log(null, $this->dImpossibleUsers . " " . $this->gImpossibleUsers);
}
if ($this->dCreated + $this->gCreated > 0) {
$plugin->log(null, "Created Users: ");
$plugin->log(null, $this->dCreatedUsers . " " . $this->gCreatedUsers);
}
if ($this->dRemoved + $this->gRemoved > 0) {
$plugin->log(null, "Removed Users: ");
$plugin->log(null, $this->dRemovedUsers . " " . $this->gRemovedUsers);
}
//Print and log the managers assignments"s information
$logResults = sprintf(
"- Managers assignments: created %d, moved %d, removed %d",
count($newManagers) - count($movedManagers),
count($movedManagers),
count($deletedManagers) - count($movedManagers) + $this->deletedManager
);
$plugin->frontEndShow("TEXT", $logResults);
$plugin->log(null, $logResults);
//Update Users data based on the LDAP Server
$plugin->usersUpdateData($arrayAuthenticationSourceData["AUTH_SOURCE_UID"]);
}
$plugin->frontEndShow("END");
//(D) Update Users
////Department //Upgrade users in departments
//foreach ($arrayDepartmentUserAd as $departmentUid => $arrayUserAd) {
// $plugin->setArrayDepartmentUsers($departmentUid); //INITIALIZE DATA
//
// $arrayAux = array_diff(array_keys($plugin->arrayDepartmentUsersByUid), $arrayUserAd);
//
// $this->departmentRemoveUsers($departmentUid, $arrayAux);
//}
//(G) Update Users
////Group //Upgrade users in groups
//foreach ($arrayGroupUserAd as $groupUid => $arrayUserAd) {
// $plugin->setArrayGroupUsers($groupUid); //INITIALIZE DATA
//
// $arrayAux = array_diff(array_keys($plugin->arrayGroupUsersByUid), $arrayUserAd);
//
// $this->groupRemoveUsers($groupUid, $arrayAux);
//}
//// Developed by Gary and Ronald
//$usersInfo = $plugin->ASUpdateInfo('');
//if (isset($usersInfo) && $usersInfo > 0) {
// $this->dMoved = $usersInfo;
//}
//// End Developed by Gary and Ronald
$plugin->debugLog("END");
}

View File

@@ -37,7 +37,7 @@ function AuthenticationBasicHTTP ($realm)
return false;
}
$realm = 'ProcessMaker Filesystem for Workspace ' . SYS_SYS;
$realm = 'ProcessMaker Filesystem for Workspace ' . config("system.workspace");
# Choice an authentification type Digest or Basic
//AuthenticationDigestHTTP($realm, $users, $phpcgi);

View File

@@ -6,7 +6,7 @@ $content = file_get_contents($filewsdl);
$http = G::is_https() ? 'https' : 'http';
$port = $_SERVER['SERVER_PORT'] === '80' ? '' : ':' . $_SERVER['SERVER_PORT'];
$lang = defined('SYS_LANG') ? SYS_LANG : 'en';
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . SYS_SYS . '/' . $lang . '/neoclassic/services/soap2';
$endpoint = $http . '://' . $_SERVER['SERVER_NAME'] . $port . '/sys' . config("system.workspace") . '/' . $lang . '/neoclassic/services/soap2';
$content = str_replace("___SOAP_ADDRESS___", $endpoint, $content);

View File

@@ -110,7 +110,7 @@ $response = array ();
switch ($option) {
case "LST":
$pageSize = $_REQUEST["pageSize"];
$workspace = SYS_SYS;
$workspace = config("system.workspace");
$action = $_REQUEST["action"];
$description = $_REQUEST["description"];
$dateFrom = $_REQUEST["dateFrom"];

View File

@@ -116,7 +116,7 @@ $response = array ();
switch ($option) {
case "LST":
$pageSize = $_REQUEST["pageSize"];
$workspace = SYS_SYS;
$workspace = config("system.workspace");
$status = $_REQUEST["status"];
$dateFrom = $_REQUEST["dateFrom"];
$dateTo = $_REQUEST["dateTo"];

View File

@@ -78,7 +78,7 @@ try {
$configuration = new Configurations();
$importResults = $language->import( $languageFile );
$renegerateContent = new WorkspaceTools( SYS_SYS );
$renegerateContent = new WorkspaceTools( config("system.workspace") );
$messs = $renegerateContent->upgradeContent();
$result->msg = G::LoadTranslation( 'IMPORT_LANGUAGE_SUCCESS' ) . "\n";

View File

@@ -19,7 +19,7 @@ switch ($request) {
print (G::json_encode( $result )) ;
break;
case 'saveSettings':
$memcache = & PMmemcached::getSingleton( defined( 'SYS_SYS' ) ? SYS_SYS : '' );
$memcache = & PMmemcached::getSingleton( !empty(config("system.workspace")) ? config("system.workspace") : '' );
$conf = new Configurations();
$conf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );

View File

@@ -56,7 +56,7 @@ if ($handle = opendir(PATH_PLUGINS)) {
) {
//Check disabled code
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = array_merge(
$cs->checkDisabledCode("FILE", PATH_PLUGINS . $pluginName . ".php"),

View File

@@ -251,7 +251,7 @@ try {
if (PMLicensedFeatures::getSingleton()->verifyfeature("B0oWlBLY3hHdWY0YUNpZEtFQm5CeTJhQlIwN3IxMEkwaG4=")) {
//Check disabled code
$cs = new CodeScanner(SYS_SYS);
$cs = new CodeScanner(config("system.workspace"));
$arrayFoundDisabledCode = array_merge($cs->checkDisabledCode("FILE", $path . $pluginFile), $cs->checkDisabledCode("PATH", $path . $sClassName));

View File

@@ -24,5 +24,5 @@
*/
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
$items = \PMPlugin::getListPluginsManager(SYS_SYS);
$items = \PMPlugin::getListPluginsManager(config("system.workspace"));
echo G::json_encode($items);

View File

@@ -30,7 +30,7 @@ $RBAC->requirePermissions( 'PM_SETUP' );
$headPublisher = & headPublisher::getSingleton();
$headPublisher->addExtJsScript( 'setup/pluginsMain', false );
$headPublisher->assign( "PROCESSMAKER_URL", "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN );
$headPublisher->assign( "PROCESSMAKER_URL", "/sys" . config("system.workspace") . "/" . SYS_LANG . "/" . SYS_SKIN );
$headPublisher->assign( "SYS_SKIN", SYS_SKIN );
$oPluginRegistry = PluginRegistry::loadSingleton();

Some files were not shown because too many files have changed in this diff Show More