diff options
author | raimund-schluessler <raimund.schluessler@googlemail.com> | 2014-05-13 22:05:30 +0400 |
---|---|---|
committer | raimund-schluessler <raimund.schluessler@googlemail.com> | 2014-05-13 22:05:30 +0400 |
commit | 62472e1662239d1b21daf31d86abc59ecca30853 (patch) | |
tree | 0ced68d484da19e75cac44ce4a02564f866db3a9 | |
parent | d557b2269307e3eb21ad617af837328a6aad7599 (diff) |
Add support for oC 6.0.1
-rw-r--r-- | appinfo/info.xml | 4 | ||||
-rw-r--r-- | appinfo/version | 2 | ||||
-rw-r--r-- | lib/helper.php | 18 |
3 files changed, 15 insertions, 9 deletions
diff --git a/appinfo/info.xml b/appinfo/info.xml index 2d897cee..ea6a1ce7 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -2,10 +2,10 @@ <info> <id>tasks_enhanced</id> <name>tasks_enhanced</name> - <version>0.2</version> + <version>0.2.1</version> <licence>AGPL</licence> <author>Raimund Schlüßler</author> - <require>6.0.3</require> + <require>6.0.0</require> <shipped>true</shipped> <description>Enhanced Task App for Calender TODOs</description> </info> diff --git a/appinfo/version b/appinfo/version index 2f453618..7dff5b89 100644 --- a/appinfo/version +++ b/appinfo/version @@ -1 +1 @@ -0.2
\ No newline at end of file +0.2.1
\ No newline at end of file diff --git a/lib/helper.php b/lib/helper.php index 016d6bf0..23f96246 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -72,6 +72,8 @@ Class helper { $reminderType = $reminder->TRIGGER['VALUE']->value; $reminderAction = $reminder->ACTION->value; + $reminderDate = null; + $reminderDuration = null; if($reminderType == 'DATE-TIME'){ @@ -82,10 +84,14 @@ Class helper { $parsed = VObject\DateTimeParser::parseDuration($reminder->TRIGGER,true); // Calculate the reminder date from duration and start date - if($reminder->TRIGGER['RELATED']->value == 'END' && $due){ - $reminderDate = $due->modify($parsed)->format('Ymd\THis'); - } elseif ($start) { - $reminderDate = $start->modify($parsed)->format('Ymd\THis'); + $related = null; + if(is_object($reminder->TRIGGER['RELATED'])){ + $related = $reminder->TRIGGER['RELATED']->value; + if(is_object($reminder->TRIGGER['RELATED']) && $reminder->TRIGGER['RELATED']->value == 'END' && $due){ + $reminderDate = $due->modify($parsed)->format('Ymd\THis'); + } elseif ($start) { + $reminderDate = $start->modify($parsed)->format('Ymd\THis'); + } } else{ throw new \Exception('Reminder duration related to not available date.'); } @@ -118,8 +124,8 @@ Class helper { } $reminderDuration['params'] = array( - 'id' => (int)$invert.(int)($reminder->TRIGGER['RELATED']->value == 'END'), - 'related'=> $reminder->TRIGGER['RELATED']->value?$reminder->TRIGGER['RELATED']->value:'START', + 'id' => (int)$invert.(int)($related == 'END'), + 'related'=> $related?$related:'START', 'invert'=> $invert ); |