From d33e1d612d90e774d649690f1dabe0cccf4240de Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 18 Feb 2005 07:07:10 +0000 Subject: [PATCH] r60: Removed file-based PCV parsing and handed it off to parse_pcv_select. --- newreport.php | 51 +++------------------------------------------------ 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/newreport.php b/newreport.php index d476048..c68753b 100755 --- a/newreport.php +++ b/newreport.php @@ -12,7 +12,7 @@ $fetchtemplates = array( 'newreport', - 'productselect' + 'pcv_select_row' ); require_once('./global.php'); @@ -83,13 +83,13 @@ if ($_POST['do'] == 'insert') // ------------------------------------------------------------------- // product/component/version stuff - $vars['pcv'] = parse_pcv_select($vars['pcv_select']); + $vars['pcv'] = parse_pcv_select($vars['pcv_select'], true); print_r($vars); // ------------------------------------------------------------------- // sanity checks - if (!is_array($vars['pcv'])) + if (!$vars['pcv']) { echo 'there was a problem selecting the product, component, or version'; exit; @@ -105,51 +105,6 @@ if ($_POST['do'] == 'insert') exit; } - // ------------------------------------------------------------------- - // pcv validation - $product = $bugsys->datastore['product'][ $vars['pcv']['product'] ]; - if (!$product) - { - echo 'please select a valid product'; - exit; - } - $version = $bugsys->datastore['version'][ $vars['pcv']['version'] ]; - if (!$version) - { - echo 'please select a valid version'; - exit; - } - // no component - if ($vars['pcv']['component'] == 0) - { - // not global version and version.productid != product.productid - if ($version['productid'] != 0 AND $version['productid'] != $product['productid']) - { - echo 'invalid version specified'; - exit; - } - } - // using a component - else - { - $component = $bugsys->datastore['product'][ $vars['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) - { - echo 'invalid version specified'; - exit; - } - } - else - { - echo 'invalid component specified'; - exit; - } - } - // ------------------------------------------------------------------- // data clean and insert $vars['comment_parsed'] = $vars['comment']; -- 2.22.5