Attachment icon in message

Hello

Is it possible to show somehow in message row (without opening message first), that it contains attachments? It is quite easy to do it in ticket level, but there mid be a lot of messages under ticket and even you can see, that ticket contain attachments, it takes a lot of time to find, what message or messages have attachments.

Thanks

Ingar

RE: Attachment icon in message

Hi Ingar,

This is current not possible (as far as I know) without some screen customization.

I have created a copy of "View Ticket 80" and added an HTML parser element at the top. In the HTML element I added this JavaScript:

<script>
$(document).ready(function(){
  $('.HtmlMessages2_contentArea').each(function(){
    var _this = $(this);
    if($('.HtmlMessages2_attachments', this).length > 0) {
      var _div = $('<div/>').css({'position': 'absolute', 'top': '5px', 'right': '50px'});
      var _img = $('<img/>').attr('src', '/graphics/8/CKEditor_Attachment.png');
      _div.append(_img);
     _this.prev('.HtmlMessages2_heading').css('position', 'relative').append(_div);
    }
  });
});
</script>

Which will display which messages have an attachment, even if the messages are collapsed:

Expanded is displayed like this:

Note that, this isn't a very good solution, and would probably be ineffective when displaying lots of messages, but ... it works :)

Av: Simen Mostuen Iversen 16. okt 2017

RE: Attachment icon in message

Thanks a lot Simen

This is exactly what i was looking for. However, maybe you can trace better where i am going wrong, because i get an errormessage, when i use your script.

So basically what i did:

I took a copy, as you told of view ticket 80. In this ticket i already can see HTML parser element, so instead of adding one, i used existing one and inserted your script behind that element into scripts tab. I receive an errormessage.

HTML parser element

element properties

error message

Thanks a lot of your help.

Regards

Ingar

Av: Ingar Mölder 23. okt 2017

RE: Attachment icon in message

Hi Ingar, 

the javascript is supposed to be in the 'Body', not in the 'Creation script'.

Simen, that is a nice solution to the problem :)

Av: Frode Lillerud 23. okt 2017

RE: Attachment icon in message

Hi Ingar,

as Frode said, it's supposed to be in the body pane. I should've specified that.

Thanks Frode :)

Av: Simen Mostuen Iversen 23. okt 2017

RE: Attachment icon in message

Hello

After upgrading our environment into 8.2 i must return into this again. For some reason it does not anymore show attachment sign in message as it did earlyer and i noticed another strange behavior. When i add an element "HTML text with Parser and database" without even a script, it piks up for page some default width. Without this element, page is extended to full width regarding to browser. Is there something changed in 8.2 and what i should change in order to make it work again?

Thanks

Av: Ingar Mölder 1. feb 2018

RE: Attachment icon in message

Hi

Regarding this issue still, i noticed, that solution shows only attachment icon, when it is in last message, but if there is a newer message without attachment, it does not show it up. Is there something to be done in order to make it work properly?

Thanks

Av: Ingar Mölder 27. feb 2018

RE: Attachment icon in message

It works correctly on my installation. However, when adding messages using the quick-reply buttons, the screen is not reloaded and the script is not re-executed, and consequently it does not take effect for the newly added message. Reloading the screen shows the icon correctly for all my messages.

Sverre

Av: Sverre Hjelm 2. mar 2018

RE: Attachment icon in message

Hi

I am struggling with adding attachment sign in message row, but can not find the reason, why it does not show up in our production installation. When i have created a new instance with empty database, i could easily build up my new screen and there was attachment sign as supposed. But, it does not work in our production environment. Here what i checked and did:

I have a test environment, which is exact copy of our production one. I followed instructions and observed, that there is no attachment sign. I even forced to use full url to proper sign, just to awoid, that it does not find it other wize.

Then i installed a new instance on the same server. It is an empty database and out of the box installation. I followed instructions and woila, sign appeard to message row.

Then i have created a package, where i picked up my new screen and screen shoser in clean installation and exported it. However, there is still no attachment sign after i corrected my url and made sure, that new, imported screen was in use.

I right click on message row and compared "View code" and to me it seems the same. Url:s poists to right place. But in one solution it works and in the other id does not.

Can you, please, suggest, where should i look at the solution for this problem?

Thank you for help

Av: Ingar Mölder 3. maj 2018