From: hickert Date: Thu, 15 Sep 2005 07:16:47 +0000 (+0000) Subject: User created from templates uses the selected macro know X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d9d32585e5096e83f3ea849685beeac24275c758;p=gosa.git User created from templates uses the selected macro know git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1370 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 31e38b139..58b506b9e 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -536,6 +536,43 @@ class phoneAccount extends plugin function execute() { $display = ""; + + if(empty($this->macro)&&(!empty($this->goFonMacro))){ + + /* Go through already saved values, for a parameter */ + $tmp = split("!",$this->goFonMacro); + + /* it is possible that nothing has been saved yet */ + if(is_array($tmp)){ + + /* First value is the macroname */ + $this->macro = $tmp[0]; + + /* Macroname saved, delete that index */ + unset($tmp[0]); + + /* Check if makro has been removed */ + if(!isset($this->macroarray[$this->macro])){ + $this->macrostillavailable = false; + }else{ + $this->macrostillavailable = true; + } + + /* for each parametervalues ( parameterID#value like 25#twentyfive) */ + foreach($tmp as $var){ + + /* Split this, so we have $varar[0] = parameterID $varar[1] = SelectedValue */ + $varar = split("#",$var); + + /* Only insert if the parameter still exists */ + if(isset($this->macroarray[$this->macro][$varar[0]])){ + /* Assign value */ + $this->macroarray[$this->macro][$varar[0]]['choosen']=$varar[1]; + } + } + } + } + /* Do we represent a valid account? */ if (!$this->is_account && $this->parent == NULL){ $display= "\"\" ".