[rt-users] Custom sort for saved searches and dashboards

David fooraide at gmail.com
Thu Dec 3 14:38:57 EST 2009


Hi,

In reference to the question I had regarding customizing the way
dashboards are sorted, I was able to figure it out - thanks:
http://lists.bestpractical.com/pipermail/rt-users/2009-October/061874.html

In fact, there was two files to modify:
/share/html/Dashboards/index.html (Which corresponds to "Tools" -> "Dashboards")
/share/html/Dashboards/Elements/ListOfDashboards (Which corresponds to
the "Module" you can add to your homepage or to other dashboards)

(I think these should be editable under /local now if the patch went through..?)
Also, if I did this, it wouldn't work:
Dashboards => [sort { $a->Name <=> $b->Name } @{
$dashboards->{personal} || [] }],

Instead, I needed to use this:
Dashboards => [sort { $a->Name cmp $b->Name } @{
$dashboards->{personal} || [] }],

Since instead of comparing a numerical value, I was comparing strings:
Binary "<=>" returns -1, 0, or 1 depending on whether the left
argument is numerically less than, equal to, or greater than the right
argument.
Binary "cmp" returns -1, 0, or 1 depending on whether the left
argument is stringwise less than, equal to, or greater than the right
argument.

Now, on to my real question. I'm trying to ease the process of doing
maintenance on our saved searches because we are using a lot. Right
now, they are sorted by unique ID.
I'd also like to sort them by alphabetical order but I wasn't able to
find the right file to look at.

Can anyone point me in the right direction ?



More information about the rt-users mailing list