Extended Property for Tasks
This commit is contained in:
@@ -297,6 +297,26 @@ class caseSchedulerPlugin {
|
||||
$this->sActionGetFields = $sActionGetFields;
|
||||
}
|
||||
}
|
||||
class taskExtendedProperty {
|
||||
var $sNamespace;
|
||||
var $sPage;
|
||||
var $sName;
|
||||
var $sIcon;
|
||||
/**
|
||||
* This function is the constructor of the taskExtendedProperty class
|
||||
* @param string $sNamespace
|
||||
* @param string $sPage
|
||||
* @param string $sName
|
||||
* @param string $sIcon
|
||||
* @return void
|
||||
*/
|
||||
function __construct( $sNamespace, $sPage, $sName, $sIcon ) {
|
||||
$this->sNamespace = $sNamespace;
|
||||
$this->sPage = $sPage;
|
||||
$this->sName = $sName;
|
||||
$this->sIcon = $sIcon;
|
||||
}
|
||||
}
|
||||
|
||||
class PMPlugin {
|
||||
var $sNamespace;
|
||||
@@ -516,4 +536,13 @@ class PMPlugin {
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->registerCaseSchedulerPlugin( $this->sNamespace, $sActionId, $sActionForm, $sActionSave, $sActionExecute, $sActionGetFields );
|
||||
}
|
||||
/**
|
||||
* With this function we can register a Dashboard Page for Cases Dashboard
|
||||
* @param string $sPage
|
||||
* @return void
|
||||
*/
|
||||
function registerTaskExtendedProperty( $sPage, $sName, $sIcon="") {
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->registerTaskExtendedProperty ( $this->sNamespace, $sPage, $sName, $sIcon );
|
||||
}
|
||||
}
|
||||
@@ -79,6 +79,7 @@ class PMPluginRegistry {
|
||||
private $_aCSSStyleSheets = array();
|
||||
private $_aToolbarFiles = array();
|
||||
private $_aCaseSchedulerPlugin = array();
|
||||
private $_aTaskExtendedProperties = array();
|
||||
|
||||
static private $instance = NULL;
|
||||
|
||||
@@ -148,8 +149,8 @@ class PMPluginRegistry {
|
||||
function registerPlugin( $sNamespace, $sFilename = null)
|
||||
{
|
||||
$sClassName = $sNamespace . 'plugin';
|
||||
//if ( isset( $this->_aPluginDetails[$sNamespace] ) )
|
||||
// return;
|
||||
if ( isset( $this->_aPluginDetails[$sNamespace] ) )
|
||||
return;
|
||||
//require_once ( $sFilename );
|
||||
$plugin = new $sClassName ($sNamespace, $sFilename);
|
||||
$detail = new pluginDetail (
|
||||
@@ -165,9 +166,9 @@ class PMPluginRegistry {
|
||||
$detail->aWorkspaces = $plugin->aWorkspaces;
|
||||
if ( isset ($plugin->bPrivate) )
|
||||
$detail->bPrivate = $plugin->bPrivate;
|
||||
if ( isset( $this->_aPluginDetails[$sNamespace] ) ){
|
||||
$detail->enabled=$this->_aPluginDetails[$sNamespace]->enabled;
|
||||
}
|
||||
//if ( isset( $this->_aPluginDetails[$sNamespace] ) ){
|
||||
// $detail->enabled=$this->_aPluginDetails[$sNamespace]->enabled;
|
||||
//}
|
||||
$this->_aPluginDetails[$sNamespace] = $detail;
|
||||
}
|
||||
|
||||
@@ -274,6 +275,12 @@ class PMPluginRegistry {
|
||||
if ( $detail->sNamespace == $sNamespace )
|
||||
unset ( $this->_aCaseSchedulerPlugin[ $key ] );
|
||||
}
|
||||
foreach ( $this->_aTaskExtendedProperties as $key=>$detail ) {
|
||||
if ( $detail->sNamespace == $sNamespace )
|
||||
unset ( $this->_aTaskExtendedProperties[ $key ] );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -921,4 +928,35 @@ class PMPluginRegistry {
|
||||
function getCaseSchedulerPlugins( ) {
|
||||
return $this->_aCaseSchedulerPlugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a Task Extended property page in the singleton
|
||||
*
|
||||
* @param unknown_type $sNamespace
|
||||
* @param unknown_type $sPage
|
||||
*/
|
||||
|
||||
function registerTaskExtendedProperty($sNamespace, $sPage, $sName, $sIcon ) {
|
||||
$found = false;
|
||||
foreach ( $this->_aTaskExtendedProperties as $row=>$detail ) {
|
||||
if ( $sPage == $detail->sPage && $sNamespace == $detail->sNamespace ){
|
||||
$detail->sName=$sName;
|
||||
$detail->sIcon=$sIcon;
|
||||
$found = true;
|
||||
}
|
||||
}
|
||||
if ( !$found ) {
|
||||
$taskExtendedProperty = new taskExtendedProperty ($sNamespace, $sPage, $sName, $sIcon);
|
||||
$this->_aTaskExtendedProperties[] = $taskExtendedProperty;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* return all dashboard pages
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function getTaskExtendedProperties() {
|
||||
return $this->_aTaskExtendedProperties;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,6 +354,16 @@ class processMap {
|
||||
$oDataset->next();
|
||||
}
|
||||
$oPM->derivation = array('Sequential', 'Evaluate (manual)', 'Evaluate (auto)', 'Parallel (fork)', 'Parallel by evaluation (fork)', 'Parallel (sequential join)', 'Parallel (sequential main join)');
|
||||
|
||||
//Load extended task properties from plugin. By JHL Jan 18, 2011
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$activePluginsForTaskProperties=$oPluginRegistry->getTaskExtendedProperties();
|
||||
$oPM->taskOptions = array();
|
||||
foreach($activePluginsForTaskProperties as $key => $taskPropertiesInfo){
|
||||
$taskOption['title']=$taskPropertiesInfo->sName;
|
||||
$taskOption['id']=$taskPropertiesInfo->sNamespace."--".$taskPropertiesInfo->sName;
|
||||
$oPM->taskOptions[]=$taskOption;
|
||||
}
|
||||
|
||||
$oJSON = new Services_JSON ( );
|
||||
return $oJSON->encode($oPM);
|
||||
@@ -1293,6 +1303,21 @@ class processMap {
|
||||
case 7 :
|
||||
$sFilename = 'tasks/tasks_Notifications.xml';
|
||||
break;
|
||||
default:
|
||||
print "<h1>$iForm</h1>";
|
||||
//if the $iForm is not one of the defaults then search under Plugins for an extended property. By JHL Jan 18, 2011
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$activePluginsForTaskProperties=$oPluginRegistry->getTaskExtendedProperties();
|
||||
$oPM->taskOptions = array();
|
||||
foreach($activePluginsForTaskProperties as $key => $taskPropertiesInfo){
|
||||
$id=$taskPropertiesInfo->sNamespace."--".$taskPropertiesInfo->sName;
|
||||
if($id==$iForm){
|
||||
$sFilename=$taskPropertiesInfo->sPage;
|
||||
}
|
||||
}
|
||||
|
||||
//$sFilename = 'tasks/tasks_Owner.xml';
|
||||
break;
|
||||
}
|
||||
$oTask = new Task ( );
|
||||
$aFields = $oTask->load($sTaskUID);
|
||||
|
||||
Reference in New Issue
Block a user