getThreadEntries();
?>
$b;
};
$htmlId = $options['html-id'] ?: ('thread-'.$ticket->getThread()->getId());
$thread_attachments = array();
foreach (Attachment::objects()->filter(array(
'thread_entry__thread__id' => $ticket->getThread()->getId(),
))->select_related('thread_entry', 'file') as $att) {
$thread_attachments[$att->object_id][] = $att;
}
?>
exists(true)) {
// Go through all the entries and bucket them by time frame
$buckets = array();
$rel = 0;
$eCount = 0;
foreach ($entries as $i=>$E) {
// First item _always_ shows up
if ($i != 0)
// Set relative time resolution to 12 hours
$rel = Format::relativeTime(Misc::db2gmtime($E->created, false, 43200));
// only entries with attachments
$acount = 0;
foreach ($E->attachments as $att ) {
if ($att->inline) continue;
$acount++;
}
if($acount) {
$buckets[$rel][] = $E;
$eCount++;
}
}
// Go back through the entries and render them on the page
foreach ($buckets as $rel=>$entries) {
// TODO: Consider adding a date boundary to indicate significant
// changes in dates between thread items.
foreach ($entries as $entry) {
?>
'.__('No attachments have been posted to this thread.').'';
}
?>