Merge pull request #4515 from MrPetovan/task/4513-hide-attendno-events

Add attendance check to event reminder
This commit is contained in:
Michael Vogel 2018-02-28 15:29:16 +01:00 committed by GitHub
commit 617ace38e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 8 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, $parent)
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,12 +642,26 @@ 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 *
FROM `event`
WHERE `event`.`uid` = ?
AND `event`.`type` != 'birthday'
AND `event`.`start` < ?
AND `event`.`start` >= ?
AND NOT EXISTS (
SELECT `id`
FROM `item`
WHERE `item`.`uid` = `event`.`uid`
AND `item`.`parent-uri` = `event`.`uri`
AND `item`.`verb` = ?
AND `item`.`visible`
AND NOT `item`.`deleted`
)
ORDER BY `event`.`start` ASC",
local_user(),
DateTimeFormat::utc('now + 7 days'),
DateTimeFormat::utc('now - 1 days')
DateTimeFormat::utc('now - 1 days'),
ACTIVITY_ATTENDNO
);
$r = [];