From 8bf367ea4c642a531ff48cb6da36023a543d0fda Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 21 Aug 2007 16:00:25 +0000 Subject: [PATCH 1/3] Monotone-Parent: 992caf023ddb85d68d02283b857594a23b4582e7 Monotone-Revision: c8ffc75afc6375fd954ab207e9dbdef8b4793876 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-21T16:00:25 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/ContactsUI.js | 35 +++++++--------------------- UI/WebServerResources/MailerUI.js | 36 ++++------------------------- UI/WebServerResources/generic.js | 16 +++++++++++-- 3 files changed, 26 insertions(+), 61 deletions(-) diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index ab4ab2a12..718c494f6 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -6,11 +6,6 @@ var currentContactFolder = null; var usersRightsWindowHeight = 200; var usersRightsWindowWidth = 450; -function openContactWindow(sender, url) { - var msgWin = window.open(url, null, "width=450,height=600,resizable=0"); - msgWin.focus(); -} - function validateEditorInput(sender) { var errortext = ""; var field; @@ -280,9 +275,8 @@ function onContactRowClick(event, node) { function onContactRowDblClick(event, node) { var contactId = node.getAttribute('id'); - openContactWindow(null, - URLForFolderID(currentContactFolder) - + "/" + contactId + "/edit"); + openContactWindow(URLForFolderID(currentContactFolder) + + "/" + contactId + "/edit", contactId); return false; } @@ -290,9 +284,8 @@ function onContactRowDblClick(event, node) { function onMenuEditContact(event) { var contactId = document.menuTarget.getAttribute('id'); - openContactWindow(null, - URLForFolderID(currentContactFolder) - + "/" + contactId + "/edit"); + openContactWindow(URLForFolderID(currentContactFolder) + + "/" + contactId + "/edit", contactId); } function onMenuWriteToContact(event) { @@ -311,9 +304,8 @@ function onToolbarEditSelectedContacts(event) { var rows = contactsList.getSelectedRowsId(); for (var i = 0; i < rows.length; i++) { - openContactWindow(null, - URLForFolderID(currentContactFolder) - + "/" + rows[i] + "/edit"); + openContactWindow(URLForFolderID(currentContactFolder) + + "/" + rows[i] + "/edit", rows[i]); } return false; @@ -372,13 +364,7 @@ function newEmailTo(sender) { var mailto = sanitizeMailTo(sender.parentNode.parentNode.menuTarget.innerHTML); if (mailto.length > 0) - { - w = window.open("compose?mailto=" + mailto, - "SOGo_compose", - "width=680,height=520,resizable=1,scrollbars=1,toolbar=0," + - "location=0,directories=0,status=0,menubar=0,copyhistory=0"); - w.focus(); - } + openMailComposeWindow("compose?mailto=" + mailto); return false; /* stop following the link */ } @@ -411,13 +397,8 @@ function onHeaderClick(event) { preventDefault(event); } -function registerDraggableMessageNodes() { - log ("can we drag..."); -} - function newContact(sender) { - openContactWindow(sender, - URLForFolderID(currentContactFolder) + "/new"); + openContactWindow(URLForFolderID(currentContactFolder) + "/new"); return false; /* stop following the link */ } diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index d0aa924f9..1327b2454 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -19,9 +19,7 @@ function openMessageWindow(msguid, url) { wId += "SOGo_msg_" + msguid; markMailReadInWindow(window, msguid); } - var msgWin = window.open(url, wId, - "width=680,height=520,resizable=1,scrollbars=1,toolbar=0," - + "location=0,directories=0,status=0,menubar=0,copyhistory=0"); + var msgWin = openMailComposeWindow(url, wId); if (msguid) { msgWin.messageId = msguid; msgWin.messageURL = ApplicationBaseURL + currentMailbox + "/" + msguid; @@ -122,25 +120,6 @@ function markMailReadInWindow(win, msguid) { return markMailInWindow(win, msguid, true); } -/* main window */ - -function reopenToRemoveLocationBar() { - // we cannot really use this, see below at the close comment - if (window.locationbar && window.locationbar.visible) { - newwin = window.open(window.location.href, "SOGo", - "width=800,height=600,resizable=1,scrollbars=1," + - "toolbar=0,location=0,directories=0,status=0," + - "menubar=0,copyhistory=0"); - if (newwin) { - window.close(); // this does only work for windows opened by scripts! - newwin.focus(); - return true; - } - return false; - } - return true; -} - /* mail list reply */ function openMessageWindowsForSelection(action, firstOnly) { @@ -393,9 +372,7 @@ function onComposeMessage() { function composeNewMessage() { var account = currentMailbox.split("/")[1]; var url = ApplicationBaseURL + "/" + account + "/compose"; - window.open(url, null, - "width=680,height=520,resizable=1,scrollbars=1,toolbar=0," - + "location=0,directories=0,status=0,menubar=0,copyhistory=0"); + openMailComposeWindow(url); } function openMailbox(mailbox, reload, idx) { @@ -823,9 +800,7 @@ function onMenuViewMessageSource(event) { if (rows.length > 0) { var url = (ApplicationBaseURL + currentMailbox + "/" + rows[0].substr(4) + "/viewsource"); - window.open(url, "", - "width=680,height=520,resizable=1,scrollbars=1,toolbar=0," - + "location=0,directories=0,status=0,menubar=0,copyhistory=0"); + openMailComposeWindow(url); } preventDefault(event); @@ -842,10 +817,7 @@ function newContactFromEmail(event) { var url = UserFolderURL + "Contacts/new?contactEmail=" + email; if (c_name) url += "&contactFN=" + c_name; - w = window.open(url, null, - "width=546,height=490,resizable=1,scrollbars=1,toolbar=0," - + "location=0,directories=0,status=0,menubar=0,copyhistory=0"); - w.focus(); + openContactWindow(url); } return false; /* stop following the link */ diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 42da85e11..0e5d7587f 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -212,8 +212,20 @@ function openUserFolderSelector(callback, type) { w.focus(); } -function openMailComposeWindow(url) { - var w = window.open(url, null, +function openContactWindow(url, wId) { + if (!wId) + wId = "" + (new Date().getTime()); + var w = window.open(url, wId, + "width=450,height=600,resizable=0"); + w.focus(); + + return w; +} + +function openMailComposeWindow(url, wId) { + if (!wId) + wId = "" + (new Date().getTime()); + var w = window.open(url, wId, "width=680,height=520,resizable=1,scrollbars=1,toolbar=0," + "location=0,directories=0,status=0,menubar=0" + ",copyhistory=0"); From 3823368fba3cc96510221a9f2ceee00ecba65f08 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 21 Aug 2007 16:01:28 +0000 Subject: [PATCH 2/3] Monotone-Parent: c8ffc75afc6375fd954ab207e9dbdef8b4793876 Monotone-Revision: a84c20b7d29bf952df6062daa2f86929f733e1f5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-21T16:01:28 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ UI/Scheduler/UIxComponentEditor.h | 1 + UI/Scheduler/UIxComponentEditor.m | 25 +++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/ChangeLog b/ChangeLog index 18b3531ef..13206cb89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-08-21 Wolfgang Sourdeau + * UI/Scheduler/UIxComponentEditor.m ([UIxComponentEditor + -takeValuesFromRequest:_rqinContext:_ctx]): save the category + selected in the dialog. + ([UIxComponentEditor -setComponent:newComponent]): retrieve the + first category, if ever, of the calendar entity. + * UI/MailerUI/UIxMailMainFrame.m ([UIxMailMainFrame -composeAction]): restored method since it is needed by the address book. diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 71c511a6e..8eec9b4d4 100644 --- a/UI/Scheduler/UIxComponentEditor.h +++ b/UI/Scheduler/UIxComponentEditor.h @@ -51,6 +51,7 @@ NSString *priority; NSString *privacy; NSString *status; + NSString *category; NSArray *categories; NSDictionary *cycle; NSString *cycleEnd; diff --git a/UI/Scheduler/UIxComponentEditor.m b/UI/Scheduler/UIxComponentEditor.m index cec6bbd1a..eecd800ff 100644 --- a/UI/Scheduler/UIxComponentEditor.m +++ b/UI/Scheduler/UIxComponentEditor.m @@ -121,6 +121,19 @@ [emails release]; } +- (void) _loadCategories +{ + NSString *compCategories, *simpleCategory; + + compCategories = [component categories]; + if ([compCategories length] > 0) + { + simpleCategory = [[compCategories componentsSeparatedByString: @","] + objectAtIndex: 0]; + ASSIGN (category, [simpleCategory uppercaseString]); + } +} + /* warning: we use this method which will be triggered by the template system when the page is instantiated, but we should find another and cleaner way of doing this... for example, when the clientObject is set */ @@ -145,6 +158,7 @@ ASSIGN (status, [component status]); ASSIGN (categories, [[component categories] commaSeparatedValues]); ASSIGN (organizer, [component organizer]); + [self _loadCategories]; [self _loadAttendees]; } // /* cycles */ @@ -300,6 +314,16 @@ return categories; } +- (void) setCategory: (NSArray *) newCategory +{ + ASSIGN (category, newCategory); +} + +- (NSString *) category +{ + return category; +} + - (NSString *) itemCategoryText { return [self labelForKey: @@ -822,6 +846,7 @@ [component setComment: comment]; [component setUrl: url]; [component setAccessClass: privacy]; + [component setCategories: [category capitalizedString]]; [self _handleAttendeesEdition]; [self _handleOrganizer]; clientObject = [self clientObject]; From e42964b9aaae0e283f52e59bceddb9e83133e563 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 21 Aug 2007 16:01:32 +0000 Subject: [PATCH 3/3] Monotone-Parent: a84c20b7d29bf952df6062daa2f86929f733e1f5 Monotone-Revision: bd49b8f89c873201475aa9e23f9d1876e0f158f7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-21T16:01:32 Monotone-Branch: ca.inverse.sogo --- SoObjects/Appointments/SOGoCalendarComponent.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index be754cf65..200346d31 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -241,7 +241,7 @@ static BOOL sendEMailNotifications = NO; - (NSException *) delete { - return [self deleteWithBaseSequence:0]; + return [self deleteWithBaseSequence: 0]; } /* EMail Notifications */