Text Filters

This section shows you how to create Text Filters.
These Text Filters are applied to Tickets and to Followups at creation and at update time.
They are based on PHP regular expressions (regexp). The regexp filters are case insensitive and unicode.
Ticket Cleaner Plugin internal mechanism is based on preg_replace() PHP function (refer to PHP online help for more details)

Text Filter Types

There are several different types of Text filters:
  • Filter type = 0, for signatures start
  • Filter type = 1, For signature end
  • Filter type = 2, For Ticket and Followup description
  • Filter type = 3, For Ticket title

It's possible to have several different filters for each type, then filters are ordered (with an order number) to define priority inside a type.
It's possible to define if a filter is active or not.
It's possible to set a name and description for each filter.

Let's see Filter Types now:

Text Filter Type 0 and 1

Type 0 is used to define what should be the start of a signature (typically inside emails)
Type 1 is used to define what should be the end of a signature (typically inside emails)
Let's look at an example:

We are going to define two Filters of type 0 and with the following order (or priority):
  1. "Registration number"
  2. "No employee or agent of the company"

The order will be used to set the priority of the start of signature.

And we are going to define only one filter of type 1:
  1. "Any other distribution, use or reproduction is unauthorized and prohibited."

Text Filter Type 2

This type is used to define what replacements should be made inside Tickets and Followups descriptions.
Example: you want to replace three (or more) empty lines by only two...

regexp: "(\\r\\n){3,}"

replacement: "\r\n\r\n"

The order is used to define order of replacements
Example: first replace three (or more) empty lines by two empty lines, and then replace multiple whitespaces (more than two) by only one space.

Text Filter Type 3

This type is used to define what what replacements should be made inside Tickets titles
This type is like type 2 but applied only on Ticket Titles

Live example

These are my own filters as an example:

email_signature__-_Message__HTML__2014-01-28_14-01-07.png (55.5 KB) tomolimo, 01/28/2014 02:08 PM

Prod_glpi.glpi_plugin_ticketcleaner_filters_2014-01-28_14-37-54.png (57.6 KB) tomolimo, 01/28/2014 02:39 PM