X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fdepartments%2Fclass_divListDepartment.inc;h=5bb5c9d6e3f0c3ecfd1207f65d9220dc7324e6c0;hb=9a0dd04fc44c7afa080b0a0dea3db4ce836d8f36;hp=e2b1509e63cc78e0eef04032205a99f3d2e7062b;hpb=d00c540f49a26a2d62e481c4823cf775bdff0d43;p=gosa.git diff --git a/plugins/admin/departments/class_divListDepartment.inc b/plugins/admin/departments/class_divListDepartment.inc index e2b1509e6..5bb5c9d6e 100755 --- a/plugins/admin/departments/class_divListDepartment.inc +++ b/plugins/admin/departments/class_divListDepartment.inc @@ -18,7 +18,7 @@ class divListDepartment extends MultiSelectWindow function divListDepartment ($config,$parent) { - MultiSelectWindow::MultiSelectWindow($config,"Department"); + MultiSelectWindow::MultiSelectWindow($config, "Department", "department"); $this->parent = $parent; $this->ui = get_userinfo(); @@ -30,28 +30,23 @@ class divListDepartment extends MultiSelectWindow /* Result page will look like a headpage */ $this->SetHeadpageMode(); - $this->SetInformation(_("This menu allows you to create, delete and edit selected departments. Having a large size of departments, you might prefer the range selectors on top of the department list.")); + $this->SetInformation(_("This menu allows you to create, delete and edit selected departments. Having a large number of departments, you might prefer the range selectors on top of the department list.")); /* 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 += 20; - } - /* set Page header */ $this->AddHeader(array("string" => " ", "attach" => "style='text-align:center;width:20px;'")); $this->AddHeader(array("string"=>_("Department name"), "attach" => "style=''")); - $this->AddHeader(array("string" =>_("Actions"), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align:right;'")); + $this->AddHeader(array("string" =>_("Actions"), "attach" => "style='width:60px;border-right:0px;text-align:right;'")); + /* Add SubSearch checkbox */ $this->AddCheckBox("SubSearch", _("Select to search within subtrees"), _("Ignore subtrees"), false); /* Name ,Text ,Default , Connect with alphabet */ - $this->AddRegex ("Regex", _("Regular expression for matching group names"), "*" , true); + $this->AddRegex ("Regex", _("Regular expression for matching department names"), "*" , true); } @@ -70,29 +65,31 @@ class divListDepartment extends MultiSelectWindow } /* Generate list head */ + $ui = get_userinfo(); + $acl = $ui->get_permissions("ou=dummy,",$this->selectedBase ,"department/department"); + $listhead = "
". - "  ". - "  ". - "  ". - "  ". - "  "; - - if($this->parent->snapshotEnabled()){ - $listhead .= " ". - "  "; + "  ". + "  ". + "  ". + "  "; + + if(preg_match("/c/",$acl)){ + $listhead .= "  ". + "   "; } + - $listhead .= "   ". - "  ". - _("Base")." ". - "  ". + $listhead .= "  ". + " "._("Base")." ". + "  ". "
"; $this->SetListHeader($listhead); @@ -106,29 +103,23 @@ class divListDepartment extends MultiSelectWindow function setEntries($list) { - $linkopen = "%s"; - /* Dynamic action col, depending on snapshot icons */ - $action_col_size = 50; - if($this->parent->snapshotEnabled()){ - $action_col_size += 20; - } - + $ui = get_userinfo(); foreach($list as $key => $val) { - - $cdn= convert_department_dn($val['dn']); - if(isset($val["description"][0])) { - $disp = get_sub_department($cdn)." - [".$val["description"][0]."]"; - }else{ - $disp = get_sub_department($cdn); + + $actions= ""; + + $acl = $ui->get_permissions($this->config->departments[$key] ,"department/department"); + if(preg_match("/r/",$acl)){ + $actions.= ""; + } + + if(preg_match("/c/",$acl)){ + $actions.= ""; } - - $actions= ""; - $actions.= $this->GetSnapShotActions($val['dn']); - $actions.= ""; if(!isset($this->config->departments[trim($key)])){ $this->config->departments[trim($key)]=""; @@ -144,8 +135,8 @@ class divListDepartment extends MultiSelectWindow $title = preg_replace('/ /', ' ', @LDAP::fix($this->config->departments[$key])); $field0 = array("string" => "department", "attach" => "style='text-align:center;width:20px;'"); - $field1 = array("string" => sprintf($linkopen,base64_encode($cdn),$disp), "attach" => "style='' title='".$title."'"); - $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions), "attach" => "style='width:".$action_col_size."px;border-right:0px;text-align: + $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "style='' title='".$title."'"); + $field2 = array("string" => preg_replace("/%KEY%/", base64_encode($key), $actions), "attach" => "style='width:60px;border-right:0px;text-align: right;'"); $this->AddElement( array($field0,$field1,$field2));