freeside/httemplate/search prepay_credit.html,NONE,1.1

ivan ivan at pouncequick.420.am
Sat Mar 12 06:31:54 PST 2005


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory pouncequick:/tmp/cvs-serv9831/httemplate/search

Added Files:
	prepay_credit.html 
Log Message:
- bring prepaid support into this century (close: Bug#1124)
- finally get rid of fs_signup (everything is in fs_selfservice now) (Bug#413)
- organize main menu sysadmin section so it is slightly less confusing

--- NEW FILE: prepay_credit.html ---
<%
my $agent = '';
my $hashref = {};
if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
  $hashref->{agentnum} = $1;
  $agent = qsearchs('agent', { 'agentnum' => $1 } );
}

my $count_query = 'SELECT COUNT(*) FROM prepay_credit';
$count_query .= ' WHERE agentnum = '. $agent->agentnum if $agent;

%><%= include( 'elements/search.html',
                 'title'       => 'Unused Prepaid Cards'.
                                  ($agent ? ' for '. $agent->agent : ''),
                 'menubar'     => [
                   'Main menu'      => $p,
                   'Generate cards' => $p.'edit/prepay_credit.cgi',
                 ],
                 'name'        => 'prepaid cards',
                 'query'       => {  'table'   => 'prepay_credit',
                                     'hashref' => $hashref,
                                  },
                 'count_query' => $count_query,
                 #'redirect'    => $link,
                 'header'      => [ '#', qw(Amount Time Agent) ],
                 'fields'      => [
                   'identifier',
                   sub { sprintf('$%.2f', shift->amount ) },
                   sub { my $c = shift; $c ? duration_exact($c->seconds) : '' },
                   sub { my $agent = shift->agent;
                         $agent ? $agent->agent : '';
                       },
                 ],
                 'links' => [
                   '',
                   '',
                   '',
                   sub { my $agent = shift->agent;
                         $agent ? [ "${p}view/agent.cgi?", 'agentnum' ] : '';
                       },
                 ],
      )
%>




More information about the freeside-commits mailing list