oops: Fix missing 2nd param to ::lookupByMessageId
Merge remote branch 'upstream/develop' into develop-next
Fixup context issue on staff registration email
Fixup missing column in upgrades from < v1.8.0

There was a major goof for osTicket 1.8.0 where the installer created a
`form_id` column in the `%filter` table; however, the upgrader neglected to
add the column. Therefore, users who have upgraded from a version previous
to 1.8.0 will not have the `form_id` column in their database whereas users
who installed osTicket >= v1.8.0 and upgraded will have the column. Since
MySQL has no concept of `ADD IF NOT EXISTS`, this dynamic query will
assist with adding the column if it doesn't exist.

Thanks, http://stackoverflow.com/a/16405301/1025836
oops: Fix crash on login screen before upgrade to 1.8.2
oops: Fixup plugin configuration loading

The code introduced to convert the database values to PHP values introduced
a bug where the configuration would not be saved.
oops: Fix E_WARNING from some thread attachments
file: Force dump of file contents

Instead of allowing the backend to send a redirect URL, which doesn't make
sense on the command line
Implement thread `format` field

Thread entries now have a flexible `format` specification, which allows the
system to save the format alongside the original text. This allows the
system not to have to convert everything to HTML when storing in the
database
thread: Implement format for Thread::setBody()
Honor thread body format in PDF export
Use strongly typed ThreadBody instances for output
Hide inline attachments on PDF output
Retroactively add the `format` column to ticket_thread

This will make upgrades from osTicket < 1.8.0 substantially faster and more
reliable, considering that the previous ticket threads will not need to be
explicitly converted to html.