aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2019-05-20 13:51:53 +0200
committerMario Vavti <mario@mariovavti.com>2019-05-20 13:51:53 +0200
commitc9d64d75f3acab6b44d28cd7bcc6e7e5dd042e77 (patch)
treeafc3304380859d44e651a534a523c1629ab9557b
parent9651689bb811630612397dde6281c27bdc649036 (diff)
downloadvolse-hubzilla-c9d64d75f3acab6b44d28cd7bcc6e7e5dd042e77.tar.gz
volse-hubzilla-c9d64d75f3acab6b44d28cd7bcc6e7e5dd042e77.tar.bz2
volse-hubzilla-c9d64d75f3acab6b44d28cd7bcc6e7e5dd042e77.zip
move smart birthday feature to calendar settings and override the adjust flag at display time instead of import
-rw-r--r--Zotlabs/Module/Channel_calendar.php3
-rw-r--r--include/datetime.php2
-rw-r--r--include/features.php16
3 files changed, 12 insertions, 9 deletions
diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php
index 87bac2762..96d32039e 100644
--- a/Zotlabs/Module/Channel_calendar.php
+++ b/Zotlabs/Module/Channel_calendar.php
@@ -345,6 +345,9 @@ class Channel_calendar extends \Zotlabs\Web\Controller {
if(! $tz)
$tz = 'UTC';
+ if($rr['etype'] === 'birthday')
+ $rr['adjust'] = intval(feature_enabled(local_channel(), 'smart_birthdays'));
+
$start = (($rr['adjust']) ? datetime_convert($tz, date_default_timezone_get(), $rr['dtstart'], 'c') : datetime_convert('UTC', 'UTC', $rr['dtstart'], 'c'));
if ($rr['nofinish']){
$end = null;
diff --git a/include/datetime.php b/include/datetime.php
index 3a07f1ccf..d049fc7c5 100644
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -516,7 +516,7 @@ function update_birthdays() {
'event_xchan' => $rr['xchan_hash'],
'dtstart' => datetime_convert('UTC', 'UTC', $rr['abook_dob']),
'dtend' => datetime_convert('UTC', 'UTC', $rr['abook_dob'] . ' + 1 day '),
- 'adjust' => intval(feature_enabled($rr['abook_channel'],'smart_birthdays')),
+ 'adjust' => 1, //intval(feature_enabled($rr['abook_channel'],'smart_birthdays')),
'summary' => sprintf( t('%1$s\'s birthday'), $rr['xchan_name']),
'description' => sprintf( t('Happy Birthday %1$s'), '[zrl=' . $rr['xchan_url'] . ']' . $rr['xchan_name'] . '[/zrl]'),
'etype' => 'birthday',
diff --git a/include/features.php b/include/features.php
index 431b199a5..a44b424a6 100644
--- a/include/features.php
+++ b/include/features.php
@@ -95,6 +95,14 @@ function get_features($filtered = true, $level = (-1)) {
t('Allow event creation in timezones other than your own.'),
false,
get_config('feature_lock','event_tz_select'),
+ ],
+
+ [
+ 'smart_birthdays',
+ t('Smart Birthdays'),
+ t('Make birthday events timezone aware in case your friends are scattered across the planet.'),
+ true,
+ get_config('feature_lock','smart_birthdays'),
]
],
@@ -290,14 +298,6 @@ function get_features($filtered = true, $level = (-1)) {
t('Default is Sunday'),
false,
get_config('feature_lock','events_cal_first_day')
- ],
-
- [
- 'smart_birthdays',
- t('Smart Birthdays'),
- t('Make birthday events timezone aware in case your friends are scattered across the planet.'),
- true,
- get_config('feature_lock','smart_birthdays'),
]
],