]> err.no Git - scalable-opengroupware.org/commitdiff
fixes and requested features
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 8 Oct 2004 16:45:00 +0000 (16:45 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Fri, 8 Oct 2004 16:45:00 +0000 (16:45 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@376 d1b88da0-ebda-0310-925b-ed51d893ca5b

13 files changed:
SOGo/UI/Contacts/ChangeLog
SOGo/UI/Contacts/UIxContactSelector.m
SOGo/UI/Contacts/UIxContactsSelectionView.m
SOGo/UI/Contacts/Version
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/UIxAppointmentPrintview.wox
SOGo/UI/Scheduler/UIxAppointmentProposal.wox
SOGo/UI/Scheduler/UIxAppointmentView.m
SOGo/UI/Scheduler/UIxAppointmentView.wox
SOGo/UI/Scheduler/Version
SOGoLogic/AgenorUserManager.m
SOGoLogic/ChangeLog
SOGoLogic/Version

index 799578926f6b50779fe6689649fdb294c8a686b8..859ae65a2ab3c58fce83e9a875953862697604b1 100644 (file)
@@ -1,3 +1,13 @@
+2004-10-08  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v0.9.13
+
+       * UIxContactsSelectionView.m: pass more (previous empty) parameters
+         to the JavaScript callback.
+
+       * UIxContactSelector.m: correctly compute the relative path to the
+         "Contacts" URL.
+
 2004-09-14  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * v0.9.12
index 54a4521e6daf73ed3a7d3c98f5fc8c1862dd7820..175aa720d7ab496765ea96e3ef4e85f325295c55 100644 (file)
 - (void)setCallback:(NSString *)_callback;
 - (NSString *)callback;
 
+- (NSString *)userRootURL;
+- (NSString *)selfURL;
+- (NSString *)relativeContactsURL;
+
 - (NSString *)jsFunctionName;
 - (NSString *)jsFunctionHref;
 - (NSString *)jsCode;
 @end
 
 #include "common.h"
+#include <NGExtensions/NGExtensions.h>
 
 @implementation UIxContactSelector
 
   return self->callback;
 }
 
+/* Helper */
+
+- (NSString *)userRootURL {
+  WOContext *ctx;
+  NSArray   *traversalObjects;
+  NSString  *url;
+
+  ctx = [self context];
+  traversalObjects = [ctx objectTraversalStack];
+  url = [[[traversalObjects objectAtIndex:1]
+                            baseURLInContext:ctx]
+                            stringByAppendingString:@"/"];
+  return [[NSURL URLWithString:url] path];
+}
+
+- (NSString *)selfURL {
+  NSString *url;
+  
+  url = [[self clientObject] baseURLInContext:[self context]];
+  return [[NSURL URLWithString:url] path];
+}
+
+- (NSString *)relativeContactsURL {
+  NSString *contactsURL, *selfURL, *relativeURL;
+
+  contactsURL = [[self userRootURL]
+                       stringByAppendingPathComponent:@"Contacts/select"];
+  selfURL = [self selfURL];
+  relativeURL = [contactsURL urlPathRelativeToPath:selfURL];
+  return relativeURL;
+}
+
 /* JavaScript */
 
 - (NSString *)jsFunctionName {
 - (NSString *)jsCode {
   static NSString *codeFmt = \
   @"function %@() {\n"
-  @"  var url = '../../Contacts/select?callback=%@';\n"
+  @"  var url = '%@?callback=%@';\n"
   @"  var contactsWindow = window.open(url, '%@', 'width=600, height=400, left=10, top=10, toolbar=no, dependent=yes, menubar=no, location=no, resizable=yes, scrollbars=yes, directories=no, status=no');\n"
   @"  contactsWindow.focus();\n"
   @"}";
   return [NSString stringWithFormat:codeFmt,
     [self jsFunctionName],
+    [self relativeContactsURL],
     [self callback],
     [self windowId]];
 }
index 47cc4cc9e20472ae5e9855c0b5db75b11340ff8b..4c6baba12d892135ae2e06633bcf97ae03b1d86e 100644 (file)
@@ -23,7 +23,6 @@
 
 #include "UIxContactsListView.h"
 
-
 @interface UIxContactsSelectionView : UIxContactsListView
 {
   NSString *callback;
@@ -31,6 +30,7 @@
 @end
 
 #include "common.h"
+#include <SOGoLogic/AgenorUserManager.h>
 
 @implementation UIxContactsSelectionView
 
 }
 
 - (NSString *)jsOnClickCode {
+  /* callback parameters: (type, cn, dn, email, uid, sn) */
   static NSString *jsCode = \
-    @"javascript:opener.window.%@('', '%@', '', '%@', '', '');";
-  NSString *cn;
-  
+    @"javascript:opener.window.%@('', '%@', '', '%@', '%@', '%@');";
+  NSString *sn, *cn, *mail, *uid;
+
+  sn = [self->contact valueForKey:@"sn"];
   cn = [NSString stringWithFormat:@"%@ %@",
-    [self->contact valueForKey:@"sn"],
+    sn,
     [self->contact valueForKey:@"givenname"]];
-
+  mail = [self->contact valueForKey:@"mail"];
+  uid = [[AgenorUserManager sharedUserManager] getUIDForEmail:mail];
   return [NSString stringWithFormat:jsCode,
     [self callback],
     cn,
-    [self->contact valueForKey:@"mail"]];
+    mail,
+    uid,
+    sn];
 }
 
 @end /* UIxContactsInlineListView */
index 9cef79939ea704d51f0e6725b9964991d0cafe31..92c8fa08c38f073a34665a077f87e34ece0ab9e3 100644 (file)
@@ -1,3 +1,3 @@
 # $Id$
 
-SUBMINOR_VERSION:=12
+SUBMINOR_VERSION:=13
index f840def63212d536e92209c0a97e9e3afe5d6ff9..f531ed68522c3b331ae29563d8f8962e0ed627e8 100644 (file)
@@ -1,3 +1,17 @@
+2004-10-08  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v0.9.86
+
+       * UIxAppointmentView.[m|wox]: new method to return categories as a
+         string.
+
+       * UIxAppointmentPrintview.wox: added missing priority and categories.
+
+       * UIxAppointmentProposal.wox: also allow selection from private address
+         book for resources/participants. This might lead to the fact that
+         contacts can be selected which do not have a calendar at all - there
+         should be some way of safeguarding this in the Contacts bundle.
+
 2004-10-06  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * UIxAppointmentEditor.m: changed iCal template to use RFC2445
index 92f9b70ebb9a8bf104503167068a82c06e46db68..b78bda47174883594137602e62773f2c6940b804 100644 (file)
               <var:string value="appointment.location" />
             </td>
           </tr>
+          <tr valign="top">
+            <td align="right" width="15%" class="aptview_text">
+              <var:string label:value="Priority" />:
+            </td>
+            <td align="left" class="aptview_text">
+              <var:string label:value="$appointment.priorityLabelKey" />
+            </td>
+          </tr>
         </table>
       </td>
     </tr>
               />
             </td>
           </tr>
+          <tr valign="top">
+            <td align="right" width="15%" class="aptview_text">
+              <var:string label:value="Categories" />:
+            </td>
+            <td align="left" class="aptview_text">
+              <var:string value="categoriesAsString" />
+            </td>
+          </tr>
           <tr valign="top">
             <td align="right" width="15%" class="aptview_text">
               <var:string label:value="Resources" />:
index c918dad26a3df25e92e88ec8e8042078174b6e92..671bf51f98ea71ac4812f26806a77891287bafce 100644 (file)
                                  const:role="NON-PARTICIPANT"
                                  attendees="resources"
                                  const:division="CC"
+                                 const:withAddressBook="YES"
                   />
                 </span>
               </td>
                                  attendees="participants"
                                  var:emailForUser="emailForUser"
                                  var:cnForUser="cnForUser"
+                                 const:withAddressBook="YES"
                   />
                 </span>
               </td>
index e228b3e8cbde6fa26bc653c9b02150a6c4f7d6f7..9b133b88b42cf445592a378f96de44e4c8a32531 100644 (file)
   return [cns componentsJoinedByString:@"<br />"];
 }
 
