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(); });
|
||||
|
||||
// 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, {
|
||||
container: '#eventedit',
|
||||
change: event_times_changed
|
||||
|
|
|
@ -391,12 +391,13 @@ function rcube_libcalendaring(settings)
|
|||
});
|
||||
$(prefix+' select.edit-alarm-offset').change(function(){
|
||||
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-related')[val == '@' ? 'hide' : 'show']();
|
||||
parent.find('.edit-alarm-related')[val === '@' ? 'hide' : 'show']();
|
||||
});
|
||||
|
||||
$(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){
|
||||
if ($(this).closest('.edit-alarm-item').siblings().length > 0) {
|
||||
|
@ -434,12 +435,11 @@ function rcube_libcalendaring(settings)
|
|||
if (!alarm.action)
|
||||
alarm.action = 'DISPLAY';
|
||||
|
||||
if (i == 0) {
|
||||
domnode = $(prefix + ' .edit-alarm-item').eq(0);
|
||||
}
|
||||
else {
|
||||
domnode = $(prefix + ' .edit-alarm-item').eq(0).clone(false).removeClass('first').appendTo(prefix);
|
||||
this.init_alarms_edit(prefix + ' .edit-alarm-item:eq(' + i + ')', i);
|
||||
domnode = $(prefix + ' .edit-alarm-item').eq(0);
|
||||
|
||||
if (i > 0) {
|
||||
domnode = domnode.clone(false).removeClass('first').appendTo(prefix);
|
||||
this.init_alarms_edit(prefix + ' .edit-alarm-item:eq(' + i + ')', i);
|
||||
}
|
||||
|
||||
$('select.edit-alarm-type', domnode).val(alarm.action);
|
||||
|
@ -588,7 +588,7 @@ function rcube_libcalendaring(settings)
|
|||
var default_props = {
|
||||
delay: 100,
|
||||
minLength: 1,
|
||||
appendTo: props.container,
|
||||
appendTo: props.container || $(elem).parents('form'),
|
||||
source: time_autocomplete_list,
|
||||
open: time_autocomplete_open,
|
||||
// change: time_autocomplete_change,
|
||||
|
|
|
@ -498,14 +498,22 @@ abstract class kolab_format_xcal extends kolab_format
|
|||
$this->obj->setRecurrenceDates($rdates);
|
||||
}
|
||||
|
||||
// save alarm
|
||||
// save alarm(s)
|
||||
$valarms = new vectoralarm;
|
||||
$valarm_hashes = array();
|
||||
if ($object['valarms']) {
|
||||
foreach ($object['valarms'] as $valarm) {
|
||||
if (!array_key_exists($valarm['action'], $this->alarm_type_map)) {
|
||||
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') {
|
||||
$recipients = new vectorcontactref;
|
||||
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) {
|
||||
$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 {
|
||||
// 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 {
|
||||
$period = new DateInterval(preg_replace('/[^0-9PTWDHMS]/', '', $valarm['trigger']));
|
||||
$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.
|
||||
*/
|
||||
public function get_owner()
|
||||
public function get_owner($fully_qualified = false)
|
||||
{
|
||||
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
|
||||
$('#taskedit-starttime, #taskedit-time, #taskedit input.edit-alarm-time').each(function() {
|
||||
$('#taskedit-starttime, #taskedit-time').each(function() {
|
||||
me.init_time_autocomplete(this, {container: '#taskedit'});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue