[AppDB] Accept application in one step.

Tony Lambregts tony.lambregts at gmail.com
Sat Jan 28 11:34:34 CST 2006


For Administrators applications are currently submitted in three phases .

1.) Submit app -- changes to application are made
2.) Submit version -- changes to version are made
3.) Submit test results -- changes to test results are made

This patch fixes this situation so everything gets submitted/changed at once.

Also minor fix in vendor logic...


Change Log: Accept application in one step.
Files Changed: admin/adminAppQueue.php



-------------- next part --------------
Index: admin/adminAppQueue.php
===================================================================
RCS file: /home/wine/appdb/admin/adminAppQueue.php,v
retrieving revision 1.49
diff -u -r1.49 adminAppQueue.php
--- admin/adminAppQueue.php	12 Nov 2005 03:06:55 -0000	1.49
+++ admin/adminAppQueue.php	28 Jan 2006 17:20:24 -0000
@@ -133,37 +133,29 @@
 
     if($_REQUEST['sub'] == 'add')
     {
-        if (($_REQUEST['apptype'] == "application") && is_numeric($_REQUEST['appId'])) // application
+        $oVersion = new Version($_REQUEST['versionId']);
+        $oTest = new testData($_REQUEST['iTestingId']);
+        $oVersion->GetOutputEditorValues();
+        $oTest->GetOutputEditorValues();
+        if ($_REQUEST['apptype'] == "application") // application
         {
+            $oApp = new Application($_REQUEST['appId']);
+            $oApp->GetOutputEditorValues(); // load the values from $_REQUEST 
             // add new vendor
-            if($_REQUEST['appVendorName'])
+            if($_REQUEST['appVendorName'] and !$_REQUEST['appVendorId'])
             {
                 $oVendor = new Vendor();
                 $oVendor->create($_REQUEST['appVendorName'],$_REQUEST['appWebpage']);
+                $oApp->iVendorId = $oVendor->iVendorId;
             }
-            
-            $oApp = new Application($_REQUEST['appId']);
-            $oApp->GetOutputEditorValues();
-            $oApp->update();
+            $oApp->update(true);
             $oApp->unQueue();
-        } else if(($_REQUEST['apptype'] == "version") && is_numeric($_REQUEST['versionId']))  // version
-        {
-            $oVersion = new Version($_REQUEST['versionId']);
-            $oVersion->GetOutputEditorValues();
-            $oVersion->update();
-            $oVersion->unQueue();
-            foreach($oVersion->aVersionIds as $iTestingId)
-            {
-                $oTest = new Version($iTestingId);
-                $oTest->GetOutputEditorValues();
-                $oTest->iVersionId = $oVersion->iVersionId;
-                $oTest->iVersionId = $oVersion->iVersionId;
-                $oTest->Update();
-                $oTest->unQueue();
-            }
         }
-  
-        redirect(apidb_fullurl("admin/adminAppQueue.php"));
+        $oVersion->update(true);
+        $oVersion->unQueue();
+        $oTest->update(true);
+        $oTest->unQueue();
+        redirect($_SERVER['PHP_SELF']);
     }
     else if ($_REQUEST['sub'] == 'duplicate')
     {
@@ -348,7 +340,10 @@
 
             //vendor field
             if($iVendorId)
+            {
                 $sVendor = "";
+                $oApp->iVendorId = $iVendorId;
+            }  
         }
 
         /* output the appropriate editors depending on whether we are processing an application */


More information about the wine-patches mailing list