From ea05c1ce70144e00ff2f22284c509d6d8ad78eba Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 25 Nov 2010 21:26:34 +0100 Subject: [PATCH] Use personal address books first if determining the default one (Valentin Vidic, Request #9367). --- turba/docs/CHANGES | 2 ++ turba/lib/Turba.php | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/turba/docs/CHANGES b/turba/docs/CHANGES index 42cf84a5c..546d8df79 100644 --- a/turba/docs/CHANGES +++ b/turba/docs/CHANGES @@ -16,6 +16,8 @@ v3.0-git v2.3.6-cvs ---------- +[jan] Use personal address books first if determining the default one (Valentin + Vidic, Request #9367). [jan] Use name format preference not only for paging, but for sorting too (Request #8806). [jan] Fix photo corruption when exporting to vCard 3.0 (Bug #9100). diff --git a/turba/lib/Turba.php b/turba/lib/Turba.php index da8319767..0fda36d43 100644 --- a/turba/lib/Turba.php +++ b/turba/lib/Turba.php @@ -146,6 +146,16 @@ class Turba { } } + /* In case of shares select first user owned address book as default */ + if (!empty($_SESSION['turba']['has_share'])) { + try { + $owned_shares = Turba::listShares(true); + if (count($owned_shares) > 0) { + return key($owned_shares); + } + } catch (Exception $e) {} + } + reset($GLOBALS['cfgSources']); return key($GLOBALS['cfgSources']); } -- 2.11.0