Merged colosa/processmaker into master

This commit is contained in:
Quenta Ronald
2015-04-29 17:20:59 -04:00
45 changed files with 861 additions and 515 deletions

View File

@@ -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);

View File

@@ -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());
}
}
/*----------------------------------********---------------------------------*/

View File

@@ -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

View File

@@ -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);

View File

@@ -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');

View File

@@ -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 . '/');

View File

@@ -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;

View File

@@ -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'] . ');');
}
}
}

View File

@@ -404,7 +404,7 @@ class AppDelegation extends BaseAppDelegation
}
//Risk date
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), round($riskTime), $data['TAS_TIMEUNIT'], $arrayCalendarData);
$riskDate = $calendar->dashCalculateDate($this->getDelDelegateDate(), $riskTime, $data['TAS_TIMEUNIT'], $arrayCalendarData);
return $riskDate;
} catch (Exception $e) {

View File

@@ -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);

View File

@@ -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();

View File

@@ -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 );

View File

@@ -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 );

View File

@@ -78,7 +78,6 @@ ViewDashboardModel.prototype.getPositionIndicator = function(callBack) {
"y" : originalObject.y,
"width" : originalObject.width,
"height" : originalObject.height
};
graphData.push(map);
});

View File

@@ -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.atRiskVisibility = (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++;
});

View File

@@ -353,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;
});
@@ -380,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);
@@ -406,8 +402,15 @@ var hideTitleAndSortDiv = function(){
switch (window.currentIndicator.type) {
case "1010":
case "1030":
$('#relatedLabel').css('visibility', 'visible');
$('#relatedLabel').show();
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();
@@ -419,7 +422,17 @@ 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);
@@ -523,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");
@@ -548,7 +557,8 @@ var fillStatusIndicatorFirstView = function (presenterData) {
containerId:'graph1',
width:300,
height:300,
stretch:true
stretch:true,
noDataText: G_STRING.ID_DISPLAY_EMPTY
},
graph: {
@@ -608,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,
@@ -627,7 +638,8 @@ 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,
@@ -725,11 +737,13 @@ var fillSpecialIndicatorSecondView = function(presenterData) {
if (window.currentIndicator.type == "1010") {
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();
}

View File

@@ -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");
}

View File

@@ -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>
";
}

View File

@@ -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 ) );
}
}

View File

@@ -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 . ";");

View File

@@ -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;

View File

@@ -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>

View File

@@ -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,21 +77,22 @@ 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,
maskRe : /([a-zA-Z0-9\s]+)$/,
maskRe : /([a-zA-Z0-9_'\s]+)$/,
regex : /([a-zA-Z0-9_'\s]+)$/,
regexText : _('ID_INVALID_VALUE', _('ID_DASHBOARD_TITLE')),
allowBlank : false
},
{
xtype : 'textarea',
id : 'DAS_DESCRIPTION',
fieldLabel : _('ID_DESCRIPTION'),
labelSeparator : '',
anchor : '85%',
maskRe : /([a-zA-Z0-9\s]+)$/,
height : 50,
maskRe : /([a-zA-Z0-9_'\s]+)$/,
height : 50
}
]
});
@@ -238,7 +237,7 @@ Ext.onReady( function() {
}
});
storeIndicatorType = new Ext.data.GroupingStore( {
proxy : new Ext.data.HttpProxy({
api: {
@@ -295,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'
@@ -448,7 +447,7 @@ Ext.onReady( function() {
return '<div class="search-item">' +
'<h3><span>{owner_uid}</span>{owner_label}</h3>' +
'{excerpt}' +
'</div>';
'</div>';
}
},
//pageSize : 10,
@@ -485,7 +484,7 @@ Ext.onReady( function() {
}
},
{
title: _('ID_PRO_USER'),
title: _('ID_PRO_USER')
},
ownerInfoGrid
]
@@ -494,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({
@@ -528,23 +527,24 @@ Ext.onReady( function() {
flag = true;
break;
case 'yes':
tabPanel.getItem(component.id).show();
flag = false;
var dasIndUid = Ext.getCmp('DAS_IND_UID_'+component.id).getValue();
if (typeof dasIndUid != 'undefined' && dasIndUid != '') {
removeIndicator(dasIndUid);
}
tabActivate.remove(component.id);
tabPanel.remove(component);
tabPanel.remove(component, true);
break;
}
},
scope: that
});
return false;
return false;
} else {
flag = true;
}
},
tabchange : function ( that, tab ) {
var id = tabPanel.getActiveTab().id;
@@ -626,12 +626,9 @@ Ext.onReady( function() {
items : [
addTabButton,
tabPanel
]
});
//form
frmDashboard = new Ext.FormPanel({
id : 'frmDashboard',
@@ -644,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,
@@ -671,10 +668,9 @@ Ext.onReady( function() {
]
});
ownerInfoGrid.store.load();
ownerInfoGrid.on("afterrender", function(component) {
component.getBottomToolbar().refresh.hideParent = true;
component.getBottomToolbar().refresh.hide();
component.getBottomToolbar().refresh.hide();
});
viewport = new Ext.Viewport({
@@ -698,6 +694,7 @@ Ext.onReady( function() {
}
dashboardOwnerFields.items.items[0].bindStore(dataUserGroup);
} );
storeUsers.on( 'load', function( store, records, options ) {
for (var i=0; i< store.data.length; i++) {
row = [];
@@ -730,243 +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]+)$/,
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);
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 : false,
emptyText : _('ID_EMPTY_PROCESSES'),
selectOnFocus : true,
hidden : true,
typeAhead : true,
autocomplete : true,
triggerAction : 'all',
value : '0',
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 {
@@ -1028,7 +1027,7 @@ var validateNameDashboard = function () {
PMExt.warning(_('ID_DASHBOARD'), _('ID_DIRECTORY_NAME_EXISTS_ENTER_ANOTHER', title));
return;
}
}
}
saveDashboard();
},
failure: function (response) {
@@ -1086,7 +1085,6 @@ var saveDashboard = function () {
},
data: JSON.stringify(data),
success: function (response) {
var jsonResp = Ext.util.JSON.decode(response.responseText);
saveAllDashboardOwner(DAS_UID);
saveAllIndicators(DAS_UID);
myMask.hide();
@@ -1109,11 +1107,25 @@ var saveAllIndicators = function (DAS_UID) {
tabPanel.getItem(tabActivate[tab]).show();
var fieldsTab = tabPanel.getItem(tabActivate[tab]).items.items[0].items.items[0].items.items;
if (fieldsTab[1].getValue().trim() == '') {
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TITLE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
fieldsTab[1].focus(true,10);
return false;
} else if (fieldsTab[2].getValue().trim() == '') {
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TYPE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
fieldsTab[2].focus(true,10);
return false;
} else if (fieldsTab[2].getValue() != '1050' && fieldsTab[4].getValue().trim() == '') {
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_PROCESS_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
fieldsTab[4].focus(true,10);
return false;
}
var goal = fieldsTab[3];
fieldsTab.push(goal.items.items[0]);
fieldsTab.push(goal.items.items[1]);
data = [];
var data = [];
data['DAS_UID'] = DAS_UID;
for (var index in fieldsTab) {
@@ -1122,12 +1134,12 @@ var saveAllIndicators = function (DAS_UID) {
continue;
}
id = node.id;
var id = node.id;
if (typeof id == 'undefined' || id.indexOf('fieldSet_') != -1 ) {
continue;
}
id = id.split('_');
field = '';
var field = '';
for (var part = 0; part<id.length-1; part++) {
if (part == 0) {
field = id[part];
@@ -1135,25 +1147,7 @@ var saveAllIndicators = function (DAS_UID) {
field = field+'_'+id[part];
}
}
value = node.getValue();
if (field == 'IND_TITLE' && value.trim() == '') {
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TITLE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
node.focus(true,10);
return false;
} else if (field == 'IND_TYPE' && value.trim() == '') {
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TYPE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
node.focus(true,10);
return false;
} else if (field == 'IND_GOAL' && value.trim() == '') {
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_GOAL_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
node.focus(true,10);
return false;
} else if (field == 'IND_PROCESS' && value.trim() == '') {
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_PROCESS_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
node.focus(true,10);
return false;
}
var value = node.getValue();
field = field == 'IND_TITLE' ? 'DAS_IND_TITLE' : field;
field = field == 'IND_TYPE' ? 'DAS_IND_TYPE' : field;
@@ -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']);

View File

@@ -59,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>
@@ -81,29 +81,29 @@
<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>
@@ -167,7 +167,8 @@
<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>
@@ -204,7 +205,7 @@
</script>
<script type="text/template" class="specialIndicatorSecondViewDetailUei">
<div class="process-div well hideme detail-button-selector" data-gs-no-resize="true"
<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 %>">
@@ -233,7 +234,7 @@
</script>
<script type="text/template" class="specialIndicatorSecondViewDetailPei">
<div class="process-div well hideme detail-button-selector" data-gs-no-resize="true"
<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 %>">
@@ -323,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>
@@ -436,7 +439,7 @@
<div>
<center><h3></h3></center>
</div>
<div>
<div id="sortby">
{translate label="ID_SORT_BY"} {translate label="ID_COSTS"} : &nbsp; <a id="sortListButton" class="fa fa-chevron-up fa-1x" style="color:#000;" href="#"></a>
</div>
</div>
@@ -453,3 +456,5 @@
</body>
</html>

View File

@@ -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");