[OGo-Users] Default value for Comment field

Gregory Malsack users@opengroupware.org
Wed, 14 Feb 2007 18:02:15 -0600


Adam,

I don't have the file LSWAppointmentViewer.m, so far I have been able to
have the field show up on the printview page by adding the label to
translation page, then adding the label definition to the
SkyAppointmentPrintViewer.html file, then adding a matching descriptor
in the SkyAppointmentPrintViewer.wod file. So now the field shows up but
the populated data does not. Here is what is in the wod file:

patientname: SkySubAttribute {
  label =3D labels.patientname;
  string =3D extendedAttributeSpec.patientname;
}

Any idea what should be in the string directive? I've tried several
different combinations with no luck. I will keep working at it and post
an answer if I find it.

Greg


-----Original Message-----
From: users-admin@opengroupware.org
[mailto:users-admin@opengroupware.org] On Behalf Of Adam Tauno Williams
Sent: Wednesday, February 14, 2007 10:33 AM
To: users@opengroupware.org
Subject: RE: [OGo-Users] Default value for Comment field

On Wed, 2007-02-14 at 09:48 -0600, Gregory Malsack wrote:
> HUGE shout out for Adam!!! Thanks mucho!!
>=20
> This is a much better way then what I did, however the additional=20
> fields do not show up printview of the calendar event. Can you show me

> how that might be done?

My guess would be editing
SkyAppointmentPrintViewer.html/SkyAppointmentPrintViewer.wod in
WebUI/Templates/LSWScheduler.

Somehow you have to get LSWObjectViewer into the page *like* is in
LSWAppointmentViewer.wox:
 <var:if condition=3D"showProperties">
    <var:component className=3D"LSWObjectViewer"
     object=3D"extendedAttributes"
     attributes=3D"extendedAttributeSpec"
     const:namespace=3D
        "http://www.opengroupware.org/properties/ext-attr"
     />
 </var:if>

(Note that LSWAppointmentViewer is a WOX while SkyAppointmentPrintViewer
is an HTML/WOD).

But my gut tells me you'd have to edit
WebUI/Scheduler/LSWScheduler/SkyAppointmentPrintViewer.m as well to
marshal the values of the properties;  I don't see any reference to the
propertyManager in that file so I doubt it currently does.  See
WebUI/Scheduler/LSWScheduler/LSWAppointmentViewer.m for an example of
how to marshal the values (it is really very easy):
-----<start>-------
static NSArray  *extAttrSpec =3D nil;
....
  extAttrSpec =3D [[ud arrayForKey:@"OGoExtendedAptAttributes"] copy];
  if ([extAttrSpec isNotEmpty])
    NSLog(@"Note(LSWAppointmentViewer): extended apt attrs are
configured.");
  else
    extAttrSpec =3D nil;
.....
/* extended apt attributes (properties) */

- (BOOL)showProperties {
  return [extAttrSpec isNotEmpty];
}
- (NSArray *)extendedAttributeSpec {
  return extAttrSpec;
}

- (NSDictionary *)extendedAttributes {
  SkyObjectPropertyManager *pm;

  pm =3D [[[self session] commandContext] propertyManager];
  return [pm propertiesForGlobalID:[[self object]
valueForKey:@"globalID"]
             namespace:XMLNS_OGoExtAttrPropNamespace];
}
-----<end>------- + plus some other little bits in the initialization of
the object.

This certainly merits opening an enhancement request in Bugzilla.
Seems like an important fix to me;  I haven't noticed since I don't ever
print anything. :)  But now that you've disturbed the karma some user is
going to bug me about it any minute now....  :(

I don't have much spare time in the next couple of days,  but I might
take a crack at this over the weekend if you can't figure it out.