+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
- (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]];
}
#include "UIxContactsListView.h"
-
@interface UIxContactsSelectionView : UIxContactsListView
{
NSString *callback;
@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 */
# $Id$
-SUBMINOR_VERSION:=12
+SUBMINOR_VERSION:=13
+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
<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" />:
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>
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 {
<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">
# $Id$
-SUBMINOR_VERSION:=85
+SUBMINOR_VERSION:=86
# v0.9.84 requires libSOGoLogic v0.9.12
# v0.9.70 requires libNGExtensions v4.3.107
@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
+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
# $Id$
-SUBMINOR_VERSION:=14
+SUBMINOR_VERSION:=15
# v0.9.13 requires libFoundation v1.0.62