Elastic: Save-as-event dialog using iframe
This commit is contained in:
parent
4ce8cd281a
commit
fb6029edbe
13 changed files with 249 additions and 232 deletions
|
@ -153,8 +153,7 @@ class calendar extends rcube_plugin
|
||||||
$this->register_action('print', array($this,'print_view'));
|
$this->register_action('print', array($this,'print_view'));
|
||||||
$this->register_action('mailimportitip', array($this, 'mail_import_itip'));
|
$this->register_action('mailimportitip', array($this, 'mail_import_itip'));
|
||||||
$this->register_action('mailimportattach', array($this, 'mail_import_attachment'));
|
$this->register_action('mailimportattach', array($this, 'mail_import_attachment'));
|
||||||
$this->register_action('mailtoevent', array($this, 'mail_message2event'));
|
$this->register_action('dialog-ui', array($this, 'mail_message2event'));
|
||||||
$this->register_action('inlineui', array($this, 'get_inline_ui'));
|
|
||||||
$this->register_action('check-recent', array($this, 'check_recent'));
|
$this->register_action('check-recent', array($this, 'check_recent'));
|
||||||
$this->register_action('itip-status', array($this, 'event_itip_status'));
|
$this->register_action('itip-status', array($this, 'event_itip_status'));
|
||||||
$this->register_action('itip-remove', array($this, 'event_itip_remove'));
|
$this->register_action('itip-remove', array($this, 'event_itip_remove'));
|
||||||
|
@ -875,7 +874,7 @@ class calendar extends rcube_plugin
|
||||||
$this->rc->output->command('multi_thread_http_response', $results, rcube_utils::get_input_value('_reqid', rcube_utils::INPUT_GPC));
|
$this->rc->output->command('multi_thread_http_response', $results, rcube_utils::get_input_value('_reqid', rcube_utils::INPUT_GPC));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($success)
|
if ($success)
|
||||||
$this->rc->output->show_message('successfullysaved', 'confirmation');
|
$this->rc->output->show_message('successfullysaved', 'confirmation');
|
||||||
else {
|
else {
|
||||||
|
@ -1221,10 +1220,10 @@ class calendar extends rcube_plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
// unlock client
|
// unlock client
|
||||||
$this->rc->output->command('plugin.unlock_saving');
|
$this->rc->output->command('plugin.unlock_saving', $success);
|
||||||
|
|
||||||
// update event object on the client or trigger a complete refresh if too complicated
|
// update event object on the client or trigger a complete refresh if too complicated
|
||||||
if ($reload) {
|
if ($reload && empty($_REQUEST['_framed'])) {
|
||||||
$args = array('source' => $event['calendar']);
|
$args = array('source' => $event['calendar']);
|
||||||
if ($reload > 1)
|
if ($reload > 1)
|
||||||
$args['refetch'] = true;
|
$args['refetch'] = true;
|
||||||
|
@ -2421,30 +2420,6 @@ class calendar extends rcube_plugin
|
||||||
$this->rc->output->send("calendar.print");
|
$this->rc->output->send("calendar.print");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public function get_inline_ui()
|
|
||||||
{
|
|
||||||
foreach (array('save','cancel','savingdata') as $label)
|
|
||||||
$texts['calendar.'.$label] = $this->gettext($label);
|
|
||||||
|
|
||||||
$texts['calendar.new_event'] = $this->gettext('createfrommail');
|
|
||||||
|
|
||||||
$this->ui->init_templates();
|
|
||||||
$this->ui->calendar_list(); # set env['calendars']
|
|
||||||
echo $this->api->output->parse('calendar.eventedit', false, false);
|
|
||||||
echo html::tag('script', array('type' => 'text/javascript'),
|
|
||||||
"rcmail.set_env('calendars', " . rcube_output::json_serialize($this->api->output->env['calendars']) . ");\n".
|
|
||||||
"rcmail.set_env('deleteicon', '" . $this->api->output->env['deleteicon'] . "');\n".
|
|
||||||
"rcmail.set_env('cancelicon', '" . $this->api->output->env['cancelicon'] . "');\n".
|
|
||||||
"rcmail.set_env('loadingicon', '" . $this->api->output->env['loadingicon'] . "');\n".
|
|
||||||
"rcmail.gui_object('attachmentlist', '" . $this->ui->attachmentlist_id . "');\n".
|
|
||||||
"rcmail.add_label(" . rcube_output::json_serialize($texts) . ");\n"
|
|
||||||
);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare two event objects and return differing properties
|
* Compare two event objects and return differing properties
|
||||||
*
|
*
|
||||||
|
@ -3375,17 +3350,21 @@ class calendar extends rcube_plugin
|
||||||
*/
|
*/
|
||||||
public function mail_message2event()
|
public function mail_message2event()
|
||||||
{
|
{
|
||||||
$uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST);
|
$this->ui->init();
|
||||||
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST);
|
$this->ui->addJS();
|
||||||
|
$this->ui->init_templates();
|
||||||
|
$this->ui->calendar_list(); // set env['calendars']
|
||||||
|
|
||||||
|
$uid = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GET);
|
||||||
|
$mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GET);
|
||||||
$event = array();
|
$event = array();
|
||||||
|
|
||||||
// establish imap connection
|
// establish imap connection
|
||||||
$imap = $this->rc->get_storage();
|
$imap = $this->rc->get_storage();
|
||||||
$imap->set_folder($mbox);
|
$message = new rcube_message($uid, $mbox);
|
||||||
$message = new rcube_message($uid);
|
|
||||||
|
|
||||||
if ($message->headers) {
|
if ($message->headers) {
|
||||||
$event['title'] = trim($message->subject);
|
$event['title'] = trim($message->subject);
|
||||||
$event['description'] = trim($message->first_text_part());
|
$event['description'] = trim($message->first_text_part());
|
||||||
|
|
||||||
$this->load_driver();
|
$this->load_driver();
|
||||||
|
@ -3427,14 +3406,14 @@ class calendar extends rcube_plugin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->rc->output->command('plugin.mail2event_dialog', $event);
|
$this->rc->output->set_env('event_prop', $event);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$this->rc->output->command('display_message', $this->gettext('messageopenerror'), 'error');
|
$this->rc->output->command('display_message', $this->gettext('messageopenerror'), 'error');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->rc->output->send();
|
$this->rc->output->send('calendar.dialog');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -33,53 +33,40 @@ function rcube_calendar(settings)
|
||||||
// extend base class
|
// extend base class
|
||||||
rcube_libcalendaring.call(this, settings);
|
rcube_libcalendaring.call(this, settings);
|
||||||
|
|
||||||
// member vars
|
|
||||||
this.ui_loaded = false;
|
|
||||||
this.selected_attachment = null;
|
|
||||||
|
|
||||||
// private vars
|
|
||||||
var me = this;
|
|
||||||
|
|
||||||
// create new event from current mail message
|
// create new event from current mail message
|
||||||
this.create_from_mail = function(uid)
|
this.create_from_mail = function(uid)
|
||||||
{
|
{
|
||||||
if (uid || (uid = rcmail.get_single_uid())) {
|
if (!uid && !(uid = rcmail.get_single_uid())) {
|
||||||
// load calendar UI (scripts and edit dialog template)
|
return;
|
||||||
if (!this.ui_loaded) {
|
|
||||||
$.when(
|
|
||||||
$.getScript(rcmail.assets_path('plugins/calendar/calendar_ui.js')),
|
|
||||||
$.getScript(rcmail.assets_path('plugins/calendar/lib/js/fullcalendar.js')),
|
|
||||||
$.get(rcmail.url('calendar/inlineui'), function(html) { $(document.body).append(html); }, 'html')
|
|
||||||
).then(function() {
|
|
||||||
// disable attendees feature (autocompletion and stuff is not initialized)
|
|
||||||
for (var c in rcmail.env.calendars)
|
|
||||||
rcmail.env.calendars[c].attendees = rcmail.env.calendars[c].resources = false;
|
|
||||||
|
|
||||||
me.ui_loaded = true;
|
|
||||||
me.ui = new rcube_calendar_ui(me.settings);
|
|
||||||
me.create_from_mail(uid); // start over
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get message contents for event dialog
|
|
||||||
var lock = rcmail.set_busy(true, 'loading');
|
|
||||||
rcmail.http_post('calendar/mailtoevent', {
|
|
||||||
'_mbox': rcmail.env.mailbox,
|
|
||||||
'_uid': uid
|
|
||||||
}, lock);
|
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// callback function triggered from server with contents for the new event
|
var url = {_mbox: rcmail.env.mailbox, _uid: uid, _framed: 1},
|
||||||
this.mail2event_dialog = function(event)
|
buttons = {},
|
||||||
{
|
button_classes = ['mainaction save', 'cancel'],
|
||||||
if (event.title) {
|
title = rcmail.gettext('calendar.createfrommail'),
|
||||||
this.ui.add_event(event);
|
dialog = $('<iframe>').attr({
|
||||||
if (rcmail.message_list)
|
id: 'kolabcalendarinlinegui',
|
||||||
rcmail.message_list.blur();
|
name: 'kolabcalendardialog',
|
||||||
}
|
src: rcmail.url('calendar/dialog-ui', url)
|
||||||
|
});
|
||||||
|
|
||||||
|
// dialog buttons
|
||||||
|
buttons[rcmail.gettext('save')] = function() {
|
||||||
|
var frame = rcmail.get_frame_window('kolabcalendarinlinegui');
|
||||||
|
frame.rcmail.command('event-save');
|
||||||
|
};
|
||||||
|
|
||||||
|
buttons[rcmail.gettext('cancel')] = function() {
|
||||||
|
dialog.dialog('destroy');
|
||||||
|
};
|
||||||
|
|
||||||
|
// open jquery UI dialog
|
||||||
|
window.kolab_event_dialog_element = dialog = rcmail.show_popup_dialog(dialog, title, buttons, {
|
||||||
|
button_classes: button_classes,
|
||||||
|
minWidth: 500,
|
||||||
|
width: 600,
|
||||||
|
height: 600
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// handler for attachment-save-calendar commands
|
// handler for attachment-save-calendar commands
|
||||||
|
@ -107,12 +94,9 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
if (rcmail.env.task == 'mail') {
|
if (rcmail.env.task == 'mail') {
|
||||||
rcmail.register_command('calendar-create-from-mail', function() { cal.create_from_mail(); });
|
rcmail.register_command('calendar-create-from-mail', function() { cal.create_from_mail(); });
|
||||||
rcmail.register_command('attachment-save-calendar', function() { cal.save_to_calendar(); });
|
rcmail.register_command('attachment-save-calendar', function() { cal.save_to_calendar(); });
|
||||||
rcmail.addEventListener('plugin.mail2event_dialog', function(p) { cal.mail2event_dialog(p); });
|
|
||||||
rcmail.addEventListener('plugin.unlock_saving', function(p) { cal.ui && cal.ui.unlock_saving(); });
|
|
||||||
|
|
||||||
if (rcmail.env.action != 'show') {
|
if (rcmail.env.action != 'show') {
|
||||||
rcmail.env.message_commands.push('calendar-create-from-mail');
|
rcmail.env.message_commands.push('calendar-create-from-mail');
|
||||||
rcmail.add_element($('<a>'));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rcmail.enable_command('calendar-create-from-mail', true);
|
rcmail.enable_command('calendar-create-from-mail', true);
|
||||||
|
|
|
@ -32,7 +32,7 @@ function rcube_calendar_ui(settings)
|
||||||
{
|
{
|
||||||
// extend base class
|
// extend base class
|
||||||
rcube_calendar.call(this, settings);
|
rcube_calendar.call(this, settings);
|
||||||
|
|
||||||
/*** member vars ***/
|
/*** member vars ***/
|
||||||
this.is_loading = false;
|
this.is_loading = false;
|
||||||
this.selected_event = null;
|
this.selected_event = null;
|
||||||
|
@ -606,6 +606,9 @@ function rcube_calendar_ui(settings)
|
||||||
event = me.selected_event; // change reference to clone
|
event = me.selected_event; // change reference to clone
|
||||||
freebusy_ui.needsupdate = false;
|
freebusy_ui.needsupdate = false;
|
||||||
|
|
||||||
|
if (rcmail.env.action == 'dialog-ui')
|
||||||
|
calendar.attendees = false; // TODO: allow Attendees tab in Save-as-event dialog
|
||||||
|
|
||||||
// reset dialog first
|
// reset dialog first
|
||||||
$('#eventedit form').trigger('reset');
|
$('#eventedit form').trigger('reset');
|
||||||
$('#event-panel-recurrence input, #event-panel-recurrence select, #event-panel-attachments input').prop('disabled', false);
|
$('#event-panel-recurrence input, #event-panel-recurrence select, #event-panel-attachments input').prop('disabled', false);
|
||||||
|
@ -760,97 +763,102 @@ function rcube_calendar_ui(settings)
|
||||||
};
|
};
|
||||||
|
|
||||||
// init dialog buttons
|
// init dialog buttons
|
||||||
var buttons = [];
|
var buttons = [],
|
||||||
|
save_func = function() {
|
||||||
|
var start = parse_datetime(allday.checked ? '12:00' : starttime.val(), startdate.val());
|
||||||
|
var end = parse_datetime(allday.checked ? '13:00' : endtime.val(), enddate.val());
|
||||||
|
|
||||||
|
// basic input validatetion
|
||||||
|
if (start.getTime() > end.getTime()) {
|
||||||
|
alert(rcmail.gettext('invalideventdates', 'calendar'));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// post data to server
|
||||||
|
var data = {
|
||||||
|
calendar: event.calendar,
|
||||||
|
start: date2servertime(start),
|
||||||
|
end: date2servertime(end),
|
||||||
|
allday: allday.checked?1:0,
|
||||||
|
title: title.val(),
|
||||||
|
description: description.val(),
|
||||||
|
location: location.val(),
|
||||||
|
categories: categories.val(),
|
||||||
|
vurl: vurl.val(),
|
||||||
|
free_busy: freebusy.val(),
|
||||||
|
priority: priority.val(),
|
||||||
|
sensitivity: sensitivity.val(),
|
||||||
|
status: eventstatus.val(),
|
||||||
|
recurrence: me.serialize_recurrence(endtime.val()),
|
||||||
|
valarms: me.serialize_alarms('#edit-alarms'),
|
||||||
|
attendees: event_attendees,
|
||||||
|
links: me.selected_event.links,
|
||||||
|
deleted_attachments: rcmail.env.deleted_attachments,
|
||||||
|
attachments: []
|
||||||
|
};
|
||||||
|
|
||||||
|
// uploaded attachments list
|
||||||
|
for (var i in rcmail.env.attachments)
|
||||||
|
if (i.match(/^rcmfile(.+)/))
|
||||||
|
data.attachments.push(RegExp.$1);
|
||||||
|
|
||||||
|
// read attendee roles
|
||||||
|
$('select.edit-attendee-role').each(function(i, elem){
|
||||||
|
if (data.attendees[i])
|
||||||
|
data.attendees[i].role = $(elem).val();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (organizer)
|
||||||
|
data._identity = $('#edit-identities-list option:selected').val();
|
||||||
|
|
||||||
|
// per-attendee notification suppression
|
||||||
|
var need_invitation = false;
|
||||||
|
if (allow_invitations) {
|
||||||
|
$.each(data.attendees, function (i, v) {
|
||||||
|
if (v.role != 'ORGANIZER') {
|
||||||
|
if ($('input.edit-attendee-reply[value="' + v.email + '"]').prop('checked') || v.cutype == 'RESOURCE') {
|
||||||
|
need_invitation = true;
|
||||||
|
delete data.attendees[i]['noreply'];
|
||||||
|
}
|
||||||
|
else if (settings.itip_notify > 0) {
|
||||||
|
data.attendees[i].noreply = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// tell server to send notifications
|
||||||
|
if ((data.attendees.length || (event.id && event.attendees.length)) && allow_invitations && (notify.checked || invite.checked || need_invitation)) {
|
||||||
|
data._notify = settings.itip_notify;
|
||||||
|
data._comment = comment.val();
|
||||||
|
}
|
||||||
|
|
||||||
|
data.calendar = calendars.val();
|
||||||
|
|
||||||
|
if (event.id) {
|
||||||
|
data.id = event.id;
|
||||||
|
if (event.recurrence)
|
||||||
|
data._savemode = $('input.edit-recurring-savemode:checked').val();
|
||||||
|
if (data.calendar && data.calendar != event.calendar)
|
||||||
|
data._fromcalendar = event.calendar;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.recurrence && syncstart.is(':checked'))
|
||||||
|
data.syncstart = 1;
|
||||||
|
|
||||||
|
update_event(action, data);
|
||||||
|
|
||||||
|
if (rcmail.env.action != 'dialog-ui')
|
||||||
|
$dialog.dialog("close");
|
||||||
|
};
|
||||||
|
|
||||||
|
rcmail.env.event_save_func = save_func;
|
||||||
|
|
||||||
// save action
|
// save action
|
||||||
buttons.push({
|
buttons.push({
|
||||||
text: rcmail.gettext('save', 'calendar'),
|
text: rcmail.gettext('save', 'calendar'),
|
||||||
'class': 'save mainaction',
|
'class': 'save mainaction',
|
||||||
click: function() {
|
click: save_func
|
||||||
var start = parse_datetime(allday.checked ? '12:00' : starttime.val(), startdate.val());
|
|
||||||
var end = parse_datetime(allday.checked ? '13:00' : endtime.val(), enddate.val());
|
|
||||||
|
|
||||||
// basic input validatetion
|
|
||||||
if (start.getTime() > end.getTime()) {
|
|
||||||
alert(rcmail.gettext('invalideventdates', 'calendar'));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// post data to server
|
|
||||||
var data = {
|
|
||||||
calendar: event.calendar,
|
|
||||||
start: date2servertime(start),
|
|
||||||
end: date2servertime(end),
|
|
||||||
allday: allday.checked?1:0,
|
|
||||||
title: title.val(),
|
|
||||||
description: description.val(),
|
|
||||||
location: location.val(),
|
|
||||||
categories: categories.val(),
|
|
||||||
vurl: vurl.val(),
|
|
||||||
free_busy: freebusy.val(),
|
|
||||||
priority: priority.val(),
|
|
||||||
sensitivity: sensitivity.val(),
|
|
||||||
status: eventstatus.val(),
|
|
||||||
recurrence: me.serialize_recurrence(endtime.val()),
|
|
||||||
valarms: me.serialize_alarms('#edit-alarms'),
|
|
||||||
attendees: event_attendees,
|
|
||||||
links: me.selected_event.links,
|
|
||||||
deleted_attachments: rcmail.env.deleted_attachments,
|
|
||||||
attachments: []
|
|
||||||
};
|
|
||||||
|
|
||||||
// uploaded attachments list
|
|
||||||
for (var i in rcmail.env.attachments)
|
|
||||||
if (i.match(/^rcmfile(.+)/))
|
|
||||||
data.attachments.push(RegExp.$1);
|
|
||||||
|
|
||||||
// read attendee roles
|
|
||||||
$('select.edit-attendee-role').each(function(i, elem){
|
|
||||||
if (data.attendees[i])
|
|
||||||
data.attendees[i].role = $(elem).val();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (organizer)
|
|
||||||
data._identity = $('#edit-identities-list option:selected').val();
|
|
||||||
|
|
||||||
// per-attendee notification suppression
|
|
||||||
var need_invitation = false;
|
|
||||||
if (allow_invitations) {
|
|
||||||
$.each(data.attendees, function (i, v) {
|
|
||||||
if (v.role != 'ORGANIZER') {
|
|
||||||
if ($('input.edit-attendee-reply[value="' + v.email + '"]').prop('checked') || v.cutype == 'RESOURCE') {
|
|
||||||
need_invitation = true;
|
|
||||||
delete data.attendees[i]['noreply'];
|
|
||||||
}
|
|
||||||
else if (settings.itip_notify > 0) {
|
|
||||||
data.attendees[i].noreply = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// tell server to send notifications
|
|
||||||
if ((data.attendees.length || (event.id && event.attendees.length)) && allow_invitations && (notify.checked || invite.checked || need_invitation)) {
|
|
||||||
data._notify = settings.itip_notify;
|
|
||||||
data._comment = comment.val();
|
|
||||||
}
|
|
||||||
|
|
||||||
data.calendar = calendars.val();
|
|
||||||
|
|
||||||
if (event.id) {
|
|
||||||
data.id = event.id;
|
|
||||||
if (event.recurrence)
|
|
||||||
data._savemode = $('input.edit-recurring-savemode:checked').val();
|
|
||||||
if (data.calendar && data.calendar != event.calendar)
|
|
||||||
data._fromcalendar = event.calendar;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.recurrence && syncstart.is(':checked'))
|
|
||||||
data.syncstart = 1;
|
|
||||||
|
|
||||||
update_event(action, data);
|
|
||||||
$dialog.dialog("close");
|
|
||||||
} // end click:
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (event.id) {
|
if (event.id) {
|
||||||
|
@ -876,7 +884,7 @@ function rcube_calendar_ui(settings)
|
||||||
$('#edit-tab-attendees')[(calendar.attendees?'show':'hide')]();
|
$('#edit-tab-attendees')[(calendar.attendees?'show':'hide')]();
|
||||||
$('#edit-tab-resources')[(rcmail.env.calendar_resources?'show':'hide')]();
|
$('#edit-tab-resources')[(rcmail.env.calendar_resources?'show':'hide')]();
|
||||||
$('#edit-tab-attachments')[(calendar.attachments?'show':'hide')]();
|
$('#edit-tab-attachments')[(calendar.attachments?'show':'hide')]();
|
||||||
$('#eventedit:not([data-notabs]) > form').tabs('option', 'active', 0); // Larry
|
$('#eventedit:not([data-notabs])').tabs('option', 'active', 0); // Larry
|
||||||
|
|
||||||
// show/hide tabs according to calendar's feature support and activate first tab (Ellastic)
|
// show/hide tabs according to calendar's feature support and activate first tab (Ellastic)
|
||||||
$('li > a[href="#event-panel-attendees"]').parent()[(calendar.attendees?'show':'hide')]();
|
$('li > a[href="#event-panel-attendees"]').parent()[(calendar.attendees?'show':'hide')]();
|
||||||
|
@ -891,33 +899,35 @@ function rcube_calendar_ui(settings)
|
||||||
|
|
||||||
var editform = $("#eventedit");
|
var editform = $("#eventedit");
|
||||||
|
|
||||||
// open jquery UI dialog
|
if (rcmail.env.action != 'dialog-ui') {
|
||||||
$dialog.dialog({
|
// open jquery UI dialog
|
||||||
modal: true,
|
$dialog.dialog({
|
||||||
resizable: true,
|
modal: true,
|
||||||
closeOnEscape: false,
|
resizable: true,
|
||||||
title: rcmail.gettext((action == 'edit' ? 'edit_event' : 'new_event'), 'calendar'),
|
closeOnEscape: false,
|
||||||
open: function() {
|
title: rcmail.gettext((action == 'edit' ? 'edit_event' : 'new_event'), 'calendar'),
|
||||||
editform.attr('aria-hidden', 'false');
|
open: function() {
|
||||||
},
|
editform.attr('aria-hidden', 'false');
|
||||||
close: function() {
|
},
|
||||||
editform.hide().attr('aria-hidden', 'true').appendTo(document.body);
|
close: function() {
|
||||||
$dialog.dialog("destroy").remove();
|
editform.hide().attr('aria-hidden', 'true').appendTo(document.body);
|
||||||
rcmail.ksearch_blur();
|
$dialog.dialog("destroy").remove();
|
||||||
freebusy_data = {};
|
rcmail.ksearch_blur();
|
||||||
rcmail.env.comm_path = comm_path_before; // restore comm_path
|
freebusy_data = {};
|
||||||
if (op_elem)
|
rcmail.env.comm_path = comm_path_before; // restore comm_path
|
||||||
$(op_elem).focus();
|
if (op_elem)
|
||||||
},
|
$(op_elem).focus();
|
||||||
buttons: buttons,
|
},
|
||||||
minWidth: 500,
|
buttons: buttons,
|
||||||
width: 600
|
minWidth: 500,
|
||||||
}).append(editform.show()); // adding form content AFTERWARDS massively speeds up opening on IE6
|
width: 600
|
||||||
|
}).append(editform.show()); // adding form content AFTERWARDS massively speeds up opening on IE6
|
||||||
|
|
||||||
// set dialog size according to form content
|
// set dialog size according to form content
|
||||||
me.dialog_resize($dialog.get(0), editform.height() + (bw.ie ? 20 : 0), 550);
|
me.dialog_resize($dialog.get(0), editform.height() + (bw.ie ? 20 : 0), 550);
|
||||||
|
|
||||||
title.select();
|
rcmail.triggerEvent('calendar-event-dialog', {dialog: $dialog});
|
||||||
|
}
|
||||||
|
|
||||||
// init other tabs asynchronously
|
// init other tabs asynchronously
|
||||||
window.setTimeout(function(){ me.set_recurrence_edit(event); }, exec_deferred);
|
window.setTimeout(function(){ me.set_recurrence_edit(event); }, exec_deferred);
|
||||||
|
@ -926,7 +936,7 @@ function rcube_calendar_ui(settings)
|
||||||
if (calendar.attachments)
|
if (calendar.attachments)
|
||||||
window.setTimeout(load_attachments_tab, exec_deferred);
|
window.setTimeout(load_attachments_tab, exec_deferred);
|
||||||
|
|
||||||
rcmail.triggerEvent('calendar-event-dialog', {dialog: $dialog});
|
title.select();
|
||||||
};
|
};
|
||||||
|
|
||||||
// show event changelog in a dialog
|
// show event changelog in a dialog
|
||||||
|
@ -3963,7 +3973,7 @@ function rcube_calendar_ui(settings)
|
||||||
$('#edit-recurrence-syncstart').hide();
|
$('#edit-recurrence-syncstart').hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
$('#eventtabs').tabs({activate: tab_change}); // Larry
|
$('#eventedit:not([data-notabs])').tabs({activate: tab_change}); // Larry
|
||||||
$('#eventedit a.nav-link').on('show.bs.tab', tab_change); // Elastic
|
$('#eventedit a.nav-link').on('show.bs.tab', tab_change); // Elastic
|
||||||
|
|
||||||
$('#edit-enddate').datepicker(datepicker_settings);
|
$('#edit-enddate').datepicker(datepicker_settings);
|
||||||
|
@ -4145,6 +4155,32 @@ function rcube_calendar_ui(settings)
|
||||||
// add proprietary css styles if not IE
|
// add proprietary css styles if not IE
|
||||||
if (!bw.ie)
|
if (!bw.ie)
|
||||||
$('div.fc-content').addClass('rcube-fc-content');
|
$('div.fc-content').addClass('rcube-fc-content');
|
||||||
|
|
||||||
|
// Save-as-event dialog content
|
||||||
|
if (rcmail.env.action == 'dialog-ui') {
|
||||||
|
var date = new Date(), event = {allDay: false, calendar: me.selected_calendar};
|
||||||
|
|
||||||
|
date.setHours(date.getHours()+1);
|
||||||
|
date.setMinutes(0);
|
||||||
|
|
||||||
|
var end = new Date(date.getTime());
|
||||||
|
end.setHours(date.getHours()+1);
|
||||||
|
|
||||||
|
event.start = date;
|
||||||
|
event.end = end;
|
||||||
|
|
||||||
|
// exec deferred because it must be after init_calendar_ui
|
||||||
|
window.setTimeout(function() {
|
||||||
|
event_edit_dialog('new', $.extend(event, rcmail.env.event_prop));
|
||||||
|
}, exec_deferred);
|
||||||
|
|
||||||
|
rcmail.register_command('event-save', function() { rcmail.env.event_save_func(); }, true);
|
||||||
|
rcmail.addEventListener('plugin.unlock_saving', function(status) {
|
||||||
|
me.unlock_saving();
|
||||||
|
if (status)
|
||||||
|
window.parent.kolab_event_dialog_element.dialog('destroy');
|
||||||
|
});
|
||||||
|
}
|
||||||
} // end rcube_calendar class
|
} // end rcube_calendar class
|
||||||
|
|
||||||
|
|
||||||
|
@ -4156,6 +4192,13 @@ if (rcmail.env.devel_mode && window.less) {
|
||||||
|
|
||||||
/* calendar plugin initialization */
|
/* calendar plugin initialization */
|
||||||
window.rcmail && rcmail.addEventListener('init', function(evt) {
|
window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
|
// let's go
|
||||||
|
var cal = new rcube_calendar_ui($.extend(rcmail.env.calendar_settings, rcmail.env.libcal_settings));
|
||||||
|
|
||||||
|
if (rcmail.env.action == 'dialog-ui') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// configure toolbar buttons
|
// configure toolbar buttons
|
||||||
rcmail.register_command('addevent', function(){ cal.add_event(); }, true);
|
rcmail.register_command('addevent', function(){ cal.add_event(); }, true);
|
||||||
rcmail.register_command('print', function(){ cal.print_calendars(); }, true);
|
rcmail.register_command('print', function(){ cal.print_calendars(); }, true);
|
||||||
|
@ -4201,9 +4244,6 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
||||||
rcmail.addEventListener('plugin.itip_message_processed', function(data){ cal.itip_message_processed(data); });
|
rcmail.addEventListener('plugin.itip_message_processed', function(data){ cal.itip_message_processed(data); });
|
||||||
rcmail.addEventListener('requestrefresh', function(q){ return cal.before_refresh(q); });
|
rcmail.addEventListener('requestrefresh', function(q){ return cal.before_refresh(q); });
|
||||||
|
|
||||||
// let's go
|
|
||||||
var cal = new rcube_calendar_ui($.extend(rcmail.env.calendar_settings, rcmail.env.libcal_settings));
|
|
||||||
|
|
||||||
$(window).resize(function(e) {
|
$(window).resize(function(e) {
|
||||||
// check target due to bugs in jquery
|
// check target due to bugs in jquery
|
||||||
// http://bugs.jqueryui.com/ticket/7514
|
// http://bugs.jqueryui.com/ticket/7514
|
||||||
|
|
|
@ -306,5 +306,6 @@ $labels['arialabeleventattendees'] = 'Event participants list';
|
||||||
$labels['arialabeleventresources'] = 'Event resources list';
|
$labels['arialabeleventresources'] = 'Event resources list';
|
||||||
$labels['arialabelresourcesearchform'] = 'Resources search form';
|
$labels['arialabelresourcesearchform'] = 'Resources search form';
|
||||||
$labels['arialabelresourceselection'] = 'Available resources';
|
$labels['arialabelresourceselection'] = 'Available resources';
|
||||||
|
$labels['arialabeleventform'] = 'Event editing form';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -127,14 +127,6 @@
|
||||||
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.priority" /></label>
|
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.priority" /></label>
|
||||||
<span class="event-text col-sm-8 form-control-plaintext"></span>
|
<span class="event-text col-sm-8 form-control-plaintext"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="event-created" class="form-group row faded">
|
|
||||||
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.created" /></label>
|
|
||||||
<span class="event-text event-created col-sm-8 form-control-plaintext"></span>
|
|
||||||
</div>
|
|
||||||
<div id="event-changed" class="form-group row faded">
|
|
||||||
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.changed" /></label>
|
|
||||||
<span class="event-text event-changed col-sm-8 form-control-plaintext"></span>
|
|
||||||
</div>
|
|
||||||
<div id="event-rsvp-comment" class="form-group row">
|
<div id="event-rsvp-comment" class="form-group row">
|
||||||
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.rsvpcomment" /></label>
|
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.rsvpcomment" /></label>
|
||||||
<span class="event-text col-sm-8 form-control-plaintext"></span>
|
<span class="event-text col-sm-8 form-control-plaintext"></span>
|
||||||
|
@ -143,6 +135,14 @@
|
||||||
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.links" /></label>
|
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.links" /></label>
|
||||||
<span class="event-text col-sm-8"></span>
|
<span class="event-text col-sm-8"></span>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="event-created" class="form-group row faded">
|
||||||
|
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.created" /></label>
|
||||||
|
<span class="event-text event-created col-sm-8 form-control-plaintext"></span>
|
||||||
|
</div>
|
||||||
|
<div id="event-changed" class="form-group row faded">
|
||||||
|
<label class="col-sm-4 col-form-label"><roundcube:label name="calendar.changed" /></label>
|
||||||
|
<span class="event-text event-changed col-sm-8 form-control-plaintext"></span>
|
||||||
|
</div>
|
||||||
<div id="event-attachments" class="form-group row">
|
<div id="event-attachments" class="form-group row">
|
||||||
<div class="event-text"></div>
|
<div class="event-text"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="eventedit" class="popupmenu formcontent" aria-hidden="true" data-notabs="true">
|
<div id="eventedit" class="<roundcube:exp expression="env:framed ? '' : 'popupmenu '">formcontent" aria-hidden="true" data-notabs="true">
|
||||||
<form class="tabbed" action="#" method="post" enctype="multipart/form-data">
|
<form class="tabbed" action="#" method="post" enctype="multipart/form-data">
|
||||||
<!-- basic info -->
|
<!-- basic info -->
|
||||||
<fieldset id="event-panel-summary">
|
<fieldset id="event-panel-summary">
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
<div class="col-sm-10 datetime">
|
<div class="col-sm-10 datetime">
|
||||||
<input type="text" name="startdate" size="11" id="edit-startdate" class="form-control" required="true" />
|
<input type="text" name="startdate" size="11" id="edit-startdate" class="form-control" required="true" />
|
||||||
<input type="text" name="starttime" size="6" id="edit-starttime" class="form-control" aria-label="<roundcube:label name='calendar.starttime' />" />
|
<input type="text" name="starttime" size="6" id="edit-starttime" class="form-control" aria-label="<roundcube:label name='calendar.starttime' />" />
|
||||||
<label><input type="checkbox" name="allday" id="edit-allday" value="1" /><roundcube:label name="calendar.all-day" /></label>
|
<label><input type="checkbox" name="allday" id="edit-allday" value="1" class="pretty-checkbox" /><roundcube:label name="calendar.all-day" /></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
|
|
|
@ -887,6 +887,18 @@ a.miniColors-trigger {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
body.eventdialog {
|
||||||
|
margin: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.eventdialog #eventedit {
|
||||||
|
display: block;
|
||||||
|
top: 0;
|
||||||
|
padding: 1em;
|
||||||
|
border-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
#eventedit {
|
#eventedit {
|
||||||
position: relative;
|
position: relative;
|
||||||
top: -1.5em;
|
top: -1.5em;
|
||||||
|
@ -919,6 +931,10 @@ div.form-section,
|
||||||
border-bottom: 2px solid #fafafa;
|
border-bottom: 2px solid #fafafa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.event-section > .col-form-label {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
.calendarmain .eventdialog label,
|
.calendarmain .eventdialog label,
|
||||||
#eventedit label,
|
#eventedit label,
|
||||||
.form-section label {
|
.form-section label {
|
||||||
|
@ -1375,6 +1391,7 @@ td.topalign {
|
||||||
|
|
||||||
#schedule-freebusy-times tr.times td {
|
#schedule-freebusy-times tr.times td {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#schedule-freebusy-times #fbrowall td {
|
#schedule-freebusy-times #fbrowall td {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<div id="eventedit" class="uidialog uidialog-tabbed" aria-hidden="true">
|
<div id="eventedit" class="<roundcube:exp expression="env:framed ? '' : 'uidialog '">uidialog-tabbed" aria-hidden="true">
|
||||||
<form id="eventtabs" action="#" method="post" enctype="multipart/form-data">
|
<form id="eventtabs" action="#" method="post" enctype="multipart/form-data">
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#event-panel-summary"><roundcube:label name="calendar.tabsummary" /></a></li><li id="edit-tab-recurrence"><a href="#event-panel-recurrence"><roundcube:label name="calendar.tabrecurrence" /></a></li><li id="edit-tab-attendees"><a href="#event-panel-attendees"><roundcube:label name="calendar.tabattendees" /></a></li><li id="edit-tab-resources"><a href="#event-panel-resources"><roundcube:label name="calendar.tabresources" /></a></li><li id="edit-tab-attachments"><a href="#event-panel-attachments"><roundcube:label name="calendar.tabattachments" /></a></li>
|
<li><a href="#event-panel-summary"><roundcube:label name="calendar.tabsummary" /></a></li><li id="edit-tab-recurrence"><a href="#event-panel-recurrence"><roundcube:label name="calendar.tabrecurrence" /></a></li><li id="edit-tab-attendees"><a href="#event-panel-attendees"><roundcube:label name="calendar.tabattendees" /></a></li><li id="edit-tab-resources"><a href="#event-panel-resources"><roundcube:label name="calendar.tabresources" /></a></li><li id="edit-tab-attachments"><a href="#event-panel-attachments"><roundcube:label name="calendar.tabattachments" /></a></li>
|
||||||
|
|
|
@ -118,8 +118,9 @@ label.noreply-toggle + a.reply-comment-toggle {
|
||||||
min-width: 5em;
|
min-width: 5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#edit-recurrence-yearly-bymonthblock {
|
.recurrence-form .event-section label + div,
|
||||||
margin-left: 7.5em;
|
.recurrence-form .form-section label + div {
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
#edit-recurrence-rdates {
|
#edit-recurrence-rdates {
|
||||||
|
|
|
@ -1300,9 +1300,16 @@ body.task-calendar {
|
||||||
.datetime {
|
.datetime {
|
||||||
label {
|
label {
|
||||||
margin-left: 1em;
|
margin-left: 1em;
|
||||||
line-height: 2.2;
|
|
||||||
text-align: right;
|
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
||||||
|
label {
|
||||||
|
line-height: 1.8;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
margin-right: .25rem;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
|
|
|
@ -137,6 +137,7 @@ $labels['arialabeltaskselector'] = 'List mode';
|
||||||
$labels['arialabeltasklisting'] = 'Tasks listing';
|
$labels['arialabeltasklisting'] = 'Tasks listing';
|
||||||
$labels['arialabelsortmenu'] = 'Tasks sorting options';
|
$labels['arialabelsortmenu'] = 'Tasks sorting options';
|
||||||
$labels['arialabeltasklistform'] = 'Tasks list properties';
|
$labels['arialabeltasklistform'] = 'Tasks list properties';
|
||||||
|
$labels['arialabeltaskform'] = 'Task editing form';
|
||||||
|
|
||||||
// attendees
|
// attendees
|
||||||
$labels['attendee'] = 'Assignee';
|
$labels['attendee'] = 'Assignee';
|
||||||
|
|
|
@ -777,6 +777,7 @@ body.taskdialog #taskedit {
|
||||||
display: block;
|
display: block;
|
||||||
top: 0;
|
top: 0;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
|
border: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#taskedit {
|
#taskedit {
|
||||||
|
|
|
@ -8,19 +8,5 @@
|
||||||
|
|
||||||
<roundcube:include file="/templates/taskedit.html" />
|
<roundcube:include file="/templates/taskedit.html" />
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
// UI startup
|
|
||||||
var UI = new rcube_mail_ui();
|
|
||||||
|
|
||||||
$(document).ready(function(e) {
|
|
||||||
rcmail.addEventListener('tasklist_editform_load', function(e){
|
|
||||||
if (rcmail.env.tasklist_driver == 'kolab')
|
|
||||||
UI.init_tabs($('#tasklistform > form').addClass('propform tabbed'));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Add table
Reference in a new issue