Allow user to select calendar when saving an invitation event (#430)
This commit is contained in:
parent
97d8eade55
commit
00628dd5d5
6 changed files with 28 additions and 3 deletions
|
@ -684,6 +684,20 @@ class calendar extends rcube_plugin
|
|||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// get a list of writeable calendars
|
||||
$calendars = $this->driver->list_calendars();
|
||||
$calendar_select = new html_select(array('name' => 'calendar', 'id' => 'calendar-saveto'));
|
||||
$numcals = 0;
|
||||
foreach ($calendars as $calendar) {
|
||||
if (!$calendar['readonly']) {
|
||||
$calendar_select->add($calendar['name'], $calendar['id']);
|
||||
$numcals++;
|
||||
}
|
||||
}
|
||||
if ($numcals <= 1)
|
||||
$calendar_select = null;
|
||||
}
|
||||
|
||||
if ($status == 'unknown') {
|
||||
$html = html::div('rsvp-status', $this->gettext('notanattendee'));
|
||||
|
@ -702,6 +716,7 @@ class calendar extends rcube_plugin
|
|||
'status' => $status,
|
||||
'action' => $action,
|
||||
'html' => $html,
|
||||
'select' => $calendar_select ? html::span('calendar-select', $this->gettext('saveincalendar') . ' ' . $calendar_select->show($this->rc->config->get('calendar_default_calendar'))) : '',
|
||||
));
|
||||
return;
|
||||
|
||||
|
@ -2082,7 +2097,7 @@ class calendar extends rcube_plugin
|
|||
// successfully parsed events?
|
||||
if (!empty($events) && ($event = $events[$index])) {
|
||||
// find writeable calendar to store event
|
||||
$cal_id = $this->rc->config->get('calendar_default_calendar');
|
||||
$cal_id = !empty($_REQUEST['_calendar']) ? get_input_value('_calendar', RCUBE_INPUT_POST) : $this->rc->config->get('calendar_default_calendar');
|
||||
$calendars = $this->driver->list_calendars();
|
||||
$calendar = $calendars[$cal_id] ? $calendars[$cal_id] : null;
|
||||
if (!$calendar || $calendar['readonly']) {
|
||||
|
|
|
@ -211,6 +211,7 @@ rcube_calendar.add_event_from_mail = function(mime_id, status)
|
|||
'_uid': rcmail.env.uid,
|
||||
'_mbox': rcmail.env.mailbox,
|
||||
'_part': mime_id,
|
||||
'_calendar': $('#calendar-saveto').val(),
|
||||
'_status': status
|
||||
}, lock);
|
||||
return false;
|
||||
|
@ -265,7 +266,7 @@ window.rcmail && rcmail.addEventListener('init', function(evt) {
|
|||
else
|
||||
$('#loading-'+p.id).hide();
|
||||
|
||||
$('#'+p.action+'-'+p.id).show();
|
||||
$('#'+p.action+'-'+p.id).show().append(p.select);
|
||||
});
|
||||
|
||||
// register create-from-mail command to message_commands array
|
||||
|
|
|
@ -172,6 +172,7 @@ $labels['youhavetentative'] = 'Sie haben die Einladung mit Vorbehalt angenommen'
|
|||
$labels['youhavedeclined'] = 'Sie haben die Einladung abgelehnt';
|
||||
$labels['notanattendee'] = 'Sie sind nicht in der Liste der Teilnehmer aufgeführt';
|
||||
$labels['eventcancelled'] = 'Der Termin wurde vom Organisator abgesagt';
|
||||
$labels['saveincalendar'] = 'speichern in';
|
||||
|
||||
// event dialog tabs
|
||||
$labels['tabsummary'] = 'Übersicht';
|
||||
|
|
|
@ -172,6 +172,7 @@ $labels['youhavetentative'] = 'Sie haben die Einladung mit Vorbehalt angenommen'
|
|||
$labels['youhavedeclined'] = 'Sie haben die Einladung abgelehnt';
|
||||
$labels['notanattendee'] = 'Sie sind nicht in der Liste der Teilnehmer aufgeführt';
|
||||
$labels['eventcancelled'] = 'Der Termin wurde vom Organisator abgesagt';
|
||||
$labels['saveincalendar'] = 'speichern in';
|
||||
|
||||
// event dialog tabs
|
||||
$labels['tabsummary'] = 'Übersicht';
|
||||
|
|
|
@ -172,6 +172,7 @@ $labels['youhavetentative'] = 'You have tentatively accepted this invitation';
|
|||
$labels['youhavedeclined'] = 'You have declined this invitation';
|
||||
$labels['notanattendee'] = 'You\'re not listed as an attendee of this event';
|
||||
$labels['eventcancelled'] = 'The event has been cancelled';
|
||||
$labels['saveincalendar'] = 'save in';
|
||||
|
||||
// event dialog tabs
|
||||
$labels['tabsummary'] = 'Summary';
|
||||
|
|
|
@ -1193,11 +1193,17 @@ div.calendar-invitebox .rsvp-buttons {
|
|||
}
|
||||
|
||||
#event-rsvp input.button,
|
||||
div.calendar-invitebox input.button {
|
||||
div.calendar-invitebox input.button,
|
||||
div.calendar-invitebox select {
|
||||
font-size: 11px;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
|
||||
div.calendar-invitebox .calendar-select {
|
||||
font-size: 11px;
|
||||
margin-left: 1em;
|
||||
}
|
||||
|
||||
div.calendar-invitebox .rsvp-status.loading {
|
||||
color: #666;
|
||||
padding: 1px 0 2px 24px;
|
||||
|
|
Loading…
Add table
Reference in a new issue