Commit 5269ce43 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Merge branch '5135-filter-enhancement-and-management-refactor' into '1.4-dev'

Resolve "filter enhancement and management refactor"

See merge request fusiondirectory/fd!370
Showing with 20 additions and 14 deletions
+20 -14
...@@ -38,10 +38,14 @@ class GroupContentColumn extends Column ...@@ -38,10 +38,14 @@ class GroupContentColumn extends Column
if ($types[$i] == 'I') { if ($types[$i] == 'I') {
continue; continue;
} }
$infos = objects::infos(ogroup::$objectTypes[$types[$i]]); try {
$result .= '<img src="'.htmlentities($infos['icon'], ENT_COMPAT, 'UTF-8').'"'. $infos = objects::infos(ogroup::$objectTypes[$types[$i]]);
' alt="'.htmlentities($infos['name'], ENT_COMPAT, 'UTF-8').'"'. $result .= '<img src="'.htmlentities($infos['icon'], ENT_COMPAT, 'UTF-8').'"'.
' title="'.htmlentities($infos['name'], ENT_COMPAT, 'UTF-8').'"/>'; ' alt="'.htmlentities($infos['name'], ENT_COMPAT, 'UTF-8').'"'.
' title="'.htmlentities($infos['name'], ENT_COMPAT, 'UTF-8').'"/>';
} catch (NonExistingObjectTypeException $e) {
continue;
}
} }
if ($result == '') { if ($result == '') {
return '&nbsp;'; return '&nbsp;';
......
...@@ -33,12 +33,16 @@ class GroupContentFilterElement extends FilterElement ...@@ -33,12 +33,16 @@ class GroupContentFilterElement extends FilterElement
$this->types = array(); $this->types = array();
foreach (ogroup::$objectTypes as $key => $type) { foreach (ogroup::$objectTypes as $key => $type) {
$infos = objects::infos($type); try {
$this->types[$type] = array( $infos = objects::infos($type);
'filter' => '(gosaGroupObjects=*'.$key.'*)', $this->types[$type] = array(
'infos' => $infos, 'filter' => '(gosaGroupObjects=*'.$key.'*)',
'checked' => FALSE, 'infos' => $infos,
); 'checked' => FALSE,
);
} catch (NonExistingObjectTypeException $e) {
continue;
}
} }
} }
......
...@@ -52,8 +52,7 @@ class ObjectsAttribute extends GenericDialogAttribute ...@@ -52,8 +52,7 @@ class ObjectsAttribute extends GenericDialogAttribute
break; break;
} }
} catch (NonExistingObjectTypeException $e) { } catch (NonExistingObjectTypeException $e) {
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $e->getMessage(), "Objecttype"); continue;
unset(ogroup::$objectTypes[$code]);
} }
} }
if (!isset($this->displays[$i])) { if (!isset($this->displays[$i])) {
...@@ -82,13 +81,12 @@ class ObjectsAttribute extends GenericDialogAttribute ...@@ -82,13 +81,12 @@ class ObjectsAttribute extends GenericDialogAttribute
($this->disabled ? ' disabled="disabled"' : ''). ($this->disabled ? ' disabled="disabled"' : '').
' >'."\n"; ' >'."\n";
foreach ($this->getDisplayValues() as $key => $value) { foreach ($this->getDisplayValues() as $key => $value) {
$infos = array();
try { try {
$infos = array();
if ($this->types[$key] !== 'I') { if ($this->types[$key] !== 'I') {
$infos = objects::infos(ogroup::$objectTypes[$this->types[$key]]); $infos = objects::infos(ogroup::$objectTypes[$this->types[$key]]);
} }
} catch (NonExistingObjectTypeException $e) { } catch (NonExistingObjectTypeException $e) {
die('No type for '.$key.' '.$value);
} }
if (isset($infos['icon'])) { if (isset($infos['icon'])) {
$img = $infos['icon']; $img = $infos['icon'];
......
Supports Markdown
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