From 8a95bf47d6645c42de1f4f189f59a8ccb5865b77 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 6 Sep 2008 16:21:39 -0400 Subject: [PATCH] Update functions_product.php to use proper naming --- includes/functions_product.php | 87 ++++++++++++++++------------------ newreport.php | 2 +- search.php | 4 +- showreport.php | 2 +- 4 files changed, 45 insertions(+), 50 deletions(-) diff --git a/includes/functions_product.php b/includes/functions_product.php index 963102d..f4feb30 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -19,54 +19,51 @@ || ################################################################### \*=====================================================================*/ -// ################################################################### /** -* Constructs a massive HTML -*/ -function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsolete = true) + * Constructs a massive HTML + */ +function construct_product_select($action = 'canviewbugs', $select = null, $obsolete = true) { - global $bugsys; - $output = ''; // index all of the components by parent and ID $components = array(); if (is_array(bugdar::$datastore['component'])) { - foreach (bugdar::$datastore['component'] AS $id => $prod) + foreach (bugdar::$datastore['component'] as $id => $prod) { $components["$prod[parentid]"]["$id"] = $prod; } } // these are products - foreach (bugdar::$datastore['product'] AS $productid => $product) + foreach (bugdar::$datastore['product'] as $productid => $product) { - if (!can_perform($action, $product['productid']) OR !can_perform('canviewbugs', $product['productid'])) + if (!can_perform($action, $product['productid']) || !can_perform('canviewbugs', $product['productid'])) { continue; } - if ($versions = ConstructVersionSelect($productid, $select, $obsolete)) + if ($versions = construct_version_select($productid, $select, $obsolete)) { - $output .= ConstructOptionGroup($product['title'], $versions); + $output .= construct_option_group($product['title'], $versions); } // these are components if ($components["$productid"]) { - foreach ($components["$productid"] AS $componentid => $component) + foreach ($components["$productid"] as $componentid => $component) { - $output .= ConstructOptionGroup($product['title'] . '/' . $component['title'], ConstructVersionSelect($componentid, $select, $obsolete)); + $output .= construct_option_group($product['title'] . '/' . $component['title'], construct_version_select($componentid, $select, $obsolete)); } } } @@ -74,19 +71,18 @@ function ConstructProductSelect($action = 'canviewbugs', $select = null, $obsole return $output; } -// ################################################################### /** -* Constructs a string of HTML block from a label and a string of -* HTML -* @param string HTML bits -* -* @return string Composed HTML -*/ -function ConstructOptionGroup($glabel, $optbits) + * Constructs an block from a label and a string of + * HTML + * @param string HTML bits + * + * @return string Composed HTML + */ +function construct_option_group($glabel, $optbits) { $tpl = new BSTemplate('selectoptgroup'); $tpl->vars = array( diff --git a/newreport.php b/newreport.php index a00df94..f343c42 100755 --- a/newreport.php +++ b/newreport.php @@ -190,7 +190,7 @@ if ($_REQUEST['do'] == 'add') $tpl = new BSTemplate('newreport'); $tpl->vars = array( 'reporter' => construct_user_display(bugdar::$userinfo), - 'productSelect' => ConstructProductSelect('cansubmitbugs', $input->in['product'], false), + 'productSelect' => construct_product_select('cansubmitbugs', $input->in['product'], false), 'select' => $select, 'customfields' => $customfields ); diff --git a/search.php b/search.php index e10608b..ad56a68 100644 --- a/search.php +++ b/search.php @@ -169,7 +169,7 @@ if ($_REQUEST['do'] == 'search') $tpl = new BSTemplate('search'); $tpl->vars = array( 'select' => $select, - 'productSelect' => ConstructProductSelect(), + 'productSelect' => construct_product_select(), 'customfields' => $customfields, 'searches' => $searches ); @@ -503,7 +503,7 @@ if ($_REQUEST['do'] == 'update') 'search' => $search, 'select' => $select, 'customfields' => $customfields, - 'productSelect' => ConstructProductSelect() + 'productSelect' => construct_product_select() ); $tpl->evaluate()->flush(); } diff --git a/showreport.php b/showreport.php index 1bd55ef..266438c 100644 --- a/showreport.php +++ b/showreport.php @@ -120,7 +120,7 @@ if ($show['edit']) } } - $productSelect = ConstructProductSelect('canviewbugs', "$bug[product],$bug[component],$bug[version]"); + $productSelect = construct_product_select('canviewbugs', "$bug[product],$bug[component],$bug[version]"); if ($bug['duplicateof']) { -- 2.22.5