Allow TicketList sorting when embedded in other pages

I’m not sure if the appended patch is what you want for RT.

The TicketList element is embedded into various pages generated by RT. However,
sorting is (as best I can tell) only enabled for searches and bulk searches
by privileged users. I tried enabling this for a custom page I’d written
for the Self-Service interface and it all went horribly wrong, because
TicketList assumes that the query arguments needed on the sorting link are
those of the RT search. This is accurate for the current uses, but not that
flexible.

With these changes it’s possible to enable sorting on TicketList in other
situations, and have it pass through the correct (extra) page parameters to
reload those pages in sorted form.

It would be possible to enable sorting of the open and closed pages on the
default self service interface, but I’ve not done that here.

Nicholas Clark

Index: rt-external/html/Elements/TicketList
diff -c rt-external/html/Elements/TicketList:1.1.1.1 rt-external/html/Elements/TicketList:1.2
*** rt-external/html/Elements/TicketList:1.1.1.1 Mon May 21 15:38:40 2007
— rt-external/html/Elements/TicketList Wed May 30 12:32:26 2007
*** 56,61 ****
— 56,62 ----
Page => $Page,
OrderBy => $OrderBy ,
BaseURL => $BaseURL,

  • GenericQueryArgs => $GenericQueryArgs,
    maxitems => $maxitems &> 
    
    % }

*** 167,172 ****
— 168,174 ----
$Order => undef
$OrderBy => undef
$BaseURL => undef

  • $GenericQueryArgs => undef
    $Format => $RT::DefaultSearchResultFormat
    $DisplayFormat => undef
    $ShowNavigation => 1
    Index: rt-external/html/Elements/CollectionAsTable/Header
    diff -u rt-external/html/Elements/CollectionAsTable/Header:1.1.1.1 rt-external/html/Elements/CollectionAsTable/Header:1.2
    — rt-external/html/Elements/CollectionAsTable/Header:1.1.1.1 Mon May 21 15:38:40 2007
    +++ rt-external/html/Elements/CollectionAsTable/Header Wed May 30 12:32:26 2007
    @@ -49,6 +49,7 @@
    $AllowSorting => undef
    $Order=>undef
    $BaseURL => undef
    +$GenericQueryArgs => undef
    $Query => undef
    $Rows => undef
    $Page => undef
    @@ -57,7 +58,7 @@
<%perl>

-my %generic_query_args = ( Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString );
+my $generic_query_args = $GenericQueryArgs || { Query => $Query, Rows => $Rows, Page => $Page, Format => $FormatString };

my $item = 0;
foreach my $col (@Format) {
@@ -98,7 +99,7 @@
’<a href="’ . $BaseURL
. $m->comp(
’/Elements/QueryString’,

  •                %generic_query_args,
    
  •                %$generic_query_args,
                   OrderBy => (
                       $m->comp(
                           '/Elements/RT__Ticket/ColumnMap',
    

Index: rt-external/html/SelfService/Elements/MyRequests
diff -u rt-external/html/SelfService/Elements/MyRequests:1.4 rt-external/html/SelfService/Elements/MyRequests:1.5
— rt-external/html/SelfService/Elements/MyRequests:1.4 Tue May 29 11:25:46 2007
+++ rt-external/html/SelfService/Elements/MyRequests Wed May 30 12:32:26 2007
@@ -50,6 +50,8 @@
Order => $Order,
OrderBy => $OrderBy,
BaseURL => $BaseURL,

  •   	 GenericQueryArgs => $GenericQueryArgs,
    
  •   	 AllowSorting => $AllowSorting,
      	 Page    => $Page &>
    

</&>

@@ -69,8 +71,6 @@
$Query .= “’ )”;
}
$Query .= ’ ’ . $extra_constraint if $extra_constraint;
-my $Order = “ASC”;
-my $OrderBy = “Created”;
my @Format = qq{
id/TITLE:Ticket Reference’,
Subject/TITLE:Subject’,
@@ -119,5 +119,9 @@
@status => (‘open’, ‘new’, ‘stalled’)
$extra_constraint => undef
$BaseURL => undef
+$GenericQueryArgs => undef
+$Order => “ASC”
+$OrderBy => “Created”
+$AllowSorting => undef
$Page => 1
</%ARGS>

I’m not sure if the appended patch is what you want for RT.

+1. Seems reasonable. (Except for the use of CVS :wink:

PGP.sig (186 Bytes)

I’m not sure if the appended patch is what you want for RT.

+1. Seems reasonable. (Except for the use of CVS :wink:

That’s another story, but not on topic for this list :slight_smile:

Its days are numbered. Those plotting fot its (overtimely) demise are now all
singing from the same hymnsheet.

Nicholas Clark

I’m not sure if the appended patch is what you want for RT.

+1. Seems reasonable. (Except for the use of CVS :wink:

That’s another story, but not on topic for this list :slight_smile:

Its days are numbered. Those plotting fot its (overtimely) demise
are now all
singing from the same hymnsheet.

Want a version control and conversion consultant? He’ll be london
local in 2 weeks.

PGP.sig (186 Bytes)

Its days are numbered. Those plotting fot its (overtimely) demise
are now all
singing from the same hymnsheet.

Want a version control and conversion consultant? He’ll be london
local in 2 weeks.

I know the dates. Is he looking for somewhere to stay again? :slight_smile:

As to “want” - I don’t know. It’s not my project, and I don’t control budgets
(even to the level of “beer”)

Nicholas Clark

If I get patch right than there is a similar change in RT-3.7 that
should be back-ported instead of adding this.
Look into html/Elements/CollectionList that has argument “@PassArguments”.On 5/30/07, Nicholas Clark nick@ccl4.org wrote:

On Wed, May 30, 2007 at 12:20:17PM -0500, Jesse Vincent wrote:

On May 30, 2007, at 12:15 PM, Nicholas Clark wrote:

Its days are numbered. Those plotting fot its (overtimely) demise
are now all
singing from the same hymnsheet.

Want a version control and conversion consultant? He’ll be london
local in 2 weeks.

I know the dates. Is he looking for somewhere to stay again? :slight_smile:

As to “want” - I don’t know. It’s not my project, and I don’t control budgets
(even to the level of “beer”)

Nicholas Clark


List info: The rt-devel Archives

Best regards, Ruslan.