From d31345afa9345604c4eaf1cdb290d37b84b5d21a Mon Sep 17 00:00:00 2001 From: cajus Date: Wed, 12 Aug 2009 13:11:36 +0000 Subject: [PATCH] Updated xml and added first user defined filter for testing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14037 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/users/class_userManagement.inc | 61 +++++++++++++++++-- gosa-core/plugins/admin/users/user-list.xml | 4 +- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 9b4d57f82..74deff351 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -978,26 +978,75 @@ class userManagement extends plugin $this->reload(); $this->DivListUsers->setEntries($this->list); - # FILTER Test ################################################# + ## FILTER Test ################################################# + + ## Build filter #$filter = new filter(get_template_path("user-filter.xml", true)); #$filter->setObjectStorage(get_people_ou()); - #$filter->setCategory("users"); #$filter->setCurrentBase($this->DivListUsers->selectedBase); #$filter->update(); #session::set('autocomplete', $filter); #if (!$filter->isValid()){ # msg_dialog::display(_("Filter error"), _("The filter is uncomplete!"), ERROR_DIALOG); - #} else { - # print "Filter results:"; - # print_a($filter->query()); #} - #return($filter->renderFilter().$this->DivListUsers->Draw()); + + ## Build headpage + #$headpage = new listing(get_template_path("user-list.xml", true)); + #$headpage->registerFilter("accountProperties", "userManagement::filterProperties"); + #$headpage->setEntries($filter->query()); + # + #return($filter->render().$headpage->render()); ################################################### FILTER Test return($this->DivListUsers->Draw()); } + static function filterProperties($dn, $row, $class) + { + $result= ""; + + $map= array( "gosaAccount" => array( "image" => "plugins/users/images/select_user.png", + "alt" => _("Generic"), + "title" => _("Edit generic properties")), + "posixAccount" => array("image" => "images/penguin.png", + "alt" => _("POSIX"), + "title" => _("Edit POSIX properties")), + "gosaMailAccount" => array("image" => "images/mailto.png", + "alt" => _("Mail"), + "title" => _("Edit mail properties")), + "sambaSamAccount" => array("image" => "plugins/systems/images/select_winstation.png", + "alt" => _("Samba"), + "title" => _("Edit samba properties")), + "apple-user" => array("image" => "plugins/netatalk/images/select_netatalk.png", + "alt" => _("Netatalk"), + "title" => _("Edit netatalk properties")), + "gotoEnvironment" => array("image" => "plugins/users/images/small_environment.png", + "alt" => _("Environment"), + "title" => _("Edit environment properties")), + "goFaxAccount" => array("image" => "plugins/users/images/fax_small.png", + "alt" => _("FAX"), + "title" => _("Edit FAX properties")), + "goFonAccount" => array("image" => "plugins/gofon/images/select_phone.png", + "alt" => _("Phone"), + "title" => _("Edit phone properties"))); + + // Walk thru map + foreach ($map as $oc => $properties) { + if (in_array($oc, $class)) { + $result.=""; + } else { + $result.=" "; + } + } + + return $result; + } + + + /* Return departments, that will be included within snapshot detection */ function get_used_snapshot_bases() { diff --git a/gosa-core/plugins/admin/users/user-list.xml b/gosa-core/plugins/admin/users/user-list.xml index 6e5af62f9..daabaa692 100644 --- a/gosa-core/plugins/admin/users/user-list.xml +++ b/gosa-core/plugins/admin/users/user-list.xml @@ -25,7 +25,7 @@ - |20px||120px|80px;r| + |20px||145px|80px;r| %{filter:objectType(dn,objectClass)} @@ -42,7 +42,7 @@
Properties
Eigenschaften
false - %{filter:accountProperties(objectClass)} + %{filter:accountProperties(dn,row,objectClass)}
-- 2.30.2