Alexander Nicolaysen Sørnes : Use sState as parameter to objectGetItemsPerPage()

Chris Morgan cmorgan at winehq.org
Wed Dec 19 20:03:30 CST 2007


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

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Wed Dec 19 15:06:35 2007 +0100

Use sState as parameter to objectGetItemsPerPage()

---

 include/application.php       |    2 +-
 include/application_queue.php |    4 ++--
 include/bugs.php              |    2 +-
 include/distribution.php      |    2 +-
 include/maintainer.php        |    2 +-
 include/objectManager.php     |   16 ++++++++++++++--
 include/screenshot.php        |    4 ++--
 include/testData.php          |    2 +-
 include/testData_queue.php    |    4 ++--
 include/vendor.php            |    2 +-
 include/version.php           |    2 +-
 include/version_queue.php     |    4 ++--
 12 files changed, 29 insertions(+), 17 deletions(-)

diff --git a/include/application.php b/include/application.php
index bcefc76..47bbdd5 100644
--- a/include/application.php
+++ b/include/application.php
@@ -349,7 +349,7 @@ class Application {
         }
     }
 
-    public static function objectGetItemsPerPage($bQueued = false)
+    public static function objectGetItemsPerPage($sState = 'accepted')
     {
         $aItemsPerPage = array(25, 50, 100, 200);
         $iDefaultPerPage = 25;
diff --git a/include/application_queue.php b/include/application_queue.php
index 4a67fec..d9100bd 100644
--- a/include/application_queue.php
+++ b/include/application_queue.php
@@ -373,9 +373,9 @@ class application_queue
         return TRUE;
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
-        return $this->oApp->objectGetItemsPerPage($bQueued);
+        return $this->oApp->objectGetItemsPerPage($sState);
     }
 
     function objectGetEntriesCount($bQueued, $bRejected)
diff --git a/include/bugs.php b/include/bugs.php
index ed1a330..e49a7a6 100644
--- a/include/bugs.php
+++ b/include/bugs.php
@@ -464,7 +464,7 @@ class Bug
         return false;
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
         $aItemsPerPage = array(25, 50, 100, 200);
         $iDefaultPerPage = 25;
diff --git a/include/distribution.php b/include/distribution.php
index 1169bf5..9a43a0a 100644
--- a/include/distribution.php
+++ b/include/distribution.php
@@ -742,7 +742,7 @@ class distribution {
         return $iCount;
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
         $aItemsPerPage = array(25, 50, 100, 200);
         $iDefaultPerPage = 25;
diff --git a/include/maintainer.php b/include/maintainer.php
index ca0e99e..64e1037 100644
--- a/include/maintainer.php
+++ b/include/maintainer.php
@@ -873,7 +873,7 @@ class maintainer
         return TRUE;
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
         $aItemsPerPage = array(25, 50, 100, 200);
         $iDefaultPerPage = 25;
diff --git a/include/objectManager.php b/include/objectManager.php
index 55d1c75..cf00be6 100644
--- a/include/objectManager.php
+++ b/include/objectManager.php
@@ -12,6 +12,7 @@ class ObjectManager
     private $sTitle;
     private $iId;
     private $bIsRejected;
+    private $sState;
     private $sReturnTo;
     private $sReturnToTitle; /* Used to preserve the title when processing entries from a queue list, for instance */
     private $oMultiPage;
@@ -62,6 +63,11 @@ class ObjectManager
     public function setIsQueue($bIsQueue)
     {
       $this->bIsQueue = $bIsQueue;
+
+      if($this->sState != 'rejected' && $bIsQueue)
+          $this->sState = 'queued';
+      else if ($this->sState == 'queued' && !$bIsQueue)
+          $this->sState = 'accepted';
     }
 
     public function getIsQueue()
@@ -82,6 +88,11 @@ class ObjectManager
     public function setIsRejected($bIsRejected)
     {
       $this->bIsRejected = $bIsRejected;
+
+      if($bIsRejected)
+          $this->sState = 'rejected';
+      else if ($this->sState == 'rejected')
+          $this->sState = 'queued';
     }
 
     public function setSortInfo($aClean = null)
@@ -114,6 +125,7 @@ class ObjectManager
         $this->iId = $iId;
         $this->oMultiPage = new MultiPage(FALSE);
         $this->oTableRow = new OMTableRow(null);
+        $this->sState = 'accepted';
 
         // initialize the common responses array
         $this->aCommonResponses = array();
@@ -1314,14 +1326,14 @@ class ObjectManager
         $oObject = new $this->sClass();
 
         if(!method_exists($oObject, "objectGetItemsPerPage") ||
-          $oObject->objectGetItemsPerPage($this->bIsQueue) === FALSE)
+          $oObject->objectGetItemsPerPage($this->sState) === FALSE)
         {
             /* Do not enable the MultiPage controls */
             $this->oMultiPage->MultiPage(FALSE);
             return;
         }
 
