]> err.no Git - scalable-opengroupware.org/commitdiff
fixed all known problems wrt Anais UidSelector
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 12 Aug 2004 16:39:27 +0000 (16:39 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Thu, 12 Aug 2004 16:39:27 +0000 (16:39 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@192 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/UI/Anais/AnaisUidSelector.m
SOGo/UI/Anais/AnaisUidSelector.wox
SOGo/UI/Anais/ChangeLog
SOGo/UI/Anais/Version
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/UIxCalView.m
SOGo/UI/Scheduler/Version

index b8d88315ab57c8cf16a2f8b01d19d2c50d26f14a..4855b880b059d48ecd0e9cabadaf9b4f1630b852 100644 (file)
@@ -27,7 +27,6 @@
 {
     NSArray *calendarUIDs;
     NSString *uid;
-    BOOL meTooChecked;
     NSString *userUid;
 }
 
     return [NSString stringWithFormat:@", %@", self->uid];
 }
 
-- (void)setMeTooChecked:(BOOL)_meTooChecked {
-    self->meTooChecked = _meTooChecked;
-}
-- (BOOL)meTooChecked {
-    return self->meTooChecked;
-}
-
 
 /* Href */
 
     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 */
 
     @"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"
     @"";
     
index 6446bd91bdb638d235586a03a59929c35aedde9d..83debd17ca372c879fb4d48f89dbddb305e6b096 100644 (file)
                            const:division="TEST"
             />
           </td>
-          <td>
-            <input type="checkbox" var:checked="meTooChecked" />
-            <var:string label:value="me too" />
-          </td>
-          <td class="button_auto_env">
-             <form var:href="showHref">
-               <input type="hidden"
-                      name="anaisUIDString"
-                      id="anaisUIDString"
-                      var:value="calendarUIDString"
-               />
-               <input type="hidden"
-                      name="previousMethod"
-                      var:value="ownMethodName"
-               />
-               <input type="submit" label:value="show" />
-             </form>
+          <td id="addMeToo" class="button_auto_env" var:style="meTooStyle">
+            <a href="javascript:addMeToo()"
+               class="button_auto"
+            ><var:string label:value="me too" /></a>
           </td>
-          <td class="button_auto_env">
+          <td id="clearUidList" class="button_auto_env">
             <a href="javascript:clearUidList()"
                 class="button_auto"
              ><var:string label:value="clear" /></a>
           </td>
+          <td id="showUidList" class="button_auto_env">
+            <form var:href="showHref">
+              <input type="hidden"
+                     name="anaisUIDString"
+                     id="anaisUIDString"
+                     var:value="calendarUIDString"
+              />
+              <input type="hidden"
+                     name="previousMethod"
+                     var:value="ownMethodName"
+              />
+              <input type="submit" label:value="show" class="button_auto" />
+            </form>
+          </td>
         </tr>
       </table>
     </td>
index 4e9952d6661c5bd74b9bd39d94264c3354b107a6..eb3b8da62c9601d0453a10fdedb39760a67eff17 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-12  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * AnaisUidSelector.[m|wox]: fixed all known problems (v0.9.3)
+
 2004-08-11  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * AnaisUidSelector.[m|wox]: much enhanced, but still not perfect
index f285cb83eddc699e6d4f35f139f23c1d0cbfd6e1..2d11c00f780fc0be2ddafc8978ae8a254b27a1ee 100644 (file)
@@ -1,3 +1,3 @@
 # $Id: Version 165 2004-08-05 17:55:50Z znek $
 
-SUBMINOR_VERSION:=2
+SUBMINOR_VERSION:=3
index 9c93c4e230d63dbea0dcc6e6184cb5961bde7321..5a1df235c0403df6f3bb94e151fa1149f679610d 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-12  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * UIxCalView.m: fixed problems with redirect (v0.9.23)
+
 2004-08-12  Helge Hess  <helge.hess@skyrix.com>
 
        * 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  <znek@mulle-kybernetik.com>
index 3da61309fb135995ed2eeb93eb68a3fe7b5269ca..96a4cf818e52afd7291ad1be301c142879146776 100644 (file)
   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 <WOActionResults> 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 */
index 78237daff645932d2dc39c82a83a2f6fffffed9c..8a19b3e3468cf58736fef0c8c36b3b6210ce79fe 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=22
+SUBMINOR_VERSION:=23