Code

Fixed %telephoneNumber replacedment
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Aug 2005 13:07:16 +0000 (13:07 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 8 Aug 2005 13:07:16 +0000 (13:07 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1079 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/gofon/phoneaccount/class_phoneAccount.inc

index aa9798a2a759ef7b1f7455452ec0f713e4092270..5fd9f63a2bd2bd988e87799f17eecc7fa0245876 100644 (file)
@@ -132,9 +132,10 @@ class phoneAccount extends plugin
             /* Set all attrs */
             $id = $data[0];
             $this->macroarray[$attrs['dn']][$id]['var']    ="var".$id;
-            $string = preg_replace("/%uid/",$this->attrs['uid'][0],$data[3]);
-            $string = preg_replace("/%telephoneNumber/",$this->attrs['telephoneNumber'][0],$string);
-            $string = preg_replace("/%cn/",$this->attrs['cn'][0],$string);
+            $string= $data[3];
+//            $string = preg_replace("/%uid/",$this->attrs['uid'][0],$data[3]);
+//            $string = preg_replace("/%telephoneNumber/",$this->attrs['telephoneNumber'][0],$string);
+//            $string = preg_replace("/%cn/",$this->attrs['cn'][0],$string);
             $this->macroarray[$attrs['dn']][$id]['choosen']= $string; 
 
             $this->macroarray[$attrs['dn']][$id]['id']     = $id;
@@ -540,6 +541,14 @@ class phoneAccount extends plugin
           break;
 
           case "string":
+            $choosen = preg_replace("/%uid/",$this->attrs['uid'][0],$choosen);
+            foreach($this->phoneNumbers as  $phone){
+              $tmp_phone[] = $phone;
+            }            
+  
+            $choosen = preg_replace("/%telephoneNumber/",$tmp_phone[0],$choosen);
+            $choosen = preg_replace("/%cn/",$this->attrs['cn'][0],$choosen);
+
             $str="<input name='".$var."' value='".$choosen."' ".chkacl($this->acl, "goFonMacro").">";
           $macrotab.= "<td>$name</td><td>$str";
           break;