2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
if (! isset ( $_REQUEST ['action'] )) {
|
|
|
|
|
$res ['success'] = 'failure';
|
|
|
|
|
$res ['message'] = 'You may request an action';
|
|
|
|
|
print G::json_encode ( $res);
|
|
|
|
|
die ();
|
|
|
|
|
}
|
|
|
|
|
if (! function_exists ( $_REQUEST ['action'] )) {
|
|
|
|
|
$res ['success'] = 'failure';
|
2012-07-25 16:51:09 -04:00
|
|
|
$res ['message'] = 'The requested action does not exist';
|
2010-12-02 23:34:41 +00:00
|
|
|
print G::json_encode ( $res );
|
|
|
|
|
die ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$functionName = $_REQUEST ['action'];
|
|
|
|
|
$functionParams = isset ( $_REQUEST ['params'] ) ? $_REQUEST ['params'] : array ();
|
|
|
|
|
|
|
|
|
|
$functionName ( $functionParams );
|
|
|
|
|
|
|
|
|
|
function getProcessList() {
|
|
|
|
|
G::LoadClass ( 'case' );
|
|
|
|
|
G::LoadClass ( 'process' );
|
|
|
|
|
G::LoadClass ( 'calendar' );
|
|
|
|
|
$calendar = new Calendar ( );
|
|
|
|
|
$oProcess = new Process ( );
|
|
|
|
|
$oCase = new Cases ( );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2011-02-24 13:48:21 +00:00
|
|
|
//Get ProcessStatistics Info
|
|
|
|
|
$start = 0;
|
|
|
|
|
$limit = '';
|
2012-10-12 12:46:35 -04:00
|
|
|
$proData = $oProcess->getAllProcesses($start, $limit, null, null, false, true);
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$bCanStart = $oCase->canStartCase ( $_SESSION ['USER_LOGGED'] );
|
|
|
|
|
if ($bCanStart) {
|
|
|
|
|
$processListInitial = $oCase->getStartCasesPerType ( $_SESSION ['USER_LOGGED'], 'category' );
|
|
|
|
|
$processList = array ();
|
|
|
|
|
foreach ( $processListInitial as $key => $procInfo ) {
|
2011-01-12 15:44:00 +00:00
|
|
|
if (isset ( $procInfo ['pro_uid'] )) {
|
2010-12-02 23:34:41 +00:00
|
|
|
if (trim ( $procInfo ['cat'] ) == "")
|
|
|
|
|
$procInfo ['cat'] = "_OTHER_";
|
|
|
|
|
$processList [$procInfo ['catname']] [$procInfo ['value']] = $procInfo;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ksort ( $processList );
|
|
|
|
|
foreach ( $processList as $key => $processInfo ) {
|
|
|
|
|
ksort ( $processList [$key] );
|
|
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
if (! isset ( $_REQUEST ['node'] )) {
|
|
|
|
|
$node = 'root';
|
|
|
|
|
} else {
|
|
|
|
|
$node = $_REQUEST ['node'];
|
|
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
|
|
|
|
|
2010-12-23 22:31:14 +00:00
|
|
|
foreach($proData as $key => $proInfo){
|
|
|
|
|
$proData[$proInfo['PRO_UID']]=$proInfo;
|
|
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$processListTree = array ();
|
2011-03-30 17:52:27 -04:00
|
|
|
if (1) {
|
2010-12-02 23:34:41 +00:00
|
|
|
foreach ( $processList as $key => $processInfo ) {
|
|
|
|
|
$tempTree ['text'] = $key;
|
|
|
|
|
$tempTree ['id'] = $key;
|
|
|
|
|
$tempTree ['cls'] = 'folder';
|
|
|
|
|
$tempTree ['draggable'] = true;
|
|
|
|
|
$tempTree ['optionType'] = "category";
|
|
|
|
|
//$tempTree['allowDrop']=false;
|
|
|
|
|
$tempTree ['singleClickExpand'] = true;
|
|
|
|
|
if ($key != "No Category") {
|
|
|
|
|
$tempTree ['expanded'] = true;
|
|
|
|
|
} else {
|
|
|
|
|
//$tempTree ['expanded'] = false;
|
|
|
|
|
$tempTree ['expanded'] = true;
|
|
|
|
|
}
|
|
|
|
|
$tempTreeChildren=array();
|
|
|
|
|
foreach ( $processList [$key] as $keyChild => $processInfoChild ) {
|
|
|
|
|
//print_r($processInfo);
|
2011-03-30 17:52:27 -04:00
|
|
|
$tempTreeChild ['text'] = $keyChild; //ellipsis ( $keyChild, 50 );
|
2010-12-02 23:34:41 +00:00
|
|
|
//$tempTree['text']=$key;
|
|
|
|
|
$tempTreeChild ['id'] = $keyChild;
|
|
|
|
|
$tempTreeChild ['draggable'] = true;
|
|
|
|
|
$tempTreeChild ['leaf'] = true;
|
|
|
|
|
$tempTreeChild ['icon'] = '/images/icon.trigger.png';
|
|
|
|
|
$tempTreeChild ['allowChildren'] = false;
|
|
|
|
|
$tempTreeChild ['optionType'] = "startProcess";
|
|
|
|
|
$tempTreeChild ['pro_uid'] = $processInfoChild ['pro_uid'];
|
|
|
|
|
$tempTreeChild ['tas_uid'] = $processInfoChild ['uid'];
|
|
|
|
|
$processInfoChild ['myInbox']=0;
|
|
|
|
|
$processInfoChild ['totalInbox']=0;
|
2011-01-19 14:49:44 +00:00
|
|
|
if(isset($proData[ $processInfoChild ['pro_uid'] ])){
|
2010-12-23 22:31:14 +00:00
|
|
|
$tempTreeChild ['otherAttributes'] = array_merge($processInfoChild,$proData[ $processInfoChild ['pro_uid'] ],$calendar->getCalendarFor ( $processInfoChild ['uid'], $processInfoChild ['uid'], $processInfoChild ['uid'] ));
|
2010-12-23 15:02:12 +00:00
|
|
|
$tempTreeChild ['otherAttributes']['PRO_TAS_TITLE']=str_replace(")","",str_replace("(","",trim(str_replace($tempTreeChild ['otherAttributes']['PRO_TITLE'],"",$tempTreeChild ['otherAttributes']["value"]))));
|
2011-02-04 22:05:14 +00:00
|
|
|
$tempTreeChild ['qtip']=$tempTreeChild ['otherAttributes']['PRO_DESCRIPTION'];
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
//$tempTree['cls']='file';
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$tempTreeChildren [] = $tempTreeChild;
|
2011-01-19 14:49:44 +00:00
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$tempTree['children']=$tempTreeChildren;
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$processListTree [] = $tempTree;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
foreach ( $processList [$node] as $key => $processInfo ) {
|
|
|
|
|
//print_r($processInfo);
|
2011-03-30 17:52:27 -04:00
|
|
|
$tempTree ['text'] = $key; //ellipsis ( $key, 50 );
|
2010-12-02 23:34:41 +00:00
|
|
|
//$tempTree['text']=$key;
|
|
|
|
|
$tempTree ['id'] = $key;
|
|
|
|
|
$tempTree ['draggable'] = true;
|
|
|
|
|
$tempTree ['leaf'] = true;
|
|
|
|
|
$tempTree ['icon'] = '/images/icon.trigger.png';
|
|
|
|
|
$tempTree ['allowChildren'] = false;
|
|
|
|
|
$tempTree ['optionType'] = "startProcess";
|
|
|
|
|
$tempTree ['pro_uid'] = $processInfo ['pro_uid'];
|
|
|
|
|
$tempTree ['tas_uid'] = $processInfo ['uid'];
|
|
|
|
|
$processInfo ['myInbox']=0;
|
|
|
|
|
$processInfo ['totalInbox']=0;
|
2010-12-23 22:31:14 +00:00
|
|
|
$tempTree ['otherAttributes'] = array_merge($processInfo,$proData[ $processInfo ['pro_uid'] ],$calendar->getCalendarFor ( $processInfo ['uid'], $processInfo ['uid'], $processInfo ['uid'] ));
|
2010-12-23 15:02:12 +00:00
|
|
|
$tempTree ['otherAttributes']['PRO_TAS_TITLE']=str_replace(")","",str_replace("(","",trim(str_replace($tempTree ['otherAttributes']['PRO_TITLE'],"",$tempTree ['otherAttributes']["value"]))));
|
2011-02-04 22:05:14 +00:00
|
|
|
$tempTree ['qtip']=$tempTree ['otherAttributes']['PRO_DESCRIPTION'];
|
2010-12-02 23:34:41 +00:00
|
|
|
//$tempTree['cls']='file';
|
|
|
|
|
$processListTree [] = $tempTree;
|
|
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
|
|
|
|
$processList = $processListTree;
|
|
|
|
|
} else {
|
|
|
|
|
$processList ['success'] = 'failure';
|
|
|
|
|
$processList ['message'] = 'User can\'t start process';
|
|
|
|
|
}
|
|
|
|
|
print G::json_encode ( $processList );
|
|
|
|
|
die ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function ellipsis($text, $numb) {
|
|
|
|
|
$text = html_entity_decode ( $text, ENT_QUOTES );
|
|
|
|
|
if (strlen ( $text ) > $numb) {
|
|
|
|
|
$text = substr ( $text, 0, $numb );
|
|
|
|
|
$text = substr ( $text, 0, strrpos ( $text, " " ) );
|
|
|
|
|
//This strips the full stop:
|
|
|
|
|
if ((substr ( $text, - 1 )) == ".") {
|
|
|
|
|
$text = substr ( $text, 0, (strrpos ( $text, "." )) );
|
|
|
|
|
}
|
|
|
|
|
$etc = "...";
|
|
|
|
|
$text = $text . $etc;
|
|
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
return $text;
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-16 22:28:15 +00:00
|
|
|
function lookinginforContentProcess($sproUid){
|
|
|
|
|
require_once 'classes/model/Content.php';
|
|
|
|
|
require_once 'classes/model/Task.php';
|
2012-08-10 16:44:36 -04:00
|
|
|
require_once 'classes/model/Content.php';
|
|
|
|
|
|
|
|
|
|
$oContent = new Content();
|
2011-02-16 22:28:15 +00:00
|
|
|
///we are looking for a pro title for this process $sproUid
|
|
|
|
|
$oCriteria = new Criteria('workflow');
|
|
|
|
|
$oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE');
|
|
|
|
|
$oCriteria->add( ContentPeer::CON_LANG, 'en');
|
|
|
|
|
$oCriteria->add( ContentPeer::CON_ID, $sproUid);
|
|
|
|
|
$oDataset = ContentPeer::doSelectRS($oCriteria);
|
|
|
|
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$oDataset->next();
|
|
|
|
|
$aRow = $oDataset->getRow();
|
|
|
|
|
if(!is_array($aRow)){
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2011-02-16 22:28:15 +00:00
|
|
|
$oC = new Criteria('workflow');
|
|
|
|
|
$oC->addSelectColumn(TaskPeer::TAS_UID);
|
|
|
|
|
$oC->add( TaskPeer::PRO_UID, $sproUid);
|
|
|
|
|
$oDataset1 = TaskPeer::doSelectRS($oC);
|
|
|
|
|
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2011-02-16 22:28:15 +00:00
|
|
|
while($oDataset1->next()){
|
|
|
|
|
$aRow1 = $oDataset1->getRow();
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2011-02-16 22:28:15 +00:00
|
|
|
$oCriteria1 = new Criteria('workflow');
|
|
|
|
|
$oCriteria1->add( ContentPeer::CON_CATEGORY, 'TAS_TITLE');
|
|
|
|
|
$oCriteria1->add( ContentPeer::CON_LANG, SYS_LANG);
|
|
|
|
|
$oCriteria1->add( ContentPeer::CON_ID, $aRow1['TAS_UID']);
|
|
|
|
|
$oDataset2 = ContentPeer::doSelectRS($oCriteria1);
|
|
|
|
|
$oDataset2->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$oDataset2->next();
|
|
|
|
|
$aRow2 = $oDataset2->getRow();
|
|
|
|
|
|
|
|
|
|
Content::insertContent( 'TAS_TITLE', '', $aRow2['CON_ID'], 'en', $aRow2['CON_VALUE'] );
|
|
|
|
|
}
|
|
|
|
|
$oC2 = new Criteria('workflow');
|
|
|
|
|
$oC2->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE');
|
|
|
|
|
$oC2->add( ContentPeer::CON_LANG, SYS_LANG);
|
|
|
|
|
$oC2->add( ContentPeer::CON_ID, $sproUid);
|
|
|
|
|
$oDataset3 = ContentPeer::doSelectRS($oC2);
|
|
|
|
|
$oDataset3->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|
|
|
|
$oDataset3->next();
|
|
|
|
|
$aRow3 = $oDataset3->getRow();
|
2012-08-10 16:44:36 -04:00
|
|
|
|
|
|
|
|
Content::insertContent( 'PRO_TITLE', '', $aRow3['CON_ID'], 'en', $aRow3['CON_VALUE'] );
|
|
|
|
|
|
2011-02-16 22:28:15 +00:00
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
function startCase() {
|
|
|
|
|
G::LoadClass ( 'case' );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
/* GET , POST & $_SESSION Vars */
|
|
|
|
|
/* unset any variable, because we are starting a new case */
|
|
|
|
|
if (isset ( $_SESSION ['APPLICATION'] )) unset ( $_SESSION ['APPLICATION'] );
|
|
|
|
|
if (isset ( $_SESSION ['PROCESS'] )) unset ( $_SESSION ['PROCESS'] );
|
|
|
|
|
if (isset ( $_SESSION ['TASK'] )) unset ( $_SESSION ['TASK'] );
|
|
|
|
|
if (isset ( $_SESSION ['INDEX'] )) unset ( $_SESSION ['INDEX'] );
|
|
|
|
|
if (isset ( $_SESSION ['STEP_POSITION'] )) unset ( $_SESSION ['STEP_POSITION'] );
|
|
|
|
|
|
|
|
|
|
/* Process */
|
|
|
|
|
try {
|
|
|
|
|
$oCase = new Cases ( );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2011-02-16 22:28:15 +00:00
|
|
|
lookinginforContentProcess($_POST['processId']);
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$aData = $oCase->startCase ( $_REQUEST ['taskId'], $_SESSION ['USER_LOGGED'] );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$_SESSION ['APPLICATION'] = $aData ['APPLICATION'];
|
|
|
|
|
$_SESSION ['INDEX'] = $aData ['INDEX'];
|
|
|
|
|
$_SESSION ['PROCESS'] = $aData ['PROCESS'];
|
|
|
|
|
$_SESSION ['TASK'] = $_REQUEST ['taskId'];
|
|
|
|
|
$_SESSION ['STEP_POSITION'] = 0;
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$_SESSION ['CASES_REFRESH'] = true;
|
2012-08-10 16:44:36 -04:00
|
|
|
|
|
|
|
|
// Execute Events
|
|
|
|
|
require_once 'classes/model/Event.php';
|
|
|
|
|
$event = new Event();
|
|
|
|
|
$event->createAppEvents($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK']);
|
|
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$oCase = new Cases ( );
|
|
|
|
|
$aNextStep = $oCase->getNextStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] );
|
2011-02-22 16:43:02 +00:00
|
|
|
|
|
|
|
|
$aNextStep['PAGE'] = 'open?APP_UID='.$aData ['APPLICATION'].'&DEL_INDEX='.$aData ['INDEX'].'&action=draft';
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$_SESSION ['BREAKSTEP'] ['NEXT_STEP'] = $aNextStep;
|
|
|
|
|
$aData ['openCase'] = $aNextStep;
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$aData ['status'] = 'success';
|
|
|
|
|
print (G::json_encode ( $aData )) ;
|
2011-02-04 22:05:14 +00:00
|
|
|
}
|
2010-12-02 23:34:41 +00:00
|
|
|
catch ( Exception $e ) {
|
|
|
|
|
$aData ['status'] = 'failure';
|
|
|
|
|
$aData ['message'] = $e->getMessage ();
|
|
|
|
|
print_r ( G::json_encode ( $aData ) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getSimpleDashboardData() {
|
|
|
|
|
G::LoadClass ( "BasePeer" );
|
|
|
|
|
require_once ("classes/model/AppCacheView.php");
|
|
|
|
|
require_once 'classes/model/Process.php';
|
|
|
|
|
$sUIDUserLogged = $_SESSION ['USER_LOGGED'];
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$Criteria = new Criteria ( 'workflow' );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$Criteria->clearSelectColumns ();
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::PRO_UID );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_UID );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_NUMBER );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_STATUS );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_INDEX );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_TITLE );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_PRO_TITLE );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_TAS_TITLE );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_DEL_PREVIOUS_USER );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_TASK_DUE_DATE );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_UPDATE_DATE );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_PRIORITY );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::DEL_DELAYED );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::USR_UID );
|
|
|
|
|
$Criteria->addSelectColumn ( AppCacheViewPeer::APP_THREAD_STATUS );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$Criteria->add ( AppCacheViewPeer::APP_STATUS, array ("TO_DO", "DRAFT" ), CRITERIA::IN );
|
|
|
|
|
$Criteria->add ( AppCacheViewPeer::USR_UID, array ($sUIDUserLogged, "" ), CRITERIA::IN );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$Criteria->add ( AppCacheViewPeer::DEL_FINISH_DATE, null, Criteria::ISNULL );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
//$Criteria->add ( AppCacheViewPeer::APP_THREAD_STATUS, 'OPEN' );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
|
|
|
|
|
$Criteria->add ( AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN' );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2011-02-04 22:05:14 +00:00
|
|
|
//execute the query
|
2010-12-02 23:34:41 +00:00
|
|
|
$oDataset = AppCacheViewPeer::doSelectRS ( $Criteria );
|
|
|
|
|
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
|
|
|
|
|
$oDataset->next ();
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$oProcess = new Process ( );
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$rows = array ();
|
|
|
|
|
$processNames = array ();
|
|
|
|
|
while ( $aRow = $oDataset->getRow () ) {
|
|
|
|
|
// G::pr($aRow);
|
|
|
|
|
if (! isset ( $processNames [$aRow ['PRO_UID']] )) {
|
|
|
|
|
$aProcess = $oProcess->load ( $aRow ['PRO_UID'] );
|
|
|
|
|
$processNames [$aRow ['PRO_UID']] = $aProcess ['PRO_TITLE'];
|
|
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
if ($aRow ['USR_UID'] == "")
|
|
|
|
|
$aRow ['APP_STATUS'] = "UNASSIGNED";
|
|
|
|
|
if (((in_array ( $aRow ['APP_STATUS'], array ("TO_DO", "UNASSIGNED" ) )) && ($aRow ['APP_THREAD_STATUS'] == "OPEN")) || ($aRow ['APP_STATUS'] == "DRAFT")) {
|
|
|
|
|
$rows [$processNames [$aRow ['PRO_UID']]] [$aRow ['APP_STATUS']] [$aRow ['DEL_DELAYED']] [] = $aRow ['APP_UID'];
|
|
|
|
|
if(!isset($rows [$processNames [$aRow ['PRO_UID']]] [$aRow ['APP_STATUS']]['count'])) $rows [$processNames [$aRow ['PRO_UID']]] [$aRow ['APP_STATUS']]['count']=0;
|
|
|
|
|
$rows [$processNames [$aRow ['PRO_UID']]][$aRow ['APP_STATUS']]['count']++;
|
|
|
|
|
}
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$oDataset->next ();
|
|
|
|
|
}
|
|
|
|
|
//Generate different groups of data for graphs
|
|
|
|
|
$rowsResponse=array();
|
|
|
|
|
$i=0;
|
|
|
|
|
foreach($rows as $processID => $processInfo){
|
|
|
|
|
$i++;
|
|
|
|
|
if($i<=10){
|
|
|
|
|
$rowsResponse['caseStatusByProcess'][]=array('process'=>$processID,'inbox'=>isset($processInfo['TO_DO']['count'])?$processInfo['TO_DO']['count']:0,'draft'=>isset($processInfo['DRAFT']['count'])?$processInfo['DRAFT']['count']:0,'unassigned'=>isset($processInfo['UNASSIGNED']['count'])?$processInfo['UNASSIGNED']['count']:0);
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
$rowsResponse['caseDelayed'][]=array('delayed'=>'On Time','total'=>100);
|
|
|
|
|
$rowsResponse['caseDelayed'][]=array('delayed'=>'Delayed','total'=>50);
|
2012-08-10 16:44:36 -04:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
print_r ( G::json_encode ( $rowsResponse ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getRegisteredDashboards() {
|
|
|
|
|
$oPluginRegistry = & PMPluginRegistry::getSingleton ();
|
|
|
|
|
$dashBoardPages = $oPluginRegistry->getDashboardPages ();
|
|
|
|
|
print_r ( G::json_encode ( $dashBoardPages ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function getDefaultDashboard(){
|
|
|
|
|
$defaultDashboard['defaultTab']="mainDashboard";
|
|
|
|
|
if(isset($_SESSION['__currentTabDashboard'])){
|
|
|
|
|
$defaultDashboard['defaultTab']=$_SESSION['__currentTabDashboard'];
|
|
|
|
|
}
|
|
|
|
|
print_r ( G::json_encode ( $defaultDashboard ) );
|
2011-02-16 22:28:15 +00:00
|
|
|
}
|