HOR-3700-RG

This commit is contained in:
Roly Rudy Gutierrez Pinto
2017-08-16 09:06:09 -04:00
parent 7ea1ca1aa6
commit 4ae20b78dc
2 changed files with 162 additions and 190 deletions

View File

@@ -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,12 +113,11 @@ 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 {
list($this->requestUri,) = explode('?', $this->requestUri);
list($this->requestUri, ) = explode('?', $this->requestUri);
$uriParts = explode('/', $this->requestUri);
if (isset($uriParts[2]) && $uriParts[2] == "oauth2") {
@@ -172,7 +176,6 @@ class WebApplication
*/
public function dispatchMultipleApiRequest($uri, $version = "1.0")
{
$stringInput = file_get_contents('php://input');
if (empty($stringInput)) {
@@ -272,13 +275,13 @@ class WebApplication
$cachedConfig = $this->workspaceCacheDir . "api-config.php";
// verify if config cache file exists, is array and the last modification date is the same when cache was created.
if (! file_exists($cachedConfig) || ! is_array($config = include($cachedConfig)) || $config["_chk"] != filemtime($apiIniFile)) {
if (!file_exists($cachedConfig) || !is_array($config = include($cachedConfig)) || $config["_chk"] != filemtime($apiIniFile)) {
$config = Util\Common::parseIniFile($apiIniFile);
$config["_chk"] = filemtime($apiIniFile);
if (! is_dir(dirname($cachedConfig))) {
if (!is_dir(dirname($cachedConfig))) {
Util\Common::mk_dir(dirname($cachedConfig));
}
file_put_contents($cachedConfig, "<?php return " . var_export($config, true).";");
file_put_contents($cachedConfig, "<?php return " . var_export($config, true) . ";");
Util\Logger::log("Configuration cache was loaded and cached to: $cachedConfig");
} else {
Util\Logger::log("Loading Api Configuration from: $cachedConfig");
@@ -287,14 +290,14 @@ class WebApplication
// Setting current workspace to Api class
Services\Api::setWorkspace(SYS_SYS);
$cacheDir = defined("PATH_WORKSPACE") ? PATH_WORKSPACE : (defined("PATH_C")? PATH_C: sys_get_temp_dir());
$cacheDir = defined("PATH_WORKSPACE") ? PATH_WORKSPACE : (defined("PATH_C") ? PATH_C : sys_get_temp_dir());
$sysConfig = System::getSystemConfiguration();
\Luracast\Restler\Defaults::$cacheDirectory = $cacheDir;
$productionMode = (bool) !(isset($sysConfig["service_api_debug"]) && $sysConfig["service_api_debug"]);
Util\Logger::log("Serving API mode: " . ($productionMode? "production": "development"));
Util\Logger::log("Serving API mode: " . ($productionMode ? "production" : "development"));
// create a new Restler instance
//$rest = new \Luracast\Restler\Restler();
@@ -313,11 +316,11 @@ class WebApplication
// Setting database connection source
list($host, $port) = strpos(DB_HOST, ':') !== false ? explode(':', DB_HOST) : array(DB_HOST, '');
$port = empty($port) ? '' : ";port=$port";
Services\OAuth2\Server::setDatabaseSource(DB_USER, DB_PASS, DB_ADAPTER.":host=$host;dbname=".DB_NAME.$port);
Services\OAuth2\Server::setDatabaseSource(DB_USER, DB_PASS, DB_ADAPTER . ":host=$host;dbname=" . DB_NAME . $port);
if (DB_NAME != DB_RBAC_NAME) { //it's PM < 3
list($host, $port) = strpos(DB_RBAC_HOST, ':') !== false ? explode(':', DB_RBAC_HOST) : array(DB_RBAC_HOST, '');
$port = empty($port) ? '' : ";port=$port";
Services\OAuth2\Server::setDatabaseSourceRBAC(DB_RBAC_USER, DB_RBAC_PASS, DB_ADAPTER.":host=$host;dbname=".DB_RBAC_NAME.$port);
Services\OAuth2\Server::setDatabaseSourceRBAC(DB_RBAC_USER, DB_RBAC_PASS, DB_ADAPTER . ":host=$host;dbname=" . DB_RBAC_NAME . $port);
}
// Setting default OAuth Client id, for local PM Web Designer
@@ -332,7 +335,7 @@ class WebApplication
if (pathinfo($classFile, PATHINFO_EXTENSION) === 'php') {
$relClassPath = str_replace('.php', '', str_replace($servicesDir, '', $classFile));
$namespace = '\\ProcessMaker\\Services\\' . str_replace(DS, '\\', $relClassPath);
$namespace = strpos($namespace, "//") === false? $namespace: str_replace("//", '', $namespace);
$namespace = strpos($namespace, "//") === false ? $namespace : str_replace("//", '', $namespace);
$this->rest->addAPIClass($namespace);
}
}
@@ -358,7 +361,7 @@ class WebApplication
$tmp = array_shift($tmp);
$tmp = explode('-', $tmp);
$pluginName = $tmp[1];
$uri = str_replace('plugin-'.$pluginName, strtolower($pluginName), $uri);
$uri = str_replace('plugin-' . $pluginName, strtolower($pluginName), $uri);
}
// hook to get rest api classes from plugins
@@ -366,7 +369,7 @@ class WebApplication
$pluginRegistry = PluginRegistry::loadSingleton();
$plugins = $pluginRegistry->getRegisteredRestServices();
if (! empty($plugins)) {
if (!empty($plugins)) {
foreach ($plugins as $pluginName => $plugin) {
$pluginSourceDir = PATH_PLUGINS . $pluginName . DIRECTORY_SEPARATOR . 'src';
@@ -374,7 +377,7 @@ class WebApplication
$loader->add($pluginSourceDir);
foreach ($plugin as $class) {
$className = is_object($class) ? $class->namespace: $class['namespace'];
$className = is_object($class) ? $class->namespace : $class['namespace'];
if (class_exists($className)) {
$this->rest->addAPIClass($className, strtolower($pluginName));
}
@@ -413,9 +416,9 @@ class WebApplication
{
define("PATH_SEP", DIRECTORY_SEPARATOR);
define("PATH_TRUNK", $this->rootDir . PATH_SEP);
define("PATH_TRUNK", $this->rootDir . PATH_SEP);
define("PATH_OUTTRUNK", realpath($this->rootDir . "/../") . PATH_SEP);
define("PATH_HOME", $this->rootDir . PATH_SEP . "workflow" . PATH_SEP);
define("PATH_HOME", $this->rootDir . PATH_SEP . "workflow" . PATH_SEP);
define("PATH_HTML", PATH_HOME . "public_html" . PATH_SEP);
define("PATH_RBAC_HOME", PATH_TRUNK . "rbac" . PATH_SEP);
@@ -440,7 +443,7 @@ class WebApplication
define("PATH_FIXTURES", PATH_TEST . "fixtures" . PATH_SEP);
define("PATH_RTFDOCS", PATH_CORE . "rtf_templates" . PATH_SEP);
define("PATH_DYNACONT", PATH_CORE . "content" . PATH_SEP . "dynaform" . PATH_SEP);
define("SYS_UPLOAD_PATH", PATH_HOME . "public_html/files/" );
define("SYS_UPLOAD_PATH", PATH_HOME . "public_html/files/");
define("PATH_UPLOAD", PATH_HTML . "files" . PATH_SEP);
define("PATH_WORKFLOW_MYSQL_DATA", PATH_CORE . "data" . PATH_SEP . "mysql" . PATH_SEP);
define("PATH_RBAC_MYSQL_DATA", PATH_RBAC_CORE . "data" . PATH_SEP . "mysql" . PATH_SEP);
@@ -450,26 +453,25 @@ 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 .
PATH_THIRDPARTY . PATH_SEPARATOR .
PATH_THIRDPARTY . "pear" . PATH_SEPARATOR .
PATH_RBAC_CORE . PATH_SEPARATOR .
get_include_path()
PATH_CORE . PATH_SEPARATOR .
PATH_THIRDPARTY . PATH_SEPARATOR .
PATH_THIRDPARTY . "pear" . PATH_SEPARATOR .
PATH_RBAC_CORE . PATH_SEPARATOR .
get_include_path()
);
///print_r(get_include_path()); die;
/*
* Setting Up Workspace
*/
if (! file_exists( FILE_PATHS_INSTALLED )) {
if (!file_exists(FILE_PATHS_INSTALLED)) {
throw new \Exception("Can't locate system file: " . FILE_PATHS_INSTALLED);
}
@@ -477,8 +479,8 @@ class WebApplication
require_once PATH_CORE . "config" . PATH_SEP . "paths_installed.php";
// defining system constant when a valid server environment exists
define("PATH_LANGUAGECONT", PATH_DATA . "META-INF" . PATH_SEP );
define("PATH_CUSTOM_SKINS", PATH_DATA . "skins" . PATH_SEP );
define("PATH_LANGUAGECONT", PATH_DATA . "META-INF" . PATH_SEP);
define("PATH_CUSTOM_SKINS", PATH_DATA . "skins" . PATH_SEP);
define("PATH_TEMPORAL", PATH_C . "dynEditor/");
define("PATH_DB", PATH_DATA . "sites" . PATH_SEP);
@@ -488,7 +490,7 @@ class WebApplication
\Bootstrap::setLanguage();
\Bootstrap::LoadTranslationObject((defined("SYS_LANG"))? SYS_LANG : "en");
\Bootstrap::LoadTranslationObject((defined("SYS_LANG")) ? SYS_LANG : "en");
if (empty($workspace)) {
return true;
@@ -516,11 +518,11 @@ class WebApplication
define('DEBUG_SQL_LOG', $arraySystemConfiguration['debug_sql']);
define('DEBUG_TIME_LOG', $arraySystemConfiguration['debug_time']);
define('DEBUG_CALENDAR_LOG', $arraySystemConfiguration['debug_calendar']);
define('MEMCACHED_ENABLED', $arraySystemConfiguration['memcached']);
define('MEMCACHED_SERVER', $arraySystemConfiguration['memcached_server']);
define('MEMCACHED_ENABLED', $arraySystemConfiguration['memcached']);
define('MEMCACHED_SERVER', $arraySystemConfiguration['memcached_server']);
define('SYS_SKIN', $arraySystemConfiguration['default_skin']);
require_once (PATH_DB . SYS_SYS . "/db.php");
require_once(PATH_DB . SYS_SYS . "/db.php");
// defining constant for workspace shared directory
$this->workspaceDir = PATH_DB . SYS_SYS . PATH_SEP;
@@ -532,15 +534,15 @@ class WebApplication
set_include_path(get_include_path() . PATH_SEPARATOR . PATH_WORKSPACE);
// smarty constants
define( "PATH_SMARTY_C", PATH_C . "smarty" . PATH_SEP . "c" );
define( "PATH_SMARTY_CACHE", PATH_C . "smarty" . PATH_SEP . "cache" );
define("PATH_SMARTY_C", PATH_C . "smarty" . PATH_SEP . "c");
define("PATH_SMARTY_CACHE", PATH_C . "smarty" . PATH_SEP . "cache");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DOCUMENT", PATH_DATA_SITE . "files/");
define("PATH_DATA_MAILTEMPLATES", PATH_DATA_SITE . "mailTemplates/");
define("PATH_DATA_PUBLIC", PATH_DATA_SITE . "public/");
define("PATH_DATA_REPORTS", PATH_DATA_SITE . "reports/");
define("PATH_DYNAFORM", PATH_DATA_SITE . "xmlForms/");
define("PATH_DATA_SITE", PATH_DATA . "sites/" . SYS_SYS . "/");
define("PATH_DOCUMENT", PATH_DATA_SITE . "files/");
define("PATH_DATA_MAILTEMPLATES", PATH_DATA_SITE . "mailTemplates/");
define("PATH_DATA_PUBLIC", PATH_DATA_SITE . "public/");
define("PATH_DATA_REPORTS", PATH_DATA_SITE . "reports/");
define("PATH_DYNAFORM", PATH_DATA_SITE . "xmlForms/");
define("PATH_IMAGES_ENVIRONMENT_FILES", PATH_DATA_SITE . "usersFiles" . PATH_SEP);
define("PATH_IMAGES_ENVIRONMENT_USERS", PATH_DATA_SITE . "usersPhotographies" . PATH_SEP);
define('DISABLE_PHP_UPLOAD_EXECUTION', $arraySystemConfiguration['disable_php_upload_execution']);
@@ -548,40 +550,39 @@ class WebApplication
/**
* Global definitions, before it was the defines.php file
*/
// URL Key
define( "URL_KEY", 'c0l0s40pt1mu59r1m3' );
define("URL_KEY", 'c0l0s40pt1mu59r1m3');
// Other definitions
define( 'TIMEOUT_RESPONSE', 100 ); //web service timeout
define( 'APPLICATION_CODE', 'ProcessMaker' ); //to login like workflow system
define( 'MAIN_POFILE', 'processmaker' );
define( 'PO_SYSTEM_VERSION', 'PM 4.0.1' );
define('TIMEOUT_RESPONSE', 100); //web service timeout
define('APPLICATION_CODE', 'ProcessMaker'); //to login like workflow system
define('MAIN_POFILE', 'processmaker');
define('PO_SYSTEM_VERSION', 'PM 4.0.1');
// Environment definitions
define( 'G_PRO_ENV', 'PRODUCTION' );
define( 'G_DEV_ENV', 'DEVELOPMENT' );
define( 'G_TEST_ENV', 'TEST' );
define('G_PRO_ENV', 'PRODUCTION');
define('G_DEV_ENV', 'DEVELOPMENT');
define('G_TEST_ENV', 'TEST');
// Number of files per folder at PATH_UPLOAD (cases documents)
define( 'APPLICATION_DOCUMENTS_PER_FOLDER', 1000 );
define('APPLICATION_DOCUMENTS_PER_FOLDER', 1000);
// Server of ProcessMaker Library
define( 'PML_SERVER', 'http://library.processmaker.com' );
define( 'PML_WSDL_URL', PML_SERVER . '/syspmLibrary/en/green/services/wsdl' );
define( 'PML_UPLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/uploadProcess' );
define( 'PML_DOWNLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/download' );
define('PML_SERVER', 'http://library.processmaker.com');
define('PML_WSDL_URL', PML_SERVER . '/syspmLibrary/en/green/services/wsdl');
define('PML_UPLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/uploadProcess');
define('PML_DOWNLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/download');
\Propel::init(PATH_CONFIG . "databases.php");
//Set Time Zone
/*----------------------------------********---------------------------------*/
if (\PMLicensedFeatures::getSingleton()->verifyfeature('oq3S29xemxEZXJpZEIzN01qenJUaStSekY4cTdJVm5vbWtVM0d4S2lJSS9qUT0=')) {
$_SESSION['__SYSTEM_UTC_TIME_ZONE__'] = (int)($arraySystemConfiguration['system_utc_time_zone']) == 1;
$_SESSION['__SYSTEM_UTC_TIME_ZONE__'] = (int) ($arraySystemConfiguration['system_utc_time_zone']) == 1;
}
/*----------------------------------********---------------------------------*/
ini_set('date.timezone', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__'])? 'UTC' : $arraySystemConfiguration['time_zone']); //Set Time Zone
ini_set('date.timezone', (isset($_SESSION['__SYSTEM_UTC_TIME_ZONE__']) && $_SESSION['__SYSTEM_UTC_TIME_ZONE__']) ? 'UTC' : $arraySystemConfiguration['time_zone']); //Set Time Zone
define('TIME_ZONE', ini_get('date.timezone'));
@@ -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);
}
}

View File

@@ -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
*/
@@ -71,10 +24,10 @@ class PMPlugin
*/
public function PMPlugin($sNamespace, $sFilename = null)
{
$this->sNamespace = $sNamespace;
$this->sClassName = $sNamespace . 'Plugin';
$this->sNamespace = $sNamespace;
$this->sClassName = $sNamespace . 'Plugin';
$this->sPluginFolder = $sNamespace;
$this->sFilename = $sFilename;
$this->sFilename = $sFilename;
}
/**
@@ -85,7 +38,7 @@ class PMPlugin
*/
public function registerMenu($menuId, $menuFilename)
{
$sMenuFilename = ($this->sClassName == 'enterprisePlugin') ? PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . $menuFilename : PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . $menuFilename;
$sMenuFilename = ($this->sClassName == 'enterprisePlugin') ? PATH_CORE . 'methods' . PATH_SEP . 'enterprise' . PATH_SEP . $menuFilename : PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . $menuFilename;
PluginRegistry::loadSingleton()->registerMenu($this->sNamespace, $menuId, $sMenuFilename);
}
@@ -154,9 +107,9 @@ class PMPlugin
* param
* @return void
*/
public function registerStep($sStepId, $sStepName, $sStepTitle, $sSetupStepPage = '')
public function registerStep($sStepId, $sStepName, $sStepTitle, $sSetupStepPage = '')
{
PluginRegistry::loadSingleton()->registerStep( $this->sNamespace, $sStepId, $sStepName, $sStepTitle, $sSetupStepPage );
PluginRegistry::loadSingleton()->registerStep($this->sNamespace, $sStepId, $sStepName, $sStepTitle, $sSetupStepPage);
}
/**
@@ -236,7 +189,7 @@ class PMPlugin
public function registerBreakPageTemplate($pageId, $templateFilename)
{
$sPageFilename = PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . $templateFilename;
PluginRegistry::loadSingleton()->registerBreakPageTemplate ($this->sNamespace, $pageId, $sPageFilename);
PluginRegistry::loadSingleton()->registerBreakPageTemplate($this->sNamespace, $pageId, $sPageFilename);
}
/**
@@ -257,7 +210,7 @@ class PMPlugin
*/
public function registerToolbarFile($sToolbarId, $filename)
{
$sFilename = PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . $filename;
$sFilename = PATH_PLUGINS . $this->sPluginFolder . PATH_SEP . $filename;
PluginRegistry::loadSingleton()->registerToolbarFile($this->sNamespace, $sToolbarId, $sFilename);
}
@@ -266,15 +219,10 @@ 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
$this->sNamespace, $sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields
);
}
@@ -283,9 +231,9 @@ class PMPlugin
* @param string $sPage
* @return void
*/
public function registerTaskExtendedProperty($sPage, $sName, $sIcon="")
public function registerTaskExtendedProperty($sPage, $sName, $sIcon = "")
{
PluginRegistry::loadSingleton()->registerTaskExtendedProperty ( $this->sNamespace, $sPage, $sName, $sIcon );
PluginRegistry::loadSingleton()->registerTaskExtendedProperty($this->sNamespace, $sPage, $sName, $sIcon);
}
/**
@@ -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')));
@@ -510,7 +458,7 @@ class PMPlugin
continue;
}
if (strpos($file, '.php', 1) && is_file(PATH_PLUGINS . $file)) {
include_once (PATH_PLUGINS . $file);
include_once(PATH_PLUGINS . $file);
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $pluginDetail */
$pluginDetail = $oPluginRegistry->getPluginDetails($file);
if ($pluginDetail === null) {
@@ -564,7 +512,7 @@ class PMPlugin
if ($handle = opendir(PATH_PLUGINS)) {
while (false !== ($file = readdir($handle))) {
if (strpos($file, '.php', 1) && is_file(PATH_PLUGINS . $file)) {
include_once (PATH_PLUGINS . $file);
include_once(PATH_PLUGINS . $file);
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $detail */
$detail = $oPluginRegistry->getPluginDetails($file);
if ($detail !== null) {
@@ -576,7 +524,6 @@ class PMPlugin
}
return $items;
}
}
class menuDetail
@@ -595,12 +542,11 @@ class menuDetail
public function __construct($sNamespace, $sMenuId, $sFilename)
{
$this->sNamespace = $sNamespace;
$this->sMenuId = $sMenuId;
$this->sFilename = $sFilename;
$this->sMenuId = $sMenuId;
$this->sFilename = $sFilename;
}
}
class toolbarDetail
{
public $sNamespace;
@@ -617,8 +563,8 @@ class toolbarDetail
public function __construct($sNamespace, $sToolbarId, $sFilename)
{
$this->sNamespace = $sNamespace;
$this->sToolbarId = $sToolbarId;
$this->sFilename = $sFilename;
$this->sToolbarId = $sToolbarId;
$this->sFilename = $sFilename;
}
}
@@ -636,7 +582,7 @@ class cssFile
public function __construct($sNamespace, $sCssFile)
{
$this->sNamespace = $sNamespace;
$this->sCssFile = $sCssFile;
$this->sCssFile = $sCssFile;
}
}
@@ -655,8 +601,8 @@ class triggerDetail
*/
public function __construct($sNamespace, $sTriggerId, $sTriggerName)
{
$this->sNamespace = $sNamespace;
$this->sTriggerId = $sTriggerId;
$this->sNamespace = $sNamespace;
$this->sTriggerId = $sTriggerId;
$this->sTriggerName = $sTriggerName;
}
}
@@ -676,8 +622,8 @@ class folderDetail
*/
public function __construct($sNamespace, $sFolderId, $sFolderName)
{
$this->sNamespace = $sNamespace;
$this->sFolderId = $sFolderId;
$this->sNamespace = $sNamespace;
$this->sFolderId = $sFolderId;
$this->sFolderName = $sFolderName;
}
}
@@ -701,10 +647,10 @@ class stepDetail
*/
public function __construct($sNamespace, $sStepId, $sStepName, $sStepTitle, $sSetupStepPage)
{
$this->sNamespace = $sNamespace;
$this->sStepId = $sStepId;
$this->sStepName = $sStepName;
$this->sStepTitle = $sStepTitle;
$this->sNamespace = $sNamespace;
$this->sStepId = $sStepId;
$this->sStepName = $sStepName;
$this->sStepTitle = $sStepTitle;
$this->sSetupStepPage = $sSetupStepPage;
}
}
@@ -724,8 +670,8 @@ class redirectDetail
*/
public function __construct($sNamespace, $sRoleCode, $sPathMethod)
{
$this->sNamespace = $sNamespace;
$this->sRoleCode = $sRoleCode;
$this->sNamespace = $sNamespace;
$this->sRoleCode = $sRoleCode;
$this->sPathMethod = $sPathMethod;
}
}
@@ -751,22 +697,15 @@ class folderData
* param string $sUserFullName
* @return void
*/
public function __construct(
$sProcessUid,
$sProcessTitle,
$sApplicationUid,
$sApplicationTitle,
$sUserUid,
$sUserLogin = '',
$sUserFullName =''
) {
$this->sProcessUid = $sProcessUid;
$this->sProcessTitle = $sProcessTitle;
$this->sApplicationUid = $sApplicationUid;
public function __construct($sProcessUid, $sProcessTitle, $sApplicationUid, $sApplicationTitle, $sUserUid, $sUserLogin = '', $sUserFullName = '')
{
$this->sProcessUid = $sProcessUid;
$this->sProcessTitle = $sProcessTitle;
$this->sApplicationUid = $sApplicationUid;
$this->sApplicationTitle = $sApplicationTitle;
$this->sUserUid = $sUserUid;
$this->sUserLogin = $sUserLogin;
$this->sUserFullName = $sUserFullName;
$this->sUserUid = $sUserUid;
$this->sUserLogin = $sUserLogin;
$this->sUserFullName = $sUserFullName;
}
}
@@ -793,12 +732,12 @@ class uploadDocumentData
public function __construct($sApplicationUid, $sUserUid, $sFilename, $sFileTitle, $sDocumentUid, $iVersion = 1)
{
$this->sApplicationUid = $sApplicationUid;
$this->sUserUid = $sUserUid;
$this->sFilename = $sFilename;
$this->sFileTitle = $sFileTitle;
$this->sDocumentUid = $sDocumentUid;
$this->sUserUid = $sUserUid;
$this->sFilename = $sFilename;
$this->sFileTitle = $sFileTitle;
$this->sDocumentUid = $sDocumentUid;
$this->bUseOutputFolder = false;
$this->iVersion = $iVersion;
$this->iVersion = $iVersion;
}
}
@@ -818,8 +757,8 @@ class loginInfo
public function __construct($lName, $lPassword, $lSession)
{
$this->lName = $lName;
$this->lPassword = $lPassword;
$this->lSession = $lSession;
$this->lPassword = $lPassword;
$this->lSession = $lSession;
}
}
@@ -844,11 +783,11 @@ class caseSchedulerPlugin
*/
public function __construct($sNamespace, $sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields)
{
$this->sNamespace = $sNamespace;
$this->sActionId = $sActionId;
$this->sActionForm = $sActionForm;
$this->sActionSave = $sActionSave;
$this->sActionExecute = $sActionExecute;
$this->sNamespace = $sNamespace;
$this->sActionId = $sActionId;
$this->sActionForm = $sActionForm;
$this->sActionSave = $sActionSave;
$this->sActionExecute = $sActionExecute;
$this->sActionGetFields = $sActionGetFields;
}
}
@@ -871,9 +810,9 @@ class taskExtendedProperty
public function __construct($sNamespace, $sPage, $sName, $sIcon)
{
$this->sNamespace = $sNamespace;
$this->sPage = $sPage;
$this->sName = $sName;
$this->sIcon = $sIcon;
$this->sPage = $sPage;
$this->sName = $sName;
$this->sIcon = $sIcon;
}
}
@@ -893,9 +832,9 @@ class dashboardPage
public function __construct($sNamespace, $sPage, $sName, $sIcon)
{
$this->sNamespace = $sNamespace;
$this->sPage = $sPage;
$this->sName = $sName;
$this->sIcon = $sIcon;
$this->sPage = $sPage;
$this->sName = $sName;
$this->sIcon = $sIcon;
}
}
@@ -913,7 +852,7 @@ class cronFile
public function __construct($namespace, $cronFile)
{
$this->namespace = $namespace;
$this->cronFile = $cronFile;
$this->cronFile = $cronFile;
}
}
@@ -931,7 +870,7 @@ class importCallBack
public function __construct($namespace, $callBackFile)
{
$this->namespace = $namespace;
$this->callBackFile = $callBackFile;
$this->callBackFile = $callBackFile;
}
}
@@ -947,6 +886,7 @@ class OpenReassignCallback
*/
public function __construct($callBackFile)
{
$this->callBackFile = $callBackFile;
$this->callBackFile = $callBackFile;
}
}