+- (NSString *)categoriesAsString {
+  unsigned i, count;
+  NSArray *cats;
+  NSMutableString *s;
+  
+  s = [[NSMutableString alloc] init];
+  cats = [((SOGoAppointment *)self->appointment) categories];
+  count = [cats count];
+  for(i = 0; i < count; i++) {
+    NSString *cat, *label;
+
+    cat = [cats objectAtIndex:i];
+    label = [self labelForKey:cat];
+    [s appendString:label];
+    if(i != (count - 1))
+      [s appendString:@", "];
+  }
+  return s;
+}
+
 /* backend */
 
 - (SOGoAppointment *)appointment {
index de15933bc5c8ddad30779ec6da7962594a9411c5..90cd422d3e334b331d9be8a123bd439d07de262d 100644 (file)
                   <var:string label:value="Categories" />:
                 </td>
                 <td align="left" bgcolor="#FFFFF0" class="aptview_text">
-                  <var:foreach list="appointment.categories" item="item">
-                     <var:string label:value="$item"
-                     /><var:entity const:name="nbsp" />
-                  </var:foreach>
+                  <var:string value="categoriesAsString" />
                 </td>
               </tr>
               <tr valign="top">
index dd616d8e4aca4617a112b4608242cf46647a746a..b9bc77131121a561e7719110ba7ee22703d52c77 100644 (file)
@@ -1,6 +1,6 @@
 # $Id$
 
-SUBMINOR_VERSION:=85
+SUBMINOR_VERSION:=86
 
 # v0.9.84 requires libSOGoLogic    v0.9.12
 # v0.9.70 requires libNGExtensions v4.3.107
index 240bf544e803fc4326b067182b3a614aab04356b..60842b44afed50b421217225e320e8fd13079587 100644 (file)
 @implementation AgenorUserManager
 
 + (id)sharedUserManager {
-    static id mgr = nil;
-    if(mgr == nil) {
-        mgr = [[self alloc] init];
-    }
-    return mgr;
+  static id mgr = nil;
+  if(mgr == nil) {
+    mgr = [[self alloc] init];
+  }
+  return mgr;
 }
 
 - (id)init {
-    self = [super init];
-    if(self) {
-    }
-    return self;
+  self = [super init];
+  if(self) {
+  }
+  return self;
 }
 
 - (void)dealloc {
-    [super dealloc];
+  [super dealloc];
 }
 
 
 - (NSString *)getUIDForEmail:(NSString *)_email {
-    NSRange r;
-    NSString *domain;
-
-    r = [_email rangeOfString:@"@"];
-    domain = [_email substringFromIndex:r.location + 1];
-    if(![domain isEqualToString:@"equipement.gouv.fr"])
-        return _email;
-    return [_email substringToIndex:r.location];
+  NSRange r;
+  NSString *domain;
+
+  if(!_email || [_email length] == 0)
+    return nil;
+
+  r = [_email rangeOfString:@"@"];
+  domain = [_email substringFromIndex:r.location + 1];
+  if(![domain isEqualToString:@"equipement.gouv.fr"])
+      return _email;
+  return [_email substringToIndex:r.location];
 }
 
 - (NSString *)getEmailForUID:(NSString *)_uid {
-    NSRange r;
-    
-    r = [_uid rangeOfString:@"@"];
-    if(r.length > 0)
-        return _uid;
-    return [NSString stringWithFormat:@"%@@equipement.gouv.fr", _uid];
-    
+  NSRange r;
+
+  if(!_uid || [_uid length] == 0)
+    return nil;
+  r = [_uid rangeOfString:@"@"];
+  if(r.length > 0)
+      return _uid;
+  return [NSString stringWithFormat:@"%@@equipement.gouv.fr", _uid];
 }
 
 - (NSString *)getCNForUID:(NSString *)_uid {
 #warning !! IMPLEMENT ME!!
-    NSString *s;
-    NSRange  r;
-    
-    s = _uid;
-    if ([s length] < 10)
-        return s;
-    
-    // TODO: algorithm might be inappropriate, depends on the actual UID
-    r = [s rangeOfString:@"."];
-    if (r.length == 0)
-        return s;
-    
-    return [s substringToIndex:r.location];
+  NSString *s;
+  NSRange  r;
+  
+  s = _uid;
+  if ([s length] < 10)
+      return s;
+  
+  // TODO: algorithm might be inappropriate, depends on the actual UID
+  r = [s rangeOfString:@"."];
+  if (r.length == 0)
+      return s;
+  
+  return [s substringToIndex:r.location];
 }
 
 @end
index 271c7d2f1e64ee1ba6f2596a597e6e580c7abbdd..fec335b9325e9bf73ae5793d23e1ed133bcdd57d 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-08  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * AgenorUserManager.m: some safe-guarding against improper values,
+         code pretty printing. (v0.9.15)
+
 2004-10-08  Helge Hess  <helge.hess@opengroupware.org>
 
        * SOGoAppointment.m: improved behaviour in some edge condition (the
index dc9886a4cb4122556d50ff257ccc655cdeaa8aed..8c6b587268deb91736cd60487574e77458af0769 100644 (file)
@@ -1,5 +1,5 @@
 # $Id$
 
-SUBMINOR_VERSION:=14
+SUBMINOR_VERSION:=15
 
 # v0.9.13 requires libFoundation v1.0.62