From: helge Date: Mon, 18 Jul 2005 16:09:51 +0000 (+0000) Subject: preserve sorting and query information X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c87b7739a9cd320d1283dec0c32ca1ae6da1612d;p=scalable-opengroupware.org preserve sorting and query information git-svn-id: http://svn.opengroupware.org/SOGo/trunk@802 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/UI/MailerUI/ChangeLog b/SOGo/UI/MailerUI/ChangeLog index 2720a7f3..09144172 100644 --- a/SOGo/UI/MailerUI/ChangeLog +++ b/SOGo/UI/MailerUI/ChangeLog @@ -1,5 +1,9 @@ 2005-07-18 Helge Hess + * UIxMailMainFrame.m: create a proper form action URL which preserves + query parameters (sort field) but removes search/filter values + (v0.9.150) + * UIxMailSortableTableHeader.m: improved handling of multivalue form keys (v0.9.149) diff --git a/SOGo/UI/MailerUI/UIxMailMainFrame.m b/SOGo/UI/MailerUI/UIxMailMainFrame.m index 4d4465a2..11a23055 100644 --- a/SOGo/UI/MailerUI/UIxMailMainFrame.m +++ b/SOGo/UI/MailerUI/UIxMailMainFrame.m @@ -104,8 +104,45 @@ static NSString *treeRootClassName = nil; - (NSString *)pageFormURL { NSString *u; + NSRange r; u = [[[self context] request] uri]; + if ((r = [u rangeOfString:@"?"]).length > 0) { + /* has query parameters */ + // TODO: this is ugly, create reusable link facility in SOPE + // TODO: remove 'search' and 'filterpopup', preserve sorting + NSMutableString *ms; + NSArray *qp; + unsigned i, count; + + qp = [[u substringFromIndex:(r.location + r.length)] + componentsSeparatedByString:@"&"]; + count = [qp count]; + ms = [NSMutableString stringWithCapacity:count * 12]; + + for (i = 0; i < count; i++) { + NSString *s; + + s = [qp objectAtIndex:i]; + + /* filter out */ + if ([s hasPrefix:@"search="]) continue; + if ([s hasPrefix:@"filterpopup="]) continue; + + if ([ms length] > 0) [ms appendString:@"&"]; + [ms appendString:s]; + } + + if ([ms length] == 0) { + /* no other query params */ + u = [u substringToIndex:r.location]; + } + else { + u = [u substringToIndex:r.location + r.length]; + u = [u stringByAppendingString:ms]; + } + return u; + } return [u hasSuffix:@"/"] ? @"view" : @"#"; } diff --git a/SOGo/UI/MailerUI/Version b/SOGo/UI/MailerUI/Version index 0f952de8..fda36ee2 100644 --- a/SOGo/UI/MailerUI/Version +++ b/SOGo/UI/MailerUI/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=149 +SUBMINOR_VERSION:=150 # v0.9.140 requires SoObjects/Mailer v0.9.100 # v0.9.134 requires libSOGo v0.9.41 diff --git a/SOGo/UI/Templates/MailerUI/UIxMailListView.wox b/SOGo/UI/Templates/MailerUI/UIxMailListView.wox index 78de1150..418fdf86 100644 --- a/SOGo/UI/Templates/MailerUI/UIxMailListView.wox +++ b/SOGo/UI/Templates/MailerUI/UIxMailListView.wox @@ -29,7 +29,7 @@ label:label="Subject" const:sortKey="subject" const:href="view" - var:queryDictionary="queryParameters" + var:queryDictionary="context.request.formValues" /> @@ -38,7 +38,7 @@ label:label="From" const:sortKey="from" const:href="view" - var:queryDictionary="queryParameters" + var:queryDictionary="context.request.formValues" /> @@ -46,7 +46,7 @@ label:label="To" const:sortKey="to" const:href="view" - var:queryDictionary="queryParameters" + var:queryDictionary="context.request.formValues" /> @@ -61,7 +61,7 @@ label:label="Date" const:sortKey="date" const:href="view" - var:queryDictionary="queryParameters" + var:queryDictionary="context.request.formValues" const:isDefault="YES" />