implements filter_actors hook

This commit is contained in:
Alexandre Delaunay
2022-01-10 11:13:15 +01:00
committed by GitHub
parent 4f6d2291e3
commit 44fe7d6b57
2 changed files with 22 additions and 2 deletions

View File

@ -686,3 +686,19 @@ function plugin_example_infocom_hook($params) {
echo __("Plugin example displays on central page", "example");
echo "</th></tr>";
}
function plugin_example_filter_actors(array $params = []): array {
$itemtype = $params['params']['itemtype'];
$items_id = $params['params']['items_id'];
// remove users_id = 1 for assignee list
if ($itemtype == 'Ticket' && $params['params']['actortype'] == 'assign') {
foreach ($params['actors'] as $index => &$actor) {
if ($actor['type'] == 'user' && $actor['items_id'] == 1) {
unset($params['actors'][$index]);
}
}
}
return $params;
}