addapted for changed priority column

This commit is contained in:
Ralf Becker 2005-07-14 17:21:01 +00:00
parent a19684502e
commit 047fbabfed

View File

@ -20,7 +20,7 @@
{ {
$taskData = $this->read($_taskID); $taskData = $this->read($_taskID);
_debug_array($taskData); //_debug_array($taskData);
$taskGUID = $GLOBALS['phpgw']->common->generate_uid('infolog_task',$_taskID); $taskGUID = $GLOBALS['phpgw']->common->generate_uid('infolog_task',$_taskID);
#print "<br>"; #print "<br>";
@ -47,22 +47,9 @@
$vevent->setAttribute('UID',$taskGUID); $vevent->setAttribute('UID',$taskGUID);
$vevent->setAttribute('CLASS',(($taskData['info_access'] == 'public')?'PUBLIC':'PRIVATE')); $vevent->setAttribute('CLASS',(($taskData['info_access'] == 'public')?'PUBLIC':'PRIVATE'));
$vevent->setAttribute('STATUS',(($taskData['info_status'] == 'completed')?'COMPLETED':'NEEDS-ACTION')); $vevent->setAttribute('STATUS',(($taskData['info_status'] == 'completed')?'COMPLETED':'NEEDS-ACTION'));
switch($taskData['info_pri']) // 3=urgent => 1, 2=high => 2, 1=normal => 3, 0=low => 4
{ $vevent->setAttribute('PRIORITY',4-$taskData['info_priority']);
case 'urgent':
$vevent->setAttribute('PRIORITY',1);
break;
case 'high':
$vevent->setAttribute('PRIORITY',2);
break;
case 'normal':
$vevent->setAttribute('PRIORITY',3);
break;
case 'low':
$vevent->setAttribute('PRIORITY',4);
break;
}
#$vevent->setAttribute('TRANSP','OPAQUE'); #$vevent->setAttribute('TRANSP','OPAQUE');
# status # status
# ATTENDEE # ATTENDEE
@ -116,23 +103,14 @@
$taskData['info_startdate'] = $attributes['value']; $taskData['info_startdate'] = $attributes['value'];
break; break;
case 'PRIORITY': case 'PRIORITY':
switch($attributes['value']) // 1 => 3=urgent, 2 => 2=high, 3 => 1=normal, 4 => 0=low
if (1 <= $attributes['value'] && $attributes['value'] <= 4)
{ {
case '1': $taskData['info_priority'] = 4 - $attributes['value'];
$taskData['info_pri'] = 'urgent'; }
break; else
case '2': {
$taskData['info_pri'] = 'high'; $taskData['info_priority'] = 1; // default = normal
break;
case '3':
$taskData['info_pri'] = 'normal';
break;
case '4':
$taskData['info_pri'] = 'low';
break;
default:
$taskData['info_pri'] = 'low';
break;
} }
break; break;
case 'STATUS': case 'STATUS':