Compatibility for PHP 5.4

This commit is contained in:
Christoph Haas 2016-12-01 00:25:23 +01:00
parent 36308c8196
commit 70b1e0872c
3 changed files with 84 additions and 122 deletions

View File

@ -3,7 +3,8 @@
<component name="ChangeListManager">
<list default="true" id="e7c9c2bb-66f1-4e37-904c-d33d8c113bde" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/js/dialogs/ImportPanel.js" afterPath="$PROJECT_DIR$/js/dialogs/ImportPanel.js" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/composer.json" afterPath="$PROJECT_DIR$/php/composer.json" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/php/module.calendar.php" afterPath="$PROJECT_DIR$/php/module.calendar.php" />
</list>
<ignored path="calendarimporter.iws" />
<ignored path=".idea/workspace.xml" />
@ -24,33 +25,21 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="plugin.calendarimporter.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/plugin.calendarimporter.js">
<file leaf-file-name="composer.json" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/php/composer.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="610">
<caret line="91" column="27" selection-start-line="91" selection-start-column="27" selection-end-line="91" selection-end-column="27" />
<state relative-caret-position="60">
<caret line="4" column="1" selection-start-line="4" selection-start-column="1" selection-end-line="4" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="upload.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/php/upload.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
<caret line="34" column="0" selection-start-line="34" selection-start-column="0" selection-end-line="39" selection-end-column="1" />
<folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<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="true">
<entry file="file://$PROJECT_DIR$/php/module.calendar.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="260">
<caret line="231" column="30" selection-start-line="231" selection-start-column="25" selection-end-line="231" selection-end-column="30" />
<state relative-caret-position="534">
<caret line="683" column="59" selection-start-line="683" selection-start-column="59" selection-end-line="683" selection-end-column="59" />
<folding>
<element signature="e#6#914#0#PHP" expanded="true" />
<element signature="e#1004#1022#0#PHP" expanded="true" />
@ -59,40 +48,6 @@
</provider>
</entry>
</file>
<file leaf-file-name="Actions.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/js/data/Actions.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="268">
<caret line="173" column="35" selection-start-line="173" selection-start-column="35" selection-end-line="173" selection-end-column="80" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ImportPanel.js" pinned="false" current-in-tab="true">
<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>
</file>
<file leaf-file-name="helper.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/php/helper.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="407">
<caret line="41" column="15" selection-start-line="41" selection-start-column="15" selection-end-line="41" selection-end-column="15" />
<folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
@ -132,12 +87,13 @@
<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$/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" />
<option value="$PROJECT_DIR$/php/composer.json" />
<option value="$PROJECT_DIR$/php/module.calendar.php" />
</list>
</option>
</component>
@ -152,10 +108,10 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="145" />
<option name="y" value="602" />
<option name="width" value="1782" />
<option name="height" value="941" />
<option name="x" value="65" />
<option name="y" value="24" />
<option name="width" value="1793" />
<option name="height" value="999" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
<OptionsSetting value="true" id="Add" />
@ -389,17 +345,19 @@
<workItem from="1477949603566" duration="9204000" />
<workItem from="1480441197414" duration="11151000" />
<workItem from="1480505014387" duration="3401000" />
<workItem from="1480509394154" duration="63000" />
<workItem from="1480548170124" duration="133000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="23756000" />
<option name="totallyTimeSpent" value="23952000" />
</component>
<component name="ToolWindowManager">
<frame x="145" y="602" width="1782" height="941" extended-state="0" />
<frame x="65" y="24" width="1793" height="999" extended-state="6" />
<editor active="true" />
<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.2514029" 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.25097603" 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="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" />
@ -436,11 +394,45 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/php/module.calendar.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3465">
<caret line="231" column="30" selection-start-line="231" selection-start-column="25" selection-end-line="231" selection-end-column="30" />
<folding>
<element signature="e#6#914#0#PHP" expanded="true" />
<element signature="e#1004#1022#0#PHP" expanded="true" />
</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="2295">
<caret line="173" column="35" selection-start-line="173" selection-start-column="35" selection-end-line="173" selection-end-column="80" />
</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" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/helper.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="615">
<caret line="41" column="15" selection-start-line="41" selection-start-column="15" selection-end-line="41" selection-end-column="15" />
<folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<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>
@ -448,7 +440,6 @@
<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>
@ -456,7 +447,6 @@
<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>
@ -464,7 +454,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1515">
<caret line="101" column="30" selection-start-line="101" selection-start-column="30" selection-end-line="101" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
@ -472,7 +461,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1275">
<caret line="85" column="59" selection-start-line="85" selection-start-column="59" selection-end-line="85" selection-end-column="59" />
<folding />
</state>
</provider>
</entry>
@ -487,9 +475,6 @@
<provider selected="true" editor-type-id="text-editor">
<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" />
<folding>
<element signature="e#21#926#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
@ -536,13 +521,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/composer.json">
<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" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/data/CalendarHelper.js" />
<entry file="file://$PROJECT_DIR$/backend/functions.php">
<provider selected="true" editor-type-id="text-editor">
@ -562,9 +540,6 @@
<provider selected="true" editor-type-id="text-editor">
<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" />
<folding>
<element signature="e#21#926#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
@ -587,12 +562,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="744">
<caret line="61" column="71" selection-start-line="61" selection-start-column="71" selection-end-line="61" selection-end-column="71" />
<folding>
<marker date="1480442383471" expanded="true" signature="1214:1218" ph="&lt;" />
<marker date="1480442383471" expanded="true" signature="1244:1248" ph="&gt;" />
<marker date="1480442383471" expanded="true" signature="2881:2885" ph="&lt;" />
<marker date="1480442383471" expanded="true" signature="2905:2909" ph="&gt;" />
</folding>
</state>
</provider>
</entry>
@ -607,7 +576,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
<caret line="44" column="93" selection-start-line="44" selection-start-column="57" selection-end-line="44" selection-end-column="93" />
<folding />
</state>
</provider>
</entry>
@ -622,7 +590,6 @@
<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="20" selection-end-column="3" />
<folding />
</state>
</provider>
</entry>
@ -644,7 +611,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="585">
<caret line="147" column="28" selection-start-line="147" selection-start-column="28" selection-end-line="147" selection-end-column="64" />
<folding />
</state>
</provider>
</entry>
@ -659,7 +625,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="15">
<caret line="1" column="29" selection-start-line="1" selection-start-column="29" selection-end-line="1" selection-end-column="29" />
<folding />
</state>
</provider>
</entry>
@ -698,7 +663,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="59" selection-start-line="2" selection-start-column="54" selection-end-line="2" selection-end-column="59" />
<folding />
</state>
</provider>
</entry>
@ -721,7 +685,6 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-165">
<caret line="13" column="25" selection-start-line="13" selection-start-column="22" selection-end-line="13" selection-end-column="25" />
<folding />
</state>
</provider>
</entry>
@ -736,7 +699,6 @@
<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>
@ -744,15 +706,12 @@
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675">
<caret line="45" column="12" selection-start-line="45" selection-start-column="12" selection-end-line="45" selection-end-column="50" />
<folding>
<element signature="e#6#907#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/helper.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="407">
<state relative-caret-position="615">
<caret line="41" column="15" selection-start-line="41" selection-start-column="15" selection-end-line="41" selection-end-column="15" />
<folding>
<element signature="e#6#905#0#PHP" expanded="true" />
@ -762,38 +721,22 @@
</entry>
<entry file="file://$PROJECT_DIR$/php/upload.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="408">
<state relative-caret-position="510">
<caret line="34" column="0" selection-start-line="34" selection-start-column="0" selection-end-line="39" selection-end-column="1" />
<folding>
<element signature="e#6#905#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/module.calendar.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="260">
<caret line="231" column="30" selection-start-line="231" selection-start-column="25" selection-end-line="231" selection-end-column="30" />
<folding>
<element signature="e#6#914#0#PHP" expanded="true" />
<element signature="e#1004#1022#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/js/plugin.calendarimporter.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="610">
<state relative-caret-position="1365">
<caret line="91" column="27" selection-start-line="91" selection-start-column="27" selection-end-line="91" selection-end-column="27" />
<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="268">
<state relative-caret-position="2295">
<caret line="173" column="35" selection-start-line="173" selection-start-column="35" selection-end-line="173" selection-end-column="80" />
<folding />
</state>
</provider>
</entry>
@ -801,8 +744,24 @@
<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" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/composer.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="1" selection-start-line="4" selection-start-column="1" selection-end-line="4" selection-end-column="1" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/php/module.calendar.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="534">
<caret line="683" column="59" selection-start-line="683" selection-start-column="59" selection-end-line="683" selection-end-column="59" />
<folding>
<element signature="n#!!doc" expanded="true" />
<element signature="e#6#914#0#PHP" expanded="true" />
<element signature="e#1004#1022#0#PHP" expanded="true" />
</folding>
</state>
</provider>

