index 0a8bcb925c251e0469be2b973c28fb2c9d615688..3963f42cf1e210e2d496c437ad7a755ba7cf27f2 100644 (file)
$this->Result = array();
$_SESSION['faiSummaryTab']['UniqueID'] = 0;
$tmp = $this->getBranches();
-
+
+
/* Get classes & release name
There are 2 different tabs which use the summary tab
faiProfile / Workstations */
/* Get Classes and release */
$this->Classes = $this->parent->by_object['faiProfile']->FAIclasses;
$str = preg_replace("/^.*ou=profiles,/","",$this->dn);
+
if(isset($tmp[$str])){
$this->Release = $tmp[$str];
}
}elseif(isset($this->parent->by_name['workstartup'])){
$this->Classes = $this->parent->by_object['workstartup']->FAIclass;
$this->Release = $this->parent->by_object['workstartup']->FAIrelease;
+
+ /* Append workstation class && LAST */
+ if(isset($this->parent->by_object['workgeneric']->cn)){
+ $this->Classes[] = $this->parent->by_object['workgeneric']->cn;
+ }
+
$tmp = array_flip($tmp);
if(!isset($tmp[$this->Release])) {
$this->Release = "";
}
}
+ $this->Classes[] = "LAST";
+
/* Set all available releases */
$this->Releases = array_flip($this->getBranches());
$this->usedClasses = array();
function save_object()
{
$once = true;
+
+ if(isset($_GET['expand']) && isset($_GET['id'])){
+ if(isset($this->Result[$_GET['id']])){
+ $this->Result[$_GET['id']]['Open'] =true ;
+ }
+ }
+
+ if(isset($_GET['compress']) && isset($_GET['id'])){
+ if(isset($this->Result[$_GET['id']])){
+ unset($this->Result[$_GET['id']]['Open']);
+ }
+ }
+
foreach($_POST as $name => $value ){
/* check for open tag request */
}
- /* returns an array with all possibly release types */
- function getBranches($base = false,$prefix = "")
+ function getBranches()
{
- $ret = array("main"=>"/");
+ $dn = $this->config->current['BASE'];
$ldap = $this->config->get_ldap_link();
- $ldap->cd($this->config->current['BASE']);
- if(!$base){
- $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
- }
- $ldap->cd($base);
- $ldap->ls("(objectClass=FAIbranch)",$base);
+ $ldap->cd($dn);
+ $ldap->search("(&(objectClass=organizationalUnit)(objectClass=FAIbranch))",array("ou","cn","dn"));
+ $ret = array("main"=>"/");
while($attrs = $ldap->fetch()){
- if((isset($attrs['ou']))&&($attrs['dn']!=$base)){
- $ret[$attrs['dn']]= $prefix.$attrs['ou'][0];
- $ret = array_merge($ret,$this->getBranches($attrs['dn'],"".$prefix.$attrs['ou'][0]."/"));
+ if(preg_match("/ou=fai,/",$attrs['dn'])){
+ $name = convert_department_dn(preg_replace("/,ou=fai,.*$/","",$attrs['dn']));
+ $ret[$attrs['dn']] = $name;
}
}
return($ret);
function createSummary($data)
{
/* Don't generate any output, if there is no result */
- $str ="<table style='width:100%;background:#F5F5F5;'> ";
+ $str ="<table cellspacing=0 cellpadding=2 style='width:100%;background:#F5F5F5;'> ";
if(!count($this->Result)){
$str.="<tr><td>";
$str.= (_("This object has no FAI classes assigned."));
$image = "<img src='".$this->objs[$key]['Image']."' class='center' alt='".$this->objs[$key]['Name']."' border=0>";
if(!isset($entry['Open'])){
- $str .= "<tr><td colspan=2><input type='image' class='center' src='images/expand.png' name='open_".$key."'> ";
+ $str .= "<tr><td colspan=2>
+ <a href='?plug=".$_GET['plug']."&expand&id=".$key."'>
+ <img border=0 class='center' src='images/expand.png' alt='"._("Open")."'> ";
$str .= $image." ";
- $str .= "<b>".$this->objs[$key]['Name']."</b></td></tr>";
+ $str .= "<b>".$this->objs[$key]['Name']."</b></b></td></tr>";
}else{
- $str .= "<tr><td colspan=2><input type='image' class='center' src='images/sort_down.png' name='close_".$key."'> ";
+ $str .= "<tr><td colspan=2>
+ <a href='?plug=".$_GET['plug']."&compress&id=".$key."'>
+ <img border=0 class='center' src='images/sort_down.png' alt='"._("Close")."'> ";
$str .= $image." ";
- $str .= "<b>".$this->objs[$key]['Name']."</b></td></tr>";
+ $str .= "<b>".$this->objs[$key]['Name']."</b></a></td></tr>";
/* Display FAItemplate FAIhook FAIscript entries */
if(in_array($key,array("FAItemplate","FAIhook","FAIscript"))){
$str .="<tr><td style='padding-left:20px;'>";
}
- $str .= "<a target='_blank'href='?plug=".$_GET['plug']."&show&type=".$key."&id=".base64_encode($data['dn'])."'>";
+ $str .= "<a target='_blank' href='?plug=".$_GET['plug']."&show&type=".$key."&id=".base64_encode($data['dn'])."'>";
$str .= $image." ";
if(isset($data['FAIpriority'][0])){
$str .= "(".$data['FAIpriority'][0].")";
if(isset($data['description'][0])){
$str .= " [".$data['description'][0]."] ";
}
- $str .=" = '".$data['FAIvariableContent'][0]."'";
+ /* Only display FAIvariableContent if description dosn't contain [*] */
+ if(isset($data['description'][0]) && !preg_match("#\[\*\]#",$data['description'][0])){
+ $str .=" = '".$data['FAIvariableContent'][0]."'";
+ }
$str .= "</td><td><i>".$data['CLASS']."</i>";
$str .="</td></tr>";
}