[OGo-Developer] accessing telephone numbers of team members in OGOGroupsPage

Sebastian Reitenbach developer@opengroupware.org
Thu, 08 Mar 2007 06:46:40 +0100


Hi,
developer@opengroupware.org wrote: 
> On Mar 7, 2007, at 08:02, Sebastian Reitenbach wrote:
> > I haven't tried the WORepetition yet
> 
> Then just do it.
done, this shows me the telephone types and the numbers:
            <var:foreach list="account.telephones" item="telephone">
                <var:string value="telephone.type" /><html:br /><var:string 
value="telephone.number" /><html:br />
            </var:foreach>


> 
> > when I add lines like these:
> >             <var:string value="account.companyValue.email1" / 
> > ><html:br />
> >             <var:string value="account.telephones.01_tel" / 
> > ><html:br />
> > then I see the following in the webui: ("","","","") (depending on  
> > companyValue
> > or telephones)
> 
> When you invoke -valueForKey: on an array, it will return an array  
> containing the values for the keys. Since the objects contained in  
> the 'telephones' array do not have a '01_tel' key, you end up having  
> and array of empty values.
> You probably want to use 'number', 'type' or something like that.
yes, thanks for the explanation, a line like this:
<var:string value="account.telephones.type" />
shows me the array of telephone types.

> 
> > when I add a line like this:
> >             <var:string value="account.email1" /><html:br />
> > then the value of email1 shows up in the WebUI.
> 
> If account is a document object (eg SkyAccountDocument), not an EO,  
> other rules apply. Document objects are smarter about their  
> relationships.
where can I read about the different rules that apply?


> 
> It could also be that companyValues are always applied directly on  
> the EO object, not sure. It probably is this way.
where do I find out whether it is directly or not? At least for me, looking at
the code, the 
companyValues and telephones are added to the members array in the same way.
where and for what should I look to find out about whether they are differently
applied to 
the members array or not?

> 
> > and finally, when I add a line like this:
> >             <var:string value="account.01_tel" /><html:br />
> >
> > an empty line is produced.
> >
> > now the question: what are the differences between these two  
> > EOGenericRecords,
> > so that I can make the extended attributes show up in the webui,  
> > but not the telephone
> > numbers?
> 
> Which *two* EOGenericRecords? I see just one, 'account'. If it is in  
> fact an EO.
when I use these lines in the .wox template:
<var:string value="account.companyValue" /><html:br />
<var:string value="account.telephones" /><html:br />
then the contents of two EOGenericRecords are printed in the webui, one
containing the 
companyValues, one containing the telephones. Both are EOGenericRecords and the
structure 
looks similar in my eyes, so for me, no difference. Therefore I wonder why this:
<var:string value="account.email1" /><html:br />
gives me the value of email1, and 
<var:string value="account.01_tel" /><html:br />
produces an empty line.

kind regards
Sebastian