]> err.no Git - scalable-opengroupware.org/commitdiff
preserve sorting and query information
authorhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 16:09:51 +0000 (16:09 +0000)
committerhelge <helge@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 18 Jul 2005 16:09:51 +0000 (16:09 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@802 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/MailerUI/ChangeLog
SOGo/UI/MailerUI/UIxMailMainFrame.m
SOGo/UI/MailerUI/Version
SOGo/UI/Templates/MailerUI/UIxMailListView.wox

index 2720a7f353c267fa399a8e7e03d73ac65236e2b1..091441725edd0d517a86ab971ccaf21e068791ca 100644 (file)
@@ -1,5 +1,9 @@
 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)
 
index 4d4465a2814559b26dcd3ab67ee40c27f00c77c9..11a23055c7862479893ccba583a732057f1e6348 100644 (file)
@@ -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" : @"#";
 }
 
index 0f952de8eb16e270110907511ee7b81a41b71dcc..fda36ee26fe23236cf122cc52b7e12f70c193590 100644 (file)
@@ -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
index 78de115010241c223347a077129bdcd592414f85..418fdf86d6e76a7a93278fcf97401e49e29741cd 100644 (file)
@@ -29,7 +29,7 @@
                            label:label="Subject"
                            const:sortKey="subject"
                            const:href="view"
-                           var:queryDictionary="queryParameters"
+                           var:queryDictionary="context.request.formValues"
             />
           </td>
           <td class="tbtv_headercell">
@@ -38,7 +38,7 @@
                              label:label="From"
                              const:sortKey="from"
                              const:href="view"
-                             var:queryDictionary="queryParameters"
+                             var:queryDictionary="context.request.formValues"
               />
             </var:if>
             <var:if condition="showToAddress">
@@ -46,7 +46,7 @@
                              label:label="To"
                              const:sortKey="to"
                              const:href="view"
-                             var:queryDictionary="queryParameters"
+                             var:queryDictionary="context.request.formValues"
               />
             </var:if>
           </td>
@@ -61,7 +61,7 @@
                            label:label="Date"
                            const:sortKey="date"
                            const:href="view"
-                           var:queryDictionary="queryParameters"
+                           var:queryDictionary="context.request.formValues"
                            const:isDefault="YES"
             />
           </td>