Code

Renanmed opsi class
[gosa.git] / gosa-plugins / systems / admin / systems / class_divListSystem.inc
index fd8153a02cb8b2c83799cddc2341197b85fbfd90..32da5bbbc7c646b4c54cb497c2d721b3d6a02420 100644 (file)
@@ -176,29 +176,33 @@ class divListSystem extends MultiSelectWindow
       " "._("Create")."|\n";
 
     if(class_available("termtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
-      $s.= "...|<img src='images/select_terminal.png' alt='' border='0' class='center'>".
+      $s.= "...|<img src='plugins/systems/images/select_terminal.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Terminal")."|"."newsystem_terminal|\n";
     }
     if(class_available("worktabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
-      $s.= "...|<img src='images/select_workstation.png' alt='' border='0' class='center'>".
+      $s.= "...|<img src='plugins/systems/images/select_workstation.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Workstation")."|"."newsystem_workstation|\n";
     }
     if(class_available("servtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/servgeneric"))){
-      $s.= "...|<img src='images/select_server.png' alt='' border='0' class='center'>".
+      $s.= "...|<img src='plugins/systems/images/select_server.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Server")."|"."newsystem_server|\n";
     }
     if(class_available("phonetabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
-      $s.= "...|<img src='images/select_phone.png' alt='' border='0' class='center'>".
+      $s.= "...|<img src='plugins/systems/images/select_phone.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Phone")."|"."newsystem_phone|\n";
     }
     if(class_available("printtabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){
-      $s.= "...|<img src='images/select_printer.png' alt='' border='0' class='center'>".
+      $s.= "...|<img src='plugins/systems/images/select_printer.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Printer")."|"."newsystem_printer|\n";
     }
     if(class_available("componenttabs") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
-      $s.= "...|<img src='images/select_component.png' alt='' border='0' class='center'>".
+      $s.= "...|<img src='plugins/systems/images/select_component.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Component")."|"."newsystem_component|\n";
     }
+    if(class_available("opsiGeneric") && preg_match("/c/",$ui->get_permissions($this->selectedBase,"opsi/opsiGeneric"))){
+      $s.= "...|<img src='plugins/systems/images/select_component.png' alt='' border='0' class='center'>".
+        "&nbsp;"._("Opsi")."|"."newsystem_opsi_client|\n";
+    }
 
     if($this->parent->si_active){
       $events  = DaemonEvent::get_event_types(SYSTEM_EVENT);
@@ -209,7 +213,7 @@ class divListSystem extends MultiSelectWindow
         $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|trigger_event_".$name."\n";
       }
 
-      $s.= "..|<img src='images/clock.png' alt='' border='0' class='center'>".
+      $s.= "..|<img src='plugins/systems/images/clock.png' alt='' border='0' class='center'>".
         "&nbsp;"._("Schedule action")."|\n";
       foreach($events['SCHEDULED'] as $name =>  $event){
         $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|schedule_event_".$name."\n";
@@ -240,17 +244,6 @@ class divListSystem extends MultiSelectWindow
 
   function setEntries($terminals)
   {
-    $img1  = "<img class='center' src='images/printer.png'            alt='C' title='"._("Cups Server")  ."'>";
-    $img2  = "<img class='center' src='images/scanner.png'            alt='L' title='"._("Log Db") ."'>";
-    $img3  = "<img class='center' src='images/select_terminal.png'    alt='L' title='"._("Syslog Server") ."'>";
-    $img4  = "<img class='center' src='images/mailto.png'             alt='M' title='"._("Mail Server")  ."'>";
-    $img5  = "<img class='center' src='images/select_phone.png'       alt='I' title='"._("Imap Server") ."'>";
-    $img6  = "<img class='center' src='images/fax_small.png'          alt='F' title='"._("Nfs Server")   ."'>";
-    $img7  = "<img class='center' src='images/select_winstation.png'  alt='K' title='"._("Kerberos Server") ."'>";
-    $img8  = "<img class='center' src='images/select_phone.png'       alt='A' title='"._("Asterisk Server") ."'>";
-    $img9  = "<img class='center' src='images/fax_small.png'          alt='F' title='"._("Fax Server") ."'>";
-    $img10 = "<img class='center' src='images/save.png'               alt='L' title='"._("Ldap Server") ."'>";
-
     $empty    ="<img src='images/empty.png' style='width:16px ; height: 16px;' class='center' alt=''>";
 
     /* Dynamic action col, depending on snapshot icons */
@@ -264,22 +257,12 @@ class divListSystem extends MultiSelectWindow
 
     /* ACL mapping */
     $ui = get_userinfo();
-    $tabs = array(
-          "terminal"    => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "terminal/termgeneric"),
-          "workstation" => array("CLASS"=>"WORKTABS",     "TABCLASS" =>"worktabs",      "ACL"=> "workstation/workgeneric"),
-          "server"      => array("CLASS"=>"SERVTABS",     "TABCLASS" =>"servtabs",      "ACL"=> "server/servgeneric"),
-          "printer"     => array("CLASS"=>"PRINTTABS",    "TABCLASS" =>"printtabs",     "ACL"=> "printer/printgeneric"),
-          "phone"       => array("CLASS"=>"PHONETABS",    "TABCLASS" =>"phonetabs",     "ACL"=> "phone/phoneGeneric"),
-          "winstation"  => array("CLASS"=>"WINTABS",      "TABCLASS" =>"wintabs",       "ACL"=> "winworkstation/wingeneric"),
-          "incoming"    => array("CLASS"=>"",             "TABCLASS" =>"",              "ACL"=> "incoming/systems"),
-          "component"   => array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs", "ACL"=> "component/componentGeneric"));
-
+    $tabs = $this->parent->get_tab_defs();
 
     $cnts = array("component" => 0 , "terminal" => 0 , "workstation" => 0 , 
-                  "printer" => 0 , "phone" => 0 , "server" => 0,
+                  "printer" => 0 , "phone" => 0 , "server" => 0,"opsi_client" => 0,
                   "NewDevice" => 0, "winstation"=> 0);
 
-
     /* Get list of all objectGroups and their member and release configuration 
      */
     $ogroups = array();
@@ -305,19 +288,13 @@ class divListSystem extends MultiSelectWindow
 
       /* Get system type, it is used to fetch the acls for the current object.
           "winstation" acls are stored as 2winworkstation", so we have to map this here */
-      $type     = $this->parent->get_system_type($val);
-      if($type == "winstation") {
-        $acl_type = "winworkstation";
-      }else{
-        $acl_type = $type;
-      }
 
       /* Map NewDevice acls to workstation acls */
+      $type     = $this->parent->get_system_type($val);
       if($type == "NewDevice" || $type == "ArpNewDevice"){
         $type     = "incoming";
-        $acl_type = "incoming";
       }
-
+      $acl_type = $tabs[$type]['ACLC'];
       $s_acl    = $tabs[$type]['ACL'];
       $category = preg_replace("/\/.*$/","",$s_acl);
       $class    = preg_replace("/^.*\//","",$s_acl);
@@ -343,22 +320,6 @@ class divListSystem extends MultiSelectWindow
         $action.= $empty;
       }
 
-
-      /* Generate picture list, which is currently disabled */
-      if(in_array("goCupsServer"    ,$val['objectClass'])) $cups    = $img1;   else $cups  =$empty;
-      if(in_array("goLogDBServer"   ,$val['objectClass'])) $logdb   = $img2;   else $logdb =$empty;
-      if(in_array("goSyslogServer"  ,$val['objectClass'])) $syslog  = $img3;   else $syslog=$empty;
-      if(in_array("goImapServer"    ,$val['objectClass'])) $imap    = $img4;   else $imap  =$empty;
-      if(in_array("sambaSamAccount" ,$val['objectClass'])) $samba   = $img5;   else $samba =$empty;
-      if(in_array("goShareServer"   ,$val['objectClass'])) $nfs     = $img6;   else $nfs   =$empty;
-      if(in_array("goKrbServer"     ,$val['objectClass'])) $krb     = $img7;   else $krb   =$empty;
-      if(in_array("goFonServer"     ,$val['objectClass'])) $fon     = $img8;   else $fon   =$empty;
-      if(in_array("goFaxServer"     ,$val['objectClass'])) $fax     = $img9;   else $fax   =$empty;
-      if(in_array("goLdapServer"    ,$val['objectClass'])) $ldap     = $img10;   else $ldap   =$empty;
-
-      $pics = $cups.$logdb.$syslog.$imap.$samba.$nfs.$krb.$fon.$fax.$ldap;
-      $pics = ""; // Pictures currently hidden
-
       $val['cn'][0]= preg_replace('/\$$/', '', $val['cn'][0]);
 
       // Generate Array to Add
@@ -382,7 +343,7 @@ class divListSystem extends MultiSelectWindow
       }
 
       if(in_array("gotoWorkstation",$val['objectClass'])){
-        $action2= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'   
+        $action2= "<input class='center' type='image' src='plugins/systems/images/cdrom.png' alt='"._("Create CD")."'   
                       name='gen_cd_%KEY%' title='"._("Create FAI CD")."'>&nbsp;".$action2;
       }else{
         $action2= $empty.$action2;
@@ -429,7 +390,7 @@ class divListSystem extends MultiSelectWindow
           $release_attach = ""; 
         }elseif(isset($ogs_release[$val['dn']])){
           $release = trim($ogs_release[$val['dn']]['STR'],", ").
-            "&nbsp;<img src='images/select_ogroup.png' class='center' alt='' 
+            "&nbsp;<img src='plugins/ogroups/images/select_ogroup.png' class='center' alt='' 
             title='".sprintf(_("Inherited from %s"),trim($ogs_release[$val['dn']]['CN'],", "))."'>";
           $release_attach = "title='".sprintf(_("Inherited from %s"),trim($ogs_release[$val['dn']]['CN'],", "))."'"; 
         }
