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

Jesse Vincent jesse at bestpractical.com
Thu Aug 23 19:11:18 EDT 2001


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
> 
> 
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
> 

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




More information about the rt-users mailing list