[OGo-Users] Default Appointment Types and Requiring an Appointment Type

Adam Tauno Williams users@opengroupware.org
Thu, 13 Mar 2008 09:56:44 -0400


> 1) Where can I find the default appointment types?  I know I can
> override them with SkyScheduler_defaultAppointmentTypes, but I'd like
> to make sure I define the few that we want to keep exactly how they
> currently are. 

The default appointment types are listed in WMOGAG
<http://docs.opengroupware.org/Members/whitemice/wmogag/file_view>;  see
the Schedular chapter.

> 2) If I do that, that will not affect any existing appointments,
> right?

Yep.

The default appointment types are defined in WebUI/Main/OpenGroupware.m

  // TODO: this is really, well, weird ;->
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"none", @"type",
                              @"apt_icon_default.gif", @"icon",nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"birthday", @"type",
                              @"apt_icon_birthday.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"tradeshow",
@"type",
                              @"apt_icon_tradeshow.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"meeting", @"type",
                              @"apt_icon_meeting.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"holiday", @"type",
                              @"apt_icon_holiday.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"duedate", @"type",
                              @"apt_icon_duedate.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"outward", @"type",
                              @"apt_icon_outwards.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"home", @"type",
                              @"apt_icon_home.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"call", @"type",
                              @"apt_icon_call.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;
  d = [[NSDictionary alloc] initWithObjectsAndKeys:@"ill", @"type",
                              @"apt_icon_ill.gif", @"icon", nil];
  [ma addObject:d]; [d release]; d = nil;

That is some ugly ugly code,  but it basically makes a array of
dictionaries like:

[ { type = 'none', icon = 'apt_icon_default.gif'}, {....

The value of type is mapped to a description via localization (the
*.strings files).

> 3) I'd like to force the choosing of an appointment type.  I'd like to
> keep the "- unspecified -" as the default, and throw a javascript
> error if that's chosen, blocking the submission of the form.  Has
> anyone done this before?  A patch would be awesome.  Or if no one has
> done it, any tips would be great.

I think this has come up before,  but I don't recall anything specific.

Maybe 
http://bugzilla.opengroupware.org/bugzilla/show_bug.cgi?id=1759

Setting a default appointment type certainly seems like a reasonable
request;  which is more general then forcing a type to be chosed (which
bug#1759 wants)