2004-12-11 22:33:01 +00:00
|
|
|
<?php
|
2006-07-06 18:37:34 +00:00
|
|
|
/**
|
|
|
|
|
* Displays an application or a version.
|
|
|
|
|
*
|
|
|
|
|
* Mandatory parameters:
|
|
|
|
|
* - iAppId, application identifier
|
|
|
|
|
* OR
|
|
|
|
|
* - iVersionId, version identifier
|
|
|
|
|
*
|
|
|
|
|
* Optional parameters:
|
2007-09-14 23:27:36 -04:00
|
|
|
* - sSub, action to perform ("delete", "unqueue", "Submit a new bug link.")
|
2006-07-06 18:37:34 +00:00
|
|
|
* - iBuglinkId, bug identifier to link a bug with a version
|
|
|
|
|
*
|
|
|
|
|
* TODO:
|
|
|
|
|
* - replace sSub with iAction and replace "delete", "unqueue", etc. with integer constants DELETE, UNQUEUE, etc.
|
2006-07-11 18:53:06 +00:00
|
|
|
* - move and rename display_bundle into its respective modules
|
2006-07-06 18:37:34 +00:00
|
|
|
* - replace require_once with require after checking that it won't break anything
|
2004-03-15 16:22:00 +00:00
|
|
|
*/
|
2006-07-06 18:37:34 +00:00
|
|
|
|
|
|
|
|
// application environment
|
2006-07-07 18:14:53 +00:00
|
|
|
require("path.php");
|
2005-02-02 00:35:49 +00:00
|
|
|
require(BASE."include/incl.php");
|
2006-07-07 18:14:53 +00:00
|
|
|
require_once(BASE."include/application.php");
|
|
|
|
|
require_once(BASE."include/appdb.php");
|
|
|
|
|
require_once(BASE."include/vote.php");
|
|
|
|
|
require_once(BASE."include/category.php");
|
|
|
|
|
require_once(BASE."include/maintainer.php");
|
2004-11-09 22:41:18 +00:00
|
|
|
|
2005-02-19 01:23:02 +00:00
|
|
|
|
2004-12-11 03:25:13 +00:00
|
|
|
/**
|
2006-07-06 18:37:34 +00:00
|
|
|
* Displays the SUB apps that belong to this application.
|
2004-12-11 03:25:13 +00:00
|
|
|
*/
|
2006-06-27 19:16:27 +00:00
|
|
|
function display_bundle($iAppId)
|
2004-03-15 16:22:00 +00:00
|
|
|
{
|
2006-07-07 19:24:33 +00:00
|
|
|
$oApp = new Application($iAppId);
|
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);
|
2007-08-03 23:27:25 +00:00
|
|
|
if(!$hResult || query_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;
|
2007-08-03 23:27:25 +00:00
|
|
|
while($ob = query_fetch_object($hResult))
|
2006-06-21 01:04:12 +00:00
|
|
|
{
|
2007-04-03 02:08:44 +00:00
|
|
|
$oApp = new application($ob->appId);
|
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";
|
2007-04-03 02:08:44 +00:00
|
|
|
echo " <td>".$oApp->objectMakeLink()."</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();
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-06 17:49:48 +00:00
|
|
|
/**
|
|
|
|
|
* We want to see an application family (=no version).
|
|
|
|
|
*/
|
2007-07-24 01:45:19 +00:00
|
|
|
if( isset($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();
|
2007-07-24 01:45:19 +00:00
|
|
|
} else if( isset($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']);
|
2007-07-24 01:45:19 +00:00
|
|
|
$iTestingId = isset($aClean['iTestingId']) ? $aClean['iTestingId'] : null;
|
|
|
|
|
$oVersion->display($iTestingId);
|
2006-01-29 04:04:46 +00:00
|
|
|
} 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-07-06 18:44:56 +00:00
|
|
|
util_show_error_page_and_exit('Page Called with No Params!');
|
2004-03-15 16:22:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
apidb_footer();
|
2004-12-11 22:33:01 +00:00
|
|
|
?>
|