You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2021-12-06 02:34:45

aziz
Member
Registered: 2021-03-30
Posts: 109

Plugin created not working even it's activated/installed.

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.

https://ibb.co/BjyD0y5

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

Board footer

Powered by FluxBB