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')) { if (!Config::get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays(); $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')) { if (!$gid && !$cid && !$update && !Config::get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays(); $o .= Profile::getBirthdays();
$o .= Profile::getEvents(); $o .= Profile::getEventsReminderHTML();
} }
if ($datequery) { if ($datequery) {

View file

@ -352,7 +352,7 @@ function profile_content(App $a, $update = 0)
if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) { if ($is_owner && !$update && !Config::get('theme', 'hide_eventlist')) {
$o .= Profile::getBirthdays(); $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(); $a = get_app();
$o = ''; $o = '';
@ -642,9 +642,21 @@ class Profile
$classtoday = ''; $classtoday = '';
$s = dba::p( $s = dba::p(
"SELECT `event`.* FROM `event` "SELECT `event`.*, `item`.`id`, `item`.`thr-parent`, `item`.`parent-uri`
WHERE `event`.`uid` = ? AND `type` != 'birthday' AND `start` < ? AND `start` >= ? FROM `event`
ORDER BY `start` ASC ", 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(), local_user(),
DateTimeFormat::utc('now + 7 days'), DateTimeFormat::utc('now + 7 days'),
DateTimeFormat::utc('now - 1 days') DateTimeFormat::utc('now - 1 days')