summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ea9accc)
raw | patch | inline | side by side (parent: ea9accc)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 15 Aug 2005 09:42:13 +0000 (09:42 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 15 Aug 2005 09:42:13 +0000 (09:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1143 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/gofon/phoneaccount/class_phoneAccount.inc | patch | blob | history | |
plugins/gofon/phoneaccount/generic.tpl | patch | blob | history |
diff --git a/plugins/gofon/phoneaccount/class_phoneAccount.inc b/plugins/gofon/phoneaccount/class_phoneAccount.inc
index 9741b68aff921b6560e555c843b3ed2707a7f570..a99133bd5f758a790b7e6e0477300875030c057a 100644 (file)
/* 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();
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");
$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'])){
}
}
- /* 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"));
$hl.= "</select>\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.= "<tr><td>";
- $forwarder_list.= "<input name=\"fwn$nr\" size=25 align=\"middle\" maxlength=60 value=\"$number\" $acl>";
- $forwarder_list.= "</td><td>";
- $forwarder_list.= "<input name=\"fwt$nr\" size=5 align=\"middle\" maxlength=5 value=\"$timeout\" $acl>";
- $forwarder_list.= "</td><td>";
- $forwarder_list.= "<input type=\"submit\" value=\""._("Add")."\" name=\"add_fw$nr\" $acl>";
- if (count($this->forwarders) > 1){
- $forwarder_list.= "<input type=\"submit\" value=\""._("Remove")."\" name=\"remove_fw$nr\" $acl>";
- }
- $forwarder_list.= "</td></tr>";
- }
- $smarty->assign("forwarder_list", $forwarder_list);
-
/* Show main page */
$display.= $smarty->fetch(get_template_path('generic.tpl', TRUE, dirname(__FILE__)));
return($display);
$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;
}
}
- /* 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])){
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"){
$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("");
- }
}
index 5e26d81093b030050cd9963d5981134b9c1a6505..35619b04ca6fc5c749cf0820c1c0000deed62fc7 100644 (file)
<tr>
<td style="vertical-align:top; border-right:1px solid #A0A0A0; width:50%">
<h2><img alt="" align="middle" src="images/banana.png"> {t}Phone numbers{/t}</h2>
- <select style="width:380px; height:120px;" name="phonenumber_list[]" size=6 multiple {$telephoneNumberACL}>
+ <select style="width:380px;" name="phonenumber_list[]" size=4 multiple {$telephoneNumberACL}>
{html_options options=$phoneNumbers}
<option disabled>
</td>
</tr>
</table>
-
- <table summary="">
- <tr>
- <td>
- <h2><img alt="" align="middle" src="images/rightarrow.png"> {t}Forward calls to{/t}</h2>
-
- <table summary="{t}Phone number{/t}">
- <tr>
- <td>{t}Phone number{/t}</td><td>{t}Timeout (s){/t}</td><td> </td>
- </tr>
- {$forwarder_list}
- </table>
- </td>
- </table>
</td>
</tr>