From bead3e6095066990afe982fc63e86f2bbd4d109f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 1 Jan 2017 14:15:07 -0800 Subject: profile vcard - generate vcard on profile update --- Zotlabs/Module/Profiles.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php index a1689e6ed..72a056963 100644 --- a/Zotlabs/Module/Profiles.php +++ b/Zotlabs/Module/Profiles.php @@ -243,6 +243,7 @@ class Profiles extends \Zotlabs\Web\Controller { check_form_security_token_redirectOnErr('/profiles', 'profile_edit'); + $is_default = (($orig[0]['is_default']) ? 1 : 0); $profile_name = notags(trim($_POST['profile_name'])); @@ -315,6 +316,15 @@ class Profiles extends \Zotlabs\Web\Controller { $hide_friends = ((intval($_POST['hide_friends'])) ? 1: 0); + + $orig_vcard = (($orig[0]['profile_vcard']) ? \Sabre\VObject\Reader::read($orig[0]['profile_vcard']) : null); + + $_REQUEST['fn'] = $name; + $_REQUEST['title'] = $pdesc; + + $profile_vcard = update_vcard($_REQUEST,$orig_vcard); + + require_once('include/text.php'); linkify_tags($a, $likes, local_channel()); linkify_tags($a, $dislikes, local_channel()); @@ -511,7 +521,8 @@ class Profiles extends \Zotlabs\Web\Controller { romance = '%s', employment = '%s', education = '%s', - hide_friends = %d + hide_friends = %d, + profile_vcard = '%s' WHERE id = %d AND uid = %d", dbesc($profile_name), dbesc($name), @@ -546,6 +557,7 @@ class Profiles extends \Zotlabs\Web\Controller { dbesc($work), dbesc($education), intval($hide_friends), + dbesc($profile_vcard), intval(argv(1)), intval(local_channel()) ); -- cgit v1.2.3 From b88a735e54b233770b6772e89876fcc66b6217eb Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 1 Jan 2017 19:51:44 -0800 Subject: feature: allow event creation in other timezones than your own. --- Zotlabs/Module/Events.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Zotlabs/Module') 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'), -- cgit v1.2.3