Merge branch 'master' into enable-rest-api-from-plugins
This commit is contained in:
@@ -33,6 +33,12 @@ $e_all = defined('E_DEPRECATED') ? E_ALL & ~E_DEPRECATED : E_ALL;
|
||||
$e_all = defined('E_STRICT') ? $e_all & ~E_STRICT : $e_all;
|
||||
$e_all = $config['debug'] ? $e_all : $e_all & ~E_NOTICE;
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$config['debug'] = $filter->validateInput($config['debug']);
|
||||
$config['memory_limit'] = $filter->validateInput($config['memory_limit']);
|
||||
$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int');
|
||||
$config['time_zone'] = $filter->validateInput($config['time_zone']);
|
||||
// Do not change any of these settings directly, use env.ini instead
|
||||
ini_set('display_errors', $config['debug']);
|
||||
ini_set('error_reporting', $e_all);
|
||||
|
||||
@@ -90,6 +90,12 @@ if (!defined('PATH_HOME')) {
|
||||
$e_all = defined('E_STRICT') ? $e_all & ~E_STRICT : $e_all;
|
||||
$e_all = $config['debug'] ? $e_all : $e_all & ~E_NOTICE;
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$config['debug'] = $filter->validateInput($config['debug']);
|
||||
$config['memory_limit'] = $filter->validateInput($config['memory_limit']);
|
||||
$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int');
|
||||
$config['time_zone'] = $filter->validateInput($config['time_zone']);
|
||||
// Do not change any of these settings directly, use env.ini instead
|
||||
ini_set('display_errors', $config['debug']);
|
||||
ini_set('error_reporting', $e_all);
|
||||
@@ -355,8 +361,8 @@ Bootstrap::registerClass('wsResponse', PATH_HOME . "engine/classes/clas
|
||||
|
||||
Bootstrap::registerClass("PMLicensedFeatures", PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "class.licensedFeatures.php");
|
||||
Bootstrap::registerClass("AddonsManagerPeer", PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "AddonsManagerPeer.php");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
Bootstrap::registerClass('dashboards', PATH_HOME . "engine/classes/class.dashboards.php");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
Bootstrap::registerClass('dashboards', PATH_HOME . "engine/classes/class.dashboards.php");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$arrayClass = array("Configuration", "EmailServer", "ListInbox", "ListParticipatedHistory");
|
||||
@@ -371,18 +377,18 @@ foreach ($arrayClass as $value) {
|
||||
G::LoadClass("serverConfiguration");
|
||||
G::LoadClass("dates"); //Load Criteria
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
if (!defined('SYS_SYS')) {
|
||||
$sObject = $argv[1];
|
||||
$sNow = $argv[2];
|
||||
$dateSystem = $argv[3];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$dateInit = null;
|
||||
$dateFinish = null;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$dateInit = null;
|
||||
$dateFinish = null;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$sFilter = '';
|
||||
|
||||
@@ -527,17 +533,17 @@ function processWorkspace()
|
||||
resendEmails();
|
||||
unpauseApplications();
|
||||
calculateDuration();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
calculateAppDuration();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
calculateAppDuration();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
executeEvents($sLastExecution);
|
||||
executeScheduledCases();
|
||||
executeUpdateAppTitle();
|
||||
executeCaseSelfService();
|
||||
executePlugins();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
fillReportByUser();
|
||||
fillReportByProcess();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
fillReportByUser();
|
||||
fillReportByProcess();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} catch (Exception $oError) {
|
||||
saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n");
|
||||
@@ -728,29 +734,29 @@ function calculateDuration()
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function calculateAppDuration()
|
||||
{
|
||||
global $sFilter;
|
||||
|
||||
if ($sFilter != '' && strpos($sFilter, 'calculateapp') === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setExecutionMessage("Calculating Duration by Application");
|
||||
|
||||
try {
|
||||
$oApplication = new Application();
|
||||
$oApplication->calculateAppDuration(1);
|
||||
|
||||
setExecutionResultMessage('DONE');
|
||||
saveLog('calculateDurationByApp', 'action', 'Calculating Duration by Application');
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-".$oError->getMessage(), 'red');
|
||||
saveLog('calculateDurationByApp', 'error', 'Error Calculating Duration: ' . $oError->getMessage());
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function calculateAppDuration()
|
||||
{
|
||||
global $sFilter;
|
||||
|
||||
if ($sFilter != '' && strpos($sFilter, 'calculateapp') === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
setExecutionMessage("Calculating Duration by Application");
|
||||
|
||||
try {
|
||||
$oApplication = new Application();
|
||||
$oApplication->calculateAppDuration(1);
|
||||
|
||||
setExecutionResultMessage('DONE');
|
||||
saveLog('calculateDurationByApp', 'action', 'Calculating Duration by Application');
|
||||
} catch (Exception $oError) {
|
||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||
eprintln(" '-".$oError->getMessage(), 'red');
|
||||
saveLog('calculateDurationByApp', 'error', 'Error Calculating Duration: ' . $oError->getMessage());
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
function executeEvents($sLastExecution, $sNow=null)
|
||||
@@ -1095,66 +1101,66 @@ function setExecutionResultMessage($m, $t='')
|
||||
eprintln("[$m]", $c);
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function fillReportByUser ()
|
||||
{
|
||||
try {
|
||||
global $sFilter;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
|
||||
if (strpos($sFilter, 'report_by_user') === false) {
|
||||
return false;
|
||||
}
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP );
|
||||
setExecutionMessage("Calculating data to fill the 'User Reporting'...");
|
||||
$appcv->fillReportByUser($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByUser", "error", "Error in fill report by user: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function fillReportByProcess ()
|
||||
{
|
||||
try {
|
||||
global $sFilter;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
|
||||
if (strpos($sFilter, 'report_by_process') === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP );
|
||||
|
||||
setExecutionMessage("Calculating data to fill the 'Process Reporting'...");
|
||||
$appcv->fillReportByProcess($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByProcess", "error", "Error in fill report by process: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
function fillReportByUser ()
|
||||
{
|
||||
try {
|
||||
global $sFilter;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
|
||||
if (strpos($sFilter, 'report_by_user') === false) {
|
||||
return false;
|
||||
}
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP );
|
||||
setExecutionMessage("Calculating data to fill the 'User Reporting'...");
|
||||
$appcv->fillReportByUser($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByUser", "error", "Error in fill report by user: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
function fillReportByProcess ()
|
||||
{
|
||||
try {
|
||||
global $sFilter;
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
|
||||
if (strpos($sFilter, 'report_by_process') === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($dateInit == null) {
|
||||
eprintln("You must enter the starting date.", "red");
|
||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
||||
return false;
|
||||
}
|
||||
|
||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
||||
$appcv = new AppCacheView();
|
||||
$appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP );
|
||||
|
||||
setExecutionMessage("Calculating data to fill the 'Process Reporting'...");
|
||||
$appcv->fillReportByProcess($dateInit, $dateFinish);
|
||||
setExecutionResultMessage("DONE");
|
||||
} catch (Exception $e) {
|
||||
setExecutionResultMessage("WITH ERRORS", "error");
|
||||
eprintln(" '-" . $e->getMessage(), "red");
|
||||
saveLog("fillReportByProcess", "error", "Error in fill report by process: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
|
||||
@@ -43,7 +43,11 @@ try {
|
||||
G::LoadClass("system");
|
||||
|
||||
$config = System::getSystemConfiguration();
|
||||
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$config['time_zone'] = $filter->validateInput($config['time_zone']);
|
||||
|
||||
ini_set("date.timezone", $config["time_zone"]);
|
||||
|
||||
//CRON command options
|
||||
|
||||
@@ -91,6 +91,11 @@ try {
|
||||
$e_all = (defined("E_STRICT"))? $e_all & ~E_STRICT : $e_all;
|
||||
$e_all = ($config["debug"])? $e_all : $e_all & ~E_NOTICE;
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$config['debug'] = $filter->validateInput($config['debug']);
|
||||
$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int');
|
||||
$config['time_zone'] = $filter->validateInput($config['time_zone']);
|
||||
//Do not change any of these settings directly, use env.ini instead
|
||||
ini_set("display_errors", $config["debug"]);
|
||||
ini_set("error_reporting", $e_all);
|
||||
|
||||
@@ -207,9 +207,16 @@ if (! defined ('SYS_SYS')) {
|
||||
define ('TIME_ZONE', $config ['time_zone']);
|
||||
|
||||
date_default_timezone_set (TIME_ZONE);
|
||||
print "TIME_ZONE: " . TIME_ZONE . "\n";
|
||||
print "MEMCACHED_ENABLED: " . MEMCACHED_ENABLED . "\n";
|
||||
print "MEMCACHED_SERVER: " . MEMCACHED_SERVER . "\n";
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$TIME_ZONE = $filter->xssFilterHard(TIME_ZONE);
|
||||
$MEMCACHED_ENABLED = $filter->xssFilterHard(MEMCACHED_ENABLED);
|
||||
$MEMCACHED_SERVER = $filter->xssFilterHard(MEMCACHED_SERVER);
|
||||
|
||||
print "TIME_ZONE: " . $TIME_ZONE . "\n";
|
||||
print "MEMCACHED_ENABLED: " . $MEMCACHED_ENABLED . "\n";
|
||||
print "MEMCACHED_SERVER: " . $MEMCACHED_SERVER . "\n";
|
||||
// ****************************************
|
||||
|
||||
include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php');
|
||||
|
||||
@@ -139,13 +139,21 @@ if (! defined ('SYS_SYS')) {
|
||||
define ('TIME_ZONE', $config ['time_zone']);
|
||||
|
||||
date_default_timezone_set (TIME_ZONE);
|
||||
print "TIME_ZONE: " . TIME_ZONE . "\n";
|
||||
print "MEMCACHED_ENABLED: " . MEMCACHED_ENABLED . "\n";
|
||||
print "MEMCACHED_SERVER: " . MEMCACHED_SERVER . "\n";
|
||||
|
||||
// ****************************************
|
||||
|
||||
include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php');
|
||||
include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$TIME_ZONE = $filter->xssFilterHard(TIME_ZONE);
|
||||
$MEMCACHED_ENABLED = $filter->xssFilterHard(MEMCACHED_ENABLED);
|
||||
$MEMCACHED_SERVER = $filter->xssFilterHard(MEMCACHED_SERVER);
|
||||
|
||||
print "TIME_ZONE: " . $TIME_ZONE . "\n";
|
||||
print "MEMCACHED_ENABLED: " . $MEMCACHED_ENABLED . "\n";
|
||||
print "MEMCACHED_SERVER: " . $MEMCACHED_SERVER . "\n";
|
||||
|
||||
// ***************** PM Paths DATA **************************
|
||||
define ('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
|
||||
|
||||
@@ -513,9 +513,9 @@ class indicatorsCalculator
|
||||
$params[':usrUid'] = $usrUid;
|
||||
|
||||
$sqlString = "SELECT
|
||||
COALESCE( SUM( DATEDIFF( DEL_DUE_DATE , NOW( ) ) < 0 ) , 0 ) AS OVERDUE,
|
||||
COALESCE( SUM( DATEDIFF( DEL_DUE_DATE , NOW( ) ) > 0 ) , 0 ) AS ONTIME,
|
||||
COALESCE( SUM( DATEDIFF( DEL_RISK_DATE , NOW( ) ) < 0 ) , 0 ) AS ATRISK
|
||||
COALESCE( SUM( TIMEDIFF( DEL_DUE_DATE , NOW( ) ) < 0 ) , 0 ) AS OVERDUE,
|
||||
COALESCE( SUM( TIMEDIFF( DEL_RISK_DATE , NOW( ) ) > 0 ) , 0 ) AS ONTIME,
|
||||
COALESCE( SUM( TIMEDIFF( DEL_RISK_DATE , NOW( ) ) < 0 && TIMEDIFF( DEL_DUE_DATE , NOW( ) ) > 0) , 0 ) AS ATRISK
|
||||
FROM LIST_INBOX
|
||||
WHERE USR_UID = :usrUid
|
||||
AND APP_STATUS = 'TO_DO'
|
||||
@@ -534,9 +534,9 @@ class indicatorsCalculator
|
||||
APP_TAS_TITLE AS taskTitle,
|
||||
APP_PRO_TITLE AS proTitle,
|
||||
|
||||
COALESCE( SUM( DATEDIFF( DEL_DUE_DATE , NOW( ) ) < 0 ) , 0 ) AS overdue,
|
||||
COALESCE( SUM( DATEDIFF( DEL_DUE_DATE , NOW( ) ) > 0 ) , 0 ) AS onTime,
|
||||
COALESCE( SUM( DATEDIFF( DEL_RISK_DATE , NOW( ) ) < 0 ) , 0 ) AS atRisk
|
||||
COALESCE( SUM( TIMEDIFF( DEL_DUE_DATE , NOW( ) ) < 0 ) , 0 ) AS overdue,
|
||||
COALESCE( SUM( TIMEDIFF( DEL_RISK_DATE , NOW( ) ) > 0 ) , 0 ) AS onTime,
|
||||
COALESCE( SUM( TIMEDIFF( DEL_RISK_DATE , NOW( ) ) < 0 && TIMEDIFF( DEL_DUE_DATE , NOW( ) ) > 0) , 0 ) AS atRisk
|
||||
FROM LIST_INBOX
|
||||
WHERE USR_UID = :usrUid
|
||||
AND APP_STATUS = 'TO_DO'
|
||||
@@ -561,8 +561,8 @@ class indicatorsCalculator
|
||||
|
||||
if (is_array($result) && isset($result[0])) {
|
||||
$response['overdue'] = $result[0]['OVERDUE'];
|
||||
$response['atRisk'] = $result[0]['ONTIME'];
|
||||
$response['onTime'] = $result[0]['ATRISK'];
|
||||
$response['atRisk'] = $result[0]['ATRISK'];
|
||||
$response['onTime'] = $result[0]['ONTIME'];
|
||||
|
||||
$total = $response['overdue'] + $response['atRisk'] + $response['onTime'];
|
||||
if ($total != 0) {
|
||||
@@ -578,20 +578,20 @@ class indicatorsCalculator
|
||||
$result[$key]['overdue'] = $value['overdue'];
|
||||
$result[$key]['atRisk'] = $value['atRisk'];
|
||||
$result[$key]['onTime'] = $value['onTime'];
|
||||
$result[$key]['percentageOverdue'] = 0;
|
||||
$result[$key]['percentageAtRisk'] = 0;
|
||||
$result[$key]['percentageOnTime'] = 0;
|
||||
$result[$key]['percentageTotalOverdue'] = 0;
|
||||
$result[$key]['percentageTotalAtRisk'] = 0;
|
||||
$result[$key]['percentageTotalOnTime'] = 0;
|
||||
$result[$key]['percentageOverdue'] = 0;
|
||||
$result[$key]['percentageAtRisk'] = 0;
|
||||
$result[$key]['percentageOnTime'] = 0;
|
||||
$result[$key]['percentageTotalOverdue'] = 0;
|
||||
$result[$key]['percentageTotalAtRisk'] = 0;
|
||||
$result[$key]['percentageTotalOnTime'] = 0;
|
||||
$total = $value['overdue'] + $value['onTime'] + $value['atRisk'];
|
||||
if ($total != 0) {
|
||||
$result[$key]['percentageOverdue'] = ($value['overdue']*100)/$total;
|
||||
$result[$key]['percentageAtRisk'] = ($value['atRisk']*100)/$total;
|
||||
$result[$key]['percentageOnTime'] = ($value['onTime']*100)/$total;
|
||||
$result[$key]['percentageTotalOverdue'] = $response['overdue'] != 0 ? ($value['overdue']*100)/$response['overdue']: 0;
|
||||
$result[$key]['percentageTotalAtRisk'] = $response['atRisk'] != 0 ? ($value['atRisk']*100)/$response['atRisk'] : 0;
|
||||
$result[$key]['percentageTotalOnTime'] = $response['onTime'] != 0 ? ($value['onTime']*100)/$response['onTime']: 0;
|
||||
$result[$key]['percentageTotalOverdue'] = $response['overdue'] != 0 ? ($value['overdue']*100)/$response['overdue']: 0;
|
||||
$result[$key]['percentageTotalAtRisk'] = $response['atRisk'] != 0 ? ($value['atRisk']*100)/$response['atRisk'] : 0;
|
||||
$result[$key]['percentageTotalOnTime'] = $response['onTime'] != 0 ? ($value['onTime']*100)/$response['onTime']: 0;
|
||||
}
|
||||
}
|
||||
$response['dataList'] = $result;
|
||||
|
||||
@@ -451,17 +451,18 @@ class AdditionalTables extends BaseAdditionalTables
|
||||
|
||||
if (isset($_POST['sort'])) {
|
||||
$_POST['sort'] = $filter->validateInput($_POST['sort']);
|
||||
$_POST['dir'] = $filter->validateInput($_POST['dir']);
|
||||
if ($_POST['dir'] == 'ASC') {
|
||||
if ($keyOrderUppercase) {
|
||||
eval('$oCriteria->addAscendingOrderByColumn("' . $sort . '");');
|
||||
eval('$oCriteria->addAscendingOrderByColumn("' . $_POST['sort'] . '");');
|
||||
} else {
|
||||
eval('$oCriteria->addAscendingOrderByColumn(' . $sClassPeerName . '::' . $sort . ');');
|
||||
eval('$oCriteria->addAscendingOrderByColumn(' . $sClassPeerName . '::' . $_POST['sort'] . ');');
|
||||
}
|
||||
} else {
|
||||
if ($keyOrderUppercase) {
|
||||
eval('$oCriteria->addDescendingOrderByColumn("' . $sort . '");');
|
||||
eval('$oCriteria->addDescendingOrderByColumn("' . $_POST['sort'] . '");');
|
||||
} else {
|
||||
eval('$oCriteria->addDescendingOrderByColumn(' . $sClassPeerName . '::' . $sort . ');');
|
||||
eval('$oCriteria->addDescendingOrderByColumn(' . $sClassPeerName . '::' . $_POST['sort'] . ');');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ class AppDelegation extends BaseAppDelegation
|
||||
|
||||
//The function return an array now. By JHL
|
||||
$delTaskDueDate = $this->calculateDueDate($sNextTasParam);
|
||||
$delRiskDate = $this->calculateRiskDate($delTaskDueDate, $this->getRisk());
|
||||
$delRiskDate = $this->calculateRiskDate($sNextTasParam, $this->getRisk());
|
||||
|
||||
//$this->setDelTaskDueDate( $delTaskDueDate['DUE_DATE'] ); // Due date formatted
|
||||
$this->setDelTaskDueDate($delTaskDueDate);
|
||||
@@ -379,8 +379,18 @@ class AppDelegation extends BaseAppDelegation
|
||||
public function calculateRiskDate($dueDate, $risk)
|
||||
{
|
||||
try {
|
||||
$riskTime = strtotime($dueDate) - strtotime($this->getDelDelegateDate()); //Seconds
|
||||
$riskTime = $riskTime - ($riskTime * $risk);
|
||||
|
||||
$data = array();
|
||||
if (isset( $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] ) && $sNextTasParam['NEXT_TASK']['TAS_TRANSFER_HIDDEN_FLY'] == 'true') {
|
||||
$data['TAS_DURATION'] = $sNextTasParam['NEXT_TASK']['TAS_DURATION'];
|
||||
$data['TAS_TIMEUNIT'] = $sNextTasParam['NEXT_TASK']['TAS_TIMEUNIT'];
|
||||
} else {
|
||||
$task = TaskPeer::retrieveByPK( $this->getTasUid() );
|
||||
$data['TAS_DURATION'] = $task->getTasDuration();
|
||||
$data['TAS_TIMEUNIT'] = $task->getTasTimeUnit();
|
||||
}
|
||||
|
||||
$riskTime = $data['TAS_DURATION'] - ($data['TAS_DURATION'] * $risk);
|
||||
|
||||
//Calendar - Use the dates class to calculate dates
|
||||
$calendar = new calendar();
|
||||
@@ -394,9 +404,8 @@ class AppDelegation extends BaseAppDelegation
|
||||
}
|
||||
|
||||
//Risk date
|
||||
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), round($riskTime / (60 * 60)), "HOURS", $arrayCalendarData);
|
||||
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $riskTime, $data['TAS_TIMEUNIT'], $arrayCalendarData);
|
||||
|
||||
//Return
|
||||
return $riskDate;
|
||||
} catch (Exception $e) {
|
||||
throw $e;
|
||||
|
||||
@@ -108,10 +108,40 @@ class DashboardDasInd extends BaseDashboardDasInd
|
||||
}
|
||||
}
|
||||
|
||||
public function getOwnerByDashboard ($dasUid)
|
||||
public function loadOwnerByUserId ($usrId)
|
||||
{
|
||||
|
||||
}
|
||||
try {
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_UID, $usrId);
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_TYPE, "USER");
|
||||
|
||||
$dataset = DashboardDasIndPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$fields = array();
|
||||
|
||||
while ($dataset->next()) {
|
||||
$auxField = $dataset->getRow();
|
||||
$fields[] = $auxField;
|
||||
}
|
||||
|
||||
$criteria = new Criteria('workflow');
|
||||
$criteria->add(DashboardDasIndPeer::OWNER_TYPE, "GROUP");
|
||||
$criteria->add(GroupUserPeer::USR_UID, $usrId);
|
||||
$criteria->addJoin(GroupUserPeer::GRP_UID, DashboardDasIndPeer::OWNER_UID);
|
||||
|
||||
$dataset = DashboardDasIndPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($dataset->next()) {
|
||||
$auxField = $dataset->getRow();
|
||||
$fields[] = $auxField;
|
||||
}
|
||||
|
||||
return $fields;
|
||||
} catch (Exception $error) {
|
||||
throw $error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,14 +65,18 @@ class DashboardIndicator extends BaseDashboardIndicator
|
||||
$oldValue = current(reset($calculator->peiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
$row['DAS_IND_OLD_VALUE'] = $oldValue;
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = round(($value - $oldValue) * 100 / (($oldValue == 0) ? 1 : $oldValue), 1);
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = $oldValue != 0
|
||||
? round(($value - $oldValue) * 100 / $oldValue)
|
||||
: "--";
|
||||
break;
|
||||
case '1030':
|
||||
$value = current(reset($calculator->ueiHistoric(null, $measureDate, $measureDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$oldValue = current(reset($calculator->ueiHistoric($uid, $compareDate, $compareDate, \ReportingPeriodicityEnum::NONE)));
|
||||
$row['DAS_IND_VARIATION'] = $value - $oldValue;
|
||||
$row['DAS_IND_OLD_VALUE'] = $oldValue;
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = round(($value - $oldValue) * 100 / (($oldValue == 0) ? 1 : $oldValue), 1);
|
||||
$row['DAS_IND_PERCENT_VARIATION'] = $oldValue != 0
|
||||
? round(($value - $oldValue) * 100 / $oldValue)
|
||||
: "--";
|
||||
break;
|
||||
case '1050':
|
||||
$value = $calculator->statusIndicatorGeneral($userUid);
|
||||
|
||||
@@ -180,6 +180,10 @@ class Dynaform extends BaseDynaform
|
||||
$aData['DYN_VERSION'] = 0;
|
||||
}
|
||||
$this->setDynVersion( $aData['DYN_VERSION'] );
|
||||
if (!isset($aData['DYN_CONTENT'])) {
|
||||
$aData['DYN_CONTENT'] = "{}";
|
||||
}
|
||||
$this->setDynContent( $aData['DYN_CONTENT'] );
|
||||
if ($this->validate()) {
|
||||
$con->begin();
|
||||
$res = $this->save();
|
||||
|
||||
@@ -25,6 +25,15 @@ class ListCompleted extends BaseListCompleted
|
||||
*/
|
||||
public function create($data)
|
||||
{
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(ListCompletedPeer::APP_UID);
|
||||
$criteria->add( ListCompletedPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$dataset = ListCompletedPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($dataset->next()) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
$criteria->add( ContentPeer::CON_ID, $data['APP_UID'], Criteria::EQUAL );
|
||||
@@ -97,9 +106,27 @@ class ListCompleted extends BaseListCompleted
|
||||
$users = new Users();
|
||||
$users->refreshTotal($data['USR_UID'], 'add', 'completed');
|
||||
if ($data['DEL_PREVIOUS'] != 0) {
|
||||
$users->refreshTotal($data['USR_UID'], 'remove', 'inbox');
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(TaskPeer::TAS_TYPE);
|
||||
$criteria->add( TaskPeer::TAS_UID, $data['TAS_UID'], Criteria::EQUAL );
|
||||
$dataset = TaskPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$dataset->next();
|
||||
$aRow = $dataset->getRow();
|
||||
if ($aRow['TAS_TYPE'] != 'SUBPROCESS') {
|
||||
$users->refreshTotal($data['USR_UID'], 'remove', 'inbox');
|
||||
}
|
||||
} else {
|
||||
$users->refreshTotal($data['USR_UID'], 'remove', 'draft');
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(SubApplicationPeer::APP_UID);
|
||||
$criteria->add( SubApplicationPeer::APP_UID, $data['APP_UID'], Criteria::EQUAL );
|
||||
$dataset = SubApplicationPeer::doSelectRS($criteria);
|
||||
$dataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
if ($dataset->next()) {
|
||||
$users->refreshTotal($data['USR_UID'], 'remove', 'inbox');
|
||||
} else {
|
||||
$users->refreshTotal($data['USR_UID'], 'remove', 'draft');
|
||||
}
|
||||
}
|
||||
|
||||
$con = Propel::getConnection( ListCompletedPeer::DATABASE_NAME );
|
||||
|
||||
@@ -699,6 +699,9 @@ class Installer extends Controller
|
||||
|
||||
try {
|
||||
$db_host = ($db_port != '' && $db_port != 3306) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
$db_host = $filter->validateInput($db_host);
|
||||
$db_username = $filter->validateInput($db_username);
|
||||
$db_password = $filter->validateInput($db_password);
|
||||
$this->link = @mysql_connect( $db_host, $db_username, $db_password );
|
||||
$this->installLog( G::LoadTranslation('ID_CONNECT_TO_SERVER', SYS_LANG, Array($db_hostname, $db_port, $db_username ) ));
|
||||
|
||||
@@ -1032,6 +1035,9 @@ class Installer extends Controller
|
||||
|
||||
try {
|
||||
$db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
$db_host = $filter->validateInput($db_host);
|
||||
$db_username = $filter->validateInput($db_username);
|
||||
$db_password = $filter->validateInput($db_password);
|
||||
$this->link = @mssql_connect( $db_host, $db_username, $db_password );
|
||||
$this->installLog( G::LoadTranslation('ID_CONNECT_TO_SERVER', SYS_LANG, Array( $db_hostname, $db_port, $db_username )) );
|
||||
|
||||
@@ -1231,6 +1237,9 @@ class Installer extends Controller
|
||||
$info = new stdclass();
|
||||
|
||||
if ($_REQUEST['db_engine'] == 'mysql') {
|
||||
$_REQUEST['db_hostname'] = $filter->validateInput($_REQUEST['db_hostname']);
|
||||
$_REQUEST['db_username'] = $filter->validateInput($_REQUEST['db_username']);
|
||||
$_REQUEST['db_password'] = $filter->validateInput($_REQUEST['db_password']);
|
||||
$link = @mysql_connect( $_REQUEST['db_hostname'], $_REQUEST['db_username'], $_REQUEST['db_password'] );
|
||||
$_REQUEST['wfDatabase'] = $filter->validateInput($_REQUEST['wfDatabase'], 'nosql');
|
||||
$query = "show databases like '%s' ";
|
||||
@@ -1296,6 +1305,7 @@ class Installer extends Controller
|
||||
}
|
||||
|
||||
$db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
|
||||
$link = @mysql_connect( $db_host, $db_username, $db_password );
|
||||
if (! $link) {
|
||||
$info->message .= G::LoadTranslation('ID_MYSQL_CREDENTIALS_WRONG');
|
||||
@@ -1348,6 +1358,7 @@ class Installer extends Controller
|
||||
}
|
||||
|
||||
$db_host = ($db_port != '' && $db_port != 1433) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
|
||||
$link = @mssql_connect( $db_host, $db_username, $db_password );
|
||||
if (! $link) {
|
||||
$info->message .= G::LoadTranslation('ID_MYSQL_CREDENTIALS_WRONG');
|
||||
@@ -1661,6 +1672,7 @@ class Installer extends Controller
|
||||
$wf = trim( $_REQUEST['wfDatabase'] );
|
||||
|
||||
$db_host = ($db_port != '' && $db_port != 3306) ? $db_hostname . ':' . $db_port : $db_hostname;
|
||||
|
||||
$link = @mysql_connect( $db_host, $db_username, $db_password );
|
||||
@mysql_select_db($wf, $link);
|
||||
$res = mysql_query( "SELECT STORE_ID FROM ADDONS_MANAGER WHERE ADDON_NAME = '" . $namePlugin . "'", $link );
|
||||
|
||||
@@ -14,6 +14,7 @@ class StrategicDashboard extends Controller
|
||||
private $urlProxy;
|
||||
private $clientToken;
|
||||
private $usrId;
|
||||
private $usrUnitCost;
|
||||
|
||||
// Class constructor
|
||||
public function __construct ()
|
||||
@@ -32,6 +33,13 @@ class StrategicDashboard extends Controller
|
||||
die;
|
||||
}
|
||||
$this->usrId = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
|
||||
$user = new Users();
|
||||
$user = $user->load($RBAC->aUserInfo['USER_INFO']['USR_UID']);
|
||||
$this->usrUnitCost = '$';
|
||||
if (isset($user['USR_UNIT_COST'])) {
|
||||
$this->usrUnitCost = $user['USR_UNIT_COST'];
|
||||
}
|
||||
|
||||
$this->urlProxy = '/api/1.0/' . SYS_SYS . '/';
|
||||
//change
|
||||
$clientId = 'x-pm-local-client';
|
||||
@@ -170,13 +178,12 @@ class StrategicDashboard extends Controller
|
||||
}
|
||||
$this->setView( 'strategicDashboard/viewDashboard' );
|
||||
|
||||
$this->setVar('urlProxy',$this->urlProxy);
|
||||
$this->setVar('usrId',$this->usrId);
|
||||
$this->setVar('credentials',$this->clientToken);
|
||||
$this->setVar('urlProxy', $this->urlProxy);
|
||||
$this->setVar('usrId', $this->usrId);
|
||||
$this->setVar('credentials', $this->clientToken);
|
||||
$this->setVar('unitCost', $this->usrUnitCost);
|
||||
|
||||
$translation = array();
|
||||
|
||||
|
||||
$translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation( 'ID_MANAGERS_DASHBOARDS');
|
||||
$translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_PRO_EFFICIENCY_INDEX');
|
||||
$translation['ID_EFFICIENCY_USER'] = G::LoadTranslation( 'ID_EFFICIENCY_USER');
|
||||
@@ -203,6 +210,7 @@ class StrategicDashboard extends Controller
|
||||
$translation['ID_OVERDUE'] = G::LoadTranslation( 'ID_OVERDUE');
|
||||
$translation['ID_AT_RISK'] = G::LoadTranslation( 'ID_AT_RISK');
|
||||
$translation['ID_ON_TIME'] = G::LoadTranslation( 'ID_ON_TIME');
|
||||
|
||||
$this->setVar('translation', $translation);
|
||||
$this->render();
|
||||
} catch (Exception $error) {
|
||||
@@ -215,12 +223,12 @@ class StrategicDashboard extends Controller
|
||||
{
|
||||
try {
|
||||
$this->setView( 'strategicDashboard/viewDashboardIE' );
|
||||
$this->setVar('urlProxy',$this->urlProxy);
|
||||
$this->setVar('usrId',$this->usrId);
|
||||
$this->setVar('credentials',$this->clientToken);
|
||||
$this->setVar('urlProxy', $this->urlProxy);
|
||||
$this->setVar('usrId', $this->usrId);
|
||||
$this->setVar('credentials', $this->clientToken);
|
||||
$this->setVar('unitCost', $this->usrUnitCost);
|
||||
|
||||
$translation = array();
|
||||
|
||||
$translation['ID_MANAGERS_DASHBOARDS'] = G::LoadTranslation( 'ID_MANAGERS_DASHBOARDS');
|
||||
$translation['ID_PRO_EFFICIENCY_INDEX'] = G::LoadTranslation( 'ID_PRO_EFFICIENCY_INDEX');
|
||||
$translation['ID_EFFICIENCY_USER'] = G::LoadTranslation( 'ID_EFFICIENCY_USER');
|
||||
|
||||
@@ -78,7 +78,6 @@ ViewDashboardModel.prototype.getPositionIndicator = function(callBack) {
|
||||
"y" : originalObject.y,
|
||||
"width" : originalObject.width,
|
||||
"height" : originalObject.height
|
||||
|
||||
};
|
||||
graphData.push(map);
|
||||
});
|
||||
|
||||
@@ -90,18 +90,37 @@ ViewDashboardPresenter.prototype.dashboardIndicatorsViewModel = function(data) {
|
||||
newObject.comparative = Math.round(newObject.comparative*1000)/1000;
|
||||
newObject.comparative = ((newObject.comparative > 0)? "+": "") + newObject.comparative;
|
||||
|
||||
newObject.percentComparative = (newObject.percentComparative != '--')
|
||||
? '(' + newObject.percentComparative + '%)'
|
||||
: "";
|
||||
|
||||
|
||||
newObject.value = (newObject.category == "normal")
|
||||
? Math.round(newObject.value) + ""
|
||||
: Math.round(newObject.value*100)/100 + ""
|
||||
|
||||
newObject.favorite = 0;
|
||||
newObject.percentageOverdue = Math.round(newObject.percentageOverdue);
|
||||
newObject.percentageAtRisk = Math.round(newObject.percentageAtRisk);
|
||||
//to be sure that percentages sum up to 100 (the rounding will lost decimals)%
|
||||
newObject.percentageOnTime = 100 - newObject.percentageOverdue - newObject.percentageAtRisk;
|
||||
newObject.overdueVisibility = (newObject.percentageOverdue > 0)? "visible" : "hidden";
|
||||
newObject.atRiskVisiblity = (newObject.percentageAtRisk > 0)? "visible" : "hidden";
|
||||
newObject.onTimeVisibility = (newObject.percentageOnTime > 0)? "visible" : "hidden";
|
||||
|
||||
newObject.percentageOverdueWidth = Math.round(newObject.percentageOverdue);
|
||||
newObject.percentageAtRiskWidth = Math.round(newObject.percentageAtRisk);
|
||||
//to be sure that percentages sum up to 100 (the rounding will lose decimals)%
|
||||
newObject.percentageOnTimeWidth = 100 - newObject.percentageOverdueWidth - newObject.percentageAtRiskWidth;
|
||||
|
||||
newObject.percentageOverdueToShow = ((newObject.percentageOverdue == 0 ||newObject.percentageOverdue == null )
|
||||
? ""
|
||||
: newObject.percentageOverdueWidth + "%");
|
||||
|
||||
newObject.percentageAtRiskToShow = ((newObject.percentageAtRisk == 0 || newObject.percentageAtRisk == null)
|
||||
? ""
|
||||
: newObject.percentageAtRiskWidth + "%");
|
||||
|
||||
newObject.percentageOnTimeToShow = ((newObject.percentageOnTime == 0 || newObject.percentageOnTime == 0)
|
||||
? G_STRING['ID_INBOX'] + ' ' + G_STRING['ID_EMPTY']
|
||||
: newObject.percentageOnTimeWidth + "%");
|
||||
|
||||
newObject.overdueVisibility = (newObject.percentageOverdueWidth > 0) ? "visible" : "hidden";
|
||||
newObject.atRiskVisibility = (newObject.percentageAtRiskWidth > 0) ? "visible" : "hidden";
|
||||
newObject.onTimeVisibility = (newObject.percentageOnTimeWidth > 0) ? "visible" : "hidden";
|
||||
returnList.push(newObject);
|
||||
i++;
|
||||
});
|
||||
@@ -164,25 +183,8 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) {
|
||||
"inefficiencyCost" : "value"
|
||||
};
|
||||
var newObject = that.helper.merge(originalObject, {}, map);
|
||||
var shortLabel = (newObject.datalabel == null)
|
||||
? ""
|
||||
: newObject.datalabel.substring(0,15);
|
||||
|
||||
newObject.datalabel = shortLabel;
|
||||
|
||||
//use positive values for drawing;
|
||||
if (newObject.value > 0) {
|
||||
newObject.value = 0;
|
||||
}
|
||||
if (newObject.value < 0) {
|
||||
newObject.value = Math.abs(newObject.value);
|
||||
}
|
||||
|
||||
if (newObject.value > 0) {
|
||||
graphData.push(newObject);
|
||||
}
|
||||
|
||||
originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost);
|
||||
graphData.push(newObject);
|
||||
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost);
|
||||
originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100;
|
||||
originalObject.indicatorId = data.id;
|
||||
originalObject.json = JSON.stringify(originalObject);
|
||||
@@ -190,16 +192,11 @@ ViewDashboardPresenter.prototype.peiViewModel = function(data) {
|
||||
|
||||
var retval = {};
|
||||
retval = data;
|
||||
graphData.sort(function(a,b) {
|
||||
var retval = 0;
|
||||
retval = ((a.value*1.0 <= b.value*1.0) ? -1 : 1);
|
||||
return retval;
|
||||
})
|
||||
retval.dataToDraw = graphData.splice(0,7);
|
||||
|
||||
this.makeShortLabel(graphData, 10);
|
||||
retval.dataToDraw = this.adaptGraphData(graphData);
|
||||
|
||||
//TODO aumentar el símbolo de moneda $
|
||||
retval.inefficiencyCostToShow = "$ " +Math.round(retval.inefficiencyCost);
|
||||
retval.inefficiencyCostToShow = Math.round(retval.inefficiencyCost);
|
||||
retval.efficiencyIndexToShow = Math.round(retval.efficiencyIndex * 100) / 100;
|
||||
return retval;
|
||||
};
|
||||
@@ -216,23 +213,8 @@ ViewDashboardPresenter.prototype.ueiViewModel = function(data) {
|
||||
"deviationTime" : "dispersion"
|
||||
};
|
||||
var newObject = that.helper.merge(originalObject, {}, map);
|
||||
var shortLabel = (newObject.datalabel == null)
|
||||
? ""
|
||||
: newObject.datalabel.substring(0,7);
|
||||
|
||||
newObject.datalabel = shortLabel;
|
||||
//use positive values for drawing;
|
||||
if (newObject.value > 0) {
|
||||
newObject.value = 0;
|
||||
}
|
||||
if (newObject.value < 0) {
|
||||
newObject.value = Math.abs(newObject.value);
|
||||
}
|
||||
|
||||
if (newObject.value > 0) {
|
||||
graphData.push(newObject);
|
||||
}
|
||||
originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost);
|
||||
graphData.push(newObject);
|
||||
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost);
|
||||
originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100;
|
||||
originalObject.indicatorId = data.id;
|
||||
originalObject.json = JSON.stringify(originalObject);
|
||||
@@ -240,15 +222,10 @@ ViewDashboardPresenter.prototype.ueiViewModel = function(data) {
|
||||
|
||||
var retval = {};
|
||||
retval = data;
|
||||
graphData.sort(function(a,b) {
|
||||
var retval = 0;
|
||||
retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1);
|
||||
return retval;
|
||||
})
|
||||
retval.dataToDraw = graphData.splice(0,7);
|
||||
this.makeShortLabel(graphData, 10);
|
||||
retval.dataToDraw = this.adaptGraphData(graphData);
|
||||
|
||||
//TODO aumentar el símbolo de moneda $
|
||||
retval.inefficiencyCostToShow = "$ " + Math.round(retval.inefficiencyCost);
|
||||
retval.inefficiencyCostToShow = Math.round(retval.inefficiencyCost);
|
||||
retval.efficiencyIndexToShow = Math.round(retval.efficiencyIndex * 100) / 100;
|
||||
return retval;
|
||||
};
|
||||
@@ -263,20 +240,18 @@ ViewDashboardPresenter.prototype.statusViewModel = function(indicatorId, data) {
|
||||
$.each(data.dataList, function(index, originalObject) {
|
||||
|
||||
originalObject.taskTitle = that.helper.labelIfEmpty(originalObject.taskTitle);
|
||||
//TODO use more that 10 chars when the label and color problem in pie 2D is solved.
|
||||
var title = originalObject.taskTitle.substring(0,10);
|
||||
|
||||
//TODO Do not use the str. replace when color and lable in pie 2D is solved.
|
||||
var newObject1 = {
|
||||
datalabel : title.trim().replace(" ", "_"),
|
||||
datalabel : title,
|
||||
value : originalObject.percentageTotalOverdue
|
||||
};
|
||||
var newObject2 = {
|
||||
datalabel : title.trim().replace(" ", "_"),
|
||||
datalabel : title,
|
||||
value : originalObject.percentageTotalAtRisk
|
||||
};
|
||||
var newObject3 = {
|
||||
datalabel : title.trim().replace(" ", "_"),
|
||||
datalabel : title,
|
||||
value : originalObject.percentageTotalOnTime
|
||||
};
|
||||
|
||||
@@ -298,8 +273,7 @@ ViewDashboardPresenter.prototype.statusViewModel = function(indicatorId, data) {
|
||||
retval.graph1Data = this.orderGraphData(graph1Data, "down").splice(0,7)
|
||||
retval.graph2Data = this.orderGraphData(graph2Data, "down").splice(0,7)
|
||||
retval.graph3Data = this.orderGraphData(graph3Data, "down").splice(0,7)
|
||||
//TODO correct 2D Pie so we don't depend on label name
|
||||
|
||||
|
||||
$.each(retval.graph1Data, function(index, item) { item.datalabel = (index + 1) + "." + item.datalabel; });
|
||||
$.each(retval.graph2Data, function(index, item) { item.datalabel = (index + 1) + "." + item.datalabel; });
|
||||
$.each(retval.graph3Data, function(index, item) { item.datalabel = (index + 1) + "." + item.datalabel; });
|
||||
@@ -370,29 +344,15 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelPei = function(modelD
|
||||
"deviationTime" : "dispersion"
|
||||
};
|
||||
var newObject = that.helper.merge(originalObject, {}, map);
|
||||
newObject.datalabel = ((newObject.datalabel == null) ? "" : newObject.datalabel.substring(0, 7));
|
||||
originalObject.inefficiencyCostToShow = "$ " + Math.round(originalObject.inefficiencyCost);
|
||||
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost);
|
||||
originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100;
|
||||
originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime);
|
||||
//use positive values for drawing;
|
||||
if (newObject.value > 0) {
|
||||
newObject.value = 0;
|
||||
}
|
||||
if (newObject.value < 0) {
|
||||
newObject.value = Math.abs(newObject.value);
|
||||
}
|
||||
|
||||
if (newObject.value > 0) {
|
||||
graphData.push(newObject);
|
||||
}
|
||||
originalObject.rankToShow = originalObject.rank + "/" + modelData.length;
|
||||
graphData.push(newObject);
|
||||
});
|
||||
var retval = {};
|
||||
graphData.sort(function(a,b) {
|
||||
var retval = 0;
|
||||
retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1);
|
||||
return retval;
|
||||
})
|
||||
retval.dataToDraw = graphData.splice(0,7);
|
||||
this.makeShortLabel(graphData, 10);
|
||||
retval.dataToDraw = this.adaptGraphData(graphData);
|
||||
retval.entityData = modelData;
|
||||
return retval;
|
||||
};
|
||||
@@ -411,30 +371,16 @@ ViewDashboardPresenter.prototype.returnIndicatorSecondLevelUei = function(modelD
|
||||
"deviationTime" : "dispersion"
|
||||
};
|
||||
var newObject = that.helper.merge(originalObject, {}, map);
|
||||
newObject.datalabel = ((newObject.datalabel == null) ? "" : newObject.datalabel.substring(0, 7));
|
||||
originalObject.inefficiencyCostToShow = "$ " +Math.round(originalObject.inefficiencyCost);
|
||||
originalObject.inefficiencyCostToShow = Math.round(originalObject.inefficiencyCost);
|
||||
originalObject.efficiencyIndexToShow = Math.round(originalObject.efficiencyIndex * 100) / 100;
|
||||
originalObject.deviationTimeToShow = Math.round(originalObject.deviationTime);
|
||||
//use positive values for drawing;
|
||||
if (newObject.value > 0) {
|
||||
newObject.value = 0;
|
||||
}
|
||||
if (newObject.value < 0) {
|
||||
newObject.value = Math.abs(newObject.value);
|
||||
}
|
||||
|
||||
if (newObject.value > 0) {
|
||||
graphData.push(newObject);
|
||||
}
|
||||
originalObject.rankToShow = originalObject.rank + "/" + modelData.length;
|
||||
graphData.push(newObject);
|
||||
|
||||
});
|
||||
var retval = {};
|
||||
graphData.sort(function(a,b) {
|
||||
var retval = 0;
|
||||
retval = ((a.value*1.0 <= b.value*1.0) ? 1 : -1);
|
||||
return retval;
|
||||
})
|
||||
retval.dataToDraw = graphData.splice(0,7);
|
||||
this.makeShortLabel(graphData, 10);
|
||||
retval.dataToDraw = this.adaptGraphData(graphData);
|
||||
retval.entityData = modelData;
|
||||
return retval;
|
||||
};
|
||||
@@ -479,3 +425,33 @@ ViewDashboardPresenter.prototype.orderGraphData = function(listData, orderDirect
|
||||
}
|
||||
return listData.sort(orderToUse);
|
||||
}
|
||||
|
||||
ViewDashboardPresenter.prototype.adaptGraphData = function(listData) {
|
||||
var workList = this.orderGraphData(listData, "up");
|
||||
var newList = [];
|
||||
$.each(workList, function(index, item) {
|
||||
item.datalabel = (index + 1) + "." + item.datalabel;
|
||||
//use positive values for drawing;
|
||||
if (item.value > 0) {
|
||||
item.value = 0;
|
||||
}
|
||||
if (item.value < 0) {
|
||||
item.value = Math.abs(item.value);
|
||||
}
|
||||
|
||||
if (item.value > 0) {
|
||||
newList.push(item);
|
||||
}
|
||||
});
|
||||
return newList.splice(0,7);
|
||||
}
|
||||
|
||||
ViewDashboardPresenter.prototype.makeShortLabel = function(listData, labelLength) {
|
||||
$.each(listData, function(index, item) {
|
||||
var shortLabel = (item.datalabel == null)
|
||||
? ""
|
||||
: item.datalabel.substring(0,labelLength);
|
||||
item.datalabel = shortLabel;
|
||||
item.datalabel = shortLabel;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -141,13 +141,41 @@ WidgetBuilder.prototype.buildSpecialIndicatorSecondView = function (secondViewDa
|
||||
return $retval;
|
||||
};
|
||||
|
||||
WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetail = function (oneItemDetail) {
|
||||
WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetailPei = function (oneItemDetail) {
|
||||
if (oneItemDetail == null){throw new Error("oneItemDetail is null ");}
|
||||
if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);}
|
||||
if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);}
|
||||
|
||||
_.templateSettings.variable = "detailData";
|
||||
var template = _.template ($("script.specialIndicatorSencondViewDetail").html());
|
||||
var template = _.template ($("script.specialIndicatorSecondViewDetailPei").html());
|
||||
var $retval = $(template(oneItemDetail));
|
||||
$retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX);
|
||||
$retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST);
|
||||
this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetailUei = function (oneItemDetail) {
|
||||
if (oneItemDetail == null){throw new Error("oneItemDetail is null ");}
|
||||
if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);}
|
||||
if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);}
|
||||
|
||||
_.templateSettings.variable = "detailData";
|
||||
var template = _.template ($("script.specialIndicatorSecondViewDetailUei").html());
|
||||
var $retval = $(template(oneItemDetail));
|
||||
$retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX);
|
||||
$retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST);
|
||||
this.setColorForInefficiency($retval.find(".detail-cost-number-selector"), oneItemDetail);
|
||||
return $retval;
|
||||
}
|
||||
|
||||
WidgetBuilder.prototype.buildSpecialIndicatorSecondViewDetaiUei = function (oneItemDetail) {
|
||||
if (oneItemDetail == null){throw new Error("oneItemDetail is null ");}
|
||||
if (!typeof(oneItemDetail) === 'object'){throw new Error( "detailData is not and object ->" + oneItemDetail);}
|
||||
if (!oneItemDetail.hasOwnProperty("name")){throw new Error("buildSpecialIndicatorFirstViewDetail -> detailData has not the name param. Has it the correct Type? ->" + oneItemDetail);}
|
||||
|
||||
_.templateSettings.variable = "detailData";
|
||||
var template = _.template ($("script.specialIndicatorSencondViewDetailUei").html());
|
||||
var $retval = $(template(oneItemDetail));
|
||||
$retval.find(".detail-efficiency-selector").text(G_STRING.ID_EFFICIENCY_INDEX);
|
||||
$retval.find(".detail-cost-selector").text(G_STRING.ID_INEFFICIENCY_COST);
|
||||
@@ -325,20 +353,17 @@ $(document).ready(function() {
|
||||
presenter.getDashboardIndicators(dashboardId, defaultInitDate(), defaultEndDate())
|
||||
.done(function(indicatorsVM) {
|
||||
fillIndicatorWidgets(indicatorsVM);
|
||||
//TODO use real data
|
||||
loadIndicator(getFavoriteIndicator().id, defaultInitDate(), defaultEndDate());
|
||||
});
|
||||
});
|
||||
|
||||
$('#indicatorsGridStack').on('click','.ind-button-selector', function() {
|
||||
var indicatorId = $(this).data('indicator-id');
|
||||
//TODO use real data
|
||||
loadIndicator(indicatorId, defaultInitDate(), defaultEndDate());
|
||||
});
|
||||
|
||||
$('body').on('click','.bread-back-selector', function() {
|
||||
var indicatorId = window.currentIndicator.id;
|
||||
//TODO use real data
|
||||
loadIndicator(indicatorId, defaultInitDate(), defaultEndDate());
|
||||
return false;
|
||||
});
|
||||
@@ -352,7 +377,6 @@ $(document).ready(function() {
|
||||
"inefficiencyCost":$(this).data('detail-cost'),
|
||||
"name":$(this).data('detail-name')
|
||||
};
|
||||
//TODO PASS REAL VALUES
|
||||
presenter.getSpecialIndicatorSecondLevel(detailId, window.currentIndicator.type, defaultInitDate(), defaultEndDate())
|
||||
.done(function (viewModel) {
|
||||
fillSpecialIndicatorSecondView(viewModel);
|
||||
@@ -366,15 +390,49 @@ var hideScrollIfAllDivsAreVisible = function(){
|
||||
$('#scrollImg').hide();
|
||||
}
|
||||
else {
|
||||
$('#scrollImg').css('visibility', 'visible');
|
||||
$('#scrollImg').show();
|
||||
}
|
||||
}
|
||||
|
||||
var hideTitleAndSortDiv = function(){
|
||||
if (window.currentIndicator == null) {
|
||||
$('#relatedLabel').hide();
|
||||
}
|
||||
switch (window.currentIndicator.type) {
|
||||
case "1010":
|
||||
case "1030":
|
||||
if($('.detail-button-selector').length == 0) {
|
||||
$('#relatedLabel').hide();
|
||||
//$('#relatedLabel').find('h3').text(G_STRING['ID_NO_DATA_TO_DISPLAY']);
|
||||
}
|
||||
else {
|
||||
$('#relatedLabel').css('visibility', 'visible');
|
||||
$('#relatedLabel').show();
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
$('#relatedLabel').hide();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
var selectedOrderOfDetailList = function () {
|
||||
return ($('#sortListButton').hasClass('fa-chevron-up') ? "up" : "down");
|
||||
}
|
||||
|
||||
var selectDefaultMonthAndYear = function () {
|
||||
var compareDate = new Date();
|
||||
compareDate.setMonth(compareDate.getMonth() - 1);
|
||||
var compareMonth = compareDate.getMonth() + 1;
|
||||
var compareYear = compareDate.getYear();
|
||||
$('#month').val(compareMonth);
|
||||
$('#year').val(compareYear);
|
||||
}
|
||||
|
||||
var initialDraw = function () {
|
||||
selectDefaultMonthAndYear();
|
||||
presenter.getUserDashboards(pageUserId)
|
||||
.then(function(dashboardsVM) {
|
||||
fillDashboardsList(dashboardsVM);
|
||||
@@ -407,6 +465,8 @@ var loadIndicator = function (indicatorId, initDate, endDate) {
|
||||
break;
|
||||
}
|
||||
});
|
||||
hideScrollIfAllDivsAreVisible();
|
||||
hideTitleAndSortDiv();
|
||||
}
|
||||
|
||||
var setIndicatorActiveMarker = function () {
|
||||
@@ -476,10 +536,6 @@ var fillIndicatorWidgets = function (presenterData) {
|
||||
$.each(presenterData, function(key, indicator) {
|
||||
var $widget = widgetBuilder.getIndicatorWidget(indicator);
|
||||
grid.add_widget($widget, indicator.toDrawX, indicator.toDrawY, indicator.toDrawWidth, indicator.toDrawHeight, true);
|
||||
//TODO will exist animation?
|
||||
/*if (indicator.category == "normal") {
|
||||
animateProgress(indicator, $widget);
|
||||
}*/
|
||||
var $title = $widget.find('.ind-title-selector');
|
||||
if (indicator.favorite == "1") {
|
||||
$title.addClass("panel-active");
|
||||
@@ -501,13 +557,14 @@ var fillStatusIndicatorFirstView = function (presenterData) {
|
||||
containerId:'graph1',
|
||||
width:300,
|
||||
height:300,
|
||||
stretch:true
|
||||
stretch:true,
|
||||
noDataText: G_STRING.ID_DISPLAY_EMPTY
|
||||
},
|
||||
graph: {
|
||||
|
||||
allowDrillDown:true,
|
||||
allowTransition:true,
|
||||
showTip: true,
|
||||
showTip: false,
|
||||
allowZoom: false,
|
||||
showLabels: true
|
||||
}
|
||||
@@ -526,7 +583,6 @@ var fillStatusIndicatorFirstView = function (presenterData) {
|
||||
|
||||
var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(presenterData.id)
|
||||
setIndicatorActiveMarker();
|
||||
$('#relatedLabel').hide();
|
||||
}
|
||||
|
||||
var fillStatusIndicatorFirstViewDetail = function(presenterData) {
|
||||
@@ -550,7 +606,6 @@ var fillStatusIndicatorFirstViewDetail = function(presenterData) {
|
||||
}
|
||||
|
||||
var fillSpecialIndicatorFirstView = function(presenterData) {
|
||||
$('#relatedLabel').show();
|
||||
var widgetBuilder = new WidgetBuilder();
|
||||
var panel = $('#indicatorsDataGridStack').data('gridstack');
|
||||
panel.remove_all();
|
||||
@@ -563,7 +618,8 @@ var fillSpecialIndicatorFirstView = function(presenterData) {
|
||||
containerId:'specialIndicatorGraph',
|
||||
width:300,
|
||||
height:300,
|
||||
stretch:true
|
||||
stretch:true,
|
||||
noDataText: G_STRING.ID_NO_INEFFICIENT_PROCESSES
|
||||
},
|
||||
graph: {
|
||||
allowDrillDown:false,
|
||||
@@ -582,13 +638,14 @@ var fillSpecialIndicatorFirstView = function(presenterData) {
|
||||
containerId:'specialIndicatorGraph',
|
||||
width:500,
|
||||
height:300,
|
||||
stretch:true
|
||||
stretch:true,
|
||||
noDataText: G_STRING.ID_NO_INEFFICIENT_USER_GROUPS
|
||||
},
|
||||
graph: {
|
||||
allowDrillDown:false,
|
||||
allowTransition:true,
|
||||
axisX:{ showAxis: true, label: G_STRING.ID_GROUPS},
|
||||
axisY:{ showAxis: true, label: G_STRING.ID_COSTS},
|
||||
axisX:{ showAxis: true, label: G_STRING['ID_GROUPS']},
|
||||
axisY:{ showAxis: true, label: G_STRING['ID_COSTS']},
|
||||
gridLinesX:false,
|
||||
gridLinesY:true,
|
||||
showTip: true,
|
||||
@@ -669,8 +726,8 @@ var fillSpecialIndicatorSecondView = function(presenterData) {
|
||||
gridLinesX: true,
|
||||
gridLinesY: true,
|
||||
area: {visible: false, css:"area"},
|
||||
axisX:{ showAxis: true, label: G_STRING.ID_USER },
|
||||
axisY:{ showAxis: true, label: G_STRING.ID_COSTS },
|
||||
axisX:{ showAxis: true, label: G_STRING['ID_USER'] },
|
||||
axisY:{ showAxis: true, label: G_STRING['ID_COSTS'] },
|
||||
showErrorBars: true
|
||||
|
||||
}
|
||||
@@ -679,12 +736,14 @@ var fillSpecialIndicatorSecondView = function(presenterData) {
|
||||
var indicatorPrincipalData = widgetBuilder.getIndicatorLoadedById(window.currentEntityData.indicatorId);
|
||||
|
||||
if (window.currentIndicator.type == "1010") {
|
||||
detailParams.graph.axisX.label = G_STRING.ID_TASK;
|
||||
detailParams.graph.axisX.label = G_STRING['ID_TASK'] ;
|
||||
detailParams.canvas.noDataText = G_STRING['ID_NO_INEFFICIENT_TASKS'] ;
|
||||
var graph = new BarChart(presenterData.dataToDraw, detailParams, null, null);
|
||||
graph.drawChart();
|
||||
}
|
||||
|
||||
if (window.currentIndicator.type == "1030") {
|
||||
detailParams.canvas.noDataText = G_STRING['ID_NO_INEFFICIENT_USERS'] ;
|
||||
var graph = new BarChart(presenterData.dataToDraw, detailParams, null, null);
|
||||
graph.drawChart();
|
||||
}
|
||||
@@ -704,7 +763,14 @@ var fillSpecialIndicatorSecondViewDetail = function (list) {
|
||||
window.currentDetailFunction = fillSpecialIndicatorSecondViewDetail;
|
||||
|
||||
$.each(list, function(index, dataItem) {
|
||||
var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetail(dataItem);
|
||||
if (window.currentIndicator.type == "1010") {
|
||||
var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetailPei(dataItem);
|
||||
}
|
||||
|
||||
if (window.currentIndicator.type == "1030") {
|
||||
var $widget = widgetBuilder.buildSpecialIndicatorSecondViewDetailUei(dataItem);
|
||||
}
|
||||
|
||||
var x = (index % 2 == 0) ? 6 : 0;
|
||||
//the first 2 elements are not hidden
|
||||
if (index < 2) {
|
||||
@@ -788,7 +854,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) {
|
||||
allowDrillDown:false,
|
||||
allowTransition:true,
|
||||
axisX:{ showAxis: true, label: G_STRING.ID_YEAR },
|
||||
axisY:{ showAxis: true, label: G_STRING.ID_COSTS},
|
||||
axisY:{ showAxis: true, label: G_STRING.ID_TIME_HOURS },
|
||||
gridLinesX:false,
|
||||
gridLinesY:true,
|
||||
showTip: true,
|
||||
@@ -810,7 +876,7 @@ var fillGeneralIndicatorFirstView = function (presenterData) {
|
||||
allowDrillDown:false,
|
||||
allowTransition:true,
|
||||
axisX:{ showAxis: true, label: G_STRING.ID_YEAR },
|
||||
axisY:{ showAxis: true, label: G_STRING.ID_COSTS },
|
||||
axisY:{ showAxis: true, label: G_STRING.ID_TIME_HOURS },
|
||||
gridLinesX:false,
|
||||
gridLinesY:true,
|
||||
showTip: true,
|
||||
|
||||
@@ -156,5 +156,5 @@ if ($RBAC->userCanAccess("PM_SETUP") == 1) {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$G_TMP_MENU->AddIdRawOption("PMENTERPRISE", "../enterprise/addonsStore", G::LoadTranslation('ID_MENU_NAME') . $licStatusMsg, "", "", "plugins");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$G_TMP_MENU->AddIdRawOption("CASES_LIST_SETUP", "../cases/casesListSetup", G::LoadTranslation('ID_CASES_LIST'), "", "", "settings");
|
||||
$G_TMP_MENU->AddIdRawOption("CASES_LIST_SETUP", "../cases/casesListSetup", G::LoadTranslation("ID_CUSTOM_CASES_LISTS"), "", "", "settings");
|
||||
}
|
||||
|
||||
@@ -50,6 +50,22 @@ if ($actionAjax == "streaming") {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($actionAjax == "fileMobile") {
|
||||
$app_uid = isset( $_REQUEST['a'] ) ? $_REQUEST['a'] : null;
|
||||
$inp_doc_uid = isset( $_REQUEST['d'] ) ? $_REQUEST['d'] : null;
|
||||
|
||||
$structure = file_get_contents(PATH_HTML ."/mobile/index.json");
|
||||
$structure = json_decode($structure);
|
||||
foreach($structure as $build){
|
||||
foreach($build as $file){
|
||||
$file->lastModified = date ("D, d M Y H:i:s \G\M\T", filemtime(PATH_HTML ."/mobile/".$file->file));
|
||||
}
|
||||
}
|
||||
G::header( 'Content-Type: application/json' );
|
||||
echo G::json_encode($structure);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
function rangeDownload($location,$mimeType)
|
||||
|
||||
@@ -33,7 +33,6 @@ G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$_GET['i18'] = $filter->xssFilterHard($_GET['i18']);
|
||||
$_GET['newSite'] = $filter->xssFilterHard($_GET['newSite']);
|
||||
$_GET['module'] = $filter->xssFilterHard($_GET['module']);
|
||||
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
||||
return $RBAC_Response;
|
||||
@@ -78,10 +77,10 @@ foreach ($toolItems as $item) {
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $template );
|
||||
G::RenderPage( 'publish' );
|
||||
if (isset( $_GET['module'] )) {
|
||||
|
||||
$module = $filter->xssFilterHard($_GET['module']);
|
||||
print "
|
||||
<script>
|
||||
admToolsContent.location='" . $_GET['module'] . "';
|
||||
admToolsContent.location='" . $module . "';
|
||||
</script>
|
||||
";
|
||||
}
|
||||
|
||||
@@ -319,9 +319,9 @@ function importSkin ()
|
||||
|
||||
function exportSkin ($skinToExport = "")
|
||||
{
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
try {
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
if (! isset( $_REQUEST['SKIN_FOLDER_ID'] )) {
|
||||
throw (new Exception( G::LoadTranslation( 'ID_SKIN_NAME_REQUIRED' ) ));
|
||||
}
|
||||
@@ -356,19 +356,23 @@ function exportSkin ($skinToExport = "")
|
||||
$response['success'] = true;
|
||||
$response['message'] = $skinTar;
|
||||
G::auditLog("ExportSkin", "Skin Name: ".$skinName);
|
||||
|
||||
$response = $filter->xssFilterHard($response);
|
||||
|
||||
print_r( G::json_encode( $response ) );
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['message'] = $e->getMessage();
|
||||
$response = $filter->xssFilterHard($response);
|
||||
print_r( G::json_encode( $response ) );
|
||||
}
|
||||
}
|
||||
|
||||
function deleteSkin ()
|
||||
{
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
try {
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$_REQUEST['SKIN_FOLDER_ID'] = $filter->xssFilterHard($_REQUEST['SKIN_FOLDER_ID']);
|
||||
|
||||
if (! (isset( $_REQUEST['SKIN_FOLDER_ID'] ))) {
|
||||
@@ -389,6 +393,7 @@ function deleteSkin ()
|
||||
} catch (Exception $e) {
|
||||
$response['success'] = false;
|
||||
$response['error'] = $response['message'] = $e->getMessage();
|
||||
$response = $filter->xssFilterHard($response);
|
||||
print_r( G::json_encode( $response ) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -323,11 +323,15 @@ class Consolidated
|
||||
$oCriteria->add($oCriteria->getNewCriterion(AppCacheViewPeer::APP_NUMBER, $search, Criteria::LIKE));
|
||||
}
|
||||
}
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new \InputFilter();
|
||||
|
||||
if ($sort != "") {
|
||||
$reportTable = new ReportTables();
|
||||
$arrayReportTableVar = $reportTable->getTableVars($tableUid);
|
||||
|
||||
$tableName = $filter->validateInput($tableName);
|
||||
$sort = $filter->validateInput($sort);
|
||||
if (in_array($sort, $arrayReportTableVar)) {
|
||||
$sort = strtoupper($sort);
|
||||
eval("\$field = " . $tableName . "Peer::" . $sort . ";");
|
||||
|
||||
@@ -23,7 +23,7 @@ class Dashboard {
|
||||
require_once (PATH_HOME . "engine" . PATH_SEP . "classes" . PATH_SEP . "model" . PATH_SEP . "DashboardDasInd.php");
|
||||
$oDashboardDasInd = new \DashboardDasInd();
|
||||
|
||||
$response = $oDashboardDasInd->loadByOwner($usr_uid);
|
||||
$response = $oDashboardDasInd->loadOwnerByUserId($usr_uid);
|
||||
return $response;
|
||||
}
|
||||
|
||||
@@ -40,27 +40,32 @@ class Dashboard {
|
||||
{
|
||||
$resp = array();
|
||||
$dashboards = $this->getDashboardsUidByUser($usr_uid);
|
||||
$existFavorite = false;
|
||||
foreach($dashboards as $i=>$x) {
|
||||
$resp[$i] = $this->getDashboard($x['DAS_UID']);
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$dashConfig = $Dashboard->getConfig($usr_uid);
|
||||
$resp[$i]['DAS_FAVORITE'] = 0;
|
||||
foreach ($dashConfig as $dashId=>$dashData) {
|
||||
if($dashId == $x['DAS_UID'] ) {
|
||||
$resp[$i]['DAS_FAVORITE'] = $dashData['dashFavorite'];
|
||||
if ($dashData['dashFavorite']==1) {
|
||||
$existFavorite = true;
|
||||
}
|
||||
$existFavorite = false;
|
||||
foreach($dashboards as $i=>$x) {
|
||||
//$resp[$i] = $this->getDashboard($x['DAS_UID']);
|
||||
$dashboardUser = $this->getDashboard($x['DAS_UID']);
|
||||
if ($dashboardUser['DAS_STATUS'] == 0) {
|
||||
continue;
|
||||
}
|
||||
$resp[$i] = $dashboardUser;
|
||||
$Dashboard = new \ProcessMaker\BusinessModel\Dashboard();
|
||||
$dashConfig = $Dashboard->getConfig($usr_uid);
|
||||
$resp[$i]['DAS_FAVORITE'] = 0;
|
||||
foreach ($dashConfig as $dashId=>$dashData) {
|
||||
if($dashId == $x['DAS_UID'] ) {
|
||||
$resp[$i]['DAS_FAVORITE'] = $dashData['dashFavorite'];
|
||||
if ($dashData['dashFavorite']==1) {
|
||||
$existFavorite = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if no favorite is set, the default vavorite is the first one
|
||||
if ($existFavorite == false && $dashboards != null && sizeof($dashboards)>0) {
|
||||
$resp[0]['DAS_FAVORITE'] = 1;
|
||||
}
|
||||
}
|
||||
return $resp;
|
||||
|
||||
//if no favorite is set, the default favorite is the first one
|
||||
if ($existFavorite == false && $resp != null && sizeof($resp)>0) {
|
||||
$resp[0]['DAS_FAVORITE'] = 1;
|
||||
}
|
||||
return $resp;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -54,7 +54,7 @@ class Light
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
$task->setFormatFieldNameInUppercase(false);
|
||||
$task->setArrayParamException(array("taskUid" => "act_uid", "stepUid" => "step_uid"));
|
||||
|
||||
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
||||
$response = array();
|
||||
foreach ($processList as $key => $processInfo) {
|
||||
$tempTreeChildren = array ();
|
||||
@@ -71,6 +71,9 @@ class Light
|
||||
$newForm[$c]['index'] = $c+1;
|
||||
$newForm[$c]['title'] = $form['obj_title'];
|
||||
$newForm[$c]['description'] = $form['obj_description'];
|
||||
$newForm[$c]['stepId'] = $form["step_uid"];
|
||||
$trigger = $this->statusTriggers($step->doGetActivityStepTriggers($form["step_uid"], $tempTreeChild['taskId'], $tempTreeChild['processId']));
|
||||
$newForm[$c]["triggers"] = $trigger;
|
||||
$c++;
|
||||
}
|
||||
}
|
||||
@@ -87,6 +90,20 @@ class Light
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function statusTriggers($triggers)
|
||||
{
|
||||
$return = array("before" => false, "after"=> false);
|
||||
foreach($triggers as $trigger){
|
||||
if ($trigger['st_type'] == "BEFORE"){
|
||||
$return["before"]= true;
|
||||
}
|
||||
if ($trigger['st_type'] == "AFTER"){
|
||||
$return["after"]= true;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get counters each type of list
|
||||
* @param $userId
|
||||
@@ -810,5 +827,229 @@ class Light
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET return array category
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCategoryList ()
|
||||
{
|
||||
$category = array ();
|
||||
$category[] = array ("", G::LoadTranslation( "ID_ALL_CATEGORIES" ));
|
||||
|
||||
$criteria = new Criteria( 'workflow' );
|
||||
$criteria->addSelectColumn( \ProcessCategoryPeer::CATEGORY_UID );
|
||||
$criteria->addSelectColumn( \ProcessCategoryPeer::CATEGORY_NAME );
|
||||
$criteria->addAscendingOrderByColumn(\ProcessCategoryPeer::CATEGORY_NAME);
|
||||
|
||||
$dataset = \ProcessCategoryPeer::doSelectRS( $criteria );
|
||||
$dataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
|
||||
$dataset->next();
|
||||
|
||||
while ($row = $dataset->getRow()) {
|
||||
$category[] = array ($row['CATEGORY_UID'],$row['CATEGORY_NAME']);
|
||||
$dataset->next();
|
||||
}
|
||||
return $category;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $action
|
||||
* @param $categoryUid
|
||||
* @param $userUid
|
||||
* @return array
|
||||
* @throws \PropelException
|
||||
*/
|
||||
public function getProcessList ($action, $categoryUid, $userUid)
|
||||
{
|
||||
//$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
|
||||
//$categoryUid = isset( $_REQUEST['CATEGORY_UID'] ) ? $_REQUEST['CATEGORY_UID'] : null;
|
||||
//$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
|
||||
// global $oAppCache;
|
||||
$oAppCache = new \AppCacheView();
|
||||
$processes = array ();
|
||||
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' ));
|
||||
|
||||
//get the list based in the action provided
|
||||
switch ($action) {
|
||||
case 'draft':
|
||||
$cProcess = $oAppCache->getDraftListCriteria( $userUid ); //fast enough
|
||||
break;
|
||||
case 'sent':
|
||||
$cProcess = $oAppCache->getSentListProcessCriteria( $userUid ); // fast enough
|
||||
break;
|
||||
case 'simple_search':
|
||||
case 'search':
|
||||
//in search action, the query to obtain all process is too slow, so we need to query directly to
|
||||
//process and content tables, and for that reason we need the current language in AppCacheView.
|
||||
G::loadClass( 'configuration' );
|
||||
$oConf = new \Configurations();
|
||||
$oConf->loadConfig( $x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '' );
|
||||
$appCacheViewEngine = $oConf->aConfig;
|
||||
$lang = isset( $appCacheViewEngine['LANG'] ) ? $appCacheViewEngine['LANG'] : 'en';
|
||||
|
||||
$cProcess = new Criteria( 'workflow' );
|
||||
$cProcess->clearSelectColumns();
|
||||
$cProcess->addSelectColumn( \ProcessPeer::PRO_UID );
|
||||
$cProcess->addSelectColumn( \ContentPeer::CON_VALUE );
|
||||
if ($categoryUid) {
|
||||
$cProcess->add( \ProcessPeer::PRO_CATEGORY, $categoryUid );
|
||||
}
|
||||
$del = DBAdapter::getStringDelimiter();
|
||||
$conds = array ();
|
||||
$conds[] = array (ProcessPeer::PRO_UID,ContentPeer::CON_ID);
|
||||
$conds[] = array (ContentPeer::CON_CATEGORY,$del . 'PRO_TITLE' . $del);
|
||||
$conds[] = array (ContentPeer::CON_LANG,$del . $lang . $del);
|
||||
$cProcess->addJoinMC( $conds, Criteria::LEFT_JOIN );
|
||||
$cProcess->add( ProcessPeer::PRO_STATUS, 'ACTIVE' );
|
||||
$cProcess->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
|
||||
|
||||
$oDataset = ProcessPeer::doSelectRS( $cProcess );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$processes[] = array ($aRow['PRO_UID'],$aRow['CON_VALUE']
|
||||
);
|
||||
$oDataset->next();
|
||||
}
|
||||
return print G::json_encode( $processes );
|
||||
break;
|
||||
case 'unassigned':
|
||||
$cProcess = $oAppCache->getUnassignedListCriteria( $userUid );
|
||||
break;
|
||||
case 'paused':
|
||||
$cProcess = $oAppCache->getPausedListCriteria( $userUid );
|
||||
break;
|
||||
case 'to_revise':
|
||||
$cProcess = $oAppCache->getToReviseListCriteria( $userUid );
|
||||
break;
|
||||
case 'to_reassign':
|
||||
$cProcess = $oAppCache->getToReassignListCriteria($userUid);
|
||||
break;
|
||||
case 'gral':
|
||||
$cProcess = $oAppCache->getGeneralListCriteria();
|
||||
break;
|
||||
case 'todo':
|
||||
default:
|
||||
$cProcess = $oAppCache->getToDoListCriteria( $userUid ); //fast enough
|
||||
break;
|
||||
}
|
||||
//get the processes for this user in this action
|
||||
$cProcess->clearSelectColumns();
|
||||
$cProcess->addSelectColumn( \AppCacheViewPeer::PRO_UID );
|
||||
$cProcess->addSelectColumn( \AppCacheViewPeer::APP_PRO_TITLE );
|
||||
$cProcess->setDistinct( \AppCacheViewPeer::PRO_UID );
|
||||
if ($categoryUid) {
|
||||
require_once 'classes/model/Process.php';
|
||||
$cProcess->addAlias( 'CP', 'PROCESS' );
|
||||
$cProcess->add( 'CP.PRO_CATEGORY', $categoryUid, Criteria::EQUAL );
|
||||
$cProcess->addJoin( \AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN );
|
||||
$cProcess->addAsColumn( 'CATEGORY_UID', 'CP.PRO_CATEGORY' );
|
||||
}
|
||||
|
||||
$cProcess->addAscendingOrderByColumn(\AppCacheViewPeer::APP_PRO_TITLE);
|
||||
|
||||
$oDataset = \AppCacheViewPeer::doSelectRS( $cProcess, \Propel::getDbConnection('workflow_ro') );
|
||||
$oDataset->setFetchmode( \ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$processes[] = array ($aRow['PRO_UID'],$aRow['APP_PRO_TITLE']
|
||||
);
|
||||
$oDataset->next();
|
||||
}
|
||||
return $processes;
|
||||
}
|
||||
|
||||
/**
|
||||
* lista de usuarios a reasignar
|
||||
*/
|
||||
public function getUsersToReassign($usr_uid, $task_uid)
|
||||
{
|
||||
//G::LoadClass( 'tasks' );
|
||||
G::LoadSystem( 'rbac' );
|
||||
G::LoadClass( 'memcached' );
|
||||
$memcache = \PMmemcached::getSingleton( SYS_SYS );
|
||||
$RBAC = \RBAC::getSingleton( PATH_DATA, session_id() );
|
||||
$RBAC->sSystem = 'PROCESSMAKER';
|
||||
$RBAC->initRBAC();
|
||||
$memKey = 'rbacSession' . session_id();
|
||||
if (($RBAC->aUserInfo = $memcache->get( $memKey )) === false) {
|
||||
$RBAC->loadUserRolePermission( $RBAC->sSystem, $usr_uid );
|
||||
$memcache->set( $memKey, $RBAC->aUserInfo, \PMmemcached::EIGHT_HOURS );
|
||||
}
|
||||
$GLOBALS['RBAC'] = $RBAC;
|
||||
|
||||
$task = new \Task();
|
||||
$tasks = $task->load($task_uid);
|
||||
$case = new \Cases();
|
||||
$result = new \stdclass();
|
||||
$result->data = $case->getUsersToReassign($task_uid, $usr_uid, $tasks['PRO_UID']);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function reassignCase($usr_uid, $app_uid, $TO_USR_UID)
|
||||
{
|
||||
$cases = new \Cases();
|
||||
$user = new \Users();
|
||||
$app = new \Application();
|
||||
$result = new \stdclass();
|
||||
|
||||
try {
|
||||
$iDelIndex = $cases->getCurrentDelegation( $app_uid, $usr_uid );
|
||||
$cases->reassignCase($app_uid, $iDelIndex, $usr_uid, $TO_USR_UID);
|
||||
$caseData = $app->load($app_uid);
|
||||
$userData = $user->load($TO_USR_UID);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
||||
$result->status = 0;
|
||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||
} catch (\Exception $e) {
|
||||
$result->status = 1;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function pauseCase($usr_uid, $app_uid, $request_data)
|
||||
{
|
||||
$result = new \stdclass();
|
||||
|
||||
try {
|
||||
$unpauseDate = $request_data['unpauseDate'] . ' '. $request_data['unpauseTime'];
|
||||
$oCase = new \Cases();
|
||||
$iDelIndex = $oCase->getCurrentDelegation( $app_uid, $usr_uid );
|
||||
// Save the note pause reason
|
||||
if ($request_data['noteContent'] != '') {
|
||||
$request_data['noteContent'] = G::LoadTranslation('ID_CASE_PAUSE_LABEL_NOTE') . ' ' . $request_data['noteContent'];
|
||||
$appNotes = new \AppNotes();
|
||||
$noteContent = addslashes($request_data['noteContent']);
|
||||
$appNotes->postNewNote($app_uid, $usr_uid, $noteContent, $request_data['notifyUser']);
|
||||
}
|
||||
// End save
|
||||
|
||||
$oCase->pauseCase($app_uid, $iDelIndex, $usr_uid, $unpauseDate);
|
||||
$app = new \Application();
|
||||
$caseData = $app->load($app_uid);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
$data['UNPAUSE_DATE'] = $unpauseDate;
|
||||
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation('ID_CASE_PAUSED_SUCCESSFULLY', SYS_LANG, $data);
|
||||
} catch (\Exception $e) {
|
||||
throw $e;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
801
workflow/engine/src/ProcessMaker/BusinessModel/ProcessMap.php
Normal file
801
workflow/engine/src/ProcessMaker/BusinessModel/ProcessMap.php
Normal file
@@ -0,0 +1,801 @@
|
||||
<?php
|
||||
|
||||
namespace ProcessMaker\BusinessModel;
|
||||
|
||||
class ProcessMap
|
||||
{
|
||||
private $running_case;
|
||||
private $diagram;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function get_image($schema, $schemaStatus, $output = 'file')
|
||||
{
|
||||
if (isset($schema)) {
|
||||
$arrActivity = array();
|
||||
foreach ($schemaStatus as $task) {
|
||||
$arrActivity[$task['tas_uid']] = $task['status'];
|
||||
}
|
||||
$this->running_case = array(
|
||||
'bpmnActivity' => $arrActivity,
|
||||
);
|
||||
|
||||
//GET DIAGRAMS
|
||||
$diagrams = $this->get_project_diagrams($schema['diagrams']);
|
||||
foreach ($diagrams as $diagram) {
|
||||
$files = $this->diagram_to_png($diagram);
|
||||
}
|
||||
}
|
||||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to retrieve shapes of diagrams
|
||||
* @param $prj_id
|
||||
*/
|
||||
private function get_project_diagrams($diagram)
|
||||
{
|
||||
$this->diagram = $diagram;
|
||||
if (isset($diagram)) {
|
||||
$response = array();
|
||||
foreach ($diagram as $row) {
|
||||
$tmp = new \stdClass();
|
||||
$tmp->activities = $row['activities'];
|
||||
$tmp->events = $row['events'];
|
||||
$tmp->gateways = $row['gateways'];
|
||||
$tmp->artifacts = $row['artifacts'];
|
||||
$tmp->flows = $row['flows'];
|
||||
$tmp->datas = $row['data'];
|
||||
$tmp->participants = $row['participants'];
|
||||
$tmp->laneset = $row['laneset'];
|
||||
$tmp->lanes = $row['lanes'];
|
||||
$response[] = $tmp;
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
private function diagram_to_png($diagram, $prj_name = '')
|
||||
{
|
||||
$serialize_data = serialize($diagram);
|
||||
$data = unserialize($serialize_data);
|
||||
$png_data = $this->convert_png_array($data);
|
||||
//TODO: avoid hardcoded
|
||||
$sprite_filename = PATH_HTML . 'lib/img/mafe_sprite.png';
|
||||
//TODO: avoid hardcoded
|
||||
$sprite_filename_bw = PATH_HTML . 'lib/img/mafe_sprite.png';
|
||||
$image_sprite = imagecreatefrompng($sprite_filename);
|
||||
$image_sprite_bw = imagecreatefrompng($sprite_filename_bw);
|
||||
$sprite_map = $this->load_sprite_coords();
|
||||
|
||||
$image = $this->allocate_diagram_image($png_data, $sprite_map, $image_sprite, $image_sprite_bw);
|
||||
|
||||
return $image;
|
||||
}
|
||||
|
||||
private function convert_png_array($data)
|
||||
{
|
||||
$pngArray = array();
|
||||
|
||||
foreach ($data->participants as $participants) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnParticipant';
|
||||
$tmpData[1] = $participants['bou_x'];
|
||||
$tmpData[2] = $participants['bou_y'];
|
||||
$tmpData[3] = $participants['bou_width'];
|
||||
$tmpData[4] = $participants['bou_height'];
|
||||
$tmpData[5] = "";
|
||||
$tmpData[6] = $participants['par_name'];
|
||||
$tmpData[7] = "";
|
||||
$tmpData[8] = $participants['par_uid'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->laneset as $laneset) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnPool';
|
||||
$tmpData[1] = $laneset['bou_x'];
|
||||
$tmpData[2] = $laneset['bou_y'];
|
||||
$tmpData[3] = $laneset['bou_width'];
|
||||
$tmpData[4] = $laneset['bou_height'];
|
||||
$tmpData[5] = $laneset['dat_type'];
|
||||
$tmpData[6] = $laneset['lns_name'];
|
||||
$tmpData[7] = "";
|
||||
$tmpData[8] = $laneset['lns_uid'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->lanes as $lanes) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnLane';
|
||||
$tmpData[1] = $lanes['bou_x'];
|
||||
$tmpData[2] = $lanes['bou_y'];
|
||||
$tmpData[3] = $lanes['bou_width'];
|
||||
$tmpData[4] = $lanes['bou_height'];
|
||||
$tmpData[5] = "";
|
||||
$tmpData[6] = $lanes['lan_name'];
|
||||
$tmpData[7] = "";
|
||||
$tmpData[8] = $lanes['lan_uid'];
|
||||
$tmpData[9] = "";
|
||||
|
||||
$tmpData[10] = $lanes['bou_container'];
|
||||
$tmpData[11] = $lanes['bou_element'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->activities as $activity) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnActivity';
|
||||
$tmpData[1] = $activity['bou_x'];
|
||||
$tmpData[2] = $activity['bou_y'];
|
||||
$tmpData[3] = $activity['bou_width'];
|
||||
$tmpData[4] = $activity['bou_height'];
|
||||
$tmpData[5] = $activity['act_type'];
|
||||
$tmpData[6] = $activity['act_name'];
|
||||
$tmpData[7] = $activity['act_task_type'] . '_' . $activity['act_loop_type'] . '_' . $activity['act_is_adhoc'] . '_' . $activity['act_is_collapsed'];
|
||||
$tmpData[8] = $activity['act_uid'];
|
||||
$tmpData[9] = $activity['act_script_type'];
|
||||
|
||||
$tmpData[10] = $activity['bou_container'];
|
||||
$tmpData[11] = $activity['bou_element'];
|
||||
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->events as $event) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnEvent';
|
||||
$tmpData[1] = $event['bou_x'];
|
||||
$tmpData[2] = $event['bou_y'];
|
||||
$tmpData[3] = $event['bou_width'];
|
||||
$tmpData[4] = $event['bou_height'];
|
||||
if ($event['evn_type'] == 'BOUNDARY') {
|
||||
$tmpData[5] = $event['evn_is_interrupting'] . '_INTERMEDIATE_EVENT';
|
||||
} else {
|
||||
$tmpData[5] = $event['evn_is_interrupting'] . '_' . $event['evn_type'] . '_EVENT';
|
||||
}
|
||||
$tmpData[6] = $event['evn_name'];
|
||||
if ($event['evn_type'] == 'BOUNDARY') {
|
||||
$tmpData[7] = 'INTERMEDIATE_' . $event['evn_marker'] . '_' . $event['evn_behavior'];
|
||||
} else if ($event['evn_type'] == 'INTERMEDIATE') {
|
||||
if ($event['evn_marker'] == 'EMPTY') {
|
||||
$tmpData[7] = 'EMPTY';
|
||||
} else {
|
||||
if ($event['evn_behavior'] != '') {
|
||||
$tmpData[7] = $event['evn_type'] . '_' . $event['evn_marker'] . '_' . $event['evn_behavior'];
|
||||
} else {
|
||||
$tmpData[7] = $event['evn_type'] . '_' . $event['evn_marker'];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($event['evn_marker'] == 'EMPTY') {
|
||||
$tmpData[7] = 'EMPTY';
|
||||
} else {
|
||||
if ($event['evn_message'] != '') {
|
||||
$tmpData[7] = $event['evn_type'] . '_' . $event['evn_marker'] . '_' . $event['evn_message'];
|
||||
} else {
|
||||
$tmpData[7] = $event['evn_type'] . '_' . $event['evn_marker'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$tmpData[8] = $event['evn_uid'];
|
||||
$tmpData[9] = "";
|
||||
|
||||
$tmpData[10] = $event['bou_container'];
|
||||
$tmpData[11] = $event['bou_element'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->gateways as $gateway) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnGateway';
|
||||
$tmpData[1] = $gateway['bou_x'];
|
||||
$tmpData[2] = $gateway['bou_y'];
|
||||
$tmpData[3] = $gateway['bou_width'];
|
||||
$tmpData[4] = $gateway['bou_height'];
|
||||
$tmpData[5] = $gateway['gat_type'] . '_GATEWAY';
|
||||
$tmpData[6] = $gateway['gat_name'];
|
||||
$tmpData[7] = '';
|
||||
$tmpData[8] = $gateway['gat_uid'];
|
||||
$tmpData[9] = '';
|
||||
$tmpData[10] = $gateway['bou_container'];
|
||||
$tmpData[11] = $gateway['bou_element'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->artifacts as $artifact) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnArtifact';
|
||||
$tmpData[1] = $artifact['bou_x'];
|
||||
$tmpData[2] = $artifact['bou_y'];
|
||||
$tmpData[3] = $artifact['bou_width'];
|
||||
$tmpData[4] = $artifact['bou_height'];
|
||||
$tmpData[5] = $artifact['art_name'];
|
||||
$tmpData[6] = $artifact['art_type'];
|
||||
$tmpData[7] = '';
|
||||
$tmpData[8] = $artifact['art_uid'];
|
||||
$tmpData[9] = '';
|
||||
$tmpData[10] = $artifact['bou_container'];
|
||||
$tmpData[11] = $artifact['bou_element'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->flows as $flow) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnFlow';
|
||||
$tmpData[1] = $flow['flo_name'];
|
||||
$tmpData[2] = $flow['flo_type'];
|
||||
$tmpData[3] = $flow['flo_element_origin_type'];
|
||||
$tmpData[4] = "";//$flow['flo_element_origin_port'];
|
||||
$tmpData[5] = $flow['flo_element_dest_type'];
|
||||
$tmpData[6] = "";//$flow['flo_element_dest_port'];
|
||||
$tmpData[7] = $flow['flo_element_origin'];
|
||||
$tmpData[8] = $flow['flo_element_dest'];
|
||||
$tmpData[9] = $flow['flo_state'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
foreach ($data->datas as $data) {
|
||||
$tmpData = array();
|
||||
$tmpData[0] = 'bpmnData';
|
||||
$tmpData[1] = $data['bou_x'];
|
||||
$tmpData[2] = $data['bou_y'];
|
||||
$tmpData[3] = $data['bou_width'];
|
||||
$tmpData[4] = $data['bou_height'];
|
||||
$tmpData[5] = $data['dat_type'];
|
||||
$tmpData[6] = $data['dat_name'];
|
||||
$tmpData[7] = "";
|
||||
$tmpData[8] = $data['dat_uid'];
|
||||
$tmpData[9] = '';
|
||||
$tmpData[10] = $data['bou_container'];
|
||||
$tmpData[11] = $data['bou_element'];
|
||||
$pngArray[] = $tmpData;
|
||||
}
|
||||
|
||||
return $pngArray;
|
||||
}
|
||||
|
||||
private function load_sprite_coords()
|
||||
{
|
||||
$xMap = array();
|
||||
$xMap['1_START_EVENT'] = array(0, 4759);
|
||||
$xMap['START_MESSAGECATCH_LEAD'] = array(0, 9371);
|
||||
$xMap['START_TIMER_LEAD'] = array(0, 8872);
|
||||
$xMap['START_CONDITIONAL_LEAD'] = array(0, 9180);
|
||||
$xMap['START_SIGNALCATCH_LEAD'] = array(0, 8905);
|
||||
$xMap['INTERMEDIATE_MESSAGETHROW_THROW'] = array(0, 8987);
|
||||
// $xMap['INTERMEDIATE_LINKTHROW_THROW'] = array(0, 4887);
|
||||
// $xMap['INTERMEDIATE_COMPENSATIONTHROW_THROW'] = array(0, 4260);
|
||||
$xMap['INTERMEDIATE_SIGNALTHROW_THROW'] = array(0, 9338);
|
||||
$xMap['INTERMEDIATE_MESSAGECATCH_CATCH'] = array(0, 9213);
|
||||
$xMap['INTERMEDIATE_TIMER_CATCH'] = array(0, 8704);
|
||||
$xMap['INTERMEDIATE_CONDITIONAL_CATCH'] = array(0, 9053);
|
||||
// $xMap['INTERMEDIATE_LINKCATCH_CATCH'] = array(0, 4648);
|
||||
$xMap['INTERMEDIATE_SIGNALCATCH_CATCH'] = array(0, 9246);
|
||||
|
||||
$xMap['1_END_EVENT'] = array(0, 4832);
|
||||
$xMap['END_MESSAGETHROW'] = array(0, 9486);
|
||||
$xMap['END_ERRORTHROW'] = array(0, 9545);
|
||||
$xMap['END_CANCELTHROW'] = array(0, 5125);
|
||||
$xMap['END_COMPENSATIONTHROW'] = array(0, 5473);
|
||||
$xMap['END_SIGNALTHROW'] = array(0, 9657);
|
||||
$xMap['END_TERMINATETHROW'] = array(0, 9609);
|
||||
|
||||
$xMap['EXCLUSIVE_GATEWAY'] = array(0, 2624);
|
||||
$xMap['PARALLEL_GATEWAY'] = array(0, 3301);
|
||||
$xMap['INCLUSIVE_GATEWAY'] = array(0, 2369);
|
||||
// $xMap['EVENTBASED_GATEWAY'] = array(0, 2753);
|
||||
// $xMap['COMPLEX_GATEWAY'] = array(0, 4394);
|
||||
|
||||
$xMap['TASK_SENDTASK'] = array(0, 10468);
|
||||
$xMap['TASK_RECEIVETASK'] = array(0, 10219);
|
||||
$xMap['TASK_USERTASK'] = array(0, 4453);
|
||||
$xMap['TASK_SERVICETASK'] = array(0, 8439);
|
||||
$xMap['TASK_SCRIPTTASK'] = array(0, 8851);
|
||||
$xMap['TASK_MANUALTASK'] = array(0, 9777);
|
||||
$xMap['TASK_BUSINESSRULE'] = array(0, 10561);
|
||||
$xMap['LOOP_LOOP'] = array(0, 5654);
|
||||
$xMap['LOOP_PARALLEL'] = array(0, 7108);
|
||||
$xMap['LOOP_SEQUENTIAL'] = array(0, 7036);
|
||||
|
||||
$xMap['DATAOBJECT'] = array(0, 5401);
|
||||
$xMap['DATAINPUT'] = array(0, 5791);
|
||||
$xMap['DATAOUTPUT'] = array(0, 6071);
|
||||
$xMap['DATASTORE'] = array(0, 3037);
|
||||
|
||||
|
||||
$xMap['arrow_target_right'] = array(0, 6727);
|
||||
$xMap['arrow_target_left'] = array(0, 6774);
|
||||
$xMap['arrow_target_top'] = array(0, 6819);
|
||||
$xMap['arrow_target_bottom'] = array(0, 6852);
|
||||
|
||||
$xMap['arrow_conditional_source_right'] = array(0, 99);
|
||||
$xMap['arrow_conditional_source_left'] = array(0, 99);
|
||||
$xMap['arrow_conditional_source_top'] = array(0, 111);
|
||||
$xMap['arrow_conditional_source_bottom'] = array(0, 111);
|
||||
|
||||
$xMap['arrow_default_source_right'] = array(0, 6893);
|
||||
$xMap['arrow_default_source_left'] = array(0, 6910);
|
||||
$xMap['arrow_default_source_top'] = array(0, 6863);
|
||||
$xMap['arrow_default_source_bottom'] = array(0, 6882);
|
||||
|
||||
$xMap['text_now'] = array(0, 0);
|
||||
$xMap['icon_terminated'] = array(0, 10);
|
||||
return $xMap;
|
||||
}
|
||||
|
||||
private function allocate_diagram_image(array $pngData, $xSpriteMap, $imgSprite, $imgSpriteBW = '')
|
||||
{
|
||||
$font = PATH_HTML .'lib/fonts/Chivo/Chivo-Regular.ttf';
|
||||
$minX = 10000;
|
||||
$minY = 10000;
|
||||
$maxW = 0;
|
||||
$maxH = 0;
|
||||
$border = 40;
|
||||
|
||||
foreach ($pngData as $coords) {
|
||||
if ($coords[0] !== 'bpmnFlow') {
|
||||
if ($minX > $coords[1]) {
|
||||
$minX = $coords[1];
|
||||
}
|
||||
if ($minY > $coords[2]) {
|
||||
$minY = $coords[2];
|
||||
}
|
||||
if ($maxW < ($coords[1] + $coords[3])) {
|
||||
$maxW = $coords[1] + $coords[3];
|
||||
}
|
||||
if ($maxH < ($coords[2] + $coords[4])) {
|
||||
$maxH = $coords[2] + $coords[4];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$x1 = $minX - $border;
|
||||
$y1 = $minY - $border;
|
||||
$x2 = $maxW + $border;
|
||||
$y2 = $maxH + $border;
|
||||
$cWidth = $x2 - $x1;
|
||||
$cHeight = $y2 - $y1;
|
||||
|
||||
if ($cWidth < 0 && $cHeight < 0) {
|
||||
$cWidth = 100;
|
||||
$cHeight = 100;
|
||||
}
|
||||
|
||||
$img = imagecreatetruecolor($cWidth, $cHeight);
|
||||
|
||||
$white = imagecolorallocate($img, 255, 255, 255);
|
||||
$black = imagecolorallocate($img, 0, 0, 0);
|
||||
$groupColor = imagecolorallocate($img, 153, 94, 6);
|
||||
$gray = imagecolorallocate($img, 0xC0, 0xC0, 0xC0);
|
||||
$aNotSupportedColor = imagecolorallocate($img, 59, 71, 83);
|
||||
$aNotSupportedFillColor = $white;
|
||||
|
||||
imagefill($img,0,0,$white);
|
||||
foreach ($pngData as $figure) {
|
||||
$shape_running = $this->get_shape_process($figure[8], $figure[0], $img);
|
||||
$shape_image = $imgSprite ;
|
||||
$aTaskColor = isset($shape_running->colors['color']) ? $shape_running->colors['color'] : imagecolorallocate($img, 59, 71, 83);
|
||||
$aTaskFillColor = isset($shape_running->colors['fillcolor']) ? $shape_running->colors['fillcolor'] : imagecolorallocate($img, 255, 255, 255);
|
||||
switch ($figure[0]) {
|
||||
case 'bpmnParticipant':
|
||||
case 'bpmnPool':
|
||||
$X1 = $figure[1] - $x1;
|
||||
$Y1 = $figure[2] - $y1;
|
||||
$X2 = $X1 + $figure[3];
|
||||
$Y2 = $Y1 + $figure[4];
|
||||
$points = array($X1 + 3, $Y1, $X2 - 3, $Y1, $X2, $Y1 + 3, $X2, $Y2 - 3, $X2 - 3, $Y2, $X1 + 3, $Y2, $X1, $Y2 - 3, $X1, $Y1 + 3);
|
||||
$borderColor = $aNotSupportedColor;
|
||||
$fillColor = $aNotSupportedFillColor;
|
||||
imagesetthickness($img, 3);
|
||||
|
||||
imagefilledpolygon($img, $points, 8, $fillColor);
|
||||
imagepolygon($img, $points, 8, $borderColor);
|
||||
imageline ( $img , $X1+40 , $Y1 , $X1+40 , $Y2 , $aTaskColor );
|
||||
//Print Text
|
||||
if (isset($figure[9]) && $figure[9] != '') {
|
||||
$tt = explode('_', $figure[7]);
|
||||
$this->print_text($img, $figure[6], 10, 90, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0], $tt[0]);
|
||||
} else {
|
||||
$this->print_text($img, $figure[6], 10, 90, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0], $figure[5]);
|
||||
}
|
||||
break;
|
||||
case 'bpmnLane':
|
||||
$newPoints = $this->getNewPoints($figure[11],$figure[10]);
|
||||
|
||||
$X1 = $figure[1] - $x1 + $newPoints[0];
|
||||
$Y1 = $figure[2] - $y1 + $newPoints[1];
|
||||
$X2 = $X1 + $figure[3];
|
||||
$Y2 = $Y1 + $figure[4];
|
||||
$points = array($X1 + 3, $Y1, $X2 - 3, $Y1, $X2, $Y1 + 3, $X2, $Y2 - 3, $X2 - 3, $Y2, $X1 + 3, $Y2, $X1, $Y2 - 3, $X1, $Y1 + 3);
|
||||
$borderColor = $aNotSupportedColor;
|
||||
$fillColor = $aNotSupportedFillColor;
|
||||
imagesetthickness($img, 3);
|
||||
|
||||
imagefilledpolygon($img, $points, 8, $fillColor);
|
||||
imagepolygon($img, $points, 8, $borderColor);
|
||||
|
||||
if (isset($figure[9]) && $figure[9] != '') {
|
||||
$tt = explode('_', $figure[7]);
|
||||
$this->print_text($img, $figure[6], 10, 90, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0], $tt[0]);
|
||||
} else {
|
||||
$this->print_text($img, $figure[6], 10, 90, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0], $figure[5]);
|
||||
}
|
||||
break;
|
||||
case 'bpmnActivity':
|
||||
$newPoints = $this->getNewPoints($figure[11],$figure[10]);
|
||||
$X1 = $figure[1] - $x1 + $newPoints[0];
|
||||
$Y1 = $figure[2] - $y1 + $newPoints[1];
|
||||
$X2 = $X1 + $figure[3];
|
||||
$Y2 = $Y1 + $figure[4];
|
||||
$properties = explode('_', $figure[7]);
|
||||
$points = array($X1 + 3, $Y1, $X2 - 3, $Y1, $X2, $Y1 + 3, $X2, $Y2 - 3, $X2 - 3, $Y2, $X1 + 3, $Y2, $X1, $Y2 - 3, $X1, $Y1 + 3);
|
||||
$points2 = array($X1 + 5, $Y1 + 2, $X2 - 5, $Y1 + 2, $X2 - 2, $Y1 + 5, $X2 - 2, $Y2 - 5, $X2 - 5, $Y2 - 2, $X1 + 5, $Y2 - 2, $X1 + 2, $Y2 - 5, $X1 + 2, $Y1 + 5);
|
||||
switch ($figure[5]) {
|
||||
case 'TASK':
|
||||
$borderColor = $aTaskColor;
|
||||
$fillColor = $aTaskFillColor;
|
||||
imagesetthickness($img, 2);
|
||||
break;
|
||||
default:
|
||||
$borderColor = $aNotSupportedColor;
|
||||
$fillColor = $aNotSupportedFillColor;
|
||||
imagesetthickness($img, 4);
|
||||
}
|
||||
//CURRENT CASE
|
||||
if ($shape_running->running) {
|
||||
$points_active = array($X1 + 3, $Y1, $X2 - 3, $Y1, $X2, $Y1 + 3, $X2, $Y2 - 3, $X2 - 3, $Y2, $X1 + 3, $Y2, $X1, $Y2 - 3, $X1, $Y1 + 3);
|
||||
imagefilledpolygon($img, $points, 8, $fillColor);
|
||||
imagepolygon($img, $points_active, 8, $borderColor);
|
||||
} else {
|
||||
imagefilledpolygon($img, $points, 8, $fillColor);
|
||||
imagepolygon($img, $points, 8, $borderColor);
|
||||
}
|
||||
//Task Type
|
||||
if ($figure[5] == 'TASK' || $figure[5] == 'TASKCALLACTIVITY') {
|
||||
if (isset($figure[9]) && $figure[9] != '') {
|
||||
$css = 'scripttask_' . strtolower($figure[9]);
|
||||
$spriteCoords = $xSpriteMap[$css];
|
||||
imagecopy($img, $shape_image, $figure[1] - $x1 - 2 + $newPoints[0], $figure[2] - $y1 - 2 + $newPoints[1], $spriteCoords[0], $spriteCoords[1], 39, 39);
|
||||
} elseif ($properties[0] != "EMPTY") {
|
||||
$css = 'TASK_' . strtoupper($properties[0]);
|
||||
$spriteCoords = $xSpriteMap[$css];
|
||||
imagecopy($img, $shape_image, $figure[1] - $x1 + 4 + $newPoints[0], $figure[2] - $y1 + 4 + $newPoints[1], $spriteCoords[0], $spriteCoords[1], 21, 21);
|
||||
}
|
||||
}
|
||||
//Makers
|
||||
if ($figure[5] == 'TASK' && ($properties[1] != 'NONE' && $properties[1] != 'EMPTY')) {
|
||||
$css = 'LOOP_' . strtoupper($properties[1]);
|
||||
$spriteCoords = $xSpriteMap[$css];
|
||||
imagecopy($img, $shape_image, $figure[1] - $x1 + $newPoints[0] + ($figure[3] - 21) / 2, $figure[2] - $y1 + $newPoints[1] + $figure[4] - 23, $spriteCoords[0], $spriteCoords[1], 21, 21);
|
||||
}
|
||||
//Print Text
|
||||
if (isset($figure[9]) && $figure[9] != '') {
|
||||
$tt = explode('_', $figure[7]);
|
||||
$this->print_text($img, $figure[6], 10, 0, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0], $tt[0]);
|
||||
} else {
|
||||
$this->print_text($img, $figure[6], 10, 0, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0], $figure[5]);
|
||||
}
|
||||
break;
|
||||
case 'bpmnEvent':
|
||||
$newPoints = $this->getNewPoints($figure[11],$figure[10]);
|
||||
$X1 = $figure[1] - $x1 + $newPoints[0];
|
||||
$Y1 = $figure[2] - $y1 + $figure[4] - 10 + $newPoints[1];
|
||||
$X2 = $X1 + $figure[3];
|
||||
$Y2 = $Y1 + $figure[4] + 5;
|
||||
$css = $figure[5];
|
||||
$marker = $figure[7];
|
||||
$spriteCoords = ($marker != 'EMPTY')?$xSpriteMap[$marker]:$xSpriteMap[$css];
|
||||
$mk = explode('_', $figure[7]);
|
||||
//CURRENT CASE
|
||||
imagecopy($img, $shape_image, $figure[1] - $x1 + $newPoints[0], $figure[2] - $y1 + $newPoints[1], $spriteCoords[0], $spriteCoords[1], $figure[3], $figure[4]);
|
||||
|
||||
if ($marker != 'EMPTY') {
|
||||
//END_CANCELTHROW???
|
||||
if (isset($xSpriteMap[$marker])) {
|
||||
$spriteCoords2 = $xSpriteMap[$marker];
|
||||
if (!($shape_running->running && $mk[1] == 'TIMER')) {
|
||||
imagecopy($img, $shape_image, $figure[1] - $x1 + $newPoints[0], $figure[2] - $y1 + $newPoints[1], $spriteCoords2[0], $spriteCoords2[1], $figure[3], $figure[4]);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->print_text($img, $figure[6], 10, 0, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0]);
|
||||
break;
|
||||
case 'bpmnGateway':
|
||||
$newPoints = $this->getNewPoints($figure[11],$figure[10]);
|
||||
$X1 = $figure[1] - $x1 + $newPoints[0];
|
||||
$Y1 = $figure[2] - $y1 + $figure[4] - 10 + $newPoints[1];
|
||||
$X2 = $X1 + $figure[3];
|
||||
$Y2 = $Y1 + $figure[4] + 5;
|
||||
$css = $figure[5];
|
||||
$spriteCoords = $xSpriteMap[$css];
|
||||
imagecopy($img, $shape_image, $figure[1] - $x1 + $newPoints[0], $figure[2] - $y1 + $newPoints[1], $spriteCoords[0], $spriteCoords[1], $figure[3], $figure[4]);
|
||||
$this->print_text($img, $figure[6], 10, 0, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0]);
|
||||
break;
|
||||
case 'bpmnArtifact':
|
||||
$newPoints = $this->getNewPoints($figure[11],$figure[10]);
|
||||
$xX1 = $figure[1] - $x1 + $newPoints[0];
|
||||
$xY1 = $figure[2] - $y1 + $newPoints[1];
|
||||
$xX2 = $xX1 + $figure[3];
|
||||
$xY2 = $xY1 + $figure[4];
|
||||
|
||||
if ($figure[6] == 'GROUP') {
|
||||
imagesetthickness($img, 2);
|
||||
$style = array(
|
||||
$groupColor, $groupColor, $groupColor, $groupColor, $groupColor,
|
||||
$white, $white, $white, $white, $white
|
||||
);
|
||||
imagesetstyle($img, $style);
|
||||
imageline($img, $xX1, $xY1, $xX2, $xY1, IMG_COLOR_STYLED);
|
||||
imageline($img, $xX2, $xY1, $xX2, $xY2, IMG_COLOR_STYLED);
|
||||
imageline($img, $xX2, $xY2, $xX1, $xY2, IMG_COLOR_STYLED);
|
||||
imageline($img, $xX1, $xY2, $xX1, $xY1, IMG_COLOR_STYLED);
|
||||
$this->print_text($img, $figure[5], 10, 0, $black, $font, $xX1, $xY1 - 5, $xX2, $xY2, $figure[0], $figure[5]);
|
||||
}
|
||||
if ($figure[6] == 'TEXT_ANNOTATION') {
|
||||
imagesetthickness($img, 1);
|
||||
imageline($img, $xX1, $xY1, $xX1, $xY2, $black);
|
||||
imageline($img, $xX1, $xY1, $xX1 + 15, $xY1, $black);
|
||||
imageline($img, $xX1, $xY2, $xX1 + 15, $xY2, $black);
|
||||
$this->print_text($img, $figure[5], 10, 0, $black, $font, $xX1, $xY1, $xX2, $xY2, $figure[0], $figure[6]);
|
||||
}
|
||||
break; //this break wasn't here ...
|
||||
case 'bpmnData':
|
||||
$newPoints = $this->getNewPoints($figure[11],$figure[10]);
|
||||
$X1 = $figure[1] - $x1 + $newPoints[0];
|
||||
$Y1 = $figure[2] - $y1 + $figure[4] - 10 + $newPoints[1];
|
||||
$X2 = $X1 + $figure[3];
|
||||
$Y2 = $Y1 + $figure[4] + 5;
|
||||
$css = $figure[5];
|
||||
$spriteCoords = $xSpriteMap[$css];
|
||||
imagecopy($img, $shape_image, $figure[1] - $x1 + $newPoints[0], $figure[2] - $y1 + $newPoints[1], $spriteCoords[0], $spriteCoords[1], $figure[3], $figure[4]);
|
||||
$this->print_text($img, $figure[6], 10, 0, $black, $font, $X1, $Y1, $X2, $Y2, $figure[0]);
|
||||
break;
|
||||
case 'bpmnFlow':
|
||||
$X1 = $figure[1] - $x1 ;
|
||||
$Y1 = $figure[2] - $y1 ;
|
||||
$X2 = $X1 + $figure[3];
|
||||
$Y2 = $Y1 + $figure[4];
|
||||
imagesetthickness($img, 1);
|
||||
$lines = $figure[9];
|
||||
$shape_o = $this->get_shape_process($figure[7], $figure[3]);
|
||||
$shape_d = $this->get_shape_process($figure[8], $figure[5]);
|
||||
// if ($shape_o->in_flow && $shape_d->in_flow) {
|
||||
$line_color = $black;
|
||||
$shape_image = $imgSprite;
|
||||
// } else {
|
||||
// $line_color = $gray;
|
||||
// $shape_image = $imgSpriteBW;
|
||||
// }
|
||||
foreach ($lines as $key => $segment) {
|
||||
if (isset($lines[$key + 1]) && $lines[$key + 1]['x'] != '' && $lines[$key + 1]['y'] != '') {
|
||||
if ($figure[2] == 'MESSAGE' || $figure[2] == 'ASSOCIATION' || $figure[2] == 'DATAASSOCIATION') {
|
||||
$style = array(
|
||||
$black, $black, $black, $black,
|
||||
$white, $white, $white, $white
|
||||
);
|
||||
imagesetstyle($img, $style);
|
||||
imageline($img, $lines[$key]['x'] - $x1, $lines[$key]['y'] - $y1, $lines[$key + 1]['x'] - $x1, $lines[$key + 1]['y'] - $y1, IMG_COLOR_STYLED);
|
||||
} else {
|
||||
imageline($img, $lines[$key]['x'] - $x1, $lines[$key]['y'] - $y1, $lines[$key + 1]['x'] - $x1, $lines[$key + 1]['y'] - $y1, $line_color);
|
||||
}
|
||||
if ((int) ((sizeof($lines) - 1) / 2) == $key) {
|
||||
$this->print_text($img, $figure[1], 10, 0, $black, $font, $lines[$key]['x'] - $x1, $lines[$key]['y'] - $y1, $lines[$key + 1]['x'] - $x1, $lines[$key + 1]['y'] - $y1, $figure[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$decorator_width = 11;
|
||||
$decorator_height = 11;
|
||||
//END DECORATOR
|
||||
|
||||
if ($lines[sizeof($lines) - 1]['x'] == $lines[sizeof($lines) - 2]['x']) {
|
||||
if ($lines[sizeof($lines) - 1]['y'] < $lines[sizeof($lines) - 2]['y']) {
|
||||
$spriteCoords = $xSpriteMap['arrow_target_bottom'];
|
||||
imagecopy($img, $shape_image, $lines[sizeof($lines) - 1]['x'] - (int) ($decorator_width / 2) - $x1, $lines[sizeof($lines) - 1]['y'] - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
} else {
|
||||
$spriteCoords = $xSpriteMap['arrow_target_top'];
|
||||
imagecopy($img, $shape_image, $lines[sizeof($lines) - 1]['x'] - (int) ($decorator_width / 2) - $x1, $lines[sizeof($lines) - 1]['y'] - $decorator_height - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
}
|
||||
} elseif (($lines[sizeof($lines) - 1]['y'] == $lines[sizeof($lines) - 2]['y'])) {
|
||||
if ($lines[sizeof($lines) - 1]['x'] < $lines[sizeof($lines) - 2]['x']) {
|
||||
$spriteCoords = $xSpriteMap['arrow_target_right'];
|
||||
imagecopy($img, $shape_image, $lines[sizeof($lines) - 1]['x'] - $x1, $lines[sizeof($lines) - 1]['y'] - (int) ($decorator_height / 2) - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
} else {
|
||||
$spriteCoords = $xSpriteMap['arrow_target_left'];
|
||||
imagecopy($img, $shape_image, $lines[sizeof($lines) - 1]['x'] - $decorator_width - $x1, $lines[sizeof($lines) - 1]['y'] - (int) ($decorator_height / 2) - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
}
|
||||
}
|
||||
|
||||
//SOURCE DECORATOR
|
||||
if ($figure[2] === 'DEFAULT' OR $figure[2] === 'CONDITIONAL') {
|
||||
if ($figure[2] === 'DEFAULT') {
|
||||
$source_decorator = '_default';
|
||||
} elseif ($figure[2] === 'CONDITIONAL') {
|
||||
$source_decorator = '_conditional';
|
||||
}
|
||||
|
||||
if ($lines[0]['x'] == $lines[1]['x']) {
|
||||
if ($lines[0]['y'] < $lines[1]['y']) {
|
||||
$spriteCoords = $xSpriteMap['arrow' . $source_decorator . '_source_top'];
|
||||
imagecopy($img, $shape_image, $lines[0]['x'] - (int) ($decorator_width / 2) - $x1, $lines[0]['y'] - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
} else {
|
||||
$spriteCoords = $xSpriteMap['arrow' . $source_decorator . '_source_bottom'];
|
||||
imagecopy($img, $shape_image, $lines[0]['x'] - (int) ($decorator_width / 2) - $x1, $lines[0]['y'] - $decorator_height - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
}
|
||||
} elseif (($lines[0]['y'] == $lines[1]['y'])) {
|
||||
if ($lines[0]['x'] < $lines[1]['x']) {
|
||||
$spriteCoords = $xSpriteMap['arrow' . $source_decorator . '_source_right'];
|
||||
imagecopy($img, $shape_image, $lines[0]['x'] - $x1, $lines[0]['y'] - (int) ($decorator_height / 2) - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
} else {
|
||||
$spriteCoords = $xSpriteMap['arrow' . $source_decorator . '_source_left'];
|
||||
imagecopy($img, $shape_image, $lines[0]['x'] - $decorator_width - $x1, $lines[0]['y'] - (int) ($decorator_height / 2) - $y1, $spriteCoords[0], $spriteCoords[1], $decorator_width, $decorator_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $img;
|
||||
}
|
||||
|
||||
private function get_shape_process($id, $shape, $img = null)
|
||||
{
|
||||
$result = new \stdClass();
|
||||
$result->running = false;
|
||||
$process_route = $this->running_case;
|
||||
if ($shape != 'bpmnFlow') {
|
||||
if (isset($process_route[$shape]) && array_key_exists($id, $process_route[$shape])) {
|
||||
$result->status = $process_route[$shape][$id];
|
||||
$result->colors = $this->get_shape_process_color($process_route[$shape][$id], $img);
|
||||
$result->running = true;
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function get_shape_process_color($status, $img)
|
||||
{
|
||||
$img = is_null($img) ? imagecreate(10,10):$img;
|
||||
$red = imagecolorallocate($img, 189, 10, 23);
|
||||
$red_1 = imagecolorallocate($img, 114, 2, 12);
|
||||
$orange = imagecolorallocate($img, 197, 119, 1);
|
||||
$orange_1 = imagecolorallocate($img, 150, 91, 2);
|
||||
$silver = imagecolorallocate($img, 170, 168, 166);
|
||||
$silver_1 = imagecolorallocate($img, 111, 109, 108);
|
||||
$green = imagecolorallocate($img, 27, 121, 9);
|
||||
$green_1 = imagecolorallocate($img, 15, 85, 2);
|
||||
$white = imagecolorallocate($img, 59, 71, 83);
|
||||
$white_1 = imagecolorallocate($img, 255, 255, 255);
|
||||
|
||||
$result = array();
|
||||
switch ($status) {
|
||||
case 'TASK_IN_PROGRESS'://red
|
||||
$result['fillcolor'] = $red;
|
||||
$result['color'] = $red_1;
|
||||
break;
|
||||
case 'TASK_COMPLETED'://green
|
||||
$result['fillcolor'] = $green;
|
||||
$result['color'] = $green_1;
|
||||
break;
|
||||
case 'TASK_PENDING_NOT_EXECUTED'://silver
|
||||
$result['fillcolor'] = $silver;
|
||||
$result['color'] = $silver_1;
|
||||
break;
|
||||
case 'TASK_PARALLEL'://orange
|
||||
$result['fillcolor'] = $orange;
|
||||
$result['color'] = $orange_1;
|
||||
break;
|
||||
default:
|
||||
$result['fillcolor'] = $white;
|
||||
$result['color'] = $white_1;
|
||||
break;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getNewPoints($idElement, $elementName)
|
||||
{
|
||||
$defenitions = array(
|
||||
'bpmnParticipant' => 'participants',
|
||||
'bpmnPool' => 'laneset',
|
||||
'bpmnLane' => 'lanes',
|
||||
'bpmnActivity' => 'activities',
|
||||
'bpmnEvent' => 'events',
|
||||
'bpmnGateway' => 'gateways',
|
||||
'bpmnArtifact' => 'artifacts',
|
||||
'bpmnData' => 'datas'
|
||||
);
|
||||
|
||||
$result = array(0,0);
|
||||
$resRec = array(0,0);
|
||||
if(isset($defenitions[$elementName])){
|
||||
$name = $defenitions[$elementName];
|
||||
foreach($this->diagram as $schem){
|
||||
$elements = $schem[$name];
|
||||
foreach ($elements as $element) {
|
||||
if($element['bou_container'] != "bpmnDiagram"){
|
||||
$resRec = $this->getNewPoints($element['bou_element'],$element['bou_container']);
|
||||
}
|
||||
if($element['lns_uid'] == $idElement || $element['lan_uid'] == $idElement){
|
||||
$result = array($element['bou_x'] + $resRec[0],$element['bou_y'] + $resRec[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function print_text($IMG, $txt, $size, $angle, $color, $font, $x1, $y1, $x2, $y2, $type = '', $stype = '')
|
||||
{
|
||||
//TODO Create a section to write multi-line text
|
||||
$yy = 0;
|
||||
switch ($type) {
|
||||
case 'bpmnActivity':
|
||||
case 'bpmnArtifact':
|
||||
if ($stype == 'SCRIPTTASK') {
|
||||
$line = $this->wrap_text($size, $angle, $font, $txt, $x2 + 50 - $x1);
|
||||
} else {
|
||||
$line = $this->wrap_text($size, $angle, $font, $txt, $x2 - $x1);
|
||||
}
|
||||
break;
|
||||
case 'bpmnEvent':
|
||||
$line = $this->wrap_text($size, $angle, $font, $txt, $x2 + 40 - $x1);
|
||||
break;
|
||||
case 'bpmnGateway':
|
||||
$line = $this->wrap_text($size, $angle, $font, $txt, $x2 + 40 - $x1);
|
||||
break;
|
||||
case 'bpmnPool':
|
||||
case 'bpmnParticipant':
|
||||
case 'bpmnLane':
|
||||
$line = $this->wrap_text($size, $angle, $font, $txt, $y2 + 40 - $y1);
|
||||
break;
|
||||
default:
|
||||
$line = $this->wrap_text($size, $angle, $font, $txt, $x2 - $x1);
|
||||
}
|
||||
$h = count($line) * 16;
|
||||
foreach ($line as $value) {
|
||||
$w = strlen(trim($value))*6;
|
||||
$X = ($x1 + ((($x2 - $x1) - $w) / 2)) - 5;
|
||||
if ($type == 'bpmnActivity' && $stype == 'TASK') {
|
||||
$Y = $y1 + (($y2 - $y1)/2) - floor($h/2) + $yy + 10;
|
||||
} else if ($type == 'bpmnArtifact' && $stype == 'TEXT_ANNOTATION') {
|
||||
$Y = $y1 + (($y2 - $y1)/2) - floor($h/2) + $yy + 10;
|
||||
} else if ($type == 'bpmnActivity' && $stype == 'SCRIPTTASK') {
|
||||
$Y = $y2 + $yy + 100;
|
||||
} else if ($type == 'bpmnPool' || $type == 'bpmnParticipant' || $type == 'bpmnLane') {
|
||||
$X = $x1 + $yy + 25;
|
||||
$Y = ($y2 - ((($y2 - $y1) - $w) / 2));
|
||||
} else if ($type == 'bpmnFlow') {
|
||||
$Y = $y1 + $yy + 15;
|
||||
} else {
|
||||
$Y = $y1 + $yy + 25;
|
||||
}
|
||||
imagettftext($IMG, $size, $angle, $X, $Y, $color, $font, $value);
|
||||
$yy += 16;
|
||||
}
|
||||
}
|
||||
|
||||
private function wrap_text($fontSize, $angle, $fontFace, $string, $width)
|
||||
{
|
||||
$pattern = '[\n|\r|\n\r]';
|
||||
$string = preg_replace($pattern, ' ', trim($string));
|
||||
$arr = explode(' ', $string);
|
||||
$sa = '';
|
||||
$sf = array();
|
||||
foreach ($arr as $word) {
|
||||
$sa_ = $sa;
|
||||
$sa .= ' ' . $word;
|
||||
$w = strlen(trim($sa))*6;
|
||||
if ($w >= $width) {
|
||||
$sf[] = $sa_;
|
||||
$sa = $word;
|
||||
}
|
||||
}
|
||||
$sf[] = $sa;
|
||||
return $sf;
|
||||
}
|
||||
}
|
||||
@@ -1348,13 +1348,15 @@ class Bpmn extends Handler
|
||||
$oCriteria->add( \BpmnFlowPeer::FLO_POSITION, $iPosition, '>' );
|
||||
$oDataset = \BpmnFlowPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->add( \BpmnFlowPeer::FLO_POSITION, $aRow['FLO_POSITION'] - 1);
|
||||
BasePeer::doUpdate($oCriteria, $oCriteria2, $con);
|
||||
$oDataset->next();
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$aRow = $oDataset->getRow();
|
||||
$newPosition = ((int)$aRow['FLO_POSITION'])-1;
|
||||
$oCriteriaTemp = new Criteria( 'workflow' );
|
||||
$oCriteriaTemp->add( \BpmnFlowPeer::FLO_UID, $aRow['FLO_UID'] );
|
||||
$oCriteria2 = new Criteria('workflow');
|
||||
$oCriteria2->add(\BpmnFlowPeer::FLO_POSITION, $newPosition);
|
||||
BasePeer::doUpdate($oCriteriaTemp, $oCriteria2, $con);
|
||||
}
|
||||
} catch (Exception $oException) {
|
||||
throw $oException;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace ProcessMaker\Services\Api;
|
||||
|
||||
use \G;
|
||||
|
||||
use \ProcessMaker\Project\Adapter;
|
||||
use \ProcessMaker\Services\Api;
|
||||
use \Luracast\Restler\RestException;
|
||||
|
||||
@@ -487,11 +487,10 @@ class Light extends Api
|
||||
|
||||
$activitySteps = $task->getSteps($act_uid);
|
||||
|
||||
//$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
||||
|
||||
$dynaForm = new \ProcessMaker\BusinessModel\DynaForm();
|
||||
$dynaForm->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$oMobile = new \ProcessMaker\BusinessModel\Light();
|
||||
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
||||
$response = array();
|
||||
for ($i = 0; $i < count($activitySteps); $i++) {
|
||||
if ($activitySteps[$i]['step_type_obj'] == "DYNAFORM") {
|
||||
@@ -499,7 +498,9 @@ class Light extends Api
|
||||
$result = $this->parserDataDynaForm($dataForm);
|
||||
$result['formContent'] = (isset($result['formContent']) && $result['formContent'] != null)?json_decode($result['formContent']):"";
|
||||
$result['index'] = $i;
|
||||
//$activitySteps[$i]["triggers"] = $step->doGetActivityStepTriggers($activitySteps[$i]["step_uid"], $act_uid, $prj_uid);
|
||||
$result['stepId'] = $activitySteps[$i]["step_uid"];
|
||||
$trigger = $oMobile->statusTriggers($step->doGetActivityStepTriggers($activitySteps[$i]["step_uid"], $act_uid, $prj_uid));
|
||||
$result["triggers"] = $trigger;
|
||||
$response[] = $result;
|
||||
}
|
||||
}
|
||||
@@ -509,6 +510,41 @@ class Light extends Api
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute Trigger case
|
||||
*
|
||||
* @param string $prj_uid {@min 1}{@max 32}
|
||||
* @param string $act_uid {@min 1}{@max 32}
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
* @param string $step_uid {@min 32}{@max 32}
|
||||
* @param string $type {@choice before,after}
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /process/:prj_uid/task/:act_uid/case/:cas_uid/step/:step_uid/execute-trigger/:type
|
||||
*/
|
||||
public function doPutExecuteTriggerCase($prj_uid, $act_uid, $cas_uid, $step_uid, $type)
|
||||
{
|
||||
try {
|
||||
$userUid = $this->getUserId();
|
||||
$step = new \ProcessMaker\Services\Api\Project\Activity\Step();
|
||||
$triggers= $step->doGetActivityStepTriggers($step_uid, $act_uid, $prj_uid);
|
||||
|
||||
$step = new \ProcessMaker\BusinessModel\Step();
|
||||
$step->setFormatFieldNameInUppercase(false);
|
||||
$step->setArrayParamException(array("stepUid" => "step_uid", "taskUid" => "act_uid", "processUid" => "prj_uid"));
|
||||
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
foreach($triggers as $trigger){
|
||||
if (strtolower($trigger['st_type']) == $type) {
|
||||
$cases->putExecuteTriggerCase($cas_uid, $trigger['tri_uid'], $userUid);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /project/dynaform/:dyn_uid
|
||||
*
|
||||
@@ -810,4 +846,275 @@ class Light extends Api
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Case Notes
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param string $start {@from path}
|
||||
* @param string $limit {@from path}
|
||||
* @param string $sort {@from path}
|
||||
* @param string $dir {@from path}
|
||||
* @param string $usr_uid {@from path}
|
||||
* @param string $date_from {@from path}
|
||||
* @param string $date_to {@from path}
|
||||
* @param string $search {@from path}
|
||||
* @return array
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url GET /case/:app_uid/notes
|
||||
*/
|
||||
public function doGetCaseNotes(
|
||||
$app_uid,
|
||||
$start = 0,
|
||||
$limit = 25,
|
||||
$sort = 'APP_CACHE_VIEW.APP_NUMBER',
|
||||
$dir = 'DESC',
|
||||
$usr_uid = '',
|
||||
$date_from = '',
|
||||
$date_to = '',
|
||||
$search = ''
|
||||
) {
|
||||
try {
|
||||
$dataList['start'] = $start;
|
||||
$dataList['limit'] = $limit;
|
||||
$dataList['sort'] = $sort;
|
||||
$dataList['dir'] = $dir;
|
||||
$dataList['user'] = $usr_uid;
|
||||
$dataList['dateFrom'] = $date_from;
|
||||
$dataList['dateTo'] = $date_to;
|
||||
$dataList['search'] = $search;
|
||||
|
||||
$usr_uid = $this->getUserId();
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$response = $cases->getCaseNotes($app_uid, $usr_uid, $dataList);
|
||||
$result = $this->parserDataNotes($response['data']);
|
||||
return $result;
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
public function parserDataNotes ($data)
|
||||
{
|
||||
$structure = array(
|
||||
'app_uid' => 'caseId',
|
||||
'usr_uid' => 'userId',
|
||||
'notes' => array(
|
||||
'note_date' => 'date',
|
||||
'note_content' => 'content'
|
||||
)
|
||||
);
|
||||
|
||||
$response = $this->replaceFields($data, $structure);
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Post Case Notes
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param string $noteContent {@min 1}{@max 500}
|
||||
* @param int $sendMail {@choice 1,0}
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /case/:app_uid/note
|
||||
*/
|
||||
public function doPostCaseNote($app_uid, $noteContent, $sendMail = 0)
|
||||
{
|
||||
try {
|
||||
$usr_uid = $this->getUserId();
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$sendMail = ($sendMail == 0) ? false : true;
|
||||
$cases->saveCaseNote($app_uid, $usr_uid, $noteContent, $sendMail);
|
||||
$result = array("status" => 'ok');
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET list category
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @url GET /category
|
||||
*/
|
||||
public function getCategoryList()
|
||||
{
|
||||
try {
|
||||
$oLight = new \ProcessMaker\BusinessModel\Light();
|
||||
$category = $oLight->getCategoryList();
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
return $category;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET list process
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @param string $action {@min 1}{@max 32}
|
||||
* @param string $cat_uid {@max 32}{@from path}
|
||||
*
|
||||
* @url GET /process/:action
|
||||
*/
|
||||
public function getProcessList ($action, $cat_uid = null)
|
||||
{
|
||||
try {
|
||||
$usr_uid = $this->getUserId();
|
||||
$oLight = new \ProcessMaker\BusinessModel\Light();
|
||||
$process = $oLight->getProcessList($action, $cat_uid, $usr_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
return $process;
|
||||
}
|
||||
|
||||
/**
|
||||
* GET list process
|
||||
*
|
||||
* @return array
|
||||
* @throws RestException
|
||||
*
|
||||
* @param string $task_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @url GET /userstoreassign/:task_uid
|
||||
*/
|
||||
public function getUsersToReassign ($task_uid)
|
||||
{
|
||||
try {
|
||||
$usr_uid = $this->getUserId();
|
||||
$oLight = new \ProcessMaker\BusinessModel\Light();
|
||||
$process = $oLight->getUsersToReassign($usr_uid, $task_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
return $process;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \stdclass
|
||||
* @throws RestException
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
* @param string $to_usr_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @url POST /reassign/:app_uid/user/:to_usr_uid
|
||||
*/
|
||||
public function reassignCase ($app_uid, $to_usr_uid)
|
||||
{
|
||||
try {
|
||||
$usr_uid = $this->getUserId();
|
||||
$oLight = new \ProcessMaker\BusinessModel\Light();
|
||||
$process = $oLight->reassignCase($usr_uid, $app_uid, $to_usr_uid);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
return $process;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paused Case
|
||||
*
|
||||
* @return \stdclass
|
||||
* @throws RestException
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @url POST /cases/:app_uid/pause
|
||||
*/
|
||||
public function pauseCase ($app_uid, $request_data)
|
||||
{
|
||||
try {
|
||||
$usr_uid = $this->getUserId();
|
||||
$oLight = new \ProcessMaker\BusinessModel\Light();
|
||||
$process = $oLight->pauseCase($usr_uid, $app_uid, $request_data);
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
return $process;
|
||||
}
|
||||
|
||||
/**
|
||||
* Unpaused Case
|
||||
*
|
||||
* @return \stdclass
|
||||
* @throws RestException
|
||||
*
|
||||
* @param string $app_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @url POST /cases/:app_uid/unpause
|
||||
*/
|
||||
public function unpauseCase ($app_uid)
|
||||
{
|
||||
$result = array();
|
||||
try {
|
||||
$usr_uid = $this->getUserId();
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$cases->putUnpauseCase($app_uid, $usr_uid);
|
||||
$result["status"] = "ok";
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel Case
|
||||
*
|
||||
* @param string $cas_uid {@min 1}{@max 32}
|
||||
*
|
||||
* @copyright Colosa - Bolivia
|
||||
*
|
||||
* @url POST /cases/:app_uid/cancel
|
||||
*/
|
||||
public function doPutCancelCase($app_uid)
|
||||
{
|
||||
$response = array("status" => "false");
|
||||
try {
|
||||
$userUid = $this->getUserId();
|
||||
$cases = new \ProcessMaker\BusinessModel\Cases();
|
||||
$cases->putCancelCase($app_uid, $userUid);
|
||||
$response["status"] = "ok";
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @url GET /project/:prj_uid/case/:app_uid
|
||||
*
|
||||
* @param string $prj_uid {@min 32}{@max 32}
|
||||
*/
|
||||
public function doGetProcessMapImage($prj_uid, $app_uid)
|
||||
{
|
||||
$return = array();
|
||||
try {
|
||||
$oPMap = new \ProcessMaker\BusinessModel\ProcessMap();
|
||||
$schema = Adapter\BpmnWorkflow::getStruct($prj_uid);
|
||||
|
||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
||||
$case->setFormatFieldNameInUppercase(false);
|
||||
$schemaStatus = $case->getTasks($app_uid);
|
||||
|
||||
$file = $oPMap->get_image($schema, $schemaStatus);
|
||||
ob_start();
|
||||
imagepng($file);
|
||||
$image = ob_get_clean();
|
||||
$return["map"] = base64_encode($image);
|
||||
|
||||
} catch (\Exception $e) {
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,10 +47,6 @@ class DynaForm extends Api
|
||||
$dynaForm->setArrayFieldNameForException(array("processUid" => "prj_uid"));
|
||||
|
||||
$arrayData = $dynaForm->executeCreate($prj_uid, $request_data);
|
||||
if (!array_key_exists('dyn_content', $request_data)) {
|
||||
$request_data['dyn_content']="{}";
|
||||
}
|
||||
$arrayData = $dynaForm->update($arrayData['dyn_uid'], $request_data);
|
||||
|
||||
$response = $arrayData;
|
||||
|
||||
|
||||
@@ -68,8 +68,7 @@
|
||||
</tr>
|
||||
{else}
|
||||
<tr>
|
||||
<td class="FormLabel" width="100"></td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.TAS_TITLE}{$data.NEXT_TASK.TAS_HIDDEN_FIELD}</td>
|
||||
<td class="FormFieldContent" colspan="2" style="text-align: center">{$data.NEXT_TASK.TAS_TITLE}{$data.NEXT_TASK.TAS_HIDDEN_FIELD}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
@@ -93,8 +92,7 @@
|
||||
</tr>
|
||||
{else}
|
||||
<tr>
|
||||
<td class="FormLabel" width="100"></td>
|
||||
<td class="FormFieldContent">{$data.NEXT_TASK.USR_HIDDEN_FIELD}</td>
|
||||
<td class="FormFieldContent" colspan="2" style="text-align: center">{$data.NEXT_TASK.USR_HIDDEN_FIELD}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
@@ -88,9 +88,9 @@
|
||||
<li class="mafe-save-process"><a href="#" class="mafe-button-save"></a></li>
|
||||
<li><a href="#" class="mafe-button-export-process"></a></li>
|
||||
<li><a class="mafe-button-export-bpmn-process"></a></li>
|
||||
<li></li>
|
||||
<li><span class="mafe-zoom-options"></span></li>
|
||||
<li class="mafe-undo"><a href="#"><span class="mafe-button-undo"></span></a></li>
|
||||
<li class="mafe-redo"><a href="#"><span class="mafe-button-redo"></span></a></li>
|
||||
<li class="mafe-redo"><a href="#"><span class="mafe-button-redo"></span></a></li>
|
||||
<li><a href="#" title="" class="mafe-button-fullscreen"></a></li>
|
||||
<li></li>
|
||||
</ul>
|
||||
|
||||
@@ -76,6 +76,8 @@ Ext.onReady(function() {
|
||||
|
||||
statusButton = new Ext.Action({
|
||||
text: _('ID_STATUS'),
|
||||
icon : '',
|
||||
id : 'activator',
|
||||
iconCls: 'silk-add',
|
||||
handler: statusDashboard,
|
||||
disabled: true
|
||||
@@ -105,19 +107,19 @@ Ext.onReady(function() {
|
||||
}
|
||||
}
|
||||
|
||||
var activator = Ext.getCmp('activator');
|
||||
|
||||
if( record.data.DAS_STATUS == 1 ){
|
||||
statusButton.setIconClass('icon-activate');
|
||||
statusButton.setText( _('ID_DEACTIVATE') );
|
||||
activator.setIcon('/images/deactivate.png');
|
||||
activator.setText( _('ID_DEACTIVATE') );
|
||||
editButton.enable();
|
||||
deleteButton.enable();
|
||||
//statusButton.enable();
|
||||
} else {
|
||||
statusButton.setIconClass('icon-deactivate');
|
||||
statusButton.setText( _('ID_ACTIVATE') );
|
||||
activator.setIcon('/images/activate.png');
|
||||
activator.setText( _('ID_ACTIVATE') );
|
||||
editButton.disable();
|
||||
deleteButton.disable();
|
||||
//statusButton.disable();
|
||||
}
|
||||
}
|
||||
},
|
||||
rowdeselect: function(sm, index, record){
|
||||
editButton.disable();
|
||||
@@ -237,7 +239,7 @@ Ext.onReady(function() {
|
||||
viewConfig: {
|
||||
forceFit:true
|
||||
},
|
||||
title : _('ID_DASHBOARD'),
|
||||
title : _('ID_STRATEGIC_DASHBOARD'),
|
||||
store: store,
|
||||
cm: cmodel,
|
||||
sm: smodel,
|
||||
|
||||
@@ -41,7 +41,6 @@ var frmDashboard;
|
||||
var addTabButton;
|
||||
var tabPanel;
|
||||
var dashboardIndicatorFields;
|
||||
var dashboardIndicatorPanel;
|
||||
var store;
|
||||
|
||||
var indexTab = 0;
|
||||
@@ -49,12 +48,11 @@ var comboPageSize = 10;
|
||||
var resultTpl;
|
||||
var storeIndicatorType;
|
||||
var storeGraphic;
|
||||
var storeFrecuency;
|
||||
var storeFrequency;
|
||||
var storeProject;
|
||||
var storeGroup;
|
||||
var storeUsers;
|
||||
var dataUserGroup;
|
||||
var dasIndUid;
|
||||
var flag = true;
|
||||
var myMask;
|
||||
var dataIndicator = '';
|
||||
@@ -63,13 +61,13 @@ var tabActivate = [];
|
||||
Ext.onReady( function() {
|
||||
|
||||
myMask = new Ext.LoadMask(Ext.getBody(), {msg:_('ID_LOADING')});
|
||||
|
||||
|
||||
|
||||
Ext.QuickTips.init();
|
||||
|
||||
resultTpl = new Ext.XTemplate(
|
||||
'<tpl for="."><div class="x-combo-list-item" style="white-space:normal !important;word-wrap: break-word;">',
|
||||
'<span> {APP_PRO_TITLE}</span>',
|
||||
'<span> {APP_PRO_TITLE}</span>',
|
||||
'</div></tpl>'
|
||||
);
|
||||
|
||||
@@ -79,7 +77,7 @@ Ext.onReady( function() {
|
||||
items : [
|
||||
{
|
||||
id : 'DAS_TITLE',
|
||||
fieldLabel : _('ID_DASHBOARD_TITLE')+ ' *',
|
||||
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_DASHBOARD_TITLE')) +'"> * </span>' + _('ID_DASHBOARD_TITLE'),
|
||||
xtype : 'textfield',
|
||||
anchor : '85%',
|
||||
maxLength : 250,
|
||||
@@ -92,10 +90,9 @@ Ext.onReady( function() {
|
||||
xtype : 'textarea',
|
||||
id : 'DAS_DESCRIPTION',
|
||||
fieldLabel : _('ID_DESCRIPTION'),
|
||||
labelSeparator : '',
|
||||
anchor : '85%',
|
||||
maskRe : /([a-zA-Z0-9_'\s]+)$/,
|
||||
height : 50,
|
||||
height : 50
|
||||
}
|
||||
]
|
||||
});
|
||||
@@ -240,7 +237,7 @@ Ext.onReady( function() {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
storeIndicatorType = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
api: {
|
||||
@@ -297,7 +294,7 @@ Ext.onReady( function() {
|
||||
}
|
||||
});
|
||||
|
||||
storeFrecuency = new Ext.data.GroupingStore( {
|
||||
storeFrequency = new Ext.data.GroupingStore( {
|
||||
proxy : new Ext.data.HttpProxy({
|
||||
api: {
|
||||
read : urlProxy + 'catalog/periodicity'
|
||||
@@ -450,7 +447,7 @@ Ext.onReady( function() {
|
||||
return '<div class="search-item">' +
|
||||
'<h3><span>{owner_uid}</span>{owner_label}</h3>' +
|
||||
'{excerpt}' +
|
||||
'</div>';
|
||||
'</div>';
|
||||
}
|
||||
},
|
||||
//pageSize : 10,
|
||||
@@ -487,7 +484,7 @@ Ext.onReady( function() {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: _('ID_PRO_USER'),
|
||||
title: _('ID_PRO_USER')
|
||||
},
|
||||
ownerInfoGrid
|
||||
]
|
||||
@@ -496,7 +493,7 @@ Ext.onReady( function() {
|
||||
addTabButton = new Ext.Button ({
|
||||
text: _('ID_NEW_TAB_INDICATOR'),
|
||||
iconCls: 'button_menu_ext ss_sprite ss_add',
|
||||
handler: addTab,
|
||||
handler: addTab
|
||||
});
|
||||
|
||||
tabPanel = new Ext.TabPanel({
|
||||
@@ -543,11 +540,11 @@ Ext.onReady( function() {
|
||||
},
|
||||
scope: that
|
||||
});
|
||||
return false;
|
||||
return false;
|
||||
} else {
|
||||
flag = true;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
tabchange : function ( that, tab ) {
|
||||
var id = tabPanel.getActiveTab().id;
|
||||
@@ -629,12 +626,9 @@ Ext.onReady( function() {
|
||||
items : [
|
||||
addTabButton,
|
||||
tabPanel
|
||||
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
|
||||
//form
|
||||
frmDashboard = new Ext.FormPanel({
|
||||
id : 'frmDashboard',
|
||||
@@ -647,11 +641,11 @@ Ext.onReady( function() {
|
||||
waitMsgTarget : true,
|
||||
frame : true,
|
||||
defaults : {
|
||||
anchor : '100%',
|
||||
allowBlank : false,
|
||||
resizable : true,
|
||||
msgTarget : 'side',
|
||||
align : 'center'
|
||||
anchor : '100%',
|
||||
allowBlank : false,
|
||||
resizable : true,
|
||||
msgTarget : 'side',
|
||||
align : 'center'
|
||||
},
|
||||
items : [
|
||||
dashboardFields,
|
||||
@@ -676,7 +670,7 @@ Ext.onReady( function() {
|
||||
|
||||
ownerInfoGrid.on("afterrender", function(component) {
|
||||
component.getBottomToolbar().refresh.hideParent = true;
|
||||
component.getBottomToolbar().refresh.hide();
|
||||
component.getBottomToolbar().refresh.hide();
|
||||
});
|
||||
|
||||
viewport = new Ext.Viewport({
|
||||
@@ -733,245 +727,245 @@ var addTab = function (flag) {
|
||||
return false;
|
||||
}
|
||||
var tab = {
|
||||
title : _('ID_INDICATOR')+ ' '+ (++indexTab),
|
||||
id : indexTab,
|
||||
iconCls : 'tabs',
|
||||
width : "100%",
|
||||
items : [
|
||||
new Ext.Panel({
|
||||
height : 230,
|
||||
width : "100%",
|
||||
border : true,
|
||||
bodyStyle : 'padding:10px',
|
||||
items : [
|
||||
new Ext.form.FieldSet({
|
||||
labelWidth : 150,
|
||||
labelAlign :'right',
|
||||
items : [
|
||||
{
|
||||
id : 'DAS_IND_UID_' + indexTab,
|
||||
xtype : 'textfield',
|
||||
hidden : true
|
||||
},
|
||||
{
|
||||
fieldLabel : _('ID_INDICATOR_TITLE')+ ' *',
|
||||
id : 'IND_TITLE_'+ indexTab,
|
||||
xtype : 'textfield',
|
||||
anchor : '85%',
|
||||
maskRe : /([a-zA-Z0-9_'\s]+)$/,
|
||||
regex : /([a-zA-Z0-9_'\s]+)$/,
|
||||
regexText : _('ID_INVALID_VALUE', _('ID_INDICATOR_TITLE')),
|
||||
maxLength : 250,
|
||||
allowBlank : false
|
||||
},
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
id : 'IND_TYPE_'+ indexTab,
|
||||
fieldLabel : _('ID_INDICATOR_TYPE')+ ' *',
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeIndicatorType,
|
||||
listeners:{
|
||||
scope: this,
|
||||
select: function(combo, record, index) {
|
||||
var value = combo.getValue();
|
||||
var field = '';
|
||||
var index = tabPanel.getActiveTab().id;
|
||||
var fields = ['DAS_IND_FIRST_FIGURE_'+index,'DAS_IND_FIRST_FREQUENCY_'+index,'DAS_IND_SECOND_FIGURE_'+index, 'DAS_IND_SECOND_FREQUENCY_'+index];
|
||||
if (value == '1050') {
|
||||
field = Ext.getCmp('IND_PROCESS_'+index);
|
||||
field.setValue('0');
|
||||
title : _('ID_INDICATOR')+ ' '+ (++indexTab),
|
||||
id : indexTab,
|
||||
iconCls : 'tabs',
|
||||
width : "100%",
|
||||
items : [
|
||||
new Ext.Panel({
|
||||
height : 230,
|
||||
width : "100%",
|
||||
border : true,
|
||||
bodyStyle : 'padding:10px',
|
||||
items : [
|
||||
new Ext.form.FieldSet({
|
||||
labelWidth : 150,
|
||||
labelAlign :'right',
|
||||
items : [
|
||||
{
|
||||
id : 'DAS_IND_UID_' + indexTab,
|
||||
xtype : 'textfield',
|
||||
hidden : true
|
||||
},
|
||||
{
|
||||
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_INDICATOR_TITLE')) +'"> * </span>' + _('ID_INDICATOR_TITLE'),
|
||||
id : 'IND_TITLE_'+ indexTab,
|
||||
xtype : 'textfield',
|
||||
anchor : '85%',
|
||||
maskRe : /([a-zA-Z0-9_'\s]+)$/,
|
||||
regex : /([a-zA-Z0-9_'\s]+)$/,
|
||||
regexText : _('ID_INVALID_VALUE', _('ID_INDICATOR_TITLE')),
|
||||
maxLength : 250,
|
||||
allowBlank : false
|
||||
},
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
id : 'IND_TYPE_'+ indexTab,
|
||||
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_INDICATOR_TYPE')) +'"> * </span>' + _('ID_INDICATOR_TYPE'),
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeIndicatorType,
|
||||
listeners:{
|
||||
scope: this,
|
||||
select: function(combo, record, index) {
|
||||
var value = combo.getValue();
|
||||
var field = '';
|
||||
var index = tabPanel.getActiveTab().id;
|
||||
var fields = ['DAS_IND_FIRST_FIGURE_'+index,'DAS_IND_FIRST_FREQUENCY_'+index,'DAS_IND_SECOND_FIGURE_'+index, 'DAS_IND_SECOND_FREQUENCY_'+index];
|
||||
if (value == '1050') {
|
||||
field = Ext.getCmp('IND_PROCESS_'+index);
|
||||
field.setValue('0');
|
||||
field.disable();
|
||||
field.hide();
|
||||
} else {
|
||||
field = Ext.getCmp('IND_PROCESS_'+index);
|
||||
field.enable();
|
||||
field.show();
|
||||
}
|
||||
if (value == '1010' || value == '1030' || value == '1050') {
|
||||
for (var i=0; i<fields.length; i++) {
|
||||
field = Ext.getCmp(fields[i]);
|
||||
field.disable();
|
||||
field.hide();
|
||||
} else {
|
||||
field = Ext.getCmp('IND_PROCESS_'+index);
|
||||
}
|
||||
} else {
|
||||
for (var i=0; i<fields.length; i++) {
|
||||
field = Ext.getCmp(fields[i]);
|
||||
field.enable();
|
||||
field.show();
|
||||
}
|
||||
if (value == '1010' || value == '1030' || value == '1050') {
|
||||
for (var i=0; i<fields.length; i++) {
|
||||
field = Ext.getCmp(fields[i]);
|
||||
field.disable();
|
||||
field.hide();
|
||||
}
|
||||
} else {
|
||||
for (var i=0; i<fields.length; i++) {
|
||||
field = Ext.getCmp(fields[i]);
|
||||
field.enable();
|
||||
field.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
new Ext.form.FieldSet({
|
||||
title : _('ID_INDICATOR_GOAL'),
|
||||
width : "90%",
|
||||
id : 'fieldSet_'+ indexTab,
|
||||
bodyStyle: 'paddingLeft: 75px;',
|
||||
paddingLeft: "30px",
|
||||
marginLeft : "60px",
|
||||
layout : 'hbox',
|
||||
hidden : true,
|
||||
items : [
|
||||
new Ext.form.ComboBox({
|
||||
editable : false,
|
||||
id : 'DAS_IND_DIRECTION_'+ indexTab,
|
||||
displayField : 'label',
|
||||
valueField : 'id',
|
||||
value : '2',
|
||||
forceSelection : false,
|
||||
selectOnFocus : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
width : 90,
|
||||
triggerAction : 'all',
|
||||
mode : 'local',
|
||||
allowBlank : false,
|
||||
store : new Ext.data.ArrayStore({
|
||||
id: 2,
|
||||
fields: [
|
||||
'id',
|
||||
'label'
|
||||
],
|
||||
data: [['1', _('ID_LESS_THAN')], ['2', _('ID_MORE_THAN')]]
|
||||
})
|
||||
}),
|
||||
{
|
||||
fieldLabel : _('ID_INDICATOR_GOAL'),
|
||||
id : 'IND_GOAL_'+ indexTab,
|
||||
xtype : 'textfield',
|
||||
anchor : '40%',
|
||||
maskRe : /([0-9\.]+)$/,
|
||||
maxLength : 9,
|
||||
value : 1,
|
||||
width : 80,
|
||||
allowBlank : false,
|
||||
listeners : {
|
||||
focus : function(tb, e) {
|
||||
Ext.QuickTips.register({
|
||||
target: tb,
|
||||
title: _('ID_HELP'),
|
||||
text: _('ID_GOAL_HELP')
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
listeners:
|
||||
}
|
||||
}
|
||||
}),
|
||||
new Ext.form.FieldSet({
|
||||
title : _('ID_INDICATOR_GOAL'),
|
||||
width : "90%",
|
||||
id : 'fieldSet_'+ indexTab,
|
||||
bodyStyle: 'paddingLeft: 75px;',
|
||||
paddingLeft: "30px",
|
||||
marginLeft : "60px",
|
||||
layout : 'hbox',
|
||||
hidden : true,
|
||||
items : [
|
||||
new Ext.form.ComboBox({
|
||||
editable : false,
|
||||
id : 'DAS_IND_DIRECTION_'+ indexTab,
|
||||
displayField : 'label',
|
||||
valueField : 'id',
|
||||
value : '2',
|
||||
forceSelection : false,
|
||||
selectOnFocus : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
width : 90,
|
||||
triggerAction : 'all',
|
||||
mode : 'local',
|
||||
allowBlank : false,
|
||||
store : new Ext.data.ArrayStore({
|
||||
id: 2,
|
||||
fields: [
|
||||
'id',
|
||||
'label'
|
||||
],
|
||||
data: [['1', _('ID_LESS_THAN')], ['2', _('ID_MORE_THAN')]]
|
||||
})
|
||||
}),
|
||||
{
|
||||
render: function()
|
||||
{
|
||||
var index = tabPanel.getActiveTab().id;
|
||||
var myfieldset = document.getElementById('fieldSet_'+index);
|
||||
myfieldset.style.marginLeft = "70px";
|
||||
myfieldset.style.marginRight = "70px";
|
||||
fieldLabel : _('ID_INDICATOR_GOAL'),
|
||||
id : 'IND_GOAL_'+ indexTab,
|
||||
xtype : 'textfield',
|
||||
anchor : '40%',
|
||||
maskRe : /([0-9\.]+)$/,
|
||||
maxLength : 9,
|
||||
value : 1,
|
||||
width : 80,
|
||||
allowBlank : false,
|
||||
listeners : {
|
||||
focus : function(tb, e) {
|
||||
Ext.QuickTips.register({
|
||||
target: tb,
|
||||
title: _('ID_HELP'),
|
||||
text: _('ID_GOAL_HELP')
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
listeners:
|
||||
{
|
||||
render: function()
|
||||
{
|
||||
var index = tabPanel.getActiveTab().id;
|
||||
var myfieldset = document.getElementById('fieldSet_'+index);
|
||||
myfieldset.style.marginLeft = "70px";
|
||||
myfieldset.style.marginRight = "70px";
|
||||
}
|
||||
}
|
||||
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_PROCESS')+ ' *',
|
||||
id : 'IND_PROCESS_'+ indexTab,
|
||||
displayField : 'prj_name',
|
||||
valueField : 'prj_uid',
|
||||
forceSelection : true,
|
||||
emptyText : _('ID_EMPTY_PROCESSES'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeProject
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_FIRST_FIGURE'),
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
id : 'DAS_IND_FIRST_FIGURE_'+ indexTab,
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeGraphic
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_PERIODICITY'),
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
id : 'DAS_IND_FIRST_FREQUENCY_'+ indexTab,
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeFrecuency
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_SECOND_FIGURE'),
|
||||
id : 'DAS_IND_SECOND_FIGURE_'+ indexTab,
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeGraphic
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_PERIODICITY'),
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
id : 'DAS_IND_SECOND_FREQUENCY_'+ indexTab,
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeFrecuency
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
],
|
||||
listeners : {
|
||||
scope: this,
|
||||
activate : function (that) {
|
||||
if (tabActivate.indexOf(that.id) == -1 ) {
|
||||
tabActivate.push(that.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
closable:true
|
||||
};
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : '<span style=\"color:red;\" ext:qtip="'+ _('ID_FIELD_REQUIRED', _('ID_PROCESS')) +'"> * </span>' + _('ID_PROCESS'),
|
||||
id : 'IND_PROCESS_'+ indexTab,
|
||||
displayField : 'prj_name',
|
||||
valueField : 'prj_uid',
|
||||
forceSelection : true,
|
||||
emptyText : _('ID_EMPTY_PROCESSES'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeProject
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_FIRST_FIGURE'),
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
id : 'DAS_IND_FIRST_FIGURE_'+ indexTab,
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeGraphic
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_PERIODICITY'),
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
id : 'DAS_IND_FIRST_FREQUENCY_'+ indexTab,
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeFrequency
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_SECOND_FIGURE'),
|
||||
id : 'DAS_IND_SECOND_FIGURE_'+ indexTab,
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeGraphic
|
||||
}),
|
||||
new Ext.form.ComboBox({
|
||||
anchor : '85%',
|
||||
editable : false,
|
||||
fieldLabel : _('ID_PERIODICITY'),
|
||||
displayField : 'CAT_LABEL_ID',
|
||||
id : 'DAS_IND_SECOND_FREQUENCY_'+ indexTab,
|
||||
valueField : 'CAT_UID',
|
||||
forceSelection : false,
|
||||
emptyText : _('ID_SELECT'),
|
||||
selectOnFocus : true,
|
||||
hidden : true,
|
||||
typeAhead : true,
|
||||
autocomplete : true,
|
||||
triggerAction : 'all',
|
||||
store : storeFrequency
|
||||
})
|
||||
]
|
||||
})
|
||||
]
|
||||
})
|
||||
],
|
||||
listeners : {
|
||||
scope: this,
|
||||
activate : function (that) {
|
||||
if (tabActivate.indexOf(that.id) == -1 ) {
|
||||
tabActivate.push(that.id);
|
||||
}
|
||||
}
|
||||
},
|
||||
closable:true
|
||||
};
|
||||
if (flag != 'load') {
|
||||
tabPanel.add(tab).show();
|
||||
} else {
|
||||
@@ -1033,7 +1027,7 @@ var validateNameDashboard = function () {
|
||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_DIRECTORY_NAME_EXISTS_ENTER_ANOTHER', title));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
saveDashboard();
|
||||
},
|
||||
failure: function (response) {
|
||||
@@ -1271,7 +1265,7 @@ var loadIndicators = function (DAS_UID) {
|
||||
addTab('load');
|
||||
}
|
||||
dataIndicator = jsonResp;
|
||||
|
||||
|
||||
for (var i=0; i<=jsonResp.length-1; i++) {
|
||||
addTab('load');
|
||||
tabPanel.getItem(i+1).setTitle(jsonResp[i]['DAS_IND_TITLE']);
|
||||
|
||||
@@ -29,18 +29,21 @@
|
||||
var urlProxy = '{$urlProxy}';
|
||||
var pageUserId = '{$usrId}';
|
||||
var token = '{$credentials.access_token}';
|
||||
var moneyUnit = '{$unitCost}';
|
||||
var G_STRING = [];
|
||||
{foreach from=$translation key=index item=option}
|
||||
G_STRING['{$index}'] = "{$option}";
|
||||
{/foreach}
|
||||
</script>
|
||||
|
||||
<!-- View Dashboard Files-->
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/viewDashboardHelper.js"></script>
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/viewDashboardModel.js"></script>
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/viewDashboardPresenter.js"></script>
|
||||
<script type="text/javascript" src="/jscore/strategicDashboard/viewDashboardView.js"></script>
|
||||
|
||||
|
||||
|
||||
<script type="text/template" class="specialIndicatorButtonTemplate">
|
||||
<div class="col-lg-3 col-md-6 dashPro ind-button-selector"
|
||||
id="indicatorButton-<%- indicator.id %>"
|
||||
@@ -56,7 +59,7 @@
|
||||
</div>
|
||||
<div class="col-xs-9 text-right"><i class="ind-symbol-selector fa fa-chevron-up fa-3x"></i>
|
||||
<div class="small ind-comparative-selector">
|
||||
<%- indicator.comparative %> (<%- indicator.percentComparative %> %)
|
||||
<%- indicator.comparative %> <%- indicator.percentComparative %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,33 +81,33 @@
|
||||
<div class="ind-container-selector panel grid-stack-item-content" style="min-width:200px;">
|
||||
<a data-toggle="collapse" href="#efficiencyindex" aria-expanded="false" aria-controls="efficiencyindex">
|
||||
<div class="panel-heading status-indicator-low"
|
||||
style=" width:<%- indicator.percentageOverdue %>%;
|
||||
visibility: <%- indicator.overdueVisibility %>" >
|
||||
style=" width:<%- indicator.percentageOverdueWidth %>%;
|
||||
visibility: <%- indicator.overdueVisibility %>;overflow:hidden;" >
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="small ind-comparative-selector"><%- indicator.percentageOverdue %>%</div>
|
||||
<div class="small ind-comparative-selector"><%- indicator.percentageOverdueToShow %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading status-indicator-medium"
|
||||
style=" width:<%- indicator.percentageAtRisk %>%;
|
||||
visibility: <%- indicator.atRiskVisibility %>;" >
|
||||
style=" width:<%- indicator.percentageAtRiskWidth %>%;
|
||||
visibility: <%- indicator.atRiskVisibility %>;overflow:hidden;" >
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="small ind-comparative-selector"><%- indicator.percentageAtRisk %>%</div>
|
||||
<div class="small ind-comparative-selector"><%- indicator.percentageAtRiskToShow %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-heading status-indicator-high"
|
||||
style=" width:<%- indicator.percentageOnTime %>%;
|
||||
visibility: <%- indicator.onTimeVisibility %>;">
|
||||
style=" width:<%- indicator.percentageOnTimeWidth %>%;
|
||||
visibility: <%- indicator.onTimeVisibility %>; overflow:hidden;">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="small ind-comparative-selector"><%- indicator.percentageOnTime %>%</div>
|
||||
<div class="small ind-comparative-selector"><%- indicator.percentageOnTimeToShow %></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-footer text-center ind-title-selector" style="clear:both;">
|
||||
<div class="panel-footer text-center ind-title-selector" style="clear:both; color:#606368;">
|
||||
<%- indicator.title %>
|
||||
</div>
|
||||
</a>
|
||||
@@ -157,14 +160,15 @@
|
||||
|
||||
<div class="text-center huge">
|
||||
<div class="col-xs-3 vcenter">
|
||||
<div class="green"><%- indicator.efficiencyIndexToShow %></div>
|
||||
<div class="blue"><%- indicator.efficiencyIndexToShow %></div>
|
||||
<div class="small grey sind-index-selector ellipsis"></div>
|
||||
</div>
|
||||
<div class="col-xs-3 vcenter" style="margin-right:40px">
|
||||
<div class="red sind-cost-number-selector"><%- indicator.inefficiencyCostToShow %></div>
|
||||
<div class="red sind-cost-number-selector">{$unitCost} <%- indicator.inefficiencyCostToShow %></div>
|
||||
<div class="small grey sind-cost-selector ellipsis"></div>
|
||||
</div>
|
||||
<div class="col-xs-6" id="specialIndicatorGraph" style="width:540px;height:300px;"></div>
|
||||
<div class="col-xs-6" id="specialIndicatorGraph" style="width:540px;height:300px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
@@ -190,7 +194,7 @@
|
||||
<div class="small grey detail-efficiency-selector ellipsis"></div>
|
||||
</div>
|
||||
<div class="col-xs-3 text-center ">
|
||||
<div class="red detail-cost-number-selector"><%- detailData.inefficiencyCostToShow %></div>
|
||||
<div class="red detail-cost-number-selector">{$unitCost}<%- detailData.inefficiencyCostToShow %></div>
|
||||
<div class="small grey detail-cost-selector ellipsis"></div>
|
||||
</div>
|
||||
<div class="col-xs-1 text-right arrow"><i class="fa fa-chevron-right fa-fw"></i></div>
|
||||
@@ -200,28 +204,56 @@
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" class="specialIndicatorSencondViewDetail">
|
||||
<div class="process-div well hideme detail-button-selector" data-gs-no-resize="true"
|
||||
<script type="text/template" class="specialIndicatorSecondViewDetailUei">
|
||||
<div class="process-div well hideme detail-button-selector-uei" data-gs-no-resize="true"
|
||||
id="detailData-<%- detailData.uid %>"
|
||||
data-indicator-id="<%- detailData.indicatorId %>"
|
||||
data-detail-id="<%- detailData.uid %>">
|
||||
<div class="panel-heading greenbg">
|
||||
<div class="col-xs-12 text-center detail-title-selector"><i class="fa fa-tasks fa-fw"></i> <span id="usrName"><%- detailData.name %></span> </div>
|
||||
<div class="col-xs-12 text-center detail-title-selector">
|
||||
<i class="fa fa-tasks fa-fw"></i>
|
||||
<span id="usrName"><%- detailData.name %> </span>
|
||||
<span>(<%- detailData.rankToShow %>)</span>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="text-center huge">
|
||||
<div class="col-xs-12 vcenter-task">
|
||||
<div class="col-xs-4 ">
|
||||
<div class="col-xs-6 ">
|
||||
<div class="blue small"><%- detailData.efficiencyIndexToShow%></div>
|
||||
<div class="smallB grey detail-efficiency-selector ellipsis"></div>
|
||||
</div>
|
||||
<div class="col-xs-4 ">
|
||||
<div class="small detail-cost-number-selector"><%- detailData.inefficiencyCostToShow%></div>
|
||||
<div class="col-xs-6 ">
|
||||
<div class="small detail-cost-number-selector">{$unitCost}<%- detailData.inefficiencyCostToShow%></div>
|
||||
<div class="smallB grey detail-cost-selector ellipsis"></div>
|
||||
</div>
|
||||
<div class="col-xs-4 ">
|
||||
<div class="blue small"><%- detailData.deviationTimeToShow%></div>
|
||||
<div class="smallB grey detail-sdv-selector ellipsis">SDV</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" class="specialIndicatorSecondViewDetailPei">
|
||||
<div class="process-div well hideme detail-button-selector-pei" data-gs-no-resize="true"
|
||||
id="detailData-<%- detailData.uid %>"
|
||||
data-indicator-id="<%- detailData.indicatorId %>"
|
||||
data-detail-id="<%- detailData.uid %>">
|
||||
<div class="panel-heading greenbg">
|
||||
<div class="col-xs-12 text-center detail-title-selector">
|
||||
<i class="fa fa-tasks fa-fw"></i>
|
||||
<span id="usrName"><%- detailData.name %> </span>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
<div class="text-center huge">
|
||||
<div class="col-xs-12 vcenter-task">
|
||||
<div class="col-xs-6 ">
|
||||
<div class="blue small"><%- detailData.efficiencyIndexToShow%></div>
|
||||
<div class="smallB grey detail-efficiency-selector ellipsis"></div>
|
||||
</div>
|
||||
<div class="col-xs-6 ">
|
||||
<div class="small detail-cost-number-selector">{$unitCost}<%- detailData.inefficiencyCostToShow%></div>
|
||||
<div class="smallB grey detail-cost-selector ellipsis"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
@@ -292,18 +324,20 @@
|
||||
<li class="ind-title-selector"></li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="text-center huge" style="margin:0 auto; width:98%;">
|
||||
<div class="col-xs-4" style="width:auto;">
|
||||
<div class="status-graph-title-low">{translate label="ID_OVERDUE"}:</div>
|
||||
<div id="graph1" style="width:400px; height:300px;"></div>
|
||||
</div>
|
||||
<div class="col-xs-4" style="width:auto;">
|
||||
<div class="status-graph-title-medium">{translate label="ID_AT_RISK"}:</div>
|
||||
<div id="graph2" style="width:400px; height:300px;"></div>
|
||||
</div>
|
||||
<div class="col-xs-4" style="width:auto;">
|
||||
<div class="status-graph-title-high">{translate label="ID_ON_TIME"}:</div>
|
||||
<div id="graph3" style="width:400px; height:300px;"></div>
|
||||
<div class="text-center huge" style="margin:0 auto; width:100%; text-align:center;">
|
||||
<div class="row" style="width:auto; margin:0 auto; display:inline-block;">
|
||||
<div class="col-xs-4" style="width:auto;">
|
||||
<div class="status-graph-title-low">{translate label="ID_OVERDUE"}:</div>
|
||||
<div id="graph1" style="width:380px; height:300px;"></div>
|
||||
</div>
|
||||
<div class="col-xs-4" style="width:auto;">
|
||||
<div class="status-graph-title-medium">{translate label="ID_AT_RISK"}:</div>
|
||||
<div id="graph2" style="width:380px; height:300px;"></div>
|
||||
</div>
|
||||
<div class="col-xs-4" style="width:auto;">
|
||||
<div class="status-graph-title-high">{translate label="ID_ON_TIME"}:</div>
|
||||
<div id="graph3" style="width:380px; height:300px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
@@ -311,9 +345,10 @@
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
<body id="page-top" class="index">
|
||||
<img id="scrollImg" class="floating" src="/images/scrolldown.gif" width="80" height="80" style="border-radius:85px;"/>
|
||||
<img id="scrollImg" class="floating" src="/images/scrolldown.gif" width="80" height="80" style="border-radius:85px; visibility:hidden;"/>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
<!--Cabezera-->
|
||||
@@ -400,12 +435,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="relatedLabel" style="clear:both;">
|
||||
<div id="relatedLabel" style="clear:both; visibility:hidden;">
|
||||
<div>
|
||||
<center><h3></h3></center>
|
||||
</div>
|
||||
<div>
|
||||
Sort by Cost: <a id="sortListButton" class="fa fa-chevron-up fa-1x" style="color:#000;" href="#"></a>
|
||||
<div id="sortby">
|
||||
{translate label="ID_SORT_BY"} {translate label="ID_COSTS"} : <a id="sortListButton" class="fa fa-chevron-up fa-1x" style="color:#000;" href="#"></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -418,7 +453,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -343,7 +343,7 @@
|
||||
<div class="title-process" style="margin-top:50px; width:500px; clear:both; border:1px solid #999; margin:0 auto; padding:15px;">
|
||||
This is just a basic view of your indexes. For better compatibility with Internet Explorer, a new tab with the KPIs has been opened. Please select this new tab on the tab list above to see all our KPIs functionality.
|
||||
</div>
|
||||
<!--Cabezera-->
|
||||
<!--[>Cabezera<]
|
||||
<div class="row" style="visibility:hidden;">
|
||||
<div class="col-lg-12">
|
||||
<div class="panel panel-default">
|
||||
@@ -401,7 +401,7 @@
|
||||
<div class="well">
|
||||
<p class="text-center">{translate label="ID_DASH_CLICK_TO_VIEW"}</p>
|
||||
<p>
|
||||
<!-- Split button -->
|
||||
[> Split button <]
|
||||
<div id="dashboardsList">
|
||||
</div>
|
||||
</p>
|
||||
@@ -411,19 +411,19 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /.col-lg-12 -->
|
||||
[> /.col-lg-12 <]
|
||||
</div>
|
||||
<!-- Indicators -->
|
||||
[> Indicators <]
|
||||
<div class="row">
|
||||
<div class="indicators">
|
||||
<div id="indicatorsGridStack" class="grid-stack" data-gs-width="12" data-gs-animate="no" >
|
||||
<!--Here are added dynamically the Indicators-->
|
||||
[>Here are added dynamically the Indicators<]
|
||||
</div>
|
||||
</div>
|
||||
<!-- Details by Indicator -->
|
||||
[> Details by Indicator <]
|
||||
<div class="col-lg-12 col-md-12 bottom">
|
||||
<div id="indicatorsDataGridStack" class="grid-stack" data-gs-width="12" data-gs-animate="no" >
|
||||
<!--Here are added dynamically the Dat by indicator-->
|
||||
[>Here are added dynamically the Dat by indicator<]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -441,7 +441,7 @@
|
||||
data-gs-animate="no" style="clear:both;">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -61,8 +61,9 @@
|
||||
|
||||
//$_test_dir = realpath(dirname(__FILE__).'/..');
|
||||
//require_once( 'lime/lime.php');
|
||||
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
if(file_exists(PATH_GULLIVER . "class.bootstrap.php")) {
|
||||
require_once (PATH_GULLIVER . "class.bootstrap.php");
|
||||
}
|
||||
spl_autoload_register(array('Bootstrap', 'autoloadClass'));
|
||||
Bootstrap::registerClass('G', PATH_GULLIVER . "class.g.php");
|
||||
Bootstrap::registerClass('System', PATH_HOME . "engine/classes/class.system.php");
|
||||
|
||||
@@ -69,6 +69,13 @@
|
||||
//$e_all = $config['debug'] ? $e_all : $e_all & ~E_NOTICE;
|
||||
//$e_all = E_ALL & ~ E_DEPRECATED & ~ E_STRICT & ~ E_NOTICE & ~E_WARNING;
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$config['display_errors'] = $filter->validateInput($config['display_errors']);
|
||||
$config['error_reporting'] = $filter->validateInput($config['error_reporting']);
|
||||
$config['memory_limit'] = $filter->validateInput($config['memory_limit']);
|
||||
$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int');
|
||||
$config['time_zone'] = $filter->validateInput($config['time_zone']);
|
||||
// Do not change any of these settings directly, use env.ini instead
|
||||
ini_set( 'display_errors', $config['display_errors']);
|
||||
ini_set( 'error_reporting', $config['error_reporting']);
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
.status-indicator-low,
|
||||
.status-indicator-medium,
|
||||
.status-indicator-high {
|
||||
padding:0px;
|
||||
padding-top:30px;
|
||||
padding:30px 0px 0px 0;
|
||||
color:#444;
|
||||
float:left;
|
||||
}
|
||||
|
||||
@@ -616,9 +616,11 @@ table.dataTable thead .sorting:after {
|
||||
margin-top:10px;
|
||||
}
|
||||
|
||||
.panel-red .panel-heading, .panel-low .panel-heading{
|
||||
/*panel red for color must be white
|
||||
* .panel-red .panel-heading, .panel-low .panel-heading{
|
||||
color:rgba(0,0,0,0.4) !important;
|
||||
}
|
||||
*/
|
||||
|
||||
.panel-high .progress-bar{
|
||||
background: #fcb322;
|
||||
|
||||
@@ -303,6 +303,20 @@ session_start();
|
||||
//$e_all = $config['debug'] ? $e_all : $e_all & ~ E_NOTICE;
|
||||
//$e_all = E_ALL & ~ E_DEPRECATED & ~ E_STRICT & ~ E_NOTICE & ~E_WARNING;
|
||||
|
||||
//Call Gulliver Classes
|
||||
Bootstrap::LoadThirdParty("smarty/libs", "Smarty.class");
|
||||
|
||||
//Loading the autoloader libraries feature
|
||||
Bootstrap::registerSystemClasses();
|
||||
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$config['display_errors'] = $filter->validateInput($config['display_errors']);
|
||||
$config['error_reporting'] = $filter->validateInput($config['error_reporting']);
|
||||
$config['memory_limit'] = $filter->validateInput($config['memory_limit']);
|
||||
$config['wsdl_cache'] = $filter->validateInput($config['wsdl_cache'],'int');
|
||||
$config['time_zone'] = $filter->validateInput($config['time_zone']);
|
||||
|
||||
// Do not change any of these settings directly, use env.ini instead
|
||||
ini_set( 'display_errors', $config['display_errors']);
|
||||
ini_set( 'error_reporting', $config['error_reporting']);
|
||||
@@ -334,15 +348,7 @@ define( 'PATH_C', (rtrim( Bootstrap::sys_get_temp_dir(), PATH_SEP ) . PATH_SEP)
|
||||
define( 'PATH_LANGUAGECONT', PATH_HOME . 'engine/content/languages/' );
|
||||
}
|
||||
|
||||
//Call Gulliver Classes
|
||||
Bootstrap::LoadThirdParty("smarty/libs", "Smarty.class");
|
||||
|
||||
//Loading the autoloader libraries feature
|
||||
Bootstrap::registerSystemClasses();
|
||||
|
||||
//Load filter class
|
||||
G::LoadSystem('inputfilter');
|
||||
$filter = new InputFilter();
|
||||
$skinPathErrors = G::skinGetPathToSrcByVirtualUri("errors", $config);
|
||||
$skinPathUpdate = G::skinGetPathToSrcByVirtualUri("update", $config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user