summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a882bc2)
raw | patch | inline | side by side (parent: a882bc2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Jun 2005 09:35:35 +0000 (09:35 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Jun 2005 09:35:35 +0000 (09:35 +0000) |
This is only testing, won't work correct yet ....
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@704 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@704 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/systems/class_phoneGeneric.inc | patch | blob | history | |
plugins/admin/systems/phone.tpl | patch | blob | history |
diff --git a/plugins/admin/systems/class_phoneGeneric.inc b/plugins/admin/systems/class_phoneGeneric.inc
index 417b6b31cf3dd36209ac27cf8baaccd0813ca454..dddc9499a37c0315031b0baf4c7466b40dbbfee0 100644 (file)
var $ignore_account= TRUE;
/* Needed values and lists */
- var $base= "";
- var $cn= "";
- var $macAddress= "";
- var $ipHostNumber= "";
- var $description= "";
- var $orig_dn= "";
+ var $base = "";
+ var $cn = "";
+ var $macAddress = "";
+ var $ipHostNumber = "";
+ var $description = "";
+ var $orig_dn = "";
+ var $goFonType = "";
+ var $goFonDmtfMode = "";
+ var $goFonHost = "";
+ var $goFonDefaultIP = "";
+ var $goFonQualify = "";
+ var $goFonAuth = "";
+ var $goFonSecret = "";
+ var $goFonInkeys = "";
+ var $goFonOutkey = "";
+ var $goFonTrunk = "";
+ var $goFonAccountCode = "";
+ var $goFonMSN = "";
+ var $selected_categorie = 0;
/* attribute list for save action */
- var $attributes= array("cn", "description", "macAddress", "ipHostNumber");
+ var $attributes= array("cn", "description", "macAddress", "ipHostNumber"
+ ,"goFonType","goFonDmtfMode","goFonHost","goFonDefaultIP",
+ "goFonQualify","goFonAuth","goFonSecret","goFonInkeys","goFonOutkey",
+ "goFonTrunk","goFonAccountCode","goFonMSN","selected_categorie"
+ );
+
+ var $usedattrs = array( "0"=>array("cn", "description", "macAddress", "ipHostNumber",
+ "goFonType","goFonDmtfMode","goFonHost","goFonDefaultIP",
+ "goFonQualify"),
+ "1"=>array("cn", "description", "macAddress", "ipHostNumber",
+ "goFonType","goFonHost","goFonDefaultIP",
+ "goFonQualify","goFonAuth","goFonSecret","goFonInkeys","goFonOutkey",
+ "goFonTrunk","goFonAccountCode","selected_categorie"),
+ "2"=>array("cn", "description", "macAddress", "ipHostNumber","goFonMSN"));
+
+
var $objectclasses= array("top", "goFonHardware");
function phonegeneric ($config, $dn= NULL)
} else {
$this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
}
+
+ if($this->goFonMSN != ""){
+ $this->selected_categorie = 2;
+ }elseif($this->goFonAccountCode != ""){
+ $this->selected_categorie = 1 ;
+ } else {
+ $this->selected_categorie = 0;
+ }
+
+
/* Save dn for later references */
$this->orig_dn= $this->dn;
function execute()
{
+
+
/* Do we represent a valid phone? */
if (!$this->is_account && $this->parent == NULL){
$display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
$smarty= get_smarty();
$smarty->assign("bases", $this->config->idepartments);
+ /* Create Arrays for samrty select boxes */
+ $smarty->assign("categories", array("SIP - phones","IAX - phones","CAPI - phones"));
+ $smarty->assign("goFonTypes", array("peer" =>"peer" ,"user" =>"user" ,"friend" =>"friend"));
+ $smarty->assign("goFonDmtfModes", array("inband" =>"inband" ,"rfc2833"=>"rfc2833" ,"info" =>"info"));
+ $smarty->assign("goFonAuths", array("plaintext" =>"plaintext" ,"md5" =>"md5" ,"rsa" =>"rsa"));
+ $smarty->assign("goFonTrunks", array("yes" =>"yes" ,"no" =>"no"));
+
+ /* deativate all fields that are not used by the specified type */
+ foreach($this->attributes as $att){
+ if(!in_array($att,$this->usedattrs[$this->selected_categorie])){
+ $smarty->assign($att."USED", "disabled" );
+ }else{
+ $smarty->assign($att."USED", "" );
+ }
+ }
+
+
/* Assign attributes */
foreach ($this->attributes as $attr){
$smarty->assign($attr."ACL", chkacl($this->acl, $attr));
/* Show main page */
$smarty->assign("netconfig", dirname(__FILE__)."/network.tpl");
+ $smarty->assign("phonesettings", dirname(__FILE__)."/phonesettings.tpl");
return($smarty->fetch (get_template_path('phone.tpl', TRUE)));
}
function save()
{
plugin::save();
+
+
+ /* only to define which attrs to save*/
+ $mode = $this->attrs['selected_categorie'];
+ /* Remove all unwanted attrs */
+ foreach($this->attributes as $att){
+ if(!in_array($att,$this->usedattrs[$mode])){
+ $this->attrs[$att] = array();
+ }
+ }
+
+ /* unset the categorie*/
+ unset($this->attrs['selected_categorie']);
+
/* Remove all empty values */
if ($this->orig_dn == 'new'){
$attrs= array();
index a5d0ce49b552e5adddbd2f20c631492bbddc34c1..317a9b7ec4f46f0b6afc3fc50505b080c7746a99 100644 (file)
</table>
<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
+{include file="$phonesettings"}
+<p class="plugbottom" style="margin-bottom:0px; padding:0px;"> </p>
{include file="$netconfig"}
<!-- Place cursor -->