An osTicket plugin allowing inlining of Attachments, works with PHP5.3+ and osTicket 1.9+
<object>
in the entry. The number to automatically show is configurable, and if you tick the box Hide Seen
in the config, then if you go back, your browser remembers you've already seen that attachment and doesn't show it again, instead replacing the embedded PDF with a Toggle button. You can get toggle buttons for everything by setting the Number of attachments to show initially
option to 0. <img>
tags. Supported by most browsers: png,jpg,gif,svg,bmp
<pre>
(If enabled). <iframe>
players. (if enabled)<video>
players. (if enabled)git clone https://github.com/clonemeagain/attachment_preview.git /include/plugins/attachment_preview
Or extract latest-zip into /include/plugins/attachment_previewIf you don't already have a PDF program on your computer, Chrome will still work (it does that for you), for Firefox you will need to enable it, eg: enable pdf preview in firefoox and set "Preview in Firefox"
Navigate to admin plugins view, click the checkbox and push the "Delete" button.
The plugin will still be available, you have deleted the config only at this point, to remove after deleting, remove the /plugins/attachment_preview folder.
Latest in Wiki
<object>
's, PNG's become <img>
etc. It also injects the plugin's stylesheet and script into the correct places of the page, so they execute once and don't break anything else.The plugin has several administratively configurable options, including, but not limited to:
The plugin is completely self-contained, so there are ZERO MODS to core required to get it working. You simply clone the repo or download the zip from github and extract into /include/plugins/ which should make a folder: "attachment_preview", but it could be called anything.
The travis-ci tests use phpunit, and are configured for PHP 7, therefore I no longer test on PHP 5.4/5.6 etc as the automated tests would break, and Travis gives me testing for free, so I don't want to waste their time running every possible combo of PHP/osTicket. The setup currently tests the plugin using the two most recent versions of osTicket (1.10.5 & 1.11) using PHP 7.1 & 7.3.