Merged in dashboards2 (pull request #1854)
Dashboards bugs and improvements
This commit is contained in:
@@ -70,8 +70,6 @@ abstract class IndicatorDataSourcesEnum extends BasicEnum {
|
|||||||
|
|
||||||
class indicatorsCalculator
|
class indicatorsCalculator
|
||||||
{
|
{
|
||||||
private static $connectionName = 'workflow';
|
|
||||||
|
|
||||||
private $userReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "USR_UID");
|
private $userReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "USR_UID");
|
||||||
private $processReportingMetadata = array("tableName" => "PRO_REPORTING", "keyField" => "PRO_UID");
|
private $processReportingMetadata = array("tableName" => "PRO_REPORTING", "keyField" => "PRO_UID");
|
||||||
private $userGroupReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "USR_UID");
|
private $userGroupReportingMetadata = array("tableName" => "USR_REPORTING", "keyField" => "USR_UID");
|
||||||
@@ -83,30 +81,57 @@ class indicatorsCalculator
|
|||||||
private $ueiCostFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - TOTAL_TIME_BY_TASK * USER_HOUR_COST)";
|
private $ueiCostFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME - TOTAL_TIME_BY_TASK * USER_HOUR_COST)";
|
||||||
private $ueiFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME) / SUM(TOTAL_TIME_BY_TASK * USER_HOUR_COST)";
|
private $ueiFormula = "SUM(TOTAL_CASES_OUT * CONFIGURED_TASK_TIME) / SUM(TOTAL_TIME_BY_TASK * USER_HOUR_COST)";
|
||||||
|
|
||||||
//
|
public function getSkewOfDataDistribution($table, $field) {
|
||||||
// public function processEfficiencyIndex($processList, $initDate, $endDate)
|
/*$sqlString = "SET @median = (SELECT x.$field from $table x, $table y
|
||||||
// {
|
GROUP BY x.$field
|
||||||
// $resultList = $this->processEfficiencyIndexList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
HAVING SUM(SIGN(1-SIGN(y.$field-x.$field)))/COUNT(*) > .5
|
||||||
// return ($resultList[0]['PEI']);
|
LIMIT 1)";
|
||||||
// }
|
*/
|
||||||
|
|
||||||
|
$sqlString = "SELECT x.$field from $table x, $table y
|
||||||
|
GROUP BY x.$field
|
||||||
|
HAVING SUM(SIGN(1-SIGN(y.$field-x.$field)))/COUNT(*) > .5
|
||||||
|
LIMIT 1";
|
||||||
|
|
||||||
|
$returnValue = 0;
|
||||||
|
$connection = $this->pdoConnection();
|
||||||
|
$result = $this->pdoExecutorWithConnection($sqlString, array(), $connection);
|
||||||
|
$result2 = $this->pdoExecutorWithConnection("select @median", array(), $connection);
|
||||||
|
if (sizeof($result) > 0) {
|
||||||
|
$returnValue = current(reset($result2));
|
||||||
|
}
|
||||||
|
return $returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
public function peiHistoric($processId, $initDate, $endDate, $periodicity) {
|
public function peiHistoric($processId, $initDate, $endDate, $periodicity) {
|
||||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||||
|
|
||||||
$sqlString = $this->indicatorsBasicQueryBuilder(IndicatorDataSourcesEnum::USER
|
/*$sqlString = $this->indicatorsBasicQueryBuilder(IndicatorDataSourcesEnum::USER
|
||||||
, $processId, $periodicity, $initDate, $endDate
|
, $processId, $periodicity, $initDate, $endDate
|
||||||
, $this->peiFormula);
|
, $this->peiFormula);*/
|
||||||
|
|
||||||
$returnValue = $this->propelExecutor($sqlString);
|
$qryParams = Array();
|
||||||
|
$sqlString = $this->indicatorsParamsQueryBuilder(IndicatorDataSourcesEnum::USER
|
||||||
|
, $processId, $periodicity, $initDate, $endDate
|
||||||
|
, $this->peiFormula, $qryParams);
|
||||||
|
|
||||||
|
//$returnValue = $this->propelExecutor($sqlString);
|
||||||
|
|
||||||
|
$returnValue = $this->pdoExecutor($sqlString, $qryParams);
|
||||||
return $returnValue;
|
return $returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function indicatorData($indicatorId)
|
public function indicatorData($indicatorId)
|
||||||
{
|
{
|
||||||
$sqlString = "select * from DASHBOARD_INDICATOR where DAS_IND_UID= '$indicatorId'";
|
$qryParams = Array();
|
||||||
$retval = $this->propelExecutor($sqlString);
|
$qryParams[':indicatorId'] = $indicatorId;
|
||||||
return $retval;
|
$sqlString = "select * from DASHBOARD_INDICATOR where DAS_IND_UID= :indicatorId";
|
||||||
|
$returnValue = $this->pdoExecutor($sqlString, $qryParams);
|
||||||
|
|
||||||
|
/*$sqlString = "select * from DASHBOARD_INDICATOR where DAS_IND_UID= '$indicatorId'";
|
||||||
|
$retval = $this->propelExecutor($sqlString);*/
|
||||||
|
return $returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function peiProcesses($indicatorId, $initDate, $endDate, $language)
|
public function peiProcesses($indicatorId, $initDate, $endDate, $language)
|
||||||
@@ -120,6 +145,12 @@ class indicatorsCalculator
|
|||||||
$endYear = $endDate->format("Y");
|
$endYear = $endDate->format("Y");
|
||||||
$endMonth = $endDate->format("m");
|
$endMonth = $endDate->format("m");
|
||||||
|
|
||||||
|
//$params[":initYear"] = $initYear;
|
||||||
|
//$params[":initMonth"] = $initMonth;
|
||||||
|
$params[":endYear"] = $endYear;
|
||||||
|
$params[":endMonth"] = $endMonth;
|
||||||
|
$params[":language"] = $language;
|
||||||
|
|
||||||
$sqlString = "
|
$sqlString = "
|
||||||
select
|
select
|
||||||
i.PRO_UID as uid,
|
i.PRO_UID as uid,
|
||||||
@@ -139,17 +170,17 @@ class indicatorsCalculator
|
|||||||
(select DAS_UID_PROCESS from DASHBOARD_INDICATOR where DAS_IND_UID = '$indicatorId')= '0'
|
(select DAS_UID_PROCESS from DASHBOARD_INDICATOR where DAS_IND_UID = '$indicatorId')= '0'
|
||||||
)
|
)
|
||||||
AND
|
AND
|
||||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear)
|
||||||
AND
|
|
||||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)
|
|
||||||
group by PRO_UID
|
group by PRO_UID
|
||||||
) i
|
) i
|
||||||
left join (select *
|
left join (select *
|
||||||
from CONTENT
|
from CONTENT
|
||||||
where CON_CATEGORY = 'PRO_TITLE'
|
where CON_CATEGORY = 'PRO_TITLE'
|
||||||
and CON_LANG = '$language'
|
and CON_LANG = :language
|
||||||
) tp on i.PRO_UID = tp.CON_ID";
|
) tp on i.PRO_UID = tp.CON_ID";
|
||||||
$retval = $this->propelExecutor($sqlString);
|
|
||||||
|
//$retval = $this->propelExecutor($sqlString);
|
||||||
|
$retval = $this->pdoExecutor($sqlString, $params);
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,6 +196,12 @@ class indicatorsCalculator
|
|||||||
$endYear = $endDate->format("Y");
|
$endYear = $endDate->format("Y");
|
||||||
$endMonth = $endDate->format("m");
|
$endMonth = $endDate->format("m");
|
||||||
|
|
||||||
|
//$params[":initYear"] = $initYear;
|
||||||
|
//$params[":initMonth"] = $initMonth;
|
||||||
|
$params[":endYear"] = $endYear;
|
||||||
|
$params[":endMonth"] = $endMonth;
|
||||||
|
$params[":language"] = $language;
|
||||||
|
|
||||||
//TODO ADD to USR_REPORTING the user's Group to speed up the query.
|
//TODO ADD to USR_REPORTING the user's Group to speed up the query.
|
||||||
$sqlString = "
|
$sqlString = "
|
||||||
select
|
select
|
||||||
@@ -185,18 +222,17 @@ class indicatorsCalculator
|
|||||||
left join
|
left join
|
||||||
GROUP_USER gu on gu.USR_UID = ur.USR_UID
|
GROUP_USER gu on gu.USR_UID = ur.USR_UID
|
||||||
WHERE
|
WHERE
|
||||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear)
|
||||||
AND
|
|
||||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)
|
|
||||||
group by gu.GRP_UID
|
group by gu.GRP_UID
|
||||||
) i
|
) i
|
||||||
left join (select *
|
left join (select *
|
||||||
from CONTENT
|
from CONTENT
|
||||||
where CON_CATEGORY = 'GRP_TITLE'
|
where CON_CATEGORY = 'GRP_TITLE'
|
||||||
and CON_LANG = 'en'
|
and CON_LANG = :language
|
||||||
) tp on i.GRP_UID = tp.CON_ID";
|
) tp on i.GRP_UID = tp.CON_ID";
|
||||||
|
|
||||||
$retval = $this->propelExecutor($sqlString);
|
$retval = $this->pdoExecutor($sqlString, $params);
|
||||||
|
//$retval = $this->propelExecutor($sqlString);
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,6 +249,13 @@ class indicatorsCalculator
|
|||||||
$endYear = $endDate->format("Y");
|
$endYear = $endDate->format("Y");
|
||||||
$endMonth = $endDate->format("m");
|
$endMonth = $endDate->format("m");
|
||||||
|
|
||||||
|
//$params[":initYear"] = $initYear;
|
||||||
|
//$params[":initMonth"] = $initMonth;
|
||||||
|
$params[":endYear"] = $endYear;
|
||||||
|
$params[":endMonth"] = $endMonth;
|
||||||
|
$params[":language"] = $language;
|
||||||
|
$params[":groupId"] = $groupId;
|
||||||
|
|
||||||
$sqlString = " select
|
$sqlString = " select
|
||||||
i.USR_UID as uid,
|
i.USR_UID as uid,
|
||||||
i.name,
|
i.name,
|
||||||
@@ -232,78 +275,32 @@ class indicatorsCalculator
|
|||||||
left join
|
left join
|
||||||
GROUP_USER gu on gu.USR_UID = ur.USR_UID
|
GROUP_USER gu on gu.USR_UID = ur.USR_UID
|
||||||
LEFT JOIN USERS u on u.USR_UID = ur.USR_UID
|
LEFT JOIN USERS u on u.USR_UID = ur.USR_UID
|
||||||
where (gu.GRP_UID = '$groupId' or ('$groupId' = '0' && gu.GRP_UID is null ))
|
where (gu.GRP_UID = :groupId or (:groupId = '0' && gu.GRP_UID is null ))
|
||||||
AND
|
AND
|
||||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear)
|
||||||
AND
|
|
||||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)
|
|
||||||
group by ur.USR_UID
|
group by ur.USR_UID
|
||||||
) i";
|
) i";
|
||||||
$returnValue = $this->propelExecutor($sqlString);
|
|
||||||
return $returnValue;
|
$retval = $this->pdoExecutor($sqlString, $params);
|
||||||
|
//$returnValue = $this->propelExecutor($sqlString);
|
||||||
|
return $retval;
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// public function employeeEfficiencyIndex($employeeList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $resultList = $this->employeeEfficiencyIndexList($employeeList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($resultList));
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function ueiHistoric($employeeId, $initDate, $endDate, $periodicity)
|
public function ueiHistoric($employeeId, $initDate, $endDate, $periodicity)
|
||||||
{
|
{
|
||||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||||
|
|
||||||
$sqlString = $this->indicatorsBasicQueryBuilder(IndicatorDataSourcesEnum::USER
|
$qryParams = Array();
|
||||||
|
$sqlString = $this->indicatorsParamsQueryBuilder(IndicatorDataSourcesEnum::USER
|
||||||
, $employeeId, $periodicity, $initDate, $endDate
|
, $employeeId, $periodicity, $initDate, $endDate
|
||||||
, $this->ueiFormula);
|
, $this->ueiFormula, $qryParams);
|
||||||
$returnValue = $this->propelExecutor($sqlString);
|
|
||||||
return $returnValue;
|
$retval = $this->pdoExecutor($sqlString, $qryParams);
|
||||||
|
//$returnValue = $this->propelExecutor($sqlString);
|
||||||
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function employeeEfficiencyCost($employeeList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $resultList = $this->employeeEfficiencyCostList($employeeList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($resultList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function userCostByGroupHistoric($groupId, $initDate, $endDate, $periodicity) {
|
|
||||||
// if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
|
||||||
// if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
|
||||||
//
|
|
||||||
// $periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
|
||||||
// $periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
|
||||||
// $initYear = $initDate->format("Y");
|
|
||||||
// $initMonth = $initDate->format("m");
|
|
||||||
// $initDay = $endDay = 1;
|
|
||||||
// $endYear = $endDate->format("Y");
|
|
||||||
// $endMonth = $endDate->format("m");
|
|
||||||
//
|
|
||||||
// $filterCondition = "";
|
|
||||||
// if ($groupId != null && $groupId > 0) {
|
|
||||||
// $filterCondition = " AND GRP_UID = '$groupId'";
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// $sqlString = "SELECT (SUM(CONFIGURED_TASK_TIME) - SUM(TOTAL_TIME_BY_TASK)) * USER_HOUR_COST as EEC
|
|
||||||
// FROM USR_REPORTING ur
|
|
||||||
// LEFT JOIN GROUP_USER gu on gu.USR_UID =ur.USR_UID
|
|
||||||
// LEFT JOIN GROUP_USER gu on gu.USR_UID =ur.USR_UID
|
|
||||||
// WHERE
|
|
||||||
// IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
|
||||||
// AND
|
|
||||||
// IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
|
||||||
// . $filterCondition
|
|
||||||
// . $periodicityGroup;
|
|
||||||
// $returnValue = $this->propelExecutor($sqlString);
|
|
||||||
// return $returnValue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function processEfficiencyCost($processList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $resultList = $this->processEfficiencyCostList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($resultList));
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function peiCostHistoric($processId, $initDate, $endDate, $periodicity)
|
public function peiCostHistoric($processId, $initDate, $endDate, $periodicity)
|
||||||
{
|
{
|
||||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||||
@@ -317,21 +314,26 @@ class indicatorsCalculator
|
|||||||
$endYear = $endDate->format("Y");
|
$endYear = $endDate->format("Y");
|
||||||
$endMonth = $endDate->format("m");
|
$endMonth = $endDate->format("m");
|
||||||
|
|
||||||
|
//$params[":initYear"] = $initYear;
|
||||||
|
//$params[":initMonth"] = $initMonth;
|
||||||
|
$params[":endYear"] = $endYear;
|
||||||
|
$params[":endMonth"] = $endMonth;
|
||||||
|
$params[":processId"] = $processId;
|
||||||
|
|
||||||
$filterCondition = "";
|
$filterCondition = "";
|
||||||
if ($processId != null && $processId > 0) {
|
if ($processId != null && $processId > 0) {
|
||||||
$filterCondition = " AND PRO_UID = '$processId'";
|
$filterCondition = " AND PRO_UID = :processId";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sqlString = "SELECT $periodicitySelectFields " . $this->peiCostFormula . " as PEC
|
$sqlString = "SELECT $periodicitySelectFields " . $this->peiCostFormula . " as PEC
|
||||||
FROM USR_REPORTING
|
FROM USR_REPORTING
|
||||||
WHERE
|
WHERE
|
||||||
IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear)"
|
||||||
AND
|
. $filterCondition
|
||||||
IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
. $periodicityGroup;
|
||||||
. $filterCondition
|
|
||||||
. $periodicityGroup;
|
|
||||||
|
|
||||||
$retval = $this->propelExecutor($sqlString);
|
$retval = $this->pdoExecutor($sqlString, $params);
|
||||||
|
//$retval = $this->propelExecutor($sqlString);
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,14 +352,6 @@ class indicatorsCalculator
|
|||||||
if ($indicatorProcessId == "0" || strlen($indicatorProcessId) ==0) {
|
if ($indicatorProcessId == "0" || strlen($indicatorProcessId) ==0) {
|
||||||
$indicatorProcessId = null;
|
$indicatorProcessId = null;
|
||||||
}
|
}
|
||||||
//$indicatorJson = unserialize($indicator['DAS_IND_PROPERTIES']);
|
|
||||||
//$indicatorConfig = json_decode($indicatorJson);
|
|
||||||
|
|
||||||
/*$graph1 = $indicatorConfig->{'IND_FIRST_FIGURE'};
|
|
||||||
$freq1 = $indicatorConfig->{'IND_FIRST_FREQUENCY'};
|
|
||||||
$graph2 = $indicatorConfig->{'IND_SECOND_FIGURE'};
|
|
||||||
$freq2 = $indicatorConfig->{'IND_SECOND_FREQUENCY'};
|
|
||||||
*/
|
|
||||||
|
|
||||||
$graph1 = $indicator['DAS_IND_FIRST_FIGURE'];
|
$graph1 = $indicator['DAS_IND_FIRST_FIGURE'];
|
||||||
$freq1 = $indicator['DAS_IND_FIRST_FREQUENCY'];
|
$freq1 = $indicator['DAS_IND_FIRST_FREQUENCY'];
|
||||||
@@ -396,180 +390,16 @@ class indicatorsCalculator
|
|||||||
throw new Exception(" The indicator id '$indicatorId' with type $indicatorType hasn't an associated operation.");
|
throw new Exception(" The indicator id '$indicatorId' with type $indicatorType hasn't an associated operation.");
|
||||||
}
|
}
|
||||||
|
|
||||||
$sqlString = $this->indicatorsBasicQueryBuilder(IndicatorDataSourcesEnum::PROCESS
|
$params = Array();
|
||||||
|
$sqlString = $this->indicatorsParamsQueryBuilder(IndicatorDataSourcesEnum::PROCESS
|
||||||
, $indicatorProcessId, $periodicity
|
, $indicatorProcessId, $periodicity
|
||||||
, $initDate, $endDate
|
, $initDate, $endDate
|
||||||
, $calcField);
|
, $calcField, $params);
|
||||||
$returnValue = $this->propelExecutor($sqlString);
|
|
||||||
return $returnValue;
|
|
||||||
}
|
|
||||||
// /***** Indicators for overdue, new, completed ******/
|
|
||||||
// public function totalOverdueCasesByProcess($processList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->totalOverdueCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalOverdueCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
|
||||||
// {
|
|
||||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OVERDUE)", "");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalOverdueCasesByUser($userList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->totalOverdueCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalOverdueCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
|
||||||
// {
|
|
||||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OVERDUE)", "");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //percent
|
|
||||||
// public function percentOverdueCasesByProcess($processList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->percentOverdueCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
|
|
||||||
// public function percentOverdueCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
$retval = $this->pdoExecutor($sqlString, $params);
|
||||||
// {
|
//$returnValue = $this->propelExecutor($sqlString);
|
||||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "100 * SUM(TOTAL_CASES_OVERDUE)", "SUM(TOTAL_CASES_ON_TIME + TOTAL_CASES_OVERDUE)");
|
return $retval;
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// public function percentOverdueCasesByUser($userList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->percentOverdueCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function percentOverdueCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
|
||||||
// {
|
|
||||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "100 * SUM(TOTAL_CASES_OVERDUE)", "SUM(TOTAL_CASES_ON_TIME + TOTAL_CASES_OVERDUE)");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// //new cases
|
|
||||||
// public function totalNewCasesByProcess($processList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->totalNewCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalNewCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
|
||||||
// {
|
|
||||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_IN)", "");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalNewCasesByUser($userList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->totalNewCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalNewCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
|
||||||
// {
|
|
||||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_IN)", "");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// //completed cases
|
|
||||||
// public function totalCompletedCasesByProcess($processList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->totalCompletedCasesByProcessList($processList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalCompletedCasesByProcessList($processList, $initDate, $endDate, $periodicity)
|
|
||||||
// {
|
|
||||||
// return $this->sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OUT)", "");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalCompletedCasesByUser($userList, $initDate, $endDate)
|
|
||||||
// {
|
|
||||||
// $returnList = $this->totalCompletedCasesByUserList($userList, $initDate, $endDate, ReportingPeriodicityEnum::NONE);
|
|
||||||
// return current(reset($returnList));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function totalCompletedCasesByUserList($userList, $initDate, $endDate, $periodicity)
|
|
||||||
// {
|
|
||||||
// return $this->sumCasesListByUser($userList, $initDate, $endDate, $periodicity, "SUM(TOTAL_CASES_OUT)", "");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function sumCasesListByProcess($processList, $initDate, $endDate, $periodicity, $fieldToProcess, $fieldToCompare)
|
|
||||||
// {
|
|
||||||
// if ($processList != null && !is_array($processList)) throw new InvalidArgumentException ('employeeList parameter must be an Array or null value.', 0);
|
|
||||||
// if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
|
||||||
// if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
|
||||||
//
|
|
||||||
// $periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
|
||||||
// $periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
|
||||||
// $initYear = $initDate->format("Y");
|
|
||||||
// $initMonth = $initDate->format("m");
|
|
||||||
// $initDay = $endDay = 1;
|
|
||||||
// $endYear = $endDate->format("Y");
|
|
||||||
// $endMonth = $endDate->format("m");
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// $userCondition = "";
|
|
||||||
// if ($processList != null && sizeof($processList) > 0) {
|
|
||||||
// $userCondition = " AND PRO_UID IN " . "('" . implode("','", $processList) . "')";
|
|
||||||
// }
|
|
||||||
// $comparationOperation = "";
|
|
||||||
// if (strlen($fieldToCompare) > 0) {
|
|
||||||
// $comparationOperation = "/$fieldToCompare";
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// $sqlString = "SELECT $periodicitySelectFields $fieldToProcess$comparationOperation as Indicator
|
|
||||||
// FROM PRO_REPORTING
|
|
||||||
// WHERE
|
|
||||||
// IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
|
||||||
// AND
|
|
||||||
// IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
|
||||||
// . $userCondition
|
|
||||||
// . $periodicityGroup;
|
|
||||||
//
|
|
||||||
// $retval = $this->propelExecutor($sqlString);
|
|
||||||
// return $retval;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function sumCasesListByUser($processList, $initDate, $endDate, $periodicity, $fieldToProcess, $fieldToCompare)
|
|
||||||
// {
|
|
||||||
// if ($processList != null && !is_array($processList)) throw new InvalidArgumentException ('employeeList parameter must be an Array or null value.', 0);
|
|
||||||
// if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
|
||||||
// if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
|
||||||
//
|
|
||||||
// $periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
|
||||||
// $periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
|
||||||
// $initYear = $initDate->format("Y");
|
|
||||||
// $initMonth = $initDate->format("m");
|
|
||||||
// $initDay = $endDay = 1;
|
|
||||||
// $endYear = $endDate->format("Y");
|
|
||||||
// $endMonth = $endDate->format("m");
|
|
||||||
//
|
|
||||||
// $userCondition = "";
|
|
||||||
// if ($processList != null && sizeof($processList) > 0) {
|
|
||||||
// $userCondition = " AND USR_UID IN " . "('" . implode("','", $processList) . "')";
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// $comparationOperation = "";
|
|
||||||
// if (strlen($fieldToCompare) > 0) {
|
|
||||||
// $comparationOperation = "/" . $fieldToCompare;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// $sqlString = "SELECT $periodicitySelectFields $fieldToProcess$comparationOperation as Indicator
|
|
||||||
// FROM USR_REPORTING
|
|
||||||
// WHERE
|
|
||||||
// IF (`YEAR` = $initYear, `MONTH`, `YEAR`) >= IF (`YEAR` = $initYear, $initMonth, $initYear)
|
|
||||||
// AND
|
|
||||||
// IF(`YEAR` = $endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = $endYear, $endMonth, $endYear)"
|
|
||||||
// . $userCondition
|
|
||||||
// . $periodicityGroup;
|
|
||||||
//
|
|
||||||
// $retval = $this->propelExecutor($sqlString);
|
|
||||||
// return $retval;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public function peiTasks($processList, $initDate, $endDate, $language)
|
public function peiTasks($processList, $initDate, $endDate, $language)
|
||||||
{
|
{
|
||||||
@@ -577,7 +407,8 @@ class indicatorsCalculator
|
|||||||
if ($processList != null && sizeof($processList) > 0) {
|
if ($processList != null && sizeof($processList) > 0) {
|
||||||
$processCondition = " WHERE PRO_UID IN " . "('" . implode("','", $processList) . "')";
|
$processCondition = " WHERE PRO_UID IN " . "('" . implode("','", $processList) . "')";
|
||||||
}
|
}
|
||||||
//TODO add dates condition in query
|
$params[':language'] = $language;
|
||||||
|
|
||||||
$sqlString = " select
|
$sqlString = " select
|
||||||
i.TAS_UID as uid,
|
i.TAS_UID as uid,
|
||||||
t.CON_VALUE as name,
|
t.CON_VALUE as name,
|
||||||
@@ -599,53 +430,13 @@ class indicatorsCalculator
|
|||||||
left join (select *
|
left join (select *
|
||||||
from CONTENT
|
from CONTENT
|
||||||
where CON_CATEGORY = 'TAS_TITLE'
|
where CON_CATEGORY = 'TAS_TITLE'
|
||||||
and CON_LANG = '$language'
|
and CON_LANG = :language
|
||||||
) t on i.TAS_UID = t.CON_ID";
|
) t on i.TAS_UID = t.CON_ID";
|
||||||
$retval = $this->propelExecutor($sqlString);
|
$retval = $this->pdoExecutor($sqlString, $params);
|
||||||
|
//$retval = $this->propelExecutor($sqlString);
|
||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function employeeTasksInfoList($userList, $initDate, $endDate, $language)
|
|
||||||
// {
|
|
||||||
// $userCondition = "";
|
|
||||||
// if ($userList != null && sizeof($userList) > 0) {
|
|
||||||
// $userCondition = " WHERE USR_UID IN " . "('" . implode("','", $userList) . "')";
|
|
||||||
// }
|
|
||||||
// //TODO add dates contidion to query
|
|
||||||
// $sqlString = " select
|
|
||||||
// i.PRO_UID as ProcessId,
|
|
||||||
// tp.CON_VALUE as ProcessTitle,
|
|
||||||
// i.TAS_UID as TaskId,
|
|
||||||
// tt.CON_VALUE as TaskTitle,
|
|
||||||
// i.EfficienceIndex,
|
|
||||||
// i.TimeAverage,
|
|
||||||
// i.TimeSdv,
|
|
||||||
// i.CONFIGURED_TASK_TIME as ConfiguredTime
|
|
||||||
// FROM
|
|
||||||
// ( select
|
|
||||||
// PRO_UID,
|
|
||||||
// TAS_UID,
|
|
||||||
// (AVG(CONFIGURED_TASK_TIME) + AVG(SDV_TIME))/ AVG(AVG_TIME) as EfficienceIndex,
|
|
||||||
// AVG(AVG_TIME) as TimeAverage,
|
|
||||||
// AVG(SDV_TIME) as TimeSdv,
|
|
||||||
// CONFIGURED_TASK_TIME
|
|
||||||
// from USR_REPORTING
|
|
||||||
// $userCondition
|
|
||||||
// group by PRO_UID, TAS_UID
|
|
||||||
// ) i
|
|
||||||
// left join (select *
|
|
||||||
// from CONTENT
|
|
||||||
// where CON_CATEGORY = 'TAS_TITLE'
|
|
||||||
// and CON_LANG = '$language'
|
|
||||||
// ) tt on i.TAS_UID = tt.CON_ID
|
|
||||||
// left join (select *
|
|
||||||
// from CONTENT
|
|
||||||
// where CON_CATEGORY = 'PRO_TITLE'
|
|
||||||
// and CON_LANG = '$language'
|
|
||||||
// ) tp on i.PRO_UID = tp.CON_ID";
|
|
||||||
// $retval = $this->propelExecutor($sqlString);
|
|
||||||
// return $retval;
|
|
||||||
// }
|
|
||||||
|
|
||||||
private function periodicityFieldsForSelect($periodicity) {
|
private function periodicityFieldsForSelect($periodicity) {
|
||||||
$periodicityFields = $this->periodicityFieldsString($periodicity);
|
$periodicityFields = $this->periodicityFieldsString($periodicity);
|
||||||
@@ -685,7 +476,7 @@ class indicatorsCalculator
|
|||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function propelExecutor($sqlString) {
|
/*private function propelExecutor($sqlString) {
|
||||||
$con = Propel::getConnection(self::$connectionName);
|
$con = Propel::getConnection(self::$connectionName);
|
||||||
$qry = $con->PrepareStatement($sqlString);
|
$qry = $con->PrepareStatement($sqlString);
|
||||||
try {
|
try {
|
||||||
@@ -700,8 +491,55 @@ class indicatorsCalculator
|
|||||||
}
|
}
|
||||||
return $rows;
|
return $rows;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
private function pdoExecutor($sqlString, $params) {
|
||||||
|
/*G::loadClass('wsTools');
|
||||||
|
$currentWS = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
|
||||||
|
$workSpace = new workspaceTools($currentWS);
|
||||||
|
$host = $workSpace->dbHost;
|
||||||
|
$db = $workSpace->dbName;
|
||||||
|
$user = $workSpace->dbUser;
|
||||||
|
$pass = $workSpace->dbPass;
|
||||||
|
|
||||||
private function indicatorsBasicQueryBuilder($reportingTable, $filterId, $periodicity, $initDate, $endDate, $fields ) {
|
|
||||||
|
$dbh = new PDO("mysql:host=".$host.";dbname=$db;charset=utf8", $user, $pass);
|
||||||
|
|
||||||
|
$statement = $dbh->prepare($sqlString);
|
||||||
|
|
||||||
|
$statement->execute($params);
|
||||||
|
$result = $statement->fetchAll(PDO::FETCH_ASSOC); */
|
||||||
|
|
||||||
|
$connection = $this->pdoConnection ();
|
||||||
|
$result = $this->pdoExecutorWithConnection($sqlString, $params, $connection);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function pdoConnection() {
|
||||||
|
G::loadClass('wsTools');
|
||||||
|
$currentWS = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined';
|
||||||
|
$workSpace = new workspaceTools($currentWS);
|
||||||
|
$host = $workSpace->dbHost;
|
||||||
|
|
||||||
|
$arrayHost = split(":", $workSpace->dbHost);
|
||||||
|
$host = "host=".$arrayHost[0];
|
||||||
|
$port = sizeof($arrayHost) > 0 ? ";port=".$arrayHost[1] : "";
|
||||||
|
$db = ";dbname=".$workSpace->dbName;
|
||||||
|
$user = $workSpace->dbUser;
|
||||||
|
$pass = $workSpace->dbPass;
|
||||||
|
$connString = "mysql:$host$port$db;";
|
||||||
|
|
||||||
|
$dbh = new PDO($connString, $user, $pass);
|
||||||
|
return $dbh;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function pdoExecutorWithConnection($sqlString, $params, $connection) {
|
||||||
|
$statement = $connection->prepare($sqlString);
|
||||||
|
$statement->execute($params);
|
||||||
|
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*private function indicatorsBasicQueryBuilder($reportingTable, $filterId, $periodicity, $initDate, $endDate, $fields ) {
|
||||||
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||||
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||||
|
|
||||||
@@ -727,8 +565,41 @@ class indicatorsCalculator
|
|||||||
. $filterCondition
|
. $filterCondition
|
||||||
. $periodicityGroup;
|
. $periodicityGroup;
|
||||||
return $sqlString;
|
return $sqlString;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
private function indicatorsParamsQueryBuilder($reportingTable, $filterId, $periodicity, $initDate, $endDate, $fields, &$params) {
|
||||||
|
if (!is_a($initDate, 'DateTime')) throw new InvalidArgumentException ('initDate parameter must be a DateTime object.', 0);
|
||||||
|
if (!is_a($endDate, 'DateTime')) throw new InvalidArgumentException ('endDate parameter must be a DateTime object.', 0);
|
||||||
|
|
||||||
|
$tableMetadata = $this->metadataForTable($reportingTable);
|
||||||
|
$periodicitySelectFields = $this->periodicityFieldsForSelect($periodicity);
|
||||||
|
$periodicityGroup = $this->periodicityFieldsForGrouping($periodicity);
|
||||||
|
$initYear = $initDate->format("Y");
|
||||||
|
$initMonth = $initDate->format("m");
|
||||||
|
$endYear = $endDate->format("Y");
|
||||||
|
$endMonth = $endDate->format("m");
|
||||||
|
|
||||||
|
$filterCondition = "";
|
||||||
|
if ($filterId != null && $filterId > 0) {
|
||||||
|
$filterCondition = " AND ".$tableMetadata["keyField"]." = '$filterId'";
|
||||||
|
}
|
||||||
|
|
||||||
|
//$params[":initYear"] = $initYear;
|
||||||
|
//$params[":initMonth"] = $initMonth;
|
||||||
|
$params[":endYear"] = $endYear;
|
||||||
|
$params[":endMonth"] = $endMonth;
|
||||||
|
|
||||||
|
$sqlString = "SELECT $periodicitySelectFields $fields
|
||||||
|
FROM ".$tableMetadata["tableName"].
|
||||||
|
" WHERE
|
||||||
|
IF(`YEAR` = :endYear, `MONTH`, `YEAR`) <= IF (`YEAR` = :endYear, :endMonth, :endYear)"
|
||||||
|
. $filterCondition
|
||||||
|
. $periodicityGroup;
|
||||||
|
return $sqlString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private function metadataForTable($table) {
|
private function metadataForTable($table) {
|
||||||
$returnVal = null;
|
$returnVal = null;
|
||||||
switch (strtolower($table)) {
|
switch (strtolower($table)) {
|
||||||
@@ -750,6 +621,23 @@ class indicatorsCalculator
|
|||||||
}
|
}
|
||||||
return $returnVal;
|
return $returnVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* For debug only:
|
||||||
|
* public function interpolateQuery($query, $params) {
|
||||||
|
$keys = array();
|
||||||
|
# build a regular expression for each parameter
|
||||||
|
foreach ($params as $key => $value) {
|
||||||
|
echo "<br>key", $key, " -- value", $value;
|
||||||
|
if (is_string($key)) {
|
||||||
|
$keys[] = '/:'.$key.'/';
|
||||||
|
} else {
|
||||||
|
$keys[] = '/[?]/';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$query = preg_replace($keys, $params, $query, 1, $count);
|
||||||
|
return $query;
|
||||||
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1793,67 +1793,52 @@ class AppCacheView extends BaseAppCacheView
|
|||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
function fillReportByUser ()
|
public function fillReportByUser ($dateInit, $dateFinish)
|
||||||
{
|
{
|
||||||
try {
|
$con = Propel::getConnection("workflow");
|
||||||
global $sFilter;
|
$stmt = $con->createStatement();
|
||||||
global $dateInit;
|
|
||||||
global $dateFinish;
|
$filenameSql = $this->pathToAppCacheFiles . "triggerFillReportByUser.sql";
|
||||||
|
|
||||||
if (strpos($sFilter, 'report_by_user') === false) {
|
if (!file_exists($filenameSql)) {
|
||||||
return false;
|
throw (new Exception("file triggerFillReportByUser.sql doesn't exist"));
|
||||||
}
|
}
|
||||||
if ($dateInit == null) {
|
|
||||||
eprintln("You must enter the starting date.", "red");
|
$sql = "TRUNCATE TABLE USR_REPORTING";
|
||||||
eprintln('Example: +init-date"YYYY-MM-DD HH:MM:SS" +finish-date"YYYY-MM-DD HH:MM:SS"', "red");
|
$stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||||
return false;
|
|
||||||
}
|
$sql = explode(';', file_get_contents($filenameSql));
|
||||||
|
|
||||||
$dateFinish = ($dateFinish != null) ? $dateFinish : date("Y-m-d H:i:s");
|
foreach ($sql as $key => $val) {
|
||||||
|
$val = str_replace('{init_date}', $dateInit, $val);
|
||||||
$appcv = new AppCacheView();
|
$val = str_replace('{finish_date}', $dateFinish, $val);
|
||||||
$appcv->setPathToAppCacheFiles( PATH_METHODS . 'setup' . PATH_SEP . 'setupSchemas' . PATH_SEP );
|
$stmt->executeQuery($val);
|
||||||
setExecutionMessage("Calculating data to fill the 'User Reporting'...");
|
}
|
||||||
$appcv->fillReportByUser($dateInit, $dateFinish);
|
}
|
||||||
setExecutionResultMessage("DONE");
|
|
||||||
} catch (Exception $e) {
|
public function fillReportByProcess ($dateInit, $dateFinish)
|
||||||
setExecutionResultMessage("WITH ERRORS", "error");
|
{
|
||||||
eprintln(" '-" . $e->getMessage(), "red");
|
$con = Propel::getConnection("workflow");
|
||||||
saveLog("fillReportByUser", "error", "Error in fill report by user: " . $e->getMessage());
|
$stmt = $con->createStatement();
|
||||||
}
|
|
||||||
}
|
$filenameSql = $this->pathToAppCacheFiles . "triggerFillReportByProcess.sql";
|
||||||
|
|
||||||
function fillReportByProcess ()
|
if (!file_exists($filenameSql)) {
|
||||||
{
|
throw (new Exception("file triggerFillReportByProcess.sql doesn't exist"));
|
||||||
try {
|
}
|
||||||
global $sFilter;
|
|
||||||
global $dateInit;
|
$sql = "TRUNCATE TABLE PRO_REPORTING";
|
||||||
global $dateFinish;
|
$stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
if (strpos($sFilter, 'report_by_process') === false) {
|
$sql = explode(';', file_get_contents($filenameSql));
|
||||||
return false;
|
|
||||||
}
|
foreach ($sql as $key => $val) {
|
||||||
|
$val = str_replace('{init_date}', $dateInit, $val);
|
||||||
if ($dateInit == null) {
|
$val = str_replace('{finish_date}', $dateFinish, $val);
|
||||||
eprintln("You must enter the starting date.", "red");
|
$stmt->executeQuery($val);
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,17 @@ class StrategicDashboard extends Controller
|
|||||||
{
|
{
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
|
|
||||||
if ($RBAC->userCanAccess('PM_DASHBOARD') != 1) {
|
if ($RBAC->userCanAccess('PM_SETUP') != 1) {
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::header( 'location: login/login' );
|
G::header( 'location: login/login' );
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||||
|
if (!$licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||||
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
|
G::header( 'location: ../login/login' );
|
||||||
|
die;
|
||||||
|
}
|
||||||
$this->usrId = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
|
$this->usrId = $RBAC->aUserInfo['USER_INFO']['USR_UID'];
|
||||||
$this->urlProxy = '/api/1.0/' . SYS_SYS . '/';
|
$this->urlProxy = '/api/1.0/' . SYS_SYS . '/';
|
||||||
//change
|
//change
|
||||||
|
|||||||
@@ -59952,7 +59952,6 @@ INSERT INTO CATALOG (CAT_UID, CAT_LABEL_ID, CAT_TYPE, CAT_FLAG, CAT_OBSERVATION,
|
|||||||
('300','ID_SEMESTER','PERIODICITY','','','2015-03-04','2015-03-04'),
|
('300','ID_SEMESTER','PERIODICITY','','','2015-03-04','2015-03-04'),
|
||||||
('400','ID_YEAR','PERIODICITY','','','2015-03-04','2015-03-04'),
|
('400','ID_YEAR','PERIODICITY','','','2015-03-04','2015-03-04'),
|
||||||
('1010','ID_PROCESS_EFFICIENCE','INDICATOR','','','2015-03-04','2015-03-04'),
|
('1010','ID_PROCESS_EFFICIENCE','INDICATOR','','','2015-03-04','2015-03-04'),
|
||||||
('1020','ID_PROCESS_INEFFICIENCE','INDICATOR','','','2015-03-04','2015-03-04'),
|
|
||||||
('1030','ID_EMPLYEE_EFFICIENCIE','INDICATOR','','','2015-03-04','2015-03-04'),
|
('1030','ID_EMPLYEE_EFFICIENCIE','INDICATOR','','','2015-03-04','2015-03-04'),
|
||||||
('1040','ID_USER_INEFFICIENCE','INDICATOR','','','2015-03-04','2015-03-04'),
|
('1040','ID_USER_INEFFICIENCE','INDICATOR','','','2015-03-04','2015-03-04'),
|
||||||
('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04'),
|
('1050','ID_OVER_DUE','INDICATOR','%','Unit for displaying','2015-03-04','2015-03-04'),
|
||||||
|
|||||||
@@ -255,7 +255,7 @@
|
|||||||
|
|
||||||
//Items by each type:
|
//Items by each type:
|
||||||
var proEffic = '<div class="col-lg-3 col-md-6 dashPro" id="proEfficItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
var proEffic = '<div class="col-lg-3 col-md-6 dashPro" id="proEfficItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
||||||
<div class="proGreen panel panel-green grid-stack-item-content">\
|
<div class="proGreen panel panel-green grid-stack-item-content" style="min-width: 200px;">\
|
||||||
<a data-toggle="collapse" href="#efficiencyindex" aria-expanded="false" aria-controls="efficiencyindex">\
|
<a data-toggle="collapse" href="#efficiencyindex" aria-expanded="false" aria-controls="efficiencyindex">\
|
||||||
<div class="panel-heading">\
|
<div class="panel-heading">\
|
||||||
<div class="row">\
|
<div class="row">\
|
||||||
@@ -273,7 +273,7 @@
|
|||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
var userEffic = '<div class="col-lg-3 col-md-6 dashUsr" id="userEfficItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
var userEffic = '<div class="col-lg-3 col-md-6 dashUsr" id="userEfficItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
||||||
<div class="proRed panel panel-red grid-stack-item-content">\
|
<div class="proRed panel panel-red grid-stack-item-content" style="min-width: 200px;">\
|
||||||
<a data-toggle="collapse" href="#userefficiency" aria-expanded="false" aria-controls="userefficiency">\
|
<a data-toggle="collapse" href="#userefficiency" aria-expanded="false" aria-controls="userefficiency">\
|
||||||
<div class="panel-heading">\
|
<div class="panel-heading">\
|
||||||
<div class="row">\
|
<div class="row">\
|
||||||
@@ -291,7 +291,7 @@
|
|||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
var compCases = '<div class="col-lg-3 col-md-6" id="generalLowItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
var compCases = '<div class="col-lg-3 col-md-6" id="generalLowItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
||||||
<div class="panel ie-panel panel-primary grid-stack-item-content">\
|
<div class="panel ie-panel panel-primary grid-stack-item-content" style="min-width: 200px;">\
|
||||||
<a data-toggle="collapse" href="#completedcases" aria-expanded="false" aria-controls="completedcases">\
|
<a data-toggle="collapse" href="#completedcases" aria-expanded="false" aria-controls="completedcases">\
|
||||||
<div class="panel-heading">\
|
<div class="panel-heading">\
|
||||||
<div class="row">\
|
<div class="row">\
|
||||||
@@ -312,7 +312,7 @@
|
|||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
var numCases = '<div class="col-lg-3 col-md-6" id="generalGreatItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
var numCases = '<div class="col-lg-3 col-md-6" id="generalGreatItem" data-gs-min-width="3" data-gs-min-height="2" data-gs-max-height="2">\
|
||||||
<div class="panel ie-panel panel-yellow grid-stack-item-content">\
|
<div class="panel ie-panel panel-yellow grid-stack-item-content" style="min-width: 200px;">\
|
||||||
<a data-toggle="collapse" href="#numbercases" aria-expanded="false" aria-controls="numbercases">\
|
<a data-toggle="collapse" href="#numbercases" aria-expanded="false" aria-controls="numbercases">\
|
||||||
<div class="panel-heading">\
|
<div class="panel-heading">\
|
||||||
<div class="row">\
|
<div class="row">\
|
||||||
@@ -333,11 +333,44 @@
|
|||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
//Data by Indicator elements:
|
//Data by Indicator elements:
|
||||||
var proEfficDataGen = '<div class="process-div well" id="proEfficiencyData" data-gs-no-resize="true" style="height:auto;"><div class="panel-heading greenbg"><span id="proEfficTitle"> '+ G_STRING.ID_PRO_EFFICIENCY_INDEX +' </span></div><div class="text-center huge"><div class="col-xs-3 vcenter"><div id="proEfficIndex" class="green">26%</div><div class="small grey">'+ G_STRING.ID_EFFICIENCY_INDEX +'</div></div><div class="col-xs-3 vcenter"><div id="proEfficCost" class="red">$1813.50</div><div class="small grey">'+ G_STRING.ID_INEFFICIENCY_COST +'</div></div><div class="col-xs-6" id="proEfficGenGraph" style="width:500px;height:300px; margin-left:80px;"><img src="../dist/img/graph.png"/></div></div><div class="clearfix"></div></div>';
|
var proEfficDataGen = '<div class="process-div well" id="proEfficiencyData" data-gs-no-resize="true" style="clear:both;position:relative;height:auto;">\
|
||||||
|
<div class="panel-heading greenbg"><span id="proEfficTitle"> '+ G_STRING.ID_PRO_EFFICIENCY_INDEX +' </span></div>\
|
||||||
|
<div class="text-center huge">\
|
||||||
|
<div class="col-xs-3 vcenter">\
|
||||||
|
<div id="proEfficIndex" class="green">26%</div>\
|
||||||
|
<div class="small grey">'+ G_STRING.ID_EFFICIENCY_INDEX +'</div>\
|
||||||
|
</div>\
|
||||||
|
<div class="col-xs-3 vcenter">\
|
||||||
|
<div id="proEfficCost" class="red">$1813.50</div>\
|
||||||
|
<div class="small grey">'+ G_STRING.ID_INEFFICIENCY_COST +'</div>\
|
||||||
|
</div>\
|
||||||
|
<div class="col-xs-6" id="proEfficGenGraph" style="width:500px;height:300px; margin-left:80px;"><img src="../dist/img/graph.png" /></div>\
|
||||||
|
</div>\
|
||||||
|
<div class="clearfix"></div>\
|
||||||
|
</div>';
|
||||||
|
|
||||||
var proEfficData = '<div class="process-div well" id="proEfficiencyData" data-gs-no-resize="true"><div class="panel-heading greenbg"><ol class="breadcrumb"><li><a id="link" href="javascript:back();"><i class="fa fa-chevron-left fa-fw"></i><span id="proEfficTitle"> '+ G_STRING.ID_PRO_EFFICIENCY_INDEX +' </span></a></li><li id="proDetName">Process 1 name</li></ol></div><div class="text-center huge"><div class="col-xs-3 vcenter"><div id="proEfficIndex" class="green">26%</div><div class="small grey">'+ G_STRING.ID_EFFICIENCY_INDEX +'</div></div><div class="col-xs-3 vcenter"><div id="proEfficCost" class="red">$1813.50</div><div class="small grey">'+ G_STRING.ID_INEFFICIENCY_COST +'</div></div><div class="col-xs-6" id="proEfficGraph" style="width:570px; height:300px; margin-left:70px; "><img src="../dist/img/graph.png"/></div></div><div class="clearfix"></div></div>';
|
var proEfficData = '<div class="process-div well" id="proEfficiencyData" data-gs-no-resize="true" style="clear:both;position:relative;">\
|
||||||
|
<div class="panel-heading greenbg">\
|
||||||
|
<ol class="breadcrumb">\
|
||||||
|
<li><a id="link" href="javascript:back();"><i class="fa fa-chevron-left fa-fw"></i><span id="proEfficTitle"> '+ G_STRING.ID_PRO_EFFICIENCY_INDEX +' </span></a></li>\
|
||||||
|
<li id="proDetName">Process 1 name</li>\
|
||||||
|
</ol>\
|
||||||
|
</div>\
|
||||||
|
<div class="text-center huge">\
|
||||||
|
<div class="col-xs-3 vcenter">\
|
||||||
|
<div id="proEfficIndex" class="green">26%</div>\
|
||||||
|
<div class="small grey">'+ G_STRING.ID_EFFICIENCY_INDEX +'</div>\
|
||||||
|
</div>\
|
||||||
|
<div class="col-xs-3 vcenter">\
|
||||||
|
<div id="proEfficCost" class="red">$1813.50</div>\
|
||||||
|
<div class="small grey">'+ G_STRING.ID_INEFFICIENCY_COST +'</div>\
|
||||||
|
</div>\
|
||||||
|
<div class="col-xs-6" id="proEfficGraph" style="width:570px; height:300px; margin-left:70px; "><img src="../dist/img/graph.png" /></div>\
|
||||||
|
</div>\
|
||||||
|
<div class="clearfix"></div>\
|
||||||
|
</div>';
|
||||||
|
|
||||||
var proEfficDetail = '<div id="process" class="process-div well hideme" data-gs-no-resize="true">\
|
var proEfficDetail = '<div id="process" class="process-div well hideme" data-gs-no-resize="true" style="clear:both;position:relative;">\
|
||||||
<div class="col-lg-12 vcenter-task">\
|
<div class="col-lg-12 vcenter-task">\
|
||||||
<a href="#" class="process-button">\
|
<a href="#" class="process-button">\
|
||||||
<div class="col-xs-3 text-left title-process">\
|
<div class="col-xs-3 text-left title-process">\
|
||||||
@@ -402,11 +435,32 @@
|
|||||||
</div>\
|
</div>\
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
var generalDataLow = '<div class="process-div well" data-gs-no-resize="true"><div class="panel-heading bluebg"><ol class="breadcrumb"><li id="generalLowTitle">'+ G_STRING.ID_COMPLETED_CASES +'</li></ol></div><div class="text-center huge"><div class="col-xs-6" id="generalGraph1" style="width:600px; height:300px;"><img src="../dist/img/graph.png"/></div><div class="col-xs-6" id="generalGraph2" style="width:600px; height:300px;margin-left:60px;"><img src="../dist/img/graph.png"/></div></div><div class="clearfix"></div></div>';
|
var generalDataLow = '<div class="process-div well" data-gs-no-resize="true" style="clear:both;position:relative;height:auto;">\
|
||||||
|
<div class="panel-heading bluebg">\
|
||||||
|
<ol class="breadcrumb">\
|
||||||
|
<li id="generalLowTitle">'+ G_STRING.ID_COMPLETED_CASES +'</li>\
|
||||||
|
</ol>\
|
||||||
|
</div>\
|
||||||
|
<div class="text-center huge">\
|
||||||
|
<div class="col-xs-6" id="generalGraph1" style="width:600px; height:300px;"><img src="../dist/img/graph.png" /></div>\
|
||||||
|
<div class="col-xs-6" id="generalGraph2" style="width:600px; height:300px;margin-left:60px;"><img src="../dist/img/graph.png" /></div>\
|
||||||
|
</div>\
|
||||||
|
<div class="clearfix"></div>\
|
||||||
|
</div>';
|
||||||
|
|
||||||
var generalDataGreat = ' <div class="process-div well" data-gs-no-resize="true"><div class="panel-heading yellowbg"><ol class="breadcrumb"><li id="generalGreatTitle">'+ G_STRING.ID_NUMBER_CASES +'</li></ol></div><div class="text-center huge"><div class="col-xs-6" id="generalGraph1" style="width:600px; height:300px;"><img src="../dist/img/graph.png"/></div><div class="col-xs-6" id="generalGraph2" style="width:600px; height:300px; margin-left:60px;"><img src="../dist/img/graph.png"/></div></div><div class="clearfix"></div></div>';
|
var generalDataGreat = '<div class="process-div well" data-gs-no-resize="true" style="clear:both;position:relative;height:auto;">\
|
||||||
|
<div class="panel-heading yellowbg">\
|
||||||
|
<ol class="breadcrumb">\
|
||||||
|
<li id="generalGreatTitle">'+ G_STRING.ID_NUMBER_CASES +'</li>\
|
||||||
|
</ol>\
|
||||||
|
</div>\
|
||||||
|
<div class="text-center huge">\
|
||||||
|
<div class="col-xs-6" id="generalGraph1" style="width:600px; height:300px;"><img src="../dist/img/graph.png" /></div>\
|
||||||
|
<div class="col-xs-6" id="generalGraph2" style="width:600px; height:300px; margin-left:60px;"><img src="../dist/img/graph.png" /></div>\
|
||||||
|
</div>\
|
||||||
|
<div class="clearfix"></div>\
|
||||||
|
</div>';
|
||||||
|
|
||||||
|
|
||||||
var oType;
|
var oType;
|
||||||
var actualDashId;
|
var actualDashId;
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') ==
|
|||||||
// NEW DASHBOARD MODULE
|
// NEW DASHBOARD MODULE
|
||||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||||
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') && ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1)) {
|
if ($licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=') && ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1)) {
|
||||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD+', 'strategicDashboard/main', G::LoadTranslation('ID_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
$G_TMP_MENU->AddIdRawOption('DASHBOARD+', 'strategicDashboard/main', G::LoadTranslation('ID_STRATEGIC_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||||
}
|
}
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ INSERT INTO PRO_REPORTING (
|
|||||||
TOTAL_CASES_OVERDUE,
|
TOTAL_CASES_OVERDUE,
|
||||||
TOTAL_CASES_ON_TIME
|
TOTAL_CASES_ON_TIME
|
||||||
)
|
)
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
APPLICATION.PRO_UID,
|
APPLICATION.PRO_UID,
|
||||||
DATE_FORMAT(APPLICATION.APP_INIT_DATE, '%m') AS `MONTH`,
|
DATE_FORMAT(APPLICATION.APP_INIT_DATE, '%m') AS `MONTH`,
|
||||||
|
|||||||
@@ -24,6 +24,13 @@
|
|||||||
|
|
||||||
$RBAC->requirePermissions( 'PM_DASHBOARD' );
|
$RBAC->requirePermissions( 'PM_DASHBOARD' );
|
||||||
|
|
||||||
|
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||||
|
if (!$licensedFeatures->verifyfeature('r19Vm5DK1UrT09MenlLYjZxejlhNUZ1b1NhV0JHWjBsZEJ6dnpJa3dTeWVLVT0=')) {
|
||||||
|
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||||
|
G::header( 'location: ../login/login' );
|
||||||
|
die;
|
||||||
|
}
|
||||||
|
|
||||||
$G_MAIN_MENU = 'processmaker';
|
$G_MAIN_MENU = 'processmaker';
|
||||||
$G_ID_MENU_SELECTED = 'DASHBOARD+';
|
$G_ID_MENU_SELECTED = 'DASHBOARD+';
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,8 @@ Ext.onReady( function() {
|
|||||||
sortInfo: {
|
sortInfo: {
|
||||||
field: 'OWNER_TYPE',
|
field: 'OWNER_TYPE',
|
||||||
direction: 'ASC'
|
direction: 'ASC'
|
||||||
}
|
},
|
||||||
|
autoLoad: true
|
||||||
});
|
});
|
||||||
|
|
||||||
storeGroup = new Ext.data.GroupingStore( {
|
storeGroup = new Ext.data.GroupingStore( {
|
||||||
@@ -208,7 +209,8 @@ Ext.onReady( function() {
|
|||||||
store: store,
|
store: store,
|
||||||
displayInfo: true,
|
displayInfo: true,
|
||||||
displayMsg: _('ID_GRID_PAGE_DISPLAYING_0WNER_MESSAGE') + ' ',
|
displayMsg: _('ID_GRID_PAGE_DISPLAYING_0WNER_MESSAGE') + ' ',
|
||||||
emptyMsg: _('ID_GRID_PAGE_NO_OWNER_MESSAGE'),
|
//emptyMsg: _('ID_GRID_PAGE_NO_OWNER_MESSAGE')
|
||||||
|
emptyMsg: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
cmodel = new Ext.grid.ColumnModel({
|
cmodel = new Ext.grid.ColumnModel({
|
||||||
@@ -387,21 +389,13 @@ Ext.onReady( function() {
|
|||||||
|
|
||||||
ownerInfoGrid = new Ext.grid.GridPanel({
|
ownerInfoGrid = new Ext.grid.GridPanel({
|
||||||
region : 'center',
|
region : 'center',
|
||||||
//layout : 'fit',
|
|
||||||
id : 'ownerInfoGrid',
|
id : 'ownerInfoGrid',
|
||||||
height : 200,
|
height : 200,
|
||||||
//autoWidth : true,
|
|
||||||
//anchor : '80%',
|
|
||||||
width : '100%',
|
width : '100%',
|
||||||
//stateful : true,
|
|
||||||
stateId : 'gridDashboardList',
|
stateId : 'gridDashboardList',
|
||||||
//enableColumnResize : true,
|
|
||||||
enableHdMenu: true,
|
enableHdMenu: true,
|
||||||
frame : false,
|
frame : false,
|
||||||
columnLines : false,
|
columnLines : false,
|
||||||
/*viewConfig : {
|
|
||||||
forceFit:true
|
|
||||||
},*/
|
|
||||||
store: store,
|
store: store,
|
||||||
cm: cmodel,
|
cm: cmodel,
|
||||||
sm: smodel,
|
sm: smodel,
|
||||||
@@ -474,7 +468,9 @@ Ext.onReady( function() {
|
|||||||
OWNER_LABEL : selection.data.field1,
|
OWNER_LABEL : selection.data.field1,
|
||||||
OWNER_TYPE : selection.data.field3
|
OWNER_TYPE : selection.data.field3
|
||||||
});
|
});
|
||||||
store.insert(store.getCount(), ow);
|
ownerInfoGrid.store.insert(store.getCount(), ow);
|
||||||
|
ownerInfoGrid.store.totalCount = data.length +1;
|
||||||
|
ownerInfoGrid.store.sort('OWNER_LABEL', 'ASC');
|
||||||
ownerInfoGrid.getView().refresh();
|
ownerInfoGrid.getView().refresh();
|
||||||
|
|
||||||
Ext.getCmp('searchIem').clearValue();
|
Ext.getCmp('searchIem').clearValue();
|
||||||
@@ -505,7 +501,7 @@ Ext.onReady( function() {
|
|||||||
enableTabScroll : true,
|
enableTabScroll : true,
|
||||||
//anchor : '98%',
|
//anchor : '98%',
|
||||||
width : '100%',
|
width : '100%',
|
||||||
height : 300,
|
height : 315,
|
||||||
defaults : {
|
defaults : {
|
||||||
autoScroll :true
|
autoScroll :true
|
||||||
},
|
},
|
||||||
@@ -522,7 +518,7 @@ Ext.onReady( function() {
|
|||||||
Ext.MessageBox.show({
|
Ext.MessageBox.show({
|
||||||
title: _('ID_CONFIRM'),
|
title: _('ID_CONFIRM'),
|
||||||
msg: _('ID_DELETE_INDICATOR_SURE'),
|
msg: _('ID_DELETE_INDICATOR_SURE'),
|
||||||
buttons: Ext.MessageBox.YESNOCANCEL,
|
buttons: Ext.MessageBox.YESNO,
|
||||||
fn: function(buttonId) {
|
fn: function(buttonId) {
|
||||||
switch(buttonId) {
|
switch(buttonId) {
|
||||||
case 'no':
|
case 'no':
|
||||||
@@ -537,9 +533,6 @@ Ext.onReady( function() {
|
|||||||
tabActivate.remove(component.id);
|
tabActivate.remove(component.id);
|
||||||
tabPanel.remove(component);
|
tabPanel.remove(component);
|
||||||
break;
|
break;
|
||||||
case 'cancel':
|
|
||||||
flag = true;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scope: that
|
scope: that
|
||||||
@@ -662,8 +655,8 @@ Ext.onReady( function() {
|
|||||||
{
|
{
|
||||||
text : _('ID_CANCEL'),
|
text : _('ID_CANCEL'),
|
||||||
id : 'cancel',
|
id : 'cancel',
|
||||||
handler : function(){
|
handler : function() {
|
||||||
location.href = 'dashboardList';
|
window.location = 'dashboardList';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -710,7 +703,6 @@ Ext.onReady( function() {
|
|||||||
loadIndicators(DAS_UID);
|
loadIndicators(DAS_UID);
|
||||||
} else {
|
} else {
|
||||||
addTab();
|
addTab();
|
||||||
tabPanel.getItem(0).show();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof(__DASHBOARD_ERROR__) !== 'undefined') {
|
if (typeof(__DASHBOARD_ERROR__) !== 'undefined') {
|
||||||
@@ -719,19 +711,20 @@ Ext.onReady( function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//==============================================================//
|
//==============================================================//
|
||||||
var addTab = function () {
|
var addTab = function (flag) {
|
||||||
if (tabPanel.items.items.length > 3 ) {
|
if (tabPanel.items.items.length > 3 ) {
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_MAX_INDICATOR_DASHBOARD'));
|
PMExt.warning(_('ID_DASHBOARD'), _('ID_MAX_INDICATOR_DASHBOARD'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tabPanel.add({
|
var tab = {
|
||||||
//title : _('ID_INDICATOR') + (++indexTab),
|
|
||||||
title : _('ID_INDICATOR')+ ' '+ (++indexTab),
|
title : _('ID_INDICATOR')+ ' '+ (++indexTab),
|
||||||
id : indexTab,
|
id : indexTab,
|
||||||
iconCls : 'tabs',
|
iconCls : 'tabs',
|
||||||
|
width : "100%",
|
||||||
items : [
|
items : [
|
||||||
new Ext.Panel({
|
new Ext.Panel({
|
||||||
height : 260,
|
height : 275,
|
||||||
|
width : "100%",
|
||||||
border : true,
|
border : true,
|
||||||
bodyStyle : 'padding:10px',
|
bodyStyle : 'padding:10px',
|
||||||
items : [
|
items : [
|
||||||
@@ -789,38 +782,69 @@ var addTab = function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
{
|
new Ext.form.FieldSet({
|
||||||
fieldLabel : _('ID_INDICATOR_GOAL'),
|
title : _('ID_INDICATOR_GOAL'),
|
||||||
id : 'IND_GOAL_'+ indexTab,
|
width : "90%",
|
||||||
xtype : 'textfield',
|
id : 'fieldSet_'+ indexTab,
|
||||||
anchor : '40%',
|
bodyStyle: 'paddingLeft: 75px;',
|
||||||
maskRe : /([0-9\.]+)$/,
|
paddingLeft: "30px",
|
||||||
maxLength : 9,
|
marginLeft : "60px",
|
||||||
width : 8,
|
layout : 'hbox',
|
||||||
allowBlank : false
|
items : [
|
||||||
},
|
new Ext.form.ComboBox({
|
||||||
new Ext.form.ComboBox({
|
editable : false,
|
||||||
anchor : '85%',
|
id : 'DAS_IND_DIRECTION_'+ indexTab,
|
||||||
editable : false,
|
displayField : 'label',
|
||||||
fieldLabel : _('ID_DIRECTION'),
|
valueField : 'id',
|
||||||
id : 'DAS_IND_DIRECTION_'+ indexTab,
|
value : '2',
|
||||||
displayField : 'label',
|
forceSelection : false,
|
||||||
valueField : 'id',
|
selectOnFocus : true,
|
||||||
value : 2,
|
typeAhead : true,
|
||||||
forceSelection : false,
|
autocomplete : true,
|
||||||
selectOnFocus : true,
|
width : 90,
|
||||||
typeAhead : true,
|
triggerAction : 'all',
|
||||||
autocomplete : true,
|
mode : 'local',
|
||||||
triggerAction : 'all',
|
allowBlank : false,
|
||||||
mode : 'local',
|
store : new Ext.data.ArrayStore({
|
||||||
store : new Ext.data.ArrayStore({
|
id: 2,
|
||||||
id: 0,
|
fields: [
|
||||||
fields: [
|
'id',
|
||||||
'id',
|
'label'
|
||||||
'label'
|
],
|
||||||
],
|
data: [['1', _('ID_LESS_THAN')], ['2', _('ID_MORE_THAN')]]
|
||||||
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,
|
||||||
|
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({
|
new Ext.form.ComboBox({
|
||||||
anchor : '85%',
|
anchor : '85%',
|
||||||
@@ -915,7 +939,12 @@ var addTab = function () {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
closable:true
|
closable:true
|
||||||
})/*.show(false)*/;
|
};
|
||||||
|
if (flag != 'load') {
|
||||||
|
tabPanel.add(tab).show();
|
||||||
|
} else {
|
||||||
|
tabPanel.add(tab);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -1049,77 +1078,70 @@ var saveDashboard = function () {
|
|||||||
|
|
||||||
var saveAllIndicators = function (DAS_UID) {
|
var saveAllIndicators = function (DAS_UID) {
|
||||||
for (var tab in tabActivate) {
|
for (var tab in tabActivate) {
|
||||||
if (tab == 'remove') {
|
if (tab == 'remove' || tab == 'indexOf' || tab == 'map') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
tabPanel.getItem(tabActivate[tab]).show();
|
tabPanel.getItem(tabActivate[tab]).show();
|
||||||
var fieldsTab = tabPanel.getItem(tabActivate[tab]).items.items[0].items.items[0].items.items;
|
var fieldsTab = tabPanel.getItem(tabActivate[tab]).items.items[0].items.items[0].items.items;
|
||||||
|
|
||||||
|
var goal = fieldsTab[3];
|
||||||
|
fieldsTab.push(goal.items.items[0]);
|
||||||
|
fieldsTab.push(goal.items.items[1]);
|
||||||
|
|
||||||
data = [];
|
data = [];
|
||||||
data['DAS_UID'] = DAS_UID;
|
data['DAS_UID'] = DAS_UID;
|
||||||
|
|
||||||
for (var index in fieldsTab) {
|
for (var index in fieldsTab) {
|
||||||
var node = fieldsTab[index];
|
var node = fieldsTab[index];
|
||||||
if (index == 'remove') {
|
if (index == 'remove' || index == 'map') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
id = node.id;
|
id = node.id;
|
||||||
value = node.getValue();
|
if (typeof id == 'undefined' || id.indexOf('fieldSet_') != -1 ) {
|
||||||
switch (index) {
|
continue;
|
||||||
case "0":
|
|
||||||
data['DAS_IND_UID'] = value.trim();
|
|
||||||
break;
|
|
||||||
case "1":
|
|
||||||
if (value.trim() == '') {
|
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TITLE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
|
||||||
node.focus(true,10);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
data['DAS_IND_TITLE'] = value.trim();
|
|
||||||
break;
|
|
||||||
case "2":
|
|
||||||
if (value.trim() == '') {
|
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_TYPE_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
|
||||||
node.focus(true,10);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
data['DAS_IND_TYPE'] = value.trim();
|
|
||||||
break;
|
|
||||||
case "3":
|
|
||||||
data['DAS_IND_GOAL'] = value.trim();
|
|
||||||
break;
|
|
||||||
case "4":
|
|
||||||
data['DAS_IND_DIRECTION'] = value;
|
|
||||||
break;
|
|
||||||
case "5":
|
|
||||||
if (value.trim() == '') {
|
|
||||||
PMExt.warning(_('ID_DASHBOARD'), _('ID_INDICATOR_PROCESS_REQUIRED', tabPanel.getItem(tabActivate[tab]).title));
|
|
||||||
node.focus(true,10);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
data['DAS_UID_PROCESS'] = value;
|
|
||||||
break;
|
|
||||||
case "6":
|
|
||||||
data['DAS_IND_FIRST_FIGURE'] = value;
|
|
||||||
break;
|
|
||||||
case "7":
|
|
||||||
data['DAS_IND_FIRST_FREQUENCY'] = value;
|
|
||||||
break;
|
|
||||||
case "8":
|
|
||||||
data['DAS_IND_SECOND_FIGURE'] = value;
|
|
||||||
break;
|
|
||||||
case "9":
|
|
||||||
data['DAS_IND_SECOND_FREQUENCY'] = value;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
id = id.split('_');
|
||||||
|
field = '';
|
||||||
|
for (var part = 0; part<id.length-1; part++) {
|
||||||
|
if (part == 0) {
|
||||||
|
field = id[part];
|
||||||
|
} else {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
field = field == 'IND_TITLE' ? 'DAS_IND_TITLE' : field;
|
||||||
|
field = field == 'IND_TYPE' ? 'DAS_IND_TYPE' : field;
|
||||||
|
field = field == 'IND_PROCESS' ? 'DAS_UID_PROCESS' : field;
|
||||||
|
field = field == 'IND_GOAL' ? 'DAS_IND_GOAL' : field;
|
||||||
|
|
||||||
|
data[field] = value.trim();
|
||||||
}
|
}
|
||||||
saveDashboardIndicator(data);
|
saveDashboardIndicator(data);
|
||||||
}
|
}
|
||||||
location.href = 'dashboardList';
|
window.location = 'dashboardList';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var saveDashboardIndicator = function (options) {
|
var saveDashboardIndicator = function (options) {
|
||||||
if (options['DAS_IND_UID'] == '') {
|
if (options['DAS_IND_UID'] == '') {
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
@@ -1196,8 +1218,6 @@ var saveAllDashboardOwner = function (DAS_UID) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var saveDashboardOwner = function (DAS_UID, uid, type) {
|
var saveDashboardOwner = function (DAS_UID, uid, type) {
|
||||||
myMask.msg = _('ID_SAVING');
|
|
||||||
myMask.show();
|
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url : urlProxy + 'dashboard/owner',
|
url : urlProxy + 'dashboard/owner',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -1212,11 +1232,9 @@ var saveDashboardOwner = function (DAS_UID, uid, type) {
|
|||||||
},
|
},
|
||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
myMask.hide();
|
|
||||||
},
|
},
|
||||||
failure: function (response) {
|
failure: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
myMask.hide();
|
|
||||||
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
PMExt.error(_('ID_ERROR'),jsonResp.error.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -1233,12 +1251,12 @@ var loadIndicators = function (DAS_UID) {
|
|||||||
success: function (response) {
|
success: function (response) {
|
||||||
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
var jsonResp = Ext.util.JSON.decode(response.responseText);
|
||||||
if (jsonResp == '') {
|
if (jsonResp == '') {
|
||||||
addTab();
|
addTab('load');
|
||||||
}
|
}
|
||||||
dataIndicator = jsonResp;
|
dataIndicator = jsonResp;
|
||||||
|
|
||||||
for (var i=0; i<=jsonResp.length-1; i++) {
|
for (var i=0; i<=jsonResp.length-1; i++) {
|
||||||
addTab();
|
addTab('load');
|
||||||
tabPanel.getItem(i+1).setTitle(jsonResp[i]['DAS_IND_TITLE']);
|
tabPanel.getItem(i+1).setTitle(jsonResp[i]['DAS_IND_TITLE']);
|
||||||
}
|
}
|
||||||
tabPanel.getItem(0).show();
|
tabPanel.getItem(0).show();
|
||||||
|
|||||||
@@ -29,13 +29,13 @@
|
|||||||
<script type="text/javascript" src="/js/d3/d3.js" ></script>
|
<script type="text/javascript" src="/js/d3/d3.js" ></script>
|
||||||
<script type="text/javascript" src="/js/d3/d3.tip.js"></script>
|
<script type="text/javascript" src="/js/d3/d3.tip.js"></script>
|
||||||
<script type="text/javascript" src="/js/pmchart/pmCharts.js"></script>
|
<script type="text/javascript" src="/js/pmchart/pmCharts.js"></script>
|
||||||
<script>
|
<script type="text/javascript" >
|
||||||
var urlProxy = '{$urlProxy}';
|
var urlProxy = '{$urlProxy}';
|
||||||
var usrId = '{$usrId}';
|
var usrId = '{$usrId}';
|
||||||
var token = '{$credentials.access_token}';
|
var token = '{$credentials.access_token}';
|
||||||
var G_STRING = [];
|
var G_STRING = [];
|
||||||
{foreach from=$translation key=index item=option}
|
{foreach from=$translation key=index item=option}
|
||||||
G_STRING['{$index}'] = '{$option}';
|
G_STRING['{$index}'] = "{$option}";
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</script>
|
</script>
|
||||||
<script type="text/javascript" src="/jscore/strategicDashboard/dashboardProxyTest.js"></script>
|
<script type="text/javascript" src="/jscore/strategicDashboard/dashboardProxyTest.js"></script>
|
||||||
@@ -56,37 +56,47 @@
|
|||||||
<i class="fa fa-chevron-down fa-1x"></i>
|
<i class="fa fa-chevron-down fa-1x"></i>
|
||||||
</a>
|
</a>
|
||||||
<h4 id="titleH4" class="header-dashboard">{translate label="ID_MANAGERS_DASHBOARDS"}</h4>
|
<h4 id="titleH4" class="header-dashboard">{translate label="ID_MANAGERS_DASHBOARDS"}</h4>
|
||||||
<div class="pull-right dashboard-right">
|
<div class="pull-right dashboard-right container-fluid">
|
||||||
<h5 class="pull-left">{translate label="ID_DASH_COMPARE_MONTH"}:</h5>
|
|
||||||
<button type="button" class="btn btn-compare btn-success pull-right btn-date">{translate label="ID_DASH_COMPARE"}</button>
|
|
||||||
|
|
||||||
<select id="year" class="form-control pull-right ">
|
<div class="row pull-left">
|
||||||
{literal}
|
<div class="span4 pull-left">
|
||||||
<script>
|
<h5 class="pull-left">{translate label="ID_DASH_COMPARE_MONTH"}:</h5>
|
||||||
now = new Date();
|
</div>
|
||||||
anio = now.getFullYear();
|
|
||||||
for(a=anio;a>=anio-7;a--){
|
|
||||||
document.write('<option value="'+a+'">'+a+'</option>');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
{/literal}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="mounth" class="form-control pull-right ">
|
<div class="span4 pull-left">
|
||||||
<option value="1">{translate label="ID_MONTH_ABB_1"}</option>
|
<button type="button" class="btn btn-compare btn-success pull-right btn-date">{translate label="ID_DASH_COMPARE"}</button>
|
||||||
<option value="2">{translate label="ID_MONTH_ABB_2"}</option>
|
</div>
|
||||||
<option value="3">{translate label="ID_MONTH_ABB_3"}</option>
|
|
||||||
<option value="4">{translate label="ID_MONTH_ABB_4"}</option>
|
|
||||||
<option value="5">{translate label="ID_MONTH_ABB_5"}</option>
|
|
||||||
<option value="6">{translate label="ID_MONTH_ABB_6"}</option>
|
|
||||||
<option value="7">{translate label="ID_MONTH_ABB_7"}</option>
|
|
||||||
<option value="8">{translate label="ID_MONTH_ABB_8"}</option>
|
|
||||||
<option value="9">{translate label="ID_MONTH_ABB_9"}</option>
|
|
||||||
<option value="10">{translate label="ID_MONTH_ABB_10"}</option>
|
|
||||||
<option value="11">{translate label="ID_MONTH_ABB_11"}</option>
|
|
||||||
<option value="12">{translate label="ID_MONTH_ABB_12"}</option>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
<div class="span4 pull-left">
|
||||||
|
<select id="year" class="form-control pull-right ">
|
||||||
|
{literal}
|
||||||
|
<script>
|
||||||
|
now = new Date();
|
||||||
|
anio = now.getFullYear();
|
||||||
|
for(a=anio;a>=anio-7;a--){
|
||||||
|
document.write('<option value="'+a+'">'+a+'</option>');
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{/literal}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="mounth" class="form-control pull-right ">
|
||||||
|
<option value="1">{translate label="ID_MONTH_ABB_1"}</option>
|
||||||
|
<option value="2">{translate label="ID_MONTH_ABB_2"}</option>
|
||||||
|
<option value="3">{translate label="ID_MONTH_ABB_3"}</option>
|
||||||
|
<option value="4">{translate label="ID_MONTH_ABB_4"}</option>
|
||||||
|
<option value="5">{translate label="ID_MONTH_ABB_5"}</option>
|
||||||
|
<option value="6">{translate label="ID_MONTH_ABB_6"}</option>
|
||||||
|
<option value="7">{translate label="ID_MONTH_ABB_7"}</option>
|
||||||
|
<option value="8">{translate label="ID_MONTH_ABB_8"}</option>
|
||||||
|
<option value="9">{translate label="ID_MONTH_ABB_9"}</option>
|
||||||
|
<option value="10">{translate label="ID_MONTH_ABB_10"}</option>
|
||||||
|
<option value="11">{translate label="ID_MONTH_ABB_11"}</option>
|
||||||
|
<option value="12">{translate label="ID_MONTH_ABB_12"}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="clearfix"></div>
|
<div class="clearfix"></div>
|
||||||
<div class="collapse" id="collapseExample">
|
<div class="collapse" id="collapseExample">
|
||||||
|
|||||||
Reference in New Issue
Block a user