View File

@ -1,5 +1,5 @@
{
"require": {
"sabre/vobject": "4.1"
"sabre/vobject": "3.5.3"
}
}

View File

@ -292,7 +292,8 @@ class CalendarModule extends Module
}
// Add alarms
if (!empty($this->getProp($messageProps, "reminder")) && $this->getProp($messageProps, "reminder") == 1) {
$reminder = $this->getProp($messageProps, "reminder");
if (!empty($reminder) && $this->getProp($messageProps, "reminder") == 1) {
$vAlarm = $vEvent->add('VALARM', [
'ACTION' => 'DISPLAY',
'DESCRIPTION' => $this->getProp($messageProps, "subject") // reuse the event summary
@ -309,7 +310,8 @@ class CalendarModule extends Module
}
// Add location
if (!empty($this->getProp($messageProps, "location"))) {
$location = $this->getProp($messageProps, "location");
if (!empty($location)) {
$vEvent->add('LOCATION', $this->getProp($messageProps, "location"));
}
@ -677,8 +679,9 @@ class CalendarModule extends Module
//$properties["trigger"] = (string)$vEvent->COMMENT;
$properties["priority"] = (string)$vEvent->PRIORITY;
$properties["private"] = ((string)$vEvent->CLASS) == "PRIVATE" ? true : false;
if (!empty((string)$vEvent->{'X-ZARAFA-LABEL'})) {
$properties["label"] = array_search((string)$vEvent->{'X-ZARAFA-LABEL'}, $this->labels);
$zLabel = (string)$vEvent->{'X-ZARAFA-LABEL'};
if (!empty($zLabel)) {
$properties["label"] = array_search($zLabel, $this->labels);
}
$properties["last_modification_time"] = (string)$vEvent->{'LAST-MODIFIED'}->getDateTime()->getTimestamp();
$properties["creation_time"] = (string)$vEvent->CREATED->getDateTime()->getTimestamp();