[rt-users] groups in alphabetical order...

Jesse Vincent jesse at bestpractical.com
Thu Aug 23 19:34:09 EDT 2001


*nod* The goal of doing the default Alphabetical sort order is so that
the default sort is predictable. because there's no real guarantee that the
DB will return results in insertion order.  I'd be happy to take a patch
to sort the PseudoGroups by another criterion within the webui.  

	-j

On Thu, Aug 23, 2001 at 07:18:48PM -0400, Ayan R. Kayal wrote:
> I actually put it in _Init the first time, but then the Pseudogroups came
> up alphabetized and that looked silly (I liked the original order). :) I
> guess I chose aesthetics over ease of implementation.
> 
> On Thu, 23 Aug 2001, Jesse Vincent wrote:
> 
> > Alternatively, you can add the
> >
> >   $self->OrderBy( ALIAS => 'main',
> >   		  FIELD => 'Name',
> >   		  ORDER => 'ASC');
> >
> > call to the _Init subroutine.  Which is what 2.0.6 will have ;)
> >
> > Thanks.  I've been trying to catch the default ordering stuff. I'm starting to get there. but I'm not all the way yet. If there are other things that aren't
> > sorted properly by default, I'd love to know.
> >
> >
> >
> > On Thu, Aug 23, 2001 at 05:28:47PM -0400, Ayan R. Kayal wrote:
> > > I hacked RT so that the "real" groups (as opposed to pseudo groups) would
> > > show in alphabetical order.
> > >
> > > The following subroutine was added to lib/RT/Groups.pm:
> > >
> > > 	# {{{ sub OrderAlpha
> > >
> > > 	=head2 OrderAlpha
> > >
> > > 	Alphabetizes group names.
> > >
> > > 	=cut
> > >
> > > 	  sub OrderAlpha {
> > > 	    my $self = shift;
> > >
> > > 	  # By default, order by name
> > > 	    return ($self->OrderBy( ALIAS => 'main',
> > > 	                  FIELD => 'Name',
> > > 	                  ORDER => 'ASC'));
> > >
> > > 	}
> > > 	# }}}
> > >
> > >
> > > Then, the line after the "Limit to Real" line was added to index.html in
> > > WebRT/html/Admin/Groups:
> > >
> > > 	my $Groups = new RT::Groups($session{'CurrentUser'});
> > > 	$Groups->LimitToReal;
> > > **	$Groups->OrderAlpha;
> > >
> > > 	</%INIT>
> > >
> > >
> > > If you modify Groups.pm to add this feature, make sure you stop and
> > > restart Apache so RT sees the change... Cheers...
> > >
> > > 				~ARK
> 
> 

-- 
http://www.bestpractical.com/products/rt  -- Trouble Ticketing. Free.




More information about the rt-users mailing list