// -------------------------------------------------------------------
// attachments
-$show['getattachments'] = ((can_perform('cangetattach', $bug['productid']) OR can_perform('caneditattach', $bug['productid'])) ? true : false);
-$show['putattachments'] = ((can_perform('canputattach', $bug['productid']) OR can_perform('caneditattach', $bug['productid'])) ? true : false);
-$show['attachments'] = ($show['getattachments'] OR $show['putattachments']) ? true : false;
+$show['getattachments'] = (can_perform('cangetattach', $bug['productid']) || can_perform('caneditattach', $bug['productid']));
+$show['putattachments'] = (can_perform('canputattach', $bug['productid']) || can_perform('caneditattach', $bug['productid']));
+$show['attachments'] = ($show['getattachments'] || $show['putattachments']);
-if ($show['getattachments'] OR $show['putattachments'])
+if ($show['getattachments'] || $show['putattachments'])
{
$attachments_fetch = $db->query("
SELECT attachment.attachmentid, attachment.filename,
foreach ($attachments_fetch as $attachment)
{
$attaches = true;
- $show['editattach'] = ((can_perform('caneditattach', $bug['productid']) OR ($attachment['userid'] == bugdar::$userinfo['userid'] AND can_perform('canputattach', $bug['productid']))) ? true : false);
+ $show['editattach'] = (can_perform('caneditattach', $bug['productid']) || ($attachment['userid'] == bugdar::$userinfo['userid'] && can_perform('canputattach', $bug['productid'])));
$attachment['date'] = $datef->format(bugdar::$options['dateformat'], $attachment['dateline']);
$attachment['user'] = construct_user_display($attachment, false);
- eval('$attachments .= "' . $template->fetch('showreport_attachment') . '";');
+
+ $tpl = new BSTemplate('showreport_attachment');
+ $tpl->vars = array(
+ 'attachment' => $attachment
+ );
+ $attachments .= $tpl->evaluate()->getTemplate();
}
- $show['attachments'] = (!$show['putattachments'] AND !$attaches) ? false : true;
+ $show['attachments'] = ($show['putattachments'] && $attaches);
}
// -------------------------------------------------------------------
'select' => $select,
'vote' => $vote,
'favoritetext' => $favoritetext,
- 'customfields' => $customfields
+ 'customfields' => $customfields,
+ 'attachments' => $attachments
);
$tpl->evaluate()->flush();