Allwoing becoming a monitor when submitting versiosn
This commit is contained in:
committed by
Chris Morgan
parent
43af0708c9
commit
480a08fecd
@@ -20,6 +20,7 @@ define("GARBAGE_RATING", "Garbage");
|
|||||||
|
|
||||||
define("MAINTAINER_REQUEST", 1);
|
define("MAINTAINER_REQUEST", 1);
|
||||||
define("SUPERMAINTAINER_REQUEST", 2);
|
define("SUPERMAINTAINER_REQUEST", 2);
|
||||||
|
define('MONITOR_REQUEST', 3);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application class for handling applications.
|
* Application class for handling applications.
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class version {
|
|||||||
version its votes should be moved to. */
|
version its votes should be moved to. */
|
||||||
var $iMaintainerRequest; /* Temporary variable for version submisson.
|
var $iMaintainerRequest; /* Temporary variable for version submisson.
|
||||||
Indicates whether the user wants to become a
|
Indicates whether the user wants to become a
|
||||||
maintainer of the version being submitted.
|
maintainer or monitor of the version being submitted.
|
||||||
Value denotes type of request. */
|
Value denotes type of request. */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -115,8 +115,9 @@ class version {
|
|||||||
$this->SendNotificationMail();
|
$this->SendNotificationMail();
|
||||||
|
|
||||||
/* Submit maintainer request if asked to */
|
/* Submit maintainer request if asked to */
|
||||||
if($this->iMaintainerRequest == MAINTAINER_REQUEST)
|
switch($this->iMaintainerRequest)
|
||||||
{
|
{
|
||||||
|
case MAINTAINER_REQUEST;
|
||||||
$oMaintainer = new Maintainer();
|
$oMaintainer = new Maintainer();
|
||||||
$oMaintainer->iAppId = $this->iAppId;
|
$oMaintainer->iAppId = $this->iAppId;
|
||||||
$oMaintainer->iVersionId = $this->iVersionId;
|
$oMaintainer->iVersionId = $this->iVersionId;
|
||||||
@@ -125,6 +126,15 @@ class version {
|
|||||||
"auto-queued.";
|
"auto-queued.";
|
||||||
$oMaintainer->bSuperMaintainer = 0;
|
$oMaintainer->bSuperMaintainer = 0;
|
||||||
$oMaintainer->create();
|
$oMaintainer->create();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MONITOR_REQUEST:
|
||||||
|
$oMonitor = new Monitor();
|
||||||
|
$oMonitor->iVersionId = $this->iVersionId;
|
||||||
|
$oMonitor->iUserId = $_SESSION['current']->iUserId;
|
||||||
|
$oMonitor->iAppId = $this->iAppId;
|
||||||
|
$oMonitor->create();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,20 +133,31 @@ class version_queue
|
|||||||
if(!$this->oVersion->iVersionId && $this->oVersion->iAppId &&
|
if(!$this->oVersion->iVersionId && $this->oVersion->iAppId &&
|
||||||
!$_SESSION['current']->isSuperMaintainer($this->oVersion->iAppId))
|
!$_SESSION['current']->isSuperMaintainer($this->oVersion->iAppId))
|
||||||
{
|
{
|
||||||
echo html_frame_start("Become Maintainer", "90%");
|
echo html_frame_start("Become Maintainer or Monitor Changes", "90%");
|
||||||
echo "<div style='padding:5px;' class='color0'>\n";
|
echo "<div style='padding:5px;' class='color0'>\n";
|
||||||
echo "<table width='100%' cellpadding=0 cellspacing=0>";
|
$oTable = new Table();
|
||||||
if($this->oVersion->iMaintainerRequest == MAINTAINER_REQUEST)
|
if($this->oVersion->iMaintainerRequest == MAINTAINER_REQUEST)
|
||||||
$sRequestMaintainerChecked = 'checked="checked"';
|
$sRequestMaintainerChecked = 'checked="checked" ';
|
||||||
echo html_tr(array(
|
else
|
||||||
array("<b>Become maintainer?</b>", ""),
|
$sRequestMaintainerChecked = '';
|
||||||
array(
|
if($this->oVersion->iMaintainerRequest == MONITOR_REQUEST)
|
||||||
"<input type=\"checkbox\" $sRequestMaintainerChecked".
|
$sRequestMonitorChecked = 'checked="checked"' ;
|
||||||
|
else
|
||||||
|
$sRequestMonitorChecked = '';
|
||||||
|
|
||||||
|
$oTableRow = new TableRow();
|
||||||
|
$oTableRow->AddTextCell(' ');
|
||||||
|
$oTableRow->AddTextCell("<input type=\"radio\" $sRequestMaintainerChecked".
|
||||||
"name=\"iMaintainerRequest\" value=\"".MAINTAINER_REQUEST."\" /> ".
|
"name=\"iMaintainerRequest\" value=\"".MAINTAINER_REQUEST."\" /> ".
|
||||||
"Check this box to request being a maintainer for this version",
|
"Request being a maintainer for this version, allowing you to edit it later");
|
||||||
"")
|
$oTable->AddRow($oTableRow);
|
||||||
));
|
$oTableRow = new TableRow();
|
||||||
echo "</table>";
|
$oTableRow->AddTextCell(' ');
|
||||||
|
$oTableRow->AddTextCell("<input type=\"radio\" $sRequestMonitorChecked".
|
||||||
|
"name=\"iMaintainerRequest\" value=\"".MONITOR_REQUEST."\" /> ".
|
||||||
|
"Monitor changes to this version, also after it has been accepted");
|
||||||
|
$oTable->AddRow($oTableRow);
|
||||||
|
echo $oTable->GetString();
|
||||||
echo "</div\n";
|
echo "</div\n";
|
||||||
echo html_frame_end();
|
echo html_frame_end();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user