From: znek Date: Thu, 12 Aug 2004 16:39:27 +0000 (+0000) Subject: fixed all known problems wrt Anais UidSelector X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90f465586200e61b8bacd50287d8deba95688b4a;p=scalable-opengroupware.org fixed all known problems wrt Anais UidSelector git-svn-id: http://svn.opengroupware.org/SOGo/trunk@192 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/Anais/AnaisUidSelector.m b/SOGo/UI/Anais/AnaisUidSelector.m index b8d88315..4855b880 100644 --- a/SOGo/UI/Anais/AnaisUidSelector.m +++ b/SOGo/UI/Anais/AnaisUidSelector.m @@ -27,7 +27,6 @@ { NSArray *calendarUIDs; NSString *uid; - BOOL meTooChecked; NSString *userUid; } @@ -77,13 +76,6 @@ return [NSString stringWithFormat:@", %@", self->uid]; } -- (void)setMeTooChecked:(BOOL)_meTooChecked { - self->meTooChecked = _meTooChecked; -} -- (BOOL)meTooChecked { - return self->meTooChecked; -} - /* Href */ @@ -106,6 +98,12 @@ return [[self calendarUIDs] componentsJoinedByString:@","]; } +/* this is to determine the initial visibility of the 'addMeToo' button */ +- (NSString *)meTooStyle { + if([[self calendarUIDs] containsObject:userUid]) + return @"visibility:hidden"; + return @"visibility:visible"; +} /* JavaScript */ @@ -121,18 +119,38 @@ @"function clearUidList() {\n" @" clearElementWithId('anaisUIDList');\n" @" var e = document.getElementById('anaisUIDString');\n" - @" e.setAttribute('value', '%@');\n" + @" e.setAttribute('value', '');\n" + @" var td = document.getElementById('addMeToo');\n" + @" td.setAttribute('style', 'visibility:visible');\n" + @" td = document.getElementById('clearUidList');\n" + @" td.setAttribute('style', 'visibility:hidden');\n" + @" td = document.getElementById('showUidList');\n" + @" td.setAttribute('style', 'visibility:hidden');\n" + @"}\n" + @"function addMeToo() {\n" + @" addUid('', '', '', '', '%@', '');\n" + @" var td = document.getElementById('addMeToo');\n" + @" td.setAttribute('style', 'visibility:hidden');\n" @"}\n" @"function addUid(division, cn, dn, email, uid, sn) {\n" @" if(!uid)\n" @" uid='unknown';\n" + @" var e = document.getElementById('anaisUIDString');\n" + @" var s = e.getAttribute('value');\n" + @" if(s)\n" + @" s = s + ',' + uid;\n" + @" else\n" + @" s = uid;\n" + @" e.setAttribute('value', s);\n" @" var td = document.getElementById('anaisUIDList');\n" @" if(td.hasChildNodes())\n" - @" uid=', '+uid;\n" + @" uid = ', ' + uid;\n" @" var text = document.createTextNode(uid);\n" @" td.appendChild(text);\n" - @" var e = document.getElementById('anaisUIDString');\n" - @" e.setAttribute('value', uid);\n" + @" td = document.getElementById('clearUidList');\n" + @" td.setAttribute('style', 'visibility:visible');\n" + @" td = document.getElementById('showUidList');\n" + @" td.setAttribute('style', 'visibility:visible');\n" @"}\n" @""; diff --git a/SOGo/UI/Anais/AnaisUidSelector.wox b/SOGo/UI/Anais/AnaisUidSelector.wox index 6446bd91..83debd17 100644 --- a/SOGo/UI/Anais/AnaisUidSelector.wox +++ b/SOGo/UI/Anais/AnaisUidSelector.wox @@ -23,29 +23,30 @@ const:division="TEST" /> - - - - - -
- - - -
+ + - + + +
+ + + +
+ diff --git a/SOGo/UI/Anais/ChangeLog b/SOGo/UI/Anais/ChangeLog index 4e9952d6..eb3b8da6 100644 --- a/SOGo/UI/Anais/ChangeLog +++ b/SOGo/UI/Anais/ChangeLog @@ -1,3 +1,7 @@ +2004-08-12 Marcus Mueller + + * AnaisUidSelector.[m|wox]: fixed all known problems (v0.9.3) + 2004-08-11 Marcus Mueller * AnaisUidSelector.[m|wox]: much enhanced, but still not perfect diff --git a/SOGo/UI/Anais/Version b/SOGo/UI/Anais/Version index f285cb83..2d11c00f 100644 --- a/SOGo/UI/Anais/Version +++ b/SOGo/UI/Anais/Version @@ -1,3 +1,3 @@ # $Id: Version 165 2004-08-05 17:55:50Z znek $ -SUBMINOR_VERSION:=2 +SUBMINOR_VERSION:=3 diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index 9c93c4e2..5a1df235 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,7 @@ +2004-08-12 Marcus Mueller + + * UIxCalView.m: fixed problems with redirect (v0.9.23) + 2004-08-12 Helge Hess * v0.9.22 @@ -5,14 +9,14 @@ * UIxAppointmentView.m: properly catch invalid appointment references and return a 404 (because SOGoAppointmentObject's are created even for invalid IDs for performance reasons) - + * UIxCalView.m: generate appointment URLs using clientObject (the appointment folder) - + * more cleanups - + * added (still empty) proposal component (v0.9.21) - + * some code reorganizations, fixed some compile warnings (v0.9.20) 2004-08-11 Marcus Mueller diff --git a/SOGo/UI/Scheduler/UIxCalView.m b/SOGo/UI/Scheduler/UIxCalView.m index 3da61309..96a4cf81 100644 --- a/SOGo/UI/Scheduler/UIxCalView.m +++ b/SOGo/UI/Scheduler/UIxCalView.m @@ -398,37 +398,42 @@ ctx = [self context]; obj = [[ctx objectTraversalStack] objectAtIndex:1]; url = [NSURL URLWithString:[obj baseURLInContext:ctx]]; - return [url path]; + return [[url path] stringByUnescapingURL]; } - (id)redirectForUIDsAction { NSMutableString *uri; NSString *uidsString, *loc, *prevMethod; WORequest *req; + id r; req = [[self context] request]; uidsString = [req formValueForKey:@"anaisUIDString"]; uidsString = [uidsString stringByTrimmingWhiteSpaces]; - if ([uidsString length] == 0) { - // TODO: improve user experience ... (eg error panel like Zope) - return [NSException exceptionWithHTTPStatus:400 /* bad request */ - reason:@"missing uids from request"]; - } - + prevMethod = [req formValueForKey:@"previousMethod"]; - if (prevMethod == nil) + if(prevMethod == nil) prevMethod = @""; uri = [[NSMutableString alloc] initWithString:[self _userFolderURI]]; - [uri appendString:@"/Groups/_custom_"]; - [uri appendString:uidsString]; + if(!(([uidsString length] == 0) || + ([[uri lastPathComponent] isEqualToString:uidsString]))) { + [uri appendString:@"/Groups/_custom_"]; + [uri appendString:uidsString]; + } [uri appendString:@"/Calendar/"]; [uri appendString:prevMethod]; - + +#if 0 + NSLog(@"%s redirect uri:%@", + __PRETTY_FUNCTION__, + uri); +#endif loc = [self completeHrefForMethod:uri]; /* this might return uri! */ - - return [self redirectToLocation:loc]; + r = [self redirectToLocation:loc]; + [uri release]; + return r; } @end /* UIxCalView */ diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 78237daf..8a19b3e3 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,3 +1,3 @@ # $Id$ -SUBMINOR_VERSION:=22 +SUBMINOR_VERSION:=23