Integrate APPDB with Bugzilla to use the versions table from Bugzilla.

This commit is contained in:
Tony Lambregts
2004-12-13 03:50:11 +00:00
committed by WineHQ
parent 5642e73425
commit dca5a408cb
6 changed files with 228 additions and 46 deletions

View File

@@ -26,4 +26,14 @@ $userdb_dbpass = "lemonade";
$userdb_dbhost = "localhost";
$userdb_db = "apidb";
/*
* Bugzilla database info
*/
$bugzilla_dbuser = "root";
$bugzilla_dbpass = "";
$bugzilla_dbhost = "localhost";
$bugzilla_db = "bugs";
/* $bugzilla_db_port = 3306; is this needed? I dont think so.*/
$bugzilla_product_id = 1;
?>

View File

@@ -171,6 +171,68 @@ function get_xml_tag ($file, $mode = null)
}
}
/* bugzilla functions */
function openbugzilladb()
{
global $bugzilla_dbuser, $bugzilla_dbpass, $bugzilla_dbhost, $bugzilla_db, $bugzilla_product_id;
global $dbcon, $dbref;
$dbref++;
if($dbcon)
return $dbcon;
$dbcon = mysql_connect($bugzilla_dbhost, $bugzilla_dbuser, $bugzilla_dbpass);
if(!$dbcon)
{
echo "An error occurred: ".mysql_error()."<p>\n";
exit;
}
mysql_select_db($bugzilla_db);
return $dbcon;
}
function closebugzilladb()
{
global $dbcon, $dbref;
if(--$dbref)
return;
mysql_close($adbcon);
}
function make_bugzilla_version_list($varname, $cvalue)
{
global $bugzilla_db, $bugzilla_product_id;
$table = $bugzilla_db.".versions";
$where = "WHERE product_id=".$bugzilla_product_id;
$query = "SELECT value FROM $table $where ORDER BY value";
openbugzilladb();
$result = mysql_query($query);
if(!$result)
{
closebugzilladb();
return; // Oops
}
echo "<select name='$varname'>\n";
echo "<option value=0>Choose ...</option>\n";
while(list($value) = mysql_fetch_row($result))
{
if($id == $cvalue)
echo "<option value=$value selected>$value\n";
else
echo "<option value=$value>$value\n";
}
echo "</select>\n";
closebugzilladb();
}
/* get the number of applications in the appQueue table */
function getQueuedAppCount()
{