BUG 10158 I added the colors in case tracker to stages SOLVED

I added the colors in case tracker to stages
This commit is contained in:
Brayan Osmar Pereyra Suxo
2012-12-10 13:03:08 -04:00
parent f4186e6653
commit 8f71c54eab
4 changed files with 173 additions and 119 deletions

View File

@@ -62,20 +62,20 @@ try {
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode( '
var pb=leimnud.dom.capture("tag.body 0");
Sm=new stagesmap();
Sm.options = {
target : "sm_target",
dataServer: "../tracker/tracker_Ajax",
uid : "' . $_POST['PRO_UID'] . '",
lang : "' . SYS_LANG . '",
theme : "processmaker",
size : {w:"780",h:"540"},
images_dir: "/jscore/processmap/core/images/",
rw : true,
hideMenu : false
};
$oHeadPublisher->addScriptCode( '
var pb=leimnud.dom.capture("tag.body 0");
Sm=new stagesmap();
Sm.options = {
target : "sm_target",
dataServer: "../tracker/tracker_Ajax",
uid : "' . $_POST['PRO_UID'] . '",
lang : "' . SYS_LANG . '",
theme : "processmaker",
size : {w:"780",h:"540"},
images_dir: "/jscore/processmap/core/images/",
rw : true,
hideMenu : false
};
Sm.make();' );
G::RenderPage( 'publish', 'raw' );
break;
@@ -122,11 +122,11 @@ try {
$oAppDocument->Fields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
$oAppDocument->Fields['FILE'] = 'tracker_ShowDocument?a=' . $_POST['APP_DOC_UID'] . '&r=' . rand();
//If plugin and trigger are defined for listing
//If plugin and trigger are defined for listing
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $_SESSION['APPLICATION'] );
//Now search for the file, if exists the change the download URL
//Now search for the file, if exists the change the download URL
foreach ($filesPluginArray as $file) {
if ($file->filename == $_POST['APP_DOC_UID']) {
$oAppDocument->Fields['FILE'] = $file->downloadScript;
@@ -165,14 +165,14 @@ try {
$aFields['FILE1'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
$aFields['FILE2'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
//If plugin and trigger are defined for listing
//If plugin and trigger are defined for listing
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $aFields['APP_UID'] );
//Now search for the file, if exists the change the download URL
//Now search for the file, if exists the change the download URL
foreach ($filesPluginArray as $file) {
if ($file->filename == $_POST['APP_DOC_UID']) {
$aFields['FILE2'] = $file->downloadScript; // The PDF is the only one uploaded to KT
$aFields['FILE2'] = $file->downloadScript; // The PDF is the only one uploaded to KT
}
}
}
@@ -183,13 +183,13 @@ try {
break;
case 'load':
$oConnection = Propel::getConnection( 'workflow' );
$oStatement = $oConnection->prepareStatement( "CREATE TABLE IF NOT EXISTS `STAGE` (
`STG_UID` VARCHAR( 32 ) NOT NULL ,
`PRO_UID` VARCHAR( 32 ) NOT NULL ,
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
PRIMARY KEY ( `STG_UID` )
$oStatement = $oConnection->prepareStatement( "CREATE TABLE IF NOT EXISTS `STAGE` (
`STG_UID` VARCHAR( 32 ) NOT NULL ,
`PRO_UID` VARCHAR( 32 ) NOT NULL ,
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
PRIMARY KEY ( `STG_UID` )
);" );
$oStatement->executeQuery();
/**
@@ -204,8 +204,8 @@ try {
$oProcess = new Process();
$aRow = $oProcess->load( $oData->uid );
$oSM->title->label = strip_tags( $aRow['PRO_TITLE'] );
//$oSM->title->position->x = $aRow['PRO_TITLE_X'];
//$oSM->title->position->y = $aRow['PRO_TITLE_Y'];
//$oSM->title->position->x = $aRow['PRO_TITLE_X'];
//$oSM->title->position->y = $aRow['PRO_TITLE_Y'];
$oSM->title->position->x = 10;
$oSM->title->position->y = 10;
$oSM->stages = array ();
@@ -249,6 +249,22 @@ try {
$oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL )->addOr( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, '' ) ) );
if (AppDelegationPeer::doCount( $oCriteria ) > 0) {
$oStage->color = '#FF0000';
} else {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
$oCriteria->add( AppDelegationPeer::DEL_THREAD_STATUS, 'CLOSED' );
if (AppDelegationPeer::doCount( $oCriteria ) > 0) {
$oStage->color = '#006633';
} else {
$oCriteria = new Criteria( 'workflow' );
$oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
$oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
if (AppDelegationPeer::doCount( $oCriteria ) == 0) {
$oStage->color = '#939598';
}
}
}
}
$oSM->stages[] = $oStage;