Add distribution queue.
Queued distributions are still treated like un-queued ones, since currently only 8 distributions are un-queued. 'View Distributions', however, will only show un-queued distributions. If an admin tries to remove a distribution with associated test results, an error is printed and no action is performed. This could be improved in the future by showing a 'move test data' link.
This commit is contained in:
committed by
WineHQ
parent
b628b3af0e
commit
f782c10317
@@ -145,9 +145,15 @@ class distribution {
|
|||||||
// is the current user allowed to delete this Distribution?
|
// is the current user allowed to delete this Distribution?
|
||||||
if(!$_SESSION['current']->hasPriv("admin") &&
|
if(!$_SESSION['current']->hasPriv("admin") &&
|
||||||
!($_SESSION['current']->iUserId == $this->iSubmitterId))
|
!($_SESSION['current']->iUserId == $this->iSubmitterId))
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* Check for associated test results */
|
||||||
|
if(sizeof($this->aTestingIds))
|
||||||
|
{
|
||||||
|
addmsg("This distribution still has associated test results", "red");
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// now delete the Distribution
|
// now delete the Distribution
|
||||||
$sQuery = "DELETE FROM distributions
|
$sQuery = "DELETE FROM distributions
|
||||||
WHERE distributionId = '?'
|
WHERE distributionId = '?'
|
||||||
@@ -179,7 +185,7 @@ class distribution {
|
|||||||
if(!$this->sQueued == 'true')
|
if(!$this->sQueued == 'true')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(query_parameters("UPDATE distribution SET queued = '?' WHERE distributionId = '?'",
|
if(query_parameters("UPDATE distributions SET queued = '?' WHERE distributionId = '?'",
|
||||||
"false", $this->iDistributionId))
|
"false", $this->iDistributionId))
|
||||||
{
|
{
|
||||||
$this->sQueued = 'false';
|
$this->sQueued = 'false';
|
||||||
@@ -206,23 +212,7 @@ class distribution {
|
|||||||
if(!$this->sQueued == 'true')
|
if(!$this->sQueued == 'true')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(query_parameters("UPDATE distribution SET queued = '?' WHERE distributionId = '?'",
|
return $this->delete();
|
||||||
"rejected", $this->iDistributionId))
|
|
||||||
{
|
|
||||||
$this->sQueued = 'rejected';
|
|
||||||
// we send an e-mail to interested people
|
|
||||||
if(!$bSilent)
|
|
||||||
{
|
|
||||||
$this->mailSubmitter("reject");
|
|
||||||
$this->SendNotificationMail("reject");
|
|
||||||
}
|
|
||||||
// the Distribution data has been rejected
|
|
||||||
return true;
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
addmsg("Error while rejecting Distribution", "red");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ReQueue()
|
function ReQueue()
|
||||||
@@ -271,16 +261,6 @@ class distribution {
|
|||||||
$sMsg = "The Distribution you submitted (".$this->sName.") has been accepted.";
|
$sMsg = "The Distribution you submitted (".$this->sName.") has been accepted.";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "reject":
|
|
||||||
{
|
|
||||||
$sSubject = "Distribution rejected";
|
|
||||||
$sMsg = "The Distribution you submitted (".$this->sName.") has been rejected.";
|
|
||||||
$sMsg .= APPDB_ROOT."testingData.php?sSub=view&iVersionId=".$this->iVersionId."\n";
|
|
||||||
$sMsg .= "Reason given:\n";
|
|
||||||
$sMsg .= $aClean['sReplyText']."\n"; // append the reply text, if there is any
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
case "delete":
|
case "delete":
|
||||||
{
|
{
|
||||||
$sSubject = "Submitted Distribution deleted";
|
$sSubject = "Submitted Distribution deleted";
|
||||||
@@ -387,14 +367,12 @@ class distribution {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get the total number of Distributions in the database */
|
/* Get the total number of Distributions in the database */
|
||||||
function getNumberOfDistributions($bQueued)
|
function objectGetEntriesCount($bQueued)
|
||||||
{
|
{
|
||||||
if($bQueued)
|
$hResult = query_parameters("SELECT count(distributionId) as num_dists FROM
|
||||||
$hResult = query_parameters("SELECT count(*) as num_dists FROM
|
distributions WHERE queued='?'",
|
||||||
distributions WHERE queued='true';");
|
$bQueued ? "true" : "false");
|
||||||
else
|
|
||||||
$hResult = query_parameters("SELECT count(*) as num_dists FROM
|
|
||||||
distributions");
|
|
||||||
if($hResult)
|
if($hResult)
|
||||||
{
|
{
|
||||||
$oRow = mysql_fetch_object($hResult);
|
$oRow = mysql_fetch_object($hResult);
|
||||||
@@ -490,6 +468,11 @@ class distribution {
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function objectHideDelete()
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
function display()
|
function display()
|
||||||
{
|
{
|
||||||
echo "Distribution Name:";
|
echo "Distribution Name:";
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ function global_sidebar_menu()
|
|||||||
$g->add("Submit Application", BASE."appsubmit.php?sSub=view&sAppType=application");
|
$g->add("Submit Application", BASE."appsubmit.php?sSub=view&sAppType=application");
|
||||||
$g->add("Help & Documentation", BASE."help/");
|
$g->add("Help & Documentation", BASE."help/");
|
||||||
$g->add("AppDB Stats", BASE."appdbStats.php");
|
$g->add("AppDB Stats", BASE."appdbStats.php");
|
||||||
$g->add("View Distributions (".distribution::getNumberOfDistributions(false).")", BASE."objectManager.php?sClass=distribution&bIsQueue=false&sTitle=View%20Distributions");
|
$g->add("View Distributions (".distribution::objectGetEntriesCount(false).")", BASE."objectManager.php?sClass=distribution&bIsQueue=false&sTitle=View%20Distributions");
|
||||||
$g->add("View Vendors (".getNumberOfvendors().")", BASE."objectManager.php?sClass=vendor&bIsQueue=false&sTitle=View%20Vendors");
|
$g->add("View Vendors (".getNumberOfvendors().")", BASE."objectManager.php?sClass=vendor&bIsQueue=false&sTitle=View%20Vendors");
|
||||||
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
|
$g->add("Email your suggestions for improving the AppDB", "mailto:appdb@winehq.org");
|
||||||
$g->done();
|
$g->done();
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ function global_admin_menu() {
|
|||||||
BASE."admin/adminBugs.php");
|
BASE."admin/adminBugs.php");
|
||||||
$g->add("View Test Results Queue (".testData::getNumberOfQueuedTests().")",
|
$g->add("View Test Results Queue (".testData::getNumberOfQueuedTests().")",
|
||||||
BASE."admin/adminTestResults.php");
|
BASE."admin/adminTestResults.php");
|
||||||
|
$g->add("View Distribution Queue (".distribution::objectGetEntriesCount(true).")",
|
||||||
|
BASE."objectManager.php?sClass=distribution&bIsQueue=true&sTitle=".
|
||||||
|
"Distribution%20Queue");
|
||||||
|
|
||||||
$g->addmisc(" ");
|
$g->addmisc(" ");
|
||||||
$g->add("Users Management", BASE."admin/adminUsers.php");
|
$g->add("Users Management", BASE."admin/adminUsers.php");
|
||||||
|
|||||||
Reference in New Issue
Block a user