Monotone-Parent: 1d7595555adaaa499a56601d8635282526350a2e

Monotone-Revision: 417eb1a0caae0d680292391081de2e4b99beecda

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2008-01-08T20:29:51
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2008-01-08 20:29:51 +00:00
parent 185195814e
commit f4e0ba66e6
11 changed files with 191 additions and 50 deletions

View File

@@ -1,3 +1,9 @@
2008-01-08 Francis Lachapelle <flachapelle@inverse.ca>
* UI/MailerUI/UIxMailAccountActions.m ([UIxMailAccountActions
-composeAction]): the mailto form parameter can now be a
comma-separated list of email addresses.
2007-12-21 Ludovic Marcotte <ludovic@inverse.ca>
* UI/Contacts/UIxContactView.m

View File

@@ -1,6 +1,6 @@
/* UIxMailAccountActions.m - this file is part of SOGo
*
* Copyright (C) 2007 Inverse groupe conseil
* Copyright (C) 2007, 2008 Inverse groupe conseil
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
@@ -157,7 +157,7 @@
value = [[self request] formValueForKey: @"mailto"];
if ([value length] > 0)
{
mailTo = [NSArray arrayWithObject: value];
mailTo = [value componentsSeparatedByString: @","];
[newDraftMessage
setHeaders: [NSDictionary dictionaryWithObject: mailTo
forKey: @"to"]];

View File

@@ -87,6 +87,9 @@
"Reload Remote Calendars" = "Reload Remote Calendars";
"Properties" = "Properties";
"Compose E-Mail to All Attendees" = "Compose E-Mail to All Attendees";
"Compose E-Mail to Undecided Attendees" = "Compose E-Mail to Undecided Attendees";
/* Folders */
"Personal calendar" = "Personal calendar";

View File

@@ -88,6 +88,9 @@
"Reload Remote Calendars" = "Recharger les agendas distants";
"Properties" = "Propriétés";
"Compose E-Mail to All Attendees" = "Rédiger un courriel pour tous les participants";
"Compose E-Mail to Undecided Attendees" = "Rédiger un courriel pour les participants indécis";
/* Folders */
"Personal calendar" = "Agenda personnel";

View File

@@ -76,6 +76,9 @@
"Reload Remote Calendars" = "Externe Kalender neu laden";
"Properties" = "Einstellungen";
"Compose E-Mail to All Attendees" = "E-Mail an alle Teilnehmer erstellen";
"Compose E-Mail to Undecided Attendees" = "E-Mail an unentschlossene Teilnehmer erstellen";
/* Folders */
"Personal calendar" = "Personal calendar";

View File

@@ -11,6 +11,16 @@
var:component="event"
var:saveURL="saveURL">
<div class="menu" id="attendeesMenu">
<ul>
<li><var:string label:value="Invite Attendees"/>...</li>
<li class="separator"><!-- separator --></li>
<li><var:string label:value="Compose E-Mail to All Attendees" />...</li>
<li id="composeToUndecidedAttendees"><var:string label:value="Compose E-Mail to Undecided Attendees" />...</li>
<li class="separator"><!-- separator --></li>
</ul>
</div>
<label><span id="allDay" class="content"><input class="checkBox"
type="checkbox" var:selection="isAllDay"
var:checked="isAllDay"

View File

@@ -268,16 +268,6 @@ function deleteSelectedMessagesCallback(http) {
log ("deleteSelectedMessagesCallback: problem during ajax request " + http.status);
}
function deleteDraft(url) {
/* this is called by UIxMailEditor with window.opener */
new Ajax.Request(url, {
method: 'post',
onFailure: function(transport) {
log("draftDeleteCallback: problem during ajax request: " + transport.status);
}
});
}
function moveMessages(rowIds, folder) {
var failCount = 0;

View File

@@ -143,3 +143,21 @@ LABEL#urlArea INPUT
A#attendeesHref
{ color: #00f;
text-decoration: underline; }
DIV#attendeesMenu LI
{ padding-left: 20px; }
DIV#attendeesMenu LI.accepted
{ background-image: url("accepted.png");
background-repeat: no-repeat;
background-position: 5px center; }
DIV#attendeesMenu LI.needs-action
{ background-image: url("needs-action.png");
background-repeat: no-repeat;
background-position: 5px center; }
DIV#attendeesMenu LI.declined
{ background-image: url("declined.png");
background-repeat: no-repeat;
background-position: 5px center; }

View File

@@ -20,6 +20,9 @@
*/
var contactSelectorAction = 'calendars-contacts';
var AppointmentEditor = {
attendeesMenu: null
};
function uixEarlierDate(date1, date2) {
// can this be done in a sane way?
@@ -132,6 +135,42 @@ function toggleCycleVisibility(node, nodeName, hiddenValue) {
}
}
function onAttendeesMenuPrepareVisibility()
{
var composeToUndecidedAttendees = $('composeToUndecidedAttendees');
var attendeesStates = $('attendeesStates').value;
if (attendeesStates.indexOf("needs-action") < 0)
composeToUndecidedAttendees.addClassName("disabled");
else
composeToUndecidedAttendees.removeClassName("disabled");
}
function onComposeToAllAttendees()
{
var attendees = $$("DIV#attendeesMenu LI.attendee");
var addresses = new Array();
attendees.each(function(item) {
addresses.push(item.readAttribute("email"));
});
if (window.opener)
window.opener.openMailTo(addresses.join(","));
}
function onComposeToUndecidedAttendees()
{
if ($(this).hasClassName("disabled"))
return;
var attendees = $$("DIV#attendeesMenu LI.attendee.needs-action");
var addresses = new Array();
attendees.each(function(item) {
addresses.push(item.readAttribute("email"));
});
if (window.opener)
window.opener.openMailTo(addresses.join(","));
}
function addContact(tag, fullContactName, contactId, contactName, contactEmail) {
var uids = $('uixselector-participants-uidList');
@@ -291,6 +330,81 @@ function initTimeWidgets(widgets) {
}
}
function refreshAttendees() {
var attendeesLabel = $("attendeesLabel");
var attendeesNames = $("attendeesNames").value;
var attendeesEmails = $("attendeesEmails").value.split(",");
var attendeesStates = $("attendeesStates").value.split(",");
var attendeesMenu = $("attendeesMenu").down("ul");
var attendeesHref = $("attendeesHref");
// Remove link of attendees
for (var i = 0; i < attendeesHref.childNodes.length; i++)
attendeesHref.removeChild(attendeesHref.childNodes[i]);
// Remove attendees from menu
var menuItems = $$("DIV#attendeesMenu LI.attendee");
if (menuItems)
for (var i = 0; i < menuItems.length; i++)
attendeesMenu.removeChild(menuItems[i]);
if (attendeesNames.length > 0) {
// Update attendees link and show label
attendeesHref.appendChild(document.createTextNode(attendeesNames));
attendeesLabel.setStyle({ display: "block" });
// Update attendees in menu
attendeesNames = attendeesNames.split(",");
for (var i = 0; i < attendeesEmails.length; i++) {
var node = document.createElement("li");
attendeesMenu.appendChild(node);
$(node).writeAttribute("email", attendeesEmails[i]);
$(node).addClassName("attendee");
$(node).addClassName(attendeesStates[i]);
node.appendChild(document.createTextNode(attendeesNames[i]));
$(node).observe("click", onMailTo);
}
}
else {
// Hide link of attendees
attendeesLabel.setStyle({ display: "none" });
}
}
function initializeAttendeesHref() {
var attendeesHref = $("attendeesHref");
var attendeesLabel = $("attendeesLabel");
var attendeesNames = $("attendeesNames");
Event.observe(attendeesHref, "click", onAttendeesHrefClick, false);
refreshAttendees();
}
function onAttendeesHrefClick(event) {
popupToolbarMenu(this, 'attendeesMenu');
preventDefault(event);
return false;
}
function onMailTo(event) {
var target = getTarget(event);
openMailTo(target.readAttribute("email"));
}
function getMenus() {
AppointmentEditor.attendeesMenu = new Array(onPopupAttendeesWindow,
"-",
onComposeToAllAttendees,
onComposeToUndecidedAttendees,
"-",
null);
var attendeesMenu = $('attendeesMenu');
attendeesMenu.prepareVisibility = onAttendeesMenuPrepareVisibility;
return { "attendeesMenu": AppointmentEditor.attendeesMenu };
}
function onAppointmentEditorLoad() {
assignCalendar('startTime_date');
assignCalendar('endTime_date');
@@ -302,6 +416,7 @@ function onAppointmentEditorLoad() {
'hour': $("endTime_time_hour"),
'minute': $("endTime_time_minute")}};
initTimeWidgets(widgets);
initializeAttendeesHref();
}
FastInit.addOnLoad(onAppointmentEditorLoad);

View File

@@ -77,36 +77,6 @@ function onChangeCalendar(event) {
form.setAttribute("action", urlElems.join("/"));
}
function refreshAttendees() {
var attendeesLabel = $("attendeesLabel");
var attendeesNames = $("attendeesNames");
var attendeesHref = $("attendeesHref");
for (var i = 0; i < attendeesHref.childNodes.length; i++)
attendeesHref.removeChild(attendeesHref.childNodes[i]);
if (attendeesNames.value.length > 0) {
attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
attendeesLabel.setStyle({ display: "block" });
}
else {
attendeesLabel.setStyle({ display: "none" });
}
}
function initializeAttendeesHref() {
var attendeesHref = $("attendeesHref");
var attendeesLabel = $("attendeesLabel");
var attendeesNames = $("attendeesNames");
Event.observe(attendeesHref, "click", onPopupAttendeesWindow, false);
if (attendeesNames.value.length > 0) {
attendeesHref.setStyle({ textDecoration: "underline", color: "#00f" });
attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
attendeesLabel.setStyle({ display: "block" });
}
}
function initializeDocumentHref() {
var documentHref = $("documentHref");
var documentLabel = $("documentLabel");
@@ -141,8 +111,6 @@ function initializePrivacyMenu() {
}
function onComponentEditorLoad(event) {
if (!$("statusPercent"))
initializeAttendeesHref();
initializeDocumentHref();
initializePrivacyMenu();
var list = $("calendarList");

View File

@@ -257,8 +257,16 @@ function openMailComposeWindow(url, wId) {
}
function openMailTo(senderMailTo) {
var mailto = sanitizeMailTo(senderMailTo);
var addresses = senderMailTo.split(",");
var sanitizedAddresses = new Array();
for (var i = 0; i < addresses.length; i++) {
var sanitizedAddress = sanitizeMailTo(addresses[i]);
if (sanitizedAddress.length > 0)
sanitizedAddresses.push(sanitizedAddress);
}
var mailto = sanitizedAddresses.join(",");
if (mailto.length > 0)
openMailComposeWindow(ApplicationBaseURL
+ "../Mail/compose?mailto=" + mailto);
@@ -266,6 +274,16 @@ function openMailTo(senderMailTo) {
return false; /* stop following the link */
}
function deleteDraft(url) {
/* this is called by UIxMailEditor with window.opener */
new Ajax.Request(url, {
method: 'post',
onFailure: function(transport) {
log("draftDeleteCallback: problem during ajax request: " + transport.status);
}
});
}
function createHTTPClient() {
// http://developer.apple.com/internet/webcontent/xmlhttpreq.html
if (typeof XMLHttpRequest != "undefined")
@@ -579,10 +597,10 @@ function popupMenu(event, menuId, target) {
- (menuLeft + popup.offsetWidth));
if (leftDiff < 0)
menuLeft -= popup.offsetWidth;
if (popup.prepareVisibility)
popup.prepareVisibility();
popup.setStyle({ top: menuTop + "px",
left: menuLeft + "px",
visibility: "visible" });
@@ -614,6 +632,8 @@ function getParentMenu(node) {
function onBodyClickMenuHandler(event) {
hideMenu(document.currentPopupMenu);
document.body.stopObserving("click", onBodyClickMenuHandler);
document.body.stopObserving("mouseup", onBodyClickMenuHandler);
document.currentPopupMenu = null;
if (event)
preventDefault(event);
@@ -965,13 +985,18 @@ function popupToolbarMenu(node, menuId) {
hideMenu(document.currentPopupMenu);
var popup = $(menuId);
var top = ($(node).getStyle('top') || 0) + node.offsetHeight - 2;
if (popup.prepareVisibility)
popup.prepareVisibility();
var offset = $(node).cumulativeOffset();
var top = offset.top + node.offsetHeight;
popup.setStyle({ top: top + "px",
left: $(node).cascadeLeftOffset() + "px",
left: offset.left + "px",
visibility: "visible" });
document.currentPopupMenu = popup;
$(document.body).observe("click", onBodyClickMenuHandler);
$(document.body).observe("mouseup", onBodyClickMenuHandler);
}
/* contact selector */