X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Freg_code.html;h=42211e5711e1c2c14557ab630cd20d4d153eb8cd;hp=52a99ff660d964422b0db50f610a184d266beed0;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=673b9a458d9138523026963df6fa3b4683e09bae diff --git a/httemplate/search/reg_code.html b/httemplate/search/reg_code.html index 52a99ff66..42211e571 100644 --- a/httemplate/search/reg_code.html +++ b/httemplate/search/reg_code.html @@ -1,13 +1,4 @@ -<% - -my $agentnum = $cgi->param('agentnum'); -$agentnum =~ /^(\d+)$/ or eidiot "illegal agentnum $agentnum"; -$agentnum = $1; -my $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); - -my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum"; - -%><%= include( 'elements/search.html', +<& elements/search.html, 'title' => 'Unused Registration Codes for '. $agent->agent, 'name' => 'registration codes', @@ -22,7 +13,7 @@ my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum"; sub { map { qq!'. - $_->pkg. ' - '. $_->comment. + $_->pkg_comment(nopkgpart => 1). '
' } $_[0]->part_pkg }, @@ -32,5 +23,18 @@ my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum"; #$plink, '', ], - ) -%> + +&> +<%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 } ); + +my $count_query = "SELECT COUNT(*) FROM reg_code WHERE agentnum = $agentnum"; + +