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

Ayan R. Kayal ayan.kayal at yale.edu
Thu Aug 23 19:18:48 EDT 2001


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





More information about the rt-users mailing list