Code

iSorted mail forward adresses by their sn not cn in case of users.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 24 Jun 2011 11:21:32 +0000 (11:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 24 Jun 2011 11:21:32 +0000 (11:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20915 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/mail/personal/mail/mailAddressSelect/class_mailAddressSelect.inc
gosa-plugins/mail/personal/mail/mailAddressSelect/selectMailAddress-list.xml

index 849276a49755336378354a6692119d7c16cc0a06..f46159aadf4b6b332503f622175f1df0055a90b9 100644 (file)
@@ -47,9 +47,19 @@ class mailAddressSelect extends management
     // Build headpage
     $headpage = new listing(get_template_path("selectMailAddress-list.xml", true, dirname(__FILE__)));
     $headpage->setFilter($filter);
+    $headpage->registerElementFilter("objectName", "mailAddressSelect::objectNameFilter");
     parent::__construct($config, $ui, "mail", $headpage);
   }
 
+    static function objectNameFilter($id,$dn,$cn,$sn=NULL,$givenName=NULL)
+    {
+        if($sn){
+            return("{$sn[0]}, {$givenName[0]}");
+        }else{
+            return("{$cn[0]}");
+        }
+    }
+
   function save()
   {
     $act = $this->detectPostActions();
index 77e8649f0605ff69d75e8c6d30e7eeb42fc0369e..f869fd9b3a30ac5207842a71ee5855965ecb2260 100644 (file)
@@ -49,7 +49,7 @@
       <label>Name</label>
       <sortAttribute>cn</sortAttribute>
       <sortType>string</sortType>
-      <value>%{cn}</value>
+      <value>%{filter:objectName(row,dn,cn,sn,givenName)}</value>
       <export>true</export>
     </column>