Skip to content

Commit

Permalink
Fix UI behavior when updating a meeting the user is not the ORGANIZER
Browse files Browse the repository at this point in the history
* Show popup with correct question when updating as either
  the ORGANIZER (sends to attendees) or an attendee and updating
    RESPONSE (sends to the ORGANIZER).
  • Loading branch information
mrubinsk committed Dec 18, 2015
1 parent dbda854 commit 57151d1
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions kronolith/js/kronolith.js
Expand Up @@ -49,6 +49,7 @@ KronolithCore = {
paramsCache: null,
attendees: [],
resources: [],
attendanceChanged: false,

/**
* The location that was open before the current location.
Expand Down Expand Up @@ -4542,10 +4543,10 @@ KronolithCore = {
case 'kronolithEventSave':
if (!elt.disabled) {
if ($F('kronolithEventAttendees') && $F('kronolithEventId')
&& !$F('kronolithEventOrganizer')) {
&& (!$F('kronolithEventOrganizer') || this.attendanceChanged)) {
$('kronolithEventSendUpdates').setValue(0);
$('kronolithEventDiv').hide();
$('kronolithUpdateDiv').show();
this.showKronolithUpdateDiv();
e.stop();
break;
}
Expand Down Expand Up @@ -5412,7 +5413,7 @@ KronolithCore = {

if (event.value.mt && event.value.oy) {
$('kronolithEventDiv').hide();
$('kronolithUpdateDiv').show();
this.showKronolithUpdateDiv();
RedBox.showHtml($('kronolithEventDialog').show());
this.uatts = uatts;
this.ucb = callback;
Expand Down Expand Up @@ -5591,7 +5592,7 @@ KronolithCore = {

if (event.value.mt && event.value.oy) {
$('kronolithEventDiv').hide();
$('kronolithUpdateDiv').show();
this.showKronolithUpdateDiv();
RedBox.showHtml($('kronolithEventDialog').show());
this.uatts = uatts;
this.ucb = callback;
Expand Down Expand Up @@ -6023,6 +6024,7 @@ KronolithCore = {
$('kronolithEventTitle').setValue(ev.t);
$('kronolithEventLocation').setValue(ev.l);
$('kronolithEventTimezone').setValue(ev.tz);
this.attendanceChanged = false;
if (ev.l && Kronolith.conf.maps.driver) {
$('kronolithEventMapLink').show();
}
Expand Down Expand Up @@ -6220,6 +6222,11 @@ KronolithCore = {
}
},

eventAttendanceChange: function(x)
{
this.attendanceChanged = true;
},

getStatusText: function(x)
{
switch (x) {
Expand All @@ -6231,6 +6238,16 @@ KronolithCore = {
return Kronolith.text.noresponse;
},

showKronolithUpdateDiv: function()
{
if (this.attendanceChanged && $F('kronolithEventOrganizer')) {
$('kronolithUpdateDiv').down('p').update(Kronolith.text.update_organizer);
} else {
$('kronolithUpdateDiv').down('p').update(Kronolith.text.update_attendees);
}
$('kronolithUpdateDiv').show();
},

/**
* Adds an attendee row to the free/busy table.
*
Expand Down Expand Up @@ -7285,6 +7302,7 @@ KronolithCore = {
$('kronolithFBDateNext').observe('click', this.nextFreebusy.bind(this));
$('kronolithResourceFBDatePrev').observe('click', this.prevFreebusy.bind(this));
$('kronolithResourceFBDateNext').observe('click', this.nextFreebusy.bind(this));
$('kronolithEventAttendance').observe('change', this.eventAttendanceChange.bind(this));
},

initialize: function(location, r)
Expand Down

0 comments on commit 57151d1

Please sign in to comment.