gunnar: server/php-kolab/Kolab_Filter/Filter resmgr.php,1.3,1.4

cvs at kolab.org cvs at kolab.org
Mon Aug 13 12:06:28 CEST 2007


Author: gunnar

Update of /kolabrepository/server/php-kolab/Kolab_Filter/Filter
In directory doto:/tmp/cvs-serv14243/php-kolab/Kolab_Filter/Filter

Modified Files:
	resmgr.php 
Log Message:
Patch for compatibility between old and new horde.

Index: resmgr.php
===================================================================
RCS file: /kolabrepository/server/php-kolab/Kolab_Filter/Filter/resmgr.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- resmgr.php	13 Aug 2007 09:57:18 -0000	1.3
+++ resmgr.php	13 Aug 2007 10:06:26 -0000	1.4
@@ -46,9 +46,6 @@
 
 require_once 'Kolab/Freebusy/recurrence.class.php';
 
-if (version_compare(PHP_VERSION,'5', '>='))
-  require_once('Kolab/Freebusy/domxml-php4-to-php5.php');
-
 // What actions we can take when receiving an event request
 define('RM_ACT_ALWAYS_ACCEPT',              1);
 define('RM_ACT_REJECT_IF_CONFLICTS',        2);
@@ -804,12 +801,28 @@
     return $epoch;
 }
 
-function &buildKolabEvent(&$itip)
+function &buildKolabEvent(&$itip, $use_new_horde)
 {
     global $organiser, $resource, $uid, $sid;
 
+    if (version_compare(PHP_VERSION,'5', '>=') && !$use_new_horde) {
+        require_once('Kolab/Freebusy/domxml-php4-to-php5.php');
+    } else {
+        require_once('Horde/DOM.php');
+    }
+
     $recurrence = false;
-    $kolab_xml = domxml_new_doc('1.0');
+    if (!$use_new_horde) {
+        $kolab_xml = domxml_new_doc('1.0');
+    } else {
+        $kolab_xml = Horde_DOM_Document::factory(array('xml' => $xml_text));
+        if (is_a($result, 'PEAR_Error')) {
+            // There were errors building the xml document
+            myLog( "Error building xml document", RM_LOG_ERROR);
+            return false;
+        }
+    }
+    
     $kolab_event = $kolab_xml->append_child($kolab_xml->create_element('event'));
     $kolab_event->set_attribute('version', '1.0');
 
@@ -1233,7 +1246,7 @@
 	$updated_messages = array($updated_messages);
       }
     }
-    list($kolab_xml,$recurrence) = buildKolabEvent($itip);
+    list($kolab_xml,$recurrence) = buildKolabEvent($itip, $params['use_new_horde']);
 
     // Don't even bother checking free/busy info if RM_ACT_ALWAYS_ACCEPT
     // is specified





More information about the commits mailing list