This commit was generated by cvs2svn to compensate for changes in r6255,
[freeside.git] / httemplate / edit / svc_acct_pop.cgi
1 <% include('/elements/header.html', "$action Access Number", menubar(
2      'View all Access Numbers' => popurl(2). "browse/svc_acct_pop.cgi",
3    ))
4 %>
5
6 <% include('/elements/error.html') %>
7
8 <FORM ACTION="<%$p1%>process/svc_acct_pop.cgi" METHOD=POST>
9
10 <INPUT TYPE="hidden" NAME="popnum" VALUE="<% $hashref->{popnum} %>">
11 Access Number #<% $hashref->{popnum} ? $hashref->{popnum} : "(NEW)" %>
12
13 <PRE>
14 City      <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="<% $hashref->{city} %>">
15 State     <INPUT TYPE="text" NAME="state" SIZE=16 MAXLENGTH=16 VALUE="<% $hashref->{state} %>">
16 Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="<% $hashref->{ac} %>">
17 Exchange  <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="<% $hashref->{exch} %>">
18 Local     <INPUT TYPE="text" NAME="loc" SIZE=5 MAXLENGTH=4 VALUE="<% $hashref->{loc} %>">
19 </PRE>
20
21 <BR>
22 <INPUT TYPE="submit" VALUE="<% $hashref->{popnum} ? "Apply changes" : "Add Access Number" %>">
23
24 </FORM>
25
26 <% include('/elements/footer.html') %>
27
28 <%init>
29
30 die "access denied"
31   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
32
33 my $svc_acct_pop;
34 if ( $cgi->param('error') ) {
35   $svc_acct_pop = new FS::svc_acct_pop ( {
36     map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop')
37   } );
38 } elsif ( $cgi->keywords ) { #editing
39   my($query)=$cgi->keywords;
40   $query =~ /^(\d+)$/;
41   $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
42 } else { #adding
43   $svc_acct_pop = new FS::svc_acct_pop {};
44 }
45 my $action = $svc_acct_pop->popnum ? 'Edit' : 'Add';
46 my $hashref = $svc_acct_pop->hashref;
47
48 my $p1 = popurl(1);
49
50 </%init>