From 566bc6476e8e766d46d72fa36eaef4bbbc497dd5 Mon Sep 17 00:00:00 2001 From: Gunnar Wrobel Date: Sun, 10 May 2009 23:37:04 +0200 Subject: [PATCH] Allow for complex attributes in the search result. --- koward/lib/Koward/Controller/ObjectController.php | 14 +++++++++----- koward/lib/Koward/Form/Search.php | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/koward/lib/Koward/Controller/ObjectController.php b/koward/lib/Koward/Controller/ObjectController.php index 7b34082f3..2bef3ba0d 100644 --- a/koward/lib/Koward/Controller/ObjectController.php +++ b/koward/lib/Koward/Controller/ObjectController.php @@ -157,8 +157,8 @@ class ObjectController extends Koward_Controller_Application $this->actions = new Koward_Form_Actions($this->object, $buttons); $this->post = $this->urlFor(array('controller' => 'object', - 'action' => 'view', - 'id' => $this->params->id)); + 'action' => 'view', + 'id' => $this->params->id)); if (!empty($this->params->token) && !empty($this->params->oaction)) { if (is_array($this->params->token) && count($this->params->token) == 1) { @@ -180,7 +180,7 @@ class ObjectController extends Koward_Controller_Application } header('Location: ' . $this->urlFor(array('controller' => 'object', 'action' => 'view', - 'id' => $this->params->id)); + 'id' => $this->params->id))); exit; } else if ($this->actions->validate()) { $action = $this->actions->execute(); @@ -326,8 +326,8 @@ class ObjectController extends Koward_Controller_Application $this->attributes = $this->koward->search['list_attributes']; } else { $this->attributes = array( - '__id' => array( - 'title' => _("Kennung"), + 'dn' => array( + 'title' => _("Distinguished name"), 'width' => 100, 'link_view'=> true, ) @@ -366,6 +366,10 @@ class ObjectController extends Koward_Controller_Application 'action' => 'view', 'id' => $uid)), _("View")); $this->objectlist[$uid]['__id'] = $uid; + if (!empty($this->koward->search['complex_attributes'])) { + $object = $this->koward->getObject($uid); + $this->objectlist[$uid] = array_merge($object->toHash(array_keys($this->attributes)), $this->objectlist[$uid]); + } } } } diff --git a/koward/lib/Koward/Form/Search.php b/koward/lib/Koward/Form/Search.php index 5b7b04928..70220f622 100644 --- a/koward/lib/Koward/Form/Search.php +++ b/koward/lib/Koward/Form/Search.php @@ -76,7 +76,7 @@ class Koward_Form_Search extends Horde_Form { } } - function &execute($attributes) + function &execute($attributes = array()) { $this->getInfo($this->_vars, $info); if (isset($info['object'])) { -- 2.11.0