Code

%tags will be replaced automaticaly
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Oct 2005 09:01:06 +0000 (09:01 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Oct 2005 09:01:06 +0000 (09:01 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1478 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/class_phoneAccount.inc
plugins/gofon/phoneaccount/generic.tpl

index 2a862b040f1eeb33610ffd79b98e3e156d80222f..ca9520191afd3d6bdd6f3f0509f2ad7bf6a0ea2e 100644 (file)
@@ -19,7 +19,8 @@ class phoneAccount extends plugin
   var $hardware_list          = array();
   var $used_hardware          = array();
   var $goFonMacro             = "";
-  var $macro                  = 0;              // Selected Macro
+  var $macro                  = 0;              // Selected Macroi
+  var $lastmacro              = "";
   var $macros                 = array();        // List of macros for smarty select box
   var $macroarray             = array();        // All needed macro informations
   var $macrostillavailable    = false;
@@ -231,6 +232,7 @@ class phoneAccount extends plugin
         }
       }
     }
+  $this->lastmacro=$this->macro;
   @mysql_close($r_con) ;
   }
 
@@ -635,21 +637,20 @@ class phoneAccount extends plugin
       $macrotab ="<table summary=\""._("Parameter")."\">";
       /* for every single parameter-> display textfile,combo, or true false switch*/
 
+      foreach($this->phoneNumbers as $phonenum){
+        $tmp[] = $phonenum;
+      }
 
-      /* Automatic fill out */
-      if(isset($_POST['fillout'])){
-
-        foreach($this->phoneNumbers as $phonenum){
-          $tmp[] = $phonenum;
-        }
-
+      
+    
+      if($this->macro != $this->lastmacro){
         /* Go through all params */
         foreach($this->macroarray[$this->macro] as $key => $paras){
 
           $string = $paras['default'];
 
           $string=preg_replace("/%uid/i",$this->uid,$string);
-          
+
           if(isset($this->cn)){
             $string=preg_replace("/%cn/i",$this->cn,$string);
           }
@@ -797,7 +798,7 @@ class phoneAccount extends plugin
     $smarty->assign ("hardware_list", $hl);
 
     /* Show main page */
-
+    $this->lastmacro = $this->macro;
     $display.= $smarty->fetch(get_template_path('generic.tpl', TRUE, dirname(__FILE__)));
     return($display);
   }
index 382b55f72e97efbe5f46402473c2827817ef74f3..43ad90d25dd87db669a9c8cc952186698c24a1c9 100644 (file)
@@ -65,7 +65,6 @@
                                <option disabled>&nbsp;</option>
                                         </select>
                                         <input type="submit" name="refresh" value="{t}Refresh{/t}" {$goFonMacroACL}>
-                                        <input type="submit" name="fillout" value="{t}Complete{/t}" {$goFonMacroACL}>
                                </td>
                        </tr>
                </table>