jQuery to the Rescue - attachmentsHelper.js
What attachmentsHelper.js does is simply walk through comments and if an attachment is found then clone it to the top. It also appends the uploader name and upload time.
I applied different styling to separate them from the attachments in the Task details. To make it more compact I made the "view" link hidden.
How to install
Copy attachmentsHelper.js to qdpm\js\helpers directory. If you have the Extended version use "qdPMExtended" in the path instead of "qdpm".
Add these lines after
<?php echo stylesheet_tag("common.css") ?> in qdpm\core\apps\qdPM\templates\layout.php:
That’s all, attachmentsHelper should work from now on. To deactivate, simply comment out the code you added in Step 2. Make sure to repeat these steps after upgrading qdPM.
Feel free to use attachmentsHelper.js and modify it to your needs if needed. Don’t forget to drop a line here if you make any improvements to it.
Please note that I am not connected with qdPM.
v0.3: New install code, localization support
- new install code (allows adding global settings)
- localization support: attachmentsHelper shows up in user language set in qdPM profile (reverts to English if language is unavailable)
- maximum number of visible attachments can be set globally using "maxVisibleAttachments"
- minor fixes
Currently attachmentsHelper supports English, German, Hungarian, Russian, Serbian and Swedish locales. Please help by submitting new languages by translating these strings:
v0.2: Limit Number of Visible Attachments & Modify Sort Order
Version 0.2 of attachmentsHelper displays only 5 attachments in the list and hides the rest. You can use the "Show X more attachments" button to reveal all.
To change the default value, modify this line:
var maxVisibleAttachments = 5;
Set this number to a very high value (e.g. 9999) to disable this feature.
By default, attachments are listed by date ascending. This can be changed by clicking on the "Reverse sort attachments" link in the bottom right corner of the attachment list block. This setting is saved in a cookie so it will persist until cookies are deleted.
0 comments Comments