From 9a765fa1e3d2f616b75b7ec76e81e89f1260ffaa Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Tue, 19 Aug 2008 13:18:39 -0400 Subject: [PATCH] More work on showreport.php --- showreport.php | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/showreport.php b/showreport.php index 3df3de7..f0a73f0 100644 --- a/showreport.php +++ b/showreport.php @@ -103,15 +103,18 @@ if ($show['edit']) $bug['priority'] = bugdar::$datastore['priority']["$bug[priority]"]['priority']; } - $show['assign'] = (can_perform('canassign', $bug['product']) ? true : false); - if (can_perform('canassign', $bug['product']) AND is_array(bugdar::$datastore['assignto'])) + $show['assign'] = (can_perform('canassign', $bug['product'])); + if (can_perform('canassign', $bug['product']) && is_array(bugdar::$datastore['assignto'])) { - foreach (bugdar::$datastore['assignto'] AS $dev) + foreach (bugdar::$datastore['assignto'] as $dev) { - $value = $dev['userid']; - $selected = (($dev['userid'] == $bug['assignedto']) ? true : false); - $label = construct_user_display($dev, false); - eval('$select[dev] .= "' . $template->fetch('selectoption') . '";'); + $tpl = new BSTemplate('selectoption'); + $tpl->vars = array( + 'value' => $dev['userid'], + 'label' => construct_user_display($dev, false), + 'selected' => ($dev['userid'] == $bug['assignedto']) + ); + $select['dev'] .= $tpl->evaluate()->getTemplate(); } } @@ -137,20 +140,26 @@ if ($show['edit']) $show['automations'] = false; if (is_array(bugdar::$datastore['automation'])) { - foreach (bugdar::$datastore['automation'] AS $action) + foreach (bugdar::$datastore['automation'] as $action) { - $label = $action['name']; - $value = $action['actionid']; - $selected = false; - eval('$select[automation] .= "' . $template->fetch('selectoption') . '";'); + $tpl = new BSTemplate('selectoption'); + $tpl->vars = array( + 'label' => $action['name'], + 'value' => $action['actionid'], + 'selected' => false + ); + $select['automation'] .= $tpl->evaluate()->getTemplate(); $show['automations'] = true; } if ($show['automations']) { - $label = ''; - $value = 0; - $selected = true; - eval('$select[automation] = "' . $template->fetch('selectoption') . '" . $select[automation];'); + $tpl = new BSTemplate('selectoption'); + $tpl->vars = array( + 'label' => '', + 'value' => 0, + 'selected' => true + ); + $select['automation'] = $tpl->evaluate()->getTemplate() . $select['automation']; } } } @@ -345,7 +354,8 @@ if (is_array($hilight) AND !$show['edit']) $tpl = new BSTemplate('showreport'); $tpl->vars = array( 'bug' => $bug, - 'comments' => $comments + 'comments' => $comments, + 'select' => $select ); $tpl->evaluate()->flush(); -- 2.43.5