mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 18:08:02 +02:00
Infolog: When creating an event from an infolog, don't send an invalid category ID. Fixes validation error when saving the event.
This commit is contained in:
parent
558d6a5d0c
commit
c0f29e406f
@ -680,10 +680,22 @@ class infolog_ui
|
|||||||
'end' => $infolog['info_enddate'] ? $infolog['info_enddate'] : $infolog['info_datecompleted']
|
'end' => $infolog['info_enddate'] ? $infolog['info_enddate'] : $infolog['info_datecompleted']
|
||||||
));
|
));
|
||||||
unset($event['entry_id']);
|
unset($event['entry_id']);
|
||||||
if (!$event['end']) $event['end'] = $event['start'] + (int) $GLOBALS['egw_info']['user']['preferences']['calendar']['defaultlength']*60;
|
if(!$event['end'])
|
||||||
|
{
|
||||||
|
$event['end'] = $event['start'] + (int)$GLOBALS['egw_info']['user']['preferences']['calendar']['defaultlength'] * 60;
|
||||||
|
}
|
||||||
|
|
||||||
// Match Api\Categories by name
|
// Match Api\Categories by name
|
||||||
|
if($infolog['info_cat'])
|
||||||
|
{
|
||||||
$event['category'] = $GLOBALS['egw']->categories->name2id(Api\Categories::id2name($infolog['info_cat']));
|
$event['category'] = $GLOBALS['egw']->categories->name2id(Api\Categories::id2name($infolog['info_cat']));
|
||||||
|
}
|
||||||
|
if(!$event['category'] || $event['category'] === '0')
|
||||||
|
{
|
||||||
|
// No matching category found, don't send an invalid category
|
||||||
|
unset($event['category']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// make current user the owner of the new event, not the selected calendar, if current user has rights for it
|
// make current user the owner of the new event, not the selected calendar, if current user has rights for it
|
||||||
$event['owner'] = $user = $GLOBALS['egw_info']['user']['account_id'];
|
$event['owner'] = $user = $GLOBALS['egw_info']['user']['account_id'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user