diff --git a/config.php b/config.php index 4cd6fbd..de30025 100644 --- a/config.php +++ b/config.php @@ -1,6 +1,8 @@ - 1.0 + 1.1 calendarimporter - ICS Calendar Importer + ICS Calendar Importer/Exporter Christoph Haas http://www.sprinternet.at Import a ICS file to the zarafa calendar @@ -17,19 +17,21 @@ php/plugin.calendarimporter.php + php/module.calendarexporter.php js/plugin.calendarimporter.js + js/data/ResponseHandler.js js/dialogs/ImportContentPanel.js js/dialogs/ImportPanel.js js/plugin.calendarimporter.js + js/data/ResponseHandler.js js/dialogs/ImportContentPanel.js js/dialogs/ImportPanel.js - resources/css/calendarimporter.css - + resources/css/calendarimporter.css resources/css/calendarimporter.css diff --git a/php/module.calendarexporter.php b/php/module.calendarexporter.php new file mode 100644 index 0000000..04af4a7 --- /dev/null +++ b/php/module.calendarexporter.php @@ -0,0 +1,94 @@ + + * Copyright (C) 2012 Christoph Haas + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/** + * This module integrates Owncloud into attachment part of emails + * @class OwncloudModule + * @extends Module + */ +class CalendarexporterModule extends Module { + + private $DEBUG = true; // enable error_log debugging + + /** + * @constructor + * @param $id + * @param $data + */ + public function __construct($id, $data) { + parent::Module($id, $data); + } + + /** + * Executes all the actions in the $data variable. + * Exception part is used for authentication errors also + * @return boolean true on success or false on failure. + */ + public function execute() { + $result = false; + + foreach($this->data as $actionType => $actionData) { + if(isset($actionType)) { + try { + if($this->DEBUG) { + error_log("exec: " . $actionType); + } + switch($actionType) { + case "export": + $result = $this->exportCalendar($actionType, $actionData); + break; + default: + $this->handleUnknownActionType($actionType); + } + + } catch (MAPIException $e) { + if($this->DEBUG) { + error_log("mapi exception: " . $e->getMessage()); + } + } catch (Exception $e) { + if($this->DEBUG) { + error_log("exception: " . $e->getMessage()); + } + } + } + } + + return $result; + } + + private function exportCalendar($actionType, $actionData) { + /* look up functionality in class.appointmentlistmodule.php (webapp/server/modules)*/ + + $response['status'] = true; + $response['entries'] = "1002"; // number of entries that will be exported + $this->addActionData($actionType, $response); + $GLOBALS["bus"]->addData($this->getResponseData()); + + if($this->DEBUG) { + error_log("export done, bus data written!"); + } + + } +}; + +?> diff --git a/php/plugin.calendarimporter.php b/php/plugin.calendarimporter.php index f9b2b18..6dd4c37 100644 --- a/php/plugin.calendarimporter.php +++ b/php/plugin.calendarimporter.php @@ -47,7 +47,8 @@ class Plugincalendarimporter extends Plugin { 'plugins' => Array( 'calendarimporter' => Array( 'enable' => PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE, - 'default_calendar' => PLUGIN_CALENDARIMPORTER_DEFAULT // currently not used, maybe in next release + 'enable_export' => PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE_EXPORT, + 'default_calendar' => PLUGIN_CALENDARIMPORTER_DEFAULT // currently not used, maybe in next release ) ) )