]> git.mxchange.org Git - friendica.git/commitdiff
Add attendance check to event reminder
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 28 Feb 2018 01:47:18 +0000 (20:47 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Wed, 28 Feb 2018 01:47:18 +0000 (20:47 -0500)
mod/network.php
mod/profile.php
src/Model/Profile.php

index 2d9a829ce48124c4b1630fa2c30ee0c37e76d64e..5b9e2a6fb974adc50cc612cd6a8755cf4984ee8a 100644 (file)
@@ -439,7 +439,7 @@ function networkFlatView(App $a, $update = 0)
 
                if (!Config::get('theme', 'hide_eventlist')) {
                        $o .= Profile::getBirthdays();
-                       $o .= Profile::getEvents();
+                       $o .= Profile::getEventsReminderHTML();
                }
        }
 
@@ -677,7 +677,7 @@ function networkThreadedView(App $a, $update = 0)
 
        if (!$gid && !$cid && !$update && !Config::get('theme', 'hide_eventlist')) {
                $o .= Profile::getBirthdays();
-               $o .= Profile::getEvents();
+               $o .= Profile::getEventsReminderHTML();
        }
 
        if ($datequery) {
index 74ca06aad9fb9e4e7b5155c73f2df8b830072c09..5e5988994cbe0965c58060bb1a0f87239d74f908 100644 (file)
@@ -352,7 +352,7 @@ function profile_content(App $a, $update = 0)
 
        if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) {
                $o .= Profile::getBirthdays();
-               $o .= Profile::getEvents();
+               $o .= Profile::getEventsReminderHTML();
        }
 
 
index 81f99630994173c0a5867446d58f39ff56b05af8..c91fdc1a9e32d69f8d1d31e46f7898fe2a05e0b8 100644 (file)
@@ -622,7 +622,7 @@ class Profile
                ]);
        }
 
-       public static function getEvents()
+       public static function getEventsReminderHTML()
        {
                $a = get_app();
                $o = '';
@@ -642,9 +642,21 @@ class Profile
                $classtoday = '';
 
                $s = dba::p(
-                       "SELECT `event`.* FROM `event`
-                       WHERE `event`.`uid` = ? AND `type` != 'birthday' AND `start` < ? AND `start` >= ?
-                       ORDER BY `start` ASC ",
+                       "SELECT `event`.*, `item`.`id`, `item`.`thr-parent`, `item`.`parent-uri`
+                       FROM `event`
+                       LEFT JOIN `item`
+                               ON `item`.`uid` = `event`.`uid`
+                               AND `item`.`parent-uri` = `event`.`uri`
+                               AND `item`.`verb` = ?
+                               AND `item`.`visible`
+                               AND NOT `item`.`deleted`
+                       WHERE `event`.`uid` = ?
+                       AND  `event`.`type` != 'birthday'
+                       AND  `event`.`start` < ?
+                       AND  `event`.`start` >= ?
+                       AND `item`.`id` IS NULL
+                       ORDER BY  `event`.`start` ASC",
+                       ACTIVITY_ATTENDNO,
                        local_user(),
                        DateTimeFormat::utc('now + 7 days'),
                        DateTimeFormat::utc('now - 1 days')