Commit 5a160392 authored by Benoit Mortier's avatar Benoit Mortier

Fixes: #1146 [PATCH] Add FAI state column.

parent 772c5291
......@@ -96,6 +96,7 @@ class systemManagement extends management
// Build headpage
$headpage = new listing(get_template_path("system-list.xml", true));
$headpage->registerElementFilter("systemRelease", "systemManagement::systemRelease");
$headpage->registerElementFilter("systemFAIstate", "systemManagement::systemFAIstate");
$headpage->registerElementFilter("ipOf", "systemManagement::ipOf");
$headpage->registerElementFilter("listServices", "systemManagement::listServices");
$headpage->setFilter($filter);
......@@ -1434,6 +1435,32 @@ class systemManagement extends management
return($str);
}
##FIXME should be documented and var changed a,b,c is stupid
static function systemFAIstate($a,$b,$c,$objectclasses= null,$state= null)
{
global $config;
// No objectclasses set - go ahead
if(!$objectclasses) return(" ");
// Skip non fai objects
if (!in_array_ics("FAIobject", $objectclasses)) {
return " ";
}
if ($state) {
$elements = explode(':', $state[0], 2);
if (count($elements) == 1)
return ' '.$elements[0].' ';
else
return '&nbsp;<div style="display:inline-block;" title="'.htmlentities($elements[1]).'">'.htmlentities($elements[0]).'</div>&nbsp;';
}
else
return ("&nbsp;(new)&nbsp;");
return("&nbsp;");
}
/*! \brief !! Incoming dummy acls, required to defined acls for incoming objects
*/
......
......@@ -205,6 +205,14 @@
<export>true</export>
</column>
<column>
<label>FAI state</label>
<sortAttribute>sort,cn</sortAttribute>
<sortType>string,string</sortType>
<value>%{filter:systemFAIstate(row,dn,"%s",objectClass,FAIstate)}</value>
<export>true</export>
</column>
<column>
<label>Actions</label>
<value>%{filter:actions(dn,row,objectClass)}</value>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment