2004-12-11 22:33:01 +00:00
|
|
|
<?php
|
2004-12-11 03:25:13 +00:00
|
|
|
/**********************************/
|
|
|
|
|
/* code to display an application */
|
|
|
|
|
/**********************************/
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-25 20:08:00 +00:00
|
|
|
/*
|
2004-12-27 23:54:55 +00:00
|
|
|
* application environment
|
2004-03-15 16:22:00 +00:00
|
|
|
*/
|
|
|
|
|
include("path.php");
|
2005-02-02 00:35:49 +00:00
|
|
|
require(BASE."include/incl.php");
|
|
|
|
|
require(BASE."include/application.php");
|
|
|
|
|
require(BASE."include/appdb.php");
|
|
|
|
|
require(BASE."include/vote.php");
|
|
|
|
|
require(BASE."include/category.php");
|
|
|
|
|
require(BASE."include/maintainer.php");
|
2005-07-13 01:16:37 +00:00
|
|
|
require(BASE."include/mail.php");
|
2005-09-30 01:55:51 +00:00
|
|
|
require(BASE."include/monitor.php");
|
2005-10-17 03:59:24 +00:00
|
|
|
require_once(BASE."include/testResults.php");
|
2004-11-09 22:41:18 +00:00
|
|
|
|
2006-06-17 06:10:10 +00:00
|
|
|
$aClean = array(); //array of filtered user input
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$aClean['iAppId'] = makeSafe($_REQUEST['iAppId']);
|
|
|
|
|
$aClean['iVersionId'] = makeSafe($_REQUEST['iVersionId']);
|
|
|
|
|
$aClean['sSub'] = makeSafe($_REQUEST['sSub']);
|
|
|
|
|
$aClean['iBuglinkId'] = makeSafe($_REQUEST['iBuglinkId']);
|
2006-06-17 06:10:10 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
$oApp = new Application($aClean['iAppId']);
|
|
|
|
|
$oVersion = new Version($aClean['iVersionId']);
|
2005-02-19 01:23:02 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
2004-12-29 20:21:31 +00:00
|
|
|
* display the full path of the Category we are looking at
|
2004-12-11 03:25:13 +00:00
|
|
|
*/
|
2004-12-25 20:11:13 +00:00
|
|
|
function display_catpath($catId, $appId, $versionId = '')
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
|
|
|
|
$cat = new Category($catId);
|
|
|
|
|
|
2004-12-25 20:11:13 +00:00
|
|
|
$catFullPath = make_cat_path($cat->getCategoryPath(), $appId, $versionId);
|
2004-03-15 16:22:00 +00:00
|
|
|
echo html_frame_start("",'98%','',2);
|
2004-12-29 20:21:31 +00:00
|
|
|
echo "<p><b>Category: ". $catFullPath ."</b><br />\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* display the SUB apps that belong to this app
|
|
|
|
|
*/
|
2006-06-27 19:16:27 +00:00
|
|
|
function display_bundle($iAppId)
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2005-02-07 23:21:33 +00:00
|
|
|
$oApp = new Application($appId);
|
2006-06-27 19:16:27 +00:00
|
|
|
$hResult = query_parameters("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
|
|
|
|
"WHERE appFamily.queued='false' AND bundleId = '?' AND appBundle.appId = appFamily.appId",
|
|
|
|
|
$iAppId);
|
2006-06-21 01:04:12 +00:00
|
|
|
if(!$hResult || mysql_num_rows($hResult) == 0)
|
2004-12-11 03:25:13 +00:00
|
|
|
{
|
|
|
|
|
return; // do nothing
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
echo html_frame_start("","98%","",0);
|
2005-02-11 23:42:50 +00:00
|
|
|
echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">\n\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2005-02-11 23:42:50 +00:00
|
|
|
echo "<tr class=\"color4\">\n";
|
2005-02-09 23:48:31 +00:00
|
|
|
echo " <td>Application Name</td>\n";
|
|
|
|
|
echo " <td>Description</td>\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
echo "</tr>\n\n";
|
|
|
|
|
|
|
|
|
|
$c = 0;
|
2006-06-21 01:04:12 +00:00
|
|
|
while($ob = mysql_fetch_object($hResult))
|
|
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
//set row color
|
|
|
|
|
$bgcolor = ($c % 2 == 0) ? "color0" : "color1";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
//display row
|
2005-02-11 23:42:50 +00:00
|
|
|
echo "<tr class=\"$bgcolor\">\n";
|
2006-07-06 17:27:54 +00:00
|
|
|
echo " <td><a href=\"appview.php?iAppId=$ob->appId\">".stripslashes($ob->appName)."</a></td>\n";
|
2006-06-29 16:07:19 +00:00
|
|
|
echo " <td>".util_trim_description($oApp->sDescription)."</td>\n";
|
2004-12-11 03:25:13 +00:00
|
|
|
echo "</tr>\n\n";
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
$c++;
|
|
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
|
|
|
|
echo "</table>\n\n";
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
}
|
|
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if(!is_numeric($aClean['iAppId']) && !is_numeric($aClean['iVersionId']))
|
2006-06-29 16:13:35 +00:00
|
|
|
util_show_error_page("Something went wrong with the application or version id");
|
2004-12-27 05:18:41 +00:00
|
|
|
|
2006-07-06 17:27:54 +00:00
|
|
|
if ($aClean['sSub'])
|
2005-07-13 01:16:37 +00:00
|
|
|
{
|
2006-07-06 17:27:54 +00:00
|
|
|
if(($aClean['sSub'] == 'delete' ) && ($aClean['iBuglinkId']))
|
2005-07-13 01:16:37 +00:00
|
|
|
{
|
|
|
|
|
if(($_SESSION['current']->hasPriv("admin") ||
|
|
|
|
|
$_SESSION['current']->isMaintainer($oVersion->iVersionId) ||
|
|
|
|
|
$_SESSION['current']->isSuperMaintainer($oVersion->iAppId)))
|
|
|
|
|
{
|
2006-07-06 17:27:54 +00:00
|
|
|
$oBuglink = new bug($aClean['iBuglinkId']);
|
2005-07-13 01:16:37 +00:00
|
|
|
$oBuglink->delete();
|
2006-07-06 17:27:54 +00:00
|
|
|
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
|
2005-07-13 01:16:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2006-07-06 17:27:54 +00:00
|
|
|
if(($aClean['sSub'] == 'unqueue' ) && ($aClean['iBuglinkId']))
|
2005-07-13 01:16:37 +00:00
|
|
|
{
|
|
|
|
|
if(($_SESSION['current']->hasPriv("admin") ||
|
|
|
|
|
$_SESSION['current']->isMaintainer($oVersion->iVersionId) ||
|
|
|
|
|
$_SESSION['current']->isSuperMaintainer($oVersion->iAppId)))
|
|
|
|
|
{
|
2006-07-06 17:27:54 +00:00
|
|
|
$oBuglink = new bug($aClean['iBuglinkId']);
|
2005-07-13 01:16:37 +00:00
|
|
|
$oBuglink->unqueue();
|
2006-07-06 17:27:54 +00:00
|
|
|
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
|
2005-07-13 01:16:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2006-07-06 17:27:54 +00:00
|
|
|
if(($aClean['sSub'] == 'Submit a new bug link.' ) && ($aClean['iBuglinkId']))
|
2005-07-13 01:16:37 +00:00
|
|
|
{
|
|
|
|
|
$oBuglink = new bug();
|
2006-07-06 17:27:54 +00:00
|
|
|
$oBuglink->create($aClean['iVersionId'],$aClean['iBuglinkId']);
|
|
|
|
|
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
|
2005-07-13 01:16:37 +00:00
|
|
|
}
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sSub'] == 'StartMonitoring')
|
2005-09-30 01:55:51 +00:00
|
|
|
{
|
|
|
|
|
$oMonitor = new Monitor();
|
2006-07-06 17:27:54 +00:00
|
|
|
$oMonitor->create($_SESSION['current']->iUserId,$aClean['iAppId'],$aClean['iVersionId']);
|
|
|
|
|
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
|
2005-09-30 01:55:51 +00:00
|
|
|
}
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['sSub'] == 'StopMonitoring')
|
2005-09-30 01:55:51 +00:00
|
|
|
{
|
|
|
|
|
$oMonitor = new Monitor();
|
2006-07-06 17:27:54 +00:00
|
|
|
$oMonitor->find($_SESSION['current']->iUserId,$aClean['iAppId'],$aClean['iVersionId']);
|
2005-09-30 01:55:51 +00:00
|
|
|
if($oMonitor->iMonitorId)
|
|
|
|
|
{
|
|
|
|
|
$oMonitor->delete();
|
|
|
|
|
}
|
2006-07-06 17:27:54 +00:00
|
|
|
redirect(apidb_fullurl("appview.php?iVersionId=".$aClean['iVersionId']));
|
2005-09-30 01:55:51 +00:00
|
|
|
}
|
2004-12-27 05:18:41 +00:00
|
|
|
|
2005-07-13 01:16:37 +00:00
|
|
|
}
|
2005-02-06 17:49:48 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* We want to see an application family (=no version).
|
|
|
|
|
*/
|
2006-07-06 17:27:54 +00:00
|
|
|
if($aClean['iAppId'])
|
2004-03-15 20:39:12 +00:00
|
|
|
{
|
2006-07-06 17:27:54 +00:00
|
|
|
$oApp = new Application($aClean['iAppId']);
|
2006-01-29 04:04:46 +00:00
|
|
|
$oApp->display();
|
2006-07-06 17:27:54 +00:00
|
|
|
} else if($aClean['iVersionId']) // We want to see a particular version.
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2006-07-06 17:27:54 +00:00
|
|
|
$oVersion = new Version($aClean['iVersionId']);
|
2006-01-29 04:04:46 +00:00
|
|
|
$oVersion->display();
|
|
|
|
|
} else
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2004-12-11 03:25:13 +00:00
|
|
|
// Oops! Called with no params, bad llamah!
|
2006-06-29 16:13:35 +00:00
|
|
|
util_show_error_page('Page Called with No Params!');
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
apidb_footer();
|
2004-12-11 22:33:01 +00:00
|
|
|
?>
|