Validate the code as submitted, not as it is in the database
authorJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jun 2009 08:33:25 +0000 (10:33 +0200)
committerJoachim Breitner <mail@joachim-breitner.de>
Fri, 26 Jun 2009 08:33:25 +0000 (10:33 +0200)
Finding the right edit window is still a problem, especially if more than one are open.

web/js/communication.js
web/php/Controller.php

index ee0db69..2c1ea6e 100644 (file)
@@ -595,7 +595,11 @@ Lseed.Editor = function() {
                                ,icon: Ext.MessageBox.Info
                        });
                } else {
+                       // This is a hack for now:
                        var pdEditor = Ext.getCmp("plantdefinitioneditor");
+                       if (!pdEditor) {
+                               var pdEditor = Ext.getCmp("editplantdefinitioneditor");
+                       }
                        if (pdEditor) {
                                communication.stopWaitingForPage();
                                Ext.MessageBox.show({
index 991ba50..3c3505e 100644 (file)
                                        break;
 
                                case "ValidatePlant":
-                                       if ($plant != null) {
-                                               $res = $plant->Validate();
-                                       } else {
-                                               $res = "{ success: false, msg: \"Keine Pflanze mit dem Namen '".$plantname."' für den Nutzer '".$username."' gefunden.\" }";
-                                       }
+                                       $plant = new Plant(0,0,$plantname,$code,0);
+                                       $res = $plant->Validate();
                                        break;
 
                                default: