mysqli: Allow specification of a unix socket

This patch allows for the specification of a socket in the database hostname
field, such as localhost:/path/to/mysql.sock
Merge pull request #864 from greezybacon/issue/mysqli-local-socket

mysqli: Allow specification of a unix socket

Reviewed-By: Peter Rotich <peter@osticket.com>
orm: Fix serious logic issue in the save() method
Merge pull request #324 from greezybacon/issue/orm-logic-oops

orm: Fix serious logic issue in the save() method

Reviewed-By: Peter Rotich  <peter@osticket.com>
upgrader: Fix 1.6 banlist corruption on upgrade
Update ajax.php

Ensure aquireLock doesn't interfere with renew/release
Merge pull request #335 from clonemeagain/patch-4

Update ajax.php

Reviewed-By: Peter Rotich <peter@osticket.com>
Parses InlineImages for index.php

Otherwise the <img> doesn't get the correct uri for the image.

Reviewed-By: Jared Hancock <jared@osticket.com>
IE8 Fix: SCRIPT1028 - Expected identifier, string or number
Merge pull request #869 from greezybacon/issue/upgrade-banlist-corruption

upgrader: Fix 1.6 banlist corruption on upgrade

Reviewed-By: Peter Rotich <peter@osticket.com>
ui: Fix missing <html> tag for client panel
ui: Add closing div for attached files block

Fixes #356
Honor ticket number in subject line without brackets

We introduced a glitch in 29b3714, which was the patch that introduced
matching on email headers other than the Subject.

I misinterpreted the original `preg_match()` regex, thinking that it was
requiring brackets. Looking at it again today, I see that it didn't. The
current one does, however, require surrounding brackets.

This patch also allows for extra letters or dashes between the `#` and the
ticket number. Eventually we should allow the ticket number itself to have
extra characters -- be formattable.

Fixes osTicket/osTicket-1.8#342
perf: Use a materialized view to speed queue views

This patch introduces an automatic materialized view to speed database
performance when querying and displaying the ticket views. This can
eventually be extended to the search and advanced search features to speed
them as well.

The data from the dynamic form entries related to ticket details is copied
to a %ticket__cdata table. The %ticket__cdata table is then joined directly
to the other tables in the query for the ticket view. MySQL is magically
and dramatically faster using this method.

The downside is that the disk usage for the custom data is doubled, and the
time needed to update the dynamic data is at least doubled as the form
entries and the materialized view must both be updated.

This method should also extend well to other database platforms in the
future. It will be likely that most other database query optimizers will
have difficulty joining, scanning, and sorting the table models we have for
custom data fields.
IE: Fix redactor and IE compatibility view for SCP
Improve advanced search performance

Use a union query to avoid using DISTINCT and lots and lots of joins in the
from clause.

Initial tests seem to indicate about a 80% faster (~500ms down from ~800ms)
on querying about 9k tickets).
Fix up search on dynamic fields

Fix adding fields to an existing form
Merge pull request #873 from greezybacon/issue/subject-ticket-number

Honor ticket number in subject line without brackets

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #368 from greezybacon/issue/ie-compatibility-view

IE: Fix redactor and IE compatibility view for SCP

Reviewed-By: Peter Rotich <peter@osticket.com>
Merge pull request #357 from greezybacon/issue/ticket-queue-performance

perf: Use a materialized view to speed queue views

Reviewed-By: Peter Rotich <peter@osticket.com>