Skip to content

Commit

Permalink
Update TaskEmailDue.php
Browse files Browse the repository at this point in the history
simplified
  • Loading branch information
creecros authored Dec 6, 2017
1 parent c5104b2 commit db7ecaf
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions Action/TaskEmailDue.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,7 @@ public function getActionRequiredParameters()
*/
public function getEventRequiredParameters()
{
return array(
'tasks',
'task' => array(
'project_id',
'column_id',
'owner_id',
'due_date',
),
);
return array('tasks');

}
/**
Expand All @@ -82,26 +74,26 @@ public function doAction(array $data)

foreach ($data['tasks'] as $task) {
$user = $this->userModel->getById($task['owner_id']);
if (! empty($task['date_due'])) {

$duration = $task['date_due'] - time();
if ($duration < $max) {
if (! empty($user['email'])) {
$results[] = $this->sendEmail($task['id'], $user);
}
}
}

}

foreach ($data['tasks'] as $task) {
$user = $this->userModel->getById($task['creator_id']);
if (! empty($task['date_due'])) {

$duration = $task['date_due'] - time();
if ($duration < $max) {
if (! empty($user['email'])) {

$results[] = $this->sendEmail($task['id'], $user);
}

}
}

}

return in_array(true, $results, true);
Expand Down

0 comments on commit db7ecaf

Please sign in to comment.