- Copy infolog entry links into calendar entry

- Match categories by name
- Event owner is current user, not infolog owner
This commit is contained in:
Nathan Gray 2011-12-19 20:45:05 +00:00
parent f8ec5c9f40
commit 4efa3dd4ae

View File

@ -1222,7 +1222,6 @@ class calendar_uiforms extends calendar_ui
if(!$infolog_bo) $infolog_bo = new infolog_bo(); if(!$infolog_bo) $infolog_bo = new infolog_bo();
$infolog = $app_entry = $infolog_bo->read($link_id); $infolog = $app_entry = $infolog_bo->read($link_id);
$event = array_merge($event, array( $event = array_merge($event, array(
'owner' => $infolog['info_owner'],
'category' => $GLOBALS['egw']->categories->check_list(EGW_ACL_READ, $infolog['info_cat']), 'category' => $GLOBALS['egw']->categories->check_list(EGW_ACL_READ, $infolog['info_cat']),
'priority' => $infolog['info_priority'] + 1, 'priority' => $infolog['info_priority'] + 1,
'public' => $infolog['info_access'] != 'private', 'public' => $infolog['info_access'] != 'private',
@ -1232,6 +1231,8 @@ class calendar_uiforms extends calendar_ui
'start' => $infolog['info_startdate'], 'start' => $infolog['info_startdate'],
'end' => $infolog['info_enddate'] 'end' => $infolog['info_enddate']
)); ));
// Match categories by name
$event['category'] .= ($event['category'] ? ',':'') . $GLOBALS['egw']->categories->name2id(categories::id2name($infolog['info_cat']));
// Only add current user, not all selected calendar users // Only add current user, not all selected calendar users
$event['participants'] = array(calendar_so::combine_user('u',$event['owner']) => 'ACHAIR'); $event['participants'] = array(calendar_so::combine_user('u',$event['owner']) => 'ACHAIR');
$event['participant_types'] = array('u' => array($event['owner']=>'ACHAIR')); $event['participant_types'] = array('u' => array($event['owner']=>'ACHAIR'));
@ -1249,6 +1250,12 @@ class calendar_uiforms extends calendar_ui
// Add infolog link to calendar entry // Add infolog link to calendar entry
egw_link::link('calendar',$link_to_id,$infolog['info_link']['app'],$infolog['info_link']['id']); egw_link::link('calendar',$link_to_id,$infolog['info_link']['app'],$infolog['info_link']['id']);
// Copy infolog's links
foreach(egw_link::get_links('infolog',$link_id) as $copy_link)
{
egw_link::link('calendar', $link_to_id, $copy_link['app'], $copy_link['id'],$copy_link['remark']);
}
break; break;
default: default:
$event['title'] = egw_link::title($link_app,$link_id); $event['title'] = egw_link::title($link_app,$link_id);