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$
+++ /dev/null
-<?php
-/*=====================================================================*
-|| ###################################################################
-|| # Bugdar [#]version[#]
-|| # Copyright ©2002-[#]year[#] Blue Static
-|| #
-|| # This program is free software; you can redistribute it and/or modify
-|| # it under the terms of the GNU General Public License as published by
-|| # the Free Software Foundation; version [#]gpl[#] of the License.
-|| #
-|| # This program is distributed in the hope that it will be useful, but
-|| # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-|| # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-|| # more details.
-|| #
-|| # You should have received a copy of the GNU General Public License along
-|| # with this program; if not, write to the Free Software Foundation, Inc.,
-|| # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-|| ###################################################################
-\*=====================================================================*/
-
-define('SVN', '$Id$');
-
-require_once('./global.php');
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'pcvselect')
-{
-
-}
-
-// ###################################################################
-
-if ($_REQUEST['do'] == 'pcvajax')
-{
- $bugsys->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