Flyspray - The bug killer!

  • Status Unconfirmed
  • Percent Complete
    0%
  • Task Type Information
  • Category Backend/Core
  • Assigned To No-one
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 1.0-beta
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Flyspray - The bug killer!
Opened by Paul - 27.01.2017

FS#2335 - PDF Attachment does NOT View/Open in New Window/Tab

if a pdf is attached with commentit needs either be forced as download or open target _blank

Project Manager
peterdd commented on 27.01.2017 15:07

Here a little target="_blank" hack to open pdf-files in a new browser tab instead of same browser window (if web browser has builtin PDF support or PDF plugin)

Search the link in themes/CleanFS/templates/common.attachments.tpl
around line 6:

Replace:

    <a title="<?php echo Filters::noXSS($attachment['orig_name']); ?>" href="?getfile=<?php echo Filters::noXSS($attachment['attachment_id']); ?>" <?php if (substr($attachment['file_type'], 0, 5) == 'image'): ?>rel="lightbox[bug]"<?php endif; ?>>

with

    <a title="<?php echo Filters::noXSS($attachment['orig_name']); ?>" href="?getfile=<?php echo Filters::noXSS($attachment['attachment_id']); ?>"
<?php if (substr($attachment['file_type'], 0, 5) == 'image'): ?> rel="lightbox[bug]"
<?php elseif (substr($attachment['file_type'], 0, 15) == 'application/pdf'): ?> target="_blank"<?php endif; ?>>

Currently we add the "force download"-button only for images to workaround the problem that lightbox grabs rightmouseclicks too.

Maybe we should add the "force download"-button for pdf-files too? The default link to a pdf file should keep a normal link I think (normal or '_blank' link), so the web browser decides if showing in browser window or show download dialog.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing