Commit 6ea3e685 authored by Mechtilde's avatar Mechtilde

New upstream version 3.9.0

parent ead54afb
......@@ -42,6 +42,9 @@ Cu.import("resource://exchangecalendar/ecFunctions.js");
if (! exchWebService) var exchWebService = {};
var exchangeStatistics = Cc["@1st-setup.nl/exchange/statistics;1"]
.getService(Ci.mivExchangeStatistics);
exchWebService.invitationResponse = {
onAccept: function _onAccept()
......@@ -49,9 +52,35 @@ exchWebService.invitationResponse = {
window.arguments[0].answer = "send";
window.arguments[0].bodyText = document.getElementById("exchWebService_messageReponseBody").value;
window.arguments[0].response = document.getElementById("exchWebService_itemResponse").value;
var pStart = this.formatDate(document.getElementById("exchWebService_propose_start").value);
var pEnd = this.formatDate(document.getElementById("exchWebService_propose_end").value);
window.arguments[0].proposeStart = pStart;
window.arguments[0].proposeEnd = pEnd;
return true;
},
formatDate: function _formatDate(date) {
var year = date.getFullYear(),
month = date.getMonth() + 1, // months are zero indexed
day = date.getDate(),
hour = date.getHours(),
minute = date.getMinutes(),
second = date.getSeconds(),
dayFormatted = day < 10 ? "0" + day : day,
monthFormatted = month < 10 ? "0" + month : month,
hourFormatted = hour < 10 ? "0" + hour : hour,
minuteFormatted = minute < 10 ? "0" + minute : minute,
secondFormatted = second < 10 ? "0" + second : second,
morning = hour < 12 ? "am" : "pm";
return year + "-" + monthFormatted + "-" + dayFormatted + "T" + hourFormatted + ":" +
minuteFormatted + ":"+ secondFormatted+ "Z" ;
},
onLoad: function _onLoad()
{
var item = window.arguments[0].item;
......@@ -78,12 +107,36 @@ exchWebService.invitationResponse = {
document.getElementById("exchWebService_meetingOrganiser").value = "(unknown)";
}
document.getElementById("exchWebService_messageReponseBody").placeholder = window.arguments[0].response;
document.getElementById("exchWebService_messageReponseBody").placeholder = window.arguments[0].response;
var serverUrl = window.arguments[0].serverUrl;
if ( exchangeStatistics.getServerVersion(serverUrl).indexOf("Exchange2013") > -1) {
document.getElementById("exchWebService_propose_time_checkbox").setAttribute("disabled","false");
}
else{
document.getElementById("exchWebService_propose_time_checkbox").setAttribute("disabled","true");
}
},
doResponseChanged: function _doResponseChanged(aMenuList)
{
document.getElementById("exchWebService_messageReponseBody").placeholder = aMenuList.value;
},
onCheckChanged: function _onCheckChanged(aCheckbox)
{
if( aCheckbox.checked == true ){
document.getElementById("exchWebService_propose_end_label").setAttribute("disabled","false");
document.getElementById("exchWebService_propose_start_label").setAttribute("disabled","false");
document.getElementById("exchWebService_propose_start").setAttribute("disabled","false");
document.getElementById("exchWebService_propose_end").setAttribute("disabled","false");
}
else{
document.getElementById("exchWebService_propose_end_label").setAttribute("disabled","true");
document.getElementById("exchWebService_propose_start_label").setAttribute("disabled","true");
document.getElementById("exchWebService_propose_start").setAttribute("disabled","true");
document.getElementById("exchWebService_propose_end").setAttribute("disabled","true");
}
},
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<!--
/* ***** BEGIN LICENSE BLOCK *****
* Version: GPL 3.0
......@@ -37,60 +36,67 @@
*
* ***** BEGIN LICENSE BLOCK *****/
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css" ?>
<?xml-stylesheet type="text/css" href="chrome://calendar/content/datetimepickers/datetimepickers.css" ?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE dialog [
<!ENTITY % dtd1 SYSTEM "chrome://exchangecalendar/locale/invitationResponse.dtd" > %dtd1;
]>
<!DOCTYPE dialog [
<!ENTITY % dtd1 SYSTEM "chrome://exchangecalendar/locale/invitationResponse.dtd" > %dtd1; ]>
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" id="exchWebService_invitationResponse_dialog" title="&description.invitationResponse;" buttons="accept,cancel" buttonlabelaccept="&label.acceptbutton;" buttonlabelcancel="&label.cancelbutton;" ondialogaccept="return exchWebService.invitationResponse.onAccept();" onload="exchWebService.invitationResponse.onLoad();">
<dialog
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
id="exchWebService_invitationResponse_dialog"
title="Select"
buttons="accept,cancel"
buttonlabelaccept="&label.acceptbutton;"
buttonlabelcancel="&label.cancelbutton;"
ondialogaccept="return exchWebService.invitationResponse.onAccept();"
onload="exchWebService.invitationResponse.onLoad();">
<script type="application/javascript" src="chrome://exchangecalendar/content/invitationResponse.js" />
<script type="application/javascript" src="chrome://exchangecalendar/content/invitationResponse.js"/>
<script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js" />
<script type="application/javascript" src="chrome://calendar/content/calUtils.js" />
<script type="application/javascript" src="chrome://calendar/content/calApplicationUtils.js" />
<vbox>
<description value="&description.invitationResponse;"/>
<seperator/>
<grid>
<columns>
<column />
<column flex="1"/>
<column flex="1" />
</columns>
<rows>
<row> <label value="&label.calendarName;"/> <label id="exchWebService_calendarName"/> </row>
<row> <label value="&label.itemTitle;"/> <label id="exchWebService_itemTitle"/> </row>
<row> <label value="&label.itemStart;"/> <label id="exchWebService_itemStart"/> </row>
<row> <label value="&label.itemResponse;"/>
<menulist label="(Make a choice)" id="exchWebService_itemResponse" value="1" oncommand="exchWebService.invitationResponse.doResponseChanged(this);">
<menupopup>
<menuitem label="&menuitem.label.ec-autorespond-answer.tentative;" value="TENTATIVE"/>
<menuitem label="&menuitem.label.ec-autorespond-answer.accepted;" value ="ACCEPTED"/>
<menuitem label="&menuitem.label.ec-autorespond-answer.declined;" value ="DECLINED"/>
</menupopup>
</menulist>
</row>
<row> <label value="&label.meetingOrganiser;"/> <label id="exchWebService_meetingOrganiser"/> </row>
<row>
<label value="&label.calendarName;" />
<label id="exchWebService_calendarName" />
</row>
<row>
<label value="&label.itemTitle;" />
<label id="exchWebService_itemTitle" />
</row>
<row>
<label value="&label.itemStart;" />
<label id="exchWebService_itemStart" />
</row>
<row>
<label value="&label.itemResponse;" />
<menulist label="(Make a choice)" id="exchWebService_itemResponse" value="1" oncommand="exchWebService.invitationResponse.doResponseChanged(this);">
<menupopup>
<menuitem label="&menuitem.label.ec-autorespond-answer.tentative;" value="TENTATIVE" />
<menuitem label="&menuitem.label.ec-autorespond-answer.accepted;" value="ACCEPTED" />
<menuitem label="&menuitem.label.ec-autorespond-answer.declined;" value="DECLINED" />
</menupopup>
</menulist>
</row>
<row>
<label value="&label.meetingOrganiser;" />
<label id="exchWebService_meetingOrganiser" />
</row>
</rows>
</grid>
<seperator/>
<checkbox id="exchWebService_propose_time_checkbox" label="&label.proposenewtime.title;" oncommand="exchWebService.invitationResponse.onCheckChanged(this);" checked="false" pack="start" />
<groupbox id="exchWebService_propose_groupbox">
<label value="&label.proposenewtime.start;" id="exchWebService_propose_start_label" control="exchWebService_propose_start" class="event-only" disable-on-readonly="true" />
<label value="&label.messageReponseBody;"/>
<textbox id="exchWebService_messageReponseBody" multiline="true" label="messageResponseBody" rows="5"/>
<datetimepicker id="exchWebService_propose_start" disable-on-readonly="true" class="event-only" disabled="true" />
<seperator/>
<label value="&label.proposenewtime.end;" id="exchWebService_propose_end_label" control="exchWebService_propose_end" class="event-only" disable-on-readonly="true" />
<datetimepicker id="exchWebService_propose_end" class="event-only" disable-on-readonly="true" disabled="true" />
</groupbox>
<seperator/>
<label value="&label.messageReponseBody;" />
<textbox id="exchWebService_messageReponseBody" multiline="true" label="messageResponseBody" rows="5" />
</vbox>
</dialog>
</dialog>
\ No newline at end of file
......@@ -35,6 +35,8 @@
* ***** BEGIN LICENSE BLOCK *****/
var Cu = Components.utils;
var Ci = Components.interfaces;
var Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
......@@ -70,7 +72,9 @@ function erSendMeetingResponsRequest(aArgument, aCbOk, aCbError, aListener)
this.response = aArgument.response;
this.item = aArgument.item;
this.messageDisposition = aArgument.messageDisposition;
this.pstart = aArgument.proposeStart;
this.pend = aArgument.proposeEnd;
this.proposeNewTime = aArgument.proposeNewTime;
this.isRunning = true;
this.execute();
}
......@@ -115,25 +119,36 @@ erSendMeetingResponsRequest.prototype = {
if (this.senderMailbox) {
r.addChildTag("Sender", "nsTypes", null).addChildTag("Mailbox", "nsTypes", null).addChildTag("EmailAddress", "nsTypes", this.senderMailbox);
}
}
var referenceItemId = r.addChildTag("ReferenceItemId", "nsTypes", null);
referenceItemId.setAttribute("Id", this.item.id);
referenceItemId.setAttribute("ChangeKey", this.item.changeKey);
this.exchangeStatistics = Cc["@1st-setup.nl/exchange/statistics;1"]
.getService(Ci.mivExchangeStatistics);
if (this.exchangeStatistics.getServerVersion(this.serverUrl).indexOf("Exchange2013") > -1) {
if( this.proposeNewTime == true ){
r.addChildTag("ProposedStart", "nsTypes", this.pstart);
r.addChildTag("ProposedEnd", "nsTypes", this.pend);
}
}
req.addChildTag("Items", "nsMessages", null).addChildTagObject(r);
r = null;
this.parent.xml2jxon = true;
//exchWebService.commonFunctions.LOG("erSendMeetingResponsRequest.execute>"+String(this.parent.makeSoapMessage(req)));
this.parent.sendRequest(this.parent.makeSoapMessage(req), this.serverUrl);
// exchWebService.commonFunctions.LOG("erSendMeetingResponsRequest.execute>"+String(req));
this.parent.sendRequest(this.parent.makeSoapMessage(req), this.serverUrl);
req = null;
},
onSendOk: function _onSendOk(aExchangeRequest, aResp)
{
//exchWebService.commonFunctions.LOG("erSendMeetingResponsRequest.onSendOk: "+String(aResp)+"\n");
// exchWebService.commonFunctions.LOG("erSendMeetingResponsRequest.onSendOkxxxxxxxxxx : "+String(aResp)+"\n");
var rm = aResp.XPath("/s:Envelope/s:Body/m:CreateItemResponse/m:ResponseMessages/m:CreateItemResponseMessage[@ResponseClass='Success']");
if (rm.length == 0) {
......
......@@ -5,13 +5,13 @@
<Description about="urn:mozilla:install-manifest">
<em:id>exchangecalendar@extensions.1st-setup.nl</em:id>
<em:version>3.8.0</em:version>
<em:version>3.9.0</em:version>
<em:targetApplication>
<Description>
<!-- Thunderbird -->
<em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
<em:minVersion>12.0</em:minVersion>
<em:maxVersion>45.*</em:maxVersion>
<em:maxVersion>50.*</em:maxVersion>
</Description>
</em:targetApplication>
......
......@@ -5531,6 +5531,9 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
var input= { item: aItem,
response: tmpResponse,
answer: "",
proposeStart: "",
proposeEnd: "",
serverUrl: this.serverUrl,
bodyText: ""};
if (preInput.response == "edit") {
......@@ -5547,7 +5550,7 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
"chrome,titlebar,toolbar,centerscreen,dialog,modal=yes,resizable=yes",
input);
}
if (input.answer != "send") {
if (this.debug) this.logInfo("User canceled invitationDialog.");
return false;
......@@ -5561,8 +5564,19 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
messageDisposition = "SaveOnly";
}
}
if (this.debug) this.logInfo(" -------------- messageDisposition="+messageDisposition);
if (this.debug) this.logInfo(" -------------- messageDisposition="+messageDisposition);
var proposeStart = this.tryToSetDateValue(input.proposeStart,"");
var proposeEnd = this.tryToSetDateValue(input.proposeEnd,"");
var proposeNewTime = false;
input.proposeStart = cal.toRFC3339(proposeStart.getInTimezone(this.globalFunctions.ecUTC()));
input.proposeEnd = cal.toRFC3339(proposeEnd.getInTimezone( this.globalFunctions.ecUTC()));
if( input.proposeStart && input.proposeEnd ){
proposeNewTime = true;
}
var self = this;
this.addToQueue( erSendMeetingResponsRequest,
{user: this.user,
......@@ -5574,6 +5588,9 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
changeKey: this.changeKey,
response: input.response,
bodyText: input.bodyText,
proposeStart: input.proposeStart,
proposeEnd: input.proposeEnd,
proposeNewTime: proposeNewTime,
senderMailbox: this.mailbox,
actionStart: Date.now(),
itemType: aItemType,
......
......@@ -17,3 +17,6 @@
<!ENTITY label.proposenewtime.title "Propose new time (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Start time">
<!ENTITY label.proposenewtime.end "End time">
......@@ -15,5 +15,6 @@
<!ENTITY menuitem.label.ec-autorespond-answer.accepted "I will attend">
<!ENTITY menuitem.label.ec-autorespond-answer.declined "I will not attend">
<!ENTITY label.proposenewtime.title "Propose new time (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Start time">
<!ENTITY label.proposenewtime.end "End time">
......@@ -17,3 +17,6 @@
<!ENTITY label.proposenewtime.title "Propose new time (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Start time">
<!ENTITY label.proposenewtime.end "End time">
......@@ -17,3 +17,6 @@
<!ENTITY label.proposenewtime.title "Propose new time (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Start time">
<!ENTITY label.proposenewtime.end "End time">
......@@ -22,3 +22,6 @@
<!ENTITY label.proposenewtime.title "Propose new time (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Start time">
<!ENTITY label.proposenewtime.end "End time">
......@@ -17,3 +17,6 @@
<!ENTITY label.proposenewtime.title "Propose new time (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Start time">
<!ENTITY label.proposenewtime.end "End time">
......@@ -14,3 +14,6 @@
<!ENTITY menuitem.label.ec-autorespond-answer.tentative "Jag kommer kanske att närvara">
<!ENTITY menuitem.label.ec-autorespond-answer.accepted "Jag kommer att närvara">
<!ENTITY menuitem.label.ec-autorespond-answer.declined "Jag kommer inte att närvara">
<!ENTITY label.proposenewtime.title "Propose new time (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Start time">
<!ENTITY label.proposenewtime.end "End time">
......@@ -47,9 +47,9 @@
<!ENTITY button.label.folderpathcheck “Denetle”>
<!ENTITY button.label.folderbrowse “Gözat”>
<!ENTITY exchWebServices.UserAvailability.label “Yalnızca, posta kutusuna ait takvimin kullanıcı müsaitliği durumu görünür olacak.">
<!ENTITY exchWebServices.UserAvailability.label “Yalnızca posta kutusuna ait takvimin kullanıcı müsaitliği durumu görünür olacak.">
<!ENTITY exchWebServices.exchtype.label "Exchange Type">
<!ENTITY exchWebServices.hostexch.label "Hosted Exchange">
<!ENTITY exchWebServices.exchtype.label "Exchange Çeşiti">
<!ENTITY exchWebServices.hostexch.label "Sunucuda Ağırlanan Exchange">
<!ENTITY exchWebServices.365exch.label "Microsoft Office365">
<!ENTITY exchWebServices.detail.label "Details">
<!ENTITY exchWebServices.detail.label "Detaylar">
......@@ -5,7 +5,7 @@
<!ENTITY label.calendarName “Takvim:”>
<!ENTITY label.itemTitle “Konu:”>
<!ENTITY label.itemStart “Başlangıç zamanı:”>
<!ENTITY label.itemStart “Başlama zamanı:”>
<!ENTITY label.itemResponse "Yanıtın:”>
<!ENTITY label.meetingOrganiser "Düzenleyen:”>
......@@ -17,3 +17,6 @@
<!ENTITY label.proposenewtime.title "Yeni bir zaman öner (>= Exchange2013)">
<!ENTITY label.proposenewtime.start "Başlama zamanı">
<!ENTITY label.proposenewtime.end "Sona erme zamanı">
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment