Code

Updated macro class. Added check -> Empty macros can't be saved.
[gosa.git] / plugins / gofon / macro / class_gofonMacro.inc
index 4c3c40a8f6589e0f75dea453c03b2dae89f95d7a..cbcc99951847697a8b1deb00120706badb92f206 100755 (executable)
@@ -340,6 +340,7 @@ class macro extends plugin
         $res    = @mysql_query($query,$r_con);
         if(!$res){
           gosa_log(@mysql_error($r_con));
+          gosa_log($query);
           return(sprintf(_("Insert of new macro failed for server '%s'."),$cfg['SERVER']));
         }
         @mysql_close($r_con);
@@ -444,6 +445,10 @@ class macro extends plugin
       $message[] = _("Makro length must be lower than 100 lines");
     }
 
+    /* Macro content must be smaller than 100 lines */
+    if(empty($this->goFonMacroContent)){
+      $message[] = _("You can't save an empty macro.");
+    }
     return $message;
   }