This commit is contained in:
Roly Rudy Gutierrez Pinto
2016-09-09 11:09:02 -04:00
parent 82e48dd7e8
commit 6603cf1526
5 changed files with 50 additions and 27 deletions

View File

@@ -35,6 +35,13 @@ class G
const hashFile = 'md5_file'; const hashFile = 'md5_file';
const hashCrc = 'crc32'; const hashCrc = 'crc32';
public $sessionVar = array(); //SESSION temporary array store. public $sessionVar = array(); //SESSION temporary array store.
public static $sysSys;
public static $sysSkin;
public static $pathDataSite;
public static $pathDocument;
public static $memcachedEnabled;
public static $pathDataPublic;
public static $httpHost;
/** /**
* is_https * is_https

View File

@@ -48,7 +48,7 @@ class PMmemcached
public function __construct ($workspace) public function __construct ($workspace)
{ {
$this->enabled = MEMCACHED_ENABLED; $this->enabled = defined("MEMCACHED_ENABLED") ? MEMCACHED_ENABLED : \G::$memcachedEnabled;
$this->connected = false; $this->connected = false;
$this->workspace = $workspace; $this->workspace = $workspace;
if (class_exists( 'Memcached' )) { if (class_exists( 'Memcached' )) {
@@ -81,7 +81,7 @@ class PMmemcached
} }
} }
if (! MEMCACHED_ENABLED) { if (!$this->enabled) {
$this->connected = false; $this->connected = false;
return false; return false;
} }

View File

@@ -3252,18 +3252,24 @@ class workspaceTools
public function migrateIteeToDummytask($workspaceName){ public function migrateIteeToDummytask($workspaceName){
$this->initPropel(true); $this->initPropel(true);
if (!defined("SYS_SYS")) {
define("SYS_SYS", $workspaceName);
}
if (!defined("PATH_DATA_SITE")) {
define("PATH_DATA_SITE", PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP);
}
if (!defined("PATH_DOCUMENT")) {
define("PATH_DOCUMENT", PATH_DATA . 'sites' . DIRECTORY_SEPARATOR . $workspaceName . DIRECTORY_SEPARATOR . 'files');
}
$arraySystemConfiguration = System::getSystemConfiguration('', '', $workspaceName); $arraySystemConfiguration = System::getSystemConfiguration('', '', $workspaceName);
if (!defined('MEMCACHED_ENABLED')) { \G::LoadClass("configuration");
define('MEMCACHED_ENABLED', $arraySystemConfiguration['memcached']); $conf = new Configurations();
\G::$sysSys = $workspaceName;
\G::$pathDataSite = PATH_DATA . "sites" . PATH_SEP . \G::$sysSys . PATH_SEP;
\G::$pathDocument = PATH_DATA . 'sites' . DIRECTORY_SEPARATOR . $workspaceName . DIRECTORY_SEPARATOR . 'files';
\G::$memcachedEnabled = $arraySystemConfiguration['memcached'];
\G::$pathDataPublic = \G::$pathDataSite . "public" . PATH_SEP;
\G::$sysSkin = $conf->getConfiguration('SKIN_CRON', '');
if (is_file(\G::$pathDataSite . PATH_SEP . ".server_info")) {
$serverInfo = file_get_contents(\G::$pathDataSite . PATH_SEP . ".server_info");
$serverInfo = unserialize($serverInfo);
$envHost = $serverInfo["SERVER_NAME"];
$envPort = ($serverInfo["SERVER_PORT"] . "" != "80") ? ":" . $serverInfo["SERVER_PORT"] : "";
if (!empty($envPort) && strpos($envHost, $envPort) === false) {
$envHost = $envHost . $envPort;
}
\G::$httpHost = $envHost;
} }
//Search All process //Search All process

View File

@@ -26,6 +26,11 @@ class WebEntry
"userUid" => "USR_UID" "userUid" => "USR_UID"
); );
private $httpHost;
private $sysSkin;
private $sysSys;
private $pathDataPublic;
/** /**
* Constructor of the class * Constructor of the class
* *
@@ -33,6 +38,10 @@ class WebEntry
*/ */
public function __construct() public function __construct()
{ {
$this->pathDataPublic = defined("PATH_DATA_PUBLIC") ? PATH_DATA_PUBLIC : \G::$pathDataPublic;
$this->httpHost = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : \G::$httpHost;
$this->sysSys = defined("SYS_SYS") ? SYS_SYS : \G::$sysSys;
$this->sysSkin = defined("SYS_SKIN") ? SYS_SKIN : \G::$sysSkin;
try { try {
foreach ($this->arrayFieldDefinition as $key => $value) { foreach ($this->arrayFieldDefinition as $key => $value) {
$this->arrayFieldNameForException[$value["fieldNameAux"]] = $key; $this->arrayFieldNameForException[$value["fieldNameAux"]] = $key;
@@ -346,7 +355,7 @@ class WebEntry
$wsRoundRobin = 0; //0, 1 //0 - Cyclical Assignment $wsRoundRobin = 0; //0, 1 //0 - Cyclical Assignment
$pathDataPublicProcess = PATH_DATA_PUBLIC . $processUid; $pathDataPublicProcess = $this->pathDataPublic . $processUid;
//Delete previous files //Delete previous files
if (trim($arrayWebEntryData["WE_DATA"]) != "") { if (trim($arrayWebEntryData["WE_DATA"]) != "") {
@@ -415,8 +424,8 @@ class WebEntry
$template = new \TemplatePower($pluginTpl); $template = new \TemplatePower($pluginTpl);
$template->prepare(); $template->prepare();
$template->assign("wsdlUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/wsdl2"); $template->assign("wsdlUrl", $http . $this->httpHost . "/sys" . $this->sysSys . "/" . SYS_LANG . "/" . $this->sysSkin . "/services/wsdl2");
$template->assign("wsUploadUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/upload"); $template->assign("wsUploadUrl", $http . $this->httpHost . "/sys" . $this->sysSys . "/" . SYS_LANG . "/" . $this->sysSkin . "/services/upload");
$template->assign("processUid", $processUid); $template->assign("processUid", $processUid);
$template->assign("dynaformUid", $dynaFormUid); $template->assign("dynaformUid", $dynaFormUid);
$template->assign("taskUid", $taskUid); $template->assign("taskUid", $taskUid);
@@ -434,7 +443,7 @@ class WebEntry
$template->assign("dynaform", $arrayDynaFormData["DYN_TITLE"]); $template->assign("dynaform", $arrayDynaFormData["DYN_TITLE"]);
$template->assign("timestamp", date("l jS \of F Y h:i:s A")); $template->assign("timestamp", date("l jS \of F Y h:i:s A"));
$template->assign("ws", SYS_SYS); $template->assign("ws", $this->sysSys);
$template->assign("version", \System::getVersion()); $template->assign("version", \System::getVersion());
$fileName = $pathDataPublicProcess . PATH_SEP . $weTitle . "Post.php"; $fileName = $pathDataPublicProcess . PATH_SEP . $weTitle . "Post.php";
@@ -494,12 +503,12 @@ class WebEntry
} }
$G_FORM = new \Form($processUid . "/" . $dynaFormUid, PATH_DYNAFORM, SYS_LANG, false); $G_FORM = new \Form($processUid . "/" . $dynaFormUid, 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 . $this->httpHost . "/sys" . $this->sysSys . "/" . SYS_LANG . "/" . $this->sysSkin . "/services/cases_StartExternal.php";
$scriptCode = ""; $scriptCode = "";
$scriptCode = $G_FORM->render(PATH_TPL . "xmlform" . ".html", $scriptCode); $scriptCode = $G_FORM->render(PATH_TPL . "xmlform" . ".html", $scriptCode);
$scriptCode = str_replace("/controls/", $http . $_SERVER["HTTP_HOST"] . "/controls/", $scriptCode); $scriptCode = str_replace("/controls/", $http . $this->httpHost . "/controls/", $scriptCode);
$scriptCode = str_replace("/js/maborak/core/images/", $http . $_SERVER["HTTP_HOST"] . "/js/maborak/core/images/", $scriptCode); $scriptCode = str_replace("/js/maborak/core/images/", $http . $this->httpHost . "/js/maborak/core/images/", $scriptCode);
//Render the template //Render the template
$pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentry.tpl"; $pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentry.tpl";
@@ -512,10 +521,10 @@ class WebEntry
$template->assign("URL_MABORAK_JS", \G::browserCacheFilesUrl("/js/maborak/core/maborak.js")); $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("URL_TRANSLATION_ENV_JS", \G::browserCacheFilesUrl("/jscore/labels/" . SYS_LANG . ".js"));
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]); $template->assign("siteUrl", $http . $this->httpHost);
$template->assign("sysSys", SYS_SYS); $template->assign("sysSys", $this->sysSys);
$template->assign("sysLang", SYS_LANG); $template->assign("sysLang", SYS_LANG);
$template->assign("sysSkin", SYS_SKIN); $template->assign("sysSkin", $this->sysSkin);
$template->assign("processUid", $processUid); $template->assign("processUid", $processUid);
$template->assign("dynaformUid", $dynaFormUid); $template->assign("dynaformUid", $dynaFormUid);
$template->assign("taskUid", $taskUid); $template->assign("taskUid", $taskUid);
@@ -526,7 +535,7 @@ class WebEntry
if (sizeof($sUidGrids) > 0) { if (sizeof($sUidGrids) > 0) {
foreach ($sUidGrids as $k => $v) { foreach ($sUidGrids as $k => $v) {
$template->newBlock("grid_uids"); $template->newBlock("grid_uids");
$template->assign("siteUrl", $http . $_SERVER["HTTP_HOST"]); $template->assign("siteUrl", $http . $this->httpHost);
$template->assign("gridFileName", $processUid . "/" . $v); $template->assign("gridFileName", $processUid . "/" . $v);
} }
} }

View File

@@ -1315,9 +1315,10 @@ class BpmnWorkflow extends Project\Bpmn
$diagram["participants"] = $bwp->getParticipants($configList); $diagram["participants"] = $bwp->getParticipants($configList);
$project["diagrams"][] = $diagram; $project["diagrams"][] = $diagram;
} }
if (file_exists(PATH_DOCUMENT . $project["prj_uid"])) { $pathDocument = defined("PATH_DOCUMENT") ? PATH_DOCUMENT : \G::$pathDocument;
$project["prj_bpmn_file_upload"] = file_get_contents(PATH_DOCUMENT . $project["prj_uid"]); if (file_exists($pathDocument . $project["prj_uid"])) {
unlink(PATH_DOCUMENT . $project["prj_uid"]); $project["prj_bpmn_file_upload"] = file_get_contents($pathDocument . $project["prj_uid"]);
unlink($pathDocument . $project["prj_uid"]);
} }
return $project; return $project;