X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fbrowse%2Fsvc_acct_pop.cgi;h=c6e615d40803726c9b9f81c78aba7cb693c25b45;hb=04a69f9d197efee6fa396bd35d04ae553e669978;hp=306d02afbbc452ad484c22fb96a9cc62c5e5c7f8;hpb=15777da47bab33e8f0021e6dd9aa6b434fa9be30;p=freeside.git
diff --git a/httemplate/browse/svc_acct_pop.cgi b/httemplate/browse/svc_acct_pop.cgi
index 306d02afb..c6e615d40 100755
--- a/httemplate/browse/svc_acct_pop.cgi
+++ b/httemplate/browse/svc_acct_pop.cgi
@@ -1,73 +1,77 @@
-<% include("/elements/header.html",'Access Number Listing', menubar( 'Main Menu' => $p )) %>
-Points of Presence
-Add new Access Number
-<% table() %>
-
- |
- City |
- State |
- Area code |
- Exchange |
- Local |
- Accounts |
-
-%
-%foreach my $svc_acct_pop ( sort {
-% #$a->getfield('popnum') <=> $b->getfield('popnum')
-% $a->state cmp $b->state || $a->city cmp $b->city
-% || $a->ac <=> $b->ac || $a->exch <=> $b->exch || $a->loc <=> $b->loc
-%} qsearch('svc_acct_pop',{}) ) {
-%
-% my $svc_acct_pop_link = $p . 'edit/svc_acct_pop.cgi?'. $svc_acct_pop->popnum;
-%
-% $accounts_sth->execute($svc_acct_pop->popnum) or die $accounts_sth->errstr;
-% my $num_accounts = $accounts_sth->fetchrow_arrayref->[0];
-%
-% my $svc_acct_link = $p. 'search/svc_acct.cgi?popnum='. $svc_acct_pop->popnum;
-%
-%
+<% include( 'elements/browse.html',
+ 'title' => 'Access Numbers',
+ 'html_init' => $html_init,
+ 'name_singular' => 'access number',
+ 'query' => $query,
+ 'count_query' => $count_query,
+ 'header' => [
+ '#',
+ 'City',
+ 'State',
+ 'Area code',
+ 'Exchange',
+ 'Local',
+ 'Accounts',
+ ],
+ 'fields' => [
+ 'popnum',
+ 'city',
+ 'state',
+ 'ac',
+ 'exch',
+ 'loc',
+ $num_accounts_sub,
+ ],
+ 'align' => 'rllrrrr',
+ )
+%>
+<%init>
-
-
- <% $svc_acct_pop->popnum %> |
-
- <% $svc_acct_pop->city %> |
-
- <% $svc_acct_pop->state %> |
-
- <% $svc_acct_pop->ac %> |
-
- <% $svc_acct_pop->exch %> |
-
- <% $svc_acct_pop->loc %> |
-
- <% $num_accounts %>
-% if ( $num_accounts ) {
-
-% }
+my $curuser = $FS::CurrentUser::CurrentUser;
- active
-% if ( $num_accounts ) {
-
-% }
+die "access denied"
+ unless $curuser->access_right('Dialup configuration')
+ || $curuser->access_right('Dialup global configuration');
- |
-
-% }
+my $html_init = qq!
+ Add new Access Number
+
+!;
+my $query = { 'select' => '*,
+ ( SELECT COUNT(*) FROM svc_acct
+ WHERE svc_acct.popnum = svc_acct_pop.popnum
+ ) AS num_accounts
+ ',
+ 'table' => 'svc_acct_pop',
+ #'hashref' => { 'disabled' => '' },
+ 'extra_sql' => 'ORDER BY state, city, ac, exch, loc',
+ };
-
-
-
-