You are not logged in.
Guys, I'm trying to create a plugin so when a ticket is created, I can execute some PHP script.
Even the plugin is installed and activated, idk what I'm doing wrong with my code.
setup.php
<?php
/* setup.php
*/
function plugin_init_aziz()
{
global $PLUGIN_HOOKS;
$PLUGIN_HOOKS['item_add']['aziz'] = 'plugin_item_add_aziz';
$PLUGIN_HOOKS['csrf_compliant']['aziz'] = true;
}
function plugin_version_aziz()
{
return [ 'name' => 'aziz',
'version' => '1.0',
'author' => 'laroussi_aziz',
'license' => 'GPLv2+',
'homepage' => '',
'requirements' => [
'glpi' => [
'min' => '9.3',
'dev' => true
]
]
];
}
function plugin_aziz_check_prerequisites() { return true; }
function plugin_aziz_check_config() { return true; }
function plugin_aziz_install() { return true; }
require_once("hook.php");
?>
hook.php
<?php
/* hook.php */
// After an item is added
function plugin_item_add_aziz()
{
// My PHP script
}
Hope you can help me guys, I will really appreciate it so much I've been struggling with this for weeks
Offline