up observations
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
namespace Maveriks;
|
||||
|
||||
use Maveriks\Util;
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
use ProcessMaker\Services;
|
||||
use ProcessMaker\Services\Api;
|
||||
use Luracast\Restler\RestException;
|
||||
@@ -358,8 +359,8 @@ class WebApplication
|
||||
}
|
||||
|
||||
// hook to get rest api classes from plugins
|
||||
if (class_exists('PMPluginRegistry')) {
|
||||
$pluginRegistry = \PMPluginRegistry::loadSingleton(PATH_DATA_SITE . 'plugin.singleton');
|
||||
if (class_exists('ProcessMaker\Plugins\PluginRegistry')) {
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$plugins = $pluginRegistry->getRegisteredRestServices();
|
||||
|
||||
if (! empty($plugins)) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
//dont work mb_internal_encoding('UTF-8');
|
||||
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
|
||||
pake_desc('gulliver version');
|
||||
@@ -519,7 +519,7 @@ function run_pack_plugin($task, $args) {
|
||||
|
||||
require_once ($pluginFilename);
|
||||
|
||||
$oPluginRegistry = PluginsRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$pluginDetail = $oPluginRegistry->getPluginDetails($pluginName . '.php');
|
||||
$fileTar = $pluginHome . PATH_SEP . $pluginName . '-' . $pluginDetail->iVersion . '.tar';
|
||||
|
||||
|
||||
@@ -1101,7 +1101,7 @@ function run_migrate_plugin($args, $opts) {
|
||||
/** @var workspaceTools $workspace */
|
||||
if (count($workspaces) === 1) {
|
||||
$workspace = array_shift($workspaces);
|
||||
print_r('Regenerating Singleton in: ' . pakeColor::colorize($workspace->name, 'INFO') . "\n");
|
||||
CLI::logging('Regenerating Singleton in: ' . pakeColor::colorize($workspace->name, 'INFO') . "\n");
|
||||
$workspace->migrateSingleton($workspace->name);
|
||||
CLI::logging("-> Regenerating Singleton \n");
|
||||
} else {
|
||||
|
||||
0
workflow/engine/classes/class.Installer.php
Normal file
0
workflow/engine/classes/class.Installer.php
Normal file
@@ -25,6 +25,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
*
|
||||
* @package workflow.engine.classes
|
||||
@@ -142,7 +144,7 @@ class PMPluginRegistry
|
||||
*/
|
||||
public static function getSingleton()
|
||||
{
|
||||
return \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
return PluginRegistry::loadSingleton();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,7 +156,7 @@ class PMPluginRegistry
|
||||
*/
|
||||
public static function loadSingleton($file)
|
||||
{
|
||||
return \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
return PluginRegistry::loadSingleton();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -3888,13 +3888,13 @@ class workspaceTools
|
||||
$oPluginRegistry = unserialize(file_get_contents($pathSingleton));
|
||||
$pluginAdapter = new PluginAdapter();
|
||||
$pluginAdapter->migrate($oPluginRegistry);
|
||||
// $data["CFG_UID"] = 'MIGRATED_PLUGIN';
|
||||
// $data["OBJ_UID"] = 'singleton';
|
||||
// $data["CFG_VALUE"] = 'true';
|
||||
// $data["PRO_UID"] = '';
|
||||
// $data["USR_UID"] = '';
|
||||
// $data["APP_UID"] = '';
|
||||
// $conf->create($data);
|
||||
$data["CFG_UID"] = 'MIGRATED_PLUGIN';
|
||||
$data["OBJ_UID"] = 'singleton';
|
||||
$data["CFG_VALUE"] = 'true';
|
||||
$data["PRO_UID"] = '';
|
||||
$data["USR_UID"] = '';
|
||||
$data["APP_UID"] = '';
|
||||
$conf->create($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
* Skeleton subclass for representing a row from the 'APP_DELEGATION' table.
|
||||
*
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseAppFolder.php';
|
||||
//require_once 'classes/model/Application.php';
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
* @package workflow.engine.classes.model
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/om/BaseCaseScheduler.php';
|
||||
|
||||
//require_once 'classes/model/Process.php';
|
||||
//require_once 'classes/model/Task.php';
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
|
||||
@@ -66,7 +66,7 @@ class PluginsRegistry extends BasePluginsRegistry
|
||||
$aFields = $oPluginsRegistry->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
return $aFields;
|
||||
} else {
|
||||
throw new Exception("Plugin with $prUid does not exist!");
|
||||
throw new Exception("Plugin does not exist!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,6 +105,12 @@ class PluginsRegistry extends BasePluginsRegistry
|
||||
return $pluginData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a record in the PLUGINS_REGISTRY table
|
||||
* @param array $aData
|
||||
* @return bool
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function create($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection(PluginsRegistryPeer::DATABASE_NAME);
|
||||
@@ -131,6 +137,12 @@ class PluginsRegistry extends BasePluginsRegistry
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifies a record in the PLUGINS_REGISTRY table
|
||||
* @param array $aData
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function update($aData)
|
||||
{
|
||||
$oConnection = Propel::getConnection(PluginsRegistryPeer::DATABASE_NAME);
|
||||
@@ -161,6 +173,12 @@ class PluginsRegistry extends BasePluginsRegistry
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate a plugin with your name
|
||||
* @param string $Namespace
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function enable($Namespace)
|
||||
{
|
||||
$oConnection = Propel::getConnection(PluginsRegistryPeer::DATABASE_NAME);
|
||||
@@ -191,6 +209,12 @@ class PluginsRegistry extends BasePluginsRegistry
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable a plugin with your name
|
||||
* @param string $Namespace
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function disable($Namespace)
|
||||
{
|
||||
$oConnection = Propel::getConnection(PluginsRegistryPeer::DATABASE_NAME);
|
||||
|
||||
@@ -325,12 +325,14 @@ class UsersProperties extends BaseUsersProperties
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$aRedirectLogin = $oPluginRegistry->getRedirectLogins();
|
||||
if (isset($aRedirectLogin) && is_array($aRedirectLogin)) {
|
||||
foreach ($aRedirectLogin as $key => $detail) {
|
||||
if (isset( $detail->sPathMethod ) && $detail->sRoleCode == $userRole) {
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\RedirectDetail $detail */
|
||||
foreach ($aRedirectLogin as $detail) {
|
||||
$pathMethod = $detail->getPathMethod();
|
||||
if (isset($pathMethod) && $detail->equalRoleCodeTo($userRole)) {
|
||||
if (isset($_COOKIE['workspaceSkin'])) {
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $detail->sPathMethod;
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . $_COOKIE['workspaceSkin'] . '/' . $pathMethod;
|
||||
} else {
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/' . $detail->sPathMethod;
|
||||
$url = '/sys' . SYS_SYS . '/' . $this->lang . '/' . SYS_SKIN . '/' . $pathMethod;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1) {
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$pluginRegistry = PluginRegistry::loadSingleton(); //lsl
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$status = $pluginRegistry->getStatusPlugin('actionsByEmail');
|
||||
|
||||
if ((string)($status) !== 'enabled' &&
|
||||
|
||||
@@ -40,9 +40,9 @@ if ($aux['extension'] != 'dat') {
|
||||
$pluginRegistry = ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\PluginDetail $plugin */
|
||||
foreach ($pluginRegistry->getPlugins() as $plugin) {
|
||||
if ($plugin->isEnabled() && !in_array($plugin->getNamespace(), $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->getNamespace());
|
||||
$pluginRegistry->savePlugin($plugin->getNamespace());
|
||||
if ($plugin->enabled && !in_array($plugin->sNamespace, $licenseManager->features)) {
|
||||
$pluginRegistry->disablePlugin($plugin->sNamespace);
|
||||
$pluginRegistry->savePlugin($plugin->sNamespace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
//Browser Compatibility
|
||||
$browserSupported = G::checkBrowserCompatibility();
|
||||
@@ -109,7 +112,7 @@ if (isset ($_SESSION['USER_LOGGED'])) {
|
||||
}
|
||||
} else {
|
||||
// Execute SSO trigger
|
||||
$pluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
if (defined('PM_SINGLE_SIGN_ON')) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$resultRbac = $RBAC->requirePermissions('PM_SETUP_ADVANCE', 'PM_SETUP_LOGS');
|
||||
if (!$resultRbac) {
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
@@ -47,7 +50,7 @@ $status = array(
|
||||
array("pending", G::LoadTranslation('ID_PENDING'))
|
||||
);
|
||||
|
||||
$pluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$flagER = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
||||
|
||||
$processes = getProcessArray($userUid);
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<?php
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$req = (isset($_POST['request']))? $_POST['request']:((isset($_REQUEST['request']))? $_REQUEST['request'] : 'No hayyy tal');
|
||||
|
||||
require_once 'classes/model/Content.php';
|
||||
@@ -36,7 +39,7 @@ switch($req){
|
||||
|
||||
$arrayType = [];
|
||||
|
||||
$pluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$flagEr = $pluginRegistry->isEnable('externalRegistration') ? 1 : 0;
|
||||
|
||||
if ($flagEr == 0) {
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$access = $RBAC->userCanAccess( 'PM_FACTORY' );
|
||||
if ($access != 1) {
|
||||
switch ($access) {
|
||||
@@ -43,7 +46,7 @@ if ($access != 1) {
|
||||
}
|
||||
|
||||
//call plugins
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry->executeTriggers( PM_NEW_PROCESS_LIST, NULL );
|
||||
|
||||
$aFields['MESSAGE1'] = G::LoadTranslation( 'ID_MSG_ERROR_PRO_TITLE' );
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$function = isset( $_POST['function'] ) ? $_POST['function'] : '';
|
||||
$infoProcess = new Process();
|
||||
$resultProcessOld = $infoProcess->load($_POST['form']['PRO_UID']);
|
||||
@@ -68,7 +70,7 @@ switch ($function) {
|
||||
$oData['PRO_TEMPLATE'] = (isset( $_POST['form']['PRO_TEMPLATE'] ) && $_POST['form']['PRO_TEMPLATE'] != '') ? $_POST['form']['PRO_TEMPLATE'] : '';
|
||||
$oData['PROCESSMAP'] = $oProcessMap;
|
||||
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry->executeTriggers( PM_NEW_PROCESS_SAVE, $oData );
|
||||
|
||||
G::header( 'location: processes_Map?PRO_UID=' . $sProUid );
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
switch ($RBAC->userCanAccess( 'PM_REPORTS' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
@@ -74,7 +77,7 @@ $reports[] = array ('RPT_NUMBER' => count( $reports ),'RPT_UID' => 5,'RPT_TITLE'
|
||||
'RPT_TITLE' => "Report 9",//G::LoadTranslation('ID_REPORT6'),
|
||||
'VIEW' => G::LoadTranslation('ID_VIEW'));*/
|
||||
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$aAvailableReports = $oPluginRegistry->getReports();
|
||||
|
||||
//$aReports = array();
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
* Report - Report view
|
||||
*
|
||||
@@ -210,7 +212,7 @@ try {
|
||||
break;
|
||||
default:
|
||||
$foundReport = false;
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$aAvailableReports = $oPluginRegistry->getReports();
|
||||
foreach ($aAvailableReports as $sReportClass) {
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
* @Updated Dec 14, 2009 by Erik <erik@colosa.com>
|
||||
*
|
||||
@@ -138,7 +140,7 @@ if (isset( $_FILES ) && $_FILES["ATTACH_FILE"]["error"] == 0) {
|
||||
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( "uploadDocumentData" )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*/
|
||||
|
||||
// lets display the items
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$pluginFile = $_GET['id'];
|
||||
$pluginStatus = $_GET['status'];
|
||||
|
||||
@@ -32,7 +34,7 @@ $filter = new InputFilter();
|
||||
$path = PATH_PLUGINS . $pluginFile;
|
||||
$path = $filter->validateInput($path, 'path');
|
||||
|
||||
$oPluginRegistry =& ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
if ($handle = opendir(PATH_PLUGINS)) {
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
@@ -41,7 +43,7 @@ if ($handle = opendir(PATH_PLUGINS)) {
|
||||
// change to disable
|
||||
$details = $oPluginRegistry->getPluginDetails($pluginFile);
|
||||
$oPluginRegistry->disablePlugin($details->getNamespace());
|
||||
//$oPluginRegistry->adapter->savePlugin($details->sNamespace, $oPluginRegistry);
|
||||
$oPluginRegistry->savePlugin($details->sNamespace);
|
||||
G::auditLog("DisablePlugin", "Plugin Name: " . $details->getNamespace());
|
||||
} else {
|
||||
$pluginName = str_replace(".php", "", $pluginFile);
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
global $RBAC;
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$access = $RBAC->userCanAccess( 'PM_SETUP_ADVANCE' );
|
||||
if ($access != 1) {
|
||||
switch ($access) {
|
||||
@@ -43,7 +46,7 @@ if ($access != 1) {
|
||||
}
|
||||
}
|
||||
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'SETUP';
|
||||
$G_SUB_MENU = 'setup';
|
||||
|
||||
@@ -22,27 +22,13 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/*
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_SETUP_ADVANCE'))
|
||||
{
|
||||
case -2:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
case -1:
|
||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||
G::header('location: ../login/login');
|
||||
die;
|
||||
break;
|
||||
}*/
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$filter = new InputFilter();
|
||||
$pluginName = $_REQUEST['pluginUid'];
|
||||
$pluginName = $filter->xssFilterHard($pluginName);
|
||||
|
||||
$pluginRegistry =& ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$pluginRegistry = PluginRegistry::loadSingleton();
|
||||
$pluginRegistry->uninstallPlugin($pluginName);
|
||||
|
||||
G::auditLog('RemovePlugin', 'Plugin Name: ' . $pluginName);
|
||||
|
||||
@@ -22,9 +22,11 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$pluginFile = $_GET['id'];
|
||||
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
$folder = $details->getFolder();
|
||||
|
||||
@@ -22,9 +22,11 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$pluginFile = $_GET['id'];
|
||||
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
$details = $oPluginRegistry->getPluginDetails( $pluginFile );
|
||||
try {
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
try {
|
||||
$filter = new InputFilter();
|
||||
$_POST = $filter->xssFilterHard($_POST);
|
||||
@@ -178,7 +181,7 @@ try {
|
||||
|
||||
//If plugin and trigger are defined for listing
|
||||
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $aFields['APP_UID'] );
|
||||
//Now search for the file, if exists the change the download URL
|
||||
foreach ($filesPluginArray as $file) {
|
||||
|
||||
@@ -61,12 +61,26 @@ class PluginRegistry
|
||||
*/
|
||||
public static function loadSingleton()
|
||||
{
|
||||
if (self::$instance == null) {
|
||||
if (self::$instance === null) {
|
||||
self::$instance = new PluginRegistry();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the singleton instance from a serialized stored file
|
||||
* @return PluginRegistry
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function newInstance()
|
||||
{
|
||||
self::$instance = new PluginRegistry();
|
||||
if (! is_object(self::$instance) || get_class(self::$instance) != "ProcessMaker\Plugins\PluginRegistry") {
|
||||
throw new Exception("Can't load main PluginRegistry object.");
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the plugin in the singleton
|
||||
* @param string $Namespace Name Plugin
|
||||
@@ -113,7 +127,8 @@ class PluginRegistry
|
||||
if ($pluginDetail->isEnabled()) {
|
||||
if (!empty($pluginDetail->getFile()) && file_exists($pluginDetail->getFile())) {
|
||||
$arrayFileInfo = pathinfo($pluginDetail->getFile());
|
||||
$Filename = (($pluginDetail->getNamespace() == "enterprise") ?
|
||||
$Filename = (
|
||||
($pluginDetail->getNamespace() == "enterprise") ?
|
||||
PATH_CORE . "methods" . PATH_SEP . "enterprise" . PATH_SEP :
|
||||
PATH_PLUGINS
|
||||
) . $arrayFileInfo["basename"];
|
||||
@@ -403,7 +418,6 @@ class PluginRegistry
|
||||
$pluginRegistry->savePlugin($value);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -840,7 +854,6 @@ class PluginRegistry
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return $found;
|
||||
|
||||
@@ -248,9 +248,7 @@ trait PluginStructure
|
||||
*/
|
||||
private function buildRestService($restServices)
|
||||
{
|
||||
foreach ($restServices as $restService) {
|
||||
$this->_restServices = array_merge($this->_restServices, $restService);
|
||||
}
|
||||
$this->_restServices = array_merge($this->_restServices, $restServices);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -264,7 +262,7 @@ trait PluginStructure
|
||||
foreach ($attributes as $key => $value) {
|
||||
$this->_aPlugins[$namespace]->{$key} = $value;
|
||||
if (property_exists($this, $key)) {
|
||||
$this->{$key} = array_merge($this->{$key}, $value);
|
||||
$this->{$key} = array_merge($this->{$key}, (array)$value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -288,8 +286,7 @@ trait PluginStructure
|
||||
foreach ($PluginRegistry as $propertyName => $propertyValue) {
|
||||
foreach ($propertyValue as $key => $plugin) {
|
||||
if (is_object($plugin) &&
|
||||
((property_exists($plugin, 'Namespace') && $plugin->equalNamespaceTo($Namespace)) ||
|
||||
(!is_int($key) && $key == $Namespace))
|
||||
property_exists($plugin, 'Namespace') && $plugin->equalNamespaceTo($Namespace)
|
||||
) {
|
||||
$newStructurePlugin[$propertyName][] = $plugin;
|
||||
} elseif (is_object($plugin) &&
|
||||
@@ -297,6 +294,8 @@ trait PluginStructure
|
||||
$plugin->pluginName == $Namespace
|
||||
) {
|
||||
$newStructurePlugin[$propertyName][] = $plugin;
|
||||
} elseif (is_string($key) && $key == $Namespace) {
|
||||
$newStructurePlugin[$propertyName][$key] = $plugin;
|
||||
} elseif (is_string($plugin) && $plugin == $Namespace) {
|
||||
$newStructurePlugin[$propertyName][] = $plugin;
|
||||
}
|
||||
|
||||
@@ -23,12 +23,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
$c = new Criteria();
|
||||
$c->add ( StepPeer::PRO_UID, $_SESSION['PROCESS'] );
|
||||
$c->add ( StepPeer::TAS_UID, $_SESSION['TASK'] );
|
||||
$c->addAscendingOrderByColumn ( StepPeer::STEP_POSITION );
|
||||
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$externalSteps = $oPluginRegistry->getSteps();
|
||||
|
||||
$oTree = new Tree();
|
||||
@@ -70,7 +72,7 @@
|
||||
$sType = $oDocument->getInpDocFormNeeded(); break;
|
||||
case 'EXTERNAL':
|
||||
$stepTitle = 'unknown ' . $aRow->getStepUidObj();
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton ();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $val */
|
||||
foreach ( $externalSteps as $val ) {
|
||||
if ($val->equalStepIdTo($aRow->getStepUidObj())) {
|
||||
@@ -185,11 +187,12 @@
|
||||
break;
|
||||
case 'EXTERNAL':
|
||||
$aActions = array ('action' => 'label' );
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton ();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
/** @var \ProcessMaker\Plugins\Interfaces\StepDetail $val */
|
||||
foreach ( $externalSteps as $key=>$val ) {
|
||||
if ( $val->sStepId == $aRow->getStepUidObj() ) {
|
||||
$stepTitle = $val->sStepTitle; //default title
|
||||
$sNamespace = $val->sNamespace;
|
||||
if ($val->equalStepIdTo($aRow->getStepUidObj())) {
|
||||
$stepTitle = $val->getStepTitle(); //default title
|
||||
$sNamespace = $val->getNamespace();
|
||||
$oPlugin =& $oPluginRegistry->getPlugin($sNamespace);
|
||||
$classFile = PATH_PLUGINS . $oPlugin->sNamespace . PATH_SEP . 'class.' . $oPlugin->sNamespace .'.php';
|
||||
if ( file_exists ( $classFile ) ) {
|
||||
|
||||
@@ -23,10 +23,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
try {
|
||||
|
||||
//call plugin
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
$externalSteps = $oPluginRegistry->getSteps();
|
||||
|
||||
$oProcessMap = new ProcessMap();
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
use ProcessMaker\Plugins\PluginRegistry;
|
||||
|
||||
/**
|
||||
* sysGeneric - ProcessMaker Bootstrap
|
||||
* this file is used initialize main variables, redirect and dispatch all requests
|
||||
@@ -419,7 +421,7 @@
|
||||
|
||||
//here we are loading all plugins registered
|
||||
//the singleton has a list of enabled plugins
|
||||
$oPluginRegistry = \ProcessMaker\Plugins\PluginRegistry::loadSingleton();
|
||||
$oPluginRegistry = PluginRegistry::loadSingleton();
|
||||
|
||||
// setup propel definitions and logging
|
||||
require_once ( "propel/Propel.php" );
|
||||
|
||||
Reference in New Issue
Block a user