Let users view distributions
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
/*******************************************************/
|
||||
/* code to view and maintain the list of Distributions */
|
||||
/*******************************************************/
|
||||
|
||||
/*
|
||||
* application environment
|
||||
*/
|
||||
include("path.php");
|
||||
require(BASE."include/incl.php");
|
||||
require_once(BASE."include/distributions.php");
|
||||
|
||||
if(!$_SESSION['current']->hasPriv("admin"))
|
||||
{
|
||||
errorpage("Insufficient privileges.");
|
||||
exit;
|
||||
}
|
||||
if ($_REQUEST['sub'])
|
||||
{
|
||||
if($_REQUEST['sub'] == 'delete')
|
||||
{
|
||||
$oDistribution = new distribution($_REQUEST['iDistributionId']);
|
||||
$oDistribution->delete();
|
||||
redirect(apidb_fullurl("admin/adminDistributions.php"));
|
||||
}
|
||||
} else
|
||||
{
|
||||
apidb_header("Admin Distributions");
|
||||
|
||||
//get available Distributions
|
||||
$sQuery = "SELECT distributionId FROM distributions ORDER BY name, distributionId;";
|
||||
$hResult = query_appdb($sQuery);
|
||||
|
||||
// show Distribution list
|
||||
echo html_frame_start("","90%","",0);
|
||||
echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
|
||||
|
||||
echo "<tr class=color4>\n";
|
||||
echo " <td>Distribution name</td>\n";
|
||||
echo " <td>Distribution url</td>\n";
|
||||
echo " <td>Linked Tests</td>\n";
|
||||
echo " <td align=\"center\">Action</td>\n";
|
||||
echo "</tr>\n\n";
|
||||
|
||||
$c = 1;
|
||||
while($ob = mysql_fetch_object($hResult))
|
||||
{
|
||||
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
||||
$oDistribution = new distribution($ob->distributionId);
|
||||
echo "<tr class=\"$bgcolor\">\n";
|
||||
echo " <td><a href=\"".BASE."distributionView.php?iDistributionId=".$oDistribution->iDistributionId."\">","\n";
|
||||
echo $oDistribution->sName."</a></td>\n";
|
||||
echo " <td><a href=\"".$oDistribution->sUrl."\">".$oDistribution->sUrl."</a></td>\n";
|
||||
echo " <td>".sizeof($oDistribution->aTestingIds)."</td>\n";
|
||||
echo " <td align=\"center\">";
|
||||
echo "[<a href='editDistribution.php?iDistributionId=".$oDistribution->iDistributionId."'>edit</a>]";
|
||||
if(!sizeof($oDistribution->aTestingIds))
|
||||
echo " [<a href='adminDistributions.php?sub=delete&iDistributionId=".$oDistribution->iDistributionId."'>delete</a>]";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n\n";
|
||||
$c++;
|
||||
}
|
||||
echo "</table>\n\n";
|
||||
echo html_frame_end(" ");
|
||||
|
||||
}
|
||||
|
||||
apidb_footer();
|
||||
?>
|
||||
@@ -5,7 +5,7 @@ require(BASE."include/distributions.php");
|
||||
|
||||
if(!$_SESSION['current']->hasPriv("admin"))
|
||||
{
|
||||
errorpage();
|
||||
errorpage("Insufficient privileges.");
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ if($_REQUEST['Submit'])
|
||||
$oDistribution->create();
|
||||
}
|
||||
|
||||
redirect(apidb_fullurl("admin/adminDistributions.php"));
|
||||
redirect(apidb_fullurl("distributionView.php"));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,41 +1,44 @@
|
||||
<?php
|
||||
|
||||
include("path.php");
|
||||
include(BASE."include/"."incl.php");
|
||||
include(BASE."include/"."tableve.php");
|
||||
require(BASE."include/incl.php");
|
||||
require(BASE."include/vendor.php");
|
||||
|
||||
if(!$_SESSION['current']->hasPriv("admin"))
|
||||
{
|
||||
errorpage();
|
||||
exit;
|
||||
}
|
||||
else
|
||||
$oVendor = new Vendor($_REQUEST['vendorId']);
|
||||
if($_REQUEST['submit'])
|
||||
{
|
||||
global $admin_mode;
|
||||
$admin_mode = 1;
|
||||
}
|
||||
|
||||
$vendorId = $_REQUEST['vendorId'];
|
||||
apidb_header("Edit Vendor Information");
|
||||
|
||||
$t = new TableVE("edit");
|
||||
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$t->update($_POST);
|
||||
$oVendor->update($_REQUEST['name'],$_REQUEST['webpage']);
|
||||
redirect(apidb_fullurl("admin/adminVendors.php"));
|
||||
}
|
||||
else
|
||||
{
|
||||
$table = "vendor";
|
||||
$query = "SELECT * FROM $table WHERE vendorId = $vendorId";
|
||||
|
||||
if(debugging())
|
||||
echo "$query <br><br>\n";
|
||||
|
||||
$t->edit($query);
|
||||
apidb_header("Edit Vendor");
|
||||
echo "<form method=\"post\" action=\"addVendor.php\">
|
||||
<input type=\"hidden\" name=\"vendorId\" value=\"".$oVendor->iVendorId."\" />
|
||||
<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\">
|
||||
<tr>
|
||||
<td width=\"15%\" class=\"box-label\"><b>Vendor name</b></td>
|
||||
<td class=\"box-body\">
|
||||
<input type=\"text\" size=\"50\" name=\"name\" value=\"".$oVendor->sName."\" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width=\"15%\" class=\"box-label\"><b>Vendor URL</b></td>
|
||||
<td class=\"box-body\">
|
||||
<input type=\"text\" size=\"50\" name=\"webpage\" value=\"".$oVendor->sWebpage."\" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=\"2\" class=\"box-body\">
|
||||
<input type=\"submit\" name=\"submit\" value=\"Submit\" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>";
|
||||
apidb_footer();
|
||||
}
|
||||
|
||||
apidb_footer();
|
||||
|
||||
?>
|
||||
|
||||
@@ -135,6 +135,8 @@ p.indent { padding-left: 1em; padding-right: 1em;}
|
||||
/* App Support status */
|
||||
.gold { background-color: #fff600; }
|
||||
.silver { background-color: silver; }
|
||||
.bronze { background-color: #fcba0a; }
|
||||
.Garbage { background-color: #999966; }
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
|
||||
@@ -11,13 +11,70 @@ require(BASE."include/incl.php");
|
||||
require(BASE."include/distributions.php");
|
||||
require(BASE."include/testResults.php");
|
||||
|
||||
if ($_REQUEST['sub'])
|
||||
{
|
||||
if(!$_SESSION['current']->hasPriv("admin"))
|
||||
{
|
||||
errorpage("Insufficient privileges.");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($_REQUEST['sub'] == 'delete')
|
||||
{
|
||||
$oDistribution = new distribution($_REQUEST['iDistributionId']);
|
||||
$oDistribution->delete();
|
||||
redirect($_SERVER['PHP_SELF']);
|
||||
}
|
||||
}
|
||||
$oDistribution = new distribution($_REQUEST['iDistributionId']);
|
||||
|
||||
//exit with error if no vendor
|
||||
if(!$oDistribution->iDistributionId)
|
||||
{
|
||||
errorpage("No Distribution ID specified!");
|
||||
exit;
|
||||
apidb_header("View Distributions");
|
||||
|
||||
//get available Distributions
|
||||
$sQuery = "SELECT distributionId FROM distributions ORDER BY name, distributionId;";
|
||||
$hResult = query_appdb($sQuery);
|
||||
|
||||
// show Distribution list
|
||||
echo html_frame_start("","90%","",0);
|
||||
echo "<table width='100%' border=0 cellpadding=3 cellspacing=0>\n\n";
|
||||
|
||||
echo "<tr class=color4>\n";
|
||||
echo " <td>Distribution name</td>\n";
|
||||
echo " <td>Distribution url</td>\n";
|
||||
echo " <td align=\"right\">Linked Tests</td>\n";
|
||||
if ($_SESSION['current']->hasPriv("admin"))
|
||||
echo " <td align=\"center\">Action</td>\n";
|
||||
echo "</tr>\n\n";
|
||||
|
||||
$c = 1;
|
||||
while($ob = mysql_fetch_object($hResult))
|
||||
{
|
||||
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
|
||||
$oDistribution = new distribution($ob->distributionId);
|
||||
echo "<tr class=\"$bgcolor\">\n";
|
||||
echo " <td><a href=\"".BASE."distributionView.php?iDistributionId=".$oDistribution->iDistributionId."\">","\n";
|
||||
echo $oDistribution->sName."</a></td>\n";
|
||||
echo " <td><a href=\"".$oDistribution->sUrl."\">".$oDistribution->sUrl."</a></td>\n";
|
||||
echo " <td align=\"right\">".sizeof($oDistribution->aTestingIds)."</td>\n";
|
||||
if ($_SESSION['current']->hasPriv("admin"))
|
||||
{
|
||||
echo " <td align=\"center\">";
|
||||
echo "[<a href='".BASE."admin/editDistribution.php?iDistributionId=".$oDistribution->iDistributionId."'>edit</a>]";
|
||||
if(!sizeof($oDistribution->aTestingIds))
|
||||
echo " [<a href='".$_SERVER['PHP_SELF']."?sub=delete&iDistributionId=".$oDistribution->iDistributionId."'>delete</a>]";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
$c++;
|
||||
}
|
||||
echo "</table>\n\n";
|
||||
echo html_frame_end(" ");
|
||||
if ($_SESSION['current']->hasPriv("admin"))
|
||||
echo "[<a href='".BASE."admin/editDistribution.php'>Add New Distribution</a>]";
|
||||
apidb_footer();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -36,9 +93,10 @@ else
|
||||
{
|
||||
echo " (".$oDistribution->sUrl.")";
|
||||
echo "</a> <br />\n";
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
echo "<br />\n";
|
||||
}
|
||||
|
||||
if($oDistribution->aTestingIds)
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
/***********/
|
||||
/* SideBar */
|
||||
/***********/
|
||||
require_once(BASE."include/distributions.php");
|
||||
|
||||
function global_sidebar_menu() {
|
||||
|
||||
@@ -17,6 +18,8 @@ function global_sidebar_menu() {
|
||||
$g->add("Submit Application", BASE."appsubmit.php?apptype=1");
|
||||
$g->add("Help & Documentation", BASE."help/");
|
||||
$g->add("AppDB Stats", BASE."appdbStats.php");
|
||||
$g->add("View Distributions (".getNumberOfDistributions().")", BASE."distributionView.php");
|
||||
|
||||
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
|
||||
$g->done();
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ function global_admin_menu() {
|
||||
|
||||
$g->add("Add Category", BASE."admin/addCategory.php");
|
||||
$g->add("Add Vendor", BASE."admin/addVendor.php");
|
||||
$g->add("Add Distribution", BASE."admin/editDistribution.php");
|
||||
|
||||
$g->addmisc(" ");
|
||||
$g->add("View App Queue (".$_SESSION['current']->getQueuedAppCount()."/".$_SESSION['current']->getQueuedVersionCount().")", BASE."admin/adminAppQueue.php");
|
||||
@@ -21,7 +20,6 @@ function global_admin_menu() {
|
||||
$g->add("View Vendors (".getVendorCount().")", BASE."admin/adminVendors.php");
|
||||
$g->add("View Bug Links (".getNumberOfQueuedBugLinks()."/".getNumberOfBugLinks().")", BASE."admin/adminBugs.php");
|
||||
$g->add("View Test Results Queue (".getNumberOfQueuedTests().")", BASE."admin/adminTestResults.php");
|
||||
$g->add("View Distributions (".getNumberOfDistributions().")", BASE."admin/adminDistributions.php");
|
||||
|
||||
$g->addmisc(" ");
|
||||
$g->add("Users Management", BASE."admin/adminUsers.php");
|
||||
|
||||
Reference in New Issue
Block a user