/** * testInternalAddressbookConfig * * @see http://forge.tine20.org/mantisbt/view.php?id=5846 */ public function testInternalAddressbookConfig() { $list = $this->objects['initialList']; $list->container_id = NULL; $listBackend = new Addressbook_Backend_List(); $listBackend->update($list); Admin_Config::getInstance()->delete(Tinebase_Config::APPDEFAULTS); $list = Addressbook_Controller_List::getInstance()->addListMember($list, $this->objects['contact1']); $appConfigDefaults = Admin_Controller::getInstance()->getConfigSettings(); $this->assertTrue(!empty($appConfigDefaults[Admin_Model_Config::DEFAULTINTERNALADDRESSBOOK]), print_r($appConfigDefaults, TRUE)); }
/** * set default internal addressbook * * @param Tinebase_Model_Container $internalAddressbook * @return Tinebase_Model_Container * * @todo create new internal adb on the fly if it does not exist? */ public static function setDefaultInternalAddressbook($internalAddressbook = NULL) { if ($internalAddressbook === NULL) { $internalAddressbook = Tinebase_Container::getInstance()->getContainerByName('Addressbook', 'Internal Contacts', Tinebase_Model_Container::TYPE_SHARED); } Admin_Config::getInstance()->set(Tinebase_Config::APPDEFAULTS, array(Admin_Model_Config::DEFAULTINTERNALADDRESSBOOK => $internalAddressbook->getId())); return $internalAddressbook; }