Monotone-Parent: c0e690042905295d3b7946d9d917fcf8e91982ef
Monotone-Revision: f8b29d68c36441f92d7ffe8056a95fd25a2fd409 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-10-17T22:29:51 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
fdf333c65c
commit
4e7ed2dab8
10
ChangeLog
10
ChangeLog
|
@ -1,5 +1,15 @@
|
|||
2007-10-17 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/MailerUI/UIxMailActions.m ([UIxMailActions -copyAction]):
|
||||
implemented new web method.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
|
||||
-copyToFolderNamed:folderNameinContext:]): new method with the
|
||||
code cut/pasted from -moveToFolderNamed:inContext:.
|
||||
([SOGoMailObject -moveToFolderNamed:folderNameinContext:]):
|
||||
modified to use the code from -copyToFolderNamed:inContext:, which
|
||||
is common between the two actions.
|
||||
|
||||
* SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount -draftsFolderNameInContext:_ctx])
|
||||
([SOGoMailAccount -sentFolderNameInContext:])
|
||||
([SOGoMailAccount -trashFolderNameInContext:]): modified to take
|
||||
|
|
1
NEWS
1
NEWS
|
@ -1,6 +1,7 @@
|
|||
0.9.0-200710XX
|
||||
--------------
|
||||
- the user can now configure his folders as drafts, trash or sent folder;
|
||||
- added the ability the move and copy message across mail folders;
|
||||
|
||||
0.9.0-200709XX
|
||||
--------------
|
||||
|
|
|
@ -89,6 +89,8 @@
|
|||
|
||||
- (BOOL)isDeletionAllowed;
|
||||
- (NSException *) trashInContext:(id)_ctx;
|
||||
- (NSException *) copyToFolderNamed: (NSString *) folderName
|
||||
inContext: (id)_ctx;
|
||||
- (NSException *) moveToFolderNamed: (NSString *) folderName
|
||||
inContext: (id)_ctx;
|
||||
|
||||
|
|
|
@ -888,13 +888,12 @@ static BOOL debugSoParts = NO;
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (NSException *) moveToFolderNamed: (NSString *) folderName
|
||||
- (NSException *) copyToFolderNamed: (NSString *) folderName
|
||||
inContext: (id)_ctx
|
||||
{
|
||||
SOGoMailAccounts *destFolder;
|
||||
NSEnumerator *folders;
|
||||
NSString *currentFolderName, *reason;
|
||||
NSException *error;
|
||||
|
||||
// TODO: check for safe HTTP method
|
||||
|
||||
|
@ -925,17 +924,26 @@ static BOOL debugSoParts = NO;
|
|||
|
||||
/* a) copy */
|
||||
|
||||
error = [self davCopyToTargetObject: destFolder
|
||||
newName: @"fakeNewUnusedByIMAP4" /* autoassigned */
|
||||
inContext:_ctx];
|
||||
if (error != nil) return error;
|
||||
return [self davCopyToTargetObject: destFolder
|
||||
newName: @"fakeNewUnusedByIMAP4" /* autoassigned */
|
||||
inContext:_ctx];
|
||||
}
|
||||
|
||||
/* b) mark deleted */
|
||||
- (NSException *) moveToFolderNamed: (NSString *) folderName
|
||||
inContext: (id)_ctx
|
||||
{
|
||||
NSException *error;
|
||||
|
||||
error = [[self imap4Connection] markURLDeleted: [self imap4URL]];
|
||||
if (error != nil) return error;
|
||||
if (![self copyToFolderNamed: folderName
|
||||
inContext: _ctx])
|
||||
{
|
||||
/* b) mark deleted */
|
||||
|
||||
[self flushMailCaches];
|
||||
error = [[self imap4Connection] markURLDeleted: [self imap4URL]];
|
||||
if (error != nil) return error;
|
||||
|
||||
[self flushMailCaches];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
|
|
@ -180,6 +180,8 @@
|
|||
"Print..." = "Print...";
|
||||
"Delete Message" = "Delete Message";
|
||||
|
||||
"This Folder" = "This Folder";
|
||||
|
||||
/* Label popup menu */
|
||||
"None" = "None";
|
||||
"Important" = "Important";
|
||||
|
@ -214,3 +216,8 @@
|
|||
|
||||
"You need to choose a non-virtual folder!" = "You need to choose a non-virtual folder!";
|
||||
"You need to choose a root subfolder!" = "You need to choose a root subfolder!";
|
||||
|
||||
"Moving a message into its own folder is impossible!"
|
||||
= "Moving a message into its own folder is impossible!";
|
||||
"Copying a message into its own folder is impossible!"
|
||||
= "Copying a message into its own folder is impossible!";
|
||||
|
|
|
@ -181,6 +181,8 @@
|
|||
"Print..." = "Imprimer...";
|
||||
"Delete Message" = "Supprimer le message";
|
||||
|
||||
"This Folder" = "Ce dossier-ci";
|
||||
|
||||
/* Label popup menu */
|
||||
"None" = "Aucune";
|
||||
"Important" = "Important";
|
||||
|
@ -215,3 +217,8 @@
|
|||
|
||||
"You need to choose a non-virtual folder!" = "Vous devez choisir un dossier non-virtuel.";
|
||||
"You need to choose a root subfolder!" = "Vous devez choisir un sous-dossier de la racine.";
|
||||
|
||||
"Moving a message into its own folder is impossible!"
|
||||
= "Le déplacement d'un message dans son propre dossier est impossible.";
|
||||
"Copying a message into its own folder is impossible!"
|
||||
= "La copie d'un message dans son propre dossier est impossible.";
|
||||
|
|
|
@ -164,6 +164,8 @@
|
|||
"Print..." = "Drucken...";
|
||||
"Delete Message" = "Lõschen";
|
||||
|
||||
"This Folder" = "This Folder";
|
||||
|
||||
/* Label popup menu */
|
||||
"None" = "Aucune";
|
||||
"Important" = "Important";
|
||||
|
@ -198,3 +200,8 @@
|
|||
|
||||
"You need to choose a non-virtual folder!" = "You need to choose a non-virtual folder!";
|
||||
"You need to choose a root subfolder!" = "You need to choose a root subfolder!";
|
||||
|
||||
"Moving a message into its own folder is impossible!"
|
||||
= "Moving a message into its own folder is impossible!";
|
||||
"Copying a message into its own folder is impossible!"
|
||||
= "Copying a message into its own folder is impossible!";
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
NSString *destinationFolder;
|
||||
id response;
|
||||
|
||||
destinationFolder = [[context request] formValueForKey: @"tofolder"];
|
||||
destinationFolder = [[context request] formValueForKey: @"folder"];
|
||||
if ([destinationFolder length] > 0)
|
||||
{
|
||||
response = [[self clientObject] moveToFolderNamed: destinationFolder
|
||||
|
@ -119,6 +119,26 @@
|
|||
return response;
|
||||
}
|
||||
|
||||
- (id) copyAction
|
||||
{
|
||||
NSString *destinationFolder;
|
||||
id response;
|
||||
|
||||
destinationFolder = [[context request] formValueForKey: @"folder"];
|
||||
if ([destinationFolder length] > 0)
|
||||
{
|
||||
response = [[self clientObject] copyToFolderNamed: destinationFolder
|
||||
inContext: context];
|
||||
if (!response)
|
||||
response = [self responseWith204];
|
||||
}
|
||||
else
|
||||
response = [NSException exceptionWithHTTPStatus: 500 /* Server Error */
|
||||
reason: @"No destination folder given"];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/* active message */
|
||||
|
||||
- (id) markMessageUnreadAction
|
||||
|
|
|
@ -210,6 +210,11 @@
|
|||
actionClass = "UIxMailActions";
|
||||
actionName = "move";
|
||||
};
|
||||
copy = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailActions";
|
||||
actionName = "copy";
|
||||
};
|
||||
trash = {
|
||||
protectedBy = "View";
|
||||
actionClass = "UIxMailActions";
|
||||
|
|
|
@ -24,14 +24,7 @@ var MailerUIdTreeExtension = {
|
|||
},
|
||||
_addFolder: function (parent, folder) {
|
||||
var thisCounter = this.elementCounter;
|
||||
var fullName = "";
|
||||
var currentFolder = folder;
|
||||
while (currentFolder.parentFolder) {
|
||||
fullName = "/folder" + currentFolder.name + fullName;
|
||||
currentFolder = currentFolder.parentFolder;
|
||||
}
|
||||
fullName = "/" + currentFolder.name + fullName;
|
||||
this._addFolderNode(parent, folder.name, fullName, folder.type);
|
||||
this._addFolderNode(parent, folder.name, folder.fullName(), folder.type);
|
||||
for (var i = 0; i < folder.children.length; i++)
|
||||
this._addFolder(thisCounter, folder.children[i]);
|
||||
},
|
||||
|
|
|
@ -11,6 +11,8 @@ var currentMailboxType = "";
|
|||
var usersRightsWindowHeight = 320;
|
||||
var usersRightsWindowWidth = 400;
|
||||
|
||||
var pageContent;
|
||||
|
||||
/* mail list */
|
||||
|
||||
function openMessageWindow(msguid, url) {
|
||||
|
@ -330,12 +332,34 @@ function onMailboxTreeItemClick(event) {
|
|||
Event.stop(event);
|
||||
}
|
||||
|
||||
function onMailboxMenuMove() {
|
||||
window.alert("unimplemented");
|
||||
function _onMailboxMenuAction(menuEntry, error, actionName) {
|
||||
var targetMailbox = menuEntry.mailbox.fullName();
|
||||
|
||||
if (targetMailbox == currentMailbox)
|
||||
window.alert(labels[error]);
|
||||
else {
|
||||
var message;
|
||||
if (document.menuTarget instanceof HTMLDivElement)
|
||||
message = currentMessages[currentMailbox];
|
||||
else
|
||||
message = document.menuTarget.getAttribute("id").substr(4);
|
||||
|
||||
var urlstr = (URLForFolderID(currentMailbox) + "/" + message
|
||||
+ "/" + actionName + "?folder=" + targetMailbox);
|
||||
triggerAjaxRequest(urlstr, folderRefreshCallback, currentMailbox);
|
||||
}
|
||||
}
|
||||
|
||||
function onMailboxMenuCopy() {
|
||||
window.alert("unimplemented");
|
||||
function onMailboxMenuMove(event) {
|
||||
_onMailboxMenuAction(this,
|
||||
"Moving a message into its own folder is impossible!",
|
||||
"move");
|
||||
}
|
||||
|
||||
function onMailboxMenuCopy(event) {
|
||||
_onMailboxMenuAction(this,
|
||||
"Copying a message into its own folder is impossible!",
|
||||
"copy");
|
||||
}
|
||||
|
||||
function refreshMailbox() {
|
||||
|
@ -1141,13 +1165,13 @@ function generateMenuForMailbox(mailbox, prefix, callback) {
|
|||
menuDIV.setAttribute("id", prefix + "Submenu");
|
||||
var menu = document.createElement("ul");
|
||||
menuDIV.appendChild(menu);
|
||||
document.body.appendChild(menuDIV);
|
||||
pageContent.appendChild(menuDIV);
|
||||
|
||||
var callbacks = new Array();
|
||||
if (mailbox.type != "account") {
|
||||
var newNode = document.createElement("li");
|
||||
newNode.mailbox = mailbox;
|
||||
newNode.appendChild(document.createTextNode("coucou"));
|
||||
newNode.appendChild(document.createTextNode(labels["This Folder"]));
|
||||
menu.appendChild(newNode);
|
||||
menu.appendChild(document.createElement("li"));
|
||||
callbacks.push(callback);
|
||||
|
@ -1186,7 +1210,8 @@ function updateMailboxMenus() {
|
|||
menuDIV.parentNode.removeChild(menuDIV);
|
||||
|
||||
menuDIV = document.createElement("div");
|
||||
document.body.appendChild(menuDIV);
|
||||
pageContent = $("pageContent");
|
||||
pageContent.appendChild(menuDIV);
|
||||
|
||||
var menu = document.createElement("ul");
|
||||
menuDIV.appendChild(menu);
|
||||
|
@ -1441,6 +1466,18 @@ Mailbox.prototype.dump = function(indent) {
|
|||
}
|
||||
}
|
||||
|
||||
Mailbox.prototype.fullName = function() {
|
||||
var fullName = "";
|
||||
|
||||
var currentFolder = this;
|
||||
while (currentFolder.parentFolder) {
|
||||
fullName = "/folder" + currentFolder.name + fullName;
|
||||
currentFolder = currentFolder.parentFolder;
|
||||
}
|
||||
|
||||
return "/" + currentFolder.name + fullName;
|
||||
}
|
||||
|
||||
Mailbox.prototype.findMailboxByName = function(name) {
|
||||
var mailbox = null;
|
||||
|
||||
|
|
Loading…
Reference in New Issue