Verified Commit 2d0e01e8 authored by dockx thibault's avatar dockx thibault
Browse files

:sparkles: Feat(Tasks) - Better status and object type

Better Status generated and Object Type reported
Showing with 19 additions and 13 deletions
+19 -13
...@@ -24,39 +24,45 @@ ...@@ -24,39 +24,45 @@
*/ */
class TasksColumn extends Column class TasksColumn extends Column
{ {
// Keep in mind this method is being called for each value.
protected function renderSingleValue (ListingEntry $entry, string $value): string protected function renderSingleValue (ListingEntry $entry, string $value): string
{ {
if ($value == '') { if ($value == '') {
return ' '; return ' ';
} else { } else {
print_r($this->attributes);
switch ($this->attributes[0]) { switch ($this->attributes[0]) {
case 'fdTasksStatus': case 'fdTasksStatus':
return static::filterStatus(); return static::filterStatus($value);
case 'fdTasksMailObject': case 'fdTasksMailObject':
return static::filterType(); return "Mail Object";
default: default:
return parent::renderSingleValue($entry, $value); return parent::renderSingleValue($entry, $value);
} }
} }
} }
static function filterStatus (): string static function filterStatus (int $status = NULL): string
{ {
$status = "test_status"; // A call towards a status map would be interesting here.
return $status; switch ($status) {
} case 1 :
return "Created";
static function filtertype (): string case 2 :
{ return "Processed";
$type ="test_type";
return $type; default :
return "Error Encountered";
}
} }
static function in_array_r($needle, $haystack, $strict = false) // Not used for now
// Find a key value in multi dimensionnal array (multi unknown levels).
static function in_array_r($needle, $haystack, $strict = FALSE)
{ {
foreach ($haystack as $item) { foreach ($haystack as $item) {
if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) { if (($strict ? $item === $needle : $item == $needle) || (is_array($item) && in_array_r($needle, $item, $strict))) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment