From d8a1ea301872be1daf8cb62ad850dcc798fec885 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 18 Jul 2016 09:54:24 -0400 Subject: [PATCH] Fix errors in tasks export (T1355) --- plugins/tasklist/tasklist.js | 13 ++++++++++--- plugins/tasklist/tasklist.php | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/plugins/tasklist/tasklist.js b/plugins/tasklist/tasklist.js index 8a767ff3..0bc47a53 100644 --- a/plugins/tasklist/tasklist.js +++ b/plugins/tasklist/tasklist.js @@ -837,7 +837,9 @@ function rcube_tasklist_ui(settings) $("#task-export-list").val(''); buttons[rcmail.gettext('export', 'tasklist')] = function() { - var source = $('#task-export-list option:selected').val(); + var data = {}, + source = $('#task-export-list option:selected').val(), + form_elements = $('select, input', form); // "current view" export, use hidden form to POST task IDs if (source === '') { @@ -852,7 +854,7 @@ function rcube_tasklist_ui(settings) }); // copy form inputs, there may be controls added by other plugins - $('#tasksexport select, #tasksexport input').each(function() { + form_elements.each(function() { if (this.type != 'checkbox' || this.checked) inputs.push($('').attr({type: 'hidden', name: this.name, value: this.value})); }); @@ -869,7 +871,12 @@ function rcube_tasklist_ui(settings) } // otherwise we can use simple GET else { - rcmail.goto_url('export', {source: source, attachments: attach}); + form_elements.each(function() { + if (this.type != 'checkbox' || this.checked) + data[this.name] = $(this).val(); + }); + + rcmail.goto_url('export', data); } $dialog.dialog("close"); diff --git a/plugins/tasklist/tasklist.php b/plugins/tasklist/tasklist.php index 6033eb57..87687f15 100644 --- a/plugins/tasklist/tasklist.php +++ b/plugins/tasklist/tasklist.php @@ -1647,7 +1647,7 @@ class tasklist extends rcube_plugin header("Content-Type: text/calendar"); header("Content-Disposition: inline; filename=\"". $plugin['filename'] ."\""); - $this->get_ical()->export($plugin['tasks'], '', true, + $this->get_ical()->export($plugin['result'], '', true, $plugins['attachments'] ? array($this->driver, 'get_attachment_body') : null); exit; }