Skip to content

Commit 36ae465

Browse files
authored
Merge pull request #33 from clonemeagain/1.11
1.11 upgrade - This is testing OK for me, I'll tag a release, scream-test!
2 parents cd2a17f + a110784 commit 36ae465

File tree

8 files changed

+1377
-1262
lines changed

8 files changed

+1377
-1262
lines changed

.travis.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
language: php
22
php:
3-
- 5.4
4-
- 5.6
3+
#- 5.6
54
- 7.1
5+
- 7.3
66

77
# These are the current latest versions of osTicket
88
env:
9-
- OSTICKET_VERSION=1.9.16
10-
- OSTICKET_VERSION=1.10.1
9+
- OSTICKET_VERSION=1.10.5
10+
- OSTICKET_VERSION=1.11
1111

1212
### Prepare the build matrix for Travis to create the different tests we want
1313
### Note: Each env above is mixed with each include directive here to create
@@ -16,9 +16,6 @@ env:
1616
### unsupported builds, like osTicket 1.10 with php 5.3
1717
matrix:
1818
fast_finish: true
19-
exclude:
20-
- php: 7.1
21-
env: OSTICKET_VERSION=1.9.16
2219

2320
# Turn off the xdebug extension, we don't use coverage reports, and the precise errors were annoying
2421
before_install:

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
# Attachment Preview
2-
An [osTicket](https://github.com/osTicket/osTicket) plugin allowing inlining of Attachments, works with PHP5.3+ and osTicket 1.9+
2+
An [osTicket](https://github.com/osTicket/osTicket) plugin allowing inlining of Attachments, works with PHP5.3+ and osTicket 1.9+
33

44
[![Build Status](https://travis-ci.org/clonemeagain/attachment_preview.svg?branch=master)](https://travis-ci.org/clonemeagain/attachment_preview)
55

66
#How it looks:
77
![agent_view](https://cloud.githubusercontent.com/assets/5077391/15166401/bedd01fc-1761-11e6-8814-178c7d4efc03.png)
88

99
## Current features:
10-
- PDF Files attachments are embedded as full PDF `<object>` in the entry.
10+
- PDF Files attachments are embedded as full PDF `<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.
1111
- Images inserted as normal `<img>` tags. Supported by most browsers: `png,jpg,gif,svg,bmp`
1212
- Text files attachments are inserted into using `<pre>` (If enabled).
1313
- HTML files are filtered and inserted (If enabled).
1414
- Youtube links in comments can be used to create embedded `<iframe>` players. (if enabled)
1515
- HTML5 Compatible video formats attached are embedded as `<video>` players. (if enabled)
16-
- All modifications to the DOM are now performed on the server.
16+
- All modifications to the DOM are now performed on the server, however the bulk of the work is in Javascript.
1717
- Admin can choose the types of attachments to inline, and who can inline them.
18-
- Default admin options are embed "PDF's & Images" only for "Agents".
1918
- Plugin API: allows other plugins to manipulate the DOM without adding race conditions or multiple re-parses.
2019

2120
## To Install:
@@ -25,6 +24,8 @@ An [osTicket](https://github.com/osTicket/osTicket) plugin allowing inlining of
2524
1. Now the plugin needs to be enabled & configured, so you should be seeing the list of currently installed plugins, pick the checkbox next to "Attachment Inline Plugin" and select the "Enable" button.
2625
1. Now you can configure the plugin, click the link "Attachment Inline Plugin" and choose who the plugin should be activated for, or keep the default.
2726

27+
If 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](https://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file) and set "Preview in Firefox"
28+
2829
## To Remove:
2930
Navigate to admin plugins view, click the checkbox and push the "Delete" button.
3031

@@ -35,16 +36,21 @@ The plugin will still be available, you have deleted the config only at this poi
3536
Latest in [Wiki](https://github.com/clonemeagain/attachment_preview/wiki)
3637

3738
* Essentially it's simple, when enabled, and a ticket page is viewed, an output buffer is created which waits for the page to be finished rendering by osTicket. (Using php's register_shutdown_function & ob_start)
38-
* The plugin then uses a DOMDocument and adds a new DOMElement after each attachment, inlining them. PDF's become `<object>`'s, PNG's become `<img>` etc.
39+
* The plugin then uses a DOMDocument and adds a new DOMElement after each attachment, inlining them. PDF's become `<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.
3940

4041
The plugin has several administratively configurable options, including, but not limited to:
4142
* What to inline (PDF/Image/Youtube/Text/HTML etc)
4243
* The maximum size of attachments to inline.
4344
* How many to inline, attachments after that are still inlineable, but the Agent has to press a "Show Attachment" button (translateable).
4445
* We now support changing the original attachment link into a "New Tab", so there is an option for that.
46+
* If the browser should remember the attachments it's seen, and if so, for how long.
4547

46-
The plugin is completely self-contained, so ZERO MODS to core are required. You simply clone the repo or download the zip from github and extract into /includes/plugins/ which should make a folder: "attachment_preview", but it could be called anything.
48+
The plugin is completely self-contained, so there are ZERO MODS to core required to get it working.
49+
You simply clone the repo or download the zip from github and extract into /includes/plugins/ which should make a folder: "attachment_preview", but it could be called anything.
4750

48-
# TODO:
49-
- Have an idea for us to work with? [Let us know via the Issue Queue above!](https://github.com/clonemeagain/attachment_preview/issues/new)
5051

52+
## Note on CI
53+
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.
54+
55+
# TODO:
56+
- Your suggestions/feedback? [Let me know via the Issue Queue above!](https://github.com/clonemeagain/attachment_preview/issues/new)

0 commit comments

Comments
 (0)