[eGroupWare-svn] r55887 - in /branches/14.2: addressbook/ addressbook/inc/ addressbook/setup/ phpgwapi/inc/

[email protected]
Newsgroups gmane.comp.web.egroupware.cvs
Message-ID <[email protected]>
Author: ralfbecker
Date: Wed Apr 27 15:51:43 2016
New Revision: 55887

URL: http://svn.stylite.de/viewvc/egroupware?rev=55887&view=rev
Log:
* CardDAV: fix not working creation of new CardDAV account with OS X 10.11.4 addressbook (it stays empty)
OS X 10.11.4 addressbook does a propfind for "addressbook-home-set", "pricipal-address" and "directory-gateway" in the root and does not continue without it

Modified:
    branches/14.2/addressbook/   (props changed)
    branches/14.2/addressbook/inc/class.addressbook_groupdav.inc.php
    branches/14.2/addressbook/setup/setup.inc.php
    branches/14.2/phpgwapi/inc/class.groupdav.inc.php

Propchange: branches/14.2/addressbook/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Apr 27 15:51:43 2016
@@ -1,1 +1,1 @@
-/trunk/addressbook:51376,51455,51563-51564,51566,51568,51584,51768,51812,51817,51953,51980,52009,52042,52174,52292,52351,52362,52420,52425,52453,52504,52511,52546,52613,52633,52817,52837,52898,52903,52971-52973,52983-52988,53006,53156,53163,53196,53209,53245,53413,53427,53491,53580,53607,53623,53639,53678,53684,53708-53709,53733,53749,53863,53964,54010,54293,54373,54557,54560,54578,54710,54782,54795-54797,54856,55560
+/trunk/addressbook:51376,51455,51563-51564,51566,51568,51584,51768,51812,51817,51953,51980,52009,52042,52174,52292,52351,52362,52420,52425,52453,52504,52511,52546,52613,52633,52817,52837,52898,52903,52971-52973,52983-52988,53006,53156,53163,53196,53209,53245,53413,53427,53491,53580,53607,53623,53639,53678,53684,53708-53709,53733,53749,53863,53964,54010,54293,54373,54557,54560,54578,54710,54782,54795-54797,54856,55560,55884

Modified: branches/14.2/addressbook/inc/class.addressbook_groupdav.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/addressbook/inc/class.addressbook_groupdav.inc.php?rev=55887&r1=55886&r2=55887&view=diff
==============================================================================
--- branches/14.2/addressbook/inc/class.addressbook_groupdav.inc.php (original)
+++ branches/14.2/addressbook/inc/class.addressbook_groupdav.inc.php Wed Apr 27 15:51:43 2016
@@ -1077,6 +1077,27 @@
 	}
 
 	/**
+	 * Hook to add properties to CardDAV root
+	 *
+	 * OS X 10.11.4 addressbook does a propfind for "addressbook-home-set" and "directory-gateway"
+	 * in the root and does not continue without it.
+	 *
+	 * @param array $data
+	 */
+	public static function groupdav_root_props(array $data)
+	{
+		$data['props']['addressbook-home-set'] = groupdav::mkprop(groupdav::CARDDAV, 'addressbook-home-set', array(
+			groupdav::mkprop('href',$data['caldav']->base_uri.'/'.$GLOBALS['egw_info']['user']['account_lid'].'/')));
+
+		$data['props']['principal-address'] = groupdav::mkprop(groupdav::CARDDAV, 'principal-address',
+				$GLOBALS['egw_info']['user']['preferences']['addressbook']['hide_accounts'] ? '' : array(
+				groupdav::mkprop('href',$data['caldav']->base_uri.'/addressbook-accounts/'.$GLOBALS['egw_info']['user']['person_id'].'.vcf')));
+
+		$data['props']['directory-gateway'] = groupdav::mkprop(groupdav::CARDDAV, 'directory-gateway', array(
+			groupdav::mkprop('href',$data['caldav']->base_uri.'/addressbook/')));
+	}
+
+	/**
 	 * Return appliction specific settings
 	 *
 	 * @param array $hook_data values for keys 'location', 'type' and 'account_id'

Modified: branches/14.2/addressbook/setup/setup.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/addressbook/setup/setup.inc.php?rev=55887&r1=55886&r2=55887&view=diff
==============================================================================
--- branches/14.2/addressbook/setup/setup.inc.php (original)
+++ branches/14.2/addressbook/setup/setup.inc.php Wed Apr 27 15:51:43 2016
@@ -47,6 +47,7 @@
 $setup_info['addressbook']['hooks']['export_limit'] = 'addressbook_hooks::getAppExportLimit';
 $setup_info['addressbook']['hooks']['acl_rights'] = 'addressbook_hooks::acl_rights';
 $setup_info['addressbook']['hooks']['categories'] = 'addressbook_hooks::categories';
+$setup_info['addressbook']['hooks']['groupdav_root_props'] = 'addressbook_groupdav::groupdav_root_props';
 
 /* Dependencies for this app to work */
 $setup_info['addressbook']['depends'][] = array(

Modified: branches/14.2/phpgwapi/inc/class.groupdav.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/branches/14.2/phpgwapi/inc/class.groupdav.inc.php?rev=55887&r1=55886&r2=55887&view=diff
==============================================================================
--- branches/14.2/phpgwapi/inc/class.groupdav.inc.php (original)
+++ branches/14.2/phpgwapi/inc/class.groupdav.inc.php Wed Apr 27 15:51:43 2016
@@ -386,6 +386,7 @@
 					'location' => 'groupdav_root_props',
 					'props' => &$files['files'][0]['props'],
 					'options' => $options,
+					'caldav' => $this,
 				));
 			}
 


------------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.