-        $aReturn = $oObject->objectGetItemsPerPage($this->bIsQueue);
+        $aReturn = $oObject->objectGetItemsPerPage($this->sState);
         $aItemsPerPage = $aReturn[0];
         $iDefaultPerPage = $aReturn[1];
 
diff --git a/include/screenshot.php b/include/screenshot.php
index 66bb34b..7063f60 100644
--- a/include/screenshot.php
+++ b/include/screenshot.php
@@ -595,9 +595,9 @@ class screenshot
         return $shImg;
     }
 
-    public static function objectGetItemsPerPage($bQueued = false)
+    public static function objectGetItemsPerPage($sState = 'accepted')
     {
-        if($bQueued)
+        if($sState != 'accepted')
         {
             $aItemsPerPage = array(25, 50, 100, 200);
             $iDefaultPerPage = 25;
diff --git a/include/testData.php b/include/testData.php
index 8dbf0a0..78a9f3f 100644
--- a/include/testData.php
+++ b/include/testData.php
@@ -1253,7 +1253,7 @@ class testData{
         return mysqltimestamp_to_unixtimestamp($this->sSubmitTime);
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
         $aItemsPerPage = array(25, 50, 100, 200);
         $iDefaultPerPage = 25;
diff --git a/include/testData_queue.php b/include/testData_queue.php
index 50b3caf..b7f8ed5 100644
--- a/include/testData_queue.php
+++ b/include/testData_queue.php
@@ -198,9 +198,9 @@ class testData_queue
         return $this->oTestData->objectGetSubmitTime();
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
-        return testData::objectGetItemsPerPage($bQueued);
+        return testData::objectGetItemsPerPage($sState);
     }
 
     function objectGetId()
diff --git a/include/vendor.php b/include/vendor.php
index 224e885..78a18bc 100644
--- a/include/vendor.php
+++ b/include/vendor.php
@@ -447,7 +447,7 @@ class Vendor {
         return $this->iVendorId;
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
         $aItemsPerPage = array(25, 50, 100, 200);
         $iDefaultPerPage = 25;
diff --git a/include/version.php b/include/version.php
index 9061262..64cd852 100644
--- a/include/version.php
+++ b/include/version.php
@@ -1518,7 +1518,7 @@ class version {
         return $oTableRow;
     }
 
-    public static function objectGetItemsPerPage($bQueued = false)
+    public static function objectGetItemsPerPage($sState = 'accepted')
     {
         $aItemsPerPage = array(25, 50, 100, 200);
         $iDefaultPerPage = 25;
diff --git a/include/version_queue.php b/include/version_queue.php
index de3483e..77ddac7 100644
--- a/include/version_queue.php
+++ b/include/version_queue.php
@@ -214,9 +214,9 @@ class version_queue
         /* $this->oVersion->displayAddItemHelp(); */
     }
 
-    function objectGetItemsPerPage($bQueued = false)
+    function objectGetItemsPerPage($sState = 'accepted')
     {
-        return $this->oVersion->objectGetItemsPerPage($bQueued);
+        return $this->oVersion->objectGetItemsPerPage($sState);
     }
 
     function objectGetEntriesCount($bQueued, $bRejected)




More information about the wine-cvs mailing list