Fix getBirthdays()
- Formatting optimizations - Remove redundant ASC
This commit is contained in:
parent
6eab7d9f14
commit
7b3515e706
1 changed files with 10 additions and 10 deletions
|
@ -495,7 +495,7 @@ class Profile
|
||||||
$bd_short = DI::l10n()->t('F d');
|
$bd_short = DI::l10n()->t('F d');
|
||||||
|
|
||||||
$cachekey = 'get_birthdays:' . local_user();
|
$cachekey = 'get_birthdays:' . local_user();
|
||||||
$events = DI::cache()->get($cachekey);
|
$events = DI::cache()->get($cachekey);
|
||||||
if (is_null($events)) {
|
if (is_null($events)) {
|
||||||
$result = DBA::p(
|
$result = DBA::p(
|
||||||
"SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event`
|
"SELECT `event`.*, `event`.`id` AS `eid`, `contact`.* FROM `event`
|
||||||
|
@ -508,7 +508,7 @@ class Profile
|
||||||
AND NOT `contact`.`archive`
|
AND NOT `contact`.`archive`
|
||||||
AND NOT `contact`.`deleted`
|
AND NOT `contact`.`deleted`
|
||||||
WHERE `event`.`uid` = ? AND `type` = 'birthday' AND `start` < ? AND `finish` > ?
|
WHERE `event`.`uid` = ? AND `type` = 'birthday' AND `start` < ? AND `finish` > ?
|
||||||
ORDER BY `start` ASC ",
|
ORDER BY `start`",
|
||||||
Contact::SHARING,
|
Contact::SHARING,
|
||||||
Contact::FRIEND,
|
Contact::FRIEND,
|
||||||
local_user(),
|
local_user(),
|
||||||
|
@ -521,11 +521,11 @@ class Profile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$total = 0;
|
$total = 0;
|
||||||
$classtoday = '';
|
$classtoday = '';
|
||||||
$tpl_events = [];
|
$tpl_events = [];
|
||||||
if (DBA::isResult($events)) {
|
if (DBA::isResult($events)) {
|
||||||
$now = strtotime('now');
|
$now = strtotime('now');
|
||||||
$cids = [];
|
$cids = [];
|
||||||
|
|
||||||
$istoday = false;
|
$istoday = false;
|
||||||
|
@ -563,13 +563,13 @@ class Profile
|
||||||
}
|
}
|
||||||
$tpl = Renderer::getMarkupTemplate('birthdays_reminder.tpl');
|
$tpl = Renderer::getMarkupTemplate('birthdays_reminder.tpl');
|
||||||
return Renderer::replaceMacros($tpl, [
|
return Renderer::replaceMacros($tpl, [
|
||||||
'$classtoday' => $classtoday,
|
'$classtoday' => $classtoday,
|
||||||
'$count' => $total,
|
'$count' => $total,
|
||||||
'$event_reminders' => DI::l10n()->t('Birthday Reminders'),
|
'$event_reminders' => DI::l10n()->t('Birthday Reminders'),
|
||||||
'$event_title' => DI::l10n()->t('Birthdays this week:'),
|
'$event_title' => DI::l10n()->t('Birthdays this week:'),
|
||||||
'$events' => $tpl_events,
|
'$events' => $tpl_events,
|
||||||
'$lbr' => '{', // raw brackets mess up if/endif macro processing
|
'$lbr' => '{', // raw brackets mess up if/endif macro processing
|
||||||
'$rbr' => '}'
|
'$rbr' => '}'
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue