2005-07-18 Helge Hess <helge.hess@opengroupware.org>
+ * 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)
- (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" : @"#";
}
label:label="Subject"
const:sortKey="subject"
const:href="view"
- var:queryDictionary="queryParameters"
+ var:queryDictionary="context.request.formValues"
/>
</td>
<td class="tbtv_headercell">
label:label="From"
const:sortKey="from"
const:href="view"
- var:queryDictionary="queryParameters"
+ var:queryDictionary="context.request.formValues"
/>
</var:if>
<var:if condition="showToAddress">
label:label="To"
const:sortKey="to"
const:href="view"
- var:queryDictionary="queryParameters"
+ var:queryDictionary="context.request.formValues"
/>
</var:if>
</td>
label:label="Date"
const:sortKey="date"
const:href="view"
- var:queryDictionary="queryParameters"
+ var:queryDictionary="context.request.formValues"
const:isDefault="YES"
/>
</td>