Merge pull request #2529 from annando/1605-events

Issue 2277: Events can now be edited and deleted
This commit is contained in:
Tobias Diekershoff 2016-05-23 18:06:09 +02:00
commit c013ca9d36
2 changed files with 3 additions and 16 deletions

View file

@ -291,10 +291,6 @@ function event_store($arr) {
`type` = '%s', `type` = '%s',
`adjust` = %d, `adjust` = %d,
`nofinish` = %d, `nofinish` = %d,
`allow_cid` = '%s',
`allow_gid` = '%s',
`deny_cid` = '%s',
`deny_gid` = '%s'
WHERE `id` = %d AND `uid` = %d", WHERE `id` = %d AND `uid` = %d",
dbesc($arr['edited']), dbesc($arr['edited']),
@ -306,10 +302,6 @@ function event_store($arr) {
dbesc($arr['type']), dbesc($arr['type']),
intval($arr['adjust']), intval($arr['adjust']),
intval($arr['nofinish']), intval($arr['nofinish']),
dbesc($arr['allow_cid']),
dbesc($arr['allow_gid']),
dbesc($arr['deny_cid']),
dbesc($arr['deny_gid']),
intval($arr['id']), intval($arr['id']),
intval($arr['uid']) intval($arr['uid'])
); );
@ -323,22 +315,16 @@ function event_store($arr) {
$object .= '</object>' . "\n"; $object .= '</object>' . "\n";
q("UPDATE `item` SET `body` = '%s', `object` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `edited` = '%s', `private` = %d WHERE `id` = %d AND `uid` = %d", q("UPDATE `item` SET `body` = '%s', `object` = '%s', `edited` = '%s' WHERE `id` = %d AND `uid` = %d",
dbesc(format_event_bbcode($arr)), dbesc(format_event_bbcode($arr)),
dbesc($object), dbesc($object),
dbesc($arr['allow_cid']),
dbesc($arr['allow_gid']),
dbesc($arr['deny_cid']),
dbesc($arr['deny_gid']),
dbesc($arr['edited']), dbesc($arr['edited']),
intval($arr['private']),
intval($r[0]['id']), intval($r[0]['id']),
intval($arr['uid']) intval($arr['uid'])
); );
$item_id = $r[0]['id']; $item_id = $r[0]['id'];
} } else
else
$item_id = 0; $item_id = 0;
call_hooks("event_updated", $arr['id']); call_hooks("event_updated", $arr['id']);

View file

@ -124,6 +124,7 @@ function events_post(&$a) {
$datarray = array(); $datarray = array();
$datarray['guid'] = get_guid(32);
$datarray['start'] = $start; $datarray['start'] = $start;
$datarray['finish'] = $finish; $datarray['finish'] = $finish;
$datarray['summary'] = $summary; $datarray['summary'] = $summary;