Code

Fixed foreach error
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Mar 2006 11:58:09 +0000 (11:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 21 Mar 2006 11:58:09 +0000 (11:58 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2878 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/class_phoneAccount.inc

index d2016b629940a9a63ed670f9ae2f9f32f6f7141e..78acac30385ef39d73ad7967a731d0d3f06aca21 100644 (file)
@@ -433,14 +433,15 @@ class phoneAccount extends plugin
       $SQL[] = "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id=".$newnums[$i_new_key].";"; 
       // Delete old entries
       $b_first_deleted  =false;
-      foreach($oldnums as $s_telenums){
-        $SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$s_telenums."';\n";
-        if(!$b_first_deleted){
-          $b_first_deleted=true;
-          $SQL[] = "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id=".$s_telenums.";";
+      if(is_array($oldnums)){
+        foreach($oldnums as $s_telenums){
+          $SQL[] = "DELETE FROM ".$a_SETUP['EXT_TABLE']." WHERE exten='".$s_telenums."';\n";
+          if(!$b_first_deleted){
+            $b_first_deleted=true;
+            $SQL[] = "DELETE FROM ".$a_SETUP['VOICE_TABLE']." WHERE customer_id=".$s_telenums.";";
+          }
         }
       }
-
       if($this->goFonHardware=="automatic"){
         foreach($SQL as $query ){
           mysql_query($query) ;
@@ -1150,6 +1151,13 @@ $ldap->modify ($this->attrs);
       }
     }
   }
+
+  function getSaveDialog()
+  {
+  
+    return("Phone");
+  }
+
 }
 
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: