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/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 */ 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]; 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");