From 20657ae1596dfdfe1023510174858b496efa589c Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 28 May 2005 19:13:29 +0000 Subject: [PATCH] r201: Show custom fields on showreport.php --- showreport.php | 44 ++++++++++++++++++++++++++++++++ templates/default/SHOWREPORT.tpl | 2 ++ 2 files changed, 46 insertions(+) diff --git a/showreport.php b/showreport.php index eb4e936..057db6b 100644 --- a/showreport.php +++ b/showreport.php @@ -56,6 +56,50 @@ $bug['assigninfo'] = ((is_array($assigninfo)) ? construct_user_display($assignin $show['editreport'] = ((((can_perform('caneditown') AND $bugsys->userinfo['userid'] == $comment['userid']) OR can_perform('caneditothers')) AND can_perform('caneditinfo')) ? true : false); +// ------------------------------------------------------------------- +// custom fields +$customfields = ''; + +$allfields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield"); +while ($field = $db->fetch_array($allfields)) +{ + $fieldlist["$field[shortname]"] = $field; +} + +$fieldvalues = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill WHERE bugid = $bug[bugid]"); + +foreach ($fieldvalues AS $shortname => $value) +{ + if ($shortname == 'bugid') + { + continue; + } + + $field =& $fieldlist["$shortname"]; + + $customfields .= "
$field[name]: "; + + if ($value == '') + { + $value = $field['defaultvalue']; + } + + if ($field['type'] == 'input_text' OR $field['type'] == 'textarea') + { + $customfields .= $value; + } + else if ($field['type'] == 'input_checkbox') + { + $customfields .= (($value) ? 'True' : 'False'); + } + else + { + $temp = unserialize($field['selects']); + $customfields .= $temp["$value"]; + } + $customfields .= "
\n\n"; +} + // ------------------------------------------------------------------- // hilight $words = explode(' ', $bugsys->in['hilight']); diff --git a/templates/default/SHOWREPORT.tpl b/templates/default/SHOWREPORT.tpl index 7cba68c..3f10ff4 100644 --- a/templates/default/SHOWREPORT.tpl +++ b/templates/default/SHOWREPORT.tpl @@ -7,6 +7,8 @@
Priority: $bug[priority]
Assigned to: $bug[assigninfo]
+$customfields +
[Show Bug History] [Edit Bug Report]

-- 2.22.5