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

Marcus Müller developer@opengroupware.org
Thu, 8 Mar 2007 08:08:09 +0100


--Apple-Mail-5--390522475
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed


On 08.03.2007, at 07:38, Sebastian Reitenbach wrote:

>> 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>
>
> just forgot, how can I tell ogo to replace the 01_tel with a string  
> from the
> .strings file
> from the translation Resources? I added a 01_tel statement to the
> GroupsUI.strings, as I did
> for the Tab name, but it was not used.

This is done via a label association. First, you have to make sure  
that the label namespace is properly defined in your .wox template,  
which means, that in your top level XML element this should be  
defined: xmlns:label="OGo:label".

Then, a binding like this will do the trick:

<var:foreach list="account.telephones" item="telephone">
                 <var:string label:value="$telephone.type" / 
 ><html:br /><var:string
value="telephone.number" /><html:br />
             </var:foreach>

WOLabelAssociations are either a constant label lookup (no preceeding  
dollar sign) or the result of a KeyPath lookup with final label  
lookup (if a preceeding dollar sign is found). In the example above,  
the keypath telephone.type is resolved, with the resulting  
stringValue being used as a label lookup. Easy. ;-)

Cheers,

   Marcus

-- 
Marcus Mueller  .  .  .  crack-admin/coder ;-)
Mulle kybernetiK  .  http://www.mulle-kybernetik.com
Current projects: http://www.mulle-kybernetik.com/znek/



--Apple-Mail-5--390522475
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=ISO-8859-1

<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; "><BR><DIV><DIV>On 08.03.2007, at =
07:38, Sebastian Reitenbach wrote:</DIV><BR =
class=3D"Apple-interchange-newline"><BLOCKQUOTE type=3D"cite"><BLOCKQUOTE =
type=3D"cite"><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">done, this shows me the =
telephone types and the numbers:</DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-converted-space">=A0 =A0 =A0 =A0 =A0 =A0 =
</SPAN>&lt;var:foreach list=3D"account.telephones" =
item=3D"telephone"&gt;</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; "><SPAN =
class=3D"Apple-converted-space">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
</SPAN>&lt;var:string value=3D"telephone.type" /&gt;&lt;html:br =
/&gt;&lt;var:string<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; =
">value=3D"telephone.number" /&gt;&lt;html:br /&gt;</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; "><SPAN class=3D"Apple-converted-space">=A0 =A0 =A0 =A0 =
=A0 =A0 </SPAN>&lt;/var:foreach&gt;</DIV> </BLOCKQUOTE><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">just =
forgot, how can I tell ogo to replace the 01_tel with a string from =
the</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">.strings file<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">from the =
translation Resources? I added a 01_tel statement to the</DIV><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">GroupsUI.strings, as I did<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></DIV><DIV style=3D"margin-top: =
0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">for the =
Tab name, but it was not used.</DIV></BLOCKQUOTE><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>This is done via a label =
association. First, you have to make sure that the label namespace is =
properly defined in your .wox template, which means, that in your top =
level XML element this should be =
defined:=A0xmlns:label=3D"OGo:label".</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Then, a binding like this =
will do the trick:</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "> =
&lt;var:foreach list=3D"account.telephones" =
item=3D"telephone"&gt;</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; ">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 &lt;var:string label:value=3D"$telephone.type" /&gt;&lt;html:br =
/&gt;&lt;var:string=A0</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; ">value=3D"telephone.number" =
/&gt;&lt;html:br /&gt;</DIV><DIV style=3D"margin-top: 0px; margin-right: =
0px; margin-bottom: 0px; margin-left: 0px; ">=A0 =A0 =A0 =A0 =A0 =A0 =
&lt;/var:foreach&gt;</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>WOLabelAssociations are =
either a constant label lookup (no preceeding dollar sign) or the result =
of a KeyPath lookup with final label lookup (if a preceeding dollar sign =
is found). In the example above, the keypath telephone.type is resolved, =
with the resulting stringValue being used as a label lookup. Easy. =
;-)</DIV></DIV><BR><DIV> <SPAN class=3D"Apple-style-span" =
style=3D"border-collapse: separate; border-spacing: 0px 0px; color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant: normal; font-weight: normal; letter-spacing: =
normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><SPAN =
class=3D"Apple-style-span" style=3D"border-collapse: separate; =
border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant: normal; font-weight: =
normal; letter-spacing: normal; line-height: normal; text-align: auto; =
-khtml-text-decorations-in-effect: none; text-indent: 0px; =
-apple-text-size-adjust: auto; text-transform: none; orphans: 2; =
white-space: normal; widows: 2; word-spacing: 0px; "><P style=3D"margin: =
0.0px 0.0px 0.0px 0.0px"><FONT face=3D"Helvetica" size=3D"3" =
style=3D"font: 12.0px Helvetica">Cheers,</FONT></P><P style=3D"margin: =
0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: =
14.0px"><BR></P><P style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><FONT =
face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px Helvetica"><SPAN =
class=3D"Apple-converted-space">=A0<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></SPAN>Marcus</FONT></P><P =
style=3D"margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; =
min-height: 14.0px"><BR></P><P style=3D"margin: 0.0px 0.0px 0.0px =
0.0px"><FONT face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px =
Helvetica">--<SPAN class=3D"Apple-converted-space">=A0</SPAN></FONT></P><P=
 style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><FONT face=3D"Helvetica" =
size=3D"3" style=3D"font: 12.0px Helvetica">Marcus Mueller<SPAN =
class=3D"Apple-converted-space">=A0<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></SPAN>.<SPAN =
class=3D"Apple-converted-space">=A0<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></SPAN>.<SPAN =
class=3D"Apple-converted-space">=A0<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></SPAN>.<SPAN =
class=3D"Apple-converted-space">=A0<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></SPAN>crack-admin/coder =
;-)</FONT></P><P style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><FONT =
face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px Helvetica">Mulle =
kybernetiK<SPAN class=3D"Apple-converted-space">=A0<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></SPAN>.<SPAN =
class=3D"Apple-converted-space">=A0<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></SPAN><A =
href=3D"http://www.mulle-kybernetik.com">http://www.mulle-kybernetik.com</=
A></FONT></P><P style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><FONT =
face=3D"Helvetica" size=3D"3" style=3D"font: 12.0px Helvetica">Current =
projects:=A0<A =
href=3D"http://www.mulle-kybernetik.com/znek/">http://www.mulle-kybernetik=
.com/znek/</A></FONT></P><BR =
class=3D"Apple-interchange-newline"></SPAN></SPAN> =
</DIV><BR></BODY></HTML>=

--Apple-Mail-5--390522475--