Code

Added Vendor + Produkt to hotplugs
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jun 2006 07:15:29 +0000 (07:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 21 Jun 2006 07:15:29 +0000 (07:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3844 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/class_hotplugDialog.inc
plugins/personal/environment/hotplugDialogNew.tpl

index 4132771b48a963cde6528fd5e8cafa49b5df3eaf..bb4f7147ed2fe721fe6f5a3ac7afd44cb045a691 100644 (file)
@@ -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 */
index a314c785071e2ea8008f82087c7738e8af2f0a32..238bb9d2404ced79d8337bcea9081b57897557da 100644 (file)
@@ -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;
           }
         }
index 635e93c962aabf9c9fe327d6d43ecdac19bf3ea2..4196308cacff5c06e93b0825f5bbaa0e05c61f9a 100644 (file)
    </td>
    <td style="vertical-align:top">
        <table summary="">
+               <tr>
+                       <td><LABEL for="HOT_vendor">{t}Vendor ID{/t}</LABEL>{$must}
+                       </td>
+                       <td>
+                               <input type="text" value="{$HOT_vendor}" name="HOT_vendor" id="HOT_vendor">
+                       </td>
+                       <td><LABEL for="HOT_produkt">{t}Produkt ID{/t}</LABEL>{$must}
+                       </td>
+                       <td>
+                               <input type="text" value="{$HOT_produkt}" name="HOT_produkt" id="HOT_produkt">
+                       </td>
+               </tr>
                <tr>
                        <td><LABEL for="HOT_id">{t}Device ID{/t}</LABEL>{$must}
                        </td>
                        <td>
                                <input type="text" value="{$HOT_id}" name="HOT_id" id="HOT_id">
                        </td>
+                       <td cols="2">&nbsp;</td>
                </tr>
        </table>
 </table>