Remove the deprecated category support. It was misplaced in this module anyway. Add...
authorGunnar Wrobel <p@rdus.de>
Tue, 23 Mar 2010 15:51:10 +0000 (16:51 +0100)
committerGunnar Wrobel <p@rdus.de>
Tue, 23 Mar 2010 15:51:10 +0000 (16:51 +0100)
framework/Kolab_Format/TODO [new file with mode: 0644]
framework/Kolab_Format/lib/Horde/Kolab/Format/Xml.php
framework/Kolab_Format/test/Horde/Kolab/Format/ContactTest.php

diff --git a/framework/Kolab_Format/TODO b/framework/Kolab_Format/TODO
new file mode 100644 (file)
index 0000000..152116f
--- /dev/null
@@ -0,0 +1,5 @@
+====================================
+ Kolab_Format Development TODO List
+====================================
+
+ - Find a decent way of handling tags within Horde 4
index bae9f95..b7252cf 100644 (file)
@@ -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)) {
index 730398a..cbff2f2 100644 (file)
@@ -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'));
         }
     }