6 Commits

Author SHA1 Message Date
275913dea8 Line endings 2016-12-16 14:51:48 +01:00
41ea9199a0 Merge remote-tracking branch 'origin/master' into php54compatibility 2016-12-05 20:54:42 +01:00
08a181d59d Fix empty check 2016-12-05 20:42:11 +01:00
668644c5d5 Fix empty check 2016-12-05 20:37:35 +01:00
3e24a00855 Merge master changes 2016-12-05 18:55:48 +01:00
70b1e0872c Compatibility for PHP 5.4 2016-12-01 00:25:23 +01:00
32 changed files with 108 additions and 259 deletions

1
.gitignore vendored
View File

@@ -1,2 +1 @@
.idea/ .idea/
.vs/

Binary file not shown.

120
README.md
View File

@@ -1,124 +1,20 @@
CALENDAR IMPORTER AND EXPORTER: CALENDAR IMPORTER AND EXPORTER:
=== ===
## Building the calendar importer plugin from source: Building the calendar importer plugin for Zarafa WebApp:
### Dependencies
- Kopano WebApp Source Code (https://stash.kopano.io/projects/KW/repos/kopano-webapp/browse)
- PHP >= 5 (7 or higher recommended)
- composer (https://getcomposer.org/)
- JDK 1.8 (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
- ant (http://ant.apache.org/)
Add JAVA_HOME (e.g. C:\Program Files\Java\jdk1.8.0_161) to your path. Also add Ant, Composer, PHP and Java to the global PATH variable!
### Compiling the plugin
Unzip (or use git clone) the sourcecode of Kopano WebApp to a new directory. In this README we call the source folder of WebApp "kopano-webapp-source".
Then generate the WebApp build utils:
``` ```
cd kopano-webapp-source cd /zarafa/webapp/
ant tools ant tools
``` cd /zarafa/webapp/plugins/
Next clone the plugin to the WebApp plugin directory:
```
cd kopano-webapp-source\plugins
git clone https://git.sprinternet.at/zarafa_webapp/calendarimporter.git git clone https://git.sprinternet.at/zarafa_webapp/calendarimporter.git
``` cd calendarimporter
Now lets build the plugin:
```
cd kopano-webapp-source\plugins\calendarimporter\php
composer install
cd kopano-webapp-source\plugins\calendarimporter
ant deploy ant deploy
``` ```
The compiled plugin is saved to `kopano-webapp-source\deploy\plugins\calendarimporter`. ### Usage
Rightclick a calendarfolder or calendar entry to export it as iCal.
## Installing the plugin Rightclick a calendarfolder to import a iCal file.
### From compiled source Rightclick a iCal attachment to import it.
Copy the whole folder "calendarimporter" to your production WebApp (`kopano-webapp-production\plugins\calendarimporter`)
For example:
```
cp -r kopano-webapp-source\deploy\plugins\calendarimporter kopano-webapp-production\plugins\
```
## Installing the sync backend
### From source
Copy the whole folder "kopano-webapp-source\plugins\calendarimporter\backend" to a destination of cour choice.
For example:
```
cp -r kopano-webapp-source\plugins\calendarimporter\backend /opt/ical-sync/backend
```
### From precompiled download
Download the newest backend release from https://git.sprinternet.at/zarafa_webapp/calendarimporter/tree/master/DIST.
Unzip the downloaded file and copy the backend folder to a destination of cour choice.
For example:
```
cp -r Downloads\calendarimporter_backend /opt/ical-sync/backend
```
## WebApp Plugin Configuration
Edit the config.php file in the plugin root path to fit your needs.
Available configuration values:
| Configuration Value | Type | Default | Desctription |
| ------------- |:-------------:| ----- | ----- |
| PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE | boolean | false | Set to true to enable the plugin for all users |
| PLUGIN_CALENDARIMPORTER_USER_DEFAULT_ENABLE_SYNC | string | true | Set to true to enable the sync feature for all users |
| PLUGIN_CALENDARIMPORTER_DEFAULT | string | "Kalender" | Default calendar folder name (might be "Calendar" on english installations) |
| PLUGIN_CALENDARIMPORTER_DEFAULT_TIMEZONE | string | "Europe/Vienna" | The local Timezone |
| PLUGIN_CALENDARIMPORTER_TMP_UPLOAD | string | "/var/lib/kopano-webapp/tmp/" | Temporary path to store uploaded iCal files |
## Sync Backend Configuration
First you have to create a new Kopano user with admin rights.
For example:
```
kopano-admin -c adminuser -e admin@domain.com -f "Calendar Sync Admin" -p topsecretpw -a 1
```
Then edit the config.php file of the sync backend to fit your needs.
Available configuration values:
| Configuration Value | Type | Default | Desctription |
| ------------- |:-------------:| ----- | ----- |
| $ADMINUSERNAME | string | "adminuser" | The newly created Kopano admin user |
| $ADMINPASSWORD | string | "topsecretpw" | The password of the admin user |
| $SERVER | string | "http://localhost:236/kopano" | Kopano Socket or HTTP(S) connection string |
| $CALDAVURL | string | "http://localhost:8080/ical/" | Kopano CalDAV URL |
| $TEMPDIR | string | "/tmp/" | Temporary path to store synchronised iCal files (must be writeable by the user executing the sync script) |
Next set up a cronjob to allow periodic syncing of ical items.
For example: (`/etc/crontab`):
```
# sync ics calendars every minute (interval can be changed by the user)
* * * * * icssync /opt/ical-sync/backend/sync.php > /var/log/icssync.log 2>&1
```
If you get an error, make sure that the mapi module is loaded for php-cli. Therefore create or modify: `/etc/php7/cli/conf.d/50-mapi.ini`
```
extension=mapi.so
```
Do no run the sync script as root! Create a user without admin rights (`adduser icssync`), and change permissions of the tmp folder accordingly.
## Usage
The plugin add context menu entries to calendar folders.
![Plugin Context Menus](https://git.sprinternet.at/zarafa_webapp/calendarimporter/raw/master/usage.png "Kopano Webapp Context Menu")
If syncing is enabled, the calendar section in the WebApp settings gets extended with a synchronisation overview. There you can add new iCal URLs for syncing.
![Plugin Settings Menus](https://git.sprinternet.at/zarafa_webapp/calendarimporter/raw/master/usage_sync.png "Kopano Webapp Settings Menu")

View File

@@ -1,54 +1,14 @@
# Backend setup: Backend setup:
## Installing the sync backend 1. Create a Admin User in Zarafa:
zarafa-admin -c adminuser -e admin@domain.com -f "Calendar Sync Admin" -p topsecretpw -a 1
### From source 2. Edit the config.php to fit your needs.
Copy the whole folder "kopano-webapp-source\plugins\calendarimporter\backend" to a destination of cour choice.
For example: 3. Setup cron to run your script every 10 minutes (or whatever...)
```
cp -r kopano-webapp-source\plugins\calendarimporter\backend /opt/ical-sync/backend
```
### From precompiled download 4. If you get an error, make sure that the mapi module is loaded for php-cli:
Download the newest backend release from https://git.sprinternet.at/zarafa_webapp/calendarimporter/tree/master/DIST. * Add: /etc/php5/cli/conf.d/50-mapi.ini
* Content: extension=mapi.so
Unzip the downloaded file and copy the backend folder to a destination of cour choice. Never run the backend script as root!
For example:
```
cp -r Downloads\calendarimporter_backend /opt/ical-sync/backend
```
## Sync Backend Configuration
First you have to create a new Kopano user with admin rights.
For example:
```
kopano-admin -c adminuser -e admin@domain.com -f "Calendar Sync Admin" -p topsecretpw -a 1
```
Then edit the config.php file of the sync backend to fit your needs.
Available configuration values:
| Configuration Value | Type | Default | Desctription |
| ------------- |:-------------:| ----- | ----- |
| $ADMINUSERNAME | string | "adminuser" | The newly created Kopano admin user |
| $ADMINPASSWORD | string | "topsecretpw" | The password of the admin user |
| $SERVER | string | "http://localhost:236/kopano" | Kopano Socket or HTTP(S) connection string |
| $CALDAVURL | string | "http://localhost:8080/ical/" | Kopano CalDAV URL |
| $TEMPDIR | string | "/tmp/" | Temporary path to store synchronised iCal files (must be writeable by the user executing the sync script) |
Next set up a cronjob to allow periodic syncing of ical items.
For example: (`/etc/crontab`):
```
# sync ics calendars every minute (interval can be changed by the user)
* * * * * icssync /opt/ical-sync/backend/sync.php > /var/log/icssync.log 2>&1
```
If you get an error, make sure that the mapi module is loaded for php-cli. Therefore create or modify: `/etc/php7/cli/conf.d/50-mapi.ini`
```
extension=mapi.so
```
Do no run the sync script as root! Create a user without admin rights (`adduser icssync`), and change permissions of the tmp folder accordingly.

View File

@@ -1,7 +1,8 @@
<?php <?php
// config options // config options
$ADMINUSERNAME = "admin"; // Kopano administrative user $ADMINUSERNAME = "admin";
$ADMINPASSWORD = "admin"; // Kopano administrative user password $ADMINPASSWORD = "admin";
$SERVER = "http://localhost:236/kopano"; // Kopano socket or http(s) connection $SERVER = "file:///var/run/zarafa";
$CALDAVURL = "http://localhost:8080/ical/"; // Caldav URL $CALDAVURL = "http://localhost:8080/ical/";
$TEMPDIR = "/tmp/"; // Temporary directory for storing downloaded ics files $TEMPDIR = "/tmp/";
?>

View File

@@ -1,9 +1,9 @@
<?php <?php
/** /**
* functions.php, Kopano calender to ics im/exporter backend * functions.php, zarafa calender to ics im/exporter backend
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -18,16 +18,10 @@
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/ */
/** /* gets the data from a URL */
* gets the data from a URL
*
* @param $url
* @param null $username
* @param null $password
* @return mixed|null
*/
function curl_get_data($url, $username = NULL, $password = NULL) { function curl_get_data($url, $username = NULL, $password = NULL) {
$ch = curl_init(); $ch = curl_init();
$timeout = 5; $timeout = 5;
@@ -50,12 +44,7 @@ function curl_get_data($url, $username = NULL, $password = NULL) {
return $data; return $data;
} }
/** /* gets all zarafa users */
* gets all zarafa users
*
* @param $userStore
* @return null|void
*/
function get_user_ics_list($userStore) { function get_user_ics_list($userStore) {
// get settings // get settings
// first check if property exist and we can open that using mapi_openproperty // first check if property exist and we can open that using mapi_openproperty
@@ -100,13 +89,7 @@ function get_user_ics_list($userStore) {
} }
} }
/** /* updates the webapp settings */
* updates the webapp settings
*
* @param $userStore
* @param $icsentry
* @return bool|void
*/
function update_last_sync_date($userStore, $icsentry) { function update_last_sync_date($userStore, $icsentry) {
// get settings // get settings
// first check if property exist and we can open that using mapi_openproperty // first check if property exist and we can open that using mapi_openproperty
@@ -151,17 +134,7 @@ function update_last_sync_date($userStore, $icsentry) {
return false; return false;
} }
/** /* upload a file */
* upload a file
*
* @param $filename
* @param $caldavurl
* @param $username
* @param $calendarname
* @param null $authuser
* @param null $authpass
* @return int
*/
function upload_ics_to_caldav($filename, $caldavurl, $username, $calendarname, $authuser = NULL, $authpass = NULL) { function upload_ics_to_caldav($filename, $caldavurl, $username, $calendarname, $authuser = NULL, $authpass = NULL) {
$url = $caldavurl . $username . "/" . rawurlencode($calendarname) . "/"; $url = $caldavurl . $username . "/" . rawurlencode($calendarname) . "/";
$post = array('file'=>'@'.$filename); $post = array('file'=>'@'.$filename);
@@ -188,4 +161,5 @@ function upload_ics_to_caldav($filename, $caldavurl, $username, $calendarname, $
echo "uploading file to: " . $url . " (" . $http_status . ")\n"; echo "uploading file to: " . $url . " (" . $http_status . ")\n";
return $http_status; return $http_status;
} }
?>

View File

@@ -1,10 +1,10 @@
#!/usr/bin/php #!/usr/bin/php
<?php <?php
/** /**
* sync.php, Kopano calender to ics im/exporter backend * sync.php, zarafa calender to ics im/exporter backend
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -26,17 +26,17 @@ if(php_sapi_name() !== 'cli') {
} }
/** /**
* Make sure that the kopano mapi extension is enabled in cli mode: * Make sure that the zarafa mapi extension is enabled in cli mode:
* Add: /etc/php5/cli/conf.d/50-mapi.ini * Add: /etc/php5/cli/conf.d/50-mapi.ini
* Content: extension=mapi.so * Content: extension=mapi.so
*/ */
// MAPI includes // MAPI includes
include('mapi/mapi.util.php'); include('/usr/share/php/mapi/mapi.util.php');
include('mapi/mapidefs.php'); include('/usr/share/php/mapi/mapidefs.php');
include('mapi/mapicode.php'); include('/usr/share/php/mapi/mapicode.php');
include('mapi/mapitags.php'); include('/usr/share/php/mapi/mapitags.php');
include('mapi/mapiguid.php'); include('/usr/share/php/mapi/mapiguid.php');
include('config.php'); include('config.php');
include('functions.php'); include('functions.php');
@@ -134,7 +134,7 @@ foreach($userList as $userName => $userData) {
echo "Import completed: $result\n"; echo "Import completed: $result\n";
$result = update_last_sync_date($userStore, $syncItemName); $result = update_last_sync_date($userStore, $syncItemName);
$res = $result ? "true":"false"; $res = $result ? "true":"false";
echo "Updated Kopano settings: " . $res . "\n"; echo "Updated Zarafa settings: " . $res . "\n";
} else { } else {
echo "Uploading failed: " . $result . "\n"; echo "Uploading failed: " . $result . "\n";
} }
@@ -146,4 +146,5 @@ foreach($userList as $userName => $userData) {
} }
echo "###Done sync for user: " . $userName . "\n\n"; echo "###Done sync for user: " . $userName . "\n\n";
} }
?>

View File

@@ -1,6 +1,3 @@
calendarimporter 2.2.2:
- updated documentation
calendarimporter 2.2.1: calendarimporter 2.2.1:
- finally supporting Kopano Webapp 3.1.x - finally supporting Kopano Webapp 3.1.x
- translation to german added - translation to german added

View File

@@ -2,7 +2,7 @@
* ABOUT.js, Kopano calender to ics im/exporter * ABOUT.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -29,7 +29,7 @@ Ext.namespace('Zarafa.plugins.calendarimporter');
* The copyright string holding the copyright notice for the Zarafa calendarimporter Plugin. * The copyright string holding the copyright notice for the Zarafa calendarimporter Plugin.
*/ */
Zarafa.plugins.calendarimporter.ABOUT = "" Zarafa.plugins.calendarimporter.ABOUT = ""
+ "<p>Copyright (C) 2012-2018 Christoph Haas &lt;christoph.h@sprinternet.at&gt;</p>" + "<p>Copyright (C) 2012-2016 Christoph Haas &lt;christoph.h@sprinternet.at&gt;</p>"
+ "<p>This program is free software; you can redistribute it and/or " + "<p>This program is free software; you can redistribute it and/or "
+ "modify it under the terms of the GNU Lesser General Public " + "modify it under the terms of the GNU Lesser General Public "
@@ -49,8 +49,18 @@ Zarafa.plugins.calendarimporter.ABOUT = ""
+ "<p>The calendarimporter plugin contains the following third-party components:</p>" + "<p>The calendarimporter plugin contains the following third-party components:</p>"
+ "<h1>sabre-io/vobject v4.1</h1>" + "<h1>iCalcreator v2.16.12</h1>"
+ "<p>Copyright (C) 2011-2016 fruux GmbH (https://fruux.com/)</p>" + "<p>Copyright 2007-2013 Kjell-Inge Gustafsson kigkonsult</p>"
+ "<p>Licensed under the BSD 3-Clause \"New\" or \"Revised\" License</p>"; + "<p>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.</p>"
+ "<p>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.</p>"
+ "<h1>Ics-parser</h1>"
+ "<p>Copyright 2002-2007 Martin Thoma &lt;info@martin-thoma.de&gt;</p>"
+ "<p>Licensed under the MIT License.</p>"
+ "<p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>";

View File

@@ -2,7 +2,7 @@
* Actions.js zarafa calender to ics im/exporter * Actions.js zarafa calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* ResponseHandler.js, Kopano calender to ics im/exporter * ResponseHandler.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* timezones.js, Kopano calender to ics im/exporter * timezones.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* ImportContentPanel.js, Kopano calender to ics im/exporter * ImportContentPanel.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* ImportPanel.js, Kopano calender to ics im/exporter * ImportPanel.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* plugin.calendarimporter.js, Kopano calender to ics im/exporter * plugin.calendarimporter.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* SettingsCalSyncWidget.js, Kopano calender to ics im/exporter * SettingsCalSyncWidget.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* SettingsWidget.js, Kopano calender to ics im/exporter * SettingsWidget.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* CalSyncEditContentPanel.js, Kopano calender to ics im/exporter * CalSyncEditContentPanel.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* CalSyncEditPanel.js, Kopano calender to ics im/exporter * CalSyncEditPanel.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* CalSyncGrid.js, Kopano calender to ics im/exporter * CalSyncGrid.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* CalSyncPanel.js, Kopano calender to ics im/exporter * CalSyncPanel.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,7 +2,7 @@
* ContectMenu.js, Kopano calender to ics im/exporter * ContectMenu.js, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -2,12 +2,12 @@
<!DOCTYPE plugin SYSTEM "manifest.dtd"> <!DOCTYPE plugin SYSTEM "manifest.dtd">
<plugin version="2"> <plugin version="2">
<info> <info>
<version>2.2.2</version> <version>2.2.1</version>
<name>calendarimporter</name> <name>calendarimporter</name>
<title>ICS Calendar Importer/Exporter</title> <title>ICS Calendar Importer/Exporter</title>
<author>Christoph Haas</author> <author>Christoph Haas</author>
<authorURL>http://www.sprinternet.at</authorURL> <authorURL>http://www.sprinternet.at</authorURL>
<description>Import or export a ICS file to/from the Kopano calendar</description> <description>Import or Export a ICS file to/from the Kopano calendar</description>
</info> </info>
<translations> <translations>
<translationsdir>languages</translationsdir> <translationsdir>languages</translationsdir>

View File

@@ -1,5 +1,5 @@
{ {
"require": { "require": {
"sabre/vobject": "4.1" "sabre/vobject": "3.5.3"
} }
} }

View File

@@ -3,7 +3,7 @@
* download.php, Kopano calendar to ics im/exporter * download.php, Kopano calendar to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -3,7 +3,7 @@
* helper.php, Kopano calender to ics im/exporter * helper.php, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -3,7 +3,7 @@
* module.calendar.php, Kopano calender to ics im/exporter * module.calendar.php, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@@ -287,8 +287,9 @@ class CalendarModule extends Module
]); ]);
// Add organizer // Add organizer
if(!empty( $this->getProp($messageProps, "sender_email_address"))) { $organizer = $this->getProp($messageProps, "sender_email_address");
$vEvent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address")); if(!empty($organizer)) {
$vEvent->add('ORGANIZER', 'mailto:' . $organizer);
$vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name"); $vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name");
} }
@@ -302,7 +303,8 @@ class CalendarModule extends Module
} }
// Add alarms // Add alarms
if (!empty($this->getProp($messageProps, "reminder")) && $this->getProp($messageProps, "reminder") == 1) { $reminder = $this->getProp($messageProps, "reminder");
if (!empty($reminder) && $this->getProp($messageProps, "reminder") == 1) {
$vAlarm = $vEvent->add('VALARM', [ $vAlarm = $vEvent->add('VALARM', [
'ACTION' => 'DISPLAY', 'ACTION' => 'DISPLAY',
'DESCRIPTION' => $this->getProp($messageProps, "subject") // reuse the event summary 'DESCRIPTION' => $this->getProp($messageProps, "subject") // reuse the event summary
@@ -319,7 +321,8 @@ class CalendarModule extends Module
} }
// Add location // Add location
if (!empty($this->getProp($messageProps, "location"))) { $location = $this->getProp($messageProps, "location");
if (!empty($location)) {
$vEvent->add('LOCATION', $this->getProp($messageProps, "location")); $vEvent->add('LOCATION', $this->getProp($messageProps, "location"));
} }
@@ -330,10 +333,11 @@ class CalendarModule extends Module
} }
// Add categories // Add categories
if (!empty($this->getProp($messageProps, "categories"))) { $categories = $this->getProp($messageProps, "categories");
$categories = array_map('trim', explode(';', trim($this->getProp($messageProps, "categories"), " ;"))); if (!empty($categories)) {
$categoryArray = array_map('trim', explode(';', trim($categories, " ;")));
$vEvent->add('CATEGORIES', $categories); $vEvent->add('CATEGORIES', $categoryArray);
} }
} }
@@ -689,12 +693,16 @@ class CalendarModule extends Module
$properties["comment"] = (string)$vEvent->COMMENT; $properties["comment"] = (string)$vEvent->COMMENT;
$properties["timezone"] = (string)$vEvent->DTSTART["TZID"]; $properties["timezone"] = (string)$vEvent->DTSTART["TZID"];
$properties["organizer"] = (string)$vEvent->ORGANIZER; $properties["organizer"] = (string)$vEvent->ORGANIZER;
if(!empty((string)$vEvent->FBTYPE)) {
$properties["busystatus"] = array_search((string)$vEvent->FBTYPE, $this->freeBusyStates); $fbType = (string)$vEvent->FBTYPE;
} else if(!empty((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'})) { $msIntendedStatus = (string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'};
$properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'}, $this->busyStates); $msBusyStatus = (string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'};
} else if(!empty((string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'})) { if(!empty($fbType)) {
$properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-BUSYSTATUS'}, $this->busyStates); $properties["busystatus"] = array_search($fbType, $this->freeBusyStates);
} else if(!empty($msIntendedStatus)) {
$properties["busystatus"] = array_search($msIntendedStatus, $this->busyStates);
} else if(!empty($msBusyStatus)) {
$properties["busystatus"] = array_search($msBusyStatus, $this->busyStates);
} else { } else {
$properties["busystatus"] = array_search("BUSY", $this->busyStates); $properties["busystatus"] = array_search("BUSY", $this->busyStates);
} }
@@ -702,15 +710,18 @@ class CalendarModule extends Module
//$properties["trigger"] = (string)$vEvent->COMMENT; //$properties["trigger"] = (string)$vEvent->COMMENT;
$properties["priority"] = (string)$vEvent->PRIORITY; $properties["priority"] = (string)$vEvent->PRIORITY;
$properties["private"] = ((string)$vEvent->CLASS) == "PRIVATE" ? true : false; $properties["private"] = ((string)$vEvent->CLASS) == "PRIVATE" ? true : false;
if (!empty((string)$vEvent->{'X-ZARAFA-LABEL'})) { $zLabel = (string)$vEvent->{'X-ZARAFA-LABEL'};
$properties["label"] = array_search((string)$vEvent->{'X-ZARAFA-LABEL'}, $this->labels); if (!empty($zLabel)) {
$properties["label"] = array_search($zLabel, $this->labels);
} }
if (!empty((string)$vEvent->{'LAST-MODIFIED'})) { $lastModified = (string)$vEvent->{'LAST-MODIFIED'};
if (!empty($lastModified)) {
$properties["last_modification_time"] = (string)$vEvent->{'LAST-MODIFIED'}->getDateTime()->getTimestamp(); $properties["last_modification_time"] = (string)$vEvent->{'LAST-MODIFIED'}->getDateTime()->getTimestamp();
} else { } else {
$properties["last_modification_time"] = time(); $properties["last_modification_time"] = time();
} }
if (!empty((string)$vEvent->CREATED)) { $created = (string)$vEvent->CREATED;
if (!empty($created)) {
$properties["creation_time"] = (string)$vEvent->CREATED->getDateTime()->getTimestamp(); $properties["creation_time"] = (string)$vEvent->CREATED->getDateTime()->getTimestamp();
} else { } else {
$properties["creation_time"] = time(); $properties["creation_time"] = time();

View File

@@ -3,7 +3,7 @@
* plugin.calendarimporter.php, Kopano calender to ics im/exporter * plugin.calendarimporter.php, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

View File

@@ -3,7 +3,7 @@
* upload.php, Kopano calender to ics im/exporter * upload.php, Kopano calender to ics im/exporter
* *
* Author: Christoph Haas <christoph.h@sprinternet.at> * Author: Christoph Haas <christoph.h@sprinternet.at>
* Copyright (C) 2012-2018 Christoph Haas * Copyright (C) 2012-2016 Christoph Haas
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public

BIN
usage.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB