Add attendance check to event reminder

This commit is contained in:
Hypolite Petovan 2018-02-27 20:47:18 -05:00
parent 99bea7f4c4
commit f58d8f4108
3 changed files with 19 additions and 7 deletions

View 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) {

View 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();
}

View 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')