AddCheckBox */ var $ShowServers; var $ShowTerminals; var $ShowWorkstations; var $ShowWinWorkstations; var $ShowPrinters; var $ShowDevices; var $ShowPhones; /* Subsearch checkbox */ var $SubSearch; var $parent ; var $ui ; function divListSystem ($config,$parent) { MultiSelectWindow::MultiSelectWindow($config, "System", array("server", "workstation", "terminal", "phone", "printer")); $this->parent = $parent; $this->ui = get_userinfo(); /* Set list strings */ $this->SetTitle(_("List of systems")); $this->SetSummary(_("List of systems")); /* Result page will look like a headpage */ $this->SetHeadpageMode(); $this->SetInformation(_("This menu allows you to add, remove and change the properties of specific systems. You can only add systems which have already been started once.")); $this->EnableAplhabet (true); /* Disable buttonsm */ $this->EnableCloseButton(false); $this->EnableSaveButton (false); /* Dynamic action col, depending on snapshot icons */ $action_col_size = 50; if($this->parent->snapshotEnabled()){ $action_col_size += 38; } /* set Page header */ $this->AddHeader(array("string"=>" ","attach"=>"style='width:20px;'")); $this->AddHeader(array("string"=>_("System / Department"))); $this->AddHeader(array("string"=>_("Actions"),"attach"=>"style='width:".$action_col_size."px;border-right:0px;'")); /* Text ,Value ,Name ,Is selected */ $this->AddCheckBox("ShowServers", _("Select to see servers"), _("Show servers"), true); $this->AddCheckBox("ShowTerminals", _("Select to see Linux terminals"), _("Show terminals") , true); $this->AddCheckBox("ShowWorkstations", _("Select to see Linux workstations"), _("Show workstations"), true); $this->AddCheckBox("ShowWinWorkstations", _("Select to see MicroSoft Windows based workstations"), _("Show windows based workstations"),true); $this->AddCheckBox("ShowPrinters", _("Select to see network printers"), _("Show network printers") ,true); $this->AddCheckBox("ShowPhones", _("Select to see VOIP phones"), _("Show phones") , true); $this->AddCheckBox("ShowDevices", _("Select to see network devices"), _("Show network devices"), true); /* Add SubSearch checkbox */ $this->AddCheckBox(SEPERATOR); $this->AddCheckBox("SubSearch", _("Select to search within subtrees"), _("Ignore subtrees"), false); /* Name ,Text ,Default , Connect with alphabet */ $this->AddRegex ("Regex", _("Display systems matching"),"*" , true); $this->AddRegex ("UserRegex", _("Display systems of user"), "*" , false, "images/search_user.png"); } function GenHeader() { /* Prepare departments, which are shown in the listbox on top of the listbox */ $options= ""; /* Get all departments within this subtree */ $base = $this->config->current['BASE']; $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); $tmp =array(); foreach($deps as $dep){ $tmp[$dep['dn']] = $dep; } $deps = $tmp; /* Load possible departments */ $ui= get_userinfo(); $department = array(); foreach($this->module as $module){ $d = $ui->get_module_departments($module); foreach($d as $department){ $departments[$department] = $department; } } $ids = $this->config->idepartments; foreach($deps as $dep){ if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $departments)){ $value = $ids[$dep['dn']]; if ($this->selectedBase == $dep['dn']){ $options.= ""; } else { $options.= ""; } } } $listhead = "