Kayako logo
Developers & Code Interested in customizing your Kayako products? Discuss modifications and develop your own mods with the community.

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 Rate Thread Display Modes
  (#1) Old
eiden Offline
Member
 
Posts: 208
Join Date: Apr 2006
Location: Norway
Post HowTo: Send the mailhistory with a ticket reply/forward - 05-04-2006, 11:19 AM

This modification will add an "Append history" checkbox to the Post Repy and Forward (in Staff CP). If the box is checked, the entire mailhistory in the ticket will be sent with the reply/forward.

To get this to work, some files need to be modified. This must be added to the templates email_staffreply and email_staffforward templates:

Code:
<{foreach key=key value=post from=$postlist}>

<{$post[fullname]}>
<{$post[date]}>
<{$post[contents]}>

<{/foreach}>

Please let me know if you use this modification
__________________________________________________ ______

Modifed files (4):
modules\tickets\functions_ticketmain.php
modules\tickets\staff_ajax.php
modules\tickets\staff_ticketactions.php
modules\tickets\staff_viewticket.php


1. modules\tickets\functions_ticketmain.php

Modify line 986:

Code:
From:
function createStaffReply($staffid, $fullname, $email, $subject, $contents, $isemailed, $fromemailqueueid, $attachments, $cc, $ccaddrecp, $bcc, $bccaddrecp, $downloadlink = false)

To:
function createStaffReply($staffid, $fullname, $email, $subject, $contents, $isemailed, $fromemailqueueid, $attachments, $cc, $ccaddrecp, $bcc, $bccaddrecp, $downloadlink = false,$append)

Add to line 1078 (Below $this->loadTemplateVariables())
Code:
if ($append == 1){
$template->assign("postlist", $this->getTicketPosts(false, false, iif($_SWIFT["settings"]["t_cpostorder"]=="asc", "asc", "desc"), true));
}

Modify line 1917

Code:
From:
function forwardTicket($staffid, $fullname, $email, $emailto, $subject, $contents, $fromemailqueueid, $addrecipient = false, $downloadlink = false)

To:
function forwardTicket($staffid, $fullname, $email, $emailto, $subject, $contents, $fromemailqueueid, $addrecipient = false, $downloadlink = false,$append)

Add to line 1950 (Below $this->loadTemplateVariables())
Code:
if ($append == 1){
$template->assign("postlist", $this->getTicketPosts(false, false, iif($_SWIFT["settings"]["t_cpostorder"]=="asc", "asc", "desc"), true));
}



2. modules\tickets\staff_ajax.php

Modify line 241:
Code:
From:
<td align="left"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="180" nowrap><span class="smalltext">'. $_SWIFT["language"]["pdue"] .'<input type="text" name="opt_due" id="opt_fdue" onclick="return showCalendar(\'opt_fdue\', \'%d/%m/%Y\');" size="12" readonly="1" value="" class="swifttext"/>&nbsp;<img src="'. $_SWIFT["themepath"] .'calendar.gif" id="opt_fduet" onclick="return showCalendar(\'opt_fdue\', \'%d/%m/%Y\');" style="cursor: pointer;" align="absmiddle"/></span></td><td nowrap><span class="smalltext">'. $_SWIFT["language"]["ptimeworked"] .'<input type="text" name="opt_timeworked" size="12" value="'. $_SWIFT["language"]["inminutes"] .'" onclick="javascript:if(this.value==\''. $_SWIFT["language"]["inminutes"] .'\') { this.value=\'\'; }" class="swifttext"/>&nbsp;</span></td></tr></table>

To:
<td align="left"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="180" nowrap><span class="smalltext">'. $_SWIFT["language"]["pdue"] .'<input type="text" name="opt_due" id="opt_fdue" onclick="return showCalendar(\'opt_fdue\', \'%d/%m/%Y\');" size="12" readonly="1" value="" class="swifttext"/>&nbsp;<img src="'. $_SWIFT["themepath"] .'calendar.gif" id="opt_fduet" onclick="return showCalendar(\'opt_fdue\', \'%d/%m/%Y\');" style="cursor: pointer;" align="absmiddle"/></span></td><td nowrap><span class="smalltext">'. $_SWIFT["language"]["ptimeworked"] .'<input type="text" name="opt_timeworked" size="12" value="'. $_SWIFT["language"]["inminutes"] .'" onclick="javascript:if(this.value==\''. $_SWIFT["language"]["inminutes"] .'\') { this.value=\'\'; }" class="swifttext"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<label for="opt_append"><input type="checkbox" name="opt_append" class="swiftcheckbox" id="opt_append" value="1" checked/>&nbsp;&nbsp;Append history</label></span></td></tr></table>



3. modules\tickets\staff_ticketactions.php

Modify line 98:
Code:
From:
$ticketpostid = $_ticketobj->createStaffReply($_SWIFT["staff"]["staffid"], $_SWIFT["staff"]["fullname"], $_SWIFT["staff"]["email"], "", $_POST["replycontents"], false, $_POST["opt_emailqueueid"], "", $_POST["opt_cc"], $_POST["ccaddrecpients"], $_POST["opt_bcc"], $_POST["bccaddrecpients"], $_POST["opt_downloads"]);

To:
$ticketpostid = $_ticketobj->createStaffReply($_SWIFT["staff"]["staffid"], $_SWIFT["staff"]["fullname"], $_SWIFT["staff"]["email"], "", $_POST["replycontents"], false, $_POST["opt_emailqueueid"], "", $_POST["opt_cc"], $_POST["ccaddrecpients"], $_POST["opt_bcc"], $_POST["bccaddrecpients"], $_POST["opt_downloads"],$_POST["opt_append"]);

Modify line 203:
Code:
From:
$ticketpostid = $_ticketobj->forwardTicket($_SWIFT["staff"]["staffid"], $_SWIFT["staff"]["fullname"], $_SWIFT["staff"]["email"], $_POST["opt_to"], $_ticketobj->ticket["subject"], $_POST["replycontents"], $_POST["opt_emailqueueid"], $_POST["faddrecipients"], $_POST["opt_downloads"]);

To:
$ticketpostid = $_ticketobj->forwardTicket($_SWIFT["staff"]["staffid"], $_SWIFT["staff"]["fullname"], $_SWIFT["staff"]["email"], $_POST["opt_to"], $_ticketobj->ticket["subject"], $_POST["replycontents"], $_POST["opt_emailqueueid"], $_POST["faddrecipients"], $_POST["opt_downloads"],$_POST["opt_append"]);


4. modules\tickets\staff_viewticket.php

Modify line 375:
Code:
From:
<td align="left"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="180" nowrap><span class="smalltext">'. $_SWIFT["language"]["pdue"] .'<input type="text" name="opt_due" id="f_date_c" size="12" readonly="1" value="" class="swifttext"/>&nbsp;<img src="'. $_SWIFT["themepath"] .'calendar.gif" id="f_trigger_c" style="cursor: pointer;" title="'. $title .'" align="absmiddle"/></span></td><td width="200" nowrap><span class="smalltext">'. $_SWIFT["language"]["ptimeworked"] .'<input type="text" name="opt_timeworked" size="12" value="'. $_SWIFT["language"]["inminutes"] .'" onclick="javascript:if(this.value==\''. $_SWIFT["language"]["inminutes"] .'\') { this.value=\'\'; }" class="swifttext"/>&nbsp;</span></td><td align="left"><span class="smalltext">&nbsp;&nbsp;&nbsp;&nbsp;<label for="opt_addpred"><input type="checkbox" name="opt_addpred" class="swiftcheckbox" id="opt_addpred" value="1" />&nbsp;&nbsp;'.$_SWIFT["language"]["optpred"].'</label>&nbsp;&nbsp;&nbsp;&nbsp;<label for="opt_addkb"><input type="checkbox" name="opt_addkb" class="swiftcheckbox" id="opt_addkb" value="1" />&nbsp;&nbsp;'.$_SWIFT["language"]["optkb"].'</label></span></td></tr></table>

To:
<td align="left"><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="180" nowrap><span class="smalltext">'. $_SWIFT["language"]["pdue"] .'<input type="text" name="opt_due" id="f_date_c" size="12" readonly="1" value="" class="swifttext"/>&nbsp;<img src="'. $_SWIFT["themepath"] .'calendar.gif" id="f_trigger_c" style="cursor: pointer;" title="'. $title .'" align="absmiddle"/></span></td><td width="200" nowrap><span class="smalltext">'. $_SWIFT["language"]["ptimeworked"] .'<input type="text" name="opt_timeworked" size="12" value="'. $_SWIFT["language"]["inminutes"] .'" onclick="javascript:if(this.value==\''. $_SWIFT["language"]["inminutes"] .'\') { this.value=\'\'; }" class="swifttext"/>&nbsp;</span></td><td align="left"><span class="smalltext">&nbsp;&nbsp;&nbsp;&nbsp;<label for="opt_addpred"><input type="checkbox" name="opt_addpred" class="swiftcheckbox" id="opt_addpred" value="1" />&nbsp;&nbsp;'.$_SWIFT["language"]["optpred"].'</label>&nbsp;&nbsp;&nbsp;&nbsp;<label for="opt_addkb"><input type="checkbox" name="opt_addkb" class="swiftcheckbox" id="opt_addkb" value="1" />&nbsp;&nbsp;'.$_SWIFT["language"]["optkb"].'</label>&nbsp;&nbsp;&nbsp;&nbsp;<label for="opt_append"><input type="checkbox" name="opt_append" class="swiftcheckbox" id="opt_append" value="1" />&nbsp;&nbsp;Append history</label></span></td></tr></table>
   
Reply With Quote
Reply

Tags
howto, mailhistory, reply or forward, ticket

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Ticket Settings: Send Complete History in Staff Replies? PeteV How do I? 2 28-08-2007 12:26 AM
New Build: 3.10.02 STABLE Ryan Lederman News and Announcements 0 05-03-2007 08:53 PM
eSupport v2.2 RC1 Available in Members Area Varun Shoor Technical Chat 1 17-05-2004 01:28 PM



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