1 %unless ( ref($error) ) {
2 % $cgi->param('error'. $error );
3 <% $cgi->redirect(popurl(3). "edit/reg_code.cgi?". $cgi->query_string ) %>
6 <% include("/elements/header.html","$num registration codes generated for ". $agent->agent, menubar(
7 'View all agents' => popurl(3). 'browse/agent.cgi',
11 % foreach my $code ( @$error ) {
16 <% include('/elements/footer.html') %>
21 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
23 $cgi->param('agentnum') =~ /^(\d+)$/
24 or errorpage('illegal agentnum '. $cgi->param('agentnum'));
26 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
31 if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) {
34 $error = 'Illegal number of codes: '. $cgi->param('num');
38 map { /^pkgpart(.*)$/; $1 }
39 grep { $cgi->param($_) }
43 $error ||= $agent->generate_reg_codes($num, \@pkgparts);