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"/> <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"/> </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"/> <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"/> <label for="opt_append"><input type="checkbox" name="opt_append" class="swiftcheckbox" id="opt_append" value="1" checked/> 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"/> <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"/> </span></td><td align="left"><span class="smalltext"> <label for="opt_addpred"><input type="checkbox" name="opt_addpred" class="swiftcheckbox" id="opt_addpred" value="1" /> '.$_SWIFT["language"]["optpred"].'</label> <label for="opt_addkb"><input type="checkbox" name="opt_addkb" class="swiftcheckbox" id="opt_addkb" value="1" /> '.$_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"/> <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"/> </span></td><td align="left"><span class="smalltext"> <label for="opt_addpred"><input type="checkbox" name="opt_addpred" class="swiftcheckbox" id="opt_addpred" value="1" /> '.$_SWIFT["language"]["optpred"].'</label> <label for="opt_addkb"><input type="checkbox" name="opt_addkb" class="swiftcheckbox" id="opt_addkb" value="1" /> '.$_SWIFT["language"]["optkb"].'</label> <label for="opt_append"><input type="checkbox" name="opt_append" class="swiftcheckbox" id="opt_append" value="1" /> Append history</label></span></td></tr></table>