From: wolfgang Date: Tue, 21 Aug 2007 19:51:21 +0000 (+0000) Subject: git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1152 d1b88da0-ebda-0310... X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b621172ed3f261968d16927bc86b18771f2f55e5;p=scalable-opengroupware.org git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1152 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ChangeLog b/ChangeLog index da37d536..4c51a028 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2007-08-21 Wolfgang Sourdeau + + * UI/SOGoElements/SOGoIEConditional.m: new extension module class + to handle "" template tags. + + * UI/SOGoElements: new extension bundle containing sogo-specific + dynamic elements. + + * 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. + + * UI/MailerUI/UIxMailAccountActions.m ([UIxMailAccountActions + -composeAction]): the address fields should be arrays and not + simple strings. + + * UI/Common/UIxPageFrame.m ([UIxPageFrame -buildDate]): new method + that returns the build date of SOGo in the template. + 2007-08-20 Wolfgang Sourdeau * SoObjects/Contacts/SOGoContactGCSFolder.m ([SOGoContactGCSFolder diff --git a/Main/build.h b/Main/build.h index d1daeddb..f74f8eef 100644 --- a/Main/build.h +++ b/Main/build.h @@ -1,4 +1,4 @@ -/* build.h - this file is part of $PROJECT_NAME_HERE$ +/* build.h - this file is part of SOGo * * Copyright (C) 2007 Inverse groupe conseil * diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index be754cf6..200346d3 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/Common/UIxPageFrame.m b/UI/Common/UIxPageFrame.m index 77209b05..b093fa75 100644 --- a/UI/Common/UIxPageFrame.m +++ b/UI/Common/UIxPageFrame.m @@ -26,6 +26,8 @@ #import #import +#import
+ #import "UIxPageFrame.h" @implementation UIxPageFrame @@ -74,6 +76,11 @@ return item; } +- (NSString *) buildDate +{ + return SOGoBuildDate; +} + - (NSString *) ownerInContext { return [[self clientObject] ownerInContext: nil]; diff --git a/UI/GNUmakefile b/UI/GNUmakefile index c91abddf..3570614b 100644 --- a/UI/GNUmakefile +++ b/UI/GNUmakefile @@ -5,6 +5,7 @@ include $(GNUSTEP_MAKEFILES)/common.make SUBPROJECTS += \ SOGoUI \ + SOGoElements \ Common \ Contacts \ MailerUI \ diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 01ee0002..01d4440b 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -14,6 +14,11 @@ "Stop" = "Stop"; "Write" = "Write"; +"Send" = "Send"; +"Contacts" = "Contacts"; +"Attach" = "Attach"; +"Save" = "Save"; + /* Main Frame */ "Home" = "Home"; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index 1a48c901..20f78222 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -14,6 +14,11 @@ "Stop" = "Stop"; "Write" = "Écrire"; +"Send" = "Envoyer"; +"Contacts" = "Contacts"; +"Attach" = "Joindre"; +"Save" = "Enregistrer"; + /* Main Frame */ "Home" = "Accueil"; @@ -61,13 +66,13 @@ "Attachments:" = "Pièces jointes :"; -"To" = "À"; -"Cc" = "Cc"; -"Bcc" = "Cci"; +"To" = "Pour"; +"Cc" = "Copie à"; +"Bcc" = "Copie cachée à"; -"to" = "À"; -"cc" = "Cc"; -"bcc" = "Cci"; +"to" = "Pour"; +"cc" = "Copie à"; +"bcc" = "Copie cachée à"; "Edit Draft..." = "Modifier le brouillon..."; diff --git a/UI/MailerUI/UIxMailAccountActions.m b/UI/MailerUI/UIxMailAccountActions.m index f7cb0be5..004c3a63 100644 --- a/UI/MailerUI/UIxMailAccountActions.m +++ b/UI/MailerUI/UIxMailAccountActions.m @@ -123,15 +123,17 @@ { SOGoDraftsFolder *drafts; SOGoDraftObject *newDraftMessage; - NSString *urlBase, *url; - NSString *mailTo; + NSString *urlBase, *url, *value; + NSArray *mailTo; + drafts = [[self clientObject] draftsFolderInContext: context]; newDraftMessage = [drafts newDraft]; - mailTo = [[self request] formValueForKey: @"mailto"]; - if ([mailTo length] > 0) + value = [[self request] formValueForKey: @"mailto"]; + if ([value length] > 0) { + mailTo = [NSArray arrayWithObject: value]; [newDraftMessage setHeaders: [NSDictionary dictionaryWithObject: mailTo forKey: @"to"]]; [newDraftMessage storeInfo]; diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index 9ad78fb1..687d8509 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -26,6 +26,7 @@ #import #import +#import #import #import #import @@ -90,4 +91,23 @@ return [u hasSuffix:@"/"] ? @"view" : @"#"; } +- (id ) composeAction +{ + NSArray *accounts; + NSString *firstAccount, *newLocation; + SOGoMailAccounts *co; + NSDictionary *formValues; + + co = [self clientObject]; + accounts = [[context activeUser] mailAccounts]; + firstAccount = [[accounts objectsForKey: @"name"] objectAtIndex: 0]; + formValues = [[context request] formValues]; + newLocation = [NSString stringWithFormat: @"%@/%@/compose%@", + [co baseURLInContext: context], + firstAccount, + [formValues asURLParameters]]; + + return [self redirectToLocation: newLocation]; +} + @end /* UIxMailMainFrame */ diff --git a/UI/MailerUI/UIxMailToSelection.m b/UI/MailerUI/UIxMailToSelection.m index 1345c80d..ef5c141b 100644 --- a/UI/MailerUI/UIxMailToSelection.m +++ b/UI/MailerUI/UIxMailToSelection.m @@ -57,17 +57,17 @@ int currentIndex; } -- (void)setTo:(NSArray *)_to; -- (NSArray *)to; -- (void)setCc:(NSArray *)_cc; -- (NSArray *)cc; -- (void)setBcc:(NSArray *)_bcc; -- (NSArray *)bcc; +- (void) setTo: (NSArray *) _to; +- (NSArray *) to; +- (void) setCc: (NSArray *) _cc; +- (NSArray *) cc; +- (void) setBcc: (NSArray *) _bcc; +- (NSArray *) bcc; -- (NSArray *)properlySplitAddresses:(NSArray *)_addresses; +- (NSArray *) properlySplitAddresses: (NSArray *) _addresses; -- (void)getAddressesFromFormValues:(NSDictionary *)_dict; -- (NSString *)getIndexFromIdentifier:(NSString *)_identifier; +- (void) getAddressesFromFormValues: (NSDictionary *) _dict; +- (NSString *) getIndexFromIdentifier: (NSString *) _identifier; @end @@ -75,157 +75,179 @@ static NSArray *headers = nil; -+ (void)initialize { ++ (void) initialize +{ static BOOL didInit = NO; - if (didInit) - return; - - didInit = YES; - headers = [[NSArray alloc] initWithObjects:@"to", @"cc", @"bcc", nil]; + if (!didInit) + { + didInit = YES; + headers = [[NSArray alloc] initWithObjects: @"to", @"cc", @"bcc", nil]; + } } -- (id)init { - self = [super init]; - if(self) { - self->currentIndex = 0; - } +- (id) init +{ + if ((self = [super init])) + currentIndex = 0; + return self; } -- (void)dealloc { - [self->to release]; - [self->cc release]; - [self->bcc release]; - [self->item release]; - [self->address release]; - [self->addressList release]; +- (void) dealloc +{ + [to release]; + [cc release]; + [bcc release]; + [item release]; + [address release]; + [addressList release]; [super dealloc]; } /* accessors */ -- (void)setTo:(NSArray *)_to +- (void) setTo: (NSArray *) _to { - _to = [self properlySplitAddresses:_to]; - ASSIGNCOPY(self->to, _to); + ASSIGN (to, [self properlySplitAddresses: _to]); } - (NSArray *) to { NSString *mailto; - mailto = [self queryParameterForKey:@"mailto"]; + mailto = [self queryParameterForKey: @"mailto"]; if ([mailto length] > 0 && ![to count]) { to = [NSArray arrayWithObject: mailto]; [to retain]; } - return self->to; + return to; } -- (void)setCc:(NSArray *)_cc { - _cc = [self properlySplitAddresses:_cc]; - ASSIGNCOPY(self->cc, _cc); +- (void) setCc: (NSArray *) _cc +{ + ASSIGN (cc, [self properlySplitAddresses: _cc]); } -- (NSArray *)cc { - return self->cc; +- (NSArray *) cc +{ + return cc; } -- (void)setBcc:(NSArray *)_bcc { - _bcc = [self properlySplitAddresses:_bcc]; - ASSIGNCOPY(self->bcc, _bcc); +- (void) setBcc: (NSArray *) _bcc +{ + ASSIGN (bcc, [self properlySplitAddresses: _bcc]); } -- (NSArray *)bcc { - return self->bcc; + +- (NSArray *) bcc +{ + return bcc; } -- (void)setAddressList:(NSArray *)_addressList { - ASSIGN(self->addressList, _addressList); +- (void) setAddressList: (NSArray *) _addressList +{ + ASSIGN (addressList, _addressList); } -- (NSArray *)addressList { - return self->addressList; + +- (NSArray *) addressList +{ + return addressList; } -- (void)setAddress:(id)_address { - ASSIGN(self->address, _address); +- (void) setAddress: (id) _address +{ + ASSIGN (address, _address); } -- (id)address { - return self->address; + +- (id) address +{ + return address; } -- (void)setItem:(id)_item { - ASSIGN(self->item, _item); +- (void) setItem: (id) _item +{ + ASSIGN (item, _item); } -- (id)item { - return self->item; + +- (id) item +{ + return item; } -- (NSArray *)addressLists { +- (NSArray *) addressLists +{ NSMutableArray *ma; ma = [NSMutableArray arrayWithCapacity:3]; - if ([self->to isNotNull]) [ma addObject:self->to]; - if ([self->cc isNotNull]) [ma addObject:self->cc]; - if ([self->bcc isNotNull]) [ma addObject:self->bcc]; - + if ([to isNotNull]) + [ma addObject: to]; + if ([cc isNotNull]) + [ma addObject: cc]; + if ([bcc isNotNull]) + [ma addObject: bcc]; + /* ensure that at least one object is available */ - if ([ma count] == 0) { - NSArray *tmp = [NSArray arrayWithObject:@""]; - ASSIGNCOPY(self->to, tmp); - [ma addObject:self->to]; - } + if ([ma count] == 0) + { + NSArray *tmp = [NSArray arrayWithObject:@""]; + ASSIGN (to, tmp); + [ma addObject:to]; + } + return ma; } -- (NSArray *)headers { +- (NSArray *) headers +{ return headers; } -- (NSString *)currentHeader { - if(self->addressList == self->to) +- (NSString *) currentHeader +{ + if (addressList == to) return @"to"; - else if(self->addressList == self->cc) + else if (addressList == cc) return @"cc"; + return @"bcc"; } /* identifiers */ -- (NSString *)currentRowId { - char buf[16]; - sprintf(buf, "row_%d", self->currentIndex); - return [NSString stringWithCString:buf]; +- (NSString *) currentRowId +{ + return [NSString stringWithFormat: @"row_%d", currentIndex]; } -- (NSString *)currentPopUpId { - char buf[16]; - sprintf(buf, "popup_%d", self->currentIndex); - return [NSString stringWithCString:buf]; +- (NSString *) currentPopUpId +{ + return [NSString stringWithFormat: @"popup_%d", currentIndex]; } -- (NSString *)currentAddressId { - char buf[16]; - sprintf(buf, "addr_%d", self->currentIndex); - return [NSString stringWithCString:buf]; +- (NSString *) currentAddressId +{ + return [NSString stringWithFormat: @"addr_%d", currentIndex]; } -- (NSString *)nextId { - self->currentIndex++; +- (NSString *) nextId +{ + currentIndex++; + return @""; } /* address handling */ -- (NSArray *)properlySplitAddresses:(NSArray *)_addresses { +- (NSArray *) properlySplitAddresses: (NSArray *) _addresses +{ NSString *addrs; NGMailAddressParser *parser; NSArray *result; NSMutableArray *ma; unsigned i, count; - if(!_addresses || [_addresses count] == 0) + if (!_addresses || [_addresses count] == 0) return nil; /* create one huge string, then split it using the parser */ @@ -263,7 +285,8 @@ static NSArray *headers = nil; /* handling requests */ -- (void)getAddressesFromFormValues:(NSDictionary *)_dict { +- (void) getAddressesFromFormValues: (NSDictionary *) _dict +{ NSMutableArray *rawTo, *rawCc, *rawBcc; NSArray *keys; unsigned i, count; @@ -274,39 +297,45 @@ static NSArray *headers = nil; keys = [_dict allKeys]; count = [keys count]; - for (i = 0; i < count; i++) { - NSString *key; + for (i = 0; i < count; i++) + { + NSString *key; - key = [keys objectAtIndex:i]; - if([key hasPrefix:@"addr_"]) { - NSString *idx, *addr, *popupKey, *popupValue; - - addr = [[_dict objectForKey:key] lastObject]; - idx = [self getIndexFromIdentifier:key]; - popupKey = [NSString stringWithFormat:@"popup_%@", idx]; - popupValue = [[_dict objectForKey:popupKey] lastObject]; - if([popupValue isEqualToString:@"0"]) - [rawTo addObject:addr]; - else if([popupValue isEqualToString:@"1"]) - [rawCc addObject:addr]; - else - [rawBcc addObject:addr]; + key = [keys objectAtIndex:i]; + if ([key hasPrefix:@"addr_"]) + { + NSString *idx, *addr, *popupKey, *popupValue; + + addr = [[_dict objectForKey:key] lastObject]; + idx = [self getIndexFromIdentifier:key]; + popupKey = [NSString stringWithFormat:@"popup_%@", idx]; + popupValue = [[_dict objectForKey:popupKey] lastObject]; + if([popupValue isEqualToString:@"0"]) + [rawTo addObject:addr]; + else if([popupValue isEqualToString:@"1"]) + [rawCc addObject:addr]; + else + [rawBcc addObject:addr]; + } } - } - [self setTo:rawTo]; - [self setCc:rawCc]; - [self setBcc:rawBcc]; + [self setTo: rawTo]; + [self setCc: rawCc]; + [self setBcc: rawBcc]; } -- (NSString *)getIndexFromIdentifier:(NSString *)_identifier { +- (NSString *) getIndexFromIdentifier: (NSString *) _identifier +{ NSRange r; - r = [_identifier rangeOfString:@"_"]; - return [_identifier substringFromIndex:NSMaxRange(r)]; + r = [_identifier rangeOfString: @"_"]; + + return [_identifier substringFromIndex: NSMaxRange(r)]; } -- (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx { +- (void) takeValuesFromRequest: (WORequest *) _rq + inContext: (WOContext *) _ctx +{ /* OK, we have a special form value processor */ NSDictionary *d; @@ -319,17 +348,20 @@ static NSArray *headers = nil; __PRETTY_FUNCTION__, d); #endif - [self getAddressesFromFormValues:d]; + [self getAddressesFromFormValues: d]; } -- (int)addressCount { - return [self->to count] + [self->cc count] + [self->bcc count]; +- (int) addressCount +{ + return [to count] + [cc count] + [bcc count]; } -- (int)currentIndex { +- (int) currentIndex +{ int count; count = [self addressCount]; + return count > 0 ? count - 1 : 0; } diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 843c51c0..214330cc 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -256,9 +256,10 @@ categories = { protectedBy = "View"; pageName = "UIxMailMainFrame"; }; - getMail = { + compose = { protectedBy = "View"; - pageName = "UIxMailAccountsView"; + pageName = "UIxMailMainFrame"; + actionName = "compose"; }; }; }; diff --git a/UI/SOGoElements/GNUmakefile b/UI/SOGoElements/GNUmakefile new file mode 100644 index 00000000..b389d94f --- /dev/null +++ b/UI/SOGoElements/GNUmakefile @@ -0,0 +1,24 @@ +# GNUstep makefile + +-include ../../config.make +include $(GNUSTEP_MAKEFILES)/common.make + +SOPE_VERSION = 4.7 + +BUNDLE_NAME = SOGoElements +BUNDLE_EXTENSION = .wox +BUNDLE_INSTALL_DIR = $(GNUSTEP_INSTALLATION_DIR)/Library/WOxElemBuilders-$(SOPE_VERSION)/ + +SOGoElements_PRINCIPAL_CLASS = SOGoElementsBundle + +SOGoElements_OBJC_FILES = \ + SOGoElementsBundle.m \ + SOGoElementsBuilder.m \ + SOGoIEConditional.m + +# building + +-include GNUmakefile.preamble +include $(GNUSTEP_MAKEFILES)/bundle.make +-include GNUmakefile.postamble +-include fhs.make diff --git a/UI/SOGoElements/GNUmakefile.postamble b/UI/SOGoElements/GNUmakefile.postamble new file mode 100644 index 00000000..cd11e680 --- /dev/null +++ b/UI/SOGoElements/GNUmakefile.postamble @@ -0,0 +1,9 @@ +ifneq ($(GNUSTEP_BUILD_DIR),) +after-SOGoElements-all :: + @(cp bundle-info.plist \ + $(GNUSTEP_BUILD_DIR)/$(BUNDLE_NAME)$(BUNDLE_EXTENSION)) +else +after-SOGoElements-all :: + @(cd $(BUNDLE_NAME)$(BUNDLE_EXTENSION);\ + cp ../bundle-info.plist .) +endif diff --git a/UI/SOGoElements/SOGoElementsBuilder.h b/UI/SOGoElements/SOGoElementsBuilder.h new file mode 100644 index 00000000..8326e6f2 --- /dev/null +++ b/UI/SOGoElements/SOGoElementsBuilder.h @@ -0,0 +1,31 @@ +/* SOGoElementsBuilder.h - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef SOGOELEMENTSBUILDER_H +#define SOGOELEMENTSBUILDER_H + +#import + +@interface SOGoElementsBuilder : WOxTagClassElemBuilder +@end + +#endif /* SOGOELEMENTSBUILDER_H */ diff --git a/UI/SOGoElements/SOGoElementsBuilder.m b/UI/SOGoElements/SOGoElementsBuilder.m new file mode 100644 index 00000000..d3f1f1f7 --- /dev/null +++ b/UI/SOGoElements/SOGoElementsBuilder.m @@ -0,0 +1,50 @@ +/* SOGoElementsBuilder.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import + +#import "SOGoIEConditional.h" + +#import "SOGoElementsBuilder.h" + +@implementation SOGoElementsBuilder + +- (Class) classForElement: (id) _element +{ + NSString *tagName; + Class zeClass; + + zeClass = Nil; + + if ([[_element namespaceURI] isEqualToString: XMLNS_OD_BIND]) + { + tagName = [_element tagName]; + if ([tagName isEqualToString: @"if-ie"]) + zeClass = [SOGoIEConditional class]; + } + + return zeClass; +} + +@end diff --git a/UI/SOGoElements/SOGoElementsBundle.m b/UI/SOGoElements/SOGoElementsBundle.m new file mode 100644 index 00000000..4c88fefe --- /dev/null +++ b/UI/SOGoElements/SOGoElementsBundle.m @@ -0,0 +1,29 @@ +/* SOGoElementsBundle.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +@interface SOGoElementsBundle : NSObject +@end + +@implementation SOGoElementsBundle +@end diff --git a/UI/SOGoElements/SOGoIEConditional.h b/UI/SOGoElements/SOGoIEConditional.h new file mode 100644 index 00000000..6b9385ed --- /dev/null +++ b/UI/SOGoElements/SOGoIEConditional.h @@ -0,0 +1,42 @@ +/* SOGoIEConditional.h - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef SOGOIECONDITIONAL_H +#define SOGOIECONDITIONAL_H + +#import + +@class WOContext; +@class WOElement; +@class WOResponse; + +@interface SOGoIEConditional : WODynamicElement +{ + WOElement *template; +} + +- (void) appendToResponse: (WOResponse *) _response + inContext: (WOContext *) _ctx; + +@end + +#endif /* SOGOIECONDITIONAL_H */ diff --git a/UI/SOGoElements/SOGoIEConditional.m b/UI/SOGoElements/SOGoIEConditional.m new file mode 100644 index 00000000..5d9cf168 --- /dev/null +++ b/UI/SOGoElements/SOGoIEConditional.m @@ -0,0 +1,53 @@ +/* SOGoIEConditional.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import +#import + +#import "SOGoIEConditional.h" + +@implementation SOGoIEConditional + +- (id) initWithName: (NSString *) name + associations: (NSDictionary *) associations + template: (WOElement *) newTemplate +{ + ASSIGN (template, newTemplate); + + return self; +} + +- (void) dealloc +{ + [template release]; + [super dealloc]; +} + +- (void) appendToResponse: (WOResponse *) response + inContext: (WOContext *) context +{ + [response appendContentString: @""]; +} + +@end diff --git a/UI/SOGoElements/bundle-info.plist b/UI/SOGoElements/bundle-info.plist new file mode 100644 index 00000000..142fb3ee --- /dev/null +++ b/UI/SOGoElements/bundle-info.plist @@ -0,0 +1,23 @@ +{ + requires = { + bundleManagerVersion = 1; + + classes = ( + { name = NSObject; } + ); + }; + + provides = { + WOxElemBuilder = ( + { name = "SOGoElementsBuilder"; }, + ); + + WODynamicElements = ( + { name = "SOGoIEConditional"; }, + ); + + classes = ( + { name = "SOGoElementsBuilder"; }, + ); + }; +} diff --git a/UI/Scheduler/UIxComponentEditor.h b/UI/Scheduler/UIxComponentEditor.h index 71c511a6..8eec9b4d 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 cec6bbd1..eecd800f 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/Templates/MailerUI/UIxMailAddressbook.wox b/UI/Templates/MailerUI/UIxMailAddressbook.wox deleted file mode 100644 index 11bec55b..00000000 --- a/UI/Templates/MailerUI/UIxMailAddressbook.wox +++ /dev/null @@ -1,16 +0,0 @@ - - - - - <var:string value="name"/> - - - - You shouldn't see this content at all - the direct actions redirect to - the proper destinations, hence this component is _never_ rendered. - - \ No newline at end of file diff --git a/UI/Templates/MailerUI/UIxMailToSelection.wox b/UI/Templates/MailerUI/UIxMailToSelection.wox index 03175599..40d503e2 100644 --- a/UI/Templates/MailerUI/UIxMailToSelection.wox +++ b/UI/Templates/MailerUI/UIxMailToSelection.wox @@ -8,8 +8,8 @@ - - + +
diff --git a/UI/Templates/UIxPageFrame.wox b/UI/Templates/UIxPageFrame.wox index 736fa087..08ec4718 100644 --- a/UI/Templates/UIxPageFrame.wox +++ b/UI/Templates/UIxPageFrame.wox @@ -17,6 +17,7 @@ + @@ -27,6 +28,9 @@ + diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index ab4ab2a1..718c494f 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.css b/UI/WebServerResources/MailerUI.css index 54535ed1..1c2f2e72 100644 --- a/UI/WebServerResources/MailerUI.css +++ b/UI/WebServerResources/MailerUI.css @@ -465,8 +465,7 @@ IMG.dragMessage visibility: hidden; border: 0px; -moz-opacity: 0.7; - opacity: 0.7; - filter: alpha(opacity=70); } + opacity: 0.7; } TABLE#addr_table { diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index d0aa924f..1327b245 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/SchedulerUI.css b/UI/WebServerResources/SchedulerUI.css index 80aa0621..6eddb019 100644 --- a/UI/WebServerResources/SchedulerUI.css +++ b/UI/WebServerResources/SchedulerUI.css @@ -824,8 +824,7 @@ DIV.events > DIV.event DIV[class~="event"]._selected > DIV.eventInside { -moz-opacity: 0.7; - opacity: 0.7; - filter: alpha(opacity=70); } + opacity: 0.7; } DIV.event > DIV.eventInside { position: absolute; @@ -845,8 +844,7 @@ DIV.shadow1 top: 2px; bottom: 3px; -moz-opacity: 0.1; - opacity: 0.1; - filter: alpha(opacity=10); } + opacity: 0.1; } DIV.shadow2 { left: 1px; @@ -854,8 +852,7 @@ DIV.shadow2 top: 1px; bottom: 2px; -moz-opacity: 0.1; - opacity: 0.1; - filter: alpha(opacity=10); } + opacity: 0.1; } DIV.shadow3 { left: 2px; @@ -863,8 +860,7 @@ DIV.shadow3 top: 0px; bottom: 3px; -moz-opacity: 0.1; - opacity: 0.1; - filter: alpha(opacity=10); } + opacity: 0.1; } DIV.shadow4 { left: 3px; @@ -872,8 +868,7 @@ DIV.shadow4 top: 3px; bottom: 4px; -moz-opacity: 0.4; - opacity: 0.4; - filter: alpha(opacity=40); } + opacity: 0.4; } DIV.gradient, DIV.text { position: absolute; diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 9eae7349..a5ceafa4 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -374,7 +374,7 @@ function tasksListCallback(http) { var owner = data[i][1]; listItem.owner = owner; $(listItem).addClassName("ownerIs" + owner); - listItem.cname = data[i][0]; + listItem.cname = escape(data[i][0]); var input = document.createElement("input"); input.setAttribute("type", "checkbox"); listItem.appendChild(input); @@ -708,7 +708,7 @@ function drawCalendarEvent(eventData, sd, ed) { function newEventDIV(cname, owner, starts, lasts, startHour, endHour, title) { var eventDiv = document.createElement("div"); - eventDiv.cname = cname; + eventDiv.cname = escape(cname); eventDiv.owner = owner; $(eventDiv).addClassName("event"); $(eventDiv).addClassName("starts" + starts); diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index 908ef54d..d399878b 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -255,8 +255,7 @@ SPAN.toolbarButton, SPAN.disabledToolbarButton SPAN.disabledToolbarButton { -moz-opacity: 0.4; - opacity: 0.4; - filter: alpha(opacity=40); } + opacity: 0.4; } SPAN.toolbarButton:hover { color: -moz-buttonhovertext; @@ -500,7 +499,6 @@ DIV.javascriptPopupBackground background-color: #999; -moz-opacity: 0.6; opacity: 0.6; - filter: alpha(opacity=60); z-index: 2; top: 0px; left: 0px; @@ -513,14 +511,13 @@ DIV.javascriptMessagePseudoTopWindow { position: absolute; z-index: 2; border-bottom: 2px solid #888; - -moz-border-bottom-colors: #000 #9c9a94 transparent; padding: 1em; margin: 0px auto; - -moz-opacity: 1.0; - opacity: 1.0; - filter: alpha(opacity=100); color: #000; - background-color: #d4d0c8; } + background-color: #d4d0c8; + -moz-border-bottom-colors: #000 #9c9a94 transparent; + -moz-opacity: 1.0; + opacity: 1.0; } DIV.javascriptMessagePseudoTopWindow { border-top: 0px; @@ -695,7 +692,7 @@ INPUT.checkBox { BODY { position: static; - font-size: 25%; + font-size: 10pt; height: auto; overflow: visible; } diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 42da85e1..0e5d7587 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");