]> git.mxchange.org Git - friendica.git/blobdiff - mod/events.php
Just some more fixed notice
[friendica.git] / mod / events.php
index 22a9b4677db4045c77f68656ce552ae60b8fcc93..7914b93d09ef9f0cb5fa875586ccbe0977434416 100644 (file)
@@ -25,21 +25,21 @@ function events_init(App $a) {
                return;
        }
 
-       if ($a->argc > 1) {
-               // If it's a json request abort here because we don't
-               // need the widget data
-               if ($a->argv[1] === 'json') {
-                       return;
-               }
+       // If it's a json request abort here because we don't
+       // need the widget data
+       if ($a->argc > 1 && $a->argv[1] === 'json') {
+               return;
+       }
 
-               $cal_widget = CalendarExport::getHTML();
+       if (empty($a->page['aside'])) {
+               $a->page['aside'] = '';
+       }
 
-               if (! x($a->page,'aside')) {
-                       $a->page['aside'] = '';
-               }
+       $a->data['user'] = $_SESSION['user'];
 
-               $a->page['aside'] .= $cal_widget;
-       }
+       $cal_widget = CalendarExport::getHTML();
+
+       $a->page['aside'] .= $cal_widget;
 
        return;
 }
@@ -339,7 +339,7 @@ function events_content(App $a) {
 
                // get events by id or by date
                if ($event_params['event_id']) {
-                       $r = Event::getListById(local_user(), $event_params['event-id']);
+                       $r = Event::getListById(local_user(), $event_params['event_id']);
                } else {
                        $r = Event::getListByDate(local_user(), $event_params);
                }
@@ -370,7 +370,7 @@ function events_content(App $a) {
                }
 
                if (x($_GET, 'id')) {
-                       $tpl =  get_markup_template("event.tpl");
+                       $tpl = get_markup_template("event.tpl");
                } else {
                        $tpl = get_markup_template("events_js.tpl");
                }
@@ -433,6 +433,7 @@ function events_content(App $a) {
                if (x($_REQUEST, 'location'))    {$orig_event['location']    = $_REQUEST['location'];}
                if (x($_REQUEST, 'start'))       {$orig_event['start']       = $_REQUEST['start'];}
                if (x($_REQUEST, 'finish'))      {$orig_event['finish']      = $_REQUEST['finish'];}
+               if (x($_REQUEST,'finish')) $orig_event['finish'] = $_REQUEST['finish'];
 
                $n_checked = ((x($orig_event) && $orig_event['nofinish']) ? ' checked="checked" ' : '');
                $a_checked = ((x($orig_event) && $orig_event['adjust'])   ? ' checked="checked" ' : '');
@@ -545,7 +546,7 @@ function events_content(App $a) {
 
                // Delete only real events (no birthdays)
                if (DBM::is_result($ev) && $ev[0]['type'] == 'event') {
-                       $del = Item::deleteById($ev[0]['itemid']);
+                       $del = Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
                }
 
                if ($del == 0) {