PM-3193 "Prepare integration of new Valeo simplified designer in process list" SOLVED
Issue:
Prepare integration of new Valeo simplified designer in process list
Cause:
Nuevo requerimiento de funciones
Solution:
> Se a implementado "DESIGNER: New options in menu" para los plugins; para lo cual se define
en el archivo principal del plugin, lo siguiente (ejemplo):
public function setup()
{ ...
$this->registerDesignerMenu(PATH_PLUGINS . "DemoDesignerMenu/classes/DesignerMenuDemoDesignerMenu.php");
...
}
El archivo "DesignerMenuDemoDesignerMenu.php" es una clase donde se define las nuevas opciones
para el "Menu New" y "Context Menu"
> Se a implementado "DESIGNER: Edit process" para los plugins; en el listado de procesos (esto en DESIGNER)
al hacer doble-click en un proceso, se inicia el modulo para la edicion del proceso, esto tambien
puede ser customizado en el plugin, para lo cual se debera realizar lo siguiente:
- Cambiar en la Base de Datos el valor del campo PROCESS.PRO_TYPE por un nuevo tipo:
* Ejemplo: PRO_TYPE = 'CPF_STANDARD_TPL'
- Registrar un archivo JavaScript para el plugin, esto se define en el archivo principal del
plugin (ejemplo):
public function setup()
{ ...
$this->registerJavascript("processes/main", "DemoDesignerMenu/MyJavaScript.js");
...
}
- En el archivo "MyJavaScript.js" se debe definir la siguiente funcion:
function CPF_STANDARD_TPLDesignerGridRowDblClick(...)
{ ...
}
- Ejemplos de "PROCESS.PRO_TYPE" y la funcion "DesignerGridRowDblClick":
* Ejemplo: PRO_TYPE = 'CPF-STANDARD-TPL' => function CPF_STANDARD_TPLDesignerGridRowDblClick(...)
* Ejemplo: PRO_TYPE = 'CPF STANDARD TPL' => function CPF_STANDARD_TPLDesignerGridRowDblClick(...)
> Se adjunta el plugin "DemoDesignerMenu-1.tar" como ejmplo
This commit is contained in:
@@ -101,7 +101,7 @@ class PMPluginRegistry
|
||||
private $_aTaskExtendedProperties = array ();
|
||||
private $_aDashboardPages = array ();
|
||||
private $_aCronFiles = array ();
|
||||
private $_aDesignerMenuFiles = array ();
|
||||
private $_arrayDesignerMenu = array();
|
||||
|
||||
/**
|
||||
* Registry a plugin javascript to include with js core at same runtime
|
||||
@@ -392,9 +392,10 @@ class PMPluginRegistry
|
||||
unset( $this->_aDashboardPages[$key] );
|
||||
}
|
||||
}
|
||||
foreach ($this->_aDesignerMenuFiles as $key => $detail) {
|
||||
if ($detail->namespace == $sNamespace) {
|
||||
unset( $this->_aDesignerMenuFiles[$key] );
|
||||
|
||||
foreach ($this->_arrayDesignerMenu as $key => $detail) {
|
||||
if ($detail->pluginName == $sNamespace) {
|
||||
unset($this->_arrayDesignerMenu[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1607,35 +1608,51 @@ class PMPluginRegistry
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Register new options to designer menu
|
||||
* Register designer menu file
|
||||
*
|
||||
* @param unknown_type $namespace
|
||||
* @param unknown_type $cronFile
|
||||
* @param string $pluginName Plugin name
|
||||
* @param string $file Designer menu file
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function registerDesignerNewOption ($namespace, $menuOptionFile)
|
||||
public function registerDesignerMenu($pluginName, $file)
|
||||
{
|
||||
$found = false;
|
||||
foreach ($this->_aDesignerMenuFiles as $row => $detail) {
|
||||
if ($menuOptionFile == $detail->menuOptionFile && $namespace == $detail->namespace) {
|
||||
$detail->menuOptionFile = $menuOptionFile;
|
||||
$found = true;
|
||||
try {
|
||||
$flagFound = false;
|
||||
|
||||
foreach ($this->_arrayDesignerMenu as $value) {
|
||||
if ($value->pluginName == $pluginName && $value->file == $file) {
|
||||
$flagFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$found) {
|
||||
$menuOptionFile = new menuOptionFile( $namespace, $menuOptionFile );
|
||||
$this->_aDesignerMenuFiles[] = $menuOptionFile;
|
||||
|
||||
if (!$flagFound) {
|
||||
$obj = new stdClass();
|
||||
$obj->pluginName = $pluginName;
|
||||
$obj->file = $file;
|
||||
|
||||
$this->_arrayDesignerMenu[] = $obj;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return all designer menu Option files registered
|
||||
* Return all designer menu files registered
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getDesignerNewOption()
|
||||
public function getDesignerMenu()
|
||||
{
|
||||
return $this->_aDesignerMenuFiles;
|
||||
try {
|
||||
return $this->_arrayDesignerMenu;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user