Allow people to remove missing automatic actions
When an automatic action is installed from a plugin, if the plugin is removed the automatic could stay in the database if the user didn't remove manually the automatic action.
This commit is contained in:
@@ -10,6 +10,7 @@ New features:
|
|||||||
|
|
||||||
Improvements:
|
Improvements:
|
||||||
|
|
||||||
|
* Allow people to remove missing automatic actions (installed from a removed plugins)
|
||||||
* Improve task view tables
|
* Improve task view tables
|
||||||
* Simplify automatic actions table
|
* Simplify automatic actions table
|
||||||
* Show category description in tooltip
|
* Show category description in tooltip
|
||||||
|
|||||||
@@ -59,7 +59,8 @@ class ActionCreationController extends BaseController
|
|||||||
$values = $this->request->getValues();
|
$values = $this->request->getValues();
|
||||||
|
|
||||||
if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {
|
if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) {
|
||||||
return $this->create();
|
$this->create();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$action = $this->actionManager->getAction($values['action_name']);
|
$action = $this->actionManager->getAction($values['action_name']);
|
||||||
@@ -72,7 +73,7 @@ class ActionCreationController extends BaseController
|
|||||||
$projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId());
|
$projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId());
|
||||||
unset($projects_list[$project['id']]);
|
unset($projects_list[$project['id']]);
|
||||||
|
|
||||||
return $this->response->html($this->template->render('action_creation/params', array(
|
$this->response->html($this->template->render('action_creation/params', array(
|
||||||
'values' => $values,
|
'values' => $values,
|
||||||
'action_params' => $action_params,
|
'action_params' => $action_params,
|
||||||
'columns_list' => $this->columnModel->getList($project['id']),
|
'columns_list' => $this->columnModel->getList($project['id']),
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Kanboard\Core\Action;
|
namespace Kanboard\Core\Action;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use Kanboard\Core\Base;
|
use Kanboard\Core\Base;
|
||||||
use Kanboard\Action\Base as ActionBase;
|
use Kanboard\Action\Base as ActionBase;
|
||||||
@@ -84,8 +85,12 @@ class ActionManager extends Base
|
|||||||
$params = array();
|
$params = array();
|
||||||
|
|
||||||
foreach ($actions as $action) {
|
foreach ($actions as $action) {
|
||||||
$currentAction = $this->getAction($action['action_name']);
|
try {
|
||||||
$params[$currentAction->getName()] = $currentAction->getActionRequiredParameters();
|
$currentAction = $this->getAction($action['action_name']);
|
||||||
|
$params[$currentAction->getName()] = $currentAction->getActionRequiredParameters();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->logger->error(__METHOD__.': '.$e->getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $params;
|
return $params;
|
||||||
@@ -127,14 +132,18 @@ class ActionManager extends Base
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($actions as $action) {
|
foreach ($actions as $action) {
|
||||||
$listener = clone $this->getAction($action['action_name']);
|
try {
|
||||||
$listener->setProjectId($action['project_id']);
|
$listener = clone $this->getAction($action['action_name']);
|
||||||
|
$listener->setProjectId($action['project_id']);
|
||||||
|
|
||||||
foreach ($action['params'] as $param_name => $param_value) {
|
foreach ($action['params'] as $param_name => $param_value) {
|
||||||
$listener->setParam($param_name, $param_value);
|
$listener->setParam($param_name, $param_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->dispatcher->addListener($action['event_name'], array($listener, 'execute'));
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$this->logger->error(__METHOD__.': '.$e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->dispatcher->addListener($action['event_name'], array($listener, 'execute'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
'Remove this user from group' => 'Enlever cet utilisateur du groupe',
|
'Remove this user from group' => 'Enlever cet utilisateur du groupe',
|
||||||
'Your project must have at least one active swimlane.' => 'Votre projet doit avoir au moins une swimlane active.',
|
'Your project must have at least one active swimlane.' => 'Votre projet doit avoir au moins une swimlane active.',
|
||||||
'Project: %s' => 'Projet : %s',
|
'Project: %s' => 'Projet : %s',
|
||||||
|
'Automatic action not found: "%s"' => 'Action automatique introuvable : « %s »',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1320,4 +1320,5 @@ return array(
|
|||||||
// 'Remove this user from group' => '',
|
// 'Remove this user from group' => '',
|
||||||
// 'Your project must have at least one active swimlane.' => '',
|
// 'Your project must have at least one active swimlane.' => '',
|
||||||
// 'Project: %s' => '',
|
// 'Project: %s' => '',
|
||||||
|
// 'Automatic action not found: "%s"' => '',
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -26,11 +26,18 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?= $this->text->in($action['action_name'], $available_actions) ?>
|
<?php if (! isset($available_params[$action['action_name']])): ?>
|
||||||
|
<?= $this->text->e($action['action_name']) ?>
|
||||||
|
<?php else: ?>
|
||||||
|
<?= $this->text->in($action['action_name'], $available_actions) ?>
|
||||||
|
<?php endif ?>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
<?php if (! isset($available_params[$action['action_name']])): ?>
|
||||||
|
<p class="alert alert-error"><?= t('Automatic action not found: "%s"', $action['action_name']) ?></p>
|
||||||
|
<?php else: ?>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
<li>
|
||||||
<?= t('Event name') ?> =
|
<?= t('Event name') ?> =
|
||||||
@@ -61,6 +68,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
<?php endif ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|||||||
Reference in New Issue
Block a user