From e31078c8f963d857f05f480aea3b201c4002d6eb Mon Sep 17 00:00:00 2001 From: Thibault Dockx <thibault.dockx@fusiondirectory.org> Date: Tue, 17 May 2022 18:52:09 +0100 Subject: [PATCH] :sparkles: Feat(Tasks) - Removes column methods Methods from Task Management have been wiped in order to rework on clean ground. --- plugins/addons/tasks/class_tasksColumn.inc | 41 ++++--------------- .../addons/tasks/class_tasksManagement.inc | 7 ++++ 2 files changed, 15 insertions(+), 33 deletions(-) diff --git a/plugins/addons/tasks/class_tasksColumn.inc b/plugins/addons/tasks/class_tasksColumn.inc index 9849f74f5..66b742233 100644 --- a/plugins/addons/tasks/class_tasksColumn.inc +++ b/plugins/addons/tasks/class_tasksColumn.inc @@ -25,7 +25,6 @@ */ class tasksColumn extends Column - { protected function renderSingleValue (ListingEntry $entry, string $value): string { @@ -36,52 +35,28 @@ class tasksColumn extends Column case 'TYPE': return static::filterTypes(); case 'TIMESTAMP': - return static::filterSchedule($value); + return static::filterSchedule(); case 'STATUS': - return static::filterStatus($entry->row, $value, $entry['SUBSTATUS']); + return static::filterStatus(); default: - return parent::renderSingleValue($entry, $value); + return parent::renderSingleValue(); } } } static function filterTypes (): string { - //A method retriving the type of the tasks. + //A method retrieving the type of the tasks. return ''; } - static function filterSchedule (string $stamp): string + static function filterSchedule (): string { - if ($stamp == '19700101000000') { - return htmlescape(_('immediately')); - } else { - return htmlescape(date('d.m.Y H:i:s', strtotime($stamp))); - } + //A method retrieving the time set by the task } - static function filterStatus (int $row, string $status, string $substatus): string + static function filterStatus (): string { - if ($status == 'waiting') { - $status = '<img class="center" src="geticon.php?context=status&icon=task-waiting&size=16" alt="clock"/> '.htmlescape(_('Waiting')); - } - if ($status == 'error') { - $status = '<input class="center" type="image" src="geticon.php?context=status&icon=task-failure&size=16" title="'.htmlescape(_('Show error')).'" '. - 'name="listing_showError_'.$row.'" style="padding:1px"/>'.htmlescape(_('Error')); - } - if ($status == 'processed') { - $status = '<img class="center" src="geticon.php?context=status&icon=task-complete&size=16" alt=""/> '.htmlescape(_('Processed')); - } - - /* Special handling for all entries that have - STATUS == "processing" && PROGRESS == NUMERIC - */ - if ($status == 'processing' && $substatus) { - $status = $substatus; - } elseif ($status == 'processing') { - $status = preg_replace('/ /', ' ', htmlescape(_('in progress'))); - } - - return $status; + //A method retrieving the status of the task } } diff --git a/plugins/addons/tasks/class_tasksManagement.inc b/plugins/addons/tasks/class_tasksManagement.inc index 6f746aef9..f44badd82 100644 --- a/plugins/addons/tasks/class_tasksManagement.inc +++ b/plugins/addons/tasks/class_tasksManagement.inc @@ -47,4 +47,11 @@ class tasksManagement extends management ]; } + protected function setUpListing () + { + /* Set baseMode to FALSE */ + $this->listing = new managementListing($this, FALSE); + + } + } -- GitLab