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
|
|
|
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2005-02-19 01:23:02 +00:00
|
|
|
$oApp = new Application($_REQUEST['appId']);
|
|
|
|
|
$oVersion = new Version($_REQUEST['versionId']);
|
|
|
|
|
|
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
|
|
|
|
|
*/
|
2004-03-15 16:22:00 +00:00
|
|
|
function display_bundle($appId)
|
|
|
|
|
{
|
2005-02-07 23:21:33 +00:00
|
|
|
$oApp = new Application($appId);
|
2005-01-05 05:29:42 +00:00
|
|
|
$result = query_appdb("SELECT appFamily.appId, appName, description FROM appBundle, appFamily ".
|
2005-02-19 01:21:14 +00:00
|
|
|
"WHERE appFamily.queued='false' AND bundleId = $appId AND appBundle.appId = appFamily.appId");
|
2004-03-15 16:22:00 +00:00
|
|
|
if(!$result || mysql_num_rows($result) == 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;
|
2004-12-11 03:25:13 +00:00
|
|
|
while($ob = mysql_fetch_object($result)) {
|
|
|
|
|
//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";
|
|
|
|
|
echo " <td><a href=\"appview.php?appId=$ob->appId\">".stripslashes($ob->appName)."</a></td>\n";
|
2005-02-07 23:21:33 +00:00
|
|
|
echo " <td>".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();
|
|
|
|
|
}
|
|
|
|
|
|
2004-12-29 03:48:47 +00:00
|
|
|
/* Show note */
|
|
|
|
|
function show_note($sType,$oData){
|
2005-02-19 01:23:02 +00:00
|
|
|
global $oVersion;
|
|
|
|
|
|
2004-12-29 03:48:47 +00:00
|
|
|
switch($sType)
|
|
|
|
|
{
|
|
|
|
|
case 'WARNING':
|
|
|
|
|
$color = 'red';
|
|
|
|
|
$title = 'Warning';
|
|
|
|
|
break;
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-29 03:48:47 +00:00
|
|
|
case 'HOWTO';
|
|
|
|
|
$color = 'green';
|
|
|
|
|
$title = 'HOWTO';
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2004-12-11 03:25:13 +00:00
|
|
|
|
2004-12-29 03:48:47 +00:00
|
|
|
if(!empty($oData->noteTitle))
|
|
|
|
|
$title = $oData->noteTitle;
|
|
|
|
|
else
|
|
|
|
|
$title = 'Note';
|
|
|
|
|
|
|
|
|
|
$color = 'blue';
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
2004-12-29 03:48:47 +00:00
|
|
|
$s = html_frame_start("","98%",'',0);
|
|
|
|
|
|
2005-02-11 23:42:50 +00:00
|
|
|
$s .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\">\n";
|
2005-02-14 18:22:04 +00:00
|
|
|
$s .= "<tr bgcolor=\"".$color."\" align=\"center\" valign=\"top\"><td><b>".$title."</b></td></tr>\n";
|
2005-02-11 23:42:50 +00:00
|
|
|
$s .= "<tr><td class=\"note\">\n";
|
2005-02-05 17:08:10 +00:00
|
|
|
$s .= $oData->noteDesc;
|
2004-12-29 03:48:47 +00:00
|
|
|
$s .= "</td></tr>\n";
|
|
|
|
|
|
2005-02-19 01:23:02 +00:00
|
|
|
if ($_SESSION['current']->hasPriv("admin") || $_SESSION['current']->isMaintainer($oVersion->iVersionId) || $_SESSION['current']->isSuperMaintainer($oVersion->iAppId))
|
2004-12-11 03:25:13 +00:00
|
|
|
{
|
2005-02-14 18:22:04 +00:00
|
|
|
$s .= "<tr class=\"color1\" align=\"center\" valign=\"top\"><td>";
|
2005-02-11 23:42:50 +00:00
|
|
|
$s .= "<form method=\"post\" name=\"message\" action=\"admin/editAppNote.php?noteId={$oData->noteId}\">";
|
|
|
|
|
$s .= '<input type="submit" value="Edit Note" class="button">';
|
2004-12-29 03:48:47 +00:00
|
|
|
$s .= '</form></td></tr>';
|
2004-12-11 03:25:13 +00:00
|
|
|
}
|
2004-03-15 16:22:00 +00:00
|
|
|
|
2004-12-29 03:48:47 +00:00
|
|
|
$s .= "</table>\n";
|
|
|
|
|
$s .= html_frame_end();
|
|
|
|
|
|
|
|
|
|
return $s;
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
2005-02-02 03:01:29 +00:00
|
|
|
if(!is_numeric($_REQUEST['appId']) && !is_numeric($_REQUEST['versionId']))
|
2004-12-27 05:18:41 +00:00
|
|
|
{
|
2005-02-02 03:01:29 +00:00
|
|
|
errorpage("Something went wrong with the application or version id");
|
2004-12-27 05:18:41 +00:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-13 01:16:37 +00:00
|
|
|
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;
|
|
|
|
|
}
|
2005-09-30 01:55:51 +00:00
|
|
|
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;
|
|
|
|
|
}
|
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).
|
|
|
|
|
*/
|
2005-02-02 03:01:29 +00:00
|
|
|
if($_REQUEST['appId'])
|
2004-03-15 20:39:12 +00:00
|
|
|
{
|
2005-02-06 17:49:48 +00:00
|
|
|
$oApp = new Application($_REQUEST['appId']);
|
2006-01-29 04:04:46 +00:00
|
|
|
$oApp->display();
|
|
|
|
|
} else if($_REQUEST['versionId']) // We want to see a particular version.
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2005-02-06 17:49:48 +00:00
|
|
|
$oVersion = new Version($_REQUEST['versionId']);
|
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!
|
|
|
|
|
errorpage('Page Called with No Params!');
|
|
|
|
|
exit;
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
apidb_footer();
|
2004-12-11 22:33:01 +00:00
|
|
|
?>
|