Merge branch 'master' into dev/elastic
This commit is contained in:
commit
58963791cc
5 changed files with 29 additions and 13 deletions
|
@ -3994,7 +3994,7 @@ function rcube_calendar_ui(settings)
|
||||||
$('#edit-allday').click(function(){ $('#edit-starttime, #edit-endtime')[(this.checked?'hide':'show')](); event_times_changed(); });
|
$('#edit-allday').click(function(){ $('#edit-starttime, #edit-endtime')[(this.checked?'hide':'show')](); event_times_changed(); });
|
||||||
|
|
||||||
// configure drop-down menu on time input fields based on jquery UI autocomplete
|
// configure drop-down menu on time input fields based on jquery UI autocomplete
|
||||||
$('#edit-starttime, #edit-endtime, #eventedit input.edit-alarm-time').each(function() {
|
$('#edit-starttime, #edit-endtime').each(function() {
|
||||||
me.init_time_autocomplete(this, {
|
me.init_time_autocomplete(this, {
|
||||||
container: '#eventedit',
|
container: '#eventedit',
|
||||||
change: event_times_changed
|
change: event_times_changed
|
||||||
|
|
|
@ -391,12 +391,13 @@ function rcube_libcalendaring(settings)
|
||||||
});
|
});
|
||||||
$(prefix+' select.edit-alarm-offset').change(function(){
|
$(prefix+' select.edit-alarm-offset').change(function(){
|
||||||
var val = $(this).val(), parent = $(this).parent();
|
var val = $(this).val(), parent = $(this).parent();
|
||||||
parent.find('.edit-alarm-date, .edit-alarm-time')[val == '@' ? 'show' : 'hide']();
|
parent.find('.edit-alarm-date, .edit-alarm-time')[val === '@' ? 'show' : 'hide']();
|
||||||
parent.find('.edit-alarm-value').prop('disabled', val === '@' || val === '0');
|
parent.find('.edit-alarm-value').prop('disabled', val === '@' || val === '0');
|
||||||
parent.find('.edit-alarm-related')[val == '@' ? 'hide' : 'show']();
|
parent.find('.edit-alarm-related')[val === '@' ? 'hide' : 'show']();
|
||||||
});
|
});
|
||||||
|
|
||||||
$(prefix+' .edit-alarm-date').removeClass('hasDatepicker').removeAttr('id').datepicker(datepicker_settings);
|
$(prefix+' .edit-alarm-date').removeClass('hasDatepicker').removeAttr('id').datepicker(datepicker_settings);
|
||||||
|
this.init_time_autocomplete($(prefix+' .edit-alarm-time')[0], {});
|
||||||
|
|
||||||
$(prefix).on('click', 'a.delete-alarm', function(e){
|
$(prefix).on('click', 'a.delete-alarm', function(e){
|
||||||
if ($(this).closest('.edit-alarm-item').siblings().length > 0) {
|
if ($(this).closest('.edit-alarm-item').siblings().length > 0) {
|
||||||
|
@ -434,11 +435,10 @@ function rcube_libcalendaring(settings)
|
||||||
if (!alarm.action)
|
if (!alarm.action)
|
||||||
alarm.action = 'DISPLAY';
|
alarm.action = 'DISPLAY';
|
||||||
|
|
||||||
if (i == 0) {
|
|
||||||
domnode = $(prefix + ' .edit-alarm-item').eq(0);
|
domnode = $(prefix + ' .edit-alarm-item').eq(0);
|
||||||
}
|
|
||||||
else {
|
if (i > 0) {
|
||||||
domnode = $(prefix + ' .edit-alarm-item').eq(0).clone(false).removeClass('first').appendTo(prefix);
|
domnode = domnode.clone(false).removeClass('first').appendTo(prefix);
|
||||||
this.init_alarms_edit(prefix + ' .edit-alarm-item:eq(' + i + ')', i);
|
this.init_alarms_edit(prefix + ' .edit-alarm-item:eq(' + i + ')', i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ function rcube_libcalendaring(settings)
|
||||||
var default_props = {
|
var default_props = {
|
||||||
delay: 100,
|
delay: 100,
|
||||||
minLength: 1,
|
minLength: 1,
|
||||||
appendTo: props.container,
|
appendTo: props.container || $(elem).parents('form'),
|
||||||
source: time_autocomplete_list,
|
source: time_autocomplete_list,
|
||||||
open: time_autocomplete_open,
|
open: time_autocomplete_open,
|
||||||
// change: time_autocomplete_change,
|
// change: time_autocomplete_change,
|
||||||
|
|
|
@ -498,14 +498,22 @@ abstract class kolab_format_xcal extends kolab_format
|
||||||
$this->obj->setRecurrenceDates($rdates);
|
$this->obj->setRecurrenceDates($rdates);
|
||||||
}
|
}
|
||||||
|
|
||||||
// save alarm
|
// save alarm(s)
|
||||||
$valarms = new vectoralarm;
|
$valarms = new vectoralarm;
|
||||||
|
$valarm_hashes = array();
|
||||||
if ($object['valarms']) {
|
if ($object['valarms']) {
|
||||||
foreach ($object['valarms'] as $valarm) {
|
foreach ($object['valarms'] as $valarm) {
|
||||||
if (!array_key_exists($valarm['action'], $this->alarm_type_map)) {
|
if (!array_key_exists($valarm['action'], $this->alarm_type_map)) {
|
||||||
continue; // skip unknown alarm types
|
continue; // skip unknown alarm types
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get rid of duplicates, some CalDAV clients can set them
|
||||||
|
$hash = serialize($valarm);
|
||||||
|
if (in_array($hash, $valarm_hashes)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
$valarm_hashes[] = $hash;
|
||||||
|
|
||||||
if ($valarm['action'] == 'EMAIL') {
|
if ($valarm['action'] == 'EMAIL') {
|
||||||
$recipients = new vectorcontactref;
|
$recipients = new vectorcontactref;
|
||||||
foreach (($valarm['attendees'] ?: array($object['_owner'])) as $email) {
|
foreach (($valarm['attendees'] ?: array($object['_owner'])) as $email) {
|
||||||
|
@ -530,7 +538,15 @@ abstract class kolab_format_xcal extends kolab_format
|
||||||
if (is_object($valarm['trigger']) && $valarm['trigger'] instanceof DateTime) {
|
if (is_object($valarm['trigger']) && $valarm['trigger'] instanceof DateTime) {
|
||||||
$alarm->setStart(self::get_datetime($valarm['trigger'], new DateTimeZone('UTC')));
|
$alarm->setStart(self::get_datetime($valarm['trigger'], new DateTimeZone('UTC')));
|
||||||
}
|
}
|
||||||
|
else if (preg_match('/^@([0-9]+)$/', $valarm['trigger'], $m)) {
|
||||||
|
$alarm->setStart(self::get_datetime($m[1], new DateTimeZone('UTC')));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
// Support also interval in format without PT, e.g. -10M
|
||||||
|
if (preg_match('/^([-+]*)([0-9]+[DHMS])$/', strtoupper($valarm['trigger']), $m)) {
|
||||||
|
$valarm['trigger'] = $m[1] . ($m[2][strlen($m[2])-1] == 'D' ? 'P' : 'PT') . $m[2];
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$period = new DateInterval(preg_replace('/[^0-9PTWDHMS]/', '', $valarm['trigger']));
|
$period = new DateInterval(preg_replace('/[^0-9PTWDHMS]/', '', $valarm['trigger']));
|
||||||
$duration = new Duration($period->d, $period->h, $period->i, $period->s, $valarm['trigger'][0] == '-');
|
$duration = new Duration($period->d, $period->h, $period->i, $period->s, $valarm['trigger'][0] == '-');
|
||||||
|
|
|
@ -80,7 +80,7 @@ class kolab_storage_folder_user extends kolab_storage_folder_virtual
|
||||||
*
|
*
|
||||||
* @return string The owner of this folder.
|
* @return string The owner of this folder.
|
||||||
*/
|
*/
|
||||||
public function get_owner()
|
public function get_owner($fully_qualified = false)
|
||||||
{
|
{
|
||||||
return $this->ldaprec['mail'];
|
return $this->ldaprec['mail'];
|
||||||
}
|
}
|
||||||
|
|
|
@ -733,7 +733,7 @@ function rcube_tasklist_ui(settings)
|
||||||
});
|
});
|
||||||
|
|
||||||
// configure drop-down menu on time input fields based on jquery UI autocomplete
|
// configure drop-down menu on time input fields based on jquery UI autocomplete
|
||||||
$('#taskedit-starttime, #taskedit-time, #taskedit input.edit-alarm-time').each(function() {
|
$('#taskedit-starttime, #taskedit-time').each(function() {
|
||||||
me.init_time_autocomplete(this, {container: '#taskedit'});
|
me.init_time_autocomplete(this, {container: '#taskedit'});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue