Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Open Attachments in New Tab/Window

When I put attachments in a ticket, clients click the link and it opens in the same window. This means clients need to relog into the ticket system in order to view the attachment at the same time. Yes they can hit the back button and right click "open in a new window" but as we all know....most can't seem to figure that out.

Is there a way to change the attachments so they open in a new tab/window  target="_blank"

v1.9.3

Comments

  • There is no way to do this currently via the ui in 1.9.3.
  • Ok, I found the solution. Doing the following will open the attachments in a new tab and prevent users from being taken away from the ticket system in order to view an attachment.
    Edit line 616 of include/class.thread.php

    BEFORE:
    $str.=sprintf('<a class="Icon file no-pjax" href="%s?id=%d&h=%s" target="%s">%s</a>%s&nbsp;%s',
                        $file, $attachment['attach_id'], $hash, $target, Format::htmlchars($attachment['name']), $size, $separator);

    AFTER EDIT:
    $str.=sprintf('<a class="Icon file no-pjax" href="%s?id=%d&h=%s" target="_blank" target="%s">%s</a>%s&nbsp;%s',
                        $file, $attachment['attach_id'], $hash, $target, Format::htmlchars($attachment['name']), $size, $separator);
  • Will this be implemented in a future release?
  • @tha

    You could suggest implementation via a pull request over at github that the developers can then decide to implement / merge this ;)
Sign In or Register to comment.