Merge branch 'bugfix' into 'master'

Bugfix

See merge request !3
This commit is contained in:
Christoph Haas 2016-11-30 13:34:12 +01:00
commit 36308c8196
13 changed files with 424 additions and 307 deletions

View File

@ -0,0 +1,17 @@
<component name="ProjectDictionaryState">
<dictionary name="osboxes">
<words>
<w>caldesc</w>
<w>calendarimporter</w>
<w>filepath</w>
<w>ical</w>
<w>importattachment</w>
<w>kopano</w>
<w>mapi</w>
<w>mapisession</w>
<w>storeid</w>
<w>uids</w>
<w>vtimezone</w>
</words>
</dictionary>
</component>

View File

@ -2,31 +2,8 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e7c9c2bb-66f1-4e37-904c-d33d8c113bde" name="Default" comment=""> <list default="true" id="e7c9c2bb-66f1-4e37-904c-d33d8c113bde" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/backend/.htaccess" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Makefile" afterPath="$PROJECT_DIR$/Makefile" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/build.xml" afterPath="$PROJECT_DIR$/build.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/changelog.txt" afterPath="$PROJECT_DIR$/changelog.txt" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/config.php" afterPath="$PROJECT_DIR$/config.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/ABOUT.js" afterPath="$PROJECT_DIR$/js/ABOUT.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/data/Actions.js" afterPath="$PROJECT_DIR$/js/data/Actions.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/data/ResponseHandler.js" afterPath="$PROJECT_DIR$/js/data/ResponseHandler.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/data/timezones.js" afterPath="$PROJECT_DIR$/js/data/timezones.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/dialogs/ImportContentPanel.js" afterPath="$PROJECT_DIR$/js/dialogs/ImportContentPanel.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/dialogs/ImportPanel.js" afterPath="$PROJECT_DIR$/js/dialogs/ImportPanel.js" /> <change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/dialogs/ImportPanel.js" afterPath="$PROJECT_DIR$/js/dialogs/ImportPanel.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/plugin.calendarimporter.js" afterPath="$PROJECT_DIR$/js/plugin.calendarimporter.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/settings/SettingsCalSyncWidget.js" afterPath="$PROJECT_DIR$/js/settings/SettingsCalSyncWidget.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/settings/SettingsWidget.js" afterPath="$PROJECT_DIR$/js/settings/SettingsWidget.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditContentPanel.js" afterPath="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditContentPanel.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditPanel.js" afterPath="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditPanel.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/settings/ui/CalSyncGrid.js" afterPath="$PROJECT_DIR$/js/settings/ui/CalSyncGrid.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/settings/ui/CalSyncPanel.js" afterPath="$PROJECT_DIR$/js/settings/ui/CalSyncPanel.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/ui/ContextMenu.js" afterPath="$PROJECT_DIR$/js/ui/ContextMenu.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/manifest.xml" afterPath="$PROJECT_DIR$/manifest.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/download.php" afterPath="$PROJECT_DIR$/php/download.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/module.calendar.php" afterPath="$PROJECT_DIR$/php/module.calendar.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/plugin.calendarimporter.php" afterPath="$PROJECT_DIR$/php/plugin.calendarimporter.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/upload.php" afterPath="$PROJECT_DIR$/php/upload.php" />
</list> </list>
<ignored path="calendarimporter.iws" /> <ignored path="calendarimporter.iws" />
<ignored path=".idea/workspace.xml" /> <ignored path=".idea/workspace.xml" />
@ -47,22 +24,24 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="ContextMenu.js" pinned="false" current-in-tab="false"> <file leaf-file-name="plugin.calendarimporter.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/ui/ContextMenu.js"> <entry file="file://$PROJECT_DIR$/js/plugin.calendarimporter.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504"> <state relative-caret-position="610">
<caret line="101" column="8" selection-start-line="101" selection-start-column="8" selection-end-line="104" selection-end-column="0" /> <caret line="91" column="27" selection-start-line="91" selection-start-column="27" selection-end-line="91" selection-end-column="27" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="plugin.calendarimporter.js" pinned="false" current-in-tab="false"> <file leaf-file-name="upload.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/plugin.calendarimporter.js"> <entry file="file://$PROJECT_DIR$/php/upload.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="729"> <state relative-caret-position="408">
<caret line="320" column="54" selection-start-line="320" selection-start-column="31" selection-end-line="320" selection-end-column="54" /> <caret line="34" column="0" selection-start-line="34" selection-start-column="0" selection-end-line="39" selection-end-column="1" />
<folding /> <folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -70,47 +49,46 @@
<file leaf-file-name="module.calendar.php" pinned="false" current-in-tab="false"> <file leaf-file-name="module.calendar.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/php/module.calendar.php"> <entry file="file://$PROJECT_DIR$/php/module.calendar.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="301"> <state relative-caret-position="260">
<caret line="329" column="17" selection-start-line="329" selection-start-column="17" selection-end-line="329" selection-end-column="17" /> <caret line="231" column="30" selection-start-line="231" selection-start-column="25" selection-end-line="231" selection-end-column="30" />
<folding> <folding>
<element signature="e#6#914#0#PHP" expanded="true" /> <element signature="e#6#914#0#PHP" expanded="true" />
<element signature="n#__construct#0;n#CalendarModule#0;n#!!top" expanded="false" /> <element signature="e#1004#1022#0#PHP" expanded="true" />
<element signature="n#execute#0;n#CalendarModule#0;n#!!top" expanded="false" />
<element signature="n#randomstring#0;n#CalendarModule#0;n#!!top" expanded="false" />
<element signature="n#getDurationStringFromMintues#0;n#CalendarModule#0;n#!!top" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="Makefile" pinned="false" current-in-tab="false"> <file leaf-file-name="Actions.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Makefile"> <entry file="file://$PROJECT_DIR$/js/data/Actions.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15"> <state relative-caret-position="268">
<caret line="1" column="92" selection-start-line="1" selection-start-column="92" selection-end-line="1" selection-end-column="92" /> <caret line="173" column="35" selection-start-line="173" selection-start-column="35" selection-end-line="173" selection-end-column="80" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="download.php" pinned="false" current-in-tab="false"> <file leaf-file-name="ImportPanel.js" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/php/download.php"> <entry file="file://$PROJECT_DIR$/js/dialogs/ImportPanel.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144"> <state relative-caret-position="583">
<caret line="28" column="35" selection-start-line="28" selection-start-column="35" selection-end-line="28" selection-end-column="35" /> <caret line="113" column="29" selection-start-line="113" selection-start-column="21" selection-end-line="113" selection-end-column="29" />
<folding> <folding>
<element signature="e#7#908#0#PHP" expanded="true" /> <element signature="n#!!doc" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="manifest.xml" pinned="false" current-in-tab="true"> <file leaf-file-name="helper.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/manifest.xml"> <entry file="file://$PROJECT_DIR$/php/helper.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135"> <state relative-caret-position="407">
<caret line="9" column="62" selection-start-line="9" selection-start-column="62" selection-end-line="9" selection-end-column="62" /> <caret line="41" column="15" selection-start-line="41" selection-start-column="15" selection-end-line="41" selection-end-column="15" />
<folding /> <folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -136,27 +114,30 @@
<option value="$PROJECT_DIR$/changelog.txt" /> <option value="$PROJECT_DIR$/changelog.txt" />
<option value="$PROJECT_DIR$/Makefile" /> <option value="$PROJECT_DIR$/Makefile" />
<option value="$PROJECT_DIR$/manifest.xml" /> <option value="$PROJECT_DIR$/manifest.xml" />
<option value="$PROJECT_DIR$/php/upload.php" />
<option value="$PROJECT_DIR$/php/download.php" />
<option value="$PROJECT_DIR$/php/plugin.calendarimporter.php" /> <option value="$PROJECT_DIR$/php/plugin.calendarimporter.php" />
<option value="$PROJECT_DIR$/build.xml" /> <option value="$PROJECT_DIR$/build.xml" />
<option value="$PROJECT_DIR$/js/ABOUT.js" /> <option value="$PROJECT_DIR$/js/ABOUT.js" />
<option value="$PROJECT_DIR$/js/ui/ContextMenu.js" />
<option value="$PROJECT_DIR$/js/settings/SettingsWidget.js" /> <option value="$PROJECT_DIR$/js/settings/SettingsWidget.js" />
<option value="$PROJECT_DIR$/js/settings/SettingsCalSyncWidget.js" /> <option value="$PROJECT_DIR$/js/settings/SettingsCalSyncWidget.js" />
<option value="$PROJECT_DIR$/js/settings/ui/CalSyncGrid.js" /> <option value="$PROJECT_DIR$/js/settings/ui/CalSyncGrid.js" />
<option value="$PROJECT_DIR$/js/settings/ui/CalSyncPanel.js" /> <option value="$PROJECT_DIR$/js/settings/ui/CalSyncPanel.js" />
<option value="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditPanel.js" /> <option value="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditPanel.js" />
<option value="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditContentPanel.js" /> <option value="$PROJECT_DIR$/js/settings/dialogs/CalSyncEditContentPanel.js" />
<option value="$PROJECT_DIR$/js/dialogs/ImportPanel.js" />
<option value="$PROJECT_DIR$/js/dialogs/ImportContentPanel.js" /> <option value="$PROJECT_DIR$/js/dialogs/ImportContentPanel.js" />
<option value="$PROJECT_DIR$/js/data/ResponseHandler.js" /> <option value="$PROJECT_DIR$/js/data/ResponseHandler.js" />
<option value="$PROJECT_DIR$/js/data/Actions.js" />
<option value="$PROJECT_DIR$/js/data/timezones.js" /> <option value="$PROJECT_DIR$/js/data/timezones.js" />
<option value="$PROJECT_DIR$/backend/.htaccess" /> <option value="$PROJECT_DIR$/backend/.htaccess" />
<option value="$PROJECT_DIR$/config.php" /> <option value="$PROJECT_DIR$/config.php" />
<option value="$PROJECT_DIR$/js/plugin.calendarimporter.js" /> <option value="$PROJECT_DIR$/php/Helper.php" />
<option value="$PROJECT_DIR$/php/helper.php" />
<option value="$PROJECT_DIR$/php/download.php" />
<option value="$PROJECT_DIR$/php/upload.php" />
<option value="$PROJECT_DIR$/php/module.calendar.php" /> <option value="$PROJECT_DIR$/php/module.calendar.php" />
<option value="$PROJECT_DIR$/resources/css/calendarimporter-main.css" />
<option value="$PROJECT_DIR$/js/plugin.calendarimporter.js" />
<option value="$PROJECT_DIR$/js/ui/ContextMenu.js" />
<option value="$PROJECT_DIR$/js/data/Actions.js" />
<option value="$PROJECT_DIR$/js/dialogs/ImportPanel.js" />
</list> </list>
</option> </option>
</component> </component>
@ -171,10 +152,10 @@
</component> </component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" /> <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="x" value="65" /> <option name="x" value="145" />
<option name="y" value="24" /> <option name="y" value="602" />
<option name="width" value="1792" /> <option name="width" value="1782" />
<option name="height" value="999" /> <option name="height" value="941" />
</component> </component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false"> <component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" /> <OptionsSetting value="true" id="Add" />
@ -202,6 +183,7 @@
</navigator> </navigator>
<panes> <panes>
<pane id="Scratches" /> <pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<PATH> <PATH>
@ -220,6 +202,38 @@
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" /> <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="resources" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="resources" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="css" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" /> <option name="myItemId" value="calendarimporter" />
@ -266,6 +280,24 @@
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" /> <option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT> </PATH_ELEMENT>
</PATH> </PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" />
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="js" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="dialogs" />
<option name="myItemType" value="com.jetbrains.php.projectView.PhpTreeStructureProvider$1" />
</PATH_ELEMENT>
</PATH>
<PATH> <PATH>
<PATH_ELEMENT> <PATH_ELEMENT>
<option name="myItemId" value="calendarimporter" /> <option name="myItemId" value="calendarimporter" />
@ -286,11 +318,10 @@
</PATH> </PATH>
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$" /> <property name="last_opened_file_path" value="$PROJECT_DIR$/../contactimporter" />
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="js-jscs-nodeInterpreter" value="/usr/bin/node" /> <property name="js-jscs-nodeInterpreter" value="/usr/bin/node" />
</component> </component>
@ -356,22 +387,22 @@
<option name="presentableId" value="Default" /> <option name="presentableId" value="Default" />
<updated>1477949602474</updated> <updated>1477949602474</updated>
<workItem from="1477949603566" duration="9204000" /> <workItem from="1477949603566" duration="9204000" />
<workItem from="1480441197414" duration="4152000" /> <workItem from="1480441197414" duration="11151000" />
<workItem from="1480505014387" duration="3401000" />
</task> </task>
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="13356000" /> <option name="totallyTimeSpent" value="23756000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="65" y="24" width="1792" height="999" extended-state="6" /> <frame x="145" y="602" width="1782" height="941" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" /> <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.2514029" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" /> <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" /> <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32900432" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32900432" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32900432" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" /> <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
@ -382,6 +413,7 @@
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" /> <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" /> <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" /> <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32900432" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" /> <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" /> <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout> </layout>
@ -404,6 +436,30 @@
<watches-manager /> <watches-manager />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/js/plugin.calendarimporter.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/ui/ContextMenu.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1440">
<caret line="96" column="123" selection-start-line="96" selection-start-column="123" selection-end-line="96" selection-end-column="123" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/data/Actions.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675">
<caret line="65" column="47" selection-start-line="65" selection-start-column="47" selection-end-line="65" selection-end-column="47" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/settings/dialogs/CalSyncEditPanel.js"> <entry file="file://$PROJECT_DIR$/js/settings/dialogs/CalSyncEditPanel.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1515"> <state relative-caret-position="1515">
@ -424,7 +480,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1560"> <state relative-caret-position="1560">
<caret line="104" column="16" selection-start-line="104" selection-start-column="16" selection-end-line="104" selection-end-column="142" /> <caret line="104" column="16" selection-start-line="104" selection-start-column="16" selection-end-line="104" selection-end-column="142" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -433,7 +488,7 @@
<state relative-caret-position="60"> <state relative-caret-position="60">
<caret line="24" column="47" selection-start-line="24" selection-start-column="47" selection-end-line="24" selection-end-column="47" /> <caret line="24" column="47" selection-start-line="24" selection-start-column="47" selection-end-line="24" selection-end-column="47" />
<folding> <folding>
<element signature="e#21#926#0#PHP" expanded="true" /> <element signature="e#21#926#0#PHP" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -442,7 +497,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -458,7 +512,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75"> <state relative-caret-position="75">
<caret line="5" column="26" selection-start-line="5" selection-start-column="26" selection-end-line="5" selection-end-column="26" /> <caret line="5" column="26" selection-start-line="5" selection-start-column="26" selection-end-line="5" selection-end-column="26" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -466,7 +519,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -474,7 +526,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -482,7 +533,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="63" selection-start-line="0" selection-start-column="63" selection-end-line="0" selection-end-column="63" /> <caret line="0" column="63" selection-start-line="0" selection-start-column="63" selection-end-line="0" selection-end-column="63" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -498,7 +548,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75"> <state relative-caret-position="75">
<caret line="5" column="26" selection-start-line="5" selection-start-column="26" selection-end-line="5" selection-end-column="26" /> <caret line="5" column="26" selection-start-line="5" selection-start-column="26" selection-end-line="5" selection-end-column="26" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -506,7 +555,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -515,7 +563,7 @@
<state relative-caret-position="60"> <state relative-caret-position="60">
<caret line="24" column="47" selection-start-line="24" selection-start-column="47" selection-end-line="24" selection-end-column="47" /> <caret line="24" column="47" selection-start-line="24" selection-start-column="47" selection-end-line="24" selection-end-column="47" />
<folding> <folding>
<element signature="e#21#926#0#PHP" expanded="true" /> <element signature="e#21#926#0#PHP" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -524,7 +572,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30"> <state relative-caret-position="30">
<caret line="2" column="30" selection-start-line="2" selection-start-column="30" selection-end-line="2" selection-end-column="30" /> <caret line="2" column="30" selection-start-line="2" selection-start-column="30" selection-end-line="2" selection-end-column="30" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -553,7 +600,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="945"> <state relative-caret-position="945">
<caret line="63" column="55" selection-start-line="63" selection-start-column="55" selection-end-line="63" selection-end-column="55" /> <caret line="63" column="55" selection-start-line="63" selection-start-column="55" selection-end-line="63" selection-end-column="55" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -569,7 +615,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="744"> <state relative-caret-position="744">
<caret line="65" column="17" selection-start-line="65" selection-start-column="17" selection-end-line="65" selection-end-column="17" /> <caret line="65" column="17" selection-start-line="65" selection-start-column="17" selection-end-line="65" selection-end-column="17" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -585,7 +630,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="624"> <state relative-caret-position="624">
<caret line="48" column="55" selection-start-line="48" selection-start-column="55" selection-end-line="48" selection-end-column="55" /> <caret line="48" column="55" selection-start-line="48" selection-start-column="55" selection-end-line="48" selection-end-column="55" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -593,7 +637,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -609,19 +652,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="774"> <state relative-caret-position="774">
<caret line="63" column="2" selection-start-line="63" selection-start-column="2" selection-end-line="63" selection-end-column="2" /> <caret line="63" column="2" selection-start-line="63" selection-start-column="2" selection-end-line="63" selection-end-column="2" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/dialogs/ImportPanel.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -637,9 +667,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-9350"> <state relative-caret-position="-9350">
<caret line="90" column="87" selection-start-line="90" selection-start-column="87" selection-end-line="90" selection-end-column="87" /> <caret line="90" column="87" selection-start-line="90" selection-start-column="87" selection-end-line="90" selection-end-column="87" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -647,7 +674,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -655,7 +681,6 @@
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0"> <state relative-caret-position="0">
<caret line="0" column="13" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" /> <caret line="0" column="13" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" />
<folding />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -664,7 +689,6 @@
<state split_layout="SPLIT"> <state split_layout="SPLIT">
<first_editor relative-caret-position="0"> <first_editor relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</first_editor> </first_editor>
<second_editor /> <second_editor />
</state> </state>
@ -678,87 +702,110 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/php/plugin.calendarimporter.php"> <entry file="file://$PROJECT_DIR$/Makefile">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-90"> <state relative-caret-position="15">
<caret line="36" column="5" selection-start-line="36" selection-start-column="5" selection-end-line="36" selection-end-column="5" /> <caret line="1" column="92" selection-start-line="1" selection-start-column="92" selection-end-line="1" selection-end-column="92" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/manifest.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" column="30" selection-start-line="5" selection-start-column="14" selection-end-line="5" selection-end-column="30" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/php/upload.php"> <entry file="file://$PROJECT_DIR$/php/plugin.calendarimporter.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-314"> <state relative-caret-position="-165">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" /> <caret line="13" column="25" selection-start-line="13" selection-start-column="22" selection-end-line="13" selection-end-column="25" />
<folding> <folding />
<element signature="e#6#905#0#PHP" expanded="true" /> </state>
</folding> </provider>
</entry>
<entry file="file://$PROJECT_DIR$/resources/css/calendarimporter-main.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="180">
<caret line="12" column="31" selection-start-line="12" selection-start-column="31" selection-end-line="12" selection-end-column="31" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/js/ui/ContextMenu.js"> <entry file="file://$PROJECT_DIR$/js/ui/ContextMenu.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504"> <state relative-caret-position="1440">
<caret line="101" column="8" selection-start-line="101" selection-start-column="8" selection-end-line="104" selection-end-column="0" /> <caret line="96" column="123" selection-start-line="96" selection-start-column="123" selection-end-line="96" selection-end-column="123" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/php/download.php"> <entry file="file://$PROJECT_DIR$/php/download.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144"> <state relative-caret-position="675">
<caret line="28" column="35" selection-start-line="28" selection-start-column="35" selection-end-line="28" selection-end-column="35" /> <caret line="45" column="12" selection-start-line="45" selection-start-column="12" selection-end-line="45" selection-end-column="50" />
<folding> <folding>
<element signature="e#7#908#0#PHP" expanded="true" /> <element signature="e#6#907#0#PHP" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/js/data/Actions.js"> <entry file="file://$PROJECT_DIR$/php/helper.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1191"> <state relative-caret-position="407">
<caret line="45" column="63" selection-start-line="45" selection-start-column="63" selection-end-line="45" selection-end-column="63" /> <caret line="41" column="15" selection-start-line="41" selection-start-column="15" selection-end-line="41" selection-end-column="15" />
<folding /> <folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/js/plugin.calendarimporter.js"> <entry file="file://$PROJECT_DIR$/php/upload.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="729"> <state relative-caret-position="408">
<caret line="320" column="54" selection-start-line="320" selection-start-column="31" selection-end-line="320" selection-end-column="54" /> <caret line="34" column="0" selection-start-line="34" selection-start-column="0" selection-end-line="39" selection-end-column="1" />
<folding /> <folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/php/module.calendar.php"> <entry file="file://$PROJECT_DIR$/php/module.calendar.php">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="301"> <state relative-caret-position="260">
<caret line="329" column="17" selection-start-line="329" selection-start-column="17" selection-end-line="329" selection-end-column="17" /> <caret line="231" column="30" selection-start-line="231" selection-start-column="25" selection-end-line="231" selection-end-column="30" />
<folding> <folding>
<element signature="e#6#914#0#PHP" expanded="true" /> <element signature="e#6#914#0#PHP" expanded="true" />
<element signature="n#__construct#0;n#CalendarModule#0;n#!!top" expanded="false" /> <element signature="e#1004#1022#0#PHP" expanded="true" />
<element signature="n#execute#0;n#CalendarModule#0;n#!!top" expanded="false" />
<element signature="n#randomstring#0;n#CalendarModule#0;n#!!top" expanded="false" />
<element signature="n#getDurationStringFromMintues#0;n#CalendarModule#0;n#!!top" expanded="false" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/Makefile"> <entry file="file://$PROJECT_DIR$/js/plugin.calendarimporter.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15"> <state relative-caret-position="610">
<caret line="1" column="92" selection-start-line="1" selection-start-column="92" selection-end-line="1" selection-end-column="92" /> <caret line="91" column="27" selection-start-line="91" selection-start-column="27" selection-end-line="91" selection-end-column="27" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/manifest.xml"> <entry file="file://$PROJECT_DIR$/js/data/Actions.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135"> <state relative-caret-position="268">
<caret line="9" column="62" selection-start-line="9" selection-start-column="62" selection-end-line="9" selection-end-column="62" /> <caret line="173" column="35" selection-start-line="173" selection-start-column="35" selection-end-line="173" selection-end-column="80" />
<folding /> <folding />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/js/dialogs/ImportPanel.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="583">
<caret line="113" column="29" selection-start-line="113" selection-start-column="21" selection-end-line="113" selection-end-column="29" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component> </component>
</project> </project>

View File

@ -34,6 +34,58 @@ Ext.namespace('Zarafa.plugins.calendarimporter.data');
* @singleton * @singleton
*/ */
Zarafa.plugins.calendarimporter.data.Actions = { Zarafa.plugins.calendarimporter.data.Actions = {
/**
* Generates a request to download the selected records as vCard.
*
* @param storeId
* @param recordIds
*/
exportToICS: function (storeId, recordIds, recordFolder) {
if ((typeof recordIds != "undefined" && recordIds.length < 1) || (typeof recordFolder != "undefined" && recordFolder.get('content_count') < 1)) {
Zarafa.common.dialogs.MessageBox.show({
title: dgettext('plugin_calendarimporter', 'Error'),
msg: dgettext('plugin_calendarimporter', 'No events found. Export skipped!'),
icon: Zarafa.common.dialogs.MessageBox.ERROR,
buttons: Zarafa.common.dialogs.MessageBox.OK
});
} else {
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({
successCallback: Zarafa.plugins.calendarimporter.data.Actions.downloadICS
});
var recordcount = 0;
var exportPayload = {
storeid: storeId,
records: undefined,
folder: undefined
};
if (typeof recordIds != "undefined") {
exportPayload.records = recordIds;
recordcount = recordIds.length;
}
if (typeof recordFolder != "undefined") {
exportPayload.folder = recordFolder.get("entryid");
recordcount = recordFolder.get('content_count');
}
// Notify user
// # TRANSLATORS: {0} will be replaced by the number of contacts that will be exported
container.getNotifier().notify('info', dgettext('plugin_contactimporter', 'Calendar Export'), String.format(dgettext('plugin_calendarimporter', 'Exporting {0} events. Please wait...'), recordcount));
// request attachment preperation
container.getRequest().singleRequest(
'calendarmodule',
'export',
exportPayload,
responseHandler
);
}
},
/** /**
* Callback for the export request. * Callback for the export request.
* @param {Object} response * @param {Object} response

View File

@ -432,7 +432,7 @@ Zarafa.plugins.calendarimporter.dialogs.ImportPanel = Ext.extend(Ext.Panel, {
this.submitAllButton.disable(); this.submitAllButton.disable();
Zarafa.common.dialogs.MessageBox.show({ Zarafa.common.dialogs.MessageBox.show({
title: _('Error'), title: _('Error'),
msg: _(action.result.error), msg: action.result.error,
icon: Zarafa.common.dialogs.MessageBox.ERROR, icon: Zarafa.common.dialogs.MessageBox.ERROR,
buttons: Zarafa.common.dialogs.MessageBox.OK buttons: Zarafa.common.dialogs.MessageBox.OK
}); });

View File

@ -95,26 +95,7 @@ Zarafa.plugins.calendarimporter.ImportPlugin = Ext.extend(Zarafa.core.Plugin, {
recordIds.push(btn.records[i].get("entryid")); recordIds.push(btn.records[i].get("entryid"));
} }
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({ Zarafa.plugins.calendarimporter.data.Actions.exportToICS(btn.records[0].get("store_entryid"), recordIds, undefined);
successCallback: Zarafa.plugins.calendarimporter.data.Actions.downloadICS,
scope: this
});
// Notify user
// # TRANSLATORS: {0} will be replaced by the number of contacts that will be exported
container.getNotifier().notify('info', dgettext('plugin_contactimporter', 'Calendar Export'), String.format(dgettext('plugin_calendarimporter', 'Exporting {0} events. Please wait...'), recordIds.length));
// request attachment preperation
container.getRequest().singleRequest(
'calendarmodule',
'export',
{
storeid: btn.records[0].get("store_entryid"),
records: recordIds
},
responseHandler
);
}, },
/** /**

View File

@ -94,25 +94,7 @@ Zarafa.plugins.calendarimporter.ui.ContextMenu = Ext.extend(Zarafa.hierarchy.ui.
* @private * @private
*/ */
onContextItemExport: function () { onContextItemExport: function () {
var responseHandler = new Zarafa.plugins.calendarimporter.data.ResponseHandler({ Zarafa.plugins.calendarimporter.data.Actions.exportToICS(this.records.get("store_entryid"), undefined, this.records);
successCallback: Zarafa.plugins.calendarimporter.data.Actions.downloadICS,
scope: this
});
// Notify user
// # TRANSLATORS: {0} will be replaced by the number of contacts that will be exported
container.getNotifier().notify('info', dgettext('plugin_contactimporter', 'Calendar Export'), String.format(dgettext('plugin_calendarimporter', 'Exporting {0} events. Please wait...'), this.records.get('content_count')));
// request attachment preperation
container.getRequest().singleRequest(
'calendarmodule',
'export',
{
storeid: this.records.get("store_entryid"),
folder: this.records.get("entryid")
},
responseHandler
);
}, },
/** /**

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* download.php, Kopano calendar to ics im/exporter * download.php, Kopano calendar to ics im/exporter
* *
@ -27,6 +26,7 @@ class DownloadHandler
{ {
/** /**
* Download the given vcf file. * Download the given vcf file.
* @return boolean
*/ */
public static function doDownload() public static function doDownload()
{ {
@ -43,7 +43,7 @@ class DownloadHandler
} }
// validate token // validate token
if (!ctype_alnum($token)) { // token is a md5 hash if (!preg_match('/^[a-zA-Z0-9]+$/', $token)) { // token is a md5 hash
return false; return false;
} }
@ -69,5 +69,7 @@ class DownloadHandler
readfile($file); readfile($file);
ignore_user_abort(true); ignore_user_abort(true);
unlink($file); unlink($file);
return true;
} }
} }

63
php/helper.php Normal file
View File

@ -0,0 +1,63 @@
<?php
/**
* helper.php, Kopano calender to ics im/exporter
*
* Author: Christoph Haas <christoph.h@sprinternet.at>
* 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);
}
}

View File

@ -21,20 +21,22 @@
* *
*/ */
include_once('vendor/autoload.php'); include_once(__DIR__ . "/vendor/autoload.php");
include_once(__DIR__ . "/helper.php");
use Sabre\VObject; use Sabre\VObject;
use calendarimporter\Helper;
class CalendarModule extends Module class CalendarModule extends Module
{ {
private $DEBUG = false; // enable error_log debugging private $DEBUG = false; // enable error_log debugging
private $busystates = null; private $busyStates = null;
private $labels = null; private $labels = null;
private $attendeetype = null; private $attendeeType = null;
/** /**
* @constructor * @constructor
@ -49,7 +51,7 @@ class CalendarModule extends Module
date_default_timezone_set(PLUGIN_CALENDARIMPORTER_DEFAULT_TIMEZONE); date_default_timezone_set(PLUGIN_CALENDARIMPORTER_DEFAULT_TIMEZONE);
// init mappings // init mappings
$this->busystates = array( $this->busyStates = array(
"FREE", "FREE",
"TENTATIVE", "TENTATIVE",
"BUSY", "BUSY",
@ -70,7 +72,7 @@ class CalendarModule extends Module
"PHONE INTERVIEW" "PHONE INTERVIEW"
); );
$this->attendeetype = array( $this->attendeeType = array(
"NON-PARTICIPANT", // needed as zarafa starts counting at 1 "NON-PARTICIPANT", // needed as zarafa starts counting at 1
"REQ-PARTICIPANT", "REQ-PARTICIPANT",
"OPT-PARTICIPANT", "OPT-PARTICIPANT",
@ -81,6 +83,7 @@ class CalendarModule extends Module
/** /**
* Executes all the actions in the $data variable. * Executes all the actions in the $data variable.
* Exception part is used for authentication errors also * Exception part is used for authentication errors also
*
* @return boolean true on success or false on failure. * @return boolean true on success or false on failure.
*/ */
public function execute() public function execute()
@ -130,58 +133,44 @@ class CalendarModule extends Module
return $result; 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. * Get a property from the array.
*
* @param $props * @param $props
* @param $propname * @param $propName
* @return string * @return string
*/ */
private function getProp($props, $propname) private function getProp($props, $propName)
{ {
if (isset($props["props"][$propname])) { if (isset($props["props"][$propName])) {
return $props["props"][$propname]; return $props["props"][$propName];
} }
return ""; 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 ? "+" : "-"; $pos = $pos === true ? "+" : "-";
$str = $pos . "P"; $str = $pos . "P";
// variables for holding values // variables for holding values
$mins = intval($minutes); $min = intval($minutes);
$hours = 0; $hours = 0;
$days = 0; $days = 0;
$weeks = 0; $weeks = 0;
// calculations // calculations
if ($mins >= 60) { if ($min >= 60) {
$hours = (int)($mins / 60); $hours = (int)($min / 60);
$mins = $mins % 60; $min = $min % 60;
} }
if ($hours >= 24) { if ($hours >= 24) {
$days = (int)($hours / 24); $days = (int)($hours / 24);
@ -202,8 +191,8 @@ class CalendarModule extends Module
if ($hours) { if ($hours) {
$str .= "{$hours}H"; $str .= "{$hours}H";
} }
if ($mins) { if ($min) {
$str .= "{$mins}M"; $str .= "{$min}M";
} }
return $str; return $str;
@ -211,15 +200,16 @@ class CalendarModule extends Module
/** /**
* The main export function, creates the ics file for download * The main export function, creates the ics file for download
*
* @param $actionType * @param $actionType
* @param $actionData * @param $actionData
*/ */
private function exportCalendar($actionType, $actionData) private function exportCalendar($actionType, $actionData)
{ {
// Get store id // Get store id
$storeid = false; $storeId = false;
if (isset($actionData["storeid"])) { if (isset($actionData["storeid"])) {
$storeid = $actionData["storeid"]; $storeId = $actionData["storeid"];
} }
// Get records // Get records
@ -239,17 +229,17 @@ class CalendarModule extends Module
$error_msg = ""; $error_msg = "";
// write csv // write csv
$token = $this->randomstring(16); $token = Helper::randomstring(16);
$file = PLUGIN_CALENDARIMPORTER_TMP_UPLOAD . "ics_" . $token . ".ics"; $file = PLUGIN_CALENDARIMPORTER_TMP_UPLOAD . "ics_" . $token . ".ics";
file_put_contents($file, ""); file_put_contents($file, "");
$store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeid)); $store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeId));
if ($store) { if ($store) {
// load folder first // load folder first
if ($folder !== false) { 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)); $list = mapi_table_queryallrows($table, array(PR_ENTRYID));
foreach ($list as $item) { 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 // Add static stuff to vCalendar
$vcalendar->add('METHOD', 'PUBLISH'); $vCalendar->add('METHOD', 'PUBLISH');
$vcalendar->add('X-WR-CALDESC', 'Exported Zarafa Calendar'); $vCalendar->add('X-WR-CALDESC', 'Exported Kopano Calendar');
$vcalendar->add('X-WR-TIMEZONE', date_default_timezone_get()); $vCalendar->add('X-WR-TIMEZONE', date_default_timezone_get());
// TODO: add VTIMEZONE object to ical. // TODO: add VTIMEZONE object to ical.
@ -274,43 +264,43 @@ class CalendarModule extends Module
$plaintext = true; $plaintext = true;
$messageProps = $GLOBALS['operations']->getMessageProps($store, $message, $properties, $plaintext); $messageProps = $GLOBALS['operations']->getMessageProps($store, $message, $properties, $plaintext);
$vevent = $vcalendar->add('VEVENT', [ $vEvent = $vCalendar->add('VEVENT', [
'SUMMARY' => $this->getProp($messageProps, "subject"), 'SUMMARY' => $this->getProp($messageProps, "subject"),
'DTSTART' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "startdate")), 'DTSTART' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "startdate")),
'DTEND' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "duedate")), 'DTEND' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "duedate")),
'CREATED' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "creation_time")), 'CREATED' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "creation_time")),
'LAST-MODIFIED' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "last_modification_time")), 'LAST-MODIFIED' => date_timestamp_set(new DateTime(), $this->getProp($messageProps, "last_modification_time")),
'PRIORITY' => $this->getProp($messageProps, "importance"), 'PRIORITY' => $this->getProp($messageProps, "importance"),
'X-MICROSOFT-CDO-INTENDEDSTATUS' => $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-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"))], 'X-ZARAFA-LABEL' => $this->labels[intval($this->getProp($messageProps, "label"))],
'CLASS' => $this->getProp($messageProps, "private") ? "PRIVATE" : "PUBLIC", 'CLASS' => $this->getProp($messageProps, "private") ? "PRIVATE" : "PUBLIC",
'COMMENT' => "eid:" . $records[$index] 'COMMENT' => "eid:" . $records[$index]
]); ]);
// Add organizer // Add organizer
$vevent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address")); $vEvent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address"));
$vevent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name"); $vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name");
// Add Attendees // Add Attendees
if (isset($messageProps["recipients"]) && count($messageProps["recipients"]["item"]) > 0) { if (isset($messageProps["recipients"]) && count($messageProps["recipients"]["item"]) > 0) {
foreach ($messageProps["recipients"]["item"] as $attendee) { 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["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 // Add alarms
if (!empty($this->getProp($messageProps, "reminder")) && $this->getProp($messageProps, "reminder") == 1) { if (!empty($this->getProp($messageProps, "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
]); ]);
// Add trigger // Add trigger
$durationValue = $this->getDurationStringFromMintues($this->getProp($messageProps, "reminder_minutes"), false); $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', $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" $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 // Add location
if (!empty($this->getProp($messageProps, "location"))) { if (!empty($this->getProp($messageProps, "location"))) {
$vevent->add('LOCATION', $this->getProp($messageProps, "location")); $vEvent->add('LOCATION', $this->getProp($messageProps, "location"));
} }
// Add description // Add description
$body = $this->getProp($messageProps, "isHTML") ? $this->getProp($messageProps, "html_body") : $this->getProp($messageProps, "body"); $body = $this->getProp($messageProps, "isHTML") ? $this->getProp($messageProps, "html_body") : $this->getProp($messageProps, "body");
if (!empty($body)) { if (!empty($body)) {
$vevent->add('DESCRIPTION', $body); $vEvent->add('DESCRIPTION', $body);
} }
} }
// write combined ics file // 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) { if (count($records) > 0) {
@ -356,9 +346,9 @@ class CalendarModule extends Module
private function importCalendar($actionType, $actionData) private function importCalendar($actionType, $actionData)
{ {
// Get uploaded vcf path // Get uploaded vcf path
$icsfile = false; $icsFile = false;
if (isset($actionData["ics_filepath"])) { if (isset($actionData["ics_filepath"])) {
$icsfile = $actionData["ics_filepath"]; $icsFile = $actionData["ics_filepath"];
} }
// Get store id // Get store id
@ -368,9 +358,9 @@ class CalendarModule extends Module
} }
// Get folder entryid // Get folder entryid
$folderid = false; $folderId = false;
if (isset($actionData["folderid"])) { if (isset($actionData["folderid"])) {
$folderid = $actionData["folderid"]; $folderId = $actionData["folderid"];
} }
// Get uids // Get uids
@ -387,7 +377,7 @@ class CalendarModule extends Module
$parser = null; $parser = null;
try { try {
$parser = VObject\Reader::read( $parser = VObject\Reader::read(
fopen($icsfile, 'r') fopen($icsFile, 'r')
); );
} catch (Exception $e) { } catch (Exception $e) {
$error = true; $error = true;
@ -398,11 +388,11 @@ class CalendarModule extends Module
if (count($parser->VEVENT) > 0) { if (count($parser->VEVENT) > 0) {
$events = $this->parseCalendarToArray($parser); $events = $this->parseCalendarToArray($parser);
$store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeid)); $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)) { if (count($uids) == count($events)) {
$importall = true; $importAll = true;
} }
$propValuesMAPI = array(); $propValuesMAPI = array();
@ -414,7 +404,7 @@ class CalendarModule extends Module
// iterate through all events and import them :) // iterate through all events and import them :)
foreach ($events as $event) { 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); $message = mapi_folder_createmessage($folder);
@ -469,15 +459,15 @@ class CalendarModule extends Module
private function getAttachmentPath($actionType, $actionData) private function getAttachmentPath($actionType, $actionData)
{ {
// Get store id // Get store id
$storeid = false; $storeId = false;
if (isset($actionData["store"])) { if (isset($actionData["store"])) {
$storeid = $actionData["store"]; $storeId = $actionData["store"];
} }
// Get message entryid // Get message entryid
$entryid = false; $entryId = false;
if (isset($actionData["entryid"])) { if (isset($actionData["entryid"])) {
$entryid = $actionData["entryid"]; $entryId = $actionData["entryid"];
} }
// Check which type isset // Check which type isset
@ -490,13 +480,13 @@ class CalendarModule extends Module
} }
// Check if storeid and entryid isset // Check if storeid and entryid isset
if ($storeid && $entryid) { if ($storeId && $entryId) {
// Open the store // Open the store
$store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeid)); $store = $GLOBALS["mapisession"]->openMessageStore(hex2bin($storeId));
if ($store) { if ($store) {
// Open the message // Open the message
$message = mapi_msgstore_openentry($store, hex2bin($entryid)); $message = mapi_msgstore_openentry($store, hex2bin($entryId));
if ($message) { if ($message) {
$attachment = false; $attachment = false;
@ -506,10 +496,10 @@ class CalendarModule extends Module
// Loop through the attachNums, message in message in message ... // Loop through the attachNums, message in message in message ...
for ($i = 0; $i < (count($attachNum) - 1); $i++) { for ($i = 0; $i < (count($attachNum) - 1); $i++) {
// Open the attachment // Open the attachment
$tempattach = mapi_message_openattach($message, (int)$attachNum[$i]); $tempAttach = mapi_message_openattach($message, (int)$attachNum[$i]);
if ($tempattach) { if ($tempAttach) {
// Open the object in the attachment // 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; $ext_found = false;
while (!feof($fh) && !$ext_found) { while (!feof($fh) && !$ext_found) {
$line = fgets($fh); $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]) { if ($extension == $result[1]) {
$ext_found = true; $ext_found = true;
$contentType = $result[2]; $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 // Open a stream to get the attachment data
$stream = mapi_openpropertytostream($attachment, PR_ATTACH_DATA_BIN); $stream = mapi_openpropertytostream($attachment, PR_ATTACH_DATA_BIN);
$stat = mapi_stream_stat($stream); $stat = mapi_stream_stat($stream);
// File length = $stat["cb"] // File length = $stat["cb"]
$fhandle = fopen($tmpname, 'w'); $fHandle = fopen($tmpName, 'w');
$buffer = null; $buffer = null;
for ($i = 0; $i < $stat["cb"]; $i += BLOCK_SIZE) { for ($i = 0; $i < $stat["cb"]; $i += BLOCK_SIZE) {
// Write stream // Write stream
$buffer = mapi_stream_read($stream, BLOCK_SIZE); $buffer = mapi_stream_read($stream, BLOCK_SIZE);
fwrite($fhandle, $buffer, strlen($buffer)); fwrite($fHandle, $buffer, strlen($buffer));
} }
fclose($fhandle); fclose($fHandle);
$response = array(); $response = array();
$response['tmpname'] = $tmpname; $response['tmpname'] = $tmpName;
$response['filename'] = $filename; $response['filename'] = $filename;
$response['contenttype'] = $contentType;
$response['status'] = true; $response['status'] = true;
$this->addActionData($actionType, $response); $this->addActionData($actionType, $response);
$GLOBALS["bus"]->addData($this->getResponseData()); $GLOBALS["bus"]->addData($this->getResponseData());
@ -611,7 +602,7 @@ class CalendarModule extends Module
private function loadCalendar($actionType, $actionData) private function loadCalendar($actionType, $actionData)
{ {
$error = false; $error = false;
$error_msg = ""; $errorMsg = "";
if (is_readable($actionData["ics_filepath"])) { if (is_readable($actionData["ics_filepath"])) {
$parser = null; $parser = null;
@ -623,11 +614,11 @@ class CalendarModule extends Module
//error_log(print_r($parser->VTIMEZONE, true)); //error_log(print_r($parser->VTIMEZONE, true));
} catch (Exception $e) { } catch (Exception $e) {
$error = true; $error = true;
$error_msg = $e->getMessage(); $errorMsg = $e->getMessage();
} }
if ($error) { if ($error) {
$response['status'] = false; $response['status'] = false;
$response['message'] = $error_msg; $response['message'] = $errorMsg;
} else { } else {
if (count($parser->VEVENT) == 0) { if (count($parser->VEVENT) == 0) {
$response['status'] = false; $response['status'] = false;
@ -681,7 +672,7 @@ 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;
$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["transp"] = (string)$vEvent->TRANSP;
//$properties["trigger"] = (string)$vEvent->COMMENT; //$properties["trigger"] = (string)$vEvent->COMMENT;
$properties["priority"] = (string)$vEvent->PRIORITY; $properties["priority"] = (string)$vEvent->PRIORITY;

View File

@ -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... */ /* disable error printing - otherwise json communication might break... */
ini_set('display_errors', '0'); ini_set('display_errors', '0');
/** // check session
* respond/echo JSON // otherwise a DOS attack might be possible
* @param $arr if (!WebAppAuthentication::getUserName() || WebAppAuthentication::getUserName() == "") {
*/ Helper::respondJSON(array('success' => false, 'error' => dgettext("plugin_calendarimporter", "Not authenticated!")));
function respondJSON($arr) die();
{
echo json_encode($arr);
} }
/** if (isset($_FILES['icsdata']['tmp_name']) && is_readable($_FILES['icsdata']['tmp_name'])) {
* Generates a random string with variable length. $destpath = PLUGIN_CALENDARIMPORTER_TMP_UPLOAD;
* @param $length the lenght of the generated string $destpath .= $_FILES['icsdata']['name'] . Helper::randomstring();
* @return string a random string
*/
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;
}
$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); $result = move_uploaded_file($_FILES['icsdata']['tmp_name'], $destpath);
if ($result) { if ($result) {
respondJSON(array('success' => true, 'ics_file' => $destpath)); Helper::respondJSON(array('success' => true, 'ics_file' => $destpath));
} else { } 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 { } 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!")));
} }

View File

@ -1,5 +1,5 @@
.icon_calendarimporter_button { .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-repeat: no-repeat;
background-position: center; background-position: center;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.