quiet warnings about CGI::param in list context
[freeside.git] / httemplate / search / reg_code.html
1 <& elements/search.html,
2                  'title'       => 'Unused Registration Codes for '.
3                                   $agent->agent,
4                  'name'        => 'registration codes',
5                  'query'       => {  'table'   => 'reg_code',
6                                      'hashref' => { 'agentnum' => $agentnum, },
7                                   },
8                  'count_query' => $count_query,
9                  #'redirect'    => $link,
10                  'header'      => [ qw(Code Packages) ],
11                  'fields'      => [
12                    'code',
13                    sub {
14                      map { 
15                        qq!<A HREF="${p}edit/part_pkg.cgi?!. $_->pkgpart. '">'.
16                        $_->pkg_comment(nopkgpart => 1).
17                        '</A><BR>'
18                      } $_[0]->part_pkg
19                    },
20                  ],
21                  'links' => [
22                    '',
23                    #$plink,
24                    '',
25                  ],
26       
27 &>
28 <%init>
29
30 die "access denied"
31   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
32
33 my $agentnum = $cgi->param('agentnum');
34 $agentnum =~ /^(\d+)$/ or errorpage("illegal agentnum $agentnum");
35 $agentnum = $1;
36 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
37
38 my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum";
39
40 </%init>