up observations

This commit is contained in:
Ronald Quenta
2017-08-04 09:32:25 -04:00
parent 6ca19b77c9
commit 651d22a71d
32 changed files with 145 additions and 82 deletions

View 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();
}
/**

View File

@@ -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);
}
}
}

View File

@@ -25,6 +25,8 @@
*
*/
use ProcessMaker\Plugins\PluginRegistry;
/**
* Skeleton subclass for representing a row from the 'APP_DELEGATION' table.
*

View File

@@ -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;
/**

View File

@@ -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;
/**

View File

@@ -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);

View File

@@ -324,13 +324,15 @@ 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) {
if (isset($aRedirectLogin) && is_array($aRedirectLogin)) {
/** @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;
}
}
}