Skip to content

Plugin Development Part 1 Getting Started

Mansur Rahamathullah edited this page Dec 2, 2023 · 6 revisions

Part 1. Getting Started

OSTicket plugins live in the <INSTALL_ROOT>/include/plugins directory.

Each plugin should be placed into its separate folder, for example [INSTALL_ROOT]/include/plugins/myplugin.

There are two files that are necessary for the OSTicket to find your plugin: plugin.php and config.php.

plugin.php

This file contains general description of the plugin. Here is a sample file:

<?php
set_include_path(get_include_path().PATH_SEPARATOR.dirname(__file__).'/include');
return array(
 'xpresstek:equipment', # notrans
 'version' => '0.1',
 'name' => 'Equipment Manager',
 'author' => 'XpressTek',
 'description' => 'Provides equipment asset management capability.',
 'url' => 'http://www.xpresstek.net/osticket/plugins/equipment',
 'plugin' => 'equipment.php:EquipmentPlugin'
);

?>

The

return array(...);

statement is one that we are interested in, most of the items in the array are self explanatory. One interesting thing that we need to change is the:

'plugin' => 'equipment.php:EquipmentPlugin'

line. This is what tells OSTicket the entry point to our plugin. The syntax is 'file name:class name', so in this case our class is EquipmentPlugin and it is defined in equipment.php.


Part 1 Getting Started

Part 2 Configuration Page

Part 3 Plugin Class

Part 4 Staff Panel Links

Part 5 Signals

Part 6 Dispatcher and Routing

Clone this wiki locally