Kayako logo
Kayako Mobile Discussion, troubleshooting and feedback for Kayako Mobile for Microsoft Windows Mobile enabled devices.

Kayako develops robust helpdesk software, live chat and real-time visitor monitoring software.
Kayako is trusted by more than 30,000 organizations, including a number of Fortune 500 companies and government institutions.
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1) Old
Matthew Offline
Member
 
Matthew's Avatar
 
Posts: 270
Join Date: Oct 2007
Location: Jakarta, Indonesia
Post Free Fix for HTML Tickets in Kayako Mobile - 01-11-2008, 10:22 AM

Do your tickets look a mess in Kayako Mobile, because you allow HTML in your ticket posts, and Kayako Mobile doesn't strip the tags? Here's great-looking fix to convert HTML tickets to plain text.

First, you need to get this PHP class:
PHP Class: HTML to Plain Text Conversion: chuggnutt.com

Download, extract, and upload to \modifications\ (yes, you need to create that directory in your installation root if you don't already have one).

Next, in \modules\tickets\mobile_sync.php, look for this around line 25...
PHP Code:
require_once ("./includes/functions_xml.php"); 
...and insert after it:
PHP Code:
// HTML2Text mod added by Matthew Arciniega
require_once('./modifications/class.html2text.inc');
// End HTML2Text mod 
Lastly, in \modules\tickets\functions_mobile.php, locate function returnSanitizedMobileData (right at the end of the file), and replace the entire function with this modified version:
PHP Code:
function returnSanitizedMobileData($data)
{
    
//HTML2Text mod added by Matthew Arciniega
    
$OriginalLength strlen($data);                  //get original length of the string
    
$StrippedLength strlen(strip_tags($data));      //get length after HTML tags are stripped
    
if ($OriginalLength != $StrippedLength)
    {
        
$h2t =& new html2text($data); 
        
$data trim($h2t->get_text());    
    } 
    
//End HTML2Text mod
    
return str_replace("<![CDATA[""&lt;![CDATA["str_replace("]]>""]]&gt;"$data));

Enjoy!


Matthew Arciniega
Free: Ticket List & Search | Dept. Display Names
Free: Outlook/HTML Tickets| Staff Parser Log
Tutorials: SLA System
| Template Groups
KSS v3.20.02 | PHP: 5.2.6 | MySQL: 5.0.58 | CentOS 4
   
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
With operamini who needs kayako mobile? nibb Kayako Mobile 0 13-04-2008 10:00 AM



Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78