From 57a35096a6bfe1b972369b21ab11f83381cec70b Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 30 Nov 2016 11:07:26 +0100 Subject: [PATCH 1/8] Fixed PHP warnings in upload.php --- .idea/workspace.xml | 222 ++++++++++++++------------------------------ php/helper.php | 63 +++++++++++++ php/upload.php | 54 ++++------- 3 files changed, 153 insertions(+), 186 deletions(-) create mode 100644 php/helper.php diff --git a/.idea/workspace.xml b/.idea/workspace.xml index f000ac4..e8fa7f4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,30 +2,8 @@ - + - - - - - - - - - - - - - - - - - - - - - - @@ -47,22 +25,14 @@ - - + + - - - - - - - - - - - - - + + + + + @@ -70,51 +40,29 @@ - - + + - - - - + + - - - - - - - - - - - - + + - + - - - - - - - - - - @@ -136,7 +84,6 @@ @@ -248,42 +198,6 @@ \ No newline at end of file diff --git a/php/helper.php b/php/helper.php new file mode 100644 index 0000000..1ffae2f --- /dev/null +++ b/php/helper.php @@ -0,0 +1,63 @@ + + * Copyright (C) 2012-2016 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 + * + */ + + +namespace calendarimporter; + + +class Helper +{ + /** + * Generates a random string with variable length. + * + * @param $length the lenght of the generated string, defaults to 6 + * @return string a random string + */ + public static function randomstring($length = 6) + { + // $chars - all allowed charakters + $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; + + srand((double)microtime() * 1000000); + $i = 0; + $pass = ""; + while ($i < $length) { + $num = rand() % strlen($chars); + $tmp = substr($chars, $num, 1); + $pass = $pass . $tmp; + $i++; + } + return $pass; + } + + /** + * respond/echo JSON + * + * @param $arr + * @return string JSON encoded string + */ + public static function respondJSON($arr) + { + echo json_encode($arr); + } +} \ No newline at end of file diff --git a/php/upload.php b/php/upload.php index bd5f928..b8b6b8f 100644 --- a/php/upload.php +++ b/php/upload.php @@ -21,53 +21,35 @@ * */ -require_once("../config.php"); +require_once(__DIR__ . "/../config.php"); +require_once(__DIR__ . "/helper.php"); + +require_once(__DIR__ . '/../../../init.php'); +require_once(__DIR__ . "/../../../server/includes/core/class.webappauthentication.php"); // for checking the session + +use calendarimporter\Helper; /* disable error printing - otherwise json communication might break... */ ini_set('display_errors', '0'); -/** - * respond/echo JSON - * @param $arr - */ -function respondJSON($arr) -{ - echo json_encode($arr); +// check session +// otherwise a DOS attack might be possible +if (!WebAppAuthentication::getUserName() || WebAppAuthentication::getUserName() == ""){ + Helper::respondJSON(array('success' => false, 'error' => dgettext("plugin_calendarimporter", "Not authenticated!"))); + die(); } -/** - * Generates a random string with variable length. - * @param $length the lenght of the generated string - * @return string a random string - */ -function randomstring($length = 6) -{ - // $chars - all allowed charakters - $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; +if (isset($_FILES['icsdata']['tmp_name']) && is_readable($_FILES['icsdata']['tmp_name'])) { + $destpath = PLUGIN_CALENDARIMPORTER_TMP_UPLOAD; + $destpath .= $_FILES['icsdata']['name'] . Helper::randomstring(); - srand((double)microtime() * 1000000); - $i = 0; - $pass = ""; - while ($i < $length) { - $num = rand() % strlen($chars); - $tmp = substr($chars, $num, 1); - $pass = $pass . $tmp; - $i++; - } - return $pass; -} - -$destpath = PLUGIN_CALENDARIMPORTER_TMP_UPLOAD; -$destpath .= $_FILES['icsdata']['name'] . randomstring(); - -if (is_readable($_FILES['icsdata']['tmp_name'])) { $result = move_uploaded_file($_FILES['icsdata']['tmp_name'], $destpath); if ($result) { - respondJSON(array('success' => true, 'ics_file' => $destpath)); + Helper::respondJSON(array('success' => true, 'ics_file' => $destpath)); } else { - respondJSON(array('success' => false, 'error' => dgettext("plugin_calendarimporter", "File could not be moved to TMP path! Check plugin config and folder permissions!"))); + Helper::respondJSON(array('success' => false, 'error' => dgettext("plugin_calendarimporter", "File could not be moved to TMP path! Check plugin config and folder permissions!"))); } } else { - respondJSON(array('success' => false, 'error' => dgettext("plugin_calendarimporter", "File could not be read by server, upload error!"))); + Helper::respondJSON(array('success' => false, 'error' => dgettext("plugin_calendarimporter", "File could not be read by server, upload error!"))); } \ No newline at end of file From 64fa5e3cbde9c85abb3a9eb23a912102ea8d4338 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 30 Nov 2016 11:13:03 +0100 Subject: [PATCH 2/8] Made download.php compatible to gentoo php --- .idea/workspace.xml | 68 ++++++++++++++++++++++++++------------------- php/download.php | 5 +++- 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index e8fa7f4..1c9cffb 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,7 @@ - - - + @@ -25,18 +23,6 @@ - - - - - - - - - - - - @@ -51,6 +37,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -84,7 +94,6 @@ @@ -270,12 +280,12 @@ \ No newline at end of file diff --git a/php/module.calendar.php b/php/module.calendar.php index 7a4e3cc..80da133 100644 --- a/php/module.calendar.php +++ b/php/module.calendar.php @@ -21,20 +21,22 @@ * */ -include_once('vendor/autoload.php'); +include_once(__DIR__ . "/vendor/autoload.php"); +include_once(__DIR__ . "/helper.php"); use Sabre\VObject; +use calendarimporter\Helper; class CalendarModule extends Module { private $DEBUG = false; // enable error_log debugging - private $busystates = null; + private $busyStates = null; private $labels = null; - private $attendeetype = null; + private $attendeeType = null; /** * @constructor @@ -49,7 +51,7 @@ class CalendarModule extends Module date_default_timezone_set(PLUGIN_CALENDARIMPORTER_DEFAULT_TIMEZONE); // init mappings - $this->busystates = array( + $this->busyStates = array( "FREE", "TENTATIVE", "BUSY", @@ -70,7 +72,7 @@ class CalendarModule extends Module "PHONE INTERVIEW" ); - $this->attendeetype = array( + $this->attendeeType = array( "NON-PARTICIPANT", // needed as zarafa starts counting at 1 "REQ-PARTICIPANT", "OPT-PARTICIPANT", @@ -81,6 +83,7 @@ class CalendarModule extends Module /** * 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() @@ -130,58 +133,44 @@ class CalendarModule extends Module return $result; } - /** - * Generates a random string with variable length. - * @param $length the lenght of the generated string - * @return string a random string - */ - private function randomstring($length = 6) - { - // $chars - all allowed charakters - $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; - - srand((double)microtime() * 1000000); - $i = 0; - $pass = ""; - while ($i < $length) { - $num = rand() % strlen($chars); - $tmp = substr($chars, $num, 1); - $pass = $pass . $tmp; - $i++; - } - return $pass; - } - /** * Get a property from the array. + * * @param $props - * @param $propname + * @param $propName * @return string */ - private function getProp($props, $propname) + private function getProp($props, $propName) { - if (isset($props["props"][$propname])) { - return $props["props"][$propname]; + if (isset($props["props"][$propName])) { + return $props["props"][$propName]; } return ""; } - private function getDurationStringFromMintues($minutes, $pos = false) + /** + * Get a duration string form given minutes + * + * @param $minutes + * @param bool $pos + * @return string + */ + private function getDurationStringFromMinutes($minutes, $pos = false) { $pos = $pos === true ? "+" : "-"; $str = $pos . "P"; // variables for holding values - $mins = intval($minutes); + $min = intval($minutes); $hours = 0; $days = 0; $weeks = 0; // calculations - if ($mins >= 60) { - $hours = (int)($mins / 60); - $mins = $mins % 60; + if ($min >= 60) { + $hours = (int)($min / 60); + $min = $min % 60; } if ($hours >= 24) { $days = (int)($hours / 24); @@ -202,8 +191,8 @@ class CalendarModule extends Module if ($hours) { $str .= "{$hours}H"; } - if ($mins) { - $str .= "{$mins}M"; + if ($min) { + $str .= "{$min}M"; } return $str; @@ -211,15 +200,16 @@ class CalendarModule extends Module /** * The main export function, creates the ics file for download + * * @param $actionType * @param $actionData */ private function exportCalendar($actionType, $actionData) { // Get store id - $storeid = false; + $storeId = false; if (isset($actionData["storeid"])) { - $storeid = $actionData["storeid"]; + $storeId = $actionData["storeid"]; } // Get records @@ -239,17 +229,17 @@ class CalendarModule extends Module $error_msg = ""; // write csv - $token = $this->randomstring(16); + $token = Helper::randomstring(16); $file = PLUGIN_CALENDARIMPORTER_TMP_UPLOAD . "ics_" . $token . ".ics"; file_put_contents($file, ""); - $store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeid)); + $store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeId)); if ($store) { // load folder first if ($folder !== false) { - $mapifolder = mapi_msgstore_openentry($store, hex2bin($folder)); + $mapiFolder = mapi_msgstore_openentry($store, hex2bin($folder)); - $table = mapi_folder_getcontentstable($mapifolder); + $table = mapi_folder_getcontentstable($mapiFolder); $list = mapi_table_queryallrows($table, array(PR_ENTRYID)); foreach ($list as $item) { @@ -257,12 +247,12 @@ class CalendarModule extends Module } } - $vcalendar = new VObject\Component\VCalendar(); + $vCalendar = new VObject\Component\VCalendar(); - // Add static stuff to vcalendar - $vcalendar->add('METHOD', 'PUBLISH'); - $vcalendar->add('X-WR-CALDESC', 'Exported Zarafa Calendar'); - $vcalendar->add('X-WR-TIMEZONE', date_default_timezone_get()); + // Add static stuff to vCalendar + $vCalendar->add('METHOD', 'PUBLISH'); + $vCalendar->add('X-WR-CALDESC', 'Exported Kopano Calendar'); + $vCalendar->add('X-WR-TIMEZONE', date_default_timezone_get()); // TODO: add VTIMEZONE object to ical. @@ -274,43 +264,43 @@ class CalendarModule extends Module $plaintext = true; $messageProps = $GLOBALS['operations']->getMessageProps($store, $message, $properties, $plaintext); - $vevent = $vcalendar->add('VEVENT', [ + $vEvent = $vCalendar->add('VEVENT', [ 'SUMMARY' => $this->getProp($messageProps, "subject"), 'DTSTART' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "startdate")), 'DTEND' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "duedate")), 'CREATED' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "creation_time")), 'LAST-MODIFIED' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "last_modification_time")), 'PRIORITY' => $this->getProp($messageProps, "importance"), - 'X-MICROSOFT-CDO-INTENDEDSTATUS' => $this->busystates[intval($this->getProp($messageProps, "busystatus"))], // both seem to be valid... - 'X-MICROSOFT-CDO-BUSYSTATUS' => $this->busystates[intval($this->getProp($messageProps, "busystatus"))], // both seem to be valid... + 'X-MICROSOFT-CDO-INTENDEDSTATUS' => $this->busyStates[intval($this->getProp($messageProps, "busystatus"))], // both seem to be valid... + 'X-MICROSOFT-CDO-BUSYSTATUS' => $this->busyStates[intval($this->getProp($messageProps, "busystatus"))], // both seem to be valid... 'X-ZARAFA-LABEL' => $this->labels[intval($this->getProp($messageProps, "label"))], 'CLASS' => $this->getProp($messageProps, "private") ? "PRIVATE" : "PUBLIC", 'COMMENT' => "eid:" . $records[$index] ]); // Add organizer - $vevent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address")); - $vevent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name"); + $vEvent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address")); + $vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name"); // Add Attendees if (isset($messageProps["recipients"]) && count($messageProps["recipients"]["item"]) > 0) { foreach ($messageProps["recipients"]["item"] as $attendee) { - $att = $vevent->add('ATTENDEE', "mailto:" . $this->getProp($attendee, "email_address")); + $att = $vEvent->add('ATTENDEE', "mailto:" . $this->getProp($attendee, "email_address")); $att["CN"] = $this->getProp($attendee, "display_name"); - $att["ROLE"] = $this->attendeetype[intval($this->getProp($attendee, "recipient_type"))]; + $att["ROLE"] = $this->attendeeType[intval($this->getProp($attendee, "recipient_type"))]; } } // Add alarms if (!empty($this->getProp($messageProps, "reminder")) && $this->getProp($messageProps, "reminder") == 1) { - $valarm = $vevent->add('VALARM', [ + $vAlarm = $vEvent->add('VALARM', [ 'ACTION' => 'DISPLAY', 'DESCRIPTION' => $this->getProp($messageProps, "subject") // reuse the event summary ]); // Add trigger - $durationValue = $this->getDurationStringFromMintues($this->getProp($messageProps, "reminder_minutes"), false); - $valarm->add('TRIGGER', $durationValue); // default trigger type is duration (see 4.8.6.3) + $durationValue = $this->getDurationStringFromMinutes($this->getProp($messageProps, "reminder_minutes"), false); + $vAlarm->add('TRIGGER', $durationValue); // default trigger type is duration (see 4.8.6.3) /* $valarm->add('TRIGGER', date_timestamp_set(new DateTime(), $this->getProp($messageProps, "reminder_time"))); // trigger type "DATE-TIME" @@ -320,18 +310,18 @@ class CalendarModule extends Module // Add location if (!empty($this->getProp($messageProps, "location"))) { - $vevent->add('LOCATION', $this->getProp($messageProps, "location")); + $vEvent->add('LOCATION', $this->getProp($messageProps, "location")); } // Add description $body = $this->getProp($messageProps, "isHTML") ? $this->getProp($messageProps, "html_body") : $this->getProp($messageProps, "body"); if (!empty($body)) { - $vevent->add('DESCRIPTION', $body); + $vEvent->add('DESCRIPTION', $body); } } // write combined ics file - file_put_contents($file, file_get_contents($file) . $vcalendar->serialize()); + file_put_contents($file, file_get_contents($file) . $vCalendar->serialize()); } if (count($records) > 0) { @@ -356,9 +346,9 @@ class CalendarModule extends Module private function importCalendar($actionType, $actionData) { // Get uploaded vcf path - $icsfile = false; + $icsFile = false; if (isset($actionData["ics_filepath"])) { - $icsfile = $actionData["ics_filepath"]; + $icsFile = $actionData["ics_filepath"]; } // Get store id @@ -368,9 +358,9 @@ class CalendarModule extends Module } // Get folder entryid - $folderid = false; + $folderId = false; if (isset($actionData["folderid"])) { - $folderid = $actionData["folderid"]; + $folderId = $actionData["folderid"]; } // Get uids @@ -387,7 +377,7 @@ class CalendarModule extends Module $parser = null; try { $parser = VObject\Reader::read( - fopen($icsfile, 'r') + fopen($icsFile, 'r') ); } catch (Exception $e) { $error = true; @@ -398,11 +388,11 @@ class CalendarModule extends Module if (count($parser->VEVENT) > 0) { $events = $this->parseCalendarToArray($parser); $store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeid)); - $folder = mapi_msgstore_openentry($store, hex2bin($folderid)); + $folder = mapi_msgstore_openentry($store, hex2bin($folderId)); - $importall = false; + $importAll = false; if (count($uids) == count($events)) { - $importall = true; + $importAll = true; } $propValuesMAPI = array(); @@ -414,7 +404,7 @@ class CalendarModule extends Module // iterate through all events and import them :) foreach ($events as $event) { - if (isset($event["startdate"]) && ($importall || in_array($event["internal_fields"]["event_uid"], $uids))) { + if (isset($event["startdate"]) && ($importAll || in_array($event["internal_fields"]["event_uid"], $uids))) { $message = mapi_folder_createmessage($folder); @@ -469,15 +459,15 @@ class CalendarModule extends Module private function getAttachmentPath($actionType, $actionData) { // Get store id - $storeid = false; + $storeId = false; if (isset($actionData["store"])) { - $storeid = $actionData["store"]; + $storeId = $actionData["store"]; } // Get message entryid - $entryid = false; + $entryId = false; if (isset($actionData["entryid"])) { - $entryid = $actionData["entryid"]; + $entryId = $actionData["entryid"]; } // Check which type isset @@ -490,13 +480,13 @@ class CalendarModule extends Module } // Check if storeid and entryid isset - if ($storeid && $entryid) { + if ($storeId && $entryId) { // Open the store - $store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeid)); + $store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeId)); if ($store) { // Open the message - $message = mapi_msgstore_openentry($store, hex2bin($entryid)); + $message = mapi_msgstore_openentry($store, hex2bin($entryId)); if ($message) { $attachment = false; @@ -506,10 +496,10 @@ class CalendarModule extends Module // Loop through the attachNums, message in message in message ... for ($i = 0; $i < (count($attachNum) - 1); $i++) { // Open the attachment - $tempattach = mapi_message_openattach($message, (int)$attachNum[$i]); - if ($tempattach) { + $tempAttach = mapi_message_openattach($message, (int)$attachNum[$i]); + if ($tempAttach) { // Open the object in the attachment - $message = mapi_attach_openobj($tempattach); + $message = mapi_attach_openobj($tempAttach); } } @@ -553,7 +543,7 @@ class CalendarModule extends Module $ext_found = false; while (!feof($fh) && !$ext_found) { $line = fgets($fh); - preg_match("/(\.[a-z0-9]+)[ \t]+([^ \t\n\r]*)/i", $line, $result); + preg_match('/(\.[a-z0-9]+)[ \t]+([^ \t\n\r]*)/i', $line, $result); if ($extension == $result[1]) { $ext_found = true; $contentType = $result[2]; @@ -565,25 +555,26 @@ class CalendarModule extends Module } - $tmpname = tempnam(TMP_PATH, stripslashes($filename)); + $tmpName = tempnam(TMP_PATH, stripslashes($filename)); // Open a stream to get the attachment data $stream = mapi_openpropertytostream($attachment, PR_ATTACH_DATA_BIN); $stat = mapi_stream_stat($stream); // File length = $stat["cb"] - $fhandle = fopen($tmpname, 'w'); + $fHandle = fopen($tmpName, 'w'); $buffer = null; for ($i = 0; $i < $stat["cb"]; $i += BLOCK_SIZE) { // Write stream $buffer = mapi_stream_read($stream, BLOCK_SIZE); - fwrite($fhandle, $buffer, strlen($buffer)); + fwrite($fHandle, $buffer, strlen($buffer)); } - fclose($fhandle); + fclose($fHandle); $response = array(); - $response['tmpname'] = $tmpname; + $response['tmpname'] = $tmpName; $response['filename'] = $filename; + $response['contenttype'] = $contentType; $response['status'] = true; $this->addActionData($actionType, $response); $GLOBALS["bus"]->addData($this->getResponseData()); @@ -611,7 +602,7 @@ class CalendarModule extends Module private function loadCalendar($actionType, $actionData) { $error = false; - $error_msg = ""; + $errorMsg = ""; if (is_readable($actionData["ics_filepath"])) { $parser = null; @@ -623,11 +614,11 @@ class CalendarModule extends Module //error_log(print_r($parser->VTIMEZONE, true)); } catch (Exception $e) { $error = true; - $error_msg = $e->getMessage(); + $errorMsg = $e->getMessage(); } if ($error) { $response['status'] = false; - $response['message'] = $error_msg; + $response['message'] = $errorMsg; } else { if (count($parser->VEVENT) == 0) { $response['status'] = false; @@ -681,7 +672,7 @@ class CalendarModule extends Module $properties["comment"] = (string)$vEvent->COMMENT; $properties["timezone"] = (string)$vEvent->DTSTART["TZID"]; $properties["organizer"] = (string)$vEvent->ORGANIZER; - $properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'}, $this->busystates); // X-MICROSOFT-CDO-BUSYSTATUS + $properties["busystatus"] = array_search((string)$vEvent->{'X-MICROSOFT-CDO-INTENDEDSTATUS'}, $this->busyStates); // X-MICROSOFT-CDO-BUSYSTATUS $properties["transp"] = (string)$vEvent->TRANSP; //$properties["trigger"] = (string)$vEvent->COMMENT; $properties["priority"] = (string)$vEvent->PRIORITY; From b3439ca57ab2b5dc094c65c9b4e05958ea8143c2 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Wed, 30 Nov 2016 11:58:16 +0100 Subject: [PATCH 5/8] Email attachment import icon fixed --- .idea/workspace.xml | 82 +++++++++++++++++------- resources/css/calendarimporter-main.css | 2 +- resources/images/import_icon.png | Bin 3100 -> 592 bytes resources/images/import_icon.xcf | Bin 11213 -> 10547 bytes 4 files changed, 60 insertions(+), 24 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b33c3be..87427e4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,9 +2,7 @@ - - - + @@ -37,15 +35,12 @@ - - + + - - - - - - + + + @@ -94,6 +89,7 @@ @@ -157,6 +153,38 @@ \ No newline at end of file diff --git a/resources/css/calendarimporter-main.css b/resources/css/calendarimporter-main.css index d101e01..f4e3106 100644 --- a/resources/css/calendarimporter-main.css +++ b/resources/css/calendarimporter-main.css @@ -1,5 +1,5 @@ .icon_calendarimporter_button { - background: url(../images/import_icon.png) no-repeat !important; + background: url(../images/import_icon.png) no-repeat; background-repeat: no-repeat; background-position: center; } diff --git a/resources/images/import_icon.png b/resources/images/import_icon.png index 6bcfdc90bd8ed2472f2931767374c513e68be6f7..0f675e0db6b2b3e60a38ae53e072dcbd053c01cc 100644 GIT binary patch delta 557 zcmV+|0@D4Q7|;YEiBL{Q4GJ0x0000DNk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 +++++++++++++++++++++++----------- js/data/Actions.js | 53 +++++++++++ js/plugin.calendarimporter.js | 21 +---- js/ui/ContextMenu.js | 20 +---- 4 files changed, 165 insertions(+), 90 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 87427e4..f5086ad 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,7 +2,9 @@ - + + + @@ -23,23 +25,44 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + - + + - - + + - - + + @@ -69,7 +92,6 @@ @@ -213,6 +236,42 @@ \ No newline at end of file diff --git a/js/dialogs/ImportPanel.js b/js/dialogs/ImportPanel.js index bda38c6..14e6060 100644 --- a/js/dialogs/ImportPanel.js +++ b/js/dialogs/ImportPanel.js @@ -432,7 +432,7 @@ Zarafa.plugins.calendarimporter.dialogs.ImportPanel = Ext.extend(Ext.Panel, { this.submitAllButton.disable(); Zarafa.common.dialogs.MessageBox.show({ title: _('Error'), - msg: _(action.result.error), + msg: action.result.error, icon: Zarafa.common.dialogs.MessageBox.ERROR, buttons: Zarafa.common.dialogs.MessageBox.OK });