[AppDB] Clean up fixes for Application

Tony Lambregts tony.lambregts at gmail.com
Sat Jan 28 10:00:54 CST 2006


Changes:
Let update be silent when we want it to be.
Get rid of redundent message in unqueue()
Fix logic of SendNotificationMail()

Change Log: Clean up fixes for application

Files Changed: include/application.php

-------------- next part --------------
Index: include/application.php
===================================================================
RCS file: /home/wine/appdb/include/application.php,v
retrieving revision 1.40
diff -u -r1.40 application.php
--- include/application.php	18 Jan 2006 04:32:28 -0000	1.40
+++ include/application.php	28 Jan 2006 15:50:08 -0000
@@ -138,7 +138,7 @@
      * Update application.
      * Returns true on success and false on failure.
      */
-    function update()
+    function update($bSilent=false)
     {
         $sWhatChanged = "";
 
@@ -200,7 +200,7 @@
             $oCatAfter = new Category($this->iCatId);
             $sWhatChanged .= "Vendor was changed from ".$oCatBefore->sName." to ".$oCatAfter->sName.".\n\n";
         }
-        if($sWhatChanged)
+        if($sWhatChanged and !$bSilent)
             $this->SendNotificationMail("edit",$sWhatChanged);
         return true;
     }
@@ -265,9 +265,6 @@
             // we send an e-mail to intersted people
             $this->mailSubmitter();
             $this->SendNotificationMail();
-
-            // the application has been unqueued
-            addmsg("The application has been unqueued.", "green");
         }
     }
 
@@ -355,7 +352,13 @@
         switch($sAction)
         {
             case "add":
-                if(!$this->sQueued == 'true')
+                if(!$this->sQueued == 'False') // Has not been accepted.
+                {
+                    $sSubject = $this->sName." has been submitted by ".$_SESSION['current']->sRealname;
+                    $sMsg .= "This application has been queued.";
+                    $sMsg .= "\n";
+                    addmsg("The application you submitted will be added to the database after being reviewed.", "green");
+                } else 
                 {
                     $sSubject = $this->sName." has been added by ".$_SESSION['current']->sRealname;
                     $sMsg  = APPDB_ROOT."appview.php?appId=".$this->iAppId."\n";
@@ -366,13 +369,7 @@
                         $sMsg .= "\n";
                     }
                     addmsg("The application was successfully added into the database.", "green");
-                } else // Application queued.
-                {
-                    $sSubject = $this->sName." has been submitted by ".$_SESSION['current']->sRealname;
-                    $sMsg .= "This application has been queued.";
-                    $sMsg .= "\n";
-                    addmsg("The application you submitted will be added to the database after being reviewed.", "green");
-                }
+                } 
             break;
             case "edit":
                 $sSubject =  $this->sName." has been modified by ".$_SESSION['current']->sRealname;


More information about the wine-patches mailing list