@@ -456,21 +417,21 @@ class divListSystem extends MultiSelectWindow
     $num_wws_str = sprintf(_("Number of listed '%s'"),_("windows workstations"));
     $num_dep_str = sprintf(_("Number of listed '%s'"),_("departments"));
 
-    $str = "<img class='center' src='images/select_server.png'
+    $str = "<img class='center' src='plugins/systems/images/select_server.png'
       title='".$num_ser_str."' alt='".$num_ser_str."'>&nbsp;".$cnts['server']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_workstation.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_workstation.png'
       title='".$num_ws_str."' alt='".$num_ws_str."'>&nbsp;".$cnts['workstation']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_terminal.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_terminal.png'
       title='".$num_ter_str."' alt='".$num_ter_str."'>&nbsp;".$cnts['terminal']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_phone.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_phone.png'
       title='".$num_pho_str."' alt='".$num_pho_str."'>&nbsp;".$cnts['phone']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_printer.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_printer.png'
       title='".$num_prt_str."' alt='".$num_prt_str."'>&nbsp;".$cnts['printer']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_component.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_component.png'
       title='".$num_com_str."' alt='".$num_com_str."'>&nbsp;".$cnts['component']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_newsystem.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_newsystem.png'
       title='".$num_new_str."' alt='".$num_new_str."'>&nbsp;".$cnts['NewDevice']."&nbsp;&nbsp;&nbsp;&nbsp;";
-    $str.= "<img class='center' src='images/select_winstation.png'
+    $str.= "<img class='center' src='plugins/systems/images/select_winstation.png'
       title='".$num_wws_str."' alt='".$num_wws_str."'>&nbsp;".$cnts['winstation']."&nbsp;&nbsp;&nbsp;&nbsp;";
     $str.= "<img class='center' src='images/lists/folder.png'
       title='".$num_dep_str."' alt='".$num_dep_str."'>&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";