fix parse errors - not sure on intent of the export calls though
authorChuck Hagenbuch <chuck@horde.org>
Tue, 14 Jul 2009 05:17:20 +0000 (01:17 -0400)
committerChuck Hagenbuch <chuck@horde.org>
Tue, 14 Jul 2009 05:17:20 +0000 (01:17 -0400)
imp/lib/Mime/Viewer/Itip.php

index 1c95b6d..a8df9af 100644 (file)
@@ -139,23 +139,22 @@ class IMP_Horde_Mime_Viewer_Itip extends Horde_Mime_Viewer_Driver
                     $guid = $components[$key]->getAttribute('UID');
                     // Check if this is an update.
                     try {
-                        $registry->call('calendar/export', array($guid, 'text/calendar');
-
-                        // Try to update in calendar.
-                        if ($registry->hasMethod('calendar/replace')) {
-                            try {
-                                $registry->call('calendar/replace', array('uid' => $guid, 'content' => $components[$key], 'contentType' => $this->mime_part->getType()));
-                                $handled = true;
-                                $url = Horde::url($registry->link('calendar/show', array('uid' => $guid)));
-                                $msgs[] = array('success', _("The event was updated in your calendar.") .
-                                                             '&nbsp;' . Horde::link($url, _("View event"), null, '_blank') . Horde::img('mime/icalendar.png', _("View event"), null, $registry->getImageDir('horde')) . '</a>');
-                            } catch (Horde_Exception $e) {}
-                                // Could be a missing permission.
-                                $msgs[] = array('warning', _("There was an error updating the event:") . ' ' . $e->getMessage() . '. ' . _("Trying to import the event instead."));
-                            }
-                        }
+                        $registry->call('calendar/export', array($guid, 'text/calendar'));
                     } catch (Horde_Exception $e) {}
 
+                    // Try to update in calendar.
+                    if ($registry->hasMethod('calendar/replace')) {
+                        try {
+                            $registry->call('calendar/replace', array('uid' => $guid, 'content' => $components[$key], 'contentType' => $this->mime_part->getType()));
+                            $handled = true;
+                            $url = Horde::url($registry->link('calendar/show', array('uid' => $guid)));
+                            $msgs[] = array('success', _("The event was updated in your calendar.") .
+                                            '&nbsp;' . Horde::link($url, _("View event"), null, '_blank') . Horde::img('mime/icalendar.png', _("View event"), null, $registry->getImageDir('horde')) . '</a>');
+                        } catch (Horde_Exception $e) {}
+                        // Could be a missing permission.
+                        $msgs[] = array('warning', _("There was an error updating the event:") . ' ' . $e->getMessage() . '. ' . _("Trying to import the event instead."));
+                    }
+
                     if (!$handled && $registry->hasMethod('calendar/import')) {
                         // Import into calendar.
                         $handled = true;