Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
calendar-event-dialog.js: fix editAttendees execution
Browse files Browse the repository at this point in the history
Now, our editAttendees dialog show up, but isn't full working
  • Loading branch information
Trim committed May 23, 2017
1 parent 189835e commit a9f9432
Showing 1 changed file with 39 additions and 25 deletions.
64 changes: 39 additions & 25 deletions chrome/content/calendar-event-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ exchangeEventDialog.prototype = {
return;
}

// Set window.calendarItem to be able to call getCalendar()
var args = this._window.arguments[0];
var item = args.calendarEvent;
this._window.calendarItem = item.clone();

// Override dialog callback to add extra exchangecalendar information processing
this._oldCallback = this._window.onAcceptCallback;
var self = this;
Expand All @@ -240,8 +245,6 @@ exchangeEventDialog.prototype = {
if (this._document.getElementById("todo-entrydate")) {
this._initialized = true;

var args = this._window.arguments[0];
var item = args.calendarEvent;
this.updateScreen(item, item.calendar);

// Display (or not) our body HTML editor
Expand Down Expand Up @@ -309,8 +312,8 @@ exchangeEventDialog.prototype = {
* editAttendees: call editAttendees with some already known informations
*/
editAttendees: function _editAttendees() {
var eventDialog = window;
var calendar = getCurrentCalendar();
var eventDialog = this._window;
var calendar = eventDialog.getCurrentCalendar();

var callback = function (attendees, organizer, startTime, endTime) {
eventDialog.attendees = attendees;
Expand Down Expand Up @@ -342,15 +345,15 @@ exchangeEventDialog.prototype = {
}

var duration = endTime.subtractDate(startTime);
startTime = startTime.clone();
endTime = endTime.clone();
var startTime = startTime.clone();
var endTime = endTime.clone();

var kDefaultTimezone = calendarDefaultTimezone();
gStartTimezone = startTime.timezone;
gEndTimezone = endTime.timezone;
gStartTime = startTime.getInTimezone(kDefaultTimezone);
gEndTime = endTime.getInTimezone(kDefaultTimezone);
gItemDuration = duration;
var gStartTimezone = startTime.timezone;
var gEndTimezone = endTime.timezone;
var gStartTime = startTime.getInTimezone(kDefaultTimezone);
var gEndTime = endTime.getInTimezone(kDefaultTimezone);
var gItemDuration = duration;

updateDateTime();
updateAllDay();
Expand All @@ -359,35 +362,46 @@ exchangeEventDialog.prototype = {
}
};

var startTime = gStartTime.getInTimezone(gStartTimezone);
var endTime = gEndTime.getInTimezone(gEndTimezone);
var startTime = {};
var endTime = {};

var isAllDay = getElementValue("event-all-day", "checked");
if (eventDialog.gStartTime) {
startTime = eventDialog.gStartTime.getInTimezone(eventDialog.gStartTimezone);
}
if (eventDialog.gEndTime) {
endTime = eventDialog.gEndTime.getInTimezone(eventDialog.gEndTimezone);
}

var isAllDay = null;
var isAllDayBox = this._document.getElementById("event-all-day");
if (isAllDayBox) {
isAllDay = isAllDayBox.getAttribute('checked');
}
if (isAllDay) {
startTime.isDate = true;
endTime.isDate = true;
endTime.day += 1;
startTime.isDate = true;
endTime.isDate = true;
endTime.day += 1;
} else {
startTime.isDate = false;
endTime.isDate = false;
startTime.isDate = false;
endTime.isDate = false;
}

var menuItem = this._document.getElementById('options-timezone-menuitem');
var displayTimezone = true;
if( menuItem != null){
displayTimezone = menuItem.getAttribute('checked') == 'true';
if( menuItem ){
displayTimezone = menuItem.getAttribute('checked');
}

var ewsDialogAttendees = {};
ewsDialogAttendees.endTime = endTime;
ewsDialogAttendees.startTime = startTime;
ewsDialogAttendees.displayTimezone = displayTimezone;
ewsDialogAttendees.attendees = this._window.attendees;
ewsDialogAttendees.organizer = this._window.organizer && this._window.organizer.clone();
ewsDialogAttendees.attendees = eventDialog.attendees;
ewsDialogAttendees.organizer = eventDialog.organizer && eventDialog.organizer.clone();
ewsDialogAttendees.calendar = calendar;
ewsDialogAttendees.item = this._window.calendarItem;
ewsDialogAttendees.item = eventDialog.calendarItem;
ewsDialogAttendees.onOk = callback;
ewsDialogAttendees.fbWrapper = this._window.fbWrapper;
ewsDialogAttendees.fbWrapper = eventDialog.fbWrapper;

// open the dialog modally
openDialog(
Expand Down

0 comments on commit a9f9432

Please sign in to comment.