X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Freg_code.cgi;h=76790ab02ce44c55d555208dce34704d154ccd8d;hp=2fba39e008584e3d14ecceb2495946b94d8e74ff;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=c1bb4ddb71147d0571bd301a6d8c452fdf0e1bc9 diff --git a/httemplate/edit/reg_code.cgi b/httemplate/edit/reg_code.cgi index 2fba39e00..76790ab02 100644 --- a/httemplate/edit/reg_code.cgi +++ b/httemplate/edit/reg_code.cgi @@ -1,36 +1,44 @@ -<% -my $agentnum = $cgi->param('agentnum'); -$agentnum =~ /^(\d+)$/ or eidiot "illegal agentnum $agentnum"; -$agentnum = $1; -my $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); - -%> +<% include('/elements/header.html', 'Generate registration codes for '. $agent->agent) %> -<%= include("/elements/header.html",'Generate registration codes for '. $agent->agent, menubar( - 'Main Menu' => $p, - )) -%> +<% include('/elements/error.html') %> -<% if ( $cgi->param('error') ) { %> - Error: <%= $cgi->param('error') %> -<% } %> - -
- + + Generate - -registration codes for <%= $agent->agent %> allowing the following packages: +% my $num = ''; +% if ( $cgi->param('num') =~ /^\s*(\d+)\s*$/ ) { +% $num = $1; +% } + +registration codes for <% $agent->agent %> allowing the following packages:

-<% foreach my $part_pkg ( qsearch('part_pkg', { 'disabled' => '' } ) ) { %> - - <%= $part_pkg->pkg %> - <%= $part_pkg->comment %> -
-<% } %> +% foreach my $part_pkg ( qsearch('part_pkg', { 'disabled' => '' } ) ) { +% my $pkgpart = $part_pkg->pkgpart; + + param("pkgpart$pkgpart") ? 'CHECKED' : '' %>> + <% $part_pkg->pkg_comment %> +
+ +% } +
-
+ + +<% include('/elements/footer.html') %> + +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $agentnum = $cgi->param('agentnum'); +$agentnum =~ /^(\d+)$/ or errorpage("illegal agentnum $agentnum"); +$agentnum = $1; +my $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); +