## OpenCA - RA Server Command
## (c) 1998-2001 by Massimiliano Pala and OpenCA Group
##
##   File Name: raList
##       Brief: List available RAs
## Description: Filter Requests Lists on RA Basis
##  Parameters: dataType

sub cmdRaList {

	## Get Parameters
	my $dataType = $query->param('dataType');

	## Get List of RAs Available (adding the ALL value)
	my @raList = @{ ($config->getParam('RegistrationAuthority'))->{VALUES} };
	push ( @raList, gettext ("All") );

	## Get Configuration needed parameters ...
	my $doc	= getRequired('RAChoiceBaseSheet');
	my $cmd	= 'listReqs';

	## Get the parameters
	my $choice	= $query->newInput( -regx=>'*', 
					    -intype=>'popup_menu',
					    -name=>'ra',
					    -values=>[ @raList ]);

	## Get the sheet page
	if ( not $page = $tools->getFile( $doc )) {;
		configError( i18nGettext ("Cannot load file __FILE__!", "__FILE__", $doc) );
	}

	## Substitute variables
	$page = $query->subVar( $page, '@RA@', $choice );
	$page = $query->subVar( $page, '@DATATYPE@', $dataType );
	$page = $query->subVar( $page, '@CMD@', $cmd );

	print "$page";
}

1;

