Update doc for CLI
This commit is contained in:
@@ -10,6 +10,7 @@ New features:
|
|||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
* Added parameters for overdue tasks notifications: group by projects and send only to managers
|
||||||
* Allow people to install Kanboard outside of the DocumentRoot
|
* Allow people to install Kanboard outside of the DocumentRoot
|
||||||
* Allow plugins to be loaded from another folder
|
* Allow plugins to be loaded from another folder
|
||||||
* Filter/Lexer/QueryBuilder refactoring
|
* Filter/Lexer/QueryBuilder refactoring
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ use Symfony\Component\Console\Command\Command;
|
|||||||
* @property \Kanboard\Model\User $user
|
* @property \Kanboard\Model\User $user
|
||||||
* @property \Kanboard\Model\UserNotification $userNotification
|
* @property \Kanboard\Model\UserNotification $userNotification
|
||||||
* @property \Kanboard\Model\UserNotificationFilter $userNotificationFilter
|
* @property \Kanboard\Model\UserNotificationFilter $userNotificationFilter
|
||||||
|
* @property \Kanboard\Model\ProjectUserRole $projectUserRole
|
||||||
* @property \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher
|
* @property \Symfony\Component\EventDispatcher\EventDispatcher $dispatcher
|
||||||
*/
|
*/
|
||||||
abstract class BaseCommand extends Command
|
abstract class BaseCommand extends Command
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ namespace Kanboard\Console;
|
|||||||
|
|
||||||
use Kanboard\Model\Task;
|
use Kanboard\Model\Task;
|
||||||
use Kanboard\Core\Security\Role;
|
use Kanboard\Core\Security\Role;
|
||||||
use Kanboard\Model\ProjectUserRole;
|
|
||||||
use Symfony\Component\Console\Helper\Table;
|
use Symfony\Component\Console\Helper\Table;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
@@ -24,7 +23,7 @@ class TaskOverdueNotificationCommand extends BaseCommand
|
|||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output)
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
if($input->getOption('group')) {
|
if ($input->getOption('group')) {
|
||||||
$tasks = $this->sendGroupOverdueTaskNotifications();
|
$tasks = $this->sendGroupOverdueTaskNotifications();
|
||||||
} elseif ($input->getOption('manager')) {
|
} elseif ($input->getOption('manager')) {
|
||||||
$tasks = $this->sendOverdueTaskNotificationsToManagers();
|
$tasks = $this->sendOverdueTaskNotificationsToManagers();
|
||||||
@@ -90,8 +89,8 @@ class TaskOverdueNotificationCommand extends BaseCommand
|
|||||||
|
|
||||||
foreach ($this->groupByColumn($tasks, 'project_id') as $project_id => $project_tasks) {
|
foreach ($this->groupByColumn($tasks, 'project_id') as $project_id => $project_tasks) {
|
||||||
$users = $this->userNotification->getUsersWithNotificationEnabled($project_id);
|
$users = $this->userNotification->getUsersWithNotificationEnabled($project_id);
|
||||||
|
|
||||||
$managers = array();
|
$managers = array();
|
||||||
|
|
||||||
foreach ($users as $user) {
|
foreach ($users as $user) {
|
||||||
$role = $this->projectUserRole->getUserRole($project_id, $user['id']);
|
$role = $this->projectUserRole->getUserRole($project_id, $user['id']);
|
||||||
if($role == Role::PROJECT_MANAGER) {
|
if($role == Role::PROJECT_MANAGER) {
|
||||||
@@ -159,7 +158,7 @@ class TaskOverdueNotificationCommand extends BaseCommand
|
|||||||
* Send overdue tasks for a project manager(s)
|
* Send overdue tasks for a project manager(s)
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @param array $user
|
* @param array $manager
|
||||||
* @param array $tasks
|
* @param array $tasks
|
||||||
*/
|
*/
|
||||||
public function sendUserOverdueTaskNotificationsToManagers(array $manager, array $tasks)
|
public function sendUserOverdueTaskNotificationsToManagers(array $manager, array $tasks)
|
||||||
|
|||||||
@@ -119,6 +119,12 @@ Emails will be sent to all users with notifications enabled.
|
|||||||
./kanboard notification:overdue-tasks
|
./kanboard notification:overdue-tasks
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Optional parameters:
|
||||||
|
|
||||||
|
- `--show`: Display notifications sent
|
||||||
|
- `--group`: Group all overdue tasks for one user (from all projects) in one email
|
||||||
|
- `--manager`: Send all overdue tasks to project manager(s) in one email
|
||||||
|
|
||||||
You can also display the overdue tasks with the flag `--show`:
|
You can also display the overdue tasks with the flag `--show`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Reference in New Issue
Block a user