aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Zotlabs/Module/Events.php10
-rw-r--r--Zotlabs/Module/Profiles.php14
-rw-r--r--doc/roadmap_hz3.md23
-rw-r--r--include/features.php9
-rw-r--r--view/css/mod_profile.css108
-rw-r--r--view/css/mod_profiles.css107
-rw-r--r--view/js/mod_profiles.js66
-rwxr-xr-xview/tpl/event_form.tpl4
-rw-r--r--view/tpl/wiki.tpl12
9 files changed, 344 insertions, 9 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/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())
);
diff --git a/doc/roadmap_hz3.md b/doc/roadmap_hz3.md
new file mode 100644
index 000000000..9f24cf1f2
--- /dev/null
+++ b/doc/roadmap_hz3.md
@@ -0,0 +1,23 @@
+
+Hubzilla III
+============
+
+Due: December 2017
+Codename:
+
+
+Wishlist:
+
+- Move CalDAV/CardDAV server to core
+
+- Integrate Hubzilla events with CalDAV
+
+- Connection 'roles' allows you to select different permission roles for your connections; such as follower, friend, contributor, etc.
+
+- CardDAV integration with abook and profiles
+
+- App tray
+
+- issues manager
+
+- wiki cloning \ No newline at end of file
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/css/mod_profile.css b/view/css/mod_profile.css
index 35016d10b..6591f8a57 100644
--- a/view/css/mod_profile.css
+++ b/view/css/mod_profile.css
@@ -5,3 +5,111 @@
.profile-thing-img {
margin: 7px 0px;
}
+
+.vcard-header {
+ cursor: pointer;
+ padding: 7px 10px;
+ margin-bottom: 3px;
+}
+
+.vcard-header:hover,
+.vcard-header.active {
+ background-color: rgb(238,238,238);
+ cursor: pointer;
+}
+
+.vcard-header.active:hover {
+ cursor: initial;
+}
+
+.vcard-add-field {
+ margin-top: 8px;
+ display: none;
+}
+
+.vcard-cancel {
+ margin: 6px 10px;
+ height: 32px;
+ line-height: 32px;
+ color: #777;
+ font-size: 16px;
+
+ cursor: pointer;
+ display: none;
+ float: right;
+}
+
+.vcard-info {
+ display: none;
+}
+
+.vcard-nophoto {
+ display: inline-block;
+ width: 32px;
+ height: 32px;
+ border-radius: 4px;
+ border: 1px solid #ccc;
+ text-align: center;
+ font-size: 20px;
+ color: #fff;
+ background-color: #ddd;
+}
+
+.vcard-photo {
+ width: 32px;
+ height: 32px;
+ border-radius: 4px;
+ border: 1px solid #ccc;
+ text-align: center;
+}
+
+.vcard-fn-preview,
+input.vcard-fn {
+ font-size: 16px !important;
+ margin-left: 5px;
+}
+
+.vcard-email-preview,
+.vcard-tel-preview {
+ color: #999;
+}
+
+
+.vcard-fn,
+#create_form,
+#more_block {
+ display: none;
+}
+
+input.vcard-fn,
+.vcard-fn-create input,
+.vcard-org input,
+.vcard-title input,
+.vcard-tel input,
+.vcard-email input,
+.vcard-impp input,
+.vcard-url input,
+.vcard-adr input,
+.vcard-note input {
+ padding: 0px;
+ margin-left: 5px;
+ border-width: 0px 0px 1px 0px;
+ border-radius: 0px;
+ background-color: transparent;
+ min-width: 160px;
+}
+
+#template-form-vcard-org,
+#template-form-vcard-title,
+#template-form-vcard-tel,
+#template-form-vcard-email,
+#template-form-vcard-impp,
+#template-form-vcard-url,
+#template-form-vcard-adr,
+#template-form-vcard-note {
+ display: none;
+}
+
+.connphone {
+ color: green;
+}
diff --git a/view/css/mod_profiles.css b/view/css/mod_profiles.css
index 4d83e6419..bd2a449ed 100644
--- a/view/css/mod_profiles.css
+++ b/view/css/mod_profiles.css
@@ -29,3 +29,110 @@
height: 48px;
margin: 10px 0px;
}
+.vcard-header {
+ cursor: pointer;
+ padding: 7px 10px;
+ margin-bottom: 3px;
+}
+
+.vcard-header:hover,
+.vcard-header.active {
+ background-color: rgb(238,238,238);
+ cursor: pointer;
+}
+
+.vcard-header.active:hover {
+ cursor: initial;
+}
+
+.vcard-add-field {
+ margin-top: 8px;
+ display: none;
+}
+
+.vcard-cancel {
+ margin: 6px 10px;
+ height: 32px;
+ line-height: 32px;
+ color: #777;
+ font-size: 16px;
+
+ cursor: pointer;
+ display: none;
+ float: right;
+}
+
+.vcard-info {
+ display: none;
+}
+
+.vcard-nophoto {
+ display: inline-block;
+ width: 32px;
+ height: 32px;
+ border-radius: 4px;
+ border: 1px solid #ccc;
+ text-align: center;
+ font-size: 20px;
+ color: #fff;
+ background-color: #ddd;
+}
+
+.vcard-photo {
+ width: 32px;
+ height: 32px;
+ border-radius: 4px;
+ border: 1px solid #ccc;
+ text-align: center;
+}
+
+.vcard-fn-preview,
+input.vcard-fn {
+ font-size: 16px !important;
+ margin-left: 5px;
+}
+
+.vcard-email-preview,
+.vcard-tel-preview {
+ color: #999;
+}
+
+
+.vcard-fn,
+#create_form,
+#more_block {
+ display: none;
+}
+
+input.vcard-fn,
+.vcard-fn-create input,
+.vcard-org input,
+.vcard-title input,
+.vcard-tel input,
+.vcard-email input,
+.vcard-impp input,
+.vcard-url input,
+.vcard-adr input,
+.vcard-note input {
+ padding: 0px;
+ margin-left: 5px;
+ border-width: 0px 0px 1px 0px;
+ border-radius: 0px;
+ background-color: transparent;
+ min-width: 160px;
+}
+
+#template-form-vcard-org,
+#template-form-vcard-title,
+#template-form-vcard-tel,
+#template-form-vcard-email,
+#template-form-vcard-impp,
+#template-form-vcard-url,
+#template-form-vcard-adr,
+#template-form-vcard-note {
+ display: none;
+}
+
+.connphone {
+ color: green;
+} \ No newline at end of file
diff --git a/view/js/mod_profiles.js b/view/js/mod_profiles.js
index a7754e0c5..acc9f9953 100644
--- a/view/js/mod_profiles.js
+++ b/view/js/mod_profiles.js
@@ -1,4 +1,70 @@
$(document).ready(function() {
$('form').areYouSure(); // Warn user about unsaved settings
$('textarea').bbco_autocomplete('bbcode');
+
+ $(document).on('click', '.vcard-header, .vcard-cancel-btn', updateView);
+ $(document).on('click', '.add-field', doAdd);
+ $(document).on('click', '.remove-field', doRemove);
+
+ function updateView() {
+ var id = $(this).data('id');
+ var action = $(this).data('action');
+ var header = $('#vcard-header-' + id);
+ var cancel = $('#vcard-cancel-' + id);
+ var addField = $('#vcard-add-field-' + id);
+ var info = $('#vcard-info-' + id);
+ var vcardPreview = $('#vcard-preview-' + id);
+ var fn = $('#vcard-fn-' + id);
+
+ if(action === 'open') {
+ $(header).addClass('active');
+ $(cancel).show();
+ $(addField).show();
+ $(info).show();
+ $(fn).show();
+ $(vcardPreview).hide();
+ }
+ else {
+ $(header).removeClass('active');
+ $(cancel).hide();
+ $(addField).hide();
+ $(info).hide();
+ $(fn).hide();
+ $(vcardPreview).show();
+ }
+ }
+
+ function doAdd() {
+ var what = $(this).data('add');
+ var id = $(this).data('id');
+ var element = '#template-form-' + what;
+ var where = '#abook-edit-form';
+
+ $(element + ' .remove-field').attr('data-id', id)
+
+ if(what === 'vcard-adr') {
+ var adrCount = $(where + ' .form-' + what).length;
+ var attrName = 'adr[' + adrCount + '][]';
+ $(element + ' input').attr('name', attrName);
+ }
+
+ if(what === 'vcard-org' || what === 'vcard-title' || what === 'vcard-note') {
+ $(where + ' .add-' + what).hide()
+ }
+
+ $(element).clone().removeAttr('id').appendTo(where + ' .form-' + what + '-wrapper');
+ }
+
+ function doRemove() {
+ var what = $(this).data('remove');
+ var element = $(this).parents('div.form-' + what);
+ var where = '#abook_edit_form' + $(this).data('id');
+
+ if(what === 'vcard-org' || what === 'vcard-title' || what === 'vcard-note') {
+ $(where + ' .add-' + what).show()
+ }
+
+ $(element).remove();
+ }
+
});
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}}
diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl
index 1b0b06132..8ad010168 100644
--- a/view/tpl/wiki.tpl
+++ b/view/tpl/wiki.tpl
@@ -368,7 +368,7 @@
$.post("embedphotos/album", {name: album},
function(data) {
if (data['status']) {
- $('#embedPhotoModalLabel').html('{{$modalchooseimages}}');
+ $('#embedPhotoModalLabel').html("{{$modalchooseimages}}");
$('#embedPhotoModalBodyAlbumDialog').html('\
<div><ul class="nav">\n\
<li><a href="#" onclick="initializeEmbedPhotoDialog();return false;">\n\
@@ -402,7 +402,7 @@
$('#editor').val(currentContent + ddata['photolink']);
{{/if}}
} else {
- window.console.log('{{$modalerrorlink}}' + ':' + ddata['errormsg']);
+ window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
}
return false;
},
@@ -413,7 +413,7 @@
$('#embedPhotoModal').modal('hide');
});
} else {
- window.console.log('{{$modalerroralbum}} ' + JSON.stringify(album) + ':' + data['errormsg']);
+ window.console.log("{{$modalerroralbum}} " + JSON.stringify(album) + ':' + data['errormsg']);
}
return false;
},
@@ -425,19 +425,19 @@
function(data) {
if (data['status']) {
var albums = data['albumlist']; //JSON.parse(data['albumlist']);
- $('#embedPhotoModalLabel').html('{{$modalchoosealbum}}');
+ $('#embedPhotoModalLabel').html("{{$modalchoosealbum}}");
$('#embedPhotoModalBodyAlbumList').html('<ul class="nav"></ul>');
for(var i=0; i<albums.length; i++) {
var albumName = albums[i].text;
var albumLink = '<li>';
- albumLink += '<a href="#" onclick="choosePhotoFromAlbum(\'' + albumName + '\');return false;">' + albumName + '</a>';
+ albumLink += '<a href="#" onclick="choosePhotoFromAlbum("' + albumName + '");return false;">' + albumName + '</a>';
albumLink += '</li>';
$('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink);
}
$('#embedPhotoModalBodyAlbumDialog').addClass('hide');
$('#embedPhotoModalBodyAlbumListDialog').removeClass('hide');
} else {
- window.console.log('{{$modalerrorlist}}' + ':' + data['errormsg']);
+ window.console.log("{{$modalerrorlist}}" + ':' + data['errormsg']);
}
return false;
},