1. Kayako Download customers: we will continue to develop and support Kayako Download beyond July 2017, alongside the new Kayako for existing customers.

    Find out more.

  2. The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

Attachment preview (images only)

Discussion in 'Developing, APIs and extending' started by Nawid Sahebzadeh, Oct 10, 2012.

  1. Ali Dursun

    Ali Dursun Member

    No, there is no need to install the app, you only need to paste some code into related files and upload hover.css; that's all.
    please see post above.
     
  2. Donaldini

    Donaldini Member

  3. Ali Dursun

    Ali Dursun Member

  4. Hi Donaldini,

    Just as Ali Dursun has mentioned, the most fool proof way to ensure everything works is by adding the code snippets I have mentioned in the original post to the files. It requires a bit of caution and precision but it does work. The app which Patrick built upon my code does make things easier (also when you want to upgrade) but it is a bit harder to debug IMHO.

    Try adding the code snippets manually and if that gives you problems, feel free to post your issues here and we will try to help you out the best we can.

    Cheers,
    Nawid
     
  5. Donaldini

    Donaldini Member

    I was trying it out as you were replying, but still couldn't get it to work :(

    I didn't have recpheader.tpl like Patrick said so here's what I did on my 4.57.1.3610


    1. Upload hoverpop.css to __swift/apps/base/javascript/__global/thirdparty/

    2. Edit __swift/library/Compressor/class.SWIFT_Compressor.php
    3. Added the following on line 110 to static protected $_cssThirdParty
    'image_popup' => './__swift/apps/base/javascript/__global/thirdparty/hoverpop.css',

    4. Changed the following lines in static protected $_jsInterfaceAutoLoad
    Original: 'staff' => array('tinymce', 'popup', 'kql', 'notification', 'circleplayer', 'unifiedsearch', 'xregexp', 'corecp', 'staffcp'),

    Replace by: 'staff' => array('tinymce', 'image_popup', 'popup', 'kql', 'notification', 'circleplayer', 'unifiedsearch', 'xregexp', 'corecp', 'staffcp'),
     
  6. Donaldini

    Donaldini Member

    5. Resumed original steps: Edit __apps/tickets/staff/class.View_Ticket.php
    Original: $_attachmentHTML .= '<a class="ticketpostcontentsattachmentitem" href="' . SWIFT::Get('basename') . '/Tickets/Ticket/GetAttachment/' . $_SWIFT_TicketObject->GetTicketID() . '/' . $_attachmentContainer['attachmentid'] . '" target="_blank" style="background-image: URL(\'' . SWIFT::Get('themepathimages') . $_attachmentIcon . '\');">' . htmlspecialchars($_attachmentContainer['filename']) . ' (' . FormattedSize($_attachmentContainer['filesize']) . ')' . '</a>';
    }
    $_attachmentHTML .= '</div>';
     
  7. Donaldini

    Donaldini Member

    Replaced by: if($_attachmentIcon == 'mimeico_pic.gif')
    {
    $_attachmentHTML .= '<a class="thumbnail" href="' . SWIFT::Get('basename') . '/Tickets/Ticket/GetAttachment/' . $_SWIFT_TicketObject->GetTicketID() . '/' . $_attachmentContainer['attachmentid']
    .
    '" target="_blank" ><img src="'. SWIFT::Get('themepathimages') . $_attachmentIcon.'" /> '. htmlspecialchars($_attachmentContainer['filename']) . ' (' . FormattedSize($_attachmentContainer['filesize']) . ')'.' &nbsp;&nbsp;&nbsp; <span><img src="' . SWIFT::Get('basename') . '/Tickets/Ticket/GetAttachment/' . $_SWIFT_TicketObject->GetTicketID() . '/' . $_attachmentContainer['attachmentid'] . '" alt="'.htmlspecialchars($_attachmentContainer['filename']).'"></span>'
    . '</a>&nbsp;';
    }
    else
     
  8. Donaldini

    Donaldini Member

    {
    $_attachmentHTML .= '<a class="ticketpostcontentsattachmentitem" href="' . SWIFT::Get('basename') . '/Tickets/Ticket/GetAttachment/' . $_SWIFT_TicketObject->GetTicketID() . '/' . $_attachmentContainer['attachmentid'] . '" target="_blank"
    style="background-image: URL(\''
    . SWIFT::Get('themepathimages') . $_attachmentIcon . '\');">' . htmlspecialchars($_attachmentContainer['filename']) . ' (' . FormattedSize($_attachmentContainer['filesize']) . ')' . '</a>';
    }
    }
    $_attachmentHTML .= '</div>';

    But after all this I couldn't see it working, or see any errors.
    Sorry for the multiple posts, I was capped
     
  9. Donaldini

    Donaldini Member

    Here are the changed files if you would want to see them
     

    Attached Files:

  10. Hi Donaldini,
    You are using two different methods combined which won't work. Please restore everything back to default and apply only the changes mentioned in the original post.

    This is WRONG: New 5. Resumed original steps: Edit __apps/tickets/staff/class.View_Ticket.php
    I have NEVER said that this file should be changed. Please restore to default and apply each step EXACTLY as it was mentioned in the original post.
    The only files that need to modified are these (NOTE the full path):
    __swift/themes/admin_default/recpheader.tpl
    __modules/tickets/staff/class.View_Ticket.php

    And the following file should be added:
    staff/hoverpop.css

    Nothing else should be modified.

    Kind regards,
    Nawid
     
  11. Peter Muscat

    Peter Muscat New Member

    Is there a way to do this on version 4.61.0.4088?
     
  12. Ali Dursun

    Ali Dursun Member

    Here are customization steps for latest version 4.66.2 but it should also work with earlier versions too:

    1. Copy attached hoverpop.css in /staff

    2. Copy attached recpheader.tpl in /__swift/themes/__cp/templates

    3. Copy attached class.View_Ticket.php in /__apps/tickets/staff

    Then everything should work properly if you hover an image.

    kind regards
    Ali
     

    Attached Files:

    Ivan Sybyriakov likes this.
  13. mcdodd

    mcdodd Member

    Just a quick mention - if you install Garys customtweaks project (listed as WYSIWYG Editor in Kayako Forge) it replaces the file class.View_Ticket.php, so you'll then need to update it again by hand. I found the code that needed updating at line 1229 in v4.65.

    Also, the path in these later versions is __apps/tickets/staff/class.View_Ticket.php.

    Thanks Nawid - it's a great help.

    thanks
    Matthew
     
  14. Zircom Net

    Zircom Net Member

    I tried it on V4.67
    It works well :)
     
  15. Zircom Net

    Zircom Net Member

    Hi Nawid,

    Is it possible to reduce the attachment files name text size?
    It always overlapping over bottom email address as shown in picture.
    [​IMG]
    Regards
    Stan
     
  16. Anything is possible. I don't understand your screenshot however as it seems your attachments are added at the bottom of the reply instead of the top of it??
    In any case, you can best define a class for the attachment filenames in your code and use css to change the text size or font of that class. That shouldn't be too difficult.
     
  17. Zircom Net

    Zircom Net Member

    The screenshot shoes the last attachment file name added at the bottom of the reply instead, I am not good in coding, any way you can help me.
     
  18. Sorry Zircom Net but that's beyond the scope of this post. If you're not used to changing code like this, I do not recommend that you perform this kind of changes to your installation.
     
  19. brooky

    brooky Established Member

    Amazing! I opened a features request for this years ago. It's the only major failing in Kayako.
     
  20. Xana Wolf

    Xana Wolf Member

    Is anyone using this in 4.7?
     

Share This Page