Alexander Nicolaysen Sørnes : maintainer : add new 'pending' queue state

Chris Morgan cmorgan at winehq.org
Wed Oct 31 17:55:28 CDT 2007


Module: appdb
Branch: master
Commit: 3723f34a1169620eb7ce4fc082d56585844655cc
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=3723f34a1169620eb7ce4fc082d56585844655cc

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Thu Oct 25 23:36:46 2007 +0200

maintainer: add new 'pending' queue state

---

 include/maintainer.php |   12 +++++++++++-
 tables/maintainers.sql |    2 +-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/maintainer.php b/include/maintainer.php
index 04dbeae..c3d64aa 100644
--- a/include/maintainer.php
+++ b/include/maintainer.php
@@ -209,12 +209,22 @@ class maintainer
         if(!$this->iUserId)
             $this->iUserId = $_SESSION['current']->iUserId;
 
+        $oApp = new application($this->iAppId);
+        if(!$this->bSuperMaintainer)
+            $oVersion = new version($this->iVersionId);
+
+        if($oApp->sQueued != "false" ||
+           (!$this->bSuperMaintainer && $oVersion->sQueued != "false"))
+            $this->sQueued = "pending";
+        else
+            $this->sQueued = $this->mustBeQueued() ? "true" : "false";
+
         $hResult = query_parameters("INSERT INTO appMaintainers (appId, versionId, ".
                                     "userId, maintainReason, superMaintainer, submitTime, queued) ".
                                     "VALUES ('?', '?', '?', '?', '?', ?, '?')",
                                     $this->iAppId, $this->iVersionId,
                                     $this->iUserId, $this->sMaintainReason,
-                                    $this->bSuperMaintainer, "NOW()", $this->mustBeQueued() ? "true" : "false");
+                                    $this->bSuperMaintainer, "NOW()", $this->sQueued);
 
         /* this objects id is the insert id returned by the database */
         $this->iMaintainerId = query_appdb_insert_id();
diff --git a/tables/maintainers.sql b/tables/maintainers.sql
index dcedfce..e149eda 100644
--- a/tables/maintainers.sql
+++ b/tables/maintainers.sql
@@ -19,7 +19,7 @@ create table appMaintainers (
     maintainReason      text,
     superMaintainer     bool,
     submitTime          datetime,
-    queued              enum('true','false','rejected') NOT NULL default 'false',
+    queued              enum('true','false','rejected','pending') NOT NULL default 'false',
     notificationLevel   int not null default '0',
     notificationTime    datetime,
     key(maintainerId)




More information about the wine-cvs mailing list