From: hickert Date: Wed, 21 Jun 2006 07:15:29 +0000 (+0000) Subject: Added Vendor + Produkt to hotplugs X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0e4b08a5baf58ef725ca877afcf5de1097ddfb77;p=gosa.git Added Vendor + Produkt to hotplugs git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3844 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/personal/environment/class_environment.inc b/plugins/personal/environment/class_environment.inc index 4132771b4..bb4f7147e 100644 --- a/plugins/personal/environment/class_environment.inc +++ b/plugins/personal/environment/class_environment.inc @@ -113,6 +113,19 @@ class environment extends plugin $tmp2['name'] = $tmp[0]; $tmp2['description'] = $tmp[1]; $tmp2['id'] = $tmp[2]; + + /* Produkt ID */ + if(!isset($tmp[3])){ + $tmp[3] = ""; + } + /* Vendor ID */ + if(!isset($tmp[4])){ + $tmp[4] = ""; + } + + $tmp2['product'] = $tmp[3]; + $tmp2['vendor'] = $tmp[4]; + $this->gotoHotplugDevices[$tmp[0]]=$tmp2; } } @@ -1074,7 +1087,8 @@ $ldap->modify ($attrs); /* Prepare HotPlug devices */ $this->attrs['gotoHotplugDevice'] = array(); foreach($this->gotoHotplugDevices as $name => $device){ - $this->attrs['gotoHotplugDevice'][] = $device['name']."|".$device['description']."|".$device['id']; + $this->attrs['gotoHotplugDevice'][] = $device['name']."|".$device['description']."|".$device['id']. + "|".$device['produkt']."|".$device['vendor']; } /* Prepare LogonScripts */ diff --git a/plugins/personal/environment/class_hotplugDialog.inc b/plugins/personal/environment/class_hotplugDialog.inc index a314c7850..238bb9d24 100644 --- a/plugins/personal/environment/class_hotplugDialog.inc +++ b/plugins/personal/environment/class_hotplugDialog.inc @@ -9,13 +9,15 @@ class hotplugDialog extends plugin /* attribute list for save action */ var $ignore_account = TRUE; - var $attributes = array("HOT_name","HOT_description","HOT_id"); + var $attributes = array("HOT_name","HOT_description","HOT_id","HOT_produkt","HOT_vendor"); var $objectclasses = array("whatever"); var $use_existing = false; var $HOT_name = ""; var $HOT_description = ""; var $HOT_id = ""; + var $HOT_produkt = ""; + var $HOT_vendor = ""; var $hotplugDevices = ""; var $hotplugDeviceList = array(); @@ -24,7 +26,6 @@ class hotplugDialog extends plugin var $deplist = "/"; - function hotplugDialog ($config, $dn= NULL,$use_existing=false ) { $this->use_existing = $use_existing; @@ -118,6 +119,12 @@ class hotplugDialog extends plugin if((empty($this->HOT_id))||(preg_match("/[\|]/i",$this->HOT_id))){ $message[]=_("Please specify a valid id."); } + if((empty($this->HOT_vendor))||(preg_match("/[\|]/i",$this->HOT_vendor))){ + $message[]=_("Please specify a valid id."); + } + if((empty($this->HOT_produkt))||(preg_match("/[\|]/i",$this->HOT_produkt))){ + $message[]=_("Please specify a valid id."); + } $ldap = $this->config->get_ldap_link(); $ldap->search("(&(objectClass=gotoEnvironment)(gotoHotplugDevice=".$this->HOT_name."*))",array("gotoHotplugDevice")); @@ -141,9 +148,11 @@ class hotplugDialog extends plugin /* return generated entry from input fields*/ if(!$this->use_existing){ $a_return=array(); - $a_return[$this->HOT_name]['name']= $this->HOT_name; - $a_return[$this->HOT_name]['description']= $this->HOT_description; - $a_return[$this->HOT_name]['id']= $this->HOT_id; + $a_return[$this->HOT_name]['name'] = $this->HOT_name; + $a_return[$this->HOT_name]['description'] = $this->HOT_description; + $a_return[$this->HOT_name]['id'] = $this->HOT_id; + $a_return[$this->HOT_name]['produkt'] = $this->HOT_produkt; + $a_return[$this->HOT_name]['vendor'] = $this->HOT_vendor; return($a_return); }else{ $entries = array(); @@ -173,9 +182,21 @@ class hotplugDialog extends plugin $a_return[$tmp[0]]= $tmp[0]." [".$tmp[1]."] ".$tmp[2]; $tmp2['name'] = $tmp[0]; - $tmp2['description'] = $tmp[1]; + $tmp2['description'] = $tmp[1]; $tmp2['id'] = $tmp[2]; + /* Produkt ID */ + if(!isset($tmp[3])){ + $tmp[3] = ""; + } + /* Vendor ID */ + if(!isset($tmp[4])){ + $tmp[4] = ""; + } + + $tmp2['produkt'] = $tmp[3]; + $tmp2['vendor'] = $tmp[4]; + $this->hotplugDeviceList[$tmp[0]]=$tmp2; } } diff --git a/plugins/personal/environment/hotplugDialogNew.tpl b/plugins/personal/environment/hotplugDialogNew.tpl index 635e93c96..4196308ca 100644 --- a/plugins/personal/environment/hotplugDialogNew.tpl +++ b/plugins/personal/environment/hotplugDialogNew.tpl @@ -24,12 +24,25 @@ + + + + + + +
{$must} + + + {$must} + + +
{$must}