With RT 3.2.2, I like the ability to customize the search format, including
creating columns for custom fields. I have ran into one issue where if you
exec a search with a customized format, the format is not held when
re-ordering the results by clicking one of the links in the header. I can
see the code in /html/Elements/CollectionsAsTable/Header, but I haven’t been
successful in converting the @Format argument into the right part of the
query string for the header links. Any thoughts on how I can do that?
Thanks.
Finally have a work around once my brain started working. Highly unofficial
diffs attached from my local cvs rep. Format string is not XSS-sanitized
yet, unless that is done somewhere else.
Index: /html/Elements/CollectionAsTable/Header
— Header 2004/12/06 15:15:26 1.1
+++ Header 2004/12/10 16:00:00 1.3
@@ -39,6 +39,13 @@ my %generic_query_args = ( Query => $Que
my $item = 0;
$$maxitems = 0;
+#M.M. Reconstruct Format String From @Format - for Re-Order Links
+my $reformat = “”;
+foreach my $recolref (@Format) {
- $reformat = $reformat.$recolref->{original}.‘,’;
+}
foreach my $col (@Format) {
$item++;
$$maxitems = $item if $item > $$maxitems;
@@ -47,8 +54,9 @@ foreach my $col (@Format) {
$item = 0;
}
else {
left; background-color: #dddddd;">‘);
my $title = $col->{title};
$title =~ s/^(.*)$/$1/o;
$title = ( $m->comp(’/Elements/RT__Ticket/ColumnMap’,
Name => $title,
@@ -76,7 +84,8 @@ foreach my $col (@Format) {
)
|| $col->{‘attribute’}
),
-
Order => ( $ARGS{'Order'} eq 'ASC' ? 'DESC' : 'ASC' ),
-
Format => ($reformat),
).
'">' . loc($title) . '</a>'
);
Index: /html/Elements/CollectionAsTable/ParseFormat
— ParseFormat 2004/12/06 15:15:26 1.1
+++ ParseFormat 2004/12/10 16:00:00 1.2
@@ -37,12 +37,16 @@ my $word = qr [(?:{|}|\w|.)+];
while ($Format =~ /($justquoted|$word)/igx) {
my $col = $1;
- my $colref;
-
#Save Original Component of Format String
- $colref->{‘original’} = $col;
if ($col =~ /^$RE{quoted}{-esc}$/) {
substr($col,0,1) = “”;
substr($col,-1,1) = “”;
}
With RT 3.2.2, I like the ability to customize the search format, including
creating columns for custom fields. I have ran into one issue where if you
exec a search with a customized format, the format is not held when
re-ordering the results by clicking one of the links in the header. I can
see the code in /html/Elements/CollectionsAsTable/Header, but I haven’t been
successful in converting the @Format argument into the right part of the
query string for the header links. Any thoughts on how I can do that?
Thanks.
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Be sure to check out the RT wiki at http://wiki.bestpractical.com
Finally have a work around once my brain started working. Highly unofficial
diffs attached from my local cvs rep.
’
Have you tried RT 3.2.3rc1?
I haven’t, but I guess I should have looked their first
I’ll have a look.
Thanks !From: Jesse Vincent [mailto:jesse@bestpractical.com]
Sent: Friday, December 10, 2004 12:53 PM
To: Matthew Meyer
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Search Format Not Held On Re-Order
Finally have a work around once my brain started working. Highly
unofficial
diffs attached from my local cvs rep.
’
Have you tried RT 3.2.3rc1?
I probably won’t get a chance to stand up 3.2.3rc1 today, but on first
glance I don’t see anything in /html/Elements/CollectionsAsTable/Header
where the Format string gets put in the link for the sortable column
headers. Of course, it could be implemented in a different way.
I’ll give you a heads up when I get a chance to actually install rc1, maybe
early next week.From: Jesse Vincent [mailto:jesse@bestpractical.com]
Sent: Friday, December 10, 2004 12:53 PM
To: Matthew Meyer
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Search Format Not Held On Re-Order
Finally have a work around once my brain started working. Highly
unofficial
diffs attached from my local cvs rep.
’
Have you tried RT 3.2.3rc1?