[Rt-devel] Minor Bug/Improvement + Patch - Ordering of Search and Ticket Create elements.

Stephen Turner sturner at MIT.EDU
Wed Dec 5 16:55:15 EST 2007


RT 3.6.5 - the way the 'Search' and 'New Ticket In' controls are laid 
out breaks the convention that the alphabetical key to the actions 
hash defines the order of appearance. What I mean is that in 
%basetopactions, component 'B' is rendered before component 'A' 
because of a reverse sort of the hash keys in /Elements/PageLayout.

It may seem trivial but if you have a convention, you might as well 
follow it - it was confusing to track down why the components were 
displaying in the "wrong" order. This patch simply removes the 
'reverse' from the sort, and puts the A and B the right way round.

Steve


diff -u share/html/Elements/Tabs local/html/Elements/Tabs

--- share/html/Elements/Tabs    2007-04-24 13:21:42.000000000 -0400
+++ local/html/Elements/Tabs    2007-12-05 16:46:35.000000000 -0500
@@ -59,10 +59,10 @@
  <%INIT>
  my $action;
  my $basetopactions = {
-       A => { html => $m->scomp('/Elements/CreateTicket')
+       A => { html => $m->scomp('/Elements/SimpleSearch')
+               },
+       B => { html => $m->scomp('/Elements/CreateTicket')
                 },
-       B => { html => $m->scomp('/Elements/SimpleSearch')
-               }
         };
  my $basetabs = {     A => { title => loc('Homepage'),
                             path => '',


diff -u share/html/Elements/PageLayout local/html/Elements/PageLayout

--- share/html/Elements/PageLayout      2007-04-24 13:21:42.000000000 -0400
+++ local/html/Elements/PageLayout      2007-12-05 16:47:34.000000000 -0500
@@ -46,7 +46,7 @@
  %#
  %# END BPS TAGGED BLOCK }}}
    <div id="topactions">
-% foreach my $action (reverse sort keys %{$topactions}) {
+% foreach my $action (sort keys %{$topactions}) {
      <span class="topaction">
  % $m->out($topactions->{"$action"}->{'html'});
      </span>


Stephen Turner
Senior Programmer/Analyst - Client Support Services
MIT Information Services and Technology (IS&T)




More information about the Rt-devel mailing list