From 9c5c4f3a2053924029f164e068ea8413de44b93c Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 27 May 2008 13:00:49 +0000 Subject: [PATCH] Fixed blocklist actions. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11039 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../blocklists/class_divListBlocklists.inc | 64 +++++++++++-------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc b/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc index d5130f173..904198dd1 100644 --- a/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc +++ b/gosa-plugins/gofax/gofax/blocklists/class_divListBlocklists.inc @@ -137,45 +137,47 @@ class divListBlocklist extends MultiSelectWindow /* Create Layers menu */ $s = ".|"._("Actions")."|\n"; - $s .= "..|". - " "._("Create")."|\n"; /* Append create options */ if(preg_match("/c/",$acl)) { + $s .= "..|". + " "._("Create")."|\n"; $s.= "...|". " "._("Blocklist")."|goFaxBlocklist_new|\n"; + $s.= "..|---|\n"; } /* Multiple options */ - $s.= "..|---|\n"; $s.= "..|". " "._("Remove")."|"."remove_multiple|\n"; - /* Add multiple copy & cut icons */ - if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ + if(is_object($this->parent->CopyPasteHandler) && preg_match("/r/",$acl_all)){ $s.= "..|---|\n"; $s.= "..|". " "._("Copy")."|"."multiple_copy_systems|\n"; - $s.= "..|". - " "._("Cut")."|"."multiple_cut_systems|\n"; - - if($this->parent->CopyPasteHandler->entries_queued()){ - $img = ""; - $s.="..|".$img." "._("Paste")."|editPaste|\n"; - }else{ - $img = ""; - $s.="..|".$img." "._("Paste")."\n"; + if(is_object($this->parent->CopyPasteHandler) && preg_match("/(r.*d|d.*r)/",$acl_all)){ + $s.= "..|". + " "._("Cut")."|"."multiple_cut_systems|\n"; } } + /* Copy & paste icons */ + if(is_object($this->parent->CopyPasteHandler) && $this->parent->CopyPasteHandler->entries_queued()){ + $img = ""; + $s.="..|".$img." "._("Paste")."|editPaste|\n"; + }else{ + $img = ""; + $s.="..|".$img." "._("Paste")."\n"; + } + /* Add snapshot icons */ if(preg_match("/(c.*w|w.*c)/",$acl_all)){ $s .= "..|---|\n"; $s .= $this->get_snapshot_header(TRUE); } - $this->SetDropDownHeaderMenu($s); + $this->SetDropDownHeaderMenu($s); $this->SetListHeader($listhead); } @@ -202,27 +204,37 @@ class divListBlocklist extends MultiSelectWindow foreach($list as $key => $val){ $acl = $ui->get_permissions($val['dn'],"gofaxlist/blocklist"); + $acl_all = $ui->has_complete_category_acls($val['dn'],"gofaxlist"); + if(!preg_match("/r/",$acl)){ continue; } - /* Edit link ; requires read access */ - $action= ""; - - - /* Create snapshot ; requires write access && create access */ - if(preg_match("/w/",$acl) && preg_match("/c/",$acl)){ - $action.= $this->GetSnapShotActions($val['dn']); - } - - /* Add copy & cut icons */ - if(preg_match("/(c.*w|w.*c)/",$acl) && $this->parent->CopyPasteHandler){ + $action =""; + if(preg_match("/(r.*d|r.*d)/",$acl_all) && $this->parent->CopyPasteHandler){ $action .= " "; + }else{ + $action.="  "; + } + + if(preg_match("/r/",$acl_all) && $this->parent->CopyPasteHandler){ $action.= " "; + }else{ + $action.="  "; } + /* Edit link ; requires read access */ + $action.= ""; + + /* Add snapshot icon */ + if(preg_match("/(r.*w|w.*r)/",$acl_all)){ + $action.= $this->GetSnapShotActions($val['dn']); + }else{ + $action.="  "; + $action.="  "; + } /* Delete entry ; requires remove access */ if(preg_match("/d/",$acl)){ -- 2.30.2