Projects
Kolab:16:Testing
roundcubemail-plugins-kolab
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 11
View file
roundcubemail-plugins-kolab.spec
Changed
@@ -29,7 +29,7 @@ %global tmpdir %{_var}/lib/roundcubemail Name: roundcubemail-plugins-kolab -Version: 3.3.0 +Version: 3.3.1 Release: 1%{?dist} Summary: Kolab Groupware plugins for Roundcube Webmail @@ -42,8 +42,9 @@ Source1: comm.py Source100: plesk.calendar.inc.php -Source101: plesk.kolab_folders.inc.php -Source102: plesk.libkolab.inc.php +Source101: plesk.kolab_addressbook.inc.php +Source102: plesk.kolab_folders.inc.php +Source103: plesk.libkolab.inc.php Patch0001: roundcubemail-plugins-kolab-3.3-kolab-files-manticore-api.patch @@ -846,8 +847,9 @@ %if 0%{?plesk} # Provide defaults for Plesk cp -af %{SOURCE100} plugins/calendar/config.inc.php.dist -cp -af %{SOURCE101} plugins/kolab_folders/config.inc.php.dist -cp -af %{SOURCE102} plugins/libkolab/config.inc.php.dist +cp -af %{SOURCE101} plugins/kolab_addressbook/config.inc.php.dist +cp -af %{SOURCE102} plugins/kolab_folders/config.inc.php.dist +cp -af %{SOURCE103} plugins/libkolab/config.inc.php.dist %endif %patch0001 -p1 @@ -1995,6 +1997,9 @@ %defattr(-,root,root,-) %changelog +* Mon May 22 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 3.3.1-1 +- Release of version 3.3.1 + * Tue Apr 4 2017 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 3.3.0-1 - Release of version 3.3.0
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +roundcubemail-plugins-kolab (1:3.3.1-0~kolab1) unstable; urgency=low + + * Release version 3.3.1 + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Mon, 22 May 2017 11:11:11 +0200 + roundcubemail-plugins-kolab (1:3.3.0-1~kolab1) unstable; urgency=low * Fix upgrade path
View file
debian.rules
Changed
@@ -88,6 +88,7 @@ if -f "/etc/plesk-release" ; then \ cp -v ../SOURCES/plesk.calendar.inc.php config/calendar.inc.php ; \ + cp -v ../SOURCES/plesk.kolab_addressbook.inc.php config/kolab_addressbook.inc.php ; \ cp -v ../SOURCES/plesk.kolab_folders.inc.php config/kolab_folders.inc.php ; \ cp -v ../SOURCES/plesk.libkolab.inc.php config/libkolab.inc.php ; \ fi
View file
plesk.calendar.inc.php
Changed
@@ -8,7 +8,13 @@ $config'calendar_work_end' = 18; $config'calendar_event_coloring' = 0; - $config'calendar_caldav_url' = "https://" . $_SERVER"HTTP_HOST" . "/calendars/%u/%i"; + $config'calendar_caldav_url' = ( + ( + array_key_exists('HTTPS', $_SERVER) && + !empty($_SERVER'HTTPS') && + $_SERVER'HTTPS' !== 'off' + ) ? "https://" : "http://") . + $_SERVER"HTTP_HOST" . "/iRony/calendars/%u/%i"; $config'calendar_contact_birthdays' = true;
View file
plesk.kolab_addressbook.inc.php
Added
@@ -0,0 +1,41 @@ +<?php + + +// This option allows to set addressbooks priority or to disable some +// of them. Disabled addressbooks will be not shown in the UI. Default: 0. +// 0 - "Global address book(s) first". Use all address books, starting with the global (LDAP) +// 1 - "Personal address book(s) first". Use all address books, starting with the personal (Kolab) +// 2 - "Global address book(s) only". Use the global (LDAP) addressbook. Disable the personal. +// 3 - "Personal address book(s) only". Use the personal (Kolab) addressbook(s). Disable the global. +$config'kolab_addressbook_prio' = 0; + +// Base URL to build fully qualified URIs to access address books via CardDAV +// The following replacement variables are supported: +// %h - Current HTTP host +// %u - Current webmail user name +// %n - Folder name +// %i - Folder UUID +$config'kolab_addressbook_carddav_url' = ( + ( + array_key_exists('HTTPS', $_SERVER) && + !empty($_SERVER'HTTPS') && + $_SERVER'HTTPS' !== 'off' + ) ? "https://" : "http://") . + $_SERVER"HTTP_HOST" . "/iRony/addressbooks/%u/%i"; + +// Name of LDAP addressbook (a key in ldap_public configuration array) for which +// the CardDAV URI will be displayed if kolab_addressbook_carddav_url is set. +// Use it when iRony's kolabdav_ldap_directory is enabled. +// Note: kolab_addressbook_carddav_url must use %i and not %n. +// +// WARNING: There's limitations with volume and performance: +// CardDAV does a full sync of the entire contact resource. +// For LDAP this means that all entries matching the base_dn/filter are synced to every client. +// It's thus only recommended for small setups with a couple hundred LDAP entries. +// Other than that, the ldap-directory exposed in iRony is strictly read-only. +// Although correctly stated in the CardDAV properties, some clients (e.g. the Thunderbird SoGO connector) +// ignore these properties and allow modifications which then result in sync errors because the server +// denies such updates. +$config'kolab_addressbook_carddav_ldap' = ''; + +?>
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/calendar/calendar_ui.js -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/calendar/calendar_ui.js
Changed
@@ -3984,6 +3984,13 @@ var tab = String(ui.newPanel.selector || ui.newPanel.attr('id')) .replace(/^#?event-panel-/, '').replace(/s$/, ''); + var has_real_attendee = function(attendees) { + for (var i=0; i < (attendees ? attendees.length : 0); i++) { + if (attendeesi.cutype != 'RESOURCE') + return true; + } + }; + if (tab == 'attendee' || tab == 'resource') { if (!rcube_event.is_keyboard(event)) $('#edit-'+tab+'-name').select(); @@ -3991,7 +3998,7 @@ if (freebusy_ui.needsupdate && me.selected_event) update_freebusy_status(me.selected_event); // add current user as organizer if non added yet - if (tab == 'attendee' && !event_attendees.length) { + if (tab == 'attendee' && !has_real_attendee(event_attendees)) { add_attendee($.extend({ role:'ORGANIZER' }, settings.identity)); $('#edit-attendees-form .attendees-invitebox').show(); }
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/calendar/composer.json -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/calendar/composer.json
Changed
@@ -4,7 +4,7 @@ "description": "Calendar plugin", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.0", + "version": "3.3.1", "authors": { "name": "Thomas Bruederli",
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/calendar/drivers/calendar_driver.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/calendar/drivers/calendar_driver.php
Changed
@@ -532,17 +532,18 @@ /** * Get a list of property changes beteen two revisions of an event * - * @param array $event Hash array with event properties: + * @param array $event Hash array with event properties: * id: Event identifier * calendar: Calendar identifier - * @param mixed $rev Revisions: "from:to" + * @param mixed $rev1 Old Revision + * @param mixed $rev2 New Revision * * @return array List of property changes, each as a hash array: * property: Revision number * old: Old property value * new: Updated property value */ - public function get_event_diff($event, $rev) + public function get_event_diff($event, $rev1, $rev2) { return false; }
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/calendar/drivers/kolab/kolab_calendar.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/calendar/drivers/kolab/kolab_calendar.php
Changed
@@ -130,7 +130,7 @@ /** * Return color to display this calendar */ - public function get_color() + public function get_color($default = null) { // color is defined in folder METADATA if ($color = $this->storage->get_color()) { @@ -143,7 +143,7 @@ if (!empty($prefs$this->id) && !empty($prefs$this->id'color')) return $prefs$this->id'color'; - return 'cc0000'; + return $default ?: 'cc0000'; } /**
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/calendar/drivers/kolab/kolab_driver.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/calendar/drivers/kolab/kolab_driver.php
Changed
@@ -1141,11 +1141,11 @@ // use start date from master but try to be smart on time or duration changes $old_start_date = $old'start'->format('Y-m-d'); $old_start_time = $old'allday' ? '' : $old'start'->format('H:i'); - $old_duration = $old'allday' ? 0 : $old'end'->format('U') - $old'start'->format('U'); + $old_duration = self::event_duration($old'start', $old'end', $old'allday'); $new_start_date = $event'start'->format('Y-m-d'); $new_start_time = $event'allday' ? '' : $event'start'->format('H:i'); - $new_duration = $event'allday' ? 0 : $event'end'->format('U') - $event'start'->format('U'); + $new_duration = self::event_duration($event'start', $event'end', $event'allday'); $diff = $old_start_date != $new_start_date || $old_start_time != $new_start_time || $old_duration != $new_duration; $date_shift = $old'start'->diff($event'start'); @@ -1154,7 +1154,7 @@ if ($diff && ($old_start_date == $new_start_date || $old_duration == $new_duration)) { $event'start' = $master'start'->add($date_shift); $event'end' = clone $event'start'; - $event'end'->add(new DateInterval('PT'.$new_duration.'S')); + $event'end'->add(new DateInterval($new_duration)); // remove fixed weekday, will be re-set to the new weekday in kolab_calendar::update_event() if ($old_start_date != $new_start_date) { @@ -1231,6 +1231,19 @@ } /** + * Calculate event duration, returns string in DateInterval format + */ + protected static function event_duration($start, $end, $allday = false) + { + if ($allday) { + $diff = $start->diff($end); + return 'P' . $diff->days . 'D'; + } + + return 'PT' . ($end->format('U') - $start->format('U')) . 'S'; + } + + /** * Determine whether the current change affects scheduling and reset attendee status accordingly */ public function check_scheduling(&$event, $old, $update = true)
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/calendar/drivers/kolab/kolab_user_calendar.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/calendar/drivers/kolab/kolab_user_calendar.php
Changed
@@ -84,9 +84,11 @@ /** * Getter for the IMAP folder owner * + * @param bool Return a fully qualified owner name (unused) + * * @return string Name of the folder owner */ - public function get_owner() + public function get_owner($fully_qualified = false) { return $this->userdata'mail'; } @@ -122,7 +124,7 @@ /** * Return color to display this calendar */ - public function get_color() + public function get_color($default = null) { // calendar color is stored in local user prefs $prefs = $this->cal->rc->config->get('kolab_calendars', array()); @@ -130,7 +132,7 @@ if (!empty($prefs$this->id) && !empty($prefs$this->id'color')) return $prefs$this->id'color'; - return 'cc0000'; + return $default ?: 'cc0000'; } /** @@ -195,9 +197,11 @@ * @param string Search query (optional) * @param boolean Include virtual events (optional) * @param array Additional parameters to query storage + * @param array Additional query to filter events + * * @return array A list of event records */ - public function list_events($start, $end, $search = null, $virtual = 1, $query = array()) + public function list_events($start, $end, $search = null, $virtual = 1, $query = array(), $filter_query = null) { // convert to DateTime for comparisons try { @@ -258,9 +262,10 @@ * * @param integer Date range start (unix timestamp) * @param integer Date range end (unix timestamp) + * @param array Additional query to filter events * @return integer Count */ - public function count_events($start, $end = null) + public function count_events($start, $end = null, $filter_query = null) { // not implemented return 0;
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/kolab_addressbook/composer.json -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/kolab_addressbook/composer.json
Changed
@@ -4,7 +4,7 @@ "description": "Kolab addressbook", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.0", + "version": "3.3.1", "authors": { "name": "Thomas Bruederli",
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/kolab_addressbook/lib/rcube_kolab_contacts.php
Changed
@@ -290,10 +290,12 @@ /** * List all active contact groups of this source * - * @param string Optional search string to match group name + * @param string Optional search string to match group name + * @param int Search mode. Sum of self::SEARCH_* + * * @return array Indexed list of contact groups, each a hash array */ - function list_groups($search = null) + function list_groups($search = null, $mode = 0) { $this->_fetch_groups(); $groups = array(); @@ -792,14 +794,16 @@ /** * Remove all records from the database + * + * @param bool $with_groups Remove also groups */ - public function delete_all() + public function delete_all($with_groups = false) { if ($this->storagefolder->delete_all()) { - $this->contacts = array(); + $this->contacts = array(); $this->sortindex = array(); - $this->dataset = null; - $this->result = null; + $this->dataset = null; + $this->result = null; } } @@ -881,9 +885,11 @@ * * @param string Group identifier * @param string New name to set for this group + * @param string New group identifier (if changed, otherwise don't set) + * * @return boolean New name on success, false if no data was changed */ - function rename_group($gid, $newname) + function rename_group($gid, $newname, &$newid) { $this->_fetch_groups(); $list = $this->distlists$gid; @@ -1029,10 +1035,11 @@ * If input not valid, the message to display can be fetched using get_error() * * @param array Associative array with contact data to save + * @param bool Attempt to fix/complete data automatically * * @return boolean True if input is valid, False if not. */ - public function validate(&$save_data) + public function validate(&$save_data, $autofix = false) { // validate e-mail addresses $valid = parent::validate($save_data);
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/kolab_files/composer.json -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/kolab_files/composer.json
Changed
@@ -4,7 +4,7 @@ "description": "User interface for Kolab File Manager (Chwala)", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.0", + "version": "3.3.1", "authors": { "name": "Aleksander Machniak",
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/kolab_files/config.inc.php.dist -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/kolab_files/config.inc.php.dist
Changed
@@ -3,6 +3,12 @@ // URL of kolab-chwala installation $config'kolab_files_url' = '/chwala/'; +// Optional URL of kolab-chwala installation for connections +// made by the Roundcube host. Useful when the chwala host name does not +// resolve on the server to the same IP as on the client. +// By default kolab_files_url will be used. +$config'kolab_files_server_url' = ''; + // List of files list columns. Available are: name, size, mtime, type $config'kolab_files_list_cols' = array('name', 'mtime', 'size');
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/kolab_files/kolab_files.js -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/kolab_files/kolab_files.js
Changed
@@ -193,8 +193,8 @@ file_api.request('folder_info', {folder: file_api.file_path(rcmail.env.file), sessions: 1}, 'folder_info_response'); } else { - file_api.env.folder = rcmail.env.folder; - file_api.env.collection = rcmail.env.collection; + file_api.env.init_folder = rcmail.env.folder; + file_api.env.init_collection = rcmail.env.collection; file_api.folder_list(); file_api.browser_capabilities_check(); } @@ -1973,7 +1973,7 @@ if (!this.response(response)) return; - var first, body, rows = , + var folder, first, body, rows = , list_selector = rcmail.env.folder_list_selector || '#files-folder-list', search_selector = rcmail.env.folder_search_selector || '#foldersearch', elem = $(list_selector), @@ -2060,13 +2060,21 @@ file_api.folder_select(node.id); }); - // select first folder? + // select first/current folder if (response.result.auth_errors && response.result.auth_errors.length) this.env.folder = this.env.collection = null; else if (this.env.folder) - rcmail.folder_list.select(this.env.folder); + rcmail.folder_list.select(folder); else if (this.env.collection) rcmail.folder_list.select('folder-collection-' + this.env.collection); + else if (folder = this.env.init_folder) { + this.env.init_folder = null; + rcmail.folder_list.select(folder); + } + else if (folder = this.env.init_collection) { + this.env.init_collection = null; + rcmail.folder_list.select('folder-collection-' + folder); + } else if (first) rcmail.folder_list.select(first);
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/kolab_files/kolab_files.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/kolab_files/kolab_files.php
Changed
@@ -72,15 +72,16 @@ $this->load_config(); - $url = $this->rc->config->get('kolab_files_url'); + $client_url = $this->rc->config->get('kolab_files_url'); + $server_url = $this->rc->config->get('kolab_files_server_url'); - if (!$url) { + if (!$client_url) { return $this->engine = false; } require_once $this->home . '/lib/kolab_files_engine.php'; - $this->engine = new kolab_files_engine($this, $url); + $this->engine = new kolab_files_engine($this, $client_url, $server_url); } return $this->engine;
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/kolab_files/lib/kolab_files_engine.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/kolab_files/lib/kolab_files_engine.php
Changed
@@ -26,6 +26,8 @@ { private $plugin; private $rc; + private $url; + private $url_srv; private $timeout = 600; private $files_sort_cols = array('name', 'mtime', 'size'); private $sessions_sort_cols = array('name'); @@ -36,9 +38,10 @@ /** * Class constructor */ - public function __construct($plugin, $url) + public function __construct($plugin, $client_url, $server_url = null) { - $this->url = rcube_utils::resolve_url($url); + $this->url = rcube_utils::resolve_url($client_url); + $this->url_srv = $server_url ? rcube_utils::resolve_url($server_url) : $this->url; $this->plugin = $plugin; $this->rc = $plugin->rc; $this->timeout = $this->rc->config->get('session_lifetime') * 60; @@ -901,7 +904,7 @@ */ protected function get_request($get = null, $token = null) { - $url = $this->url . '/api/'; + $url = $this->url_srv . '/api/'; if (!$this->request) { $config = array( @@ -1432,28 +1435,29 @@ if (array_key_exists($type, $this->mimetypes)) { $mimetypes = $this->mimetypes$type; } + // fallback to static definition if old Chwala is used + else if ($type == 'edit') { + $mimetypes = array( + 'text/plain' => 'txt', + 'text/html' => 'html', + ); + if (!empty($_SESSION'kolab_files_caps''MANTICORE')) { + $mimetypes = array_merge(array('application/vnd.oasis.opendocument.text' => 'odt'), $mimetypes); + } + + foreach (array_keys($mimetypes) as $type) { + list ($app, $label) = explode('/', $type); + $label = preg_replace('/^a-z/', '', $label); + $mimetypes$type = array( + 'ext' => $mimetypes$type, + 'label' => $this->plugin->gettext('type.' . $label), + ); + } + } else { $mimetypes = $this->mimetypes; } } - - // fallback to static definition if old Chwala is used - if ($type == 'edit' && empty($mimetypes)) { - $mimetypes = array( - 'application/vnd.oasis.opendocument.text' => 'odt', - 'text/plain' => 'txt', - 'text/html' => 'html', - ); - - foreach (array_keys($mimetypes) as $type) { - list ($app, $label) = explode('/', $type); - $label = preg_replace('/^a-z/', '', $label); - $mimetypes$type = array( - 'ext' => $mimetypes$type, - 'label' => $this->plugin->gettext('type.' . $label), - ); - } - } } catch (Exception $e) { rcube::raise_error(array(
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/libkolab/composer.json -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/libkolab/composer.json
Changed
@@ -4,7 +4,7 @@ "description": "Plugin to setup a basic environment for the interaction with a Kolab server.", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.0", + "version": "3.3.1", "authors": { "name": "Thomas Bruederli",
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/libkolab/lib/kolab_format_xcal.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/libkolab/lib/kolab_format_xcal.php
Changed
@@ -440,7 +440,7 @@ if (isset($this->weekday_map$day)) { // @TODO: libkolabxml does not support BYSETPOS, neither we. // However, we can convert most common cases to BYDAY - if (!$occurence && $freq == 'MONTHLY' && !empty($bysetpos)) { + if (!$occurrence && $freq == 'MONTHLY' && !empty($bysetpos)) { foreach ($bysetpos as $pos) { $byday->push(new DayPos(intval($pos), $this->weekday_map$day)); }
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/tasklist/composer.json -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/tasklist/composer.json
Changed
@@ -4,7 +4,7 @@ "description": "Task management plugin", "homepage": "https://git.kolab.org/diffusion/RPK/", "license": "AGPLv3", - "version": "3.3.0", + "version": "3.3.1", "authors": { "name": "Thomas Bruederli",
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/tasklist/localization/en_US.inc -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/tasklist/localization/en_US.inc
Changed
@@ -123,6 +123,10 @@ $labels'changetaskconfirm' = 'Update task'; $labels'changeconfirmnotifications' = 'Do you want to notify the attendees about the modification?'; $labels'partstatupdatenotification' = 'Do you want to notify the organizer about the status change?'; +$labels'importtasks' = 'Import tasks'; +$labels'importsuccess' = 'Successfully imported $nr tasks'; +$labels'importnone' = 'No tasks found to be imported'; +$labels'importerror' = 'An error occured while importing'; // (hidden) titles and labels for accessibility annotations $labels'quickaddinput' = 'New task date and title';
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/tasklist/skins/larry/templates/mainview.html -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/tasklist/skins/larry/templates/mainview.html
Changed
@@ -17,6 +17,7 @@ <div id="taskstoolbar" class="toolbar" role="toolbar" aria-labelledby="aria-label-toolbar"> <roundcube:button command="newtask" type="link" class="button newtask disabled" classAct="button newtask" classSel="button newtask pressed" label="tasklist.newtask" title="tasklist.newtask" /> <roundcube:button command="print" type="link" class="button print disabled" classAct="button print" classSel="button print pressed" label="print" title="tasklist.printtitle" /> + <roundcube:button command="import" type="link" class="button import disabled" classAct="button import" classSel="button import pressed" label="import" title="tasklist.importtasks" /> <roundcube:button command="export" type="link" class="button export disabled" classAct="button export" classSel="button export pressed" label="tasklist.export" title="tasklist.exporttitle" /> <roundcube:container name="toolbar" id="taskstoolbar" /> </div> @@ -321,6 +322,10 @@ <roundcube:container name="tasklistform" id="tasklistform" /> </div> +<div id="tasksimport" class="uidialog"> + <roundcube:object name="plugin.tasks_import_form" id="tasks-import-form" uploadFieldSize="30" /> +</div> + <div id="tasksexport" class="uidialog"> <roundcube:object name="plugin.tasks_export_form" id="tasks-export-form" /> </div>
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/tasklist/tasklist.js -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/tasklist/tasklist.js
Changed
@@ -288,6 +288,9 @@ setTimeout(fetch_counts, 200); }); + rcmail.addEventListener('plugin.import_success', function(p){ rctasks.import_success(p); }); + rcmail.addEventListener('plugin.import_error', function(p){ rctasks.import_error(p); }); + rcmail.addEventListener('plugin.task_render_changelog', task_render_changelog); rcmail.addEventListener('plugin.task_show_diff', task_show_diff); rcmail.addEventListener('plugin.task_show_revision', function(data){ task_show_dialog(null, data, true); }); @@ -824,6 +827,90 @@ loadstate.lists = active_lists(); } + // open a dialog to upload an .ics file with tasks to be imported + this.import_tasks = function(tasklist) + { + // close show dialog first + var buttons = {}, + $dialog = $("#tasksimport"), + form = rcmail.gui_objects.importform; + + if ($dialog.is(':ui-dialog')) + $dialog.dialog('close'); + + if (tasklist) + $('#task-import-list').val(tasklist); + + buttonsrcmail.gettext('import', 'tasklist') = function() { + if (form && form.elements._data.value) { + rcmail.async_upload_form(form, 'import', function(e) { + rcmail.set_busy(false, null, saving_lock); + saving_lock = null; + $('.ui-dialog-buttonpane button', $dialog.parent()).button('enable'); + + // display error message if no sophisticated response from server arrived (e.g. iframe load error) + if (me.import_succeeded === null) + rcmail.display_message(rcmail.get_label('importerror', 'tasklist'), 'error'); + }); + + // display upload indicator (with extended timeout) + var timeout = rcmail.env.request_timeout; + rcmail.env.request_timeout = 600; + me.import_succeeded = null; + saving_lock = rcmail.set_busy(true, 'uploading'); + $('.ui-dialog-buttonpane button', $dialog.parent()).button('disable'); + + // restore settings + rcmail.env.request_timeout = timeout; + } + }; + + buttonsrcmail.gettext('cancel', 'tasklist') = function() { + $dialog.dialog("close"); + }; + + // open jquery UI dialog + $dialog.dialog({ + modal: true, + resizable: false, + closeOnEscape: false, + title: rcmail.gettext('importtasks', 'tasklist'), + open: function() { + $dialog.parent().find('.ui-dialog-buttonset .ui-button').first().addClass('mainaction'); + }, + close: function() { + $('.ui-dialog-buttonpane button', $dialog.parent()).button('enable'); + $dialog.dialog("destroy").hide(); + }, + buttons: buttons, + width: 520 + }).show(); + }; + + // callback from server if import succeeded + this.import_success = function(p) + { + this.import_succeeded = true; + $("#tasksimport:ui-dialog").dialog('close'); + rcmail.set_busy(false, null, saving_lock); + saving_lock = null; + rcmail.gui_objects.importform.reset(); + + if (p.refetch) { + list_tasks(null, true); + setTimeout(fetch_counts, 200); + } + }; + + // callback from server to report errors on import + this.import_error = function(p) + { + this.import_succeeded = false; + rcmail.set_busy(false, null, saving_lock); + saving_lock = null; + rcmail.display_message(p.message || rcmail.get_label('importerror', 'tasklist'), 'error'); + }; + // open a tasks export dialog this.export_tasks = function() { @@ -3448,6 +3535,7 @@ // register button commands rcmail.register_command('newtask', function(){ rctasks.edit_task(null, 'new', {}); }, true); rcmail.register_command('print', function(){ rctasks.print_tasks(); }, true); + rcmail.register_command('import', function(){ rctasks.import_tasks(rctasks.selected_list); }, true); rcmail.register_command('list-create', function(){ rctasks.list_edit_dialog(null); }, true); rcmail.register_command('list-edit', function(){ rctasks.list_edit_dialog(rctasks.selected_list); }, false);
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/tasklist/tasklist.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/tasklist/tasklist.php
Changed
@@ -119,6 +119,7 @@ $this->register_action('mail2task', array($this, 'mail_message2task')); $this->register_action('get-attachment', array($this, 'attachment_get')); $this->register_action('upload', array($this, 'attachment_upload')); + $this->register_action('import', array($this, 'import_tasks')); $this->register_action('export', array($this, 'export_tasks')); $this->register_action('mailimportitip', array($this, 'mail_import_itip')); $this->register_action('mailimportattach', array($this, 'mail_import_attachment')); @@ -1552,6 +1553,126 @@ } /** + * Handler for importing .ics files + */ + function import_tasks() + { + // Upload progress update + if (!empty($_GET'_progress')) { + $this->rc->upload_progress(); + } + + @set_time_limit(0); + + // process uploaded file if there is no error + $err = $_FILES'_data''error'; + + if (!$err && $_FILES'_data''tmp_name') { + $source = rcube_utils::get_input_value('source', rcube_utils::INPUT_GPC); + $lists = $this->driver->get_lists(); + $list = $lists$source ?: $this->get_default_tasklist(); + $source = $list'id'; + + // extract zip file + if ($_FILES'_data''type' == 'application/zip') { + $count = 0; + if (class_exists('ZipArchive', false)) { + $zip = new ZipArchive(); + if ($zip->open($_FILES'_data''tmp_name')) { + $randname = uniqid('zip-' . session_id(), true); + $tmpdir = slashify($this->rc->config->get('temp_dir', sys_get_temp_dir())) . $randname; + mkdir($tmpdir, 0700); + + // extract each ical file from the archive and import it + for ($i = 0; $i < $zip->numFiles; $i++) { + $filename = $zip->getNameIndex($i); + if (preg_match('/\.ics$/i', $filename)) { + $tmpfile = $tmpdir . '/' . basename($filename); + if (copy('zip://' . $_FILES'_data''tmp_name' . '#'.$filename, $tmpfile)) { + $count += $this->import_from_file($tmpfile, $source, $errors); + unlink($tmpfile); + } + } + } + + rmdir($tmpdir); + $zip->close(); + } + else { + $errors = 1; + $msg = 'Failed to open zip file.'; + } + } + else { + $errors = 1; + $msg = 'Zip files are not supported for import.'; + } + } + else { + // attempt to import the uploaded file directly + $count = $this->import_from_file($_FILES'_data''tmp_name', $source, $errors); + } + + if ($count) { + $this->rc->output->command('display_message', $this->gettext(array('name' => 'importsuccess', 'vars' => array('nr' => $count))), 'confirmation'); + $this->rc->output->command('plugin.import_success', array('source' => $source, 'refetch' => true)); + } + else if (!$errors) { + $this->rc->output->command('display_message', $this->gettext('importnone'), 'notice'); + $this->rc->output->command('plugin.import_success', array('source' => $source)); + } + else { + $this->rc->output->command('plugin.import_error', array('message' => $this->gettext('importerror') . ($msg ? ': ' . $msg : ''))); + } + } + else { + if ($err == UPLOAD_ERR_INI_SIZE || $err == UPLOAD_ERR_FORM_SIZE) { + $msg = $this->rc->gettext(array('name' => 'filesizeerror', 'vars' => array( + 'size' => $this->rc->show_bytes(parse_bytes(ini_get('upload_max_filesize')))))); + } + else { + $msg = $this->rc->gettext('fileuploaderror'); + } + + $this->rc->output->command('plugin.import_error', array('message' => $msg)); + } + + $this->rc->output->send('iframe'); + } + + /** + * Helper function to parse and import a single .ics file + */ + private function import_from_file($filepath, $source, &$errors) + { + $user_email = $this->rc->user->get_username(); + $ical = $this->get_ical(); + $errors = !$ical->fopen($filepath); + $count = $i = 0; + + foreach ($ical as $task) { + // keep the browser connection alive on long import jobs + if (++$i > 100 && $i % 100 == 0) { + echo "<!-- -->"; + ob_flush(); + } + + if ($task'_type' == 'task') { + $task'list' = $source; + + if ($this->driver->create_task($task)) { + $count++; + } + else { + $errors++; + } + } + } + + return $count; + } + + /** * Construct the ics file for exporting tasks to iCalendar format */ function export_tasks()
View file
roundcubemail-plugins-kolab-3.3.0.tar.gz/plugins/tasklist/tasklist_ui.php -> roundcubemail-plugins-kolab-3.3.1.tar.gz/plugins/tasklist/tasklist_ui.php
Changed
@@ -158,6 +158,7 @@ $this->plugin->register_handler('plugin.task_rsvp_buttons', array($this->plugin->itip, 'itip_rsvp_buttons')); $this->plugin->register_handler('plugin.object_changelog_table', array('libkolab', 'object_changelog_table')); $this->plugin->register_handler('plugin.tasks_export_form', array($this, 'tasks_export_form')); + $this->plugin->register_handler('plugin.tasks_import_form', array($this, 'tasks_import_form')); jqueryui::tagedit(); @@ -535,6 +536,53 @@ } /** + * Form for uploading and importing tasks + */ + function tasks_import_form($attrib = array()) + { + if (!$attrib'id') { + $attrib'id' = 'rcmImportForm'; + } + + // Get max filesize, enable upload progress bar + $max_filesize = $this->rc->upload_init(); + + $accept = '.ics, text/calendar, text/x-vcalendar, application/ics'; + if (class_exists('ZipArchive', false)) { + $accept .= ', .zip, application/zip'; + } + + $input = new html_inputfield(array( + 'type' => 'file', + 'name' => '_data', + 'size' => $attrib'uploadfieldsize', + 'accept' => $accept + )); + + $html = html::div('form-section', + html::div(null, $input->show()) + . html::div('hint', $this->rc->gettext(array('name' => 'maxuploadsize', 'vars' => array('size' => $max_filesize)))) + ); + + $html .= html::div('form-section', + html::label('task-import-list', $this->plugin->gettext('list')) + . $this->tasklist_select(array('name' => 'source', 'id' => 'task-import-list', 'editable' => true)) + ); + + $this->rc->output->add_gui_object('importform', $attrib'id'); + $this->rc->output->add_label('import', 'importerror'); + + return html::tag('form', array( + 'action' => $this->rc->url(array('task' => 'tasklist', 'action' => 'import')), + 'method' => 'post', + 'enctype' => 'multipart/form-data', + 'id' => $attrib'id' + ), + $html + ); + } + + /** * Form to select options for exporting tasks */ function tasks_export_form($attrib = array())
View file
roundcubemail-plugins-kolab.dsc
Changed
@@ -2,7 +2,7 @@ Source: roundcubemail-plugins-kolab Binary: roundcubemail-plugins-kolab Architecture: all -Version: 1:3.3.0-1~kolab1 +Version: 1:3.3.1-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Standards-Version: 3.9.3 @@ -34,5 +34,5 @@ roundcubemail-plugin-tinymce-config deb web extra roundcubemail-plugin-wap-client deb web extra Files: - 00000000000000000000000000000000 0 roundcubemail-plugins-kolab-3.3.0.tar.gz + 00000000000000000000000000000000 0 roundcubemail-plugins-kolab-3.3.1.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.