| | <?php |
| |
|
| | namespace Kanboard\Action; |
| |
|
| | use Kanboard\Model\TaskModel; |
| |
|
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | class TaskAssignColorOnStartDate extends Base |
| | { |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function getDescription() |
| | { |
| | return t('Assign automatically a color when preset start date is reached'); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | public function getCompatibleEvents() |
| | { |
| | return array( |
| | TaskModel::EVENT_DAILY_CRONJOB, |
| | ); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | public function getActionRequiredParameters() |
| | { |
| | return array( |
| | 'color_id' => t('Color'), |
| | ); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | public function getEventRequiredParameters() |
| | { |
| | return array('tasks'); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function doAction(array $data) |
| | { |
| | $results = array(); |
| |
|
| | foreach ($data['tasks'] as $task) { |
| | if ($task['date_started'] <= time() && $task['date_started'] > 0 && $task['color_id'] != $this->getParam('color_id')) { |
| | $values = array( |
| | 'id' => $task['id'], |
| | 'color_id' => $this->getParam('color_id'), |
| | ); |
| | $results[] = $this->taskModificationModel->update($values, false); |
| | } |
| | } |
| |
|
| | return in_array(true, $results, true); |
| | } |
| |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | public function hasRequiredCondition(array $data) |
| | { |
| | return count($data['tasks']) > 0; |
| | } |
| | } |
| |
|