-Configuring the system using the provided config.php file
-Changing the display interface and including other datafields
This project is based around the ticker.php web page. This page provides a display for the work done by the php files.
The config.php file allows various settings within the program to be changed.
Ticket status to be included are provided as a pipe seperated string of values. The order in which they are listed controls the order in which they are displayed on-screen.
The available options to include are:
- Open
- In Progress
- Closed
- On Hold
Its use is not recommended when the Max Ticket variable is not set as it essentially DoS's the site with thousands of http requests.
This variable dictates how often the back-end polls for new tickets or changes to ticket statuses. It is provided as a number in seconds.
A change to the polling time requires the page to be refreshed for the effects to be propagated to the end user.
This controls the order in which the tickets are shown on screen.
It is provided as a string. It dictates whether it is to be sorted by ID or Creation Date.
Other sort methods may be added by editing the sortBy()
method in ticker.class.php to accept other __SORT_METHOD
variables and set $a()
and $b()
accordingly.
The available options are:
- CREATION_DATE
- ID
This controls which departments to exclude tickets from and is provided as pipe seperated string.
There are 22 departments that tickets are pulled from and each may be excluded by providing the department name in this string.
- Other
- Hardware
- Operating Systems
- Issue
- Installation
- BIOS
- Silicon / Processors
- Re-Work
- Networking
- Lab Access Request
- Fault
- Requisition
- Security
- Shipping
- Traffic Generators
- Administration
- WGC
- Hardware [WGC]
- Software [WGC]
- Networking [WGC]
- Shipping [WGC]
- Silicon / Processors [WGC]
The ticker program is designed to allow support for a number of different display interfaces. Each display can be added by creating a new subdirectory in the views folder.
The default format can be specified as the false return value of the ternary logic operator checking $_GET['template']
in the config file.
This means that the template can also be set by appending a get parameter to the url in the format ticker.php?template=old-basic
A display can be added by creating a new folder in views which contains at least the following 5 files.
The header file must contain the required HTML code up to and including the <body>
tag at a minimum.
It is also required to have an include for the javascript file.
Click here to see an example header.txt file used in the basic display view.
The index file contains the template for the viewable webpage.
It contains markup for the inclusion of both the header.txt and the footer.txt.
This is done by placing @<file-name-without-extension>@
at the points in the file where the code should be included.
It also contains the template for each data row of the display. The data will be filled into the placeholders in the form: [<identifier>]
.
The placeholders included by default are:
- [ticketid]
- [user]
- [subject]
- [status]
- [dept]
- [creation]
- [type]
- [class]
Click here to see an example index.txt file used in the basic display view.
The purpose of this file is to return all the updated values of the tickets to the page so changes can be propagated to the viewer.
For that reason, it just consists of all the attributes of each ticket in a string that is seperated by a specific mark-up.
These attributes are seperated in the javascript and passed to the addRow() function or used in the updateRow() function.
Click here to see an example indexsimple.txt file used in the basic display view.
The Kayako API offers access to many fields of a ticket query. For this reason, not all fields are included by default. To include additional fields, changes must be in many parts of the program.
Data is filled into the locations occupied by certain placeholders in the form: [<identifier>]
.
To include other datafields, the html contained within #ticketentry# must be edited to allow for more data to be displayed. This is done using additional placeholders like above.
The relevant CSS must also be adjusted.
Indexsimple must also be adjusted so it returns more datafields to the page.
Again, this is managed by placeholders like those in index.txt.
The callback_ticketlist()
of this class must be changed so that the preg_replace
function calls now act on the new placeholders that have been added to index and indexsimple.
The javascript must be edited to take extra datafields during the string split operations on indexsimple in updateTable()
.
The addRow()
function must also be adapted to match the new HTML/CSS of index.txt and also to include the extra parameters now being passed to it from the additional updateTable()
splits.