Code

Updated acl handling in system list.
[gosa.git] / gosa-plugins / systems / admin / systems / class_divListSystem.inc
1 <?php
2 /*
3  * This code is part of GOsa (http://www.gosa-project.org)
4  * Copyright (C) 2003-2008 GONICUS GmbH
5  *
6  * ID: $$Id$$
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
23 class divListSystem extends MultiSelectWindow
24 {
26   /* Current base */
27   var $selectedBase       = "";
28   var $departments        = array();
30   /* Regex */
31   var $Regex              = "*";
32   var $UserRegex          = "*";
34   /* CheckBoxes, to change default values modify $this->AddCheckBox */
35   var $ShowServers;
36   var $ShowTerminals;
37   var $ShowWorkstations;
38   var $ShowWinWorkstations;
39   var $ShowPrinters;
40   var $ShowDevices;
41   var $ShowPhones;
43   /* Subsearch checkbox */
44   var $SubSearch;
46   var $parent             ;
47   var $ui                 ;
49   function divListSystem (&$config,$parent)
50   {
51     MultiSelectWindow::MultiSelectWindow($config, "System", array("server",
52                                                                   "workstation",
53                                                                   "terminal",
54                                                                   "phone",
55                                                                   "incoming",
56                                                                   "printer"));
58     $this->parent       = $parent;
59     $this->ui           = get_userinfo();
61     /* Set list strings */
62     $this->SetTitle(_("List of systems"));
63     $this->SetSummary(_("List of systems"));
65     /* Result page will look like a headpage */
66     $this->SetHeadpageMode();
68     $this->EnableAplhabet   (true);
70     /* Disable buttonsm */
71     $this->EnableCloseButton(false);
72     $this->EnableSaveButton (false);
74     /* Dynamic action col, depending on snapshot icons */
75     $action_col_size = 110;
76     if($this->parent->snapshotEnabled()){
77       $action_col_size += 38;
78     }
80     /* Toggle all selected / deselected */
81     $chk = "<input type='checkbox' id='select_all' name='select_all' title='"._("Select all")."'
82                onClick='toggle_all_(\"^item_selected_[0-9]*$\",\"select_all\");' >";
84     /* set Page header */
85     $this->AddHeader(array("string"=> $chk,          "attach"=>"style='width:20px;'"));
86     $this->AddHeader(array("string"=>"&nbsp;","attach"=>"style='width:20px;'"));
87     $this->AddHeader(array("string"=>_("Systems")." / "._("Department")));
89     /* Add header for selected FAI release, if fai is active */
90     if($this->parent->fai_activated){
91       $this->AddHeader(array("string"=>_("Release"),"attach"=>"style='width:100px;'"));
92     }
94     $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:".$action_col_size."px;border-right:0px;'"));
96     /*                  Text        ,Value    ,Name         ,Is selected */
97     $this->AddCheckBox("ShowServers",        
98         msgPool::selectToView(  _("servers")),            
99         sprintf(_("Show %s"),   _("servers")),true);
100     $this->AddCheckBox("ShowTerminals",       
101         msgPool::selectToView(  _("Linux terminals")),    
102         sprintf(_("Show %s"),   _("terminals")),true);
103     $this->AddCheckBox("ShowWorkstations",
104         msgPool::selectToView(  _("Linux workstations")), 
105         sprintf(_("Show %s"),   _("workstations")),true);
106     $this->AddCheckBox("ShowWinWorkstations", 
107         msgPool::selectToView(  _("MicroSoft Windows based workstations")), 
108         sprintf(_("Show %s"),   _("windows based workstations")),true);
109     $this->AddCheckBox("ShowPrinters",
110         msgPool::selectToView(  _("network printers")),   
111         sprintf(_("Show %s"),   _("network printers")) ,true);
112     $this->AddCheckBox("ShowPhones",
113         msgPool::selectToView(  _("VoIP phones")),        
114         sprintf(_("Show %s"),   _("phones")) ,true);
115     $this->AddCheckBox("ShowDevices",
116         msgPool::selectToView(  _("network devices")),    
117         sprintf(_("Show %s"),   _("network devices")),  true);
119     /* Add SubSearch checkbox */
120     $this->AddCheckBox(SEPERATOR);
121     $this->AddCheckBox("SubSearch",  msgPool::selectToView("","subsearch"), msgPool::selectToView("","subsearch_small"), false);
123     /*                  Name                 ,Text                              ,Default  , Connect with alphabet  */
124     $this->AddRegex   ("Regex",     _("Display systems matching"),"*" , true);
125     $this->AddRegex   ("UserRegex", _("Display systems of user"), "*" , false, "images/lists/search-user.png");
126   }
128   function GenHeader()
129   {
130    /* Prepare departments,
131        which are shown in the listbox on top of the listbox
132      */
133     $options= "";
135     /* Get all departments within this subtree */
136     $base = $this->config->current['BASE'];
138     /* Add base */
139     $tmp = array();
140     $tmp[] = array("dn"=>$this->config->current['BASE']);
141     $tmp=  array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base,
142                     array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH));
144     $deps = array();
145     foreach($tmp as $tm){
146       $deps[$tm['dn']] = $tm['dn'];
147     }
149     /* Load possible departments */
150     $ui= get_userinfo();
151     $first = "";
152     $found = FALSE;
153     $department = $departments = array();
154     foreach($this->module as $module){
155       $d = $ui->get_module_departments($module);      
156       foreach($d as $department){
157         $departments[$department] = $department;
158       }
159     }
161     /* Load possible departments */
162     $ui= get_userinfo();
163     $ids = $this->config->idepartments;
164     $first = "";
165     $found = FALSE;
166     foreach($ids as $dep => $name){
167       if(isset($deps[$dep]) && in_array_ics($dep, $departments)){
169         /* Keep first base dn in mind, we could need this
170          *  info if no valid base was found
171          */
172         if(empty($first)) {
173           $first = $dep['dn'];
174         }
176         $value = $ids[$dep];
177         if ($this->selectedBase == $dep){
178           $found = TRUE;
179           $options.= "<option selected='selected' value='".$dep."'>$value</option>";
180         } else {
181           $options.= "<option value='".$dep."'>$value</option>";
182         }
183       }
184     }
187     /* The currently used base is not visible with your acl setup.
188      * Set base to first useable base.
189      */
190     if(!$found){
191       $this->selectedBase = $first;
192     }
194     /* If there is at least one c (Create) and one w (Write) acl in this combination
195         display the snapshot paste icon. BUT check the correct acls in the management plugin */
196     $all_module_acls = "";
197     foreach($this->module as $module){
198       $all_module_acls .= $ui->has_complete_category_acls($this->selectedBase,$module);
199     }
201     /* Must we add an additional seperator */
202     $add_sep = false;
203    
204     /* Add default header */
205     $listhead = MultiSelectWindow::get_default_header();
207     /* Add base selection */
208     $listhead .= _("Base")."&nbsp; <select name='CurrentMainBase' onChange='mainform.submit()' class='center'>$options</select>".
209       " <input class='center' type='image' src='images/lists/submit.png' align='middle'
210       title='"._("Submit department")."' name='submit_department' alt='".           _("Submit")."'>&nbsp;";
212     /* Handle create icons */ 
213     $s = ".|"._("Actions")."|\n";
214     $s.= "..|<img src='images/lists/new.png' alt='' border='0' class='center'>".
215       "&nbsp;"._("Create")."|\n";
217     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
218       $s.= "...|<img src='images/select_terminal.png' alt='' border='0' class='center'>".
219         "&nbsp;"._("Terminal")."|"."newsystem_terminal|\n";
220     }
221     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/workgeneric"))){
222       $s.= "...|<img src='images/select_workstation.png' alt='' border='0' class='center'>".
223         "&nbsp;"._("Workstation")."|"."newsystem_workstation|\n";
224     }
225     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"workstation/servgeneric"))){
226       $s.= "...|<img src='images/select_server.png' alt='' border='0' class='center'>".
227         "&nbsp;"._("Server")."|"."newsystem_server|\n";
228     }
229     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"phone/phoneGeneric"))){
230       $s.= "...|<img src='images/select_phone.png' alt='' border='0' class='center'>".
231         "&nbsp;"._("Phone")."|"."newsystem_phone|\n";
232     }
233     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"printer/printgeneric"))){
234       $s.= "...|<img src='images/select_printer.png' alt='' border='0' class='center'>".
235         "&nbsp;"._("Printer")."|"."newsystem_printer|\n";
236     }
237     if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"component/componentGeneric"))){
238       $s.= "...|<img src='images/select_component.png' alt='' border='0' class='center'>".
239         "&nbsp;"._("Component")."|"."newsystem_component|\n";
240     }
242     $events  = DaemonEvent::get_event_types(SYSTEM_EVENT);
244     $s.= "..|<img src='images/rocket.png' alt='' border='0' class='center'>".
245       "&nbsp;"._("Trigger action")."|\n";
246     foreach($events['TRIGGERED'] as $name => $event){
247       $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|trigger_event_".$name."\n";
248     }
250     $s.= "..|<img src='images/clock.png' alt='' border='0' class='center'>".
251       "&nbsp;"._("Schedule action")."|\n";
252     foreach($events['SCHEDULED'] as $name =>  $event){
253       $s.= "...|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|schedule_event_".$name."\n";
254     }
256     $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>".
257       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
259     $s.= "..|<img src='images/lists/unlocked.png' alt='' border='0' class='center'>".
260       "&nbsp;"._("Activate systems")."|activate_multiple|\n";
262     if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$all_module_acls)){
263       $s.= "..|---|\n";
264       $s.= "..|<img src='images/lists/copy.png' alt='' border='0' class='center'>".
265         "&nbsp;"._("Copy")."|"."multiple_copy_systems|\n";
266       if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$all_module_acls)){
267         $s.= "..|<img src='images/lists/cut.png' alt='' border='0' class='center'>".
268           "&nbsp;"._("Cut")."|"."multiple_cut_systems|\n";
269       }
270     }
272     /* Copy & paste icons */
273     if(is_object($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler->entries_queued()){
274       $img = "<img border='0' class='center' src='images/lists/paste.png' alt=''>";
275       $s.="..|".$img."&nbsp;"._("Paste")."|editPaste|\n";
276     }else{
277       $img = "<img border='0' class='center' src='images/lists/paste-grey.png' alt=''>";
278       $s.="..|".$img."&nbsp;"._("Paste")."\n";
279     }
281     /* Add snapshot icons */
282     if(preg_match("/(c.*w|w.*c)/",$all_module_acls)){
283       $s .= "..|---|\n";
284       $s .= $this->get_snapshot_header(TRUE);
285     }
287     $this->SetDropDownHeaderMenu($s);
288     $this->SetListHeader($listhead);
289   }
291   function execute()
292   {
293     $this->ClearElementsList();
294     $this->GenHeader();
295   }
297   function setEntries($terminals)
298   {
299     $img1  = "<img class='center' src='images/printer.png'            alt='C' title='"._("Cups Server")  ."'>";
300     $img2  = "<img class='center' src='images/scanner.png'            alt='L' title='"._("Log Db") ."'>";
301     $img3  = "<img class='center' src='images/select_terminal.png'    alt='L' title='"._("Syslog Server") ."'>";
302     $img4  = "<img class='center' src='images/mailto.png'             alt='M' title='"._("Mail Server")  ."'>";
303     $img5  = "<img class='center' src='images/select_phone.png'       alt='I' title='"._("Imap Server") ."'>";
304     $img6  = "<img class='center' src='images/fax_small.png'          alt='F' title='"._("Nfs Server")   ."'>";
305     $img7  = "<img class='center' src='images/select_winstation.png'  alt='K' title='"._("Kerberos Server") ."'>";
306     $img8  = "<img class='center' src='images/select_phone.png'       alt='A' title='"._("Asterisk Server") ."'>";
307     $img9  = "<img class='center' src='images/fax_small.png'          alt='F' title='"._("Fax Server") ."'>";
308     $img10 = "<img class='center' src='images/save.png'               alt='L' title='"._("Ldap Server") ."'>";
310     $empty    ="<img src='images/empty.png' style='width:16px ; height: 16px;' class='center' alt=''>";
312     /* Dynamic action col, depending on snapshot icons */
313     $action_col_size = 110;
314     if($this->parent->snapshotEnabled()){
315       $action_col_size += 38;
316     }
318     // User and Template  Images
319     $editlink = "<a href='?plug=".$_GET['plug']."&amp;id=%s&amp;act=edit_entry'>%s</a>";
321     /* ACL mapping */
322     $ui = get_userinfo();
323     $tabs = array(
324           "terminal"    => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "terminal/termgeneric"),
325           "workstation" => array("CLASS"=>"WORKTABS",     "TABCLASS" =>"worktabs",      "ACL"=> "workstation/workgeneric"),
326           "server"      => array("CLASS"=>"SERVTABS",     "TABCLASS" =>"servtabs",      "ACL"=> "server/servgeneric"),
327           "printer"     => array("CLASS"=>"PRINTTABS",    "TABCLASS" =>"printtabs",     "ACL"=> "printer/printgeneric"),
328           "phone"       => array("CLASS"=>"PHONETABS",    "TABCLASS" =>"phonetabs",     "ACL"=> "phone/phoneGeneric"),
329           "winstation"  => array("CLASS"=>"WINTABS",      "TABCLASS" =>"wintabs",       "ACL"=> "winworkstation/wingeneric"),
330           "incoming"    => array("CLASS"=>"",             "TABCLASS" =>"",              "ACL"=> "incoming/systems"),
331           "component"   => array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs", "ACL"=> "component/componentGeneric"));
334     $cnts = array("component" => 0 , "terminal" => 0 , "workstation" => 0 , 
335                   "printer" => 0 , "phone" => 0 , "server" => 0,
336                   "NewDevice" => 0, "winstation"=> 0);
339     /* Get list of all objectGroups and their member and release configuration 
340      */
341     $ogroups = array();
342     if($this->parent->fai_activated){
343       $ogroups = get_sub_list("(&(objectClass=gosaGroupOfNames)(FAIclass=*)(member=*))",array("ogroups"),
344           get_ou("ogroupou"),$this->config->current['BASE'],array("FAIclass","member","cn"),GL_NO_ACL_CHECK | GL_SUBSEARCH);
345       foreach($ogroups as $ogroup){
346         for($i = 0 ; $i < $ogroup['member']['count'] ; $i++){
347           if(preg_match("/:/",$ogroup['FAIclass'][0])) {
348             if(!isset($og_list[$ogroup['member'][$i]])){
349               $ogs_release[$ogroup['member'][$i]]['STR'] = ""; 
350               $ogs_release[$ogroup['member'][$i]]['CN'] = ""; 
351             }
352             $ogs_release[$ogroup['member'][$i]]['STR'] .= preg_replace("/^.*:/","",$ogroup['FAIclass'][0]).", ";
353             $ogs_release[$ogroup['member'][$i]]['CN']  .= $ogroup['cn'][0].", ";
354           }
355         }
356       }
357     }
359     // Test Every Entry and generate divlist Array
360     foreach($terminals as $key => $val){
362       /* Get system type, it is used to fetch the acls for the current object.
363           "winstation" acls are stored as 2winworkstation", so we have to map this here */
364       $type     = $this->parent->get_system_type($val);
365       if($type == "winstation") {
366         $acl_type = "winworkstation";
367       }else{
368         $acl_type = $type;
369       }
371       /* Map NewDevice acls to workstation acls */
372       if($type == "NewDevice" || $type == "ArpNewDevice"){
373         $type     = "incoming";
374         $acl_type = "incoming";
375       }
377       /* Get complete category acls */
378       $acl_all  = $ui->has_complete_category_acls($val['dn'],$acl_type) ;
379   
380       /* Get specific generic acls */
381       $acl      = $ui->get_permissions($val['dn'],$tabs[$type]['ACL']);
383       $action ="";
384       if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){
385         $action .= "<input class='center' type='image'
386           src='images/lists/cut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'>&nbsp;";
387       }else{
388         $action.="<img src='images/empty.png' alt=' ' class='center'>&nbsp;";
389       }
391       if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){
392         $action.= "<input class='center' type='image'
393           src='images/lists/copy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'>&nbsp;";
394       }else{
395         $action.="<img src='images/empty.png' alt=' ' class='center'>&nbsp;";
396       }
398       $action.= "<input class='center' type='image' src='images/lists/edit.png' 
399                     alt='"._("edit")."'     name='system_edit_%KEY%' title='"._("Edit system")."'>";
401       /* Add snapshot icon */
402       if(preg_match("/(r.*w|w.*r)/",$acl_all)){
403         $action.= $this->GetSnapShotActions($val['dn']);
404       }else{
405         $action.="<img src='images/empty.png' alt=' ' class='center'>&nbsp;";
406         $action.="<img src='images/empty.png' alt=' ' class='center'>&nbsp;";
407       }
409       if(preg_match("/d/",$acl)){
410         $action.= "<input class='center' type='image' src='images/lists/trash.png' 
411           alt='"._("delete")."'   name='system_del_%KEY%' title='"._("Delete system")."'>";
412       }else{
413         $action.= $empty;    
414       }
416       /* Generate picture list, which is currently disabled */
417       if(in_array("goCupsServer"    ,$val['objectClass'])) $cups    = $img1;   else $cups  =$empty;
418       if(in_array("goLogDBServer"   ,$val['objectClass'])) $logdb   = $img2;   else $logdb =$empty;
419       if(in_array("goSyslogServer"  ,$val['objectClass'])) $syslog  = $img3;   else $syslog=$empty;
420       if(in_array("goImapServer"    ,$val['objectClass'])) $imap    = $img4;   else $imap  =$empty;
421       if(in_array("sambaSamAccount" ,$val['objectClass'])) $samba   = $img5;   else $samba =$empty;
422       if(in_array("goShareServer"   ,$val['objectClass'])) $nfs     = $img6;   else $nfs   =$empty;
423       if(in_array("goKrbServer"     ,$val['objectClass'])) $krb     = $img7;   else $krb   =$empty;
424       if(in_array("goFonServer"     ,$val['objectClass'])) $fon     = $img8;   else $fon   =$empty;
425       if(in_array("goFaxServer"     ,$val['objectClass'])) $fax     = $img9;   else $fax   =$empty;
426       if(in_array("goLdapServer"    ,$val['objectClass'])) $ldap     = $img10;   else $ldap   =$empty;
428       $pics = $cups.$logdb.$syslog.$imap.$samba.$nfs.$krb.$fon.$fax.$ldap;
429       $pics = ""; // Pictures currently hidden
431       $val['cn'][0]= preg_replace('/\$$/', '', $val['cn'][0]);
433       // Generate Array to Add
434       $dsc= "";
435       if (isset($val['description'][0])){
436         $dsc= " [".$val['description'][0]."]";
437       }
438       if((isset($val['is_new']))&&(!empty($val['is_new']))){
439         $display= $val["cn"][0]." ".$val['is_new'].$dsc;
440       }else{
441         $display= $val["cn"][0].$dsc;
442       }
444       /* Check if this is a terminal/workstation && if we are allowed to change the gotoRootPasswd */
445       $display_key_for = array("terminal","workstation","server","component");
446       $pwd_acl = $ui->get_permissions($val['dn'],$tabs[$type]['ACL'],"userPassword");
447       if(preg_match("/w/",$pwd_acl) && in_array($type,$display_key_for)){
448         $action2 = "<input class='center' type='image' src='images/lists/key.png' alt='"._("Password")."'   name='system_setpwd_%KEY%' title='"._("Set password")."'>";
449       }else{
450         $action2 = $empty;
451       }
453       if(in_array("gotoWorkstation",$val['objectClass'])){
454         $action2= "<input class='center' type='image' src='images/cdrom.png' alt='"._("Create CD")."'   
455                       name='gen_cd_%KEY%' title='"._("Create FAI CD")."'>&nbsp;".$action2;
456       }else{
457         $action2= $empty.$action2;
458       }
460       if(isset($val['message'])){
461         $display.= "  (".$val['message'].")";
462       }
464       $img    = $this->parent->convert_list($val);
466       /* Cutted objects should be displayed in light grey */
467       if($this->parent->CopyPasteHandler){
468         foreach($this->parent->CopyPasteHandler->queue as $queue_key => $queue_data){
469           if($queue_data['dn'] == $val['dn']) {
470             $display = "<font color='#999999'>".$display."</font>";
471             break;
472           }
473         }
474       }
476       $type = $this->parent->get_system_type($val);
477       if($type == "ArpNewDevice"){
478         $type = "NewDevice";
479       }
480       $cnts[$type] ++;
482       /* Create each field */
483       $field0 = array("string" => "<input type='checkbox' id='item_selected_".$key."' name='item_selected_".$key."'>" ,
484           "attach" => "style='width:20px;'");
485       $field1 = array("string" => sprintf($img['img'],$val['dn']),
486           "attach" => "style='text-align:center;width:20px;'");
487       $field2 = array("string" => sprintf($editlink,$key,$display),
488           "attach" => "style='' title='".preg_replace('/ /', '&nbsp;', @LDAP::fix($val['dn']))."'");
489       $field3 = array("string" => preg_replace("/%KEY%/", "$key", $action2.$action),
490           "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'");
492       if($this->parent->fai_activated){
494         $release ="&nbsp;";
495         $release_attach = ""; 
496         if(isset($val['FAIclass'][0]) && preg_match("/:/",$val['FAIclass'][0])){
497           $release        = preg_replace("/^.*:/","",$val['FAIclass'][0]);
498           $release_attach = ""; 
499         }elseif(isset($ogs_release[$val['dn']])){
500           $release = trim($ogs_release[$val['dn']]['STR'],", ").
501             "&nbsp;<img src='images/select_ogroup.png' class='center' alt='' 
502             title='".sprintf(_("Inherited from %s"),trim($ogs_release[$val['dn']]['CN'],", "))."'>";
503           $release_attach = "title='".sprintf(_("Inherited from %s"),trim($ogs_release[$val['dn']]['CN'],", "))."'"; 
504         }
505         $field2a = array("string" => $release,"attach"=>$release_attach." style='width:100px;'");
506         $this->AddElement( array($field0,$field1,$field2,$field2a,$field3));
507       }else{
508         $this->AddElement( array($field0,$field1,$field2,$field3));
509       }
510     }
512     /* Create summary string for list footer */
513     $num_deps=0;
514     if(!$this->SubSearch){
515       $num_deps = count($this->Added_Departments);
516     }
518     $num_ser_str = sprintf(_("Number of listed '%s'"),_("servers"));
519     $num_ws_str  = sprintf(_("Number of listed '%s'"),_("workstations"));
520     $num_ter_str = sprintf(_("Number of listed '%s'"),_("terminals"));
521     $num_pho_str = sprintf(_("Number of listed '%s'"),_("phones"));
522     $num_prt_str = sprintf(_("Number of listed '%s'"),_("printers"));
523     $num_com_str = sprintf(_("Number of listed '%s'"),_("network components"));
524     $num_new_str = sprintf(_("Number of listed '%s'"),_("new devices"));
525     $num_wws_str = sprintf(_("Number of listed '%s'"),_("windows workstations"));
526     $num_dep_str = sprintf(_("Number of listed '%s'"),_("departments"));
528     $str = "<img class='center' src='images/select_server.png'
529       title='".$num_ser_str."' alt='".$num_ser_str."'>&nbsp;".$cnts['server']."&nbsp;&nbsp;&nbsp;&nbsp;";
530     $str.= "<img class='center' src='images/select_workstation.png'
531       title='".$num_ws_str."' alt='".$num_ws_str."'>&nbsp;".$cnts['workstation']."&nbsp;&nbsp;&nbsp;&nbsp;";
532     $str.= "<img class='center' src='images/select_terminal.png'
533       title='".$num_ter_str."' alt='".$num_ter_str."'>&nbsp;".$cnts['terminal']."&nbsp;&nbsp;&nbsp;&nbsp;";
534     $str.= "<img class='center' src='images/select_phone.png'
535       title='".$num_pho_str."' alt='".$num_pho_str."'>&nbsp;".$cnts['phone']."&nbsp;&nbsp;&nbsp;&nbsp;";
536     $str.= "<img class='center' src='images/select_printer.png'
537       title='".$num_prt_str."' alt='".$num_prt_str."'>&nbsp;".$cnts['printer']."&nbsp;&nbsp;&nbsp;&nbsp;";
538     $str.= "<img class='center' src='images/select_component.png'
539       title='".$num_com_str."' alt='".$num_com_str."'>&nbsp;".$cnts['component']."&nbsp;&nbsp;&nbsp;&nbsp;";
540     $str.= "<img class='center' src='images/select_newsystem.png'
541       title='".$num_new_str."' alt='".$num_new_str."'>&nbsp;".$cnts['NewDevice']."&nbsp;&nbsp;&nbsp;&nbsp;";
542     $str.= "<img class='center' src='images/select_winstation.png'
543       title='".$num_wws_str."' alt='".$num_wws_str."'>&nbsp;".$cnts['winstation']."&nbsp;&nbsp;&nbsp;&nbsp;";
544     $str.= "<img class='center' src='images/lists/folder.png'
545       title='".$num_dep_str."' alt='".$num_dep_str."'>&nbsp;".$num_deps."&nbsp;&nbsp;&nbsp;&nbsp;";
547     $this->set_List_Bottom_Info($str);
548   }
551   function Save()
552   {
553     MultiSelectWindow :: Save();  
554   }
557   function save_object()
558   {
559     /* Save automatic created POSTs like regex, checkboxes */
560     MultiSelectWindow :: save_object();  
563   }
565 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
566 ?>