aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-01-01 19:51:44 -0800
committerzotlabs <mike@macgirvin.com>2017-01-01 19:51:44 -0800
commitb88a735e54b233770b6772e89876fcc66b6217eb (patch)
tree1d2479cbddda4a1d96475f2ac4b77a1b9f244f1a
parentdca4de80fd8dfc2e23f6e7bec73b8bf79cdfa8ca (diff)
downloadvolse-hubzilla-b88a735e54b233770b6772e89876fcc66b6217eb.tar.gz
volse-hubzilla-b88a735e54b233770b6772e89876fcc66b6217eb.tar.bz2
volse-hubzilla-b88a735e54b233770b6772e89876fcc66b6217eb.zip
feature: allow event creation in other timezones than your own.
-rw-r--r--Zotlabs/Module/Events.php10
-rw-r--r--include/features.php9
-rwxr-xr-xview/tpl/event_form.tpl4
3 files changed, 21 insertions, 2 deletions
diff --git a/Zotlabs/Module/Events.php b/Zotlabs/Module/Events.php
index 863bdf3cb..c3d1dd89c 100644
--- a/Zotlabs/Module/Events.php
+++ b/Zotlabs/Module/Events.php
@@ -43,6 +43,10 @@ class Events extends \Zotlabs\Web\Controller {
$adjust = intval($_POST['adjust']);
$nofinish = intval($_POST['nofinish']);
+ $timezone = ((x($_POST,'timezone_select')) ? notags(trim($_POST['timezone_select'])) : '');
+
+ $tz = (($timezone) ? $timezone : date_default_timezone_get());
+
$categories = escape_tags(trim($_POST['category']));
// only allow editing your own events.
@@ -71,9 +75,9 @@ class Events extends \Zotlabs\Web\Controller {
if($adjust) {
- $start = datetime_convert(date_default_timezone_get(),'UTC',$start);
+ $start = datetime_convert($tz,'UTC',$start);
if(! $nofinish)
- $finish = datetime_convert(date_default_timezone_get(),'UTC',$finish);
+ $finish = datetime_convert($tz,'UTC',$finish);
}
else {
$start = datetime_convert('UTC','UTC',$start);
@@ -478,6 +482,8 @@ class Events extends \Zotlabs\Web\Controller {
'$allow_gid' => acl2json($permissions['allow_gid']),
'$deny_cid' => acl2json($permissions['deny_cid']),
'$deny_gid' => acl2json($permissions['deny_gid']),
+ '$tz_choose' => feature_enabled(local_channel(),'event_tz_select'),
+ '$timezone' => array('timezone_select' , t('Timezone:'), date_default_timezone_get(), '', get_timezones()),
'$lockstate' => (($acl->is_private()) ? 'lock' : 'unlock'),
diff --git a/include/features.php b/include/features.php
index 1ccdbf015..8ff0d2d21 100644
--- a/include/features.php
+++ b/include/features.php
@@ -157,6 +157,15 @@ function get_features($filtered = true) {
feature_level('smart_birthdays',2),
],
+ [
+ 'event_tz_select',
+ t('Event Timezone Selection'),
+ t('Allow event creation in timezones other than your own.'),
+ false,
+ get_config('feature_lock','event_tz_select'),
+ feature_level('event_tz_select',2),
+ ],
+
[
'advanced_dirsearch',
t('Advanced Directory Search'),
diff --git a/view/tpl/event_form.tpl b/view/tpl/event_form.tpl
index 2c1fc762c..8a06567c1 100755
--- a/view/tpl/event_form.tpl
+++ b/view/tpl/event_form.tpl
@@ -10,6 +10,10 @@
{{include file="field_input.tpl" field=$summary}}
+ {{if $tz_choose}}
+ {{include file="field_select_grouped.tpl" field=$timezone}}
+ {{/if}}
+
{{$s_dsel}}
{{$f_dsel}}