Merged in bugfix/PMCORE-2721 (pull request #7747)
PMCORE-2721 Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
@@ -23,11 +23,12 @@ class AbstractCases implements CasesInterface
|
||||
const PRIORITIES = [1 => 'VL', 2 => 'L', 3 => 'N', 4 => 'H', 5 => 'VH'];
|
||||
// Task Colors
|
||||
const TASK_COLORS = [1 => 'green', 2 => 'red', 3 => 'orange', 4 => 'blue', 5 => 'gray'];
|
||||
const COLOR_OVERDUE = 1;
|
||||
const COLOR_ON_TIME = 2;
|
||||
const COLOR_DRAFT = 3;
|
||||
const COLOR_PAUSED = 4;
|
||||
const COLOR_UNASSIGNED = 5;
|
||||
const TASK_STATUS = [1 => 'ON_TIME', 2 => 'OVERDUE', 3 => 'DRAFT', 4 => 'PAUSED', 5 => 'UNASSIGNED'];
|
||||
const COLOR_ON_TIME = 1; // green
|
||||
const COLOR_OVERDUE = 2; // red
|
||||
const COLOR_DRAFT = 3; // orange
|
||||
const COLOR_PAUSED = 4; // blue
|
||||
const COLOR_UNASSIGNED = 5; // gray
|
||||
// Status values
|
||||
const STATUS_DRAFT = 1;
|
||||
const STATUS_TODO = 2;
|
||||
@@ -1070,9 +1071,11 @@ class AbstractCases implements CasesInterface
|
||||
{
|
||||
$currentDate = new DateTime('now');
|
||||
$dueDate = new DateTime($dueDate);
|
||||
if ($dueDate > $currentDate) {
|
||||
if ($currentDate > $dueDate) {
|
||||
// Overdue: When the current date is mayor to the due date of the case
|
||||
$taskColor = self::COLOR_OVERDUE;
|
||||
} else {
|
||||
// OnTime
|
||||
$taskColor = self::COLOR_ON_TIME;
|
||||
if (get_class($this) === Draft::class) {
|
||||
$taskColor = self::COLOR_DRAFT;
|
||||
@@ -1117,6 +1120,7 @@ class AbstractCases implements CasesInterface
|
||||
// Get task color label
|
||||
$threadTasks[$i]['tas_color'] = (!empty($row)) ? $this->getTaskColor($row) : '';
|
||||
$threadTasks[$i]['tas_color_label'] = (!empty($row)) ? self::TASK_COLORS[$threadTasks[$i]['tas_color']] : '';
|
||||
$threadTasks[$i]['tas_status'] = self::TASK_STATUS[$threadTasks[$i]['tas_color']];
|
||||
}
|
||||
// Review if require other information
|
||||
if ($onlyTask) {
|
||||
|
||||
@@ -99,6 +99,7 @@ class Draft extends AbstractCases
|
||||
// Get task color label
|
||||
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
|
||||
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
|
||||
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
|
||||
|
||||
@@ -103,6 +103,7 @@ class Inbox extends AbstractCases
|
||||
// Get task color label
|
||||
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
|
||||
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
|
||||
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
|
||||
|
||||
@@ -183,6 +183,7 @@ class Participated extends AbstractCases
|
||||
$result[$i]['delay'] = getDiffBetweenDates($thread['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
|
||||
$result[$i]['tas_color'] = (!empty($thread['DEL_TASK_DUE_DATE'])) ? $this->getTaskColor($thread['DEL_TASK_DUE_DATE']) : '';
|
||||
$result[$i]['tas_color_label'] = (!empty($result[$i]['tas_color'])) ? self::TASK_COLORS[$result[$i]['tas_color']] : '';
|
||||
$result[$i]['tas_status'] = self::TASK_STATUS[$result[$i]['tas_color']];
|
||||
// Get the user tooltip information
|
||||
$result[$i]['user_tooltip'] = User::getInformation($thread['USR_ID']);
|
||||
$i++;
|
||||
@@ -195,6 +196,7 @@ class Participated extends AbstractCases
|
||||
$result[$i]['delay'] = getDiffBetweenDates($item['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
|
||||
$result[$i]['tas_color'] = (!empty($item['DEL_TASK_DUE_DATE'])) ? $this->getTaskColor($item['DEL_TASK_DUE_DATE']) : '';
|
||||
$result[$i]['tas_color_label'] = (!empty($result[$i]['tas_color'])) ? self::TASK_COLORS[$result[$i]['tas_color']] : '';
|
||||
$result[$i]['tas_status'] = self::TASK_STATUS[$result[$i]['tas_color']];
|
||||
// Get the user tooltip information
|
||||
$result[$i]['user_tooltip'] = User::getInformation($item['USR_ID']);
|
||||
$item['PENDING'] = $result;
|
||||
@@ -216,6 +218,7 @@ class Participated extends AbstractCases
|
||||
$result[$i]['delay'] = getDiffBetweenDates($item['DEL_TASK_DUE_DATE'], date("Y-m-d H:i:s"));
|
||||
$result[$i]['tas_color'] = (!empty($item['DEL_TASK_DUE_DATE'])) ? $this->getTaskColor($item['DEL_TASK_DUE_DATE']) : '';
|
||||
$result[$i]['tas_color_label'] = (!empty($result[$i]['tas_color'])) ? self::TASK_COLORS[$result[$i]['tas_color']] : '';
|
||||
$result[$i]['tas_status'] = self::TASK_STATUS[$result[$i]['tas_color']];
|
||||
// Get the user tooltip information
|
||||
$result[$i]['user_tooltip'] = User::getInformation($item['USR_ID']);
|
||||
$item['PENDING'] = $result;
|
||||
|
||||
@@ -98,6 +98,7 @@ class Paused extends AbstractCases
|
||||
// Get task color label
|
||||
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
|
||||
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
|
||||
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
|
||||
|
||||
@@ -106,8 +106,9 @@ class Unassigned extends AbstractCases
|
||||
$priorityLabel = self::PRIORITIES[$item['DEL_PRIORITY']];
|
||||
$item['DEL_PRIORITY_LABEL'] = G::LoadTranslation("ID_PRIORITY_{$priorityLabel}");
|
||||
// Get task color label
|
||||
$item['TAS_COLOR'] = 1; // green - onTime
|
||||
$item['TAS_COLOR'] = $this->getTaskColor($item['DEL_TASK_DUE_DATE']);
|
||||
$item['TAS_COLOR_LABEL'] = self::TASK_COLORS[$item['TAS_COLOR']];
|
||||
$item['TAS_STATUS'] = self::TASK_STATUS[$item['TAS_COLOR']];
|
||||
// Apply the date format defined in environment
|
||||
$item['DEL_TASK_DUE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_TASK_DUE_DATE']);
|
||||
$item['DEL_DELEGATE_DATE_LABEL'] = applyMaskDateEnvironment($item['DEL_DELEGATE_DATE']);
|
||||
|
||||
Reference in New Issue
Block a user