Files
GLPI-Plugin-SOC-Case-Manage…/hook.php
2025-05-31 11:05:58 +02:00

74 lines
1.6 KiB
PHP

<?php
/**
* Hook functions for the SOC plugin
*/
/**
* Hook called after a new item has been added
*
* @param CommonDBTM $item
* @return void
*/
function plugin_soc_item_add(CommonDBTM $item) {
// Add actions when a new item is created
}
/**
* Hook called after an item has been updated
*
* @param CommonDBTM $item
* @return void
*/
function plugin_soc_item_update(CommonDBTM $item) {
// Add actions when an item is updated
}
/**
* Hook called after an item has been deleted
*
* @param CommonDBTM $item
* @return void
*/
function plugin_soc_item_delete(CommonDBTM $item) {
// Add actions when an item is deleted
}
/**
* Hook called after an item has been purged
*
* @param CommonDBTM $item
* @return void
*/
function plugin_soc_item_purge(CommonDBTM $item) {
// Add actions when an item is purged
}
/**
* Hook called when displaying the tabs for an item
*
* @param array $params
* @return array
*/
function plugin_soc_getAddSearchOptions($itemtype) {
$options = [];
// Add search options for supported item types
if ($itemtype == 'Ticket' || $itemtype == 'Change') {
$options[9000] = [
'table' => 'glpi_plugin_soc_cases',
'field' => 'name',
'name' => __('SOC Case', 'soc'),
'joinparams' => [
'beforejoin' => [
'table' => $itemtype == 'Ticket' ? 'glpi_plugin_soc_case_tickets' : 'glpi_plugin_soc_case_changes',
'joinparams' => [
'jointype' => 'itemtype_item',
'specific_itemtype' => $itemtype
]
]
]
];
}
return $options;
}