diff --git a/.gitignore b/.gitignore index 9f11b75..1721d3b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .idea/ +.vs/ diff --git a/DIST/calendarimporter_2.2.2.zip b/DIST/calendarimporter_2.2.2.zip new file mode 100644 index 0000000..24786f6 Binary files /dev/null and b/DIST/calendarimporter_2.2.2.zip differ diff --git a/DIST/calendarimporter_backend_2.2.2.zip b/DIST/calendarimporter_backend_2.2.2.zip new file mode 100644 index 0000000..9dd4a97 Binary files /dev/null and b/DIST/calendarimporter_backend_2.2.2.zip differ diff --git a/README.md b/README.md index f52cd38..bb4b880 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,124 @@ CALENDAR IMPORTER AND EXPORTER: === -Building the calendar importer plugin for Zarafa WebApp: +## Building the calendar importer plugin from source: +### 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 /zarafa/webapp/ +cd kopano-webapp-source 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 -cd calendarimporter +``` + +Now lets build the plugin: +``` +cd kopano-webapp-source\plugins\calendarimporter\php +composer install +cd kopano-webapp-source\plugins\calendarimporter ant deploy ``` -### Usage -Rightclick a calendarfolder or calendar entry to export it as iCal. +The compiled plugin is saved to `kopano-webapp-source\deploy\plugins\calendarimporter`. -Rightclick a calendarfolder to import a iCal file. +## Installing the plugin -Rightclick a iCal attachment to import it. \ No newline at end of file +### From compiled source +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") \ No newline at end of file diff --git a/backend/README.txt b/backend/README.txt index 9349a72..234acac 100644 --- a/backend/README.txt +++ b/backend/README.txt @@ -1,14 +1,54 @@ -Backend setup: +# Backend setup: -1. Create a Admin User in Kopano: +## 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 +``` + +## 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. -2. Edit the config.php to fit your needs. +Available configuration values: -3. Setup cron to run your script every 10 minutes (or whatever...) +| 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) | -4. If you get an error, make sure that the mapi module is loaded for php-cli: - * Add: /etc/php5/cli/conf.d/50-mapi.ini - * Content: extension=mapi.so +Next set up a cronjob to allow periodic syncing of ical items. -Never run the backend script as root! \ No newline at end of file +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. \ No newline at end of file diff --git a/backend/functions.php b/backend/functions.php index 52390fe..46bc375 100644 --- a/backend/functions.php +++ b/backend/functions.php @@ -3,7 +3,7 @@ * functions.php, Kopano calender to ics im/exporter backend * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/backend/sync.php b/backend/sync.php index c9e21f9..3b995b5 100644 --- a/backend/sync.php +++ b/backend/sync.php @@ -4,7 +4,7 @@ * sync.php, Kopano calender to ics im/exporter backend * * Author: Christoph Haas - * Copyright (C) 2012-2017 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/changelog.txt b/changelog.txt index 43928a2..dad1ea7 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +calendarimporter 2.2.2: + - updated documentation + calendarimporter 2.2.1: - finally supporting Kopano Webapp 3.1.x - translation to german added diff --git a/js/ABOUT.js b/js/ABOUT.js index 0dcce4c..d42488f 100644 --- a/js/ABOUT.js +++ b/js/ABOUT.js @@ -2,7 +2,7 @@ * ABOUT.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * 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. */ Zarafa.plugins.calendarimporter.ABOUT = "" - + "

Copyright (C) 2012-2016 Christoph Haas <christoph.h@sprinternet.at>

" + + "

Copyright (C) 2012-2018 Christoph Haas <christoph.h@sprinternet.at>

" + "

This program is free software; you can redistribute it and/or " + "modify it under the terms of the GNU Lesser General Public " @@ -49,18 +49,8 @@ Zarafa.plugins.calendarimporter.ABOUT = "" + "

The calendarimporter plugin contains the following third-party components:

" - + "

iCalcreator v2.16.12

" + + "

sabre-io/vobject v4.1

" - + "

Copyright 2007-2013 Kjell-Inge Gustafsson kigkonsult

" - - + "

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.

" - - + "

Ics-parser

" - - + "

Copyright 2002-2007 Martin Thoma <info@martin-thoma.de>

" - - + "

Licensed under the MIT License.

" - - + "

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.

"; \ No newline at end of file + + "

Copyright (C) 2011-2016 fruux GmbH (https://fruux.com/)

" + + + "

Licensed under the BSD 3-Clause \"New\" or \"Revised\" License

"; \ No newline at end of file diff --git a/js/data/Actions.js b/js/data/Actions.js index 3274c47..ea4aacf 100644 --- a/js/data/Actions.js +++ b/js/data/Actions.js @@ -2,7 +2,7 @@ * Actions.js zarafa calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/data/ResponseHandler.js b/js/data/ResponseHandler.js index c17129f..0307265 100644 --- a/js/data/ResponseHandler.js +++ b/js/data/ResponseHandler.js @@ -2,7 +2,7 @@ * ResponseHandler.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/data/timezones.js b/js/data/timezones.js index 15b3601..2eb7586 100644 --- a/js/data/timezones.js +++ b/js/data/timezones.js @@ -2,7 +2,7 @@ * timezones.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/dialogs/ImportContentPanel.js b/js/dialogs/ImportContentPanel.js index a18aeee..63b08c2 100644 --- a/js/dialogs/ImportContentPanel.js +++ b/js/dialogs/ImportContentPanel.js @@ -2,7 +2,7 @@ * ImportContentPanel.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/dialogs/ImportPanel.js b/js/dialogs/ImportPanel.js index 14e6060..2bca0c4 100644 --- a/js/dialogs/ImportPanel.js +++ b/js/dialogs/ImportPanel.js @@ -2,7 +2,7 @@ * ImportPanel.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/plugin.calendarimporter.js b/js/plugin.calendarimporter.js index eec6411..d878895 100644 --- a/js/plugin.calendarimporter.js +++ b/js/plugin.calendarimporter.js @@ -2,7 +2,7 @@ * plugin.calendarimporter.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/settings/SettingsCalSyncWidget.js b/js/settings/SettingsCalSyncWidget.js index 058266d..ba23f7e 100644 --- a/js/settings/SettingsCalSyncWidget.js +++ b/js/settings/SettingsCalSyncWidget.js @@ -2,7 +2,7 @@ * SettingsCalSyncWidget.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/settings/SettingsWidget.js b/js/settings/SettingsWidget.js index d85909f..02bdefa 100644 --- a/js/settings/SettingsWidget.js +++ b/js/settings/SettingsWidget.js @@ -2,7 +2,7 @@ * SettingsWidget.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/settings/dialogs/CalSyncEditContentPanel.js b/js/settings/dialogs/CalSyncEditContentPanel.js index 41709f1..bede984 100644 --- a/js/settings/dialogs/CalSyncEditContentPanel.js +++ b/js/settings/dialogs/CalSyncEditContentPanel.js @@ -2,7 +2,7 @@ * CalSyncEditContentPanel.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/settings/dialogs/CalSyncEditPanel.js b/js/settings/dialogs/CalSyncEditPanel.js index b53f599..b45a0da 100644 --- a/js/settings/dialogs/CalSyncEditPanel.js +++ b/js/settings/dialogs/CalSyncEditPanel.js @@ -2,7 +2,7 @@ * CalSyncEditPanel.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/settings/ui/CalSyncGrid.js b/js/settings/ui/CalSyncGrid.js index 092604e..5379e7d 100644 --- a/js/settings/ui/CalSyncGrid.js +++ b/js/settings/ui/CalSyncGrid.js @@ -2,7 +2,7 @@ * CalSyncGrid.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/settings/ui/CalSyncPanel.js b/js/settings/ui/CalSyncPanel.js index 8e63856..d6c9786 100644 --- a/js/settings/ui/CalSyncPanel.js +++ b/js/settings/ui/CalSyncPanel.js @@ -2,7 +2,7 @@ * CalSyncPanel.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/js/ui/ContextMenu.js b/js/ui/ContextMenu.js index d8bee7e..226373e 100644 --- a/js/ui/ContextMenu.js +++ b/js/ui/ContextMenu.js @@ -2,7 +2,7 @@ * ContectMenu.js, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/manifest.xml b/manifest.xml index df0af10..ce4464c 100644 --- a/manifest.xml +++ b/manifest.xml @@ -2,12 +2,12 @@ - 2.2.1 + 2.2.2 calendarimporter ICS Calendar Importer/Exporter Christoph Haas http://www.sprinternet.at - Import or Export a ICS file to/from the Kopano calendar + Import or export a ICS file to/from the Kopano calendar languages diff --git a/php/download.php b/php/download.php index 1ed00a4..496a30d 100644 --- a/php/download.php +++ b/php/download.php @@ -3,7 +3,7 @@ * download.php, Kopano calendar to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/php/helper.php b/php/helper.php index 1ffae2f..2aa7cbe 100644 --- a/php/helper.php +++ b/php/helper.php @@ -3,7 +3,7 @@ * helper.php, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/php/module.calendar.php b/php/module.calendar.php index 23e78d7..bc975aa 100644 --- a/php/module.calendar.php +++ b/php/module.calendar.php @@ -3,7 +3,7 @@ * module.calendar.php, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/php/plugin.calendarimporter.php b/php/plugin.calendarimporter.php index ff54fc0..7d3d5f5 100644 --- a/php/plugin.calendarimporter.php +++ b/php/plugin.calendarimporter.php @@ -3,7 +3,7 @@ * plugin.calendarimporter.php, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/php/upload.php b/php/upload.php index d2400ec..949f364 100644 --- a/php/upload.php +++ b/php/upload.php @@ -3,7 +3,7 @@ * upload.php, Kopano calender to ics im/exporter * * Author: Christoph Haas - * Copyright (C) 2012-2016 Christoph Haas + * Copyright (C) 2012-2018 Christoph Haas * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/usage.png b/usage.png new file mode 100644 index 0000000..1366d2a Binary files /dev/null and b/usage.png differ diff --git a/usage_sync.png b/usage_sync.png new file mode 100644 index 0000000..8d467fe Binary files /dev/null and b/usage_sync.png differ