From: cajus Date: Mon, 15 Aug 2005 09:42:13 +0000 (+0000) Subject: Removed call forwarding - this should do the macro X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ec360ca851d320b51f10a59479bfb979ebe05a74;p=gosa.git Removed call forwarding - this should do the macro git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1143 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc index 9741b68af..a99133bd5 100644 --- a/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -10,12 +10,10 @@ class phoneAccount extends plugin /* Attributes */ var $telephoneNumber = ""; var $goFonHardware = ""; - var $goFonForwarding = ""; var $goFonFormat = ""; var $goFonPIN = ""; var $goFonDeliveryMode = ""; var $phoneNumbers = array(); - var $forwarders = array(); var $mail = ""; var $hardware_list = array(); var $used_hardware = array(); @@ -35,7 +33,7 @@ class phoneAccount extends plugin var $cli_parameters = array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser"); /* attribute list for save action */ - var $attributes = array("goFonDeliveryMode", "goFonForwarding", "goFonFormat", + var $attributes = array("goFonDeliveryMode", "goFonFormat", "goFonHardware", "goFonPIN", "telephoneNumber", "goFonMacro","macro"); var $objectclasses= array("goFonAccount"); @@ -60,15 +58,6 @@ class phoneAccount extends plugin $this->phoneNumbers[$number]= $number; } } - /* Assemble forwarders */ - if (isset($this->attrs['goFonForwarding'])){ - for ($i= 0; $i<$this->attrs['goFonForwarding']['count']; $i++){ - list($num, $v1, $v2) =split(';', $this->attrs['goFonForwarding'][$i]); - $this->forwarders[$num]= "$v1;$v2"; - } - } else { - $this->forwarders= array(""); - } /* Set up has_mailAccount */ if (isset($this->attrs['objectClass'])){ @@ -650,18 +639,6 @@ class phoneAccount extends plugin } } - /* Check for forwarding action */ - foreach ($this->forwarders as $nr => $fw){ - - /* Buttons pressed? */ - if (isset($_POST["add_fw$nr"])){ - $this->forwarders= $this->insert_after("", $nr, $this->forwarders); - } - if (isset($_POST["remove_fw$nr"])){ - unset($this->forwarders[$nr]); - } - } - /* Transfer ACL's */ foreach($this->attributes as $val){ $smarty->assign($val."ACL", chkacl($this->acl, "$val")); @@ -693,28 +670,6 @@ class phoneAccount extends plugin $hl.= "\n"; $smarty->assign ("hardware_list", $hl); - /* Generate forwarder view */ - $forwarder_list=""; - $acl= chkacl($this->acl, "goFonForwaring"); - foreach ($this->forwarders as $nr => $fw){ - if ($fw == ""){ - $number= ""; $timeout= ""; - } else { - list($number, $timeout)= split(";", $fw); - } - $forwarder_list.= ""; - $forwarder_list.= ""; - $forwarder_list.= ""; - $forwarder_list.= ""; - $forwarder_list.= ""; - $forwarder_list.= ""; - if (count($this->forwarders) > 1){ - $forwarder_list.= ""; - } - $forwarder_list.= ""; - } - $smarty->assign("forwarder_list", $forwarder_list); - /* Show main page */ $display.= $smarty->fetch(get_template_path('generic.tpl', TRUE, dirname(__FILE__))); return($display); @@ -739,17 +694,6 @@ class phoneAccount extends plugin $this->goFonDeliveryMode= $tmp; } - /* Save forwarding numbers and timeouts */ - if (chkacl ($this->acl, "goFonForwarder") == ""){ - foreach ($this->forwarders as $nr => $fw){ - $tmp= $_POST["fwn$nr"].";".$_POST["fwt$nr"]; - if ($this->forwarders[$nr] != $tmp){ - $this->is_modified= TRUE; - } - $this->forwarders[$nr]= $tmp; - } - } - /* Every macro in the select box are available */ if((isset($_POST['macro']))){ $this->macrostillavailable=true; @@ -830,23 +774,6 @@ class phoneAccount extends plugin } } - /* Check timestamps and phonenumbers */ - foreach ($this->forwarders as $fw){ - - /* Skip empty values */ - if ($fw == ";"){ - continue; - } - - /* Check */ - list($number, $timeout)= split(";", $fw); - if (!is_phone_nr($number)){ - $message[]= sprintf(_("The number '%s' is no valid phone number!"), $number); - } - if (!is_id($timeout)){ - $message[]= sprintf(_("The timeout '%s' contains invalid characters!"), $timeout); - } - } /* check for ! in any parameter setting*/ if(isset($this->macroarray[$this->macro])){ @@ -870,10 +797,6 @@ class phoneAccount extends plugin foreach ($this->phoneNumbers as $number){ $this->attrs['telephoneNumber'][]= $number; } - $this->attrs['goFonForwarding']= array(); - foreach ($this->forwarders as $index => $number){ - $this->attrs['goFonForwarding'][]= "$index;$number"; - } /* Save settings, or remove goFonMacro attribute*/ if($this->macro!="none"){ @@ -945,16 +868,6 @@ class phoneAccount extends plugin $this->phoneNumbers[$number]= $number; } } - - /* Assemble forwarders */ - if (isset($this->attrs['goFonForwarding'])){ - for ($i= 0; $i<$this->attrs['goFonForwarding']['count']; $i++){ - list($num, $v1, $v2) =split(';', $this->attrs['goFonForwarding'][$i]); - $this->forwarders[$num]= "$v1;$v2"; - } - } else { - $this->forwarders= array(""); - } } diff --git a/plugins/gofon/phoneaccount/generic.tpl b/plugins/gofon/phoneaccount/generic.tpl index 5e26d8109..35619b04c 100644 --- a/plugins/gofon/phoneaccount/generic.tpl +++ b/plugins/gofon/phoneaccount/generic.tpl @@ -2,7 +2,7 @@

{t}Phone numbers{/t}

- {html_options options=$phoneNumbers}