## OpenCA - CA Command
## (c) 2001 by Michael Bell and OpenCA Group
##
##   File Name: show_prepared_operation
##       Brief: show a special operation
## Description: show a special operation and a button to add/delete the module
##  Parameters: operation, next_cmd

sub cmdShow_prepared_operation {

	## Get required parameters ( return only the value string )
	my $sheet    = getRequired( 'ShowPreparedOperationSheet' );

	my @cols;
	my $page;

	## Get the base Page ( got in $page variable )
	if( not $page = $query->getFile( "$sheet" ) ) {
		configError ( i18nGettext ("File not Found : __SHEET__", "__SHEET__", $sheet) );
	};

	my $operation = $query->param ('operation');

	my $data = "<input type=hidden name=operation value=\"".$operation."\">\n";

	if ( $query->param ('next_cmd') =~ /^delete$/i ) {
		$data .= "<input type=hidden name=cmd value=delete_operation>\n";
		$data .= "<input type=submit value=\"".gettext ("DELETE this Operation")."\">\n";
	} else {
		$data .= "<input type=hidden name=cmd value=new_operation>";
		$data .= "<input type=submit value=\"".gettext ("Create this Operation")."\">\n";
	}

	## Substitute the Variables in the $page
	$page = $query->subVar( $page, '$operation', $operation );
	$page = $query->subVar( $page, '$data', $data );

	print "$page";
}

1;
