Merged in jennydmz/processmaker/dash2Conf (pull request #1799)
Resolving conflicts
This commit is contained in:
@@ -352,6 +352,9 @@ 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");
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
$arrayClass = array("EmailServer", "ListInbox", "ListParticipatedHistory");
|
||||
|
||||
@@ -365,14 +368,33 @@ foreach ($arrayClass as $value) {
|
||||
G::LoadClass("serverConfiguration");
|
||||
G::LoadClass("dates"); //Load Criteria
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
global $dateInit;
|
||||
global $dateFinish;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
if (!defined('SYS_SYS')) {
|
||||
$sObject = $argv[1];
|
||||
$sNow = $argv[2];
|
||||
$sObject = $argv[1];
|
||||
$sNow = $argv[2];
|
||||
$dateSystem = $argv[3];
|
||||
$sFilter = '';
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$dateInit = null;
|
||||
$dateFinish = null;
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$sFilter = '';
|
||||
|
||||
for ($i = 4; $i <= count($argv) - 1; $i++) {
|
||||
$sFilter .= ' ' . $argv[$i];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
if (strpos($argv[$i], "+init-date") !== false) {
|
||||
$dateInit = substr($argv[$i],10);
|
||||
} else if (strpos($argv[$i], "+finish-date") !== false) {
|
||||
$dateFinish = substr($argv[$i], 12);
|
||||
} else {
|
||||
/*----------------------------------********---------------------------------*/
|
||||
$sFilter .= ' ' . $argv[$i];
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
$oDirectory = dir(PATH_DB);
|
||||
@@ -470,7 +492,7 @@ if (!defined('SYS_SYS')) {
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
|
||||
eprintln("Probelm in workspace: " . $sObject . " it was omitted.", "red");
|
||||
eprintln("Problem in workspace: " . $sObject . " it was omitted.", "red");
|
||||
}
|
||||
|
||||
eprintln();
|
||||
@@ -502,11 +524,18 @@ function processWorkspace()
|
||||
resendEmails();
|
||||
unpauseApplications();
|
||||
calculateDuration();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
calculateAppDuration();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
executeEvents($sLastExecution);
|
||||
executeScheduledCases();
|
||||
executeUpdateAppTitle();
|
||||
executeCaseSelfService();
|
||||
executePlugins();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
fillReportByUser();
|
||||
fillReportByProcess();
|
||||
/*----------------------------------********---------------------------------*/
|
||||
} catch (Exception $oError) {
|
||||
saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n");
|
||||
}
|
||||
@@ -696,6 +725,31 @@ 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 executeEvents($sLastExecution, $sNow=null)
|
||||
{
|
||||
global $sFilter;
|
||||
@@ -1038,3 +1092,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());
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
|
||||
@@ -414,7 +414,7 @@ class calendar extends CalendarDefinition
|
||||
$hoursDuration -= (float)($secondRes/3600);
|
||||
//$dataLog[] = (float)($secondRes/3600);
|
||||
} else {
|
||||
$newDate = date("Y-m-d H:i:s", strtotime("+" . round(((float)($hoursDuration)) * 3600) . " seconds", strtotime($newDate)));
|
||||
$newDate = date('Y-m-d H:i:s', strtotime('+' . (((float)$hoursDuration)*3600) . ' seconds', strtotime($newDate)));
|
||||
//$dataLog[] = (float)($hoursDuration);
|
||||
$hoursDuration = 0;
|
||||
}
|
||||
@@ -796,5 +796,253 @@ class calendar extends CalendarDefinition
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**************SLA classes***************/
|
||||
public function dashCalculateDate ($iniDate, $duration, $formatDuration, $calendarData = array())
|
||||
{
|
||||
if ( G::toUpper($formatDuration) == 'DAYS' ) {
|
||||
$duration = $duration*$calendarData['HOURS_FOR_DAY'];
|
||||
}
|
||||
|
||||
$hoursDuration = (float)$duration;
|
||||
$newDate = $iniDate;
|
||||
|
||||
while ($hoursDuration > 0) {
|
||||
$newDate = $this->dashGetIniDate($newDate, $calendarData);
|
||||
|
||||
$rangeWorkHour = $this->dashGetRangeWorkHours($newDate, $calendarData['BUSINESS_DAY']);
|
||||
$onlyDate = (date('Y-m-d',strtotime($newDate))) . ' ' . $rangeWorkHour['END'];
|
||||
|
||||
if ( (((float)$hoursDuration) >= ((float)$rangeWorkHour['TOTAL'])) ||
|
||||
((strtotime($onlyDate) - strtotime($newDate)) < (((float)$hoursDuration)*3600))
|
||||
) {
|
||||
$secondRes = (float)(strtotime($onlyDate) - strtotime($newDate));
|
||||
$newDate = $onlyDate;
|
||||
$hoursDuration -= (float)($secondRes/3600);
|
||||
} else {
|
||||
$newDate = date('Y-m-d H:i:s', strtotime('+' . (((float)$hoursDuration)*3600) . ' seconds', strtotime($newDate)));
|
||||
$hoursDuration = 0;
|
||||
}
|
||||
}
|
||||
return $newDate;
|
||||
}
|
||||
|
||||
//Calculate the duration betwen two dates with a calendar
|
||||
public function dashCalculateDurationWithCalendar ($iniDate, $finDate = null, $calendarData = array())
|
||||
{
|
||||
if ((is_null($finDate)) || ($finDate == '')) {
|
||||
$finDate = date('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
$secondDuration = 0.00;
|
||||
|
||||
if ( (strtotime($iniDate)) < (strtotime($finDate)) ) {
|
||||
$timeIniDate = strtotime($iniDate);
|
||||
$timeFinDate = strtotime($finDate);
|
||||
} elseif ( (strtotime($finDate)) < (strtotime($iniDate)) ) {
|
||||
$timeIniDate = strtotime($finDate);
|
||||
$timeFinDate = strtotime($iniDate);
|
||||
$auxDate = $iniDate;
|
||||
$iniDate = $finDate;
|
||||
$finDate = $auxDate;
|
||||
} else {
|
||||
return $secondDuration;
|
||||
}
|
||||
|
||||
$finDate = $this->dashGetIniDate($finDate, $calendarData);
|
||||
$newDate = $iniDate;
|
||||
while ($timeIniDate < $timeFinDate) {
|
||||
$newDate = $this->dashGetIniDate($newDate, $calendarData);
|
||||
|
||||
$rangeWorkHour = $this->dashGetRangeWorkHours($newDate, $calendarData['BUSINESS_DAY']);
|
||||
$onlyDate = (date('Y-m-d',strtotime($newDate))) . ' ' . $rangeWorkHour['END'];
|
||||
|
||||
if ( (strtotime($finDate)) < (strtotime($onlyDate)) ) {
|
||||
$secondRes = ( ((float)strtotime($finDate)) - ((float)strtotime($newDate)) );
|
||||
$timeIniDate = strtotime($finDate);
|
||||
$secondDuration += (float)$secondRes;
|
||||
} else {
|
||||
$secondRes = ( ((float)strtotime($onlyDate)) - ((float)strtotime($newDate)) );
|
||||
$newDate = $onlyDate;
|
||||
$timeIniDate = strtotime($onlyDate);
|
||||
$secondDuration += (float)$secondRes;
|
||||
}
|
||||
}
|
||||
return $secondDuration;
|
||||
}
|
||||
|
||||
public function dashGetIniDate ($iniDate, $calendarData = array())
|
||||
{
|
||||
$flagIniDate = true;
|
||||
|
||||
while ($flagIniDate) {
|
||||
// 1 if it's a work day
|
||||
$weekDay = date('w',strtotime($iniDate));
|
||||
if ( !(in_array($weekDay, $calendarData['CALENDAR_WORK_DAYS_A'])) ) {
|
||||
$iniDate = date('Y-m-d'.' 00:00:00' , strtotime('+1 day', strtotime($iniDate)));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 2 if it's a holiday
|
||||
$iniDateHolidayDay = $this->dashIs_holiday($iniDate, $calendarData['HOLIDAY']);
|
||||
if ($iniDateHolidayDay) {
|
||||
$iniDate = date('Y-m-d'.' 00:00:00' , strtotime('+1 day', strtotime($iniDate)));
|
||||
continue;
|
||||
}
|
||||
|
||||
// 3 if it's work time
|
||||
$workHours = $this->dashNextWorkHours($iniDate, $weekDay, $calendarData['BUSINESS_DAY']);
|
||||
if ( !($workHours['STATUS']) ) {
|
||||
$iniDate = date('Y-m-d'.' 00:00:00' , strtotime('+1 day', strtotime($iniDate)));
|
||||
continue;
|
||||
} else {
|
||||
$iniDate = $workHours['DATE'];
|
||||
}
|
||||
$flagIniDate = false;
|
||||
}
|
||||
|
||||
return $iniDate;
|
||||
}
|
||||
|
||||
public function dashNextWorkHours ($date, $weekDay, $workHours = array())
|
||||
{
|
||||
$auxIniDate = explode(' ', $date);
|
||||
|
||||
$timeDate = $auxIniDate['1'];
|
||||
$timeDate = (float)str_replace(':', '', ((strlen($timeDate) == 8) ? $timeDate : $timeDate.':00') );
|
||||
$nextWorkHours = array();
|
||||
|
||||
$workHoursDay = array();
|
||||
$tempWorkHoursDay = array();
|
||||
|
||||
foreach ($workHours as $value) {
|
||||
if ($value['CALENDAR_BUSINESS_DAY'] == $weekDay) {
|
||||
$rangeWorkHour = array();
|
||||
$timeStart = $value['CALENDAR_BUSINESS_START'];
|
||||
$timeEnd = $value['CALENDAR_BUSINESS_END'];
|
||||
$rangeWorkHour['START'] = ((strlen($timeStart) == 8) ? $timeStart : $timeStart.':00');
|
||||
$rangeWorkHour['END'] = ((strlen($timeEnd) == 8) ? $timeEnd : $timeEnd.':00');
|
||||
|
||||
$workHoursDay[] = $rangeWorkHour;
|
||||
}
|
||||
|
||||
if ($value['CALENDAR_BUSINESS_DAY'] == '7') {
|
||||
$rangeWorkHour = array();
|
||||
$timeStart = $value['CALENDAR_BUSINESS_START'];
|
||||
$timeEnd = $value['CALENDAR_BUSINESS_END'];
|
||||
$rangeWorkHour['START'] = ((strlen($timeStart) == 8) ? $timeStart : $timeStart.':00');
|
||||
$rangeWorkHour['END'] = ((strlen($timeEnd) == 8) ? $timeEnd : $timeEnd.':00');
|
||||
|
||||
$tempWorkHoursDay[] = $rangeWorkHour;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !(count($workHoursDay)) ) {
|
||||
$workHoursDay = $tempWorkHoursDay;
|
||||
}
|
||||
|
||||
$countHours = count($workHoursDay);
|
||||
if ($countHours) {
|
||||
for ($i = 1; $i < $countHours; $i++) {
|
||||
for ($j = 0; $j < $countHours-$i; $j++) {
|
||||
$dataft = (float)str_replace(':', '', $workHoursDay[$j]['START']);
|
||||
$datasc = (float)str_replace(':', '', $workHoursDay[$j+1]['END']);
|
||||
if ($dataft > $datasc) {
|
||||
$aux = $workHoursDay[$j+1];
|
||||
$workHoursDay[$j+1] = $workHoursDay[$j];
|
||||
$workHoursDay[$j] = $aux;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($workHoursDay as $value) {
|
||||
$iniTime = (float)str_replace(':', '', ((strlen($value['START']) == 8) ? $value['START'] : $value['START'].':00'));
|
||||
$finTime = (float)str_replace(':', '', ((strlen($value['END']) == 8) ? $value['END'] : $value['END'].':00'));
|
||||
|
||||
if ( $timeDate <= $iniTime ) {
|
||||
$nextWorkHours['STATUS'] = true;
|
||||
$nextWorkHours['DATE'] = $auxIniDate['0'] . ' ' . ((strlen($value['START']) == 8) ? $value['START'] : $value['START'].':00');
|
||||
return $nextWorkHours;
|
||||
} elseif ( ($iniTime <= $timeDate) && ($timeDate < $finTime) ) {
|
||||
$nextWorkHours['STATUS'] = true;
|
||||
$nextWorkHours['DATE'] = $date;
|
||||
return $nextWorkHours;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$nextWorkHours['STATUS'] = false;
|
||||
return $nextWorkHours;
|
||||
}
|
||||
|
||||
public function dashIs_holiday ($date, $holidays = array())
|
||||
{
|
||||
$auxIniDate = explode(' ', $date);
|
||||
$iniDate = $auxIniDate['0'];
|
||||
$iniDate = strtotime($iniDate);
|
||||
|
||||
foreach ($holidays as $value) {
|
||||
$holidayStartDate = strtotime(date('Y-m-d',strtotime($value['CALENDAR_HOLIDAY_START'])));
|
||||
$holidayEndDate = strtotime(date('Y-m-d',strtotime($value['CALENDAR_HOLIDAY_END'])));
|
||||
|
||||
if ( ($holidayStartDate <= $iniDate) && ($iniDate <= $holidayEndDate) ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function dashGetRangeWorkHours ($date, $workHours)
|
||||
{
|
||||
$auxIniDate = explode(' ', $date);
|
||||
$timeDate = $auxIniDate['1'];
|
||||
$timeDate = (float)str_replace(':', '', ((strlen($timeDate) == 8) ? $timeDate : $timeDate.':00') );
|
||||
$weekDay = date('w',strtotime($date));
|
||||
|
||||
$workHoursDay = array();
|
||||
$tempWorkHoursDay = array();
|
||||
|
||||
foreach ($workHours as $value) {
|
||||
if ($value['CALENDAR_BUSINESS_DAY'] == $weekDay) {
|
||||
$rangeWorkHour = array();
|
||||
$timeStart = $value['CALENDAR_BUSINESS_START'];
|
||||
$timeEnd = $value['CALENDAR_BUSINESS_END'];
|
||||
$rangeWorkHour['START'] = ((strlen($timeStart) == 8) ? $timeStart : $timeStart.':00');
|
||||
$rangeWorkHour['END'] = ((strlen($timeEnd) == 8) ? $timeEnd : $timeEnd.':00');
|
||||
|
||||
$workHoursDay[] = $rangeWorkHour;
|
||||
}
|
||||
|
||||
if ($value['CALENDAR_BUSINESS_DAY'] == '7') {
|
||||
$rangeWorkHour = array();
|
||||
$timeStart = $value['CALENDAR_BUSINESS_START'];
|
||||
$timeEnd = $value['CALENDAR_BUSINESS_END'];
|
||||
$rangeWorkHour['START'] = ((strlen($timeStart) == 8) ? $timeStart : $timeStart.':00');
|
||||
$rangeWorkHour['END'] = ((strlen($timeEnd) == 8) ? $timeEnd : $timeEnd.':00');
|
||||
|
||||
$tempWorkHoursDay[] = $rangeWorkHour;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !(count($workHoursDay)) ) {
|
||||
$workHoursDay = $tempWorkHoursDay;
|
||||
}
|
||||
|
||||
foreach ($workHoursDay as $value) {
|
||||
$iniTime = (float)str_replace(':', '', $value['START']);
|
||||
$finTime = (float)str_replace(':', '', $value['END']);
|
||||
|
||||
if ( ($iniTime <= $timeDate) && ($timeDate <= $finTime) ) {
|
||||
//pr($finTime .' menos '.$iniTime .' = '.($finTime-$iniTime));
|
||||
$value['TOTAL'] = (($finTime-$iniTime)/10000);
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
?>
|
||||
@@ -1792,5 +1792,68 @@ class AppCacheView extends BaseAppCacheView
|
||||
$criteria->addSelectColumn(AppCacheViewPeer::APP_OVERDUE_PERCENTAGE);
|
||||
return $criteria;
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
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());
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -572,5 +572,111 @@ class Application extends BaseApplication
|
||||
|
||||
return $this->getAppUid();
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
public function calculateAppDuration ($cron = 0)
|
||||
{
|
||||
try {
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
}
|
||||
|
||||
$calendar = new calendar();
|
||||
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( ApplicationPeer::APP_UID );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_NUMBER );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_STATUS );
|
||||
$c->addSelectColumn( ApplicationPeer::PRO_UID );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_INIT_USER );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_CUR_USER );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_CREATE_DATE );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_INIT_DATE );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_FINISH_DATE );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_UPDATE_DATE );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_DURATION );
|
||||
$c->addSelectColumn( ApplicationPeer::APP_DELAY_DURATION );
|
||||
$c->addSelectColumn( ProcessPeer::PRO_TIME );
|
||||
$c->addSelectColumn( ProcessPeer::PRO_TIMEUNIT );
|
||||
|
||||
$c->addJoin( ApplicationPeer::PRO_UID, ProcessPeer::PRO_UID, Criteria::LEFT_JOIN );
|
||||
|
||||
$rs = ApplicationPeer::doSelectRS( $c );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
$i = 0;
|
||||
|
||||
$now = strtotime( 'now' );
|
||||
while (is_array( $row )) {
|
||||
$appNumber = $row['APP_NUMBER'];
|
||||
$appStatus = $row['APP_STATUS'];
|
||||
$appInitUser = $row['APP_INIT_USER'];
|
||||
$appCurUser = $row['APP_CUR_USER'];
|
||||
$appCreateDate = $row['APP_CREATE_DATE'];
|
||||
$appInitDate = $row['APP_INIT_DATE'];
|
||||
$appFinishDate = $row['APP_FINISH_DATE'];
|
||||
$appUpdateDate = $row['APP_UPDATE_DATE'];
|
||||
$appDuration = $row['APP_DURATION'];
|
||||
$proTime = $row['PRO_TIME'];
|
||||
$proTimeUnit = $row['PRO_TIMEUNIT'];
|
||||
$proUid = $row['PRO_UID'];
|
||||
|
||||
//get the object,
|
||||
$oApp = ApplicationPeer::retrieveByPk( $row['APP_UID'] );
|
||||
|
||||
//getting the calendar
|
||||
$calendar->getCalendar(null, $proUid);
|
||||
$calData = $calendar->getCalendarData();
|
||||
|
||||
/*if(G::toUpper($proTimeUnit) != 'DAYS'){ //if it is not in days must be in mins.
|
||||
$proTime = $proTime / (24 * 60 * 60); //converting to Days
|
||||
}*/
|
||||
|
||||
$proDueDate = $calendar->dashCalculateDate($row['APP_INIT_DATE'], $proTime, $proTimeUnit, $calData); //date when the process has to finish
|
||||
|
||||
if($appFinishDate == null){//When the process didnt finish yet.
|
||||
//Duration
|
||||
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, date("Y-m-d H:i:s"), $calData );
|
||||
|
||||
|
||||
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns segs.
|
||||
$oApp->setAppDuration( $appDuration );
|
||||
|
||||
//Delay Duration
|
||||
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, date("Y-m-d H:i:s"), $calData );//it returns in mins
|
||||
$delayDuration = $delayDuration / (24 * 60 * 60); //Days
|
||||
$oApp->setAppDelayDuration( $delayDuration );
|
||||
} else {
|
||||
//Duration
|
||||
$appDuration = $calendar->dashCalculateDurationWithCalendar($appInitDate, $appFinishDate, $calData );
|
||||
$appDuration = $appDuration / (24 * 60 * 60); //Saving the proDuration in days. The calculateDurationWithCalendar func returns mins.
|
||||
$oApp->setAppDuration( $appDuration );
|
||||
|
||||
//Delay Duration
|
||||
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $proDueDate, $appFinishDate, $calData );
|
||||
$delayDuration = $delayDuration / (24 * 60 * 60); //Days
|
||||
$oApp->setAppDelayDuration( $delayDuration );
|
||||
}
|
||||
|
||||
//and finally save the record
|
||||
$RES = $oApp->save();
|
||||
$rs->next();
|
||||
$row = $rs->getRow();
|
||||
}
|
||||
|
||||
if ($cron == 1) {
|
||||
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
|
||||
$arrayCron["processcTimeStart"] = time();
|
||||
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
|
||||
}
|
||||
} catch (Exception $oError) {
|
||||
error_log( $oError->getMessage() );
|
||||
}
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
}
|
||||
|
||||
|
||||
@@ -1,104 +1,108 @@
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'APPLICATION' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class ApplicationMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.ApplicationMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('APPLICATION');
|
||||
$tMap->setPhpName('Application');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_PROC_STATUS', 'AppProcStatus', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('APP_PROC_CODE', 'AppProcCode', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('APP_PARALLEL', 'AppParallel', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_INIT_USER', 'AppInitUser', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_CUR_USER', 'AppCurUser', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('APP_INIT_DATE', 'AppInitDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('APP_DATA', 'AppData', 'string', CreoleTypes::LONGVARCHAR, true, null);
|
||||
|
||||
$tMap->addColumn('APP_PIN', 'AppPin', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addValidator('APP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'DRAFT|TO_DO|PAUSED|COMPLETED|CANCELLED', 'Please select a valid status.');
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ApplicationMapBuilder
|
||||
<?php
|
||||
|
||||
require_once 'propel/map/MapBuilder.php';
|
||||
include_once 'creole/CreoleTypes.php';
|
||||
|
||||
|
||||
/**
|
||||
* This class adds structure of 'APPLICATION' table to 'workflow' DatabaseMap object.
|
||||
*
|
||||
*
|
||||
*
|
||||
* These statically-built map classes are used by Propel to do runtime db structure discovery.
|
||||
* For example, the createSelectSql() method checks the type of a given column used in an
|
||||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
|
||||
* (i.e. if it's a text column type).
|
||||
*
|
||||
* @package workflow.classes.model.map
|
||||
*/
|
||||
class ApplicationMapBuilder
|
||||
{
|
||||
|
||||
/**
|
||||
* The (dot-path) name of this class
|
||||
*/
|
||||
const CLASS_NAME = 'classes.model.map.ApplicationMapBuilder';
|
||||
|
||||
/**
|
||||
* The database map.
|
||||
*/
|
||||
private $dbMap;
|
||||
|
||||
/**
|
||||
* Tells us if this DatabaseMapBuilder is built so that we
|
||||
* don't have to re-build it every time.
|
||||
*
|
||||
* @return boolean true if this DatabaseMapBuilder is built, false otherwise.
|
||||
*/
|
||||
public function isBuilt()
|
||||
{
|
||||
return ($this->dbMap !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the databasemap this map builder built.
|
||||
*
|
||||
* @return the databasemap
|
||||
*/
|
||||
public function getDatabaseMap()
|
||||
{
|
||||
return $this->dbMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* The doBuild() method builds the DatabaseMap
|
||||
*
|
||||
* @return void
|
||||
* @throws PropelException
|
||||
*/
|
||||
public function doBuild()
|
||||
{
|
||||
$this->dbMap = Propel::getDatabaseMap('workflow');
|
||||
|
||||
$tMap = $this->dbMap->addTable('APPLICATION');
|
||||
$tMap->setPhpName('Application');
|
||||
|
||||
$tMap->setUseIdGenerator(false);
|
||||
|
||||
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_NUMBER', 'AppNumber', 'int', CreoleTypes::INTEGER, true, null);
|
||||
|
||||
$tMap->addColumn('APP_PARENT', 'AppParent', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_STATUS', 'AppStatus', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('PRO_UID', 'ProUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_PROC_STATUS', 'AppProcStatus', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('APP_PROC_CODE', 'AppProcCode', 'string', CreoleTypes::VARCHAR, true, 100);
|
||||
|
||||
$tMap->addColumn('APP_PARALLEL', 'AppParallel', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_INIT_USER', 'AppInitUser', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_CUR_USER', 'AppCurUser', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_CREATE_DATE', 'AppCreateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('APP_INIT_DATE', 'AppInitDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('APP_FINISH_DATE', 'AppFinishDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||
|
||||
$tMap->addColumn('APP_UPDATE_DATE', 'AppUpdateDate', 'int', CreoleTypes::TIMESTAMP, true, null);
|
||||
|
||||
$tMap->addColumn('APP_DATA', 'AppData', 'string', CreoleTypes::LONGVARCHAR, true, null);
|
||||
|
||||
$tMap->addColumn('APP_PIN', 'AppPin', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||
|
||||
$tMap->addColumn('APP_DURATION', 'AppDuration', 'double', CreoleTypes::DOUBLE, false, null);
|
||||
|
||||
$tMap->addColumn('APP_DELAY_DURATION', 'AppDelayDuration', 'double', CreoleTypes::DOUBLE, false, null);
|
||||
|
||||
$tMap->addValidator('APP_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'DRAFT|TO_DO|PAUSED|COMPLETED|CANCELLED', 'Please select a valid status.');
|
||||
|
||||
} // doBuild()
|
||||
|
||||
} // ApplicationMapBuilder
|
||||
@@ -130,6 +130,10 @@ class UsersMapBuilder
|
||||
$tMap->addColumn('USR_TOTAL_COMPLETED', 'UsrTotalCompleted', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_TOTAL_UNASSIGNED', 'UsrTotalUnassigned', 'int', CreoleTypes::INTEGER, false, null);
|
||||
|
||||
$tMap->addColumn('USR_COST_BY_HOUR', 'UsrCostByHour', 'double', CreoleTypes::DOUBLE, false, 11,2);
|
||||
|
||||
$tMap->addColumn('USR_UNIT_COST', 'UsrUnitCost', 'string', CreoleTypes::VARCHAR, false, 50);
|
||||
|
||||
$tMap->addValidator('USR_STATUS', 'validValues', 'propel.validator.ValidValuesValidator', 'ACTIVE|INACTIVE|VACATION|CLOSED', 'Please select a valid type.');
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -183,6 +183,17 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
*/
|
||||
protected $usr_ux = 'NORMAL';
|
||||
|
||||
/**
|
||||
* The value for the usr_cost_by_hour field.
|
||||
* @var double
|
||||
*/
|
||||
protected $usr_cost_by_hour = 0;
|
||||
|
||||
/**
|
||||
* The value for the usr_unit_cost field.
|
||||
* @var string
|
||||
*/
|
||||
protected $usr_unit_cost = '';
|
||||
/**
|
||||
* The value for the usr_total_inbox field.
|
||||
* @var int
|
||||
@@ -608,6 +619,28 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
|
||||
return $this->usr_ux;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [usr_cost_by_hour] column value.
|
||||
*
|
||||
* @return double
|
||||
*/
|
||||
public function getUsrCostByHour()
|
||||
{
|
||||
|
||||
return $this->usr_cost_by_hour;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [usr_unit_cost] column value.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getUsrUnitCost()
|
||||
{
|
||||
|
||||
return $this->usr_unit_cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the [usr_total_inbox] column value.
|
||||
@@ -1286,6 +1319,44 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
|
||||
} // setUsrUx()
|
||||
|
||||
/**
|
||||
* Set the value of [usr_cost_by_hour] column.
|
||||
*
|
||||
* @param double $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setUsrCostByHour($v)
|
||||
{
|
||||
|
||||
if ($this->usr_cost_by_hour !== $v || $v === 0) {
|
||||
$this->usr_cost_by_hour = $v;
|
||||
$this->modifiedColumns[] = UsersPeer::USR_COST_BY_HOUR;
|
||||
}
|
||||
|
||||
} // setUsrCostByHour()
|
||||
|
||||
/**
|
||||
* Set the value of [usr_unit_cost] column.
|
||||
*
|
||||
* @param string $v new value
|
||||
* @return void
|
||||
*/
|
||||
public function setUsrUnitCost($v)
|
||||
{
|
||||
|
||||
// Since the native PHP type for this column is string,
|
||||
// we will cast the input to a string (if it is not).
|
||||
if ($v !== null && !is_string($v)) {
|
||||
$v = (string) $v;
|
||||
}
|
||||
|
||||
if ($this->usr_unit_cost !== $v || $v === '') {
|
||||
$this->usr_unit_cost = $v;
|
||||
$this->modifiedColumns[] = UsersPeer::USR_UNIT_COST;
|
||||
}
|
||||
|
||||
} // setUsrUnitCost()
|
||||
|
||||
/**
|
||||
* Set the value of [usr_total_inbox] column.
|
||||
*
|
||||
@@ -1509,6 +1580,10 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
|
||||
$this->usr_ux = $rs->getString($startcol + 25);
|
||||
|
||||
$this->usr_cost_by_hour = $rs->getFloat($startcol + 26);
|
||||
|
||||
$this->usr_unit_cost = $rs->getString($startcol + 27);
|
||||
|
||||
$this->usr_total_inbox = $rs->getInt($startcol + 26);
|
||||
|
||||
$this->usr_total_draft = $rs->getInt($startcol + 27);
|
||||
@@ -1528,7 +1603,7 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
$this->setNew(false);
|
||||
|
||||
// FIXME - using NUM_COLUMNS may be clearer.
|
||||
return $startcol + 33; // 33 = UsersPeer::NUM_COLUMNS - UsersPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
return $startcol + 35; // 35 = UsersPeer::NUM_COLUMNS - UsersPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||
|
||||
} catch (Exception $e) {
|
||||
throw new PropelException("Error populating Users object", $e);
|
||||
@@ -1831,6 +1906,12 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
case 32:
|
||||
return $this->getUsrTotalUnassigned();
|
||||
break;
|
||||
case 33:
|
||||
return $this->getUsrCostByHour();
|
||||
break;
|
||||
case 34:
|
||||
return $this->getUsrUnitCost();
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
break;
|
||||
@@ -1884,6 +1965,8 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
$keys[30] => $this->getUsrTotalPaused(),
|
||||
$keys[31] => $this->getUsrTotalCompleted(),
|
||||
$keys[32] => $this->getUsrTotalUnassigned(),
|
||||
$keys[33] => $this->getUsrCostByHour(),
|
||||
$keys[34] => $this->getUsrUnitCost(),
|
||||
);
|
||||
return $result;
|
||||
}
|
||||
@@ -2014,6 +2097,12 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
case 32:
|
||||
$this->setUsrTotalUnassigned($value);
|
||||
break;
|
||||
case 26:
|
||||
$this->setUsrCostByHour($value);
|
||||
break;
|
||||
case 27:
|
||||
$this->setUsrUnitCost($value);
|
||||
break;
|
||||
} // switch()
|
||||
}
|
||||
|
||||
@@ -2169,6 +2258,14 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
$this->setUsrTotalUnassigned($arr[$keys[32]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[33], $arr)) {
|
||||
$this->setUsrCostByHour($arr[$keys[26]]);
|
||||
}
|
||||
|
||||
if (array_key_exists($keys[34], $arr)) {
|
||||
$this->setUsrUnitCost($arr[$keys[27]]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2312,6 +2409,13 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
$criteria->add(UsersPeer::USR_TOTAL_UNASSIGNED, $this->usr_total_unassigned);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(UsersPeer::USR_COST_BY_HOUR)) {
|
||||
$criteria->add(UsersPeer::USR_COST_BY_HOUR, $this->usr_cost_by_hour);
|
||||
}
|
||||
|
||||
if ($this->isColumnModified(UsersPeer::USR_UNIT_COST)) {
|
||||
$criteria->add(UsersPeer::USR_UNIT_COST, $this->usr_unit_cost);
|
||||
}
|
||||
|
||||
return $criteria;
|
||||
}
|
||||
@@ -2429,7 +2533,10 @@ abstract class BaseUsers extends BaseObject implements Persistent
|
||||
$copyObj->setUsrTotalCompleted($this->usr_total_completed);
|
||||
|
||||
$copyObj->setUsrTotalUnassigned($this->usr_total_unassigned);
|
||||
|
||||
|
||||
$copyObj->setUsrCostByHour($this->usr_cost_by_hour);
|
||||
|
||||
$copyObj->setUsrUnitCost($this->usr_unit_cost);
|
||||
|
||||
$copyObj->setNew(true);
|
||||
|
||||
|
||||
@@ -1476,6 +1476,8 @@
|
||||
<column name="USR_TOTAL_PAUSED" type="INTEGER" default="0"/>
|
||||
<column name="USR_TOTAL_COMPLETED" type="INTEGER" default="0"/>
|
||||
<column name="USR_TOTAL_UNASSIGNED" type="INTEGER" default="0"/>
|
||||
<column name="USR_COST_BY_HOUR" type="DOUBLE" size="11,2" required="false" default="0"/>
|
||||
<column name="USR_UNIT_COST" type="VARCHAR" size="50" required="false" default=""/>
|
||||
<validator column="USR_STATUS">
|
||||
<rule name="validValues" value="ACTIVE|INACTIVE|VACATION|CLOSED" message="Please select a valid type."/>
|
||||
<rule name="required" message="Type is required."/>
|
||||
@@ -4816,5 +4818,217 @@
|
||||
</vendor>
|
||||
</column>
|
||||
</table>
|
||||
|
||||
<table name="USR_REPORTING">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Name" value="USR_REPORTING" />
|
||||
<parameter name="Engine" value="InnoDB" />
|
||||
<parameter name="Version" value="10" />
|
||||
<parameter name="Row_format" value="Dynamic" />
|
||||
<parameter name="Data_free" value="0" />
|
||||
<parameter name="Auto_increment" value="" />
|
||||
<parameter name="Check_time" value="" />
|
||||
<parameter name="Collation" value="utf8_general_ci" />
|
||||
<parameter name="Checksum" value="" />
|
||||
<parameter name="Create_options" value="" />
|
||||
<parameter name="Comment" value="Data calculated users by task"/>
|
||||
</vendor>
|
||||
<column name="USR_UID" type="VARCHAR" size="32" required="true" primaryKey="true" />
|
||||
<column name="TAS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" />
|
||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" />
|
||||
<column name="MONTH" type="INTEGER" required="true" default="0" primaryKey="true" />
|
||||
<column name="YEAR" type="INTEGER" required="true" default="0" primaryKey="true" />
|
||||
<column name="TOTAL_TIME_BY_TASK" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_IN" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_OUT" type="DECIMAL" size="7,2"/>
|
||||
<column name="USER_HOUR_COST" type="DECIMAL" size="7,2"/>
|
||||
<column name="AVG_TIME" type="DECIMAL" size="7,2"/>
|
||||
<column name="SDV_TIME" type="DECIMAL" size="7,2"/>
|
||||
<column name="CONFIGURED_TASK_TIME" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_OVERDUE" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_ON_TIME" type="DECIMAL" size="7,2"/>
|
||||
<index name="indexReporting">
|
||||
<index-column name="USR_UID"/>
|
||||
<index-column name="TAS_UID"/>
|
||||
<index-column name="PRO_UID"/>
|
||||
<vendor type="mysql">
|
||||
<parameter name="Table" value="USR_REPORTING"/>
|
||||
<parameter name="Non_unique" value="1"/>
|
||||
<parameter name="Key_name" value="indexReporting"/>
|
||||
<parameter name="Seq_in_index" value="1"/>
|
||||
<parameter name="Column_name" value="USR_UID"/>
|
||||
<parameter name="Collation" value="A"/>
|
||||
<parameter name="Cardinality" value=""/>
|
||||
<parameter name="Sub_part" value=""/>
|
||||
<parameter name="Packed" value=""/>
|
||||
<parameter name="Null" value=""/>
|
||||
<parameter name="Index_type" value="BTREE"/>
|
||||
<parameter name="Comment" value=""/>
|
||||
</vendor>
|
||||
</index>
|
||||
</table>
|
||||
|
||||
<table name="PRO_REPORTING">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Name" value="PRO_REPORTING" />
|
||||
<parameter name="Engine" value="InnoDB" />
|
||||
<parameter name="Version" value="10" />
|
||||
<parameter name="Row_format" value="Dynamic" />
|
||||
<parameter name="Data_free" value="0" />
|
||||
<parameter name="Auto_increment" value="" />
|
||||
<parameter name="Check_time" value="" />
|
||||
<parameter name="Collation" value="utf8_general_ci" />
|
||||
<parameter name="Checksum" value="" />
|
||||
<parameter name="Create_options" value="" />
|
||||
<parameter name="Comment" value="Data calculated by process"/>
|
||||
</vendor>
|
||||
<column name="PRO_UID" type="VARCHAR" size="32" required="true" primaryKey="true" />
|
||||
<column name="MONTH" type="INTEGER" required="true" default="0" primaryKey="true" />
|
||||
<column name="YEAR" type="INTEGER" required="true" default="0" primaryKey="true" />
|
||||
<column name="AVG_TIME" type="DECIMAL" size="7,2"/>
|
||||
<column name="SDV_TIME" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_IN" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_OUT" type="DECIMAL" size="7,2"/>
|
||||
<column name="CONFIGURED_PROCESS_TIME" type="DECIMAL" size="7,2"/>
|
||||
<column name="CONFIGURED_PROCESS_COST" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_OPEN" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_OVERDUE" type="DECIMAL" size="7,2"/>
|
||||
<column name="TOTAL_CASES_ON_TIME" type="DECIMAL" size="7,2"/>
|
||||
</table>
|
||||
|
||||
<table name="DASHBOARD">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Name" value="DASHBOARD" />
|
||||
<parameter name="Engine" value="InnoDB" />
|
||||
<parameter name="Version" value="10" />
|
||||
<parameter name="Row_format" value="Dynamic" />
|
||||
<parameter name="Data_free" value="0" />
|
||||
<parameter name="Auto_increment" value="" />
|
||||
<parameter name="Check_time" value="" />
|
||||
<parameter name="Collation" value="utf8_general_ci" />
|
||||
<parameter name="Checksum" value="" />
|
||||
<parameter name="Create_options" value="" />
|
||||
<parameter name="Comment" value="Dashboard definitions."/>
|
||||
</vendor>
|
||||
<column name="DAS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
||||
<column name="DAS_TITLE" type="VARCHAR" size="255" required="true" default="" />
|
||||
<column name="DAS_DESCRIPTION" type="LONGVARCHAR" required="false" />
|
||||
<column name="DAS_CREATE_DATE" type="TIMESTAMP" required="true" />
|
||||
<column name="DAS_UPDATE_DATE" type="TIMESTAMP" required="false" />
|
||||
<column name="DAS_STATUS" type="TINYINT" required="true" default="1"/>
|
||||
</table>
|
||||
|
||||
<table name="DASHBOARD_INDICATOR">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Name" value="DASHBOARD_INDICATOR" />
|
||||
<parameter name="Engine" value="InnoDB" />
|
||||
<parameter name="Version" value="10" />
|
||||
<parameter name="Row_format" value="Dynamic" />
|
||||
<parameter name="Data_free" value="0" />
|
||||
<parameter name="Auto_increment" value="" />
|
||||
<parameter name="Check_time" value="" />
|
||||
<parameter name="Collation" value="utf8_general_ci" />
|
||||
<parameter name="Checksum" value="" />
|
||||
<parameter name="Create_options" value="" />
|
||||
<parameter name="Comment" value="Dashboard Indicators definitions."/>
|
||||
</vendor>
|
||||
<column name="DAS_IND_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="" />
|
||||
<column name="DAS_UID" type="VARCHAR" size="32" required="true" default="" />
|
||||
<column name="DAS_IND_TYPE" type="VARCHAR" size="32" required="true" default="" />
|
||||
<column name="DAS_IND_TITLE" type="VARCHAR" size="255" required="true" default="" />
|
||||
<column name="DAS_IND_GOAL" type="DECIMAL" size="7,2" required="true" />
|
||||
<column name="DAS_IND_DIRECTION" type="TINYINT" required="true" default="2"/>
|
||||
<column name="DAS_UID_PROCESS" type="VARCHAR" size="32" required="true" default="" />
|
||||
<column name="DAS_IND_FIRST_FIGURE" type="VARCHAR" size="32" required="false" default="" />
|
||||
<column name="DAS_IND_FIRST_FREQUENCY" type="VARCHAR" size="32" required="false" default="" />
|
||||
<column name="DAS_IND_SECOND_FIGURE" type="VARCHAR" size="32" required="false" default="" />
|
||||
<column name="DAS_IND_SECOND_FREQUENCY" type="VARCHAR" size="32" required="false" default="" />
|
||||
<column name="DAS_IND_CREATE_DATE" type="TIMESTAMP" required="true" />
|
||||
<column name="DAS_IND_UPDATE_DATE" type="TIMESTAMP" required="false" />
|
||||
<column name="DAS_IND_STATUS" type="TINYINT" required="true" default="1"/>
|
||||
<foreign-key name="fk_dashboard_indicator_dashboard" foreignTable="DASHBOARD">
|
||||
<reference local="DAS_UID" foreign="DAS_UID"/>
|
||||
</foreign-key>
|
||||
<index name="indexDashboard">
|
||||
<index-column name="DAS_UID"/>
|
||||
<index-column name="DAS_IND_TYPE"/>
|
||||
<vendor type="mysql">
|
||||
<parameter name="Table" value="DASHBOARD_INDICATOR"/>
|
||||
<parameter name="Non_unique" value="1"/>
|
||||
<parameter name="Key_name" value="indexDashboard"/>
|
||||
<parameter name="Seq_in_index" value="1"/>
|
||||
<parameter name="Column_name" value="DAS_UID"/>
|
||||
<parameter name="Collation" value="A"/>
|
||||
<parameter name="Cardinality" value=""/>
|
||||
<parameter name="Sub_part" value=""/>
|
||||
<parameter name="Packed" value=""/>
|
||||
<parameter name="Null" value=""/>
|
||||
<parameter name="Index_type" value="BTREE"/>
|
||||
<parameter name="Comment" value=""/>
|
||||
</vendor>
|
||||
</index>
|
||||
</table>
|
||||
|
||||
<table name="DASHBOARD_DAS_IND">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Name" value="DASHBOARD_DAS_IND" />
|
||||
<parameter name="Engine" value="InnoDB" />
|
||||
<parameter name="Version" value="10" />
|
||||
<parameter name="Row_format" value="Dynamic" />
|
||||
<parameter name="Data_free" value="0" />
|
||||
<parameter name="Auto_increment" value="" />
|
||||
<parameter name="Check_time" value="" />
|
||||
<parameter name="Collation" value="utf8_general_ci" />
|
||||
<parameter name="Checksum" value="" />
|
||||
<parameter name="Create_options" value="" />
|
||||
<parameter name="Comment" value="Dashboard definitions to user."/>
|
||||
</vendor>
|
||||
<column name="DAS_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||
<column name="OWNER_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
||||
<column name="OWNER_TYPE" type="VARCHAR" size="15" required="true" default=""/>
|
||||
<foreign-key name="fk_dashboard_indicator_dashboard_das_ind" foreignTable="DASHBOARD">
|
||||
<reference local="DAS_UID" foreign="DAS_UID"/>
|
||||
</foreign-key>
|
||||
</table>
|
||||
|
||||
<table name="CATALOG">
|
||||
<vendor type="mysql">
|
||||
<parameter name="Name" value="CATALOG" />
|
||||
<parameter name="Engine" value="InnoDB" />
|
||||
<parameter name="Version" value="10" />
|
||||
<parameter name="Row_format" value="Dynamic" />
|
||||
<parameter name="Data_free" value="0" />
|
||||
<parameter name="Auto_increment" value="" />
|
||||
<parameter name="Check_time" value="" />
|
||||
<parameter name="Collation" value="utf8_general_ci" />
|
||||
<parameter name="Checksum" value="" />
|
||||
<parameter name="Create_options" value="" />
|
||||
<parameter name="Comment" value="Definitions catalog."/>
|
||||
</vendor>
|
||||
<column name="CAT_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default="0"/>
|
||||
<column name="CAT_LABEL_ID" type="VARCHAR" size="100" required="true" default=""/>
|
||||
<column name="CAT_TYPE" type="VARCHAR" size="100" required="true" primaryKey="true" default=""/>
|
||||
<column name="CAT_FLAG" type="VARCHAR" size="50" required="false" default=""/>
|
||||
<column name="CAT_OBSERVATION" type="LONGVARCHAR" required="false" default=""/>
|
||||
<column name="CAT_CREATE_DATE" type="TIMESTAMP" required="true" />
|
||||
<column name="CAT_UPDATE_DATE" type="TIMESTAMP" required="false" />
|
||||
<index name="indexType">
|
||||
<index-column name="CAT_TYPE"/>
|
||||
<vendor type="mysql">
|
||||
<parameter name="Table" value="CATALOG"/>
|
||||
<parameter name="Non_unique" value="1"/>
|
||||
<parameter name="Key_name" value="indexDashboard"/>
|
||||
<parameter name="Seq_in_index" value="1"/>
|
||||
<parameter name="Column_name" value="CAT_TYPE"/>
|
||||
<parameter name="Collation" value="A"/>
|
||||
<parameter name="Cardinality" value=""/>
|
||||
<parameter name="Sub_part" value=""/>
|
||||
<parameter name="Packed" value=""/>
|
||||
<parameter name="Null" value=""/>
|
||||
<parameter name="Index_type" value="BTREE"/>
|
||||
<parameter name="Comment" value=""/>
|
||||
</vendor>
|
||||
</index>
|
||||
</table>
|
||||
</database>
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,57 +1,66 @@
|
||||
<?php
|
||||
/**
|
||||
* processmaker.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*************************************
|
||||
* ---= Processmaker main menu=---
|
||||
*************************************/
|
||||
|
||||
global $G_TMP_MENU;
|
||||
global $RBAC;
|
||||
|
||||
// HOME MODULE
|
||||
if ($RBAC->userCanAccess('PM_CASES') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES', 'cases/main', G::LoadTranslation('ID_HOME'), '', '', '', 'x-pm-home');
|
||||
}
|
||||
|
||||
// DESIGNER MODULE
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1 ) {
|
||||
$G_TMP_MENU->AddIdRawOption('PROCESSES', 'processes/main', G::LoadTranslation('ID_DESIGNER'), '', '', '', 'x-pm-designer');
|
||||
}
|
||||
|
||||
// DASHBOARD MODULE
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD', 'dashboard/main', G::LoadTranslation('ID_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
|
||||
// ADMIN MODULE
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('SETUP', 'setup/main', G::LoadTranslation('ID_SETUP'), '', '', '', 'x-pm-setup');
|
||||
}
|
||||
|
||||
// PLUGINS MENUS
|
||||
if( file_exists(PATH_CORE . 'menus/plugin.php') ) {
|
||||
require_once(PATH_CORE . 'menus/plugin.php');
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* processmaker.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*************************************
|
||||
* ---= Processmaker main menu=---
|
||||
*************************************/
|
||||
|
||||
global $G_TMP_MENU;
|
||||
global $RBAC;
|
||||
|
||||
// HOME MODULE
|
||||
if ($RBAC->userCanAccess('PM_CASES') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('CASES', 'cases/main', G::LoadTranslation('ID_HOME'), '', '', '', 'x-pm-home');
|
||||
}
|
||||
|
||||
// DESIGNER MODULE
|
||||
if ($RBAC->userCanAccess('PM_FACTORY') == 1 ) {
|
||||
$G_TMP_MENU->AddIdRawOption('PROCESSES', 'processes/main', G::LoadTranslation('ID_DESIGNER'), '', '', '', 'x-pm-designer');
|
||||
}
|
||||
|
||||
// DASHBOARD MODULE
|
||||
if ($RBAC->userCanAccess('PM_DASHBOARD') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD', 'dashboard/main', G::LoadTranslation('ID_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
|
||||
// ADMIN MODULE
|
||||
if ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1) {
|
||||
$G_TMP_MENU->AddIdRawOption('SETUP', 'setup/main', G::LoadTranslation('ID_SETUP'), '', '', '', 'x-pm-setup');
|
||||
}
|
||||
|
||||
/*----------------------------------********---------------------------------*/
|
||||
// NEW DASHBOARD MODULE
|
||||
$licensedFeatures = & PMLicensedFeatures::getSingleton();
|
||||
if ($licensedFeatures->verifyfeature('bvZTnIraUhCSXIxNEVOcGluVVR6Y3E3NStiMW9tWU54aU5tb0FrRnJ0MXMzLzRWMHZtakJIN3dRPT0=') && ($RBAC->userCanAccess('PM_SETUP') == 1 || $RBAC->userCanAccess('PM_USERS') == 1)) {
|
||||
$G_TMP_MENU->AddIdRawOption('DASHBOARD+', 'strategicDashboard/main', G::LoadTranslation('ID_DASHBOARD'), '', '', '', 'x-pm-dashboard');
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
|
||||
// PLUGINS MENUS
|
||||
if( file_exists(PATH_CORE . 'menus/plugin.php') ) {
|
||||
require_once(PATH_CORE . 'menus/plugin.php');
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -103,3 +103,9 @@ debug = 1
|
||||
|
||||
[alias: consolidated]
|
||||
list = "ProcessMaker\Services\Api\Consolidated"
|
||||
|
||||
[alias: dashboard]
|
||||
dashboard = "ProcessMaker\Services\Api\Dashboard"
|
||||
|
||||
[alias: catalog]
|
||||
dashboard = "ProcessMaker\Services\Api\Catalog"
|
||||
|
||||
Reference in New Issue
Block a user