If default addressbook is not browsable, try one from the addressbook pref.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 8 Jul 2010 18:20:49 +0000 (14:20 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Thu, 8 Jul 2010 18:22:21 +0000 (14:22 -0400)
Bug: 6536

turba/browse.php

index e152e42..b65fbfe 100644 (file)
 require_once dirname(__FILE__) . '/lib/Application.php';
 Horde_Registry::appInit('turba');
 
+/* If default source is not browsable, try one from the addressbooks pref */
+if (empty($cfgSources[$default_source]['browse'])) {
+    $addressbooks = Horde_Serialize::unserialize($prefs->getValue('addressbooks'), Horde_Serialize::JSON);
+    foreach ($addressbooks as $source) {
+        if (!empty($cfgSources[$source]['browse'])) {
+            $default_source = $source;
+            break;
+        }
+    }
+}
+
 $params = array(
     'vars' => Horde_Variables::getDefaultVariables(),
     'prefs' => &$prefs,