[Rt-devel] Elements/CollectionAsTable/ParseFormat
Nicholas Clark
nick at ccl4.org
Fri May 25 11:09:03 EDT 2007
Is there any documentation for the formatting system used by
Elements/CollectionAsTable/ParseFormat?
I've got some way to understanding it, but I'm stuck on something seemingly
insane. In html/SelfService/Elements/MyRequests the format is:
qq{
'<B><A HREF="$RT::WebPath/SelfService/Display.html?id=__id__">__id__</a></B>/TITLE:#',
'<B><A HREF="$RT::WebPath/SelfService/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject',
Status,
'__Requestors__',
OwnerName};
I don't understand the difference between Status and '__Requestors__'
I have ascertained that the '' are a red herring here. __Requestors__ and
Requestors behave identically.
OK. As above, those two lines of that format parse to give these values
in the columns array:
$VAR1 = [
'__Status__'
];
$VAR1 = [
'__Requestors__',
''
];
That produces an HTML table with these headers:
<th class="collection-as-table">#</th><th class="collection-as-table">Subject</th><th class="collection-as-table">Status</th><th class="collection-as-table">Requestors</th><th class="collection-as-table">Owner</th></tr>
If I take out the __ and use the format
qq{
'<B><A HREF="$RT::WebPath/SelfService/Display.html?id=__id__">__id__</a></B>/TITLE:#',
'<B><A HREF="$RT::WebPath/SelfService/Display.html?id=__id__">__Subject__</a></B>/TITLE:Subject',
Status,
'Requestors',
OwnerName};
it gives these values in the columns array:
$VAR1 = [
'__Status__'
];
$VAR1 = [
'__Requestors__'
];
(note, no '' now)
and this HTML:
<th class="collection-as-table">#</th><th class="collection-as-table">Subject</th><th class="collection-as-table">Status</th><th class="collection-as-table"></th><th class="collection-as-table">Owner</th></tr>
Difference is
was: <th class="collection-as-table">Requestors</th>
now: <th class="collection-as-table"></th>
what I don't understand is what the difference in behaviour is between Status
and Requestors. Because in html/Elements/RT__Ticket/ColumnMap I see
Status => {
attribute => 'Status',
value => sub { return loc($_[0]->Status) }
},
Requestors => {
attribute => 'Requestor.EmailAddress',
value => sub { return $_[0]->Requestors->MemberEmailAddressesAsString }
},
Neither specify title. Yet one gets a title for free.
How?
Nicholas Clark
More information about the Rt-devel
mailing list