farhad.khan
10-14-2010, 06:23 PM
Hi,
We work with multiple versions within the same project and find it very daunting that the default issue list shows issues from all versions and all statuses.
We are trying to change it such that the default do=issuelist query does the following. Any help will be much appreciated.
1. Check for the latest version
2. Load only issues in the latest version and with status "any active"
Here's how far I've gone:
In project.php @ if ($_REQUEST['do'] == 'issuelist'), I could add the following
if (!empty($vbulletin->GPC['appliesversionid']))
{
if ($vbulletin->GPC['appliesversionid'] == -1)
{
$version_filter = -1;
}
else
{
$type = $vbulletin->GPC['appliesversionid'][0];
$value = intval(substr($vbulletin->GPC['appliesversionid'], 1));
if ($type == 'g')
{
$group_filter = $value;
}
else
{
$version_filter = $value;
}
}
}
else
{
/***** Load latest version ******/
/***** Apply version filter ******/
}
What I don't know is how to load the latest version and how to apply the filter.
The latest version could probably be found by doing the following (found frmo another post). But how do I apply the filter?
$version = $db->query_first("
SELECT versionname
FROM mytable_pt_projectversion
WHERE projectid = 2 AND projectversiongroupid = 1 AND displayorder = 10;
");
We work with multiple versions within the same project and find it very daunting that the default issue list shows issues from all versions and all statuses.
We are trying to change it such that the default do=issuelist query does the following. Any help will be much appreciated.
1. Check for the latest version
2. Load only issues in the latest version and with status "any active"
Here's how far I've gone:
In project.php @ if ($_REQUEST['do'] == 'issuelist'), I could add the following
if (!empty($vbulletin->GPC['appliesversionid']))
{
if ($vbulletin->GPC['appliesversionid'] == -1)
{
$version_filter = -1;
}
else
{
$type = $vbulletin->GPC['appliesversionid'][0];
$value = intval(substr($vbulletin->GPC['appliesversionid'], 1));
if ($type == 'g')
{
$group_filter = $value;
}
else
{
$version_filter = $value;
}
}
}
else
{
/***** Load latest version ******/
/***** Apply version filter ******/
}
What I don't know is how to load the latest version and how to apply the filter.
The latest version could probably be found by doing the following (found frmo another post). But how do I apply the filter?
$version = $db->query_first("
SELECT versionname
FROM mytable_pt_projectversion
WHERE projectid = 2 AND projectversiongroupid = 1 AND displayorder = 10;
");