From 363cc978ac284e553354f6693d8dbc083d8b08e6 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 24 Jun 2008 08:02:56 +0000 Subject: [PATCH] Updated phone stuff. Macro&&phoneAccount -Save changes if only paramater values have changed. -Fixed problem with selecting a macro. -Fixed typo, which caused problems with POST attributes. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11406 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../gofon/gofon/macro/class_gofonMacroParameters.inc | 2 +- .../gofon/gofon/phoneaccount/class_phoneAccount.inc | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc index d8d2898a5..c131d67ab 100644 --- a/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc +++ b/gosa-plugins/gofon/gofon/macro/class_gofonMacroParameters.inc @@ -186,7 +186,7 @@ class macroParameter extends plugin } /* get current content */ - $macroManagment = session::get('macroManagment') ; + $macroManagment = session::get('macroManagement') ; $content = $macroManagment->macrotabs->by_object['macro']->goFonMacroContent; if(strstr($content,"ARG")){ diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc index c5796a688..d2b2029a6 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc @@ -188,7 +188,7 @@ class phoneAccount extends plugin /* Get available Macros - * Search for all Marcos that are visible and create + * Search for all Macros that are visible and create * an array with name and parameters */ $tmp = get_sub_list("(&(objectClass=goFonMacro)(goFonMacroVisible=1))","gofonmacro",array(get_ou("macroou")), @@ -1164,6 +1164,7 @@ class phoneAccount extends plugin /* Every macro in the select box are available */ if((isset($_POST['macro']))){ + $this->macro = $_POST['macro']; $this->macrostillavailable=true; } @@ -1199,9 +1200,11 @@ class phoneAccount extends plugin /* get all Postvars */ if(isset($this->macroarray[$this->macro])){ - if($this->acl_is_writeable("goFonMarco",$SkipWrite)){ + + if($this->acl_is_writeable("goFonMacro",$SkipWrite)){ foreach($this->macroarray[$this->macro] as $key => $paras){ + $old_macro_settings = $this->macroarray[$this->macro][$key]; $backup = $this->macroarray[$this->macro][$key]; if(isset($_POST[$paras['var']])){ @@ -1221,7 +1224,11 @@ class phoneAccount extends plugin } } } + if(array_differs($old_macro_settings,$this->macroarray[$this->macro][$key])){ + $this->modified = TRUE; + } } + if(count(array_diff($this->macroarray[$this->macro][$key],$backup))){ $this->modified = TRUE; } @@ -1638,6 +1645,7 @@ class phoneAccount extends plugin } if(isset($_POST['macro']) && $_POST['macro'] != $this->macro){ + $this->macro = $_POST['macro']; $this->is_modified =true; } -- 2.30.2