[eGroupWare-svn] r56080 - /branches/14.2/addressbook/inc/class.addressbook_bo.inc.php

[email protected] Fri, 06 May 2016 17:39:34 -0000
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Fri May  6 19:39:34 2016
New Revision: 56080

URL: http://svn.stylite.de/viewvc/egroupware?rev=56080&view=rev
Log:
* Addressbook: adding "Lastname, Firstname (birthday)" as fileas and link-title

Modified:
    branches/14.2/addressbook/inc/class.addressbook_bo.inc.php

Modified: branches/14.2/addressbook/inc/class.addressbook_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/addressbook/inc/class.addressbook_bo.inc.php?rev=56080&r1=56079&r2=56080&view=diff
==============================================================================
--- branches/14.2/addressbook/inc/class.addressbook_bo.inc.php (original)
+++ branches/14.2/addressbook/inc/class.addressbook_bo.inc.php Fri May  6 19:39:34 2016
@@ -52,6 +52,7 @@
 		'n_family, n_given',
 		'n_family, n_prefix',
 		'n_fn',
+		'n_family, n_given (bday)',
 	);
 
 	/**
@@ -414,7 +415,7 @@
 
 		if($isUpdate)
 		{
-			$fileas_fields = array('n_prefix','n_given','n_middle','n_family','n_suffix','n_fn','org_name','org_unit','adr_one_locality');
+			$fileas_fields = array('n_prefix','n_given','n_middle','n_family','n_suffix','n_fn','org_name','org_unit','adr_one_locality','bday');
 			$old = null;
 			foreach($fileas_fields as $field)
 			{
@@ -427,16 +428,30 @@
 			unset($old);
 		}
 
-		$fileas = str_replace(array('n_prefix','n_given','n_middle','n_family','n_suffix','n_fn','org_name','org_unit','adr_one_locality'),
-			array($contact['n_prefix'],$contact['n_given'],$contact['n_middle'],$contact['n_family'],$contact['n_suffix'],
-				$contact['n_fn'],$contact['org_name'],$contact['org_unit'],$contact['adr_one_locality']),$type);
-
 		// removing empty delimiters, caused by empty contact fields
-		$fileas = str_replace(array(', , : ',', : ',': , ',', , ',': : ',' ()'),array(': ',': ',': ',', ',': ',''),$fileas);
-		while ($fileas[0] == ':' ||  $fileas[0] == ',') $fileas = substr($fileas,2);
-		while (substr($fileas,-2) == ': ' || substr($fileas,-2) == ', ') $fileas = substr($fileas,0,-2);
-
-		//echo "<p align=right>bocontacts::fileas(,$type)='$fileas'</p>\n";
+		$fileas = str_replace(array(', , : ',', : ',': , ',', , ',': : ',' ()'),
+			array(': ',': ',': ',', ',': ',''),
+			strtr($type, array(
+				'n_prefix' => $contact['n_prefix'],
+				'n_given'  => $contact['n_given'],
+				'n_middle' => $contact['n_middle'],
+				'n_family' => $contact['n_family'],
+				'n_suffix' => $contact['n_suffix'],
+				'n_fn'     => $contact['n_fn'],
+				'org_name' => $contact['org_name'],
+				'org_unit' => $contact['org_unit'],
+				'adr_one_locality' => $contact['adr_one_locality'],
+				'bday'     => (int)$contact['bday'] ? DateTime::to($contact['bday'], true) : $contact['bday'],
+			)));
+
+		while ($fileas[0] == ':' ||  $fileas[0] == ',')
+		{
+			$fileas = substr($fileas,2);
+		}
+		while (substr($fileas,-2) == ': ' || substr($fileas,-2) == ', ')
+		{
+			$fileas = substr($fileas,0,-2);
+		}
 		return $fileas;
 	}
 
@@ -498,6 +513,7 @@
 			'org_name' => lang('company'),
 			'org_unit' => lang('department'),
 			'adr_one_locality' => lang('city'),
+			'bday'     => lang('Birthday'),
 		);
 		foreach($labels as $name => $label)
 		{


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z