From: Gunnar Wrobel
Date: Tue, 23 Mar 2010 15:51:10 +0000 (+0100) Subject: Remove the deprecated category support. It was misplaced in this module anyway. Add... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=61b35a6a46ac53ae0ff6ffe6532773184604a53c;p=horde.git Remove the deprecated category support. It was misplaced in this module anyway. Add a TODO that we still need to find a decent way on handling tags in Horde 4. --- diff --git a/framework/Kolab_Format/TODO b/framework/Kolab_Format/TODO new file mode 100644 index 000000000..152116f01 --- /dev/null +++ b/framework/Kolab_Format/TODO @@ -0,0 +1,5 @@ +==================================== + Kolab_Format Development TODO List +==================================== + + - Find a decent way of handling tags within Horde 4 diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php index bae9f950b..b7252cfe7 100644 --- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php +++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php @@ -1006,17 +1006,6 @@ class Horde_Kolab_Format_Xml return; } - // Create horde category if needed - if ($this->_create_categories && - class_exists('Horde_Prefs_CategoryManager') && - isset($prefs) && $prefs instanceof Horde_Prefs) { - $cManager = new Horde_Prefs_CategoryManager(); - $horde_categories = $cManager->get(); - } else { - $cManager = null; - $horde_categories = null; - } - $kolab_categories = explode(',', $object['categories']); $primary_category = ''; @@ -1024,14 +1013,6 @@ class Horde_Kolab_Format_Xml $kolab_category = trim($kolab_category); $valid_category = true; - if ($cManager && - array_search($kolab_category, $horde_categories) === false) { - // Unknown category -> Add - if ($cManager->add($kolab_category) === false) { - // categories might be locked - $valid_category = false; - } - } // First valid category becomes primary category if ($valid_category && empty($primary_category)) { diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php index 730398a9d..cbff2f2d9 100644 --- a/framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php +++ b/framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php @@ -105,12 +105,7 @@ class Horde_Kolab_Format_ContactTest extends PHPUnit_Framework_TestCase */ public function testCategoriesWithPrefs() { - global $registry, $prefs; - if (class_exists('Horde_Prefs')) { - $registry = new DummyRegistry(); - $prefs = Horde_Prefs::singleton('Session'); - /* Monkey patch to allw the value to be set. */ $prefs->_prefs['categories'] = array('v' => ''); @@ -119,7 +114,6 @@ class Horde_Kolab_Format_ContactTest extends PHPUnit_Framework_TestCase . '/fixtures/contact_category.xml'); $object = $contact->load($xml); $this->assertContains('Test', $object['categories']); - $this->assertEquals('Test', $prefs->getValue('categories')); } }