From 451c4420580064d5186c6e1a25026b5b467bde09 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 9 May 2005 04:55:30 +0000 Subject: [PATCH] r100: Added attachment display information in showreport.php and respective templates --- showreport.php | 25 +++++++++++++++++++++ templates/default/SHOWREPORT.tpl | 16 +++++++++++++ templates/default/showreport_attachment.tpl | 6 +++++ 3 files changed, 47 insertions(+) create mode 100644 templates/default/showreport_attachment.tpl diff --git a/showreport.php b/showreport.php index c171556..b73db8c 100644 --- a/showreport.php +++ b/showreport.php @@ -12,6 +12,7 @@ $fetchtemplates = array( 'SHOWREPORT', + 'showreport_attachment', 'showreport_comment' ); @@ -78,6 +79,30 @@ foreach ($words AS $word) print_r($words); print_r($hilight); +// ------------------------------------------------------------------- +// attachments +$show['getattachments'] = ((can_perform('cangetattach')) ? true : false); +$show['putattachments'] = ((can_perform('canputattach')) ? true : false); + +if ($show['getattachments'] OR $show['putattachments']) +{ + $attachments_fetch = $db->query(" + SELECT attachment.*, user.email, user.showemail, + user.displayname + FROM " . TABLE_PREFIX . "attachment AS attachment + LEFT JOIN " . TABLE_PREFIX . "user AS user + ON (attachment.userid = user.userid) + WHERE attachment.bugid = $bug[bugid] + ORDER BY attachment.dateline" + ); + while ($attachment = $db->fetch_array($attachments_fetch)) + { + $attachment['date'] = datelike('standard', $attachment['dateline']); + $attachment['user'] = construct_user_display($attachment); + eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";'); + } +} + // ------------------------------------------------------------------- // get comments $comments_fetch = $db->query(" diff --git a/templates/default/SHOWREPORT.tpl b/templates/default/SHOWREPORT.tpl index aab07bb..39f337b 100644 --- a/templates/default/SHOWREPORT.tpl +++ b/templates/default/SHOWREPORT.tpl @@ -11,6 +11,22 @@
+ + + + + + + +$attachments + + + + +
Attachments
[Add New Attachment]
+ +
+ $comments
[New Comment]
\ No newline at end of file diff --git a/templates/default/showreport_attachment.tpl b/templates/default/showreport_attachment.tpl new file mode 100644 index 0000000..4c3bb24 --- /dev/null +++ b/templates/default/showreport_attachment.tpl @@ -0,0 +1,6 @@ + + + $attachment[filename] posted by $attachment[user] ($attachment[date]) +
$attachment[description]
+ + \ No newline at end of file -- 2.22.5