getCategoryPath(), $appId, $versionId);
echo html_frame_start("",'98%','',2);
echo "
Category: ". $catFullPath ."
\n";
echo html_frame_end();
}
/**
* display the SUB apps that belong to this app
*/
function display_bundle($appId)
{
$oApp = new Application($appId);
$result = query_appdb("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
"WHERE appFamily.queued='false' AND bundleId = $appId AND appBundle.appId = appFamily.appId");
if(!$result || mysql_num_rows($result) == 0)
{
return; // do nothing
}
echo html_frame_start("","98%","",0);
echo "
\n\n";
echo "\n";
echo " | Application Name | \n";
echo " Description | \n";
echo "
\n\n";
$c = 0;
while($ob = mysql_fetch_object($result)) {
//set row color
$bgcolor = ($c % 2 == 0) ? "color0" : "color1";
//display row
echo "\n";
echo " | appId\">".stripslashes($ob->appName)." | \n";
echo " ".trim_description($oApp->sDescription)." | \n";
echo "
\n\n";
$c++;
}
echo "
\n\n";
echo html_frame_end();
}
/* Show note */
function show_note($sType,$oData){
global $oVersion;
switch($sType)
{
case 'WARNING':
$color = 'red';
$title = 'Warning';
break;
case 'HOWTO';
$color = 'green';
$title = 'HOWTO';
break;
default:
if(!empty($oData->noteTitle))
$title = $oData->noteTitle;
else
$title = 'Note';
$color = 'blue';
}
$s = html_frame_start("","98%",'',0);
$s .= "\n";
$s .= "| ".$title." |
\n";
$s .= "| \n";
$s .= $oData->noteDesc;
$s .= " |
\n";
if ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($oVersion->iVersionId) || $_SESSION['current']->isSuperMaintainer($oVersion->iAppId))
{
$s .= "| ";
$s .= " |
';
}
$s .= "
\n";
$s .= html_frame_end();
return $s;
}
if(!is_numeric($_REQUEST['appId']) && !is_numeric($_REQUEST['versionId']))
{
errorpage("Something went wrong with the application or version id");
exit;
}
if ($_REQUEST['sub'])
{
if(($_REQUEST['sub'] == 'delete' ) && ($_REQUEST['buglinkId']))
{
if(($_SESSION['current']->hasPriv("admin") ||
$_SESSION['current']->isMaintainer($oVersion->iVersionId) ||
$_SESSION['current']->isSuperMaintainer($oVersion->iAppId)))
{
$oBuglink = new bug($_REQUEST['buglinkId']);
$oBuglink->delete();
redirect(apidb_fullurl("appview.php?versionId=".$_REQUEST['versionId']));
exit;
}
}
if(($_REQUEST['sub'] == 'unqueue' ) && ($_REQUEST['buglinkId']))
{
if(($_SESSION['current']->hasPriv("admin") ||
$_SESSION['current']->isMaintainer($oVersion->iVersionId) ||
$_SESSION['current']->isSuperMaintainer($oVersion->iAppId)))
{
$oBuglink = new bug($_REQUEST['buglinkId']);
$oBuglink->unqueue();
redirect(apidb_fullurl("appview.php?versionId=".$_REQUEST['versionId']));
exit;
}
}
if(($_REQUEST['sub'] == 'Submit a new bug link.' ) && ($_REQUEST['buglinkId']))
{
$oBuglink = new bug();
$oBuglink->create($_REQUEST['versionId'],$_REQUEST['buglinkId']);
redirect(apidb_fullurl("appview.php?versionId=".$_REQUEST['versionId']));
exit;
}
if($_REQUEST['sub'] == 'StartMonitoring')
{
$oMonitor = new Monitor();
$oMonitor->create($_SESSION['current']->iUserId,$_REQUEST['appId'],$_REQUEST['versionId']);
redirect(apidb_fullurl("appview.php?versionId=".$_REQUEST['versionId']));
exit;
}
if($_REQUEST['sub'] == 'StopMonitoring')
{
$oMonitor = new Monitor();
$oMonitor->find($_SESSION['current']->iUserId,$_REQUEST['appId'],$_REQUEST['versionId']);
if($oMonitor->iMonitorId)
{
$oMonitor->delete();
}
redirect(apidb_fullurl("appview.php?versionId=".$_REQUEST['versionId']));
exit;
}
}
/**
* We want to see an application family (=no version).
*/
if($_REQUEST['appId'])
{
$oApp = new Application($_REQUEST['appId']);
$oApp->display();
} else if($_REQUEST['versionId']) // We want to see a particular version.
{
$oVersion = new Version($_REQUEST['versionId']);
$oVersion->display();
} else
{
// Oops! Called with no params, bad llamah!
errorpage('Page Called with No Params!');
exit;
}
apidb_footer();
?>