I would like the developers to include a simple change in the code to allow attachments to open in another window/tab in my browser.
My skills in programming are very limited. I am running it production in version 1.9.8.1 since i found this related post that I answered using my user @mici2015 :
http://osticket.com/forum/discussion/85805/view-attachments-in-a-other-tab-or-pop-up-window
Note that I am not claiming that I discover/did it, I just modified a little bit the php string. Kudos to the original poster @philk in original thread:
http://osticket.com/forum/discussion/79839/open-attachments-in-new-tab-window
--- class.thread.php.original 2015-06-15 11:04:56.157265900 -0500
+++ class.thread.php 2015-06-15 11:07:02.493265900 -0500
@@ -657,7 +657,7 @@
if($attachment['size'])
$size=sprintf('<em>(%s)</em>', Format::file_size($attachment['size']));
- $str.=sprintf('<a class="Icon file no-pjax" href="%s" target="%s">%s</a>%s %s',
+ $str.=sprintf('<a class="Icon file no-pjax" href="%s" target="_blank" target="%s">%s</a>%s %s',
$attachment['download_url'], $target, Format::htmlchars($attachment['name']), $size, $separator);
}
I agree. This is implemented already in the v1.10 (develop-next) branch
And also please add preview function attached images.
Clients send a lot of pictures with the problems in one application and each time it is very difficult to find the right.
please, its a one line change, and could't be in the current stable brand!!!
and develop-next still are unnistallable due i18n problems (patches already sended in my issue reports and still not commited)
i made a little fix and with this simple code onpened in popup window:
$str.=sprintf('<a class="Icon file no-pjax" href="%s" target="_blank" onClick="window.open(this.href, this.target, \'width=800,height=600\'); return false;">%s</a>%s %s',
$attachment['download_url'], Format::htmlchars($attachment['name']), $size, $separator);
i added this after "target" but using "_blank" as target, for work link if popup fails:
onClick="window.open(this.href, this.target, \'width=800,height=600\'); return false;"
and now opens popup window and with right without prolems agains html4 or html5
why this simple pacht are not in the stable release of 1.9.12? this was reported some time ago and also attach the patch in the previous comment very simple to commit!

Could it be that this is not working on 1.10 RC2?
At least in firefox when I inspect the code loaded, it says already target="_blank" but it is not doing it...
i not revised the code in 1.10 brand, due i'm now not interesting in unstable product, my production environment has only 1.9.11 due the 1.10 stil has many bugs and problems to use it
i explain the working of the popup mchanish in the modified patch in that comment here: https://github.com/osTicket/osTicket-1.8/issues/2164#issuecomment-119995132 due the firts provided breaks html standars
@ARiber what patch do u use to u'r setup, the first or the posted by me in the previus comment?驴
right now i cannot revise 1.10 but i can do later if osticket developers will commit in both versions.. i can made also the preview feature requested. bt now production environment are the priority to all the productive manpowers, i'm not use osticket for a hobby
The patch does not work in version 1.9.12 and pop-up window is not working.
Strange, but it seems the developer has decided to ignore this problem.
1.9.12 How to make a pop-up window for file attachments?
@ARiber i can see that maybe u patched wrong, the url are not realtive to osticket installation, please revise the modified version from my comments
@MAlexey was working in 1.9.9 umm i suspect its the browser, in wchit browser do u run ?
note that ie are not a browser, seem modern versions of firefox and chromiun ignores some standars.. provide me the console error (hit F12) to see what can be do by me..
i have installed 1.9.11 (from upgrade) with chromium 27 and also firefox 28 working with php 5.3.11 under Linux only
developer seem decided to ignore many things and only implements that what are using by seflt or those that are paid, no problem with that, but must let the comunity implements their request, that the community collaboration process
Sorry to drag up an old thread, but I've just had to amend this myself. The functionality to specify the target is already there in the function it just has to be utilised correctly.
For Staff:
In include/staff/ticket-view.inc.php
Change
getAttachmentsLinks(); ?>
To
getAttachmentsLinks('','_blank'); ?>
For Users/Clients
In include/client/view.inc.php
Change
$links=$tentry->getAttachmentsLinks()
to
$links=$tentry->getAttachmentsLinks('','_blank')
@SDGPeteBatin thanks, for that tip, better to include, due u'r patch its only few words, but still developer ignores things easy to include as this!
@SDGPeteBatin you would want to make a Pull Request.
I've made a pull request for ticket-view.inc.php but the code in the repo for user/clients in include/client/view.inc.php has changed since the version I'm using, doesn't include getAttachmentsLinks() in the code and renders the thread output instead. Unfortunately I wont have time to investigate the new method until I next update.
as i spected, more problems with constant "updating" code! but necesary changes dont come up!
monts are passed since 1.9 now we have 1.10 nd some important features does not come!
please why ? i have some codes and some feature request, i made some pull and why constant changes to easy things!
@SDGPeteBatin thanks for the PR.
@mckaygerhard You appear to be off topic.
seems that the pull #2943 are more rather the #3014 that changes the behavior while the other is flexible
+1
the pull request are out of date, and still are not commited this HARD NEED FATURED IN 1.9.X BRAND THAT IS STILL THE STABLE VERSION (one year still waiting 1.10 and only RC releases)
so simple commit to open atachment in new window are so hard! uff! wow!
every time i donwload the last 1.9.X fix release i must do this change by myselft! why not including! !
Most helpful comment
I've made a pull request for ticket-view.inc.php but the code in the repo for user/clients in include/client/view.inc.php has changed since the version I'm using, doesn't include getAttachmentsLinks() in the code and renders the thread output instead. Unfortunately I wont have time to investigate the new method until I next update.