HOR-3700-RG
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Maveriks;
|
||||
|
||||
use Maveriks\Util;
|
||||
@@ -12,8 +13,6 @@ use G;
|
||||
|
||||
/**
|
||||
* Web application bootstrap
|
||||
*
|
||||
* @author Erik Amaru Ortiz <aortiz.erik@gmail.com>
|
||||
*/
|
||||
class WebApplication
|
||||
{
|
||||
@@ -30,26 +29,32 @@ class WebApplication
|
||||
* @var string application root directory
|
||||
*/
|
||||
protected $rootDir = "";
|
||||
|
||||
/**
|
||||
* @var string workflow directory
|
||||
*/
|
||||
protected $workflowDir = "";
|
||||
|
||||
/**
|
||||
* @var string workspace directory located into shared directory
|
||||
*/
|
||||
protected $workspaceDir = "";
|
||||
|
||||
/**
|
||||
* @var string workspace cache directory
|
||||
*/
|
||||
protected $workspaceCacheDir = "";
|
||||
|
||||
/**
|
||||
* @var string request location uri
|
||||
*/
|
||||
protected $requestUri = "";
|
||||
|
||||
/**
|
||||
* @var array holds multiple request response
|
||||
*/
|
||||
protected $responseMultipart = array();
|
||||
|
||||
/**
|
||||
* @var \Maveriks\Extension\Restler main REST dispatcher object
|
||||
*/
|
||||
@@ -108,8 +113,7 @@ class WebApplication
|
||||
} else {
|
||||
return self::RUNNING_DEFAULT;
|
||||
}
|
||||
} elseif (substr($this->requestUri, 1, 3) === "api"
|
||||
&& count(explode("/", $this->requestUri)) >= 4 // url api pattern: /api/1.0/<workspace>/<resource>
|
||||
} elseif (substr($this->requestUri, 1, 3) === "api" && count(explode("/", $this->requestUri)) >= 4 // url api pattern: /api/1.0/<workspace>/<resource>
|
||||
) {
|
||||
return self::RUNNING_API;
|
||||
} else {
|
||||
@@ -172,7 +176,6 @@ class WebApplication
|
||||
*/
|
||||
public function dispatchMultipleApiRequest($uri, $version = "1.0")
|
||||
{
|
||||
|
||||
$stringInput = file_get_contents('php://input');
|
||||
|
||||
if (empty($stringInput)) {
|
||||
@@ -450,11 +453,12 @@ class WebApplication
|
||||
define("PATH_CONTROLLERS", PATH_CORE . "controllers" . PATH_SEP);
|
||||
define("PATH_SERVICES_REST", PATH_CORE . "services" . PATH_SEP . "rest" . PATH_SEP);
|
||||
|
||||
self::defineConstantsForPlugin();
|
||||
|
||||
G::defineConstants();
|
||||
$arraySystemConfiguration = System::getSystemConfiguration();
|
||||
|
||||
ini_set('date.timezone', $arraySystemConfiguration['time_zone']); //Set Time Zone
|
||||
|
||||
// set include path
|
||||
set_include_path(
|
||||
PATH_CORE . PATH_SEPARATOR .
|
||||
@@ -463,12 +467,10 @@ class WebApplication
|
||||
PATH_RBAC_CORE . PATH_SEPARATOR .
|
||||
get_include_path()
|
||||
);
|
||||
///print_r(get_include_path()); die;
|
||||
|
||||
/*
|
||||
* Setting Up Workspace
|
||||
*/
|
||||
|
||||
if (!file_exists(FILE_PATHS_INSTALLED)) {
|
||||
throw new \Exception("Can't locate system file: " . FILE_PATHS_INSTALLED);
|
||||
}
|
||||
@@ -548,7 +550,6 @@ class WebApplication
|
||||
/**
|
||||
* Global definitions, before it was the defines.php file
|
||||
*/
|
||||
|
||||
// URL Key
|
||||
define("URL_KEY", 'c0l0s40pt1mu59r1m3');
|
||||
|
||||
@@ -613,5 +614,36 @@ class WebApplication
|
||||
@unlink(PATH_DATA_SITE . 'routes.php');
|
||||
@unlink(PATH_DATA . 'sites' . DS . $workspace . DS . 'api-config.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* The content of this function comes from the file:
|
||||
* processmaker/workflow/engine/classes/class.plugin.php, the loading of this
|
||||
* file is not done by 'require' in this version of ProcessMaker. Therefore,
|
||||
* these definitions have been moved to this class.
|
||||
*/
|
||||
public static function defineConstantsForPlugin()
|
||||
{
|
||||
define('G_PLUGIN_CLASS', 1);
|
||||
define('PM_CREATE_CASE', 1001);
|
||||
define('PM_UPLOAD_DOCUMENT', 1002);
|
||||
define('PM_CASE_DOCUMENT_LIST', 1003);
|
||||
define('PM_BROWSE_CASE', 1004);
|
||||
define('PM_NEW_PROCESS_LIST', 1005);
|
||||
define('PM_NEW_PROCESS_SAVE', 1006);
|
||||
define('PM_NEW_DYNAFORM_LIST', 1007);
|
||||
define('PM_NEW_DYNAFORM_SAVE', 1008);
|
||||
define('PM_EXTERNAL_STEP', 1009);
|
||||
define('PM_CASE_DOCUMENT_LIST_ARR', 1010);
|
||||
define('PM_LOGIN', 1011);
|
||||
define('PM_UPLOAD_DOCUMENT_BEFORE', 1012);
|
||||
define('PM_CREATE_NEW_DELEGATION', 1013);
|
||||
define('PM_SINGLE_SIGN_ON', 1014);
|
||||
define('PM_GET_CASES_AJAX_LISTENER', 1015);
|
||||
define('PM_BEFORE_CREATE_USER', 1016);
|
||||
define('PM_AFTER_LOGIN', 1017);
|
||||
define('PM_HASH_PASSWORD', 1018);
|
||||
define('PM_SCHEDULER_CREATE_CASE_BEFORE', 1019);
|
||||
define('PM_SCHEDULER_CREATE_CASE_AFTER', 1020);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,54 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* class.plugin.php
|
||||
* @package workflow.engine.classes
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2011 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
|
||||
define('G_PLUGIN_CLASS', 1);
|
||||
define('PM_CREATE_CASE', 1001);
|
||||
define('PM_UPLOAD_DOCUMENT', 1002);
|
||||
define('PM_CASE_DOCUMENT_LIST', 1003);
|
||||
define('PM_BROWSE_CASE', 1004);
|
||||
define('PM_NEW_PROCESS_LIST', 1005);
|
||||
define('PM_NEW_PROCESS_SAVE', 1006);
|
||||
define('PM_NEW_DYNAFORM_LIST', 1007);
|
||||
define('PM_NEW_DYNAFORM_SAVE', 1008);
|
||||
define('PM_EXTERNAL_STEP', 1009);
|
||||
define('PM_CASE_DOCUMENT_LIST_ARR', 1010);
|
||||
define('PM_LOGIN', 1011);
|
||||
define('PM_UPLOAD_DOCUMENT_BEFORE', 1012);
|
||||
define('PM_CREATE_NEW_DELEGATION', 1013);
|
||||
define('PM_SINGLE_SIGN_ON', 1014);
|
||||
define('PM_GET_CASES_AJAX_LISTENER', 1015);
|
||||
define('PM_BEFORE_CREATE_USER', 1016);
|
||||
define('PM_AFTER_LOGIN', 1017);
|
||||
define('PM_HASH_PASSWORD', 1018);
|
||||
define('PM_SCHEDULER_CREATE_CASE_BEFORE', 1019);
|
||||
define('PM_SCHEDULER_CREATE_CASE_AFTER', 1020);
|
||||
|
||||
|
||||
/**
|
||||
* @package workflow.engine.classes
|
||||
*/
|
||||
@@ -266,13 +219,8 @@ class PMPlugin
|
||||
* param
|
||||
* @return void
|
||||
*/
|
||||
public function registerCaseSchedulerPlugin(
|
||||
$sActionId,
|
||||
$sActionForm,
|
||||
$sActionSave,
|
||||
$sActionExecute,
|
||||
$sActionGetFields
|
||||
) {
|
||||
public function registerCaseSchedulerPlugin($sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields)
|
||||
{
|
||||
PluginRegistry::loadSingleton()->registerCaseSchedulerPlugin(
|
||||
$this->sNamespace, $sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields
|
||||
);
|
||||
@@ -294,7 +242,7 @@ class PMPlugin
|
||||
* @param array/string $pluginJsFile
|
||||
* @return void
|
||||
*/
|
||||
function registerJavascript($sCoreJsFile, $pluginJsFile)
|
||||
public function registerJavascript($sCoreJsFile, $pluginJsFile)
|
||||
{
|
||||
PluginRegistry::loadSingleton()->registerJavascript($this->sNamespace, $sCoreJsFile, $pluginJsFile);
|
||||
}
|
||||
@@ -327,7 +275,7 @@ class PMPlugin
|
||||
* @param array/string $pluginJsFile
|
||||
* @return void
|
||||
*/
|
||||
function registerRestService()
|
||||
public function registerRestService()
|
||||
{
|
||||
PluginRegistry::loadSingleton()->registerRestService($this->sNamespace);
|
||||
}
|
||||
@@ -337,7 +285,7 @@ class PMPlugin
|
||||
*
|
||||
* @param string $className that is name class to extends
|
||||
*/
|
||||
function registerExtendsRestService($className)
|
||||
public function registerExtendsRestService($className)
|
||||
{
|
||||
PluginRegistry::loadSingleton()->registerExtendsRestService($this->sNamespace, $className);
|
||||
}
|
||||
@@ -347,7 +295,7 @@ class PMPlugin
|
||||
*
|
||||
* @param string $className that is name class to extends
|
||||
*/
|
||||
function disableExtendsRestService($className)
|
||||
public function disableExtendsRestService($className)
|
||||
{
|
||||
PluginRegistry::loadSingleton()->disableExtendsRestService($this->sNamespace, $className);
|
||||
}
|
||||
@@ -360,7 +308,7 @@ class PMPlugin
|
||||
* @param array/string $pluginJsFile
|
||||
* @return void
|
||||
*/
|
||||
function unregisterRestService($classname, $path)
|
||||
public function unregisterRestService($classname, $path)
|
||||
{
|
||||
PluginRegistry::loadSingleton()->unregisterRestService($this->sNamespace, $classname, $path);
|
||||
}
|
||||
@@ -375,7 +323,7 @@ class PMPlugin
|
||||
PluginRegistry::loadSingleton()->registerCronFile($this->sNamespace, $cronFile);
|
||||
}
|
||||
|
||||
function enableRestService($enable)
|
||||
public function enableRestService($enable)
|
||||
{
|
||||
PluginRegistry::loadSingleton()->enableRestService($this->sNamespace, $enable);
|
||||
}
|
||||
@@ -495,7 +443,7 @@ class PMPlugin
|
||||
*/
|
||||
public static function getListPluginsManager($workspace)
|
||||
{
|
||||
$items = Array();
|
||||
$items = array();
|
||||
$aPluginsPP = array();
|
||||
if (is_file(PATH_PLUGINS . 'enterprise/data/data')) {
|
||||
$aPlugins = unserialize(trim(file_get_contents(PATH_PLUGINS . 'enterprise/data/data')));
|
||||
@@ -576,7 +524,6 @@ class PMPlugin
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class menuDetail
|
||||
@@ -600,7 +547,6 @@ class menuDetail
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class toolbarDetail
|
||||
{
|
||||
public $sNamespace;
|
||||
@@ -751,15 +697,8 @@ class folderData
|
||||
* param string $sUserFullName
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
$sProcessUid,
|
||||
$sProcessTitle,
|
||||
$sApplicationUid,
|
||||
$sApplicationTitle,
|
||||
$sUserUid,
|
||||
$sUserLogin = '',
|
||||
$sUserFullName =''
|
||||
) {
|
||||
public function __construct($sProcessUid, $sProcessTitle, $sApplicationUid, $sApplicationTitle, $sUserUid, $sUserLogin = '', $sUserFullName = '')
|
||||
{
|
||||
$this->sProcessUid = $sProcessUid;
|
||||
$this->sProcessTitle = $sProcessTitle;
|
||||
$this->sApplicationUid = $sApplicationUid;
|
||||
@@ -950,3 +889,4 @@ class OpenReassignCallback
|
||||
$this->callBackFile = $callBackFile;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user