datastore['product'] AS $product)
{
if ($product['componentmother'])
{
$components["$product[componentmother]"]["$product[productid]"] = $product;
}
else
{
$products["$product[productid]"] = $product;
}
}
foreach ($bugsys->datastore['version'] AS $version)
{
$versions["$version[productid]"]["$version[versionid]"] = $version;
}
foreach ($products AS $product)
{
if (!can_perform($action, $product['productid']) OR !can_perform('canviewbugs', $product['productid']))
{
continue;
}
// set options
$OPTIONS = '';
// prefix
$valuepfx = "p$product[productid]";
// construct global options
$OPTIONS .= construct_pcv_select_global_version($product['productid'], 0, $versions, 0, $prefix, $select);
// any immediate versions
if (is_array($versions["$product[productid]"]))
{
foreach ($versions["$product[productid]"] AS $version)
{
$OPTIONS .= construct_option($version['version'], "{$valuepfx}c0v$version[versionid]", $select, 0, $prefix);
}
}
else
{
$OPTIONS = '';
}
// components (can't be a nested