I wrote some code to add the full thread to the ticket email response. v 1.10.1
Add a new method in class.ticket.php.
function addMessageThread($body){
$sql = 'SELECT ost_thread_entry.id, poster, body, FORMAT, ost_thread_entry.created FROM ost_thread, ost_thread_entry
WHERE ost_thread_entry.thread_id = ost_thread.id AND object_id = ' . $this->getId() .'
ORDER BY ost_thread_entry.created DESC';
$result = db_query($sql);
$i=0;
while ($row = $result->fetch_assoc()) {
if($i > 0) {
$body .= '<br/><br/><b>' . $row['poster'] . ' ' . date_format(date_create($row['created']), 'd-m-Y g:i A') . '</b><br/>';
$body .= $row['body'];
}
else
$body .= "<br/><br/><h2>THREAD</h2>";
$i=$i+1;
}
return $body;
}
modify the method postReply, near line 2582.
//....
$user = $this->getOwner();
if (($email=$dept->getEmail())
&& ($tpl = $dept->getTemplate())
&& ($msg=$tpl->getReplyMsgTemplate())
) {
$msg = $this->replaceVars($msg->asArray(),
$variables + array('recipient' => $user)
);
$attachments = $cfg->emailAttachments()?$response->getAttachments():array();
//Add this lines
$body = $msg['body'];
//Includes thread.
if($vars['includeThread'] == 'on')
$body = $this->addMessageThread($body);
$email->send($user, $msg['subj'], $body, $attachments,
$options);
}
Modify file ticket-view.inc.php. Near line 730.
<p style="text-align:center;">
<!--Add this line-->
<br/><br/><input type="checkbox" name="includeThread" /> Include Thread <br/><br/>
<input class="save pending" type="submit" value="<?php echo __('Post Reply');?>">
<input class="" type="reset" value="<?php echo __('Reset');?>">
</p>