mirror of
https://github.com/pluginsGLPI/example.git
synced 2025-06-28 06:58:43 +02:00
implements filter_actors hook
This commit is contained in:

committed by
GitHub

parent
4f6d2291e3
commit
44fe7d6b57
16
hook.php
16
hook.php
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user