From f4e24899ceb553ceef1d3bb0d573d13ec612e8e2 Mon Sep 17 00:00:00 2001
From: Gunnar Wrobel
Date: Wed, 23 Jun 2010 15:16:40 +0200
Subject: [PATCH] MFB: Remove dependency on the Kolab package within the task
handler.
---
.../lib/Horde/Kolab/Format/Xml/Task.php | 14 +-
framework/Kolab_Format/package.xml | 231 ++++++++++++---------
.../test/Horde/Kolab/Format/TaskTest.php | 44 ++++
.../test/Horde/Kolab/Format/fixtures/task.xml | 30 +++
framework/Packaging/script/horde-pear-release.php | 4 +-
5 files changed, 217 insertions(+), 106 deletions(-)
create mode 100644 framework/Kolab_Format/test/Horde/Kolab/Format/TaskTest.php
create mode 100644 framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/task.xml
diff --git a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php
index 527f32464..ca11f2957 100644
--- a/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php
+++ b/framework/Kolab_Format/lib/Horde/Kolab/Format/Xml/Task.php
@@ -160,7 +160,7 @@ class Horde_Kolab_Format_Xml_Task extends Horde_Kolab_Format_Xml
$object['parent'] = null;
}
- $object['completed'] = (bool) Kolab::percentageToBoolean($object['completed']);
+ $object['completed'] = (bool) $this->percentageToBoolean($object['completed']);
if (isset($object['organizer'])
&& isset($object['organizer']['smtp-address'])) {
@@ -193,8 +193,18 @@ class Horde_Kolab_Format_Xml_Task extends Horde_Kolab_Format_Xml
$object['estimate'] = number_format($object['estimate'], 2);
- $object['completed'] = Kolab::BooleanToPercentage($object['completed']);
+ $object['completed'] = $this->booleanToPercentage($object['completed']);
return $this->_saveArray($root, $object, $this->_fields_specific);
}
+
+ function percentageToBoolean($percentage)
+ {
+ return $percentage == 100 ? '1' : '0';
+ }
+
+ function booleanToPercentage($boolean)
+ {
+ return $boolean ? '100' : '0';
+ }
}
diff --git a/framework/Kolab_Format/package.xml b/framework/Kolab_Format/package.xml
index 2a6862b05..958f5f5df 100644
--- a/framework/Kolab_Format/package.xml
+++ b/framework/Kolab_Format/package.xml
@@ -1,8 +1,5 @@
-
+
Kolab_Format
pear.horde.org
A package for reading/writing Kolab data formats
@@ -32,7 +29,8 @@ http://pear.php.net/dtd/package-2.0.xsd">
jan@horde.org
yes
- 2009-04-02
+ 2010-06-23
+
1.0.2
1.0.0
@@ -43,12 +41,12 @@ http://pear.php.net/dtd/package-2.0.xsd">
LGPL
- * Converted to Horde4/PHP5
- * Removed Horde_DOM dependency.
+* Remove dependency on the Kolab package within the task handler.
+* Converted to Horde4/PHP5
+* Removed Horde_DOM dependency.
-
-
+
@@ -71,11 +69,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
-
-
-
@@ -85,7 +79,11 @@ http://pear.php.net/dtd/package-2.0.xsd">
+
+
+
+
@@ -93,24 +91,32 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
-
-
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -147,85 +153,86 @@ http://pear.php.net/dtd/package-2.0.xsd">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- 2009-04-02
- 1.0.1
- 1.0.0
+ 0.1.0
+ 0.1.0
- stable
- stable
+ alpha
+ alpha
- LGPL
+ 2008-07-11
+ LGPL
- * Handle parsing errors within the DOM XML extension correctly
- kolab/issue3520 (calendar with certain entries does not display in web client)
- https://www.intevation.de/roundup/kolab/issue3520
- kolab/issue3525 (free/busy regeneration aborts for unparsable events)
- https://www.intevation.de/roundup/kolab/issue3525
- * Accept ISO-8859-1 encoding even if advertised as UTF-8
- kolab/issue3528 (Events with broken encoding should work)
- https://www.intevation.de/roundup/kolab/issue3528
+* Initial release.
- 2008-12-12
- 1.0.0
- 1.0.0
+ 0.1.1
+ 0.1.0
- stable
- stable
+ alpha
+ alpha
- LGPL
+ 2008-07-29
+ LGPL
- * Fixed copyright information.
+* Estimated amount of required time in tasks is a float.
+* Only convert recurrence end of type date to a date.
+* Fixed calls to _loadArray/_saveArray.
+* Added experimental annotations format.
- 2008-11-07
- 1.0.0RC2
- 0.2.0
+ 0.1.2
+ 0.1.0
- beta
+ alpha
alpha
+ 2008-08-01
LGPL
- * Added functions to provide MIME related information.
+* Renamed package to Kolab_Format.
+* Removed some unnecessary translations.
@@ -240,63 +247,83 @@ http://pear.php.net/dtd/package-2.0.xsd">
LGPL
- * Fixed handling of return values from _load/_saveArray().
- * Allowed disabling the automatic creation of categories.
- * Merge a single mail address into the list of mail addresses.
- * Support storing public gpg keys in the contact format.
- * Fixed a PHP5 only check when reading XML content.
- * Use the 'application' instead of the 'categories' element in the
- preferences driver.
- * Fix category handling when no preference backend is available.
+* Fixed handling of return values from _load/_saveArray().
+* Allowed disabling the automatic creation of categories.
+* Merge a single mail address into the list of mail addresses.
+* Support storing public gpg keys in the contact format.
+* Fixed a PHP5 only check when reading XML content.
+* Use the 'application' instead of the 'categories' element in the
+ preferences driver.
+* Fix category handling when no preference backend is available.
+ 2008-11-07
- 0.1.2
- 0.1.0
+ 1.0.0RC2
+ 0.2.0
- alpha
+ beta
alpha
- 2008-08-01
LGPL
- * Renamed package to Kolab_Format.
- * Removed some unnecessary translations.
+* Added functions to provide MIME related information.
+ 2008-12-12
- 0.1.1
- 0.1.0
+ 1.0.0
+ 1.0.0
- alpha
- alpha
+ stable
+ stable
- 2008-07-29
- LGPL
+ LGPL
- * Estimated amount of required time in tasks is a float.
- * Only convert recurrence end of type date to a date.
- * Fixed calls to _loadArray/_saveArray.
- * Added experimental annotations format.
+* Fixed copyright information.
+ 2009-04-02
- 0.1.0
- 0.1.0
+ 1.0.1
+ 1.0.0
- alpha
- alpha
+ stable
+ stable
- 2008-07-11
- LGPL
+ LGPL
+
+* Handle parsing errors within the DOM XML extension correctly
+ kolab/issue3520 (calendar with certain entries does not display in web client)
+ https://www.intevation.de/roundup/kolab/issue3520
+ kolab/issue3525 (free/busy regeneration aborts for unparsable events)
+ https://www.intevation.de/roundup/kolab/issue3525
+* Accept ISO-8859-1 encoding even if advertised as UTF-8
+ kolab/issue3528 (Events with broken encoding should work)
+ https://www.intevation.de/roundup/kolab/issue3528
+
+
+
+
+ 1.0.2
+ 1.0.0
+
+
+ stable
+ stable
+
+ 2010-06-23
+ LGPL
- * Initial release.
+* Remove dependency on the Kolab package within the task handler.
+* Converted to Horde4/PHP5
+* Removed Horde_DOM dependency.
diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/TaskTest.php b/framework/Kolab_Format/test/Horde/Kolab/Format/TaskTest.php
new file mode 100644
index 000000000..2bc67f1fd
--- /dev/null
+++ b/framework/Kolab_Format/test/Horde/Kolab/Format/TaskTest.php
@@ -0,0 +1,44 @@
+
+ * @package Kolab_Format
+ */
+class Horde_Kolab_Format_TaskTest extends PHPUnit_Framework_TestCase
+{
+
+ /**
+ * Test basic task handling
+ */
+ public function testBasicTask()
+ {
+ $xml = Horde_Kolab_Format::factory('XML', 'task');
+
+ // Load XML
+ $task = file_get_contents(dirname(__FILE__) . '/fixtures/task.xml');
+ $result = $xml->load($task);
+ // Check that the xml loads fine
+ $this->assertEquals($result['body'], 'TEST');
+ }
+}
diff --git a/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/task.xml b/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/task.xml
new file mode 100644
index 000000000..38b693a79
--- /dev/null
+++ b/framework/Kolab_Format/test/Horde/Kolab/Format/fixtures/task.xml
@@ -0,0 +1,30 @@
+
+
+ 1e2f91e4977abfec573916f351db3e14
+ TEST
+ Variable
+ 2007-10-29T06:32:14Z
+ 2007-11-12T15:40:04Z
+ public
+ Horde::Kolab
+ Finish project description
+
+
+
+
+
+
+
+
+
+ 2007-11-06T23:00:00Z
+
+ 1
+
+
+ 1
+ 100
+ not-started
+ 2007-11-07T18:00:00Z
+ 30
+
diff --git a/framework/Packaging/script/horde-pear-release.php b/framework/Packaging/script/horde-pear-release.php
index 5187a6ef0..6399852b6 100755
--- a/framework/Packaging/script/horde-pear-release.php
+++ b/framework/Packaging/script/horde-pear-release.php
@@ -1,6 +1,6 @@
#!/usr/bin/php
false,
'clearchangelog' => false,
'simpleoutput' => true,
- 'ignore' => array('*~', 'conf.php'),
+ 'ignore' => array('*~', 'conf.php', 'CVS/*'),
'include' => '*',
'dir_roles' =>
array(
--
2.11.0