From ee3f904a838691148c14d6be3895e54450f29f1b Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 8 May 2006 07:13:21 +0000 Subject: [PATCH] Updated summary tab, class isshown now git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3212 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_faiSummaryTab.inc | 90 +++++++++++++++++------ 1 file changed, 68 insertions(+), 22 deletions(-) diff --git a/plugins/admin/fai/class_faiSummaryTab.inc b/plugins/admin/fai/class_faiSummaryTab.inc index 43b087e56..45402b6b2 100644 --- a/plugins/admin/fai/class_faiSummaryTab.inc +++ b/plugins/admin/fai/class_faiSummaryTab.inc @@ -188,70 +188,108 @@ class faiSummaryTab extends plugin{ foreach($data as $key => $entry){ $image = "".$this->objs[$key]["; - - $str.=""; if(!isset($entry['Open'])){ - $str .= " "; + $str .= " "; $str .= $image." "; - $str .= "".$this->objs[$key]['Name'].""; + $str .= "".$this->objs[$key]['Name'].""; }else{ - $str .= " "; + $str .= " "; $str .= $image." "; - $str .= "".$this->objs[$key]['Name'].""; + $str .= "".$this->objs[$key]['Name'].""; /* Display FAItemplate FAIhook FAIscript entries */ if(in_array($key,array("FAItemplate","FAIhook","FAIscript"))){ + $nums = array(); + if($key == "FAIscript"){ + krsort($entry['Entries']); foreach($entry['Entries'] as $scripts){ ksort($scripts); foreach($scripts as $script){ - $script['cn'][0] = "(".$script['FAIpriority'][0].") ".$script['cn'][0]; - $tmp[$script['cn'][0]] = $script; + +// $script['cn'][0] = "(".$script['FAIpriority'][0].") ".$script['cn'][0]; + if(!isset($nums[$script['cn'][0]])){ + $nums[$script['cn'][0]]= 0; + } + $nums[$script['cn'][0]] ++; + + $tmp[] = $script; } } $entry['Entries'] = $tmp; + }else{ + foreach($entry['Entries'] as $script){ + if(!isset($nums[$script['cn'][0]])){ + $nums[$script['cn'][0]]= 0; + } + $nums[$script['cn'][0]] ++; + } } foreach($entry['Entries'] as $cn => $data){ - $str .=""; + + if(isset($nums[$data['cn'][0]]) && ($nums[$data['cn'][0]] > 1)){ + $str .=""; + }else{ + $str .=""; + } + $str .= ""; - $str .= $image." ".$data['cn'][0]; + $str .= $image." "; + if(isset($data['FAIpriority'][0])){ + $str .= "(".$data['FAIpriority'][0].")"; + } + + $str .= " ".$data['cn'][0]; if(isset($data['description'][0])){ $str .= " [".$data['description'][0]."]"; } - $str .=""; + $str .= ""; + $str .= "".$data['CLASS'].""; + $str .= ""; } } /* Create variable entries */ if(in_array($key,array("FAIvariable"))) { foreach($entry['Entries'] as $cn => $data){ - $str .=""; + $str .=""; $str .= $image." ".$data['cn'][0]; if(isset($data['description'][0])){ $str .= " [".$data['description'][0]."] "; } $str .=" = '".$data['FAIvariableContent'][0]."'"; + + $str .= "".$data['CLASS'].""; + + + $str .=""; } } /* Create packagelist entries */ if(in_array($key,array("FAIpackageList"))) { - ksort($entry['Entries']); - foreach($entry['Entries'] as $cn => $data){ - $str .=""; - $str .= $image." ".$data; +// ksort($entry['Entries']); + foreach($entry['Entries'] as $data){ + $str .=""; + $str .= $image." ".$data['cn'][0]; + $str .= "".$data['CLASS'].""; + $str .= "";; } } /* Create partition table entries */ if(in_array($key,array("FAIpartitionTable"))) { foreach($entry['Entries'] as $cn => $data){ - $str .=""; + $str .= ""; $str .= $image." ".$data['name']; + $str .= "".$data['CLASS'].""; + $str .= ""; ksort($data['partitions']); + + $str .= ""; $str .= " @@ -289,7 +327,6 @@ class faiSummaryTab extends plugin{ } } } - $str.="" ; } $str .="
"._("No.")."
"; return($str); @@ -341,7 +378,8 @@ class faiSummaryTab extends plugin{ $ldap->cd($data['dn']); $ldap->search("(objectClass=FAIscriptEntry)",array("cn","description","FAIpriority")); while($attrs = $ldap->fetch()){ - $current[$attrs['FAIpriority'][0]][$attrs['cn'][0]] = $attrs; + $attrs['CLASS'] = $data['cn'][0]; + $current[$attrs['FAIpriority'][0]][] = $attrs; } $this->Result['FAIscript']['Entries'] = $current ; } @@ -364,6 +402,8 @@ class faiSummaryTab extends plugin{ /* Create an array which is sortable by priority */ while($attrs = $ldap->fetch()){ + $attrs['CLASS'] = $data['cn'][0]; + $disks[$attrs['cn'][0]]= $attrs; if(isset($attrs['description'][0])){ $disks[$attrs['cn'][0]]['name'] = $attrs['cn'][0]." [".$attrs['description'][0]."]"; }else{ @@ -381,6 +421,7 @@ class faiSummaryTab extends plugin{ if(!isset($attrs['FAIfsOptions'][0])){ $attrs['FAIfsOptions'][0] = ""; } + $attrs['CLASS'] = $data['cn'][0]; $disks[$key]['partitions'][$attrs['cn'][0]] = $attrs; } } @@ -400,7 +441,8 @@ class faiSummaryTab extends plugin{ $ldap->cd($data['dn']); $ldap->search("(objectClass=FAItemplateEntry)",array("cn","description")); while($attrs = $ldap->fetch()){ - $current[$attrs['cn'][0]] = $attrs; + $attrs['CLASS'] = $data['cn'][0]; + $current[] = $attrs; } $this->Result['FAItemplate']['Entries'] = $current ; } @@ -416,7 +458,9 @@ class faiSummaryTab extends plugin{ if(isset($data['FAIpackage'])){ unset($data['FAIpackage']['count']); foreach($data['FAIpackage'] as $pkg){ - $current[$pkg] = $pkg; + $attrs['CLASS'] = $data['cn'][0]; + $attrs['cn'][0] = $pkg; + $current[$pkg] = $attrs; } } $this->Result['FAIpackageList']['Entries'] = $current ; @@ -434,7 +478,8 @@ class faiSummaryTab extends plugin{ $ldap->cd($data['dn']); $ldap->search("(objectClass=FAIvariableEntry)",array("cn","description","FAIvariableContent")); while($attrs = $ldap->fetch()){ - $current[$attrs['cn'][0]] = $attrs; + $attrs['CLASS'] = $data['cn'][0]; + $current[] = $attrs; } $this->Result['FAIvariable']['Entries'] = $current ; } @@ -450,6 +495,7 @@ class faiSummaryTab extends plugin{ $ldap->cd($data['dn']); $ldap->search("(objectClass=FAIhookEntry)",array("cn","description")); while($attrs = $ldap->fetch()){ + $attrs['CLASS'] = $data['cn'][0]; $current[$attrs['cn'][0]] = $attrs; } $this->Result['FAIhook']['Entries'] = $current ; -- 2.30.2