Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
kolab
roundcube-plugins
Commits
bfc961ba
Commit
bfc961ba
authored
Nov 14, 2012
by
Thomas Bruederli
Browse files
Support percentage values for task completeness according to spec (requires patch on Horde classes)
parent
92eb064f
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/libkolab/lib/kolab_format_task.php
View file @
bfc961ba
...
...
@@ -74,7 +74,7 @@ class kolab_format_task extends kolab_format
if
(
$kolab_status
=
$status_map
[
$object
[
'status'
]])
$this
->
kolab_object
[
'status'
]
=
$kolab_status
;
$this
->
kolab_object
[
'due'
]
=
$this
->
kolab_object
[
'start'
]
=
0
;
$this
->
kolab_object
[
'due'
]
=
$this
->
kolab_object
[
'start'
]
=
null
;
if
(
$object
[
'due'
])
{
$dtdue
=
clone
$object
[
'due'
];
$dtdue
->
setTimezone
(
new
DateTimeZone
(
'UTC'
));
...
...
@@ -91,13 +91,13 @@ class kolab_format_task extends kolab_format
}
// set 'completed-date' on transition
if
(
!
$this
->
kolab_object
[
'complete'
]
&&
$object
[
'status'
]
==
'COMPLETED'
)
if
(
$this
->
kolab_object
[
'complete'
]
<
100
&&
$object
[
'status'
]
==
'COMPLETED'
)
$this
->
kolab_object
[
'completed-date'
]
=
time
();
if
(
$object
[
'status'
]
==
'COMPLETED'
||
$object
[
'complete'
]
==
100
)
$this
->
kolab_object
[
'completed'
]
=
true
;
else
if
(
$object
[
'status'
]
!=
'COMPLETED'
&&
$this
->
kolab_object
[
'completed'
]
)
$this
->
kolab_object
[
'completed'
]
=
0
;
else
if
(
$object
[
'status'
]
!=
'COMPLETED'
)
$this
->
kolab_object
[
'completed'
]
=
intval
(
$object
[
'complete'
])
;
// handle alarms
$this
->
kolab_object
[
'alarm'
]
=
self
::
to_kolab2_alarm
(
$object
[
'alarms'
]);
...
...
@@ -123,7 +123,7 @@ class kolab_format_task extends kolab_format
$object
=
array
(
'uid'
=>
$record
[
'uid'
],
'dtstamp'
=>
$record
[
'last-modification-date'
],
'complete'
=>
0
,
'complete'
=>
intval
(
$record
[
'completed'
])
,
);
// map basic fields rcube => $kolab
...
...
@@ -131,12 +131,11 @@ class kolab_format_task extends kolab_format
$object
[
$rcube
]
=
$record
[
$kolab
];
}
if
(
$record
[
'completed'
])
{
if
(
$record
[
'completed'
]
===
true
||
$record
[
'completed'
]
==
100
)
{
$object
[
'status'
]
=
'COMPLETED'
;
$object
[
'complete'
]
=
100
;
}
$object
[
'categories'
]
=
array_filter
(
explode
(
','
,
$record
[
'categories'
]));
$object
[
'categories'
]
=
array_filter
(
explode
(
','
,
$record
[
'_categories_all'
]
?
$record
[
'_categories_all'
]
:
$record
[
'categories'
]));
if
(
$record
[
'due'
])
{
$object
[
'due'
]
=
new
DateTime
(
'@'
.
$record
[
'due'
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment