From da23fc69a796a8f4e0dacd1916add832e260c024 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 4 Dec 2006 06:43:36 +0000 Subject: [PATCH] r1332: Removing the last of the old product selection system --- editreport.php | 4 +- includes/functions_product.php | 76 ------------------------ productselect.php | 102 --------------------------------- 3 files changed, 1 insertion(+), 181 deletions(-) delete mode 100644 productselect.php diff --git a/editreport.php b/editreport.php index af2ff9b..5c4c986 100644 --- a/editreport.php +++ b/editreport.php @@ -184,9 +184,7 @@ if ($_POST['do'] == 'update') } // ------------------------------------------------------------------- - // do update stuff - $pcv = parse_pcv_select($bugsys->in['pcv_select'], true); - + // do update stuff $dependencies = preg_split('#([^0-9].*?)#', $bugsys->in['dependency'], -1, PREG_SPLIT_NO_EMPTY); $dependencies = ((sizeof($dependencies) < 1) ? '' : implode(', ', $dependencies)); diff --git a/includes/functions_product.php b/includes/functions_product.php index 65cd58d..5191854 100644 --- a/includes/functions_product.php +++ b/includes/functions_product.php @@ -122,82 +122,6 @@ function ConstructOptionGroup($glabel, $optbits) return $HTML; } -// ###################### Start parse_pcv_select ##################### -function parse_pcv_select($input, $validate = false) -{ - global $bugsys; - - $input = trim($input); - - if (preg_match('#^p(\d+?)c(\d+?)v(\d+?)$#', $input) == 0) - { - return false; - } - - $trio = preg_split('#(p|c|v)#i', $input, -1, PREG_SPLIT_NO_EMPTY); - if (sizeof($trio) != 3) - { - return false; - } - - $pcv = array('product' => intval($trio[0]), 'component' => intval($trio[1]), 'version' => intval($trio[2])); - - if (!$validate) - { - return $return; - } - else - { - // ------------------------------------------------------------------- - // pcv validation - $product = $bugsys->datastore['product'][ $pcv['product'] ]; - if (!$product) - { - return false; - } - $version = $bugsys->datastore['version'][ $pcv['version'] ]; - if (!$version) - { - return false; - } - // no component - if ($pcv['component'] == 0) - { - // not global version and version.productid != product.productid - if ($version['productid'] != 0 AND $version['productid'] != $product['productid']) - { - return false; - } - } - // using a component - else - { - $component = $bugsys->datastore['product'][ $pcv['component'] ]; - // component has the right mother - if ($component['componentmother'] == $product['productid']) - { - // version.productid != {component.productid | product.productid} - if (($version['productid'] != $component['productid'] AND $version['productid'] != $product['productid']) AND $version['productid'] != 0) - { - return false; - } - } - else - { - return false; - } - } - - if (!can_perform('canviewbugs', $product['productid'])) - { - return false; - } - - return $pcv; - } -} - - /*=====================================================================*\ || ################################################################### || # $HeadURL$ diff --git a/productselect.php b/productselect.php deleted file mode 100644 index 58bd5e7..0000000 --- a/productselect.php +++ /dev/null @@ -1,102 +0,0 @@ -input_clean('product', TYPE_UINT); - $bugsys->input_clean('component', TYPE_UINT); - $bugsys->input_clean('version', TYPE_UINT); - - $bits = ''; - - if ($bugsys->in['piece'] == 'product') - { - if ($bugsys->in['product'] == 0) - { - $value = 0; - $label = _('-- None --'); - $selected = (!$bugsys->in['component']); - eval('$bits .= "' . $template->fetch('selectoption') . '";'); - } - - foreach ($bugsys->datastore['product'] AS $value => $prod) - { - if ($prod['componentmother'] == 0) - { - $label = $prod['title']; - $selected = ($value == $bugsys->in['product']); - eval('$bits .= "' . $template->fetch('selectoption') . '";'); - } - } - } - else if ($bugsys->in['piece'] == 'component' AND $bugsys->in['product'] != 0) - { - $value = 0; - $label = _('-- None --'); - $selected = (!$bugsys->in['component']); - eval('$bits .= "' . $template->fetch('selectoption') . '";'); - - foreach ($bugsys->datastore['product'] AS $value => $prod) - { - if ($prod['componentmother'] == $bugsys->in['product']) - { - $label = $prod['title']; - $selected = ($value == $bugsys->in['component']); - eval('$bits .= "' . $template->fetch('selectoption') . '";'); - } - } - } - else if ($bugsys->in['piece'] == 'version' AND $bugsys->in['product'] != 0) - { - foreach ($bugsys->datastore['version'] AS $value => $vers) - { - if ($vers['productid'] == $bugsys->in['product'] OR $vers['productid'] == $bugsys->in['component'] OR intval($vers['productid']) == 0) - { - $label = $vers['version']; - $selected = ($value == $bugsys->in['version']); - eval('$bits .= "' . $template->fetch('selectoption') . '";'); - } - } - } - - echo $bits; -} - -/*=====================================================================* -|| ################################################################### -|| # $HeadURL$ -|| # $Id$ -|| ################################################################### -\*=====================================================================*/ -?> \ No newline at end of file -- 2.43.5