Alexander Nicolaysen Sørnes : Allwoing becoming a monitor when submitting versiosn
Chris Morgan
cmorgan at winehq.org
Tue Nov 13 23:22:57 CST 2007
Module: appdb
Branch: master
Commit: 480a08fecd36c1e1e2b1e166e68452c15bdc5b1a
URL: http://source.winehq.org/git/appdb.git/?a=commit;h=480a08fecd36c1e1e2b1e166e68452c15bdc5b1a
Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date: Tue Nov 13 21:09:38 2007 +0100
Allwoing becoming a monitor when submitting versiosn
---
include/application.php | 1 +
include/version.php | 30 ++++++++++++++++++++----------
include/version_queue.php | 33 ++++++++++++++++++++++-----------
3 files changed, 43 insertions(+), 21 deletions(-)
diff --git a/include/application.php b/include/application.php
index 7f46efc..79fc182 100644
--- a/include/application.php
+++ b/include/application.php
@@ -20,6 +20,7 @@ define("GARBAGE_RATING", "Garbage");
define("MAINTAINER_REQUEST", 1);
define("SUPERMAINTAINER_REQUEST", 2);
+define('MONITOR_REQUEST', 3);
/**
* Application class for handling applications.
diff --git a/include/version.php b/include/version.php
index 371a947..1caeaa4 100644
--- a/include/version.php
+++ b/include/version.php
@@ -42,7 +42,7 @@ class version {
version its votes should be moved to. */
var $iMaintainerRequest; /* Temporary variable for version submisson.
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. */
/**
@@ -115,16 +115,26 @@ class version {
$this->SendNotificationMail();
/* Submit maintainer request if asked to */
- if($this->iMaintainerRequest == MAINTAINER_REQUEST)
+ switch($this->iMaintainerRequest)
{
- $oMaintainer = new Maintainer();
- $oMaintainer->iAppId = $this->iAppId;
- $oMaintainer->iVersionId = $this->iVersionId;
- $oMaintainer->iUserId = $_SESSION['current']->iUserId;
- $oMaintainer->sMaintainReason = "This user submitted the version;".
- "auto-queued.";
- $oMaintainer->bSuperMaintainer = 0;
- $oMaintainer->create();
+ case MAINTAINER_REQUEST;
+ $oMaintainer = new Maintainer();
+ $oMaintainer->iAppId = $this->iAppId;
+ $oMaintainer->iVersionId = $this->iVersionId;
+ $oMaintainer->iUserId = $_SESSION['current']->iUserId;
+ $oMaintainer->sMaintainReason = "This user submitted the version;".
+ "auto-queued.";
+ $oMaintainer->bSuperMaintainer = 0;
+ $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;
}
diff --git a/include/version_queue.php b/include/version_queue.php
index 725f8b0..1e8799a 100644
--- a/include/version_queue.php
+++ b/include/version_queue.php
@@ -133,20 +133,31 @@ class version_queue
if(!$this->oVersion->iVersionId && $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 "<table width='100%' cellpadding=0 cellspacing=0>";
+ $oTable = new Table();
if($this->oVersion->iMaintainerRequest == MAINTAINER_REQUEST)
- $sRequestMaintainerChecked = 'checked="checked"';
- echo html_tr(array(
- array("<b>Become maintainer?</b>", ""),
- array(
- "<input type=\"checkbox\" $sRequestMaintainerChecked".
+ $sRequestMaintainerChecked = 'checked="checked" ';
+ else
+ $sRequestMaintainerChecked = '';
+ if($this->oVersion->iMaintainerRequest == MONITOR_REQUEST)
+ $sRequestMonitorChecked = 'checked="checked"' ;
+ else
+ $sRequestMonitorChecked = '';
+
+ $oTableRow = new TableRow();
+ $oTableRow->AddTextCell(' ');
+ $oTableRow->AddTextCell("<input type=\"radio\" $sRequestMaintainerChecked".
"name=\"iMaintainerRequest\" value=\"".MAINTAINER_REQUEST."\" /> ".
- "Check this box to request being a maintainer for this version",
- "")
- ));
- echo "</table>";
+ "Request being a maintainer for this version, allowing you to edit it later");
+ $oTable->AddRow($oTableRow);
+ $oTableRow = new TableRow();
+ $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 html_frame_end();
}
More information about the wine-cvs
mailing list