From d15d32ac5ed04257858df2330143f0975991d4f3 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 3 Oct 2005 03:57:33 +0000 Subject: [PATCH] r480: $show['attachments'] (TRUE) only if we can (put || (get && have attachs)) --- showreport.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/showreport.php b/showreport.php index a52665e..0c463ee 100644 --- a/showreport.php +++ b/showreport.php @@ -245,13 +245,18 @@ if ($show['getattachments'] OR $show['putattachments']) WHERE attachment.bugid = $bug[bugid] ORDER BY attachment.dateline" ); + + $attaches = false; while ($attachment = $db->fetch_array($attachments_fetch)) { + $attaches = true; $show['editattach'] = ((can_perform('caneditattach') OR ($attachment['userid'] == $bugsys->userinfo['userid'] AND can_perform('canputattach'))) ? true : false); $attachment['date'] = $datef->format($bugsys->options['dateformat'], $attachment['dateline']); $attachment['user'] = construct_user_display($attachment, false); eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";'); } + + $show['attachments'] = (!$show['putattachments'] AND !$attaches) ? false : true; } // ------------------------------------------------------------------- -- 2.22.5