summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/addr_block.cgi76
-rwxr-xr-xhttemplate/browse/cust_main_county.cgi11
-rw-r--r--httemplate/browse/generic.cgi46
-rw-r--r--httemplate/browse/part_sb_field.cgi31
-rw-r--r--httemplate/browse/router.cgi37
-rw-r--r--httemplate/docs/index.html3
-rw-r--r--httemplate/docs/install.html15
-rwxr-xr-xhttemplate/docs/legacy.html3
-rw-r--r--httemplate/docs/schema.diabin14438 -> 14414 bytes
-rw-r--r--httemplate/docs/schema.html19
-rw-r--r--httemplate/docs/session.html7
-rw-r--r--httemplate/docs/upgrade10.html11
-rw-r--r--httemplate/docs/upgrade4.html27
-rw-r--r--httemplate/docs/upgrade5.html34
-rw-r--r--httemplate/docs/upgrade6.html66
-rwxr-xr-xhttemplate/edit/REAL_cust_pkg.cgi2
-rwxr-xr-xhttemplate/edit/cust_main_county.cgi5
-rwxr-xr-xhttemplate/edit/part_bill_event.cgi6
-rwxr-xr-xhttemplate/edit/part_pkg.cgi2
-rw-r--r--httemplate/edit/part_router_field.cgi70
-rw-r--r--httemplate/edit/part_sb_field.cgi79
-rwxr-xr-xhttemplate/edit/part_svc.cgi19
-rwxr-xr-xhttemplate/edit/process/addr_block/add.cgi20
-rwxr-xr-xhttemplate/edit/process/addr_block/allocate.cgi25
-rwxr-xr-xhttemplate/edit/process/addr_block/deallocate.cgi24
-rwxr-xr-xhttemplate/edit/process/addr_block/split.cgi19
-rwxr-xr-xhttemplate/edit/process/cust_main_county.cgi17
-rw-r--r--httemplate/edit/process/generic.cgi69
-rwxr-xr-xhttemplate/edit/process/part_svc.cgi2
-rw-r--r--httemplate/edit/process/router.cgi100
-rwxr-xr-xhttemplate/edit/process/svc_acct_sm.cgi34
-rw-r--r--httemplate/edit/process/svc_broadband.cgi79
-rwxr-xr-xhttemplate/edit/router.cgi88
-rwxr-xr-xhttemplate/edit/svc_acct_sm.cgi178
-rw-r--r--httemplate/edit/svc_broadband.cgi184
-rwxr-xr-xhttemplate/edit/svc_forward.cgi1
-rwxr-xr-xhttemplate/graph/money_time-graph.cgi108
-rw-r--r--httemplate/graph/money_time.cgi59
-rw-r--r--httemplate/index.html11
-rwxr-xr-xhttemplate/misc/link.cgi1
-rw-r--r--httemplate/misc/meta-import.cgi64
-rw-r--r--httemplate/misc/process/meta-import.cgi153
-rwxr-xr-xhttemplate/search/report_cc.cgi3
-rwxr-xr-xhttemplate/search/report_credit.cgi3
-rwxr-xr-xhttemplate/search/report_receivables.cgi3
-rwxr-xr-xhttemplate/search/report_tax.cgi3
-rwxr-xr-xhttemplate/search/svc_acct.cgi25
-rwxr-xr-xhttemplate/search/svc_acct_sm.cgi84
-rwxr-xr-xhttemplate/search/svc_acct_sm.html23
-rwxr-xr-xhttemplate/search/svc_domain.cgi13
-rwxr-xr-xhttemplate/view/cust_main.cgi21
-rwxr-xr-xhttemplate/view/svc_acct.cgi7
-rwxr-xr-xhttemplate/view/svc_acct_sm.cgi58
-rw-r--r--httemplate/view/svc_broadband.cgi91
54 files changed, 606 insertions, 1533 deletions
diff --git a/httemplate/browse/addr_block.cgi b/httemplate/browse/addr_block.cgi
deleted file mode 100644
index 06ac556cf..000000000
--- a/httemplate/browse/addr_block.cgi
+++ /dev/null
@@ -1,76 +0,0 @@
-<%= header('Address Blocks', menubar('Main Menu' => $p)) %>
-<%
-
-use NetAddr::IP;
-
-my @addr_block = qsearch('addr_block', {});
-my @router = qsearch('router', {});
-my $block;
-my $p2 = popurl(2);
-my $path = $p2 . "edit/process/addr_block";
-
-%>
-
-<% if ($cgi->param('error')) { %>
- <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
- <BR><BR>
-<% } %>
-
-<%=table()%>
-
-<% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) { %>
- <TR>
- <TD><%=$block->NetAddr%></TD>
- <% if (my $router = $block->router) { %>
- <% if (scalar($block->svc_broadband) == 0) { %>
- <TD>
- <%=$router->routername%>
- </TD>
- <TD>
- <FORM ACTION="<%=$path%>/deallocate.cgi" METHOD="POST">
- <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
- <INPUT TYPE="submit" NAME="submit" VALUE="Deallocate">
- </FORM>
- </TD>
- <% } else { %>
- <TD COLSPAN="2">
- <%=$router->routername%>
- </TD>
- <% } %>
- <% } else { %>
- <TD>
- <FORM ACTION="<%=$path%>/allocate.cgi" METHOD="POST">
- <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
- <SELECT NAME="routernum" SIZE="1">
- <% foreach (@router) { %>
- <OPTION VALUE="<%=$_->routernum %>"><%=$_->routername%></OPTION>
- <% } %>
- </SELECT>
- <INPUT TYPE="submit" NAME="submit" VALUE="Allocate">
- </FORM>
- </TD>
- <TD>
- <FORM ACTION="<%=$path%>/split.cgi" METHOD="POST">
- <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$block->blocknum%>">
- <INPUT TYPE="submit" NAME="submit" VALUE="Split">
- </FORM>
- </TD>
- </TR>
-<% }
- } %>
- <TR><TD COLSPAN="3"><BR></TD></TR>
- <TR>
- <FORM ACTION="<%=$path%>/add.cgi" METHOD="POST">
- <TD>Gateway/Netmask</TD>
- <TD>
- <INPUT TYPE="text" NAME="ip_gateway" SIZE="15">/<INPUT TYPE="text" NAME="ip_netmask" SIZE="2">
- </TD>
- <TD>
- <INPUT TYPE="submit" NAME="submit" VALUE="Add">
- </TD>
- </FORM>
- </TR>
-</TABLE>
-</BODY>
-</HTML>
-
diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi
index c2473c4c8..991606087 100755
--- a/httemplate/browse/cust_main_county.cgi
+++ b/httemplate/browse/cust_main_county.cgi
@@ -21,8 +21,7 @@ print '<BR><BR>'. &table(). <<END;
<TH><FONT SIZE=-1>Country</FONT></TH>
<TH><FONT SIZE=-1>State</FONT></TH>
<TH>County</TH>
- <TH>Taxclass<BR><FONT SIZE=-1>(per-package classification)</FONT></TH>
- <TH>Tax name<BR><FONT SIZE=-1>(printed on invoices)</FONT></TH>
+ <TH>Taxclass</TH>
<TH><FONT SIZE=-1>Tax</FONT></TH>
<TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH>
</TR>
@@ -112,14 +111,6 @@ END
}
print "</TD>";
- print "<TD";
- if ( $hashref->{taxname} ) {
- print ' BGCOLOR="#ffffff">'. $hashref->{taxname};
- } else {
- print ' BGCOLOR="#cccccc">Tax';
- }
- print "</TD>";
-
print "<TD BGCOLOR=\"#ffffff\">$hashref->{tax}%</TD>".
'<TD BGCOLOR="#ffffff">$'.
sprintf("%.2f", $hashref->{exempt_amount} || 0). '</TD>'.
diff --git a/httemplate/browse/generic.cgi b/httemplate/browse/generic.cgi
deleted file mode 100644
index 9ac0f2391..000000000
--- a/httemplate/browse/generic.cgi
+++ /dev/null
@@ -1,46 +0,0 @@
-<%
-
-use FS::Record qw(qsearch dbdef);
-use DBIx::DBSchema;
-use DBIx::DBSchema::Table;
-
-my $error;
-my $p2 = popurl(2);
-my ($table) = $cgi->keywords;
-my $dbdef = dbdef or die "Cannot fetch dbdef!";
-my $dbdef_table = $dbdef->table($table) or die "Cannot fetch schema for $table";
-
-my $pkey = $dbdef_table->primary_key or die "Cannot fetch pkey for $table";
-print header("Browse $table", menubar('Main Menu' => $p));
-
-my @rec = qsearch($table, {});
-my @col = $dbdef_table->columns;
-
-if ($cgi->param('error')) { %>
- <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
- <BR><BR>
-<% }
-%>
-<A HREF="<%=$p2%>edit/<%=$table%>.cgi"><I>Add a new <%=$table%></I></A><BR><BR>
-
-<%=table()%>
-<TH>
-<% foreach (grep { $_ ne $pkey } @col) {
- %><TD><%=$_%></TD>
- <% } %>
-</TH>
-<% foreach $rec (sort {$a->getfield($pkey) cmp $b->getfield($pkey) } @rec) {
- %>
- <TR>
- <TD>
- <A HREF="<%=$p2%>edit/<%=$table%>.cgi?<%=$rec->getfield($pkey)%>">
- <%=$rec->getfield($pkey)%></A> </TD> <%
- foreach $col (grep { $_ ne $pkey } @col) { %>
- <TD><%=$rec->getfield($col)%></TD> <% } %>
- </A>
- </TR>
-<% } %>
-</TABLE>
-</BODY>
-</HTML>
-
diff --git a/httemplate/browse/part_sb_field.cgi b/httemplate/browse/part_sb_field.cgi
deleted file mode 100644
index 4c9641e86..000000000
--- a/httemplate/browse/part_sb_field.cgi
+++ /dev/null
@@ -1,31 +0,0 @@
-<%= header('svc_broadband extended fields', menubar('Main Menu' => $p)) %>
-<%
-
-my @psf = qsearch('part_sb_field', {});
-my $block;
-my $p2 = popurl(2);
-
-%>
-
-<% if ($cgi->param('error')) { %>
- <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
- <BR><BR>
-<% } %>
-
-<A HREF="<%=$p2%>edit/part_sb_field.cgi"><I>Add a new field</I></A><BR><BR>
-
-<%=table()%>
-<TH><TD>Field name</TD><TD>Service type</TD></TH>
-<% foreach $psf (sort {$a->name cmp $b->name} @psf) { %>
- <TR>
- <TD></TD>
- <TD>
- <A HREF="<%=$p2%>edit/part_sb_field.cgi?<%=$psf->sbfieldpart%>">
- <%=$psf->name%></A></TD>
- <TD><%=$psf->part_svc->svc%></TD>
- </TR>
-<% } %>
-</TABLE>
-</BODY>
-</HTML>
-
diff --git a/httemplate/browse/router.cgi b/httemplate/browse/router.cgi
deleted file mode 100644
index 8864936d9..000000000
--- a/httemplate/browse/router.cgi
+++ /dev/null
@@ -1,37 +0,0 @@
-<%= header('Routers', menubar('Main Menu' => $p)) %>
-<%
-
-my @router = qsearch('router', {});
-my $p2 = popurl(2);
-
-%>
-
-<% if ($cgi->param('error')) { %>
- <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
- <BR><BR>
-<% } %>
-
-<A HREF="<%=$p2%>edit/router.cgi"><I>Add a new router</I></A><BR><BR>
-
-<%=table()%>
-<!-- <TH><TD>Field name</TD><TD>Field value</TD></TH> -->
-<% foreach $router (sort {$a->routernum <=> $b->routernum} @router) { %>
- <TR>
-<!-- <TD ROWSPAN="<%=scalar($router->router_field) + 2%>"> -->
- <TD>
- <A HREF="<%=$p2%>edit/router.cgi?<%=$router->routernum%>"><%=$router->routername%></A>
- </TD>
- <!--
- <% foreach (sort { $a->part_router_field->name cmp $b->part_router_field->name } $router->router_field ) { %>
- <TR>
- <TD BGCOLOR="#cccccc" ALIGN="right"><%=$_->part_router_field->name%></TD>
- <TD BGCOLOR="#ffffff"><%=$_->value%></TD>
- </TR>
- <% } %>
- -->
- </TR>
-<% } %>
-</TABLE>
-</BODY>
-</HTML>
-
diff --git a/httemplate/docs/index.html b/httemplate/docs/index.html
index 8f6f91378..eaa5b9b92 100644
--- a/httemplate/docs/index.html
+++ b/httemplate/docs/index.html
@@ -6,6 +6,9 @@
<img src="overview.png">
<ul>
<li><a href="install.html">New Installation</a>
+ <li><a href="upgrade4.html">Upgrading from 1.2.x to 1.2.2</a>
+ <li><a href="upgrade5.html">Upgrading from 1.2.2 to 1.2.3</a>
+ <li><a href="upgrade6.html">Upgrading from 1.2.3 to 1.3.0</a>
<li><a href="upgrade7.html">Upgrading from 1.3.0 to 1.3.1</a>
<li><a href="upgrade8.html">Upgrading from 1.3.1 to 1.4.0</a>
<li><a href="upgrade9.html">Upgrading from 1.4.0 to 1.4.1</a>
diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html
index 51dce4da5..c90e908e1 100644
--- a/httemplate/docs/install.html
+++ b/httemplate/docs/install.html
@@ -53,8 +53,6 @@ Before installing, you need:
<li><a href="http://search.cpan.org/search?dist=HTML-Widgets-SelectLayers">HTML-Widgets-SelectLayers</a>
<li><a href="http://search.cpan.org/search?dist=Storable">Storable</a>
<!-- MyAccounts, maybe only for dev <li><a href="http://search.cpan.org/search?dist=Cache-Cache">Cache::Cache</a> -->
- <li><a href="http://search.cpan.org/search?dist=NetAddr-IP">NetAddr-IP</a>
- <li><a href="http://search.cpan.org/search?dist=Chart">Chart</a>
<li><a href="http://search.cpan.org/search?dist=ApacheDBI">Apache::DBI</a> <i>(optional but recommended for better webinterface performance)</i>
</ul>
</ul>
@@ -65,7 +63,7 @@ Install the Freeside distribution:
<ul>
<li> with <a href="http://www.postgresql.org/users-lounge/docs/7.1/postgres/user-manag.html#DATABASE-USERS">PostgreSQL</a>:
<pre>
-$ su postgres (pgsql on some distributions)
+$ su postgres
$ createuser -P freeside
Enter password for user "freeside":
Enter it again:
@@ -82,7 +80,7 @@ mysql> GRANT SELECT,INSERT,UPDATE,DELETE,INDEX,ALTER,CREATE,DROP on freeside.* T
<!-- <li>Unpack the tarball: <pre>gunzip -c fs-x.y.z.tar.gz | tar xvf -</pre>-->
<li>Edit the top-level Makefile:
<ul>
- <li>Set <tt>DATASOURCE</tt> to your <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI data source</a>, for example, <tt>DBI:Pg:dbname=freeside</tt> for PostgresSQL<!-- or <tt>DBI:mysql:freeside</tt> for MySQL-->. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">manpage for your DBD</a> for the exact syntax of your DBI data source.
+ <li>Set <tt>DATASOURCE</tt> to your <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI data source</a>, for example, <tt>DBI:Pg:host=localhost;dbname=freeside</tt> for PostgresSQL<!-- or <tt>DBI:mysql:freeside</tt> for MySQL-->. See the <a href="http://search.cpan.org/doc/TIMB/DBI-1.28/DBI.pm">DBI manpage</a> and the <a href="http://search.cpan.org/search?mode=module&query=DBD%3A%3A">manpage for your DBD</a> for the exact syntax of your DBI data source.
<li>Set <tt>DB_PASSWORD</tt> to the freeside database user's password.
</ul>
<li>Add the freeside database to your database engine:
@@ -170,6 +168,7 @@ require&nbsp;"/usr/local/apache/conf/handler.pl";
<li>Restrict access to this web interface - see the <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache documentation on user authentication</a>. For example, to configure user authentication with <a href="http://httpd.apache.org/docs/mod/mod_auth.html">mod_auth</a> (flat files):
<pre>
&lt;Directory /usr/local/apache/htdocs/freeside-asp&gt;
+PerlSetVar Global /usr/local/etc/freeside/asp-global/
AuthName Freeside
AuthType Basic
AuthUserFile /usr/local/etc/freeside/htpasswd
@@ -186,16 +185,16 @@ $ <a href="man/bin/freeside-adduser.html">freeside-adduser</a> -c -h /usr/local/
$ <a href="man/bin/freeside-adduser.html">freeside-adduser</a> -h /usr/local/etc/freeside/htpasswd <i>username</i></pre></font>
</ul>
<i>(using other auth types, add each user to your <a href="http://httpd.apache.org/docs/misc/FAQ.html#user-authentication">Apache authentication</a> and then run: <tt>freeside-adduser <b>username</b></tt></i>
- <li>As the freeside UNIX user, run <tt>freeside-setup <b>username</b></tt> to create the database tables, passing the username of a Freeside user you created above:
+ <li>As the freeside UNIX user, run <tt>bin/fs-setup <b>username</b></tt> (in the untar'ed freeside directory) to create the database tables, passing the username of a Freeside user you created above:
<pre>
$ su freeside
-$ freeside-setup <b>username</b>
+$ cd <b>/path/to/freeside/</b>
+$ bin/fs-setup <b>username</b>
</pre>
- Alternately, use the -s option to enable shipping addresses: <tt>freeside-setup -s <b>username</b></tt>
<li>As the freeside UNIX user, run <tt>bin/populate-msgcat <b>username</b></tt> (in the untar'ed freeside directory) to populate the message catalog, passing the username of a Freeside user you created above:
<pre>
$ su freeside
-$ cd <b>/path/to/freeside/</b>
+$ cd <b>/path/to/freeside-1.4.0/</b>
$ bin/populate-msgcat <b>username</b>
</pre>
<li><tt>freeside-queued</tt> was installed with the Perl modules. Start it now and ensure that is run upon system startup (Do this manually, or edit the top-level Makefile, replacing INIT_FILE with the appropriate location on your systemand QUEUED_USER with the username of a Freeside user you created above, and run <tt>make install-init</tt>)
diff --git a/httemplate/docs/legacy.html b/httemplate/docs/legacy.html
index 678780962..2db9edb0f 100755
--- a/httemplate/docs/legacy.html
+++ b/httemplate/docs/legacy.html
@@ -17,12 +17,11 @@
<li>POP mail accounts have entries in passwd only, and have a particular shell.
<li>Everything else in passwd is a shell account.
</ul>
-<!-- <li><a name="svc_acct_sm">bin/svc_acct_sm.import</a> - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need <a href="../browse/part_svc.cgi">services</a> as follows:
+ <li><a name="svc_acct_sm">bin/svc_acct_sm.import</a> - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need <a href="../browse/part_svc.cgi">services</a> as follows:
<ul>
<li>Domain (table svc_acct)
<li>Mail alias (table svc_acct_sm)
</ul>
--->
<li><a name="cust_main">Importing customer data</a>
<ul>
<li>Manually
diff --git a/httemplate/docs/schema.dia b/httemplate/docs/schema.dia
index 746561550..092d2f88b 100644
--- a/httemplate/docs/schema.dia
+++ b/httemplate/docs/schema.dia
Binary files differ
diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html
index 593ea82a0..cec122f44 100644
--- a/httemplate/docs/schema.html
+++ b/httemplate/docs/schema.html
@@ -57,14 +57,6 @@
<li>recur - recurring fee
<li>sdate - starting date
<li>edate - ending date
- <li>itemdesc - Line item description (currently used only when pkgnum is 0)
- </ul>
- <li><a name="cust_bill_pkg_detail" href="man/FS/cust_bill_pkg_detail.html">cust_bill_pkg_detail</a> - Invoice line items detail
- <ul>
- <li>detailnum - primary key
- <li>pkgnum -
- <li>invnum -
- <li>detail - Detail description
</ul>
<li><a name="cust_credit" href="man/FS/cust_credit.html">cust_credit</a> - Credits. The equivalent of a negative <a href="#cust_bill">cust_bill</a> record.
<ul>
@@ -141,7 +133,6 @@
<li>tax - % rate
<li>taxclass
<li>exempt_amount
- <li>taxname - if defined, printed on invoices instead of "Tax"
</ul>
<li><a name="cust_tax_exempt" href="man/FS/cust_tax_exempt.html">cust_tax_exempt</a> - Tax exemption record
<ul>
@@ -195,7 +186,6 @@
<li>pkgpart - <a href="#part_pkg">Package definition</a>
<li>setup - date
<li>bill - next bill date
- <li>last_bill - last bill date
<li>susp - (past) suspension date
<li>expire - (future) cancellation date
<li>cancel - (past) cancellation date
@@ -258,7 +248,7 @@
<ul>
<li>svcpart - primary key
<li>svc - name of this service
- <li>svcdb - table used for this service: svc_acct, svc_forward, svc_domain, svc_charge or svc_wo
+ <li>svcdb - table used for this service: svc_acct, svc_acct_sm, svc_forward, svc_domain, svc_charge or svc_wo
<li>disabled - Disabled flag, empty or `Y'
<!-- <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
<li><i>table</i>__<i>field</i>_flag - null, D or F
@@ -357,6 +347,13 @@
<li>npa - area code
<li>nxx - exchange
</ul>
+ <li><a name="svc_acct_sm" href="man/FS/svc_acct_sm.html">svc_acct_sm</a> - <b>DEPRECIATED</b> Domain mail aliases
+ <ul>
+ <li>svcnum - <a href="#cust_svc">primary key</a>
+ <li>domsvc - <a href="#svc_domain">Domain</a> (by svcnum)
+ <li>domuid - <a href="#svc_acct">Account</a> (by uid)
+ <li>domuser - domuser @ <a href="#svc_domain">Domain</a> forwards to <a href="#svc_acct">Account</a>
+ </ul>
<li><a name="svc_domain" href="man/FS/svc_domain.html">svc_domain</a> - Domains
<ul>
<li>svcnum - <a href="#cust_svc">primary key</a>
diff --git a/httemplate/docs/session.html b/httemplate/docs/session.html
index 72e16424e..7dac5fdf7 100644
--- a/httemplate/docs/session.html
+++ b/httemplate/docs/session.html
@@ -38,14 +38,9 @@ freeside-logout username ( portnum | ip | nasnum nasport )</pre>
<li><i>username</i> is a customer username from the svc_acct table
<li><i>portnum</i>, <i>ip</i> or <i>nasport</i> and <i>nasnum</i> uniquely identify a port in the <a href="schema.html#port">port</a> database table.
</ul>
- <li>RADIUS - One of:
+ <li>RADIUS
<ul>
- <li>Run the <b>freeside-sqlradius-radacctd</b> daemon to import radacct
- records from all configured sqlradius exports:
- <tt>freeside-sqlradius-radacctd username</tt>
<li>Configure your RADIUS server's login and logout callbacks to use the command-line <tt>freeside-login</tt> and <tt>freeside-logout</tt> utilites.
- <li> <i>(incomplete)</i>Use the <b>fs_radlog/fs_radlogd</b> tool to
- import records from a text radacct file.
</ul>
</ul>
<h2>Callbacks</h2>
diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html
deleted file mode 100644
index 7aa26f698..000000000
--- a/httemplate/docs/upgrade10.html
+++ /dev/null
@@ -1,11 +0,0 @@
-this is very incomplete
-
-CREATE TABLE cust_bill_pkg_detail (
- detailnum serial,
- pkgnum int NOT NULL,
- invnum int NOT NULL,
- detail varchar(80),
- PRIMARY KEY (detailnum)
-);
-CREATE INDEX cust_bill_pkg_detail1 ON cust_bill_pkg_detail ( pkgnum, invnum );
-
diff --git a/httemplate/docs/upgrade4.html b/httemplate/docs/upgrade4.html
new file mode 100644
index 000000000..1d70f8b73
--- /dev/null
+++ b/httemplate/docs/upgrade4.html
@@ -0,0 +1,27 @@
+<head>
+ <title>Upgrading to 1.2.2</title>
+</head>
+<body>
+<h1>Upgrading to 1.2.2 from 1.2.x</h1>
+<ul>
+ <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
+ <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first.
+ <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first.
+ <li>Back up your data and current Freeside installation.
+ <li>Install the Perl modules <a href="http://www.perl.com/CPAN/modules/by-module/Locale/">Locale-Codes</a> and <a href="http://www.perl.com/CPAN/modules/by-module/Net/">Net-Whois</a>.
+ <li>Apply the following changes to your database:
+<pre>
+ALTER TABLE cust_pay_batch CHANGE exp exp VARCHAR(11);
+</pre>
+ <li>Copy or symlink htdocs to the new copy.
+ <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS.
+ <li>Change to the FS directory in the new tarball, and build and install the
+ Perl modules:
+ <pre>
+$ cd FS/
+$ perl Makefile.PL
+$ make
+$ su
+# make install</pre>
+ <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly.
+</body>
diff --git a/httemplate/docs/upgrade5.html b/httemplate/docs/upgrade5.html
new file mode 100644
index 000000000..3f3431653
--- /dev/null
+++ b/httemplate/docs/upgrade5.html
@@ -0,0 +1,34 @@
+<head>
+ <title>Upgrading to 1.3.0</title>
+</head>
+<body>
+<h1>Upgrading to 1.2.3 from 1.2.2</h1>
+<ul>
+ <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
+ <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first.
+ <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first.
+ <li>If migrating from less than 1.2.2, see these <a href="upgrade4.html">instructions</a> first.
+ <li>Back up your data and current Freeside installation.
+ <li>Apply the following changes to your database:
+<pre>
+ALTER TABLE svc_acct_pop ADD loc CHAR(4);
+CREATE TABLE prepay_credit (
+ prepaynum int NOT NULL,
+ identifier varchar(80) NOT NULL,
+ amount decimal(10,2) NOT NULL,
+ PRIMARY KEY (prepaynum),
+ INDEX (identifier)
+);
+</pre>
+ <li>Copy or symlink htdocs to the new copy.
+ <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS.
+ <li>Change to the FS directory in the new tarball, and build and install the
+ Perl modules:
+ <pre>
+$ cd FS/
+$ perl Makefile.PL
+$ make
+$ su
+# make install</pre>
+ <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly.
+</body>
diff --git a/httemplate/docs/upgrade6.html b/httemplate/docs/upgrade6.html
new file mode 100644
index 000000000..dc82975f3
--- /dev/null
+++ b/httemplate/docs/upgrade6.html
@@ -0,0 +1,66 @@
+<head>
+ <title>Upgrading to 1.3.0</title>
+</head>
+<body>
+<h1>Upgrading to 1.3.0 from 1.2.3</h1>
+<ul>
+ <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
+ <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first.
+ <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first.
+ <li>If migrating from less than 1.2.2, see these <a href="upgrade4.html">instructions</a> first.
+ <li>If migrating from less than 1.2.3, see these <a href="upgrade5.html">instructions</a> first.
+ <li>Back up your data and current Freeside installation.
+ <li>As 1.3.0 requires transactions, <b>MySQL's default <a href="http://www.mysql.com/doc/M/y/MyISAM.html">MyISAM</a> and <a href="http://www.mysql.com/doc/I/S/ISAM.html">ISAM</a> table types are no longer supported</b>. Converting to <a href="http://www.postgresql.org/">PostgreSQL</a> is recommended. If you really want to use MySQL, convert your tables to one of the <a href="http://www.mysql.com/doc/T/a/Table_types.html">transaction-safe table types</a> such as <a href="http://www.mysql.com/doc/B/D/BDB.html">BDB</a>.
+ <li>Copy the <i>invoice_template</i> file from the <i>conf/</i> directory in the distribution to your <a href="config.html">configuration directory</a>.
+ <li>Install the <a href="http://search.cpan.org/search?dist=Text-Template">Text-Template</a>, <a href="http://search.cpan.org/search?dist=DBIx-DBSchema">DBIx-DBSchema</a>, <a href="http://search.cpan.org/search?dist=Net-SSH">Net-SSH</a>, <a href="http://search.cpan.org/search?dist=String-ShellQuote">String-ShellQuote</a> and <a href="http://search.cpan.org/search?dist=Net-SCP">Net-SCP</a> Perl modules.
+ <li>Apply the following changes to your database:
+<pre>
+CREATE TABLE domain_record (
+ recnum int NOT NULL,
+ svcnum int NOT NULL,
+ reczone varchar(80) NOT NULL,
+ recaf char(2) NOT NULL,
+ rectype char(5) NOT NULL,
+ recdata varchar(80) NOT NULL,
+ PRIMARY KEY (recnum)
+);
+CREATE TABLE svc_www (
+ svcnum int NOT NULL,
+ recnum int NOT NULL,
+ usersvc int NOT NULL,
+ PRIMARY KEY (svcnum)
+);
+ALTER TABLE part_svc ADD svc_www__recnum varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_www__recnum_flag char(1) NULL;
+ALTER TABLE part_svc ADD svc_www__usersvc varchar(80) NULL;
+ALTER TABLE part_svc ADD svc_www__uesrsvc_flag char(1) NULL;
+ALTER TABLE svc_acct CHANGE _password _password varchar(50) NULL;
+ALTER TABLE svc_acct ADD seconds integer NULL;
+ALTER TABLE part_svc ADD svc_acct__seconds integer NULL;
+ALTER TABLE part_svc ADD svc_acct__seconds_flag char(1) NULL;
+ALTER TABLE prepay_credit ADD seconds integer NULL;
+
+</pre>
+ <li>If your database supports dropping columns:
+<pre>
+ALTER TABLE cust_bill DROP owed;
+ALTER TABLE cust_credit DROP credited;
+</pre>
+ Or, if your database does not support dropping columns, you can do this:
+<pre>
+ALTER TABLE cust_bill CHANGE owed depriciated decimal(10,2);
+ALTER TABLE cust_credit CHANGE credited depriciated2 decimal(10,2);
+</pre>
+
+ <li>Copy or symlink htdocs to the new copy.
+ <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS.
+ <li>Change to the FS directory in the new tarball, and build and install the
+ Perl modules:
+ <pre>
+$ cd FS/
+$ perl Makefile.PL
+$ make
+$ su
+# make install</pre>
+ <li>Run bin/dbdef-create.
+</body>
diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi
index e44acba3c..d9f122f0c 100755
--- a/httemplate/edit/REAL_cust_pkg.cgi
+++ b/httemplate/edit/REAL_cust_pkg.cgi
@@ -1,6 +1,6 @@
<!-- mason kludge -->
<%
-# <!-- $Id: REAL_cust_pkg.cgi,v 1.5 2003-04-01 01:22:24 ivan Exp $ -->
+# <!-- $Id: REAL_cust_pkg.cgi,v 1.4.4.1 2003-04-01 01:22:31 ivan Exp $ -->
my $error ='';
my $pkgnum = '';
diff --git a/httemplate/edit/cust_main_county.cgi b/httemplate/edit/cust_main_county.cgi
index f3d28825a..7ef37a48d 100755
--- a/httemplate/edit/cust_main_county.cgi
+++ b/httemplate/edit/cust_main_county.cgi
@@ -15,8 +15,7 @@ print qq!<FORM ACTION="!, popurl(1),
<TH><FONT SIZE=-1>Country</FONT></TH>
<TH><FONT SIZE=-1>State</FONT></TH>
<TH><FONT SIZE=-1>County</FONT></TH>
- <TH><FONT SIZE=-1>Taxclass</FONT><BR><FONT SIZE=-2>(per-package classification)</FONT></TH>
- <TH><FONT SIZE=-1>Tax name</FONT><BR><FONT SIZE=-2>(printed on invoices)</FONT></TH>
+ <TH><FONT SIZE=-1>Taxclass</FONT></TH>
<TH><FONT SIZE=-1>Tax</FONT></TH>
<TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH>
</TR>
@@ -47,8 +46,6 @@ END
: ' BGCOLOR="#cccccc">(ALL)'
, "</TD>";
- print qq!<TD><INPUT TYPE="text" NAME="taxname!, $hashref->{taxnum},
- qq!" VALUE="!, $hashref->{taxname}, qq!"></TD>!;
print qq!<TD><INPUT TYPE="text" NAME="tax!, $hashref->{taxnum},
qq!" VALUE="!, $hashref->{tax}, qq!" SIZE=6 MAXLENGTH=6>%</TD>!;
print qq!<TD>\$<INPUT TYPE="text" NAME="exempt_amount!, $hashref->{taxnum},
diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi
index 2104b4530..bd3288982 100755
--- a/httemplate/edit/part_bill_event.cgi
+++ b/httemplate/edit/part_bill_event.cgi
@@ -114,6 +114,12 @@ tie my %events, 'Tie::IxHash',
'weight' => 30,
},
+ 'realtime-card-cybercash' => {
+ 'name' => '(<b>deprecated</b>) Run card with <a href="http://www.cybercash.com/cashregister">CyberCash CashRegister</a> realtime gateway',
+ 'code' => '$cust_bill->realtime_card_cybercash();',
+ 'weight' => 30,
+ },
+
'realtime-lec' => {
'name' => 'Run phone bill ("LEC") billing with a <a href="http://search.cpan.org/search?mode=module&query=Business%3A%3AOnlinePayment">Business::OnlinePayment</a> realtime gateway',
'code' => '$cust_bill->realtime_lec();',
diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi
index dee356250..f5b33f255 100755
--- a/httemplate/edit/part_pkg.cgi
+++ b/httemplate/edit/part_pkg.cgi
@@ -396,7 +396,7 @@ tie my %plans, 'Tie::IxHash',
},
'fieldorder' => [qw( setup_fee recur_flat recur_included_hours recur_hourly_charge recur_included_input recur_input_charge recur_included_output recur_output_charge recur_included_total recur_total_charge )],
'setup' => 'what.setup_fee.value',
- 'recur' => '\'my $last_bill = $cust_pkg->last_bill; my $hours = $cust_pkg->seconds_since_sqlradacct($last_bill, $sdate ) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; my $input = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctInputOctets\" ) / 1048576; my $output = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctOutputOctets\" ) / 1048576; my $total = $input + $output - \' + what.recur_included_total.value + \'; $total = 0 if $total < 0; my $input = $input - \' + what.recur_included_input.value + \'; $input = 0 if $input < 0; my $output = $output - \' + what.recur_included_output.value + \'; $output = 0 if $output < 0; my $totalcharge = sprintf(\"%.2f\", \' + what.recur_total_charge.value + \' * $total); my $hourscharge = sprintf(\"%.2f\", \' + what.recur_hourly_charge.value + \' * $hours); push @details, \"Last month\\\'s excess data \". sprintf(\"%.1f\", $total). \" megs: \\\$$totalcharge\", \"Last month\\\'s excess time \". sprintf(\"%.1f\", $hours). \" hours: \\\$$hourscharge\"; \' + what.recur_flat.value + \' + $hourscharge + \' + what.recur_input_charge.value + \' * $input + \' + what.recur_output_charge.value + \' * $output + $totalcharge ;\'',
+ 'recur' => '\'my $last_bill = $cust_pkg->last_bill; my $hours = $cust_pkg->seconds_since_sqlradacct($last_bill, $sdate ) / 3600 - \' + what.recur_included_hours.value + \'; $hours = 0 if $hours < 0; my $input = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctInputOctets\" ) / 1048576; my $output = $cust_pkg->attribute_since_sqlradacct($last_bill, $sdate, \"AcctOutputOctets\" ) / 1048576; my $total = $input + $output - \' + what.recur_included_total.value + \'; $total = 0 if $total < 0; my $input = $input - \' + what.recur_included_input.value + \'; $input = 0 if $input < 0; my $output = $output - \' + what.recur_included_output.value + \'; $output = 0 if $output < 0; \' + what.recur_flat.value + \' + \' + what.recur_hourly_charge.value + \' * $hours + \' + what.recur_input_charge.value + \' * $input + \' + what.recur_output_charge.value + \' * $output + \' + what.recur_total_charge.value + \' * $total ;\'',
},
;
diff --git a/httemplate/edit/part_router_field.cgi b/httemplate/edit/part_router_field.cgi
deleted file mode 100644
index c3e99be2c..000000000
--- a/httemplate/edit/part_router_field.cgi
+++ /dev/null
@@ -1,70 +0,0 @@
-<!-- mason kludge -->
-<%
-my ($routerfieldpart, $part_router_field);
-
-if ( $cgi->param('error') ) {
- $part_router_field = new FS::part_router_field ( {
- map { $_, scalar($cgi->param($_)) } fields('part_router_field')});
- $routerfieldpart = $part_router_field->routerfieldpart;
-} else {
- my($query) = $cgi->keywords;
- if ( $query =~ /^(\d+)$/ ) { #editing
- $routerfieldpart=$1;
- $part_router_field=qsearchs('part_router_field',
- {'routerfieldpart' => $routerfieldpart})
- or die "Unknown routerfieldpart!";
-
- } else { #adding
- $part_router_field = new FS::part_router_field({});
- }
-}
-my $action = $part_router_field->routerfieldpart ? 'Edit' : 'Add';
-
-my $p1 = popurl(1);
-print header("$action Router Extended Field Definition", '');
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-%>
-<FORM ACTION="<%=$p1%>process/generic.cgi" METHOD=POST>
-
-<INPUT TYPE="hidden" NAME="table" VALUE="part_router_field">
-<INPUT TYPE="hidden" NAME="redirect_ok"
- VALUE="<%=$p1%>part_router_field.cgi">
-<INPUT TYPE="hidden" NAME="routerfieldpart" VALUE="<%=
- $routerfieldpart%>">
-Field #<B><%=$routerfieldpart or "(NEW)"%></B><BR><BR>
-
-<%=ntable("#cccccc",2)%>
- <TR>
- <TD ALIGN="right">Name</TD>
- <TD><INPUT TYPE="text" NAME="name" MAXLENGTH=15 VALUE="<%=
- $part_router_field->name%>"></TD>
- </TR>
- <TR>
- <TD ALIGN="right">Length</TD>
- <TD><INPUT TYPE="text" NAME="length" MAXLENGTH=4 VALUE="<%=
- $part_router_field->length%>"></TD>
- </TR>
- <TR>
- <TD ALIGN="right">check_block</TD>
- <TD><TEXTAREA COLS="20" ROWS="4" NAME="check_block"><%=
- $part_router_field->check_block%></TEXTAREA></TD>
- </TR>
- <TR>
- <TD ALIGN="right">list_source</TD>
- <TD><TEXTAREA COLS="20" ROWS="4" NAME="list_source"><%=
- $part_router_field->list_source%></TEXTAREA></TD>
- </TR>
-</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">
-
-</FORM>
-
-<BR><BR>
-<FONT SIZE=-2>If you don't understand what <I>check_block</I> and
-<I>list_source</I> mean, <B>LEAVE THEM BLANK</B>. We mean it.</FONT>
-
-
-</BODY>
-</HTML>
diff --git a/httemplate/edit/part_sb_field.cgi b/httemplate/edit/part_sb_field.cgi
deleted file mode 100644
index 9e0cc9e4f..000000000
--- a/httemplate/edit/part_sb_field.cgi
+++ /dev/null
@@ -1,79 +0,0 @@
-<!-- mason kludge -->
-<%
-my ($sbfieldpart, $part_sb_field);
-
-if ( $cgi->param('error') ) {
- $part_sb_field = new FS::part_sb_field ( {
- map { $_, scalar($cgi->param($_)) } fields('part_sb_field')});
- $sbfieldpart = $part_sb_field->sbfieldpart;
-} else {
- my($query) = $cgi->keywords;
- if ( $query =~ /^(\d+)$/ ) { #editing
- $sbfieldpart=$1;
- $part_sb_field=qsearchs('part_sb_field',
- {'sbfieldpart' => $sbfieldpart})
- or die "Unknown sbfieldpart!";
-
- } else { #adding
- $part_sb_field = new FS::part_sb_field({});
- }
-}
-my $action = $part_sb_field->sbfieldpart ? 'Edit' : 'Add';
-
-my $p1 = popurl(1);
-print header("$action svc_broadband Extended Field Definition", '');
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-%>
-<FORM ACTION="<%=$p1%>process/generic.cgi" METHOD="POST">
-
-<INPUT TYPE="hidden" NAME="table" VALUE="part_sb_field">
-<INPUT TYPE="hidden" NAME="redirect_ok"
- VALUE="<%=popurl(2)%>browse/part_sb_field.cgi">
-<INPUT TYPE="hidden" NAME="sbfieldpart" VALUE="<%=
- $sbfieldpart%>">
-Field #<B><%=$sbfieldpart or "(NEW)"%></B><BR><BR>
-
-<%=ntable("#cccccc",2)%>
- <TR>
- <TD ALIGN="right">Name</TD>
- <TD><INPUT TYPE="text" NAME="name" MAXLENGTH=15 VALUE="<%=
- $part_sb_field->name%>"></TD>
- </TR>
- <TR>
- <TD ALIGN="right">Length</TD>
- <TD><INPUT TYPE="text" NAME="length" MAXLENGTH=4 VALUE="<%=
- $part_sb_field->length%>"></TD>
- </TR>
- <TR>
- <TD ALIGN="right">Service</TD>
- <TD><SELECT SIZE=1 NAME="svcpart"><%
- foreach my $part_svc (qsearch('part_svc', {svcdb => 'svc_broadband'})) {
- %><OPTION VALUE="<%=$part_svc->svcpart%>"<%=
- ($part_svc->svcpart == $part_sb_field->svcpart) ? ' SELECTED' : ''%>">
- <%=$part_svc->svc%>
- <% } %>
- </SELECT></TD>
- <TR>
- <TD ALIGN="right">check_block</TD>
- <TD><TEXTAREA COLS="20" ROWS="4" NAME="check_block"><%=
- $part_sb_field->check_block%></TEXTAREA></TD>
- </TR>
- <TR>
- <TD ALIGN="right">list_source</TD>
- <TD><TEXTAREA COLS="20" ROWS="4" NAME="list_source"><%=
- $part_sb_field->list_source%></TEXTAREA></TD>
- </TR>
-</TABLE><BR><INPUT TYPE="submit" VALUE="Submit">
-
-</FORM>
-
-<BR><BR>
-<FONT SIZE=-2>If you don't understand what <I>check_block</I> and
-<I>list_source</I> mean, <B>LEAVE THEM BLANK</B>. We mean it.</FONT>
-
-
-</BODY>
-</HTML>
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi
index d4bb4704c..683bf9ec5 100755
--- a/httemplate/edit/part_svc.cgi
+++ b/httemplate/edit/part_svc.cgi
@@ -50,9 +50,9 @@ Disable new orders <INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<%= $hashref-
Services are items you offer to your customers.
<UL><LI>svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
<LI>svc_domain - Domains
+ <LI>svc_acct_sm - <B>deprecated</B> (use svc_forward for new installations) Virtual domain mail aliasing.
<LI>svc_forward - mail forwarding
<LI>svc_www - Virtual domain website
- <LI>svc_broadband - Broadband/High-speed Internet service
<!-- <LI>svc_charge - One-time charges (Partially unimplemented)
<LI>svc_wo - Work orders (Partially unimplemented)
-->
@@ -104,6 +104,11 @@ my %defs = (
'svc_domain' => {
'domain' => 'Domain',
},
+ 'svc_acct_sm' => {
+ 'domuser' => 'domuser@virtualdomain.com',
+ 'domuid' => 'UID where domuser@virtualdomain.com mail is forwarded',
+ 'domsvc' => 'svcnum from svc_domain for virtualdomain.com',
+ },
'svc_forward' => {
'srcsvc' => 'service from which mail is to be forwarded',
'dstsvc' => 'service to which mail is to be forwarded',
@@ -120,21 +125,11 @@ my %defs = (
#'recnum' => '',
#'usersvc' => '',
},
- 'svc_broadband' => {
- 'actypenum' => 'This is the actypenum that refers to the type of AC that can be provisioned for this service. This field must be set fixed.',
- 'speed_down' => 'Maximum download speed for this service in Kbps. 0 denotes unlimited.',
- 'speed_up' => 'Maximum upload speed for this service in Kbps. 0 denotes unlimited.',
- 'acnum' => 'acnum of a specific AC that this service is restricted to. Not required',
- 'ip_addr' => 'IP address. Leave blank for automatic assignment.',
- 'ip_netmask' => 'Mask length, aka. netmask bits. (Eg. 255.255.255.0 == 24)',
- 'mac_addr' => 'MAC address which is used by some ACs for access control. Specified by 6 colon seperated hex octets. (Eg. 00:00:0a:bc:1a:2b)',
- 'location' => 'Defines the physically location at which this service was installed. This is not necessarily the billing address',
- },
);
my @dbs = $hashref->{svcdb}
? ( $hashref->{svcdb} )
- : qw( svc_acct svc_domain svc_forward svc_www svc_broadband );
+ : qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www );
tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs;
my $widget = new HTML::Widgets::SelectLayers(
diff --git a/httemplate/edit/process/addr_block/add.cgi b/httemplate/edit/process/addr_block/add.cgi
deleted file mode 100755
index 34d799ccd..000000000
--- a/httemplate/edit/process/addr_block/add.cgi
+++ /dev/null
@@ -1,20 +0,0 @@
-<%
-
-my $error = '';
-my $ip_gateway = $cgi->param('ip_gateway');
-my $ip_netmask = $cgi->param('ip_netmask');
-
-my $new = new FS::addr_block {
- ip_gateway => $ip_gateway,
- ip_netmask => $ip_netmask,
- routernum => 0 };
-
-$error = $new->insert;
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
-}
-%>
diff --git a/httemplate/edit/process/addr_block/allocate.cgi b/httemplate/edit/process/addr_block/allocate.cgi
deleted file mode 100755
index 85b0d7a7a..000000000
--- a/httemplate/edit/process/addr_block/allocate.cgi
+++ /dev/null
@@ -1,25 +0,0 @@
-<%
-my $error = '';
-my $blocknum = $cgi->param('blocknum');
-my $routernum = $cgi->param('routernum');
-
-my $addr_block = qsearchs('addr_block', { blocknum => $blocknum });
-my $router = qsearchs('router', { routernum => $routernum });
-
-if($addr_block) {
- if ($router) {
- $error = $addr_block->allocate($router);
- } else {
- $error = "Cannot find router with routernum $routernum";
- }
-} else {
- $error = "Cannot find block with blocknum $blocknum";
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi?" . $cgi->query_string);
-} else {
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
-}
-%>
diff --git a/httemplate/edit/process/addr_block/deallocate.cgi b/httemplate/edit/process/addr_block/deallocate.cgi
deleted file mode 100755
index cfb7ed04d..000000000
--- a/httemplate/edit/process/addr_block/deallocate.cgi
+++ /dev/null
@@ -1,24 +0,0 @@
-<%
-my $error = '';
-my $blocknum = $cgi->param('blocknum');
-
-my $addr_block = qsearchs('addr_block', { blocknum => $blocknum });
-
-if($addr_block) {
- my $router = $addr_block->router;
- if ($router) {
- $error = $addr_block->deallocate($router);
- } else {
- $error = "Block is not allocated to a router";
- }
-} else {
- $error = "Cannot find block with blocknum $blocknum";
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi?" . $cgi->query_string);
-} else {
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
-}
-%>
diff --git a/httemplate/edit/process/addr_block/split.cgi b/httemplate/edit/process/addr_block/split.cgi
deleted file mode 100755
index bb6d4ba3e..000000000
--- a/httemplate/edit/process/addr_block/split.cgi
+++ /dev/null
@@ -1,19 +0,0 @@
-<%
-my $error = '';
-my $blocknum = $cgi->param('blocknum');
-my $addr_block = qsearchs('addr_block', { blocknum => $blocknum });
-
-if ( $addr_block) {
- $error = $addr_block->split_block;
-} else {
- $error = "Unknown blocknum: $blocknum";
-}
-
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(4). "browse/addr_block.cgi");
-}
-%>
diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi
index 6d80ad512..990a23919 100755
--- a/httemplate/edit/process/cust_main_county.cgi
+++ b/httemplate/edit/process/cust_main_county.cgi
@@ -2,18 +2,17 @@
foreach ( grep { /^tax\d+$/ } $cgi->param ) {
/^tax(\d+)$/ or die "Illegal form $_!";
- my $taxnum = $1;
- my $old = qsearchs('cust_main_county', { 'taxnum' => $taxnum })
+ my($taxnum)=$1;
+ my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum})
or die "Couldn't find taxnum $taxnum!";
- next unless $old->tax != $cgi->param("tax$taxnum")
- || $old->exempt_amount != $cgi->param("exempt_amount$taxnum")
- || $old->taxname ne $cgi->param("taxname$taxnum");
+ my $exempt_amount = $cgi->param("exempt_amount$taxnum");
+ next unless $old->tax ne $cgi->param("tax$taxnum")
+ || $old->exempt_amount ne $exempt_amount;
my %hash = $old->hash;
$hash{tax} = $cgi->param("tax$taxnum");
- $hash{exempt_amount} = $cgi->param("exempt_amount$taxnum");
- $hash{taxname} = $cgi->param("taxname$taxnum");
- my $new = new FS::cust_main_county \%hash;
- my $error = $new->replace($old);
+ $hash{exempt_amount} = $exempt_amount;
+ my($new)=new FS::cust_main_county \%hash;
+ my($error)=$new->replace($old);
if ( $error ) {
$cgi->param('error', $error);
print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string );
diff --git a/httemplate/edit/process/generic.cgi b/httemplate/edit/process/generic.cgi
deleted file mode 100644
index 751987f7a..000000000
--- a/httemplate/edit/process/generic.cgi
+++ /dev/null
@@ -1,69 +0,0 @@
-<%
-
-# Welcome to generic.cgi.
-#
-# This script provides a generic edit/process/ backend for simple table
-# editing. All it knows how to do is take the values entered into
-# the script and insert them into the table specified by $cgi->param('table').
-# If there's an existing record with the same primary key, it will be
-# replaced. (Deletion will be added in the future.)
-#
-# Special cgi params for this script:
-# table: the name of the table to be edited. The script will die horribly
-# if it can't find the table.
-# redirect_ok: URL to be displayed after a successful edit. The value of
-# the record's primary key will be passed as a keyword.
-# Defaults to (freeside root)/view/$table.cgi.
-# redirect_error: URL to be displayed if there's an error. The original
-# query string, plus the error message, will be passed.
-# Defaults to $cgi->referer() (i.e. go back where you
-# came from).
-
-
-use FS::Record qw(qsearchs dbdef);
-use DBIx::DBSchema;
-use DBIx::DBSchema::Table;
-
-
-my $error;
-my $p2 = popurl(2);
-my $table = $cgi->param('table');
-my $dbdef = dbdef or die "Cannot fetch dbdef!";
-
-my $dbdef_table = $dbdef->table($table) or die "Cannot fetch schema for $table";
-
-my $pkey = $dbdef_table->primary_key or die "Cannot fetch pkey for $table";
-my $pkey_val = $cgi->param($pkey);
-
-
-#warn "new FS::Record ( $table, (hashref) )";
-my $new = FS::Record::new ( "FS::$table", {
- map { $_, scalar($cgi->param($_)) } fields($table)
-} );
-
-#warn 'created $new of class '.ref($new);
-
-if($pkey_val and (my $old = qsearchs($table, { $pkey, $pkey_val} ))) {
- # edit
- $error = $new->replace($old);
-} else {
- #add
- $error = $new->insert;
- $pkey_val = $new->getfield($pkey);
- # New records usually don't have their primary keys set until after
- # they've been checked/inserted, so grab the new $pkey_val so we can
- # redirect to it.
-}
-
-my $redirect_ok = (($cgi->param('redirect_ok')) ?
- $cgi->param('redirect_ok') : $p2."view/$table.cgi");
-my $redirect_error = (($cgi->param('redirect_error')) ?
- $cgi->param('redirect_error') : $cgi->referer());
-
-if($error) {
- $cgi->param('error', $error);
- print $cgi->redirect($redirect_error . '?' . $cgi->query_string);
-} else {
- print $cgi->redirect($redirect_ok . '?' .$pkey_val);
-}
-%>
diff --git a/httemplate/edit/process/part_svc.cgi b/httemplate/edit/process/part_svc.cgi
index 9633fabdf..859670b17 100755
--- a/httemplate/edit/process/part_svc.cgi
+++ b/httemplate/edit/process/part_svc.cgi
@@ -17,7 +17,7 @@ my $new = new FS::part_svc ( {
push @fields, 'usergroup' if $svcdb eq 'svc_acct'; #kludge
map { ( $svcdb.'__'.$_, $svcdb.'__'.$_.'_flag' ) } @fields;
} grep defined( $FS::Record::dbdef->table($_) ),
- qw( svc_acct svc_domain svc_forward svc_www svc_broadband )
+ qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www )
)
} );
diff --git a/httemplate/edit/process/router.cgi b/httemplate/edit/process/router.cgi
deleted file mode 100644
index c0cb884f0..000000000
--- a/httemplate/edit/process/router.cgi
+++ /dev/null
@@ -1,100 +0,0 @@
-<%
-
-use FS::UID qw(dbh);
-
-my $dbh = dbh;
-local $FS::UID::AutoCommit=0;
-
-sub check {
- my $error = shift;
- if($error) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(3) . "edit/router.cgi?". $cgi->query_string);
- $dbh->rollback;
- exit;
- }
-}
-
-my $error = '';
-my $routernum = $cgi->param('routernum');
-my $routername = $cgi->param('routername');
-my $old = qsearchs('router', { routernum => $routernum });
-my @old_rf;
-my @old_psr;
-
-my $new = new FS::router {
- routernum => $routernum,
- routername => $routername,
- svcnum => 0
- };
-
-if($old) {
- if($old->routername ne $new->routername) {
- $error = $new->replace($old);
- } #else do nothing
-} else {
- $error = $new->insert;
-}
-
-check($error);
-
-if ($old) {
- @old_psr = $old->part_svc_router;
- foreach $psr (@old_psr) {
- if($cgi->param('svcpart_'.$psr->svcpart) eq 'ON') {
- # do nothing
- } else {
- $error = $psr->delete;
- }
- }
- check($error);
- @old_rf = $old->router_field;
- foreach $rf (@old_rf) {
- if(my $new_val = $cgi->param('rf_'.$rf->routerfieldpart)) {
- if($new_val ne $rf->value) {
- my $new_rf = new FS::router_field
- { routernum => $routernum,
- value => $new_val,
- routerfieldpart => $rf->routerfieldpart };
- $error = $new_rf->replace($rf);
- } #else do nothing
- } else {
- $error = $rf->delete;
- }
- check($error);
- }
-}
-
-foreach($cgi->param) {
- if($cgi->param($_) eq 'ON' and /^svcpart_(\d+)$/) {
- my $svcpart = $1;
- if(grep {$_->svcpart == $svcpart} @old_psr) {
- # do nothing
- } else {
- my $new_psr = new FS::part_svc_router { svcpart => $svcpart,
- routernum => $routernum };
- $error = $new_psr->insert;
- }
- check($error);
- } elsif($cgi->param($_) ne '' and /^rf_(\d+)$/) {
- my $part = $1;
- if(my @x = grep {$_->routerfieldpart == $part} @old_rf) {
- # already handled all of these
- } else {
- my $new_rf = new FS::router_field
- { routernum => $routernum,
- value => $cgi->param('rf_'.$part),
- routerfieldpart => $part };
- $error = $new_rf->insert;
- check($error);
- }
- }
-}
-
-
-
-# Yay, everything worked!
-$dbh->commit or die $dbh->errstr;
-print $cgi->redirect(popurl(3). "edit/router.cgi?$routernum");
-
-%>
diff --git a/httemplate/edit/process/svc_acct_sm.cgi b/httemplate/edit/process/svc_acct_sm.cgi
new file mode 100755
index 000000000..41d03fb92
--- /dev/null
+++ b/httemplate/edit/process/svc_acct_sm.cgi
@@ -0,0 +1,34 @@
+<%
+
+$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
+my $svcnum =$1;
+
+my $old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum;
+
+#unmunge domsvc and domuid
+#$cgi->param('domsvc',(split(/:/, $cgi->param('domsvc') ))[0] );
+#$cgi->param('domuid',(split(/:/, $cgi->param('domuid') ))[0] );
+
+my $new = new FS::svc_acct_sm ( {
+ map {
+ ($_, scalar($cgi->param($_)));
+ #} qw(svcnum pkgnum svcpart domuser domuid domsvc)
+ } ( fields('svc_acct_sm'), qw( pkgnum svcpart ) )
+} );
+
+my $error = '';
+if ( $svcnum ) {
+ $error = $new->replace($old);
+} else {
+ $error = $new->insert;
+ $svcnum = $new->getfield('svcnum');
+}
+
+if ($error) {
+ $cgi->param('error', $error);
+ print $cgi->redirect(popurl(2). "svc_acct_sm.cgi?". $cgi->query_string );
+} else {
+ print $cgi->redirect(popurl(3). "view/svc_acct_sm.cgi?$svcnum");
+}
+
+%>
diff --git a/httemplate/edit/process/svc_broadband.cgi b/httemplate/edit/process/svc_broadband.cgi
deleted file mode 100644
index ab8b9f9d8..000000000
--- a/httemplate/edit/process/svc_broadband.cgi
+++ /dev/null
@@ -1,79 +0,0 @@
-<%
-
-# If it's stupid but it works, it's not stupid.
-# -- U.S. Army
-
-local $FS::UID::AutoCommit = 0;
-my $dbh = FS::UID::dbh;
-
-$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
-my $svcnum = $1;
-
-my $old; my @old_sbf;
-if ( $svcnum ) {
- $old = qsearchs('svc_broadband', { 'svcnum' => $svcnum } )
- or die "fatal: can't find broadband service (svcnum $svcnum)!";
- @old_sbf = $old->sb_field;
-} else {
- $old = '';
-}
-
-my $new = new FS::svc_broadband ( {
- map {
- ($_, scalar($cgi->param($_)));
- } ( fields('svc_broadband'), qw( pkgnum svcpart ) )
-} );
-
-my $error;
-if ( $svcnum ) {
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
- $svcnum = $new->svcnum;
-}
-
-unless ($error) {
- my $sb_field;
-
- foreach ($cgi->param) {
- #warn "\$cgi->param $_: " . $cgi->param($_);
- if(/^sbf_(\d+)/) {
- my $part = $1;
- #warn "\$part $part";
- $sb_field = new FS::sb_field
- { svcnum => $svcnum,
- value => $cgi->param($_),
- sbfieldpart => $part };
- if (my @x = grep { $_->sbfieldpart eq $part } @old_sbf) {
- #if (my $old_sb_field = (grep { $_->sbfieldpart eq $part} @old_Sbf)[0]) {
- #warn "array: " . scalar(@x);
- if (length($sb_field->value) && ($sb_field->value ne $x[0]->value)) {
- #warn "replacing " . $x[0]->value . " with " . $sb_field->value;
- $error = $sb_field->replace($x[0]);
- #$error = $sb_field->replace($old_sb_field);
- } elsif (length($sb_field->value) == 0) {
- #warn "delete";
- $error = $x[0]->delete;
- }
- } else {
- if (length($sb_field->value) > 0) {
- #warn "insert";
- $error = $sb_field->insert;
- }
- # else do nothing
- }
- }
- }
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- $cgi->param('ip_addr', $new->ip_addr);
- $dbh->rollback;
- print $cgi->redirect(popurl(2). "svc_broadband.cgi?". $cgi->query_string );
-} else {
- $dbh->commit or die $dbh->errstr;
- print $cgi->redirect(popurl(3). "view/svc_broadband.cgi?" . $svcnum );
-}
-
-%>
diff --git a/httemplate/edit/router.cgi b/httemplate/edit/router.cgi
deleted file mode 100755
index d2279ff00..000000000
--- a/httemplate/edit/router.cgi
+++ /dev/null
@@ -1,88 +0,0 @@
-<HTML><BODY>
-
-<%
-
-my $router;
-if ( $cgi->keywords ) {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $router = qsearchs('router', { routernum => $1 })
- or print $cgi->redirect(popurl(2)."browse/router.cgi") ;
-} else {
- $router = new FS::router ( {
- map { $_, scalar($cgi->param($_)) } fields('router')
- } );
-}
-
-my $routernum = $router->routernum;
-my $action = $routernum ? 'Edit' : 'Add';
-my $hashref = $router->hashref;
-
-print header("$action Router", menubar(
- 'Main Menu' => "$p",
- 'View all routers' => "${p}browse/router.cgi",
-));
-
-if($cgi->param('error')) {
-%> <FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT>
-<% } %>
-
-<FORM ACTION="<%=popurl(1)%>process/router.cgi" METHOD=POST>
- <INPUT TYPE="hidden" NAME="routernum" VALUE="<%=$routernum%>">
- Router #<%=$routernum or "(NEW)"%>
-
-<BR><BR>Name <INPUT TYPE="text" NAME="routername" SIZE=32 VALUE="<%=$hashref->{routername}%>">
-<%=table() %>
-
-<%
-# I know, I know. Massive false laziness with edit/svc_broadband.cgi. But
-# Kristian won't let me generalize the custom field mechanism to every table in
-# the database, so this is what we get. <snarl>
-# -- MW
-
-my @part_router_field = qsearch('part_router_field', { });
-my %rf = map { $_->part_router_field->name, $_->value } $router->router_field;
-foreach (sort { $a->name cmp $b->name } @part_router_field) {
- %>
- <TR>
- <TD ALIGN="right"><%=$_->name%></TD>
- <TD><%
- if(my @opts = $_->list_values) {
- %> <SELECT NAME="rf_<%=$_->routerfieldpart%>" SIZE="1">
- <%
- foreach $opt (@opts) {
- %> <OPTION VALUE="<%=$opt%>"<%=($opt eq $rf{$_->name})
- ? ' SELECTED' : ''%>>
- <%=$opt%>
- </OPTION>
- <% } %>
- </SELECT>
- <% } else { %>
- <INPUT NAME="rf_<%=$_->routerfieldpart%>"
- VALUE="<%=$rf{$_->name}%>"
- <%=$_->length ? 'SIZE="'.$_->length.'"' : ''%>>
- <% } %></TD>
- </TR>
-<% } %>
-</TABLE>
-
-
-
-<BR><BR>Select the service types available on this router<BR>
-<%
-
-foreach my $part_svc ( qsearch('part_svc', { svcdb => 'svc_broadband',
- disabled => '' }) ) {
- %>
- <BR>
- <INPUT TYPE="checkbox" NAME="svcpart_<%=$part_svc->svcpart%>"<%=
- qsearchs('part_svc_router', { svcpart => $part_svc->svcpart,
- routernum => $routernum } ) ? 'CHECKED' : ''%> VALUE="ON">
- <A HREF="<%=${p}%>edit/part_svc.cgi?<%=$part_svc->svcpart%>">
- <%=$part_svc->svcpart%>: <%=$part_svc->svc%></A>
- <% } %>
-
- <BR><BR><INPUT TYPE="submit" VALUE="Apply changes">
- </FORM>
-</BODY></HTML>
-
diff --git a/httemplate/edit/svc_acct_sm.cgi b/httemplate/edit/svc_acct_sm.cgi
new file mode 100755
index 000000000..0fd5f7622
--- /dev/null
+++ b/httemplate/edit/svc_acct_sm.cgi
@@ -0,0 +1,178 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
+
+my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_acct_sm );
+if ( $cgi->param('error') ) {
+ $svc_acct_sm = new FS::svc_acct_sm ( {
+ map { $_, scalar($cgi->param($_)) } fields('svc_acct_sm')
+ } );
+ $svcnum = $svc_acct_sm->svcnum;
+ $pkgnum = $cgi->param('pkgnum');
+ $svcpart = $cgi->param('svcpart');
+ #$part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ #die "No part_svc entry!" unless $part_svc;
+} else {
+ my($query) = $cgi->keywords;
+ if ( $query =~ /^(\d+)$/ ) { #editing
+ $svcnum=$1;
+ $svc_acct_sm=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum})
+ or die "Unknown (svc_acct_sm) svcnum!";
+
+ my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
+ or die "Unknown (cust_svc) svcnum!";
+
+ $pkgnum=$cust_svc->pkgnum;
+ $svcpart=$cust_svc->svcpart;
+
+ #$part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ #die "No part_svc entry!" unless $part_svc;
+
+ } else { #adding
+
+ $svc_acct_sm = new FS::svc_acct_sm({});
+
+ foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
+ $pkgnum=$1 if /^pkgnum(\d+)$/;
+ $svcpart=$1 if /^svcpart(\d+)$/;
+ }
+ my $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
+ die "No part_svc entry!" unless $part_svc;
+
+ $svcnum='';
+
+ #set fixed and default fields from part_svc
+ foreach my $part_svc_column (
+ grep { $_->columnflag } $part_svc->all_part_svc_column
+ ) {
+ $svc_acct_sm->setfield( $part_svc_column->columnname,
+ $part_svc_column->columnvalue,
+ );
+ }
+
+ }
+}
+my $action = $svc_acct_sm->svcnum ? 'Edit' : 'Add';
+
+my %username = ();
+my %domain = ();
+if ($pkgnum) {
+
+ #find all possible uids (and usernames)
+
+ my @u_acct_svcparts = ();
+ foreach my $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
+ push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
+ }
+
+ my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ my($custnum)=$cust_pkg->getfield('custnum');
+ foreach my $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
+ #record(s) in cust_svc ( for this
+ #pkgnum ! )
+ my($i_cust_svc);
+ foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
+ my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
+ $username{$svc_acct->getfield('uid')}=$svc_acct->getfield('username');
+ }
+ }
+ }
+
+ #find all possible domains (and domsvc's)
+
+ my @d_acct_svcparts = ();
+ foreach my $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) {
+ push @d_acct_svcparts,$d_part_svc->getfield('svcpart');
+ }
+
+ foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
+ my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
+ my($acct_svcpart);
+ foreach $acct_svcpart (@d_acct_svcparts) {
+ my($i_cust_svc);
+ foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
+ my($svc_domain)=qsearch('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
+ $domain{$svc_domain->getfield('svcnum')}=$svc_domain->getfield('domain');
+ }
+ }
+ }
+
+} elsif ( $action eq 'Edit' ) {
+
+ my($svc_acct)=qsearchs('svc_acct',{'uid'=>$svc_acct_sm->domuid});
+ $username{$svc_acct_sm->uid} = $svc_acct->username;
+
+ my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svc_acct_sm->domsvc});
+ $domain{$svc_acct_sm->domsvc} = $svc_domain->domain;
+
+} else {
+ die "\$action eq Add, but \$pkgnum is null!\n";
+}
+
+my $p1 = popurl(1);
+print header("Mail Alias $action", '');
+
+print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
+ "</FONT>"
+ if $cgi->param('error');
+
+print qq!<FORM ACTION="${p1}process/svc_acct_sm.cgi" METHOD=POST>!;
+
+#display
+
+ #formatting
+ print "<PRE>";
+
+#svcnum
+print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!;
+print qq!Service #<FONT SIZE=+1><B>!, $svcnum ? $svcnum : " (NEW)", "</B></FONT>";
+
+#pkgnum
+print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
+
+#svcpart
+print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
+
+my($domuser,$domsvc,$domuid)=(
+ $svc_acct_sm->domuser,
+ $svc_acct_sm->domsvc,
+ $svc_acct_sm->domuid,
+);
+
+#domuser
+print qq!\n\nMail to <INPUT TYPE="text" NAME="domuser" VALUE="$domuser"> <I>( * for anything )</I>!;
+
+#domsvc
+print qq! \@ <SELECT NAME="domsvc" SIZE=1>!;
+foreach $_ (keys %domain) {
+ print "<OPTION", $_ eq $domsvc ? " SELECTED" : "",
+ qq! VALUE="$_">$domain{$_}!;
+}
+print "</SELECT>";
+
+#uid
+print qq!\nforwards to <SELECT NAME="domuid" SIZE=1>!;
+foreach $_ (keys %username) {
+ print "<OPTION", ($_ eq $domuid) ? " SELECTED" : "",
+ qq! VALUE="$_">$username{$_}!;
+}
+print "</SELECT>\@$mydomain mailbox.";
+
+ #formatting
+ print "</PRE>\n";
+
+print qq!<CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>!;
+
+print <<END;
+
+ </FORM>
+ </BODY>
+</HTML>
+END
+
+%>
diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi
deleted file mode 100644
index f017d7a6e..000000000
--- a/httemplate/edit/svc_broadband.cgi
+++ /dev/null
@@ -1,184 +0,0 @@
-<!-- mason kludge -->
-<%
-
-# If it's stupid but it works, it's still stupid.
-# -Kristian
-
-
-use HTML::Widgets::SelectLayers;
-use Tie::IxHash;
-
-my( $svcnum, $pkgnum, $svcpart, $part_svc, $svc_broadband );
-if ( $cgi->param('error') ) {
- $svc_broadband = new FS::svc_broadband ( {
- map { $_, scalar($cgi->param($_)) } fields('svc_broadband')
- } );
- $svcnum = $svc_broadband->svcnum;
- $pkgnum = $cgi->param('pkgnum');
- $svcpart = $cgi->param('svcpart');
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-} else {
- my($query) = $cgi->keywords;
- if ( $query =~ /^(\d+)$/ ) { #editing
- $svcnum=$1;
- $svc_broadband=qsearchs('svc_broadband',{'svcnum'=>$svcnum})
- or die "Unknown (svc_broadband) svcnum!";
-
- my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
- or die "Unknown (cust_svc) svcnum!";
-
- $pkgnum=$cust_svc->pkgnum;
- $svcpart=$cust_svc->svcpart;
-
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- } else { #adding
-
- $svc_broadband = new FS::svc_broadband({});
-
- foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
- $pkgnum=$1 if /^pkgnum(\d+)$/;
- $svcpart=$1 if /^svcpart(\d+)$/;
- }
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- $svc_broadband->setfield('svcpart', $svcpart);
-
- $svcnum='';
-
- #set fixed and default fields from part_svc
- foreach my $part_svc_column (
- grep { $_->columnflag } $part_svc->all_part_svc_column
- ) {
- $svc_broadband->setfield( $part_svc_column->columnname,
- $part_svc_column->columnvalue,
- );
- }
-
- }
-}
-my $action = $svc_broadband->svcnum ? 'Edit' : 'Add';
-
-if ($pkgnum) {
-
- #Nothing?
-
-} elsif ( $action eq 'Edit' ) {
-
- #Nothing?
-
-} else {
- die "\$action eq Add, but \$pkgnum is null!\n";
-}
-
-my $p1 = popurl(1);
-
-my ($ip_addr, $speed_up, $speed_down, $blocknum) =
- ($svc_broadband->ip_addr,
- $svc_broadband->speed_up,
- $svc_broadband->speed_down,
- $svc_broadband->blocknum);
-
-%>
-
-<%=header("Broadband Service $action", '')%>
-
-<% if ($cgi->param('error')) { %>
-<FONT SIZE="+1" COLOR="#ff0000">Error: <%=$cgi->param('error')%></FONT><BR>
-<% } %>
-
-Service #<B><%=$svcnum ? $svcnum : "(NEW)"%></B><BR><BR>
-
-<FORM ACTION="<%=${p1}%>process/svc_broadband.cgi" METHOD=POST>
- <INPUT TYPE="hidden" NAME="svcnum" VALUE="<%=$svcnum%>">
- <INPUT TYPE="hidden" NAME="pkgnum" VALUE="<%=$pkgnum%>">
- <INPUT TYPE="hidden" NAME="svcpart" VALUE="<%=$svcpart%>">
- <INPUT TYPE="hidden" NAME="ip_addr" VALUE="<%=$ip_addr%>">
-
- <%=&ntable("#cccccc",2)%>
-
- <TR>
- <TD ALIGN="right">Download speed</TD>
- <TD BGCOLOR="#ffffff">
-<% if ( $part_svc->part_svc_column('speed_down')->columnflag eq 'F' ) { %>
- <INPUT TYPE="hidden" NAME="speed_down" VALUE="<%=$speed_down%>"><%=$speed_down%>Kbps
-<% } else { %>
- <INPUT TYPE="text" NAME="speed_down" SIZE=5 VALUE="<%=$speed_down%>">Kbps
-<% } %>
- </TD>
- </TR>
- <TR>
- <TD ALIGN="right">Upload speed</TD>
- <TD BGCOLOR="#ffffff">
-<% if ( $part_svc->part_svc_column('speed_up')->columnflag eq 'F' ) { %>
- <INPUT TYPE="hidden" NAME="speed_up" VALUE="<%=$speed_up%>"><%=$speed_up%>Kbps
-<% } else { %>
- <INPUT TYPE="text" NAME="speed_up" SIZE=5 VALUE="<%=$speed_up%>">Kbps
-<% } %>
- </TD>
- </TR>
-<% if ($action eq 'Add') { %>
- <TR>
- <TD ALIGN="right">Router/Block</TD>
- <TD BGCOLOR="#ffffff">
- <SELECT NAME="blocknum">
-<%
- foreach my $router ($svc_broadband->allowed_routers) {
- foreach my $addr_block ($router->addr_block) {
-%>
- <OPTION VALUE="<%=$addr_block->blocknum%>"<%=($addr_block->blocknum eq $blocknum) ? ' SELECTED' : ''%>>
- <%=$router->routername%>:<%=$addr_block->ip_gateway%>/<%=$addr_block->ip_netmask%></OPTION>
-<%
- }
- }
-%>
- </SELECT>
- </TD>
- </TR>
-<% } else { %>
-
- <TR>
- <TD ALIGN="right">Router/Block</TD>
- <TD BGCOLOR="#ffffff">
- <%=$svc_broadband->addr_block->router->routername%>:<%=$svc_broadband->addr_block->NetAddr%>
- <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%=$svc_broadband->blocknum%>">
- </TD>
- </TR>
-
-<% } %>
-
-<%
-
- my @part_sb_field = qsearch('part_sb_field', { svcpart => $svcpart });
- my $sbf_hashref = $svc_broadband->sb_field_hashref($svcpart);
- foreach (sort { $a->name cmp $b->name } @part_sb_field) {
- %>
- <TR>
- <TD ALIGN="right"><%=$_->name%></TD>
- <TD><%
- if(my @opts = $_->list_values) {
- %>
- <SELECT NAME="sbf_<%=$_->sbfieldpart%>" SIZE=1> <%
- foreach $opt (@opts) { %>
- <OPTION VALUE="<%=$opt%>"<%=
- ($opt eq $sbf_hashref->{$_->name}) ? ' SELECTED' : ''%>>
- <%=$opt%></OPTION><%
- } %></SELECT>
- <% } else { %>
- <INPUT NAME="sbf_<%=$_->sbfieldpart%>"
- VALUE="<%=$sbf_hashref->{$_->name}%>"
- <%=$_->length ? 'SIZE="'.$_->length.'"' : ''%>>
- <% } %>
- </TD>
- </TR>
-<% } %>
- </TABLE>
- <BR>
- <INPUT TYPE="submit" NAME="submit" VALUE="Submit">
-</FORM>
-</BODY>
-</HTML>
-
diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi
index 0d815b9e5..bc19fe1de 100755
--- a/httemplate/edit/svc_forward.cgi
+++ b/httemplate/edit/svc_forward.cgi
@@ -2,6 +2,7 @@
<%
my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
my($svcnum, $pkgnum, $svcpart, $part_svc, $svc_forward);
if ( $cgi->param('error') ) {
diff --git a/httemplate/graph/money_time-graph.cgi b/httemplate/graph/money_time-graph.cgi
deleted file mode 100755
index 944019a7a..000000000
--- a/httemplate/graph/money_time-graph.cgi
+++ /dev/null
@@ -1,108 +0,0 @@
-<%
-
-#my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-my ($curmon,$curyear) = (localtime(time))[4,5];
-
-#find first month
-my $syear = $cgi->param('syear') || 1899+$curyear;
-my $smonth = $cgi->param('smonth') || $curmon+1;
-
-#find last month
-my $eyear = $cgi->param('eyear') || 1900+$curyear;
-my $emonth = $cgi->param('emonth') || $curmon+1;
-if ( $emonth++>12 ) { $emonth-=12; $eyear++; }
-
-my @labels;
-my %data;
-
-while ( $syear < $eyear || ( $syear == $eyear && $smonth < $emonth ) ) {
- push @labels, "$smonth/$syear";
-
- my $speriod = timelocal(0,0,0,1,$smonth-1,$syear);
- if ( ++$smonth == 13 ) { $syear++; $smonth=1; }
- my $eperiod = timelocal(0,0,0,1,$smonth-1,$syear);
-
- my $where = "WHERE _date >= $speriod AND _date < $eperiod";
-
- # Invoiced
- my $charged_sql = "SELECT SUM(charged) FROM cust_bill $where";
- my $charged_sth = dbh->prepare($charged_sql) or die dbh->errstr;
- $charged_sth->execute or die $charged_sth->errstr;
- my $charged = $charged_sth->fetchrow_arrayref->[0] || 0;
-
- push @{$data{charged}}, $charged;
-
- #accounts receivable
-# my $ar_sql2 = "SELECT SUM(amount) FROM cust_credit $where";
- my $credited_sql = "SELECT SUM(cust_credit_bill.amount) FROM cust_credit_bill, cust_bill WHERE cust_bill.invnum = cust_credit_bill.invnum AND cust_bill._date >= $speriod AND cust_bill._date < $eperiod";
- my $credited_sth = dbh->prepare($credited_sql) or die dbh->errstr;
- $credited_sth->execute or die $credited_sth->errstr;
- my $credited = $credited_sth->fetchrow_arrayref->[0] || 0;
-
- #horrible local kludge
- my $expenses_sql = "SELECT SUM(cust_bill_pkg.setup) FROM cust_bill_pkg, cust_bill, cust_pkg, part_pkg WHERE cust_bill.invnum = cust_bill_pkg.invnum AND cust_bill._date >= $speriod AND cust_bill._date < $eperiod AND cust_pkg.pkgnum = cust_bill_pkg.pkgnum AND cust_pkg.pkgpart = part_pkg.pkgpart AND LOWER(part_pkg.pkg) LIKE 'expense _%'";
- my $expenses_sth = dbh->prepare($expenses_sql) or die dbh->errstr;
- $expenses_sth->execute or die $expenses_sth->errstr;
- my $expenses = $expenses_sth->fetchrow_arrayref->[0] || 0;
-
- push @{$data{ar}}, $charged-$credited-$expenses;
-
- #deferred revenue
-# push @{$data{defer}}, '0';
-
- #cashflow
- my $paid_sql = "SELECT SUM(paid) FROM cust_pay $where";
- my $paid_sth = dbh->prepare($paid_sql) or die dbh->errstr;
- $paid_sth->execute or die $paid_sth->errstr;
- my $paid = $paid_sth->fetchrow_arrayref->[0] || 0;
-
- my $refunded_sql = "SELECT SUM(refund) FROM cust_refund $where";
- my $refunded_sth = dbh->prepare($refunded_sql) or die dbh->errstr;
- $refunded_sth->execute or die $refunded_sth->errstr;
- my $refunded = $refunded_sth->fetchrow_arrayref->[0] || 0;
-
- #horrible local kludge that doesn't even really work right
- my $expenses_sql = "SELECT SUM(cust_bill_pay.amount) FROM cust_bill_pay, cust_bill WHERE cust_bill_pay.invnum = cust_bill.invnum AND cust_bill_pay._date >= $speriod AND cust_bill_pay._date < $eperiod AND 0 < ( select count(*) from cust_bill_pkg, cust_pkg, part_pkg WHERE cust_bill.invnum = cust_bill_pkg.invnum AND cust_pkg.pkgnum = cust_bill_pkg.pkgnum AND cust_pkg.pkgpart = part_pkg.pkgpart AND LOWER(part_pkg.pkg) LIKE 'expense _%' )";
-
-# my $expenses_sql = "SELECT SUM(cust_bill_pay.amount) FROM cust_bill_pay, cust_bill_pkg, cust_bill, cust_pkg, part_pkg WHERE cust_bill_pay.invnum = cust_bill.invnum AND cust_bill.invnum = cust_bill_pkg.invnum AND cust_bill_pay._date >= $speriod AND cust_bill_pay._date < $eperiod AND cust_pkg.pkgnum = cust_bill_pkg.pkgnum AND cust_pkg.pkgpart = part_pkg.pkgpart AND LOWER(part_pkg.pkg) LIKE 'expense _%'";
- my $expenses_sth = dbh->prepare($expenses_sql) or die dbh->errstr;
- $expenses_sth->execute or die $expenses_sth->errstr;
- my $expenses = $expenses_sth->fetchrow_arrayref->[0] || 0;
-
- push @{$data{cash}}, $paid-$refunded-$expenses;
-
-}
-
-#my $chart = Chart::LinesPoints->new(1024,480);
-my $chart = Chart::LinesPoints->new(768,480);
-
-$chart->set(
- #'min_val' => 0,
- 'legend' => 'bottom',
- 'legend_labels' => [ #'Invoiced (cust_bill)',
- 'Accounts receivable (invoices - applied credits)',
- #'Deferred revenue',
- 'Actual cashflow (payments - refunds)' ],
-);
-
-my @data = ( \@labels,
- #map $data{$_}, qw( ar defer cash )
- #map $data{$_}, qw( charged ar cash )
- map $data{$_}, qw( ar cash )
- );
-
-#my $gd = $chart->plot(\@data);
-#open (IMG, ">i_r_c.png");
-#print IMG $gd->png;
-#close IMG;
-
-#$chart->png("i_r_c.png", \@data);
-
-#$chart->cgi_png(\@data);
-
-http_header('Content-Type' => 'image/png' );
-$Response->{ContentType} = 'image/png';
-
-$chart->_set_colors();
-
-%><%= $chart->scalar_png(\@data) %>
diff --git a/httemplate/graph/money_time.cgi b/httemplate/graph/money_time.cgi
deleted file mode 100644
index e24157ccb..000000000
--- a/httemplate/graph/money_time.cgi
+++ /dev/null
@@ -1,59 +0,0 @@
-<!-- mason kludge %>
-<%
-
-#my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
-my ($curmon,$curyear) = (localtime(time))[4,5];
-
-#find first month
-my $syear = $cgi->param('syear') || 1899+$curyear;
-my $smonth = $cgi->param('smonth') || $curmon+1;
-
-#find last month
-my $eyear = $cgi->param('eyear') || 1900+$curyear;
-my $emonth = $cgi->param('emonth') || $curmon+1;
-
-%>
-
-<HTML>
- <HEAD>
- <TITLE>Graphing monetary values over time</TITLE>
- </HEAD>
-<BODY BGCOLOR="#e8e8e8">
-<IMG SRC="money_time-graph.cgi?<%= $cgi->query_string %>" WIDTH="768" HEIGHT="480">
-<BR>
-<FORM METHOD="POST">
-<INPUT TYPE="checkbox" NAME="ar">
- Accounts receivable (invoices - applied credits)<BR>
-<INPUT TYPE="checkbox" NAME="charged">
- Just Invoices<BR>
-<INPUT TYPE="checkbox" NAME="defer">
- Accounts receivable, with deferred revenue (invoices - applied credits, with charges for annual/semi-annual/quarterly/etc. services deferred over applicable time period) (there has got to be a shorter description for this)<BR>
-<INPUT TYPE="checkbox" NAME="cash">
- Cashflow (payments - refunds)<BR>
-<BR>
-From <SELECT NAME="smonth">
-<% my @m = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
- foreach my $m ( 1..12 ) { %>
-<OPTION VALUE="<%= $m %>"<%= $m == $smonth ? ' SELECTED' : '' %>><%= $m[$m-1] %>
-<% } %>
-</SELECT>
-<SELECT NAME="syear">
-<% foreach my $y ( 1999 .. 2010 ) { %>
-<OPTION VALUE="<%= $y %>"<%= $y == $syear ? ' SELECTED' : '' %>><%= $y %>
-<% } %>
-</SELECT>
- to <SELECT NAME="emonth">
-<% foreach my $m ( 1..12 ) { %>
-<OPTION VALUE="<%= $m %>"<%= $m == $emonth ? ' SELECTED' : '' %>><%= $m[$m-1] %>
-<% } %>
-</SELECT>
-<SELECT NAME="eyear">
-<% foreach my $y ( 1999 .. 2010 ) { %>
-<OPTION VALUE="<%= $y %>"<%= $y == $eyear ? ' SELECTED' : '' %>><%= $y %>
-<% } %>
-</SELECT>
-
-<INPUT TYPE="submit" VALUE="Graph">
-</FORM>
-</BODY>
-</HTML>
diff --git a/httemplate/index.html b/httemplate/index.html
index d13649b07..6890e8038 100644
--- a/httemplate/index.html
+++ b/httemplate/index.html
@@ -34,6 +34,7 @@
<FORM ACTION="search/cust_main.cgi" METHOD="POST"><INPUT TYPE="hidden" NAME="phone_on" VALUE="1">Phone # <INPUT TYPE="text" NAME="phone_text"><INPUT TYPE="submit" VALUE="Search"></FORM>
<BR><FORM ACTION="search/svc_acct.cgi" METHOD="POST">Username <INPUT TYPE="text" NAME="username"><SELECT NAME="username_type"><OPTION VALUE="All">(all)</OPTION><OPTION>Fuzzy</OPTION><OPTION>Substring</OPTION><OPTION SELECTED>Exact</OPTION></SELECT><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/svc_acct.cgi?username">all accounts by username</A> or <A HREF="search/svc_acct.cgi?uid">uid</A></FORM>
<BR><FORM ACTION="search/svc_domain.cgi" METHOD="POST">Domain <INPUT TYPE="text" NAME="domain"><INPUT TYPE="submit" VALUE="Search"> or <A HREF="search/svc_domain.cgi?domain">all domains</A></FORM>
+<!-- <LI><A HREF="search/svc_acct_sm.html">mail aliases (by domain, and optionally username)</A>-->
<!-- <LI><A HREF="search/svc_forward.html">mail forwards (by ?)</A>-->
<BR>
</TD></TR>
@@ -195,15 +196,7 @@
<LI><A HREF="browse/svc_acct_pop.cgi">View/Edit Access Numbers</A>
- Points of Presence
<LI><A HREF="browse/part_bill_event.cgi">View/Edit invoice events</A> - Actions for overdue invoices
- <LI><A HREF="browse/msgcat.cgi">View/Edit message catalog</A> - Change error messages and other customizable labels.
- <LI><A HREF="browse/part_sb_field.cgi">View/Edit custom svc_broadband fields</A>
- - Custom broadband service fields for site-specific export/informational data.
- <LI><A HREF="browse/generic.cgi?part_router_field">View/Edit custom router fields</A>
- - Custom router fields for site-specific export data.
- <LI><A HREF="browse/router.cgi">View/Edit routers</A>
- - Broadband access routers
- <LI><A HREF="browse/addr_block.cgi">View/Edit address blocks</A>
- - Manage address blocks and block assignments to broadband routers.
+ <LI><A HREF="browse/msgcat.cgi">View/Edit message catalog</A> - Change error messages and other customizable labels.
</ul>
<BR>
</TD></TR>
diff --git a/httemplate/misc/link.cgi b/httemplate/misc/link.cgi
index 79adce88c..efc762cc5 100755
--- a/httemplate/misc/link.cgi
+++ b/httemplate/misc/link.cgi
@@ -4,6 +4,7 @@
my %link_field = (
'svc_acct' => 'username',
'svc_domain' => 'domain',
+ 'svc_acct_sm' => '',
'svc_charge' => '',
'svc_wo' => '',
);
diff --git a/httemplate/misc/meta-import.cgi b/httemplate/misc/meta-import.cgi
deleted file mode 100644
index 2f3b7380d..000000000
--- a/httemplate/misc/meta-import.cgi
+++ /dev/null
@@ -1,64 +0,0 @@
-<!-- mason kludge -->
-<%= header('Import') %>
-<FORM ACTION="process/meta-import.cgi" METHOD="post" ENCTYPE="multipart/form-data">
-Import data from a DBI data source<BR><BR>
-
-<%
- #false laziness with edit/cust_main.cgi
- my @agents = qsearch( 'agent', {} );
- die "No agents created!" unless @agents;
- my $agentnum = $agents[0]->agentnum; #default to first
-
- if ( scalar(@agents) == 1 ) {
-%>
- <INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agentnum %>">
-<% } else { %>
- <BR><BR>Agent <SELECT NAME="agentnum" SIZE="1">
- <% foreach my $agent (sort { $a->agent cmp $b->agent } @agents) { %>
- <OPTION VALUE="<%= $agent->agentnum %>" <%= " SELECTED"x($agent->agentnum==$agentnum) %>><%= $agent->agent %></OPTION>
- <% } %>
- </SELECT><BR><BR>
-<% } %>
-
-<%
- my @referrals = qsearch('part_referral',{});
- die "No advertising sources created!" unless @referrals;
- my $refnum = $referrals[0]->refnum; #default to first
-
- if ( scalar(@referrals) == 1 ) {
-%>
- <INPUT TYPE="hidden" NAME="refnum" VALUE="<%= $refnum %>">
-<% } else { %>
- <BR><BR>Advertising source <SELECT NAME="refnum" SIZE="1">
- <% foreach my $referral ( sort { $a->referral <=> $b->referral } @referrals) { %>
- <OPTION VALUE="<%= $referral->refnum %>" <%= " SELECTED"x($referral->refnum==$refnum) %>><%= $referral->refnum %>: <%= $referral->referral %></OPTION>
- <% } %>
- </SELECT><BR><BR>
-<% } %>
-
- First package: <SELECT NAME="pkgpart"><OPTION VALUE="">(none)</OPTION>
-<% foreach my $part_pkg ( qsearch('part_pkg',{'disabled'=>'' }) ) { %>
- <OPTION VALUE="<%= $part_pkg->pkgpart %>"><%= $part_pkg->pkg. ' - '. $part_pkg->comment %></OPTION>
-<% } %>
-</SELECT><BR><BR>
-
- <table>
- <tr>
- <td align="right">DBI data source: </td>
- <td><INPUT TYPE="text" NAME="data_source"></td>
- </tr>
- <tr>
- <td align="right">DBI username: </td>
- <td><INPUT TYPE="text" NAME="username"></td>
- </tr>
- <tr>
- <td align="right">DBI password: </td>
- <td><INPUT TYPE="text" NAME="password"></td>
- </tr>
- </table>
- <INPUT TYPE="submit" VALUE="Import">
-
- </FORM>
- </BODY>
-<HTML>
-
diff --git a/httemplate/misc/process/meta-import.cgi b/httemplate/misc/process/meta-import.cgi
deleted file mode 100644
index 9e374b508..000000000
--- a/httemplate/misc/process/meta-import.cgi
+++ /dev/null
@@ -1,153 +0,0 @@
-<!-- mason kludge -->
-<%= header('Map tables') %>
-
-<SCRIPT>
-var gSafeOnload = new Array();
-var gSafeOnsubmit = new Array();
-window.onload = SafeOnload;
-function SafeAddOnLoad(f) {
- gSafeOnload[gSafeOnload.length] = f;
-}
-function SafeOnload() {
- for (var i=0;i<gSafeOnload.length;i++)
- gSafeOnload[i]();
-}
-function SafeAddOnSubmit(f) {
- gSafeOnsubmit[gSafeOnsubmit.length] = f;
-}
-function SafeOnsubmit() {
- for (var i=0;i<gSafeOnsubmit.length;i++)
- gSafeOnsubmit[i]();
-}
-</SCRIPT>
-
-<FORM NAME="OneTrueForm" METHOD="POST" ACTION="meta-import.cgi">
-
-<%
- #use DBIx::DBSchema;
- my $schema = new_native DBIx::DBSchema
- map { $cgi->param($_) } qw( data_source username password );
- foreach my $field (qw( data_source username password )) { %>
- <INPUT TYPE="hidden" NAME=<%= $field %> VALUE="<%= $cgi->param($field) %>">
- <% }
-
- my %schema = ();
- if ( $cgi->param('schema') ) {
- my $schema_string = $cgi->param('schema');
- %> <INPUT TYPE="hidden" NAME="schema" VALUE="<%=$schema_string%>"> <%
- %schema = map { /^\s*(\w+)\s*=>\s*(\w+)\s*$/
- or die "guru meditation #420: $_";
- ( $1 => $2 );
- }
- split( /\n/, $schema_string );
- }
-
- #first page
- unless ( $cgi->param('magic') ) { %>
-
- <INPUT TYPE="hidden" NAME="magic" VALUE="process">
- <%= hashmaker('schema', [ $schema->tables ],
- [ grep !/^h_/, dbdef->tables ], ) %>
- <br><INPUT TYPE="submit" VALUE="done">
- <%
-
- #second page
- } elsif ( $cgi->param('magic') eq 'process' ) { %>
-
- <INPUT TYPE="hidden" NAME="magic" VALUE="process2">
- <%
-
- foreach my $table ( keys %schema ) {
-
- my @from_columns = $schema->table($table)->columns;
- my @fs_columns = dbdef->table($schema{$table})->columns;
-
- %>
- <%= hashmaker($table, \@from_columns => \@fs_columns,
- $table => $schema{$table}, ) %>
- <br><hr><br>
- <%
-
- }
-
- %>
- <br><INPUT TYPE="submit" VALUE="done">
- <%
-
- #third (results)
- } elsif ( $cgi->param('magic') eq 'process2' ) {
-
- print "<pre>\n";
-
- foreach my $table ( keys %schema ) {
- ( my $spaces = $table ) =~ s/./ /g;
- print "'$table' => { 'table' => '$schema{$table}',\n".
- #(length($table) x ' '). " 'map' => {\n";
- "$spaces 'map' => {\n";
- my %map = map { /^\s*(\w+)\s*=>\s*(\w+)\s*$/
- or die "guru meditation #420: $_";
- ( $1 => $2 );
- }
- split( /\n/, $cgi->param($table) );
- foreach ( keys %map ) {
- print "$spaces '$_' => '$map{$_}',\n";
- }
- print "$spaces },\n";
- print "$spaces },\n";
-
- }
- print "\n</pre>";
-
- } else {
- warn "unrecognized magic: ". $cgi->param('magic');
- }
-
- %>
-</FORM>
-</BODY>
-</HTML>
-
- <%
- #hashmaker widget
- sub hashmaker {
- my($name, $from, $to, $labelfrom, $labelto) = @_;
- $fromsize = scalar(@$from);
- $tosize = scalar(@$to);
- "<TABLE><TR><TH>$labelfrom</TH><TH>$labelto</TH></TR><TR><TD>".
- qq!<SELECT NAME="${name}_from" SIZE=$fromsize>\n!.
- join("\n", map { qq!<OPTION VALUE="$_">$_</OPTION>! } sort { $a cmp $b } @$from ).
- "</SELECT>\n".
- '</TD><TD>'.
- qq!<SELECT NAME="${name}_to" SIZE=$tosize>\n!.
- join("\n", map { qq!<OPTION VALUE="$_">$_</OPTION>! } sort { $a cmp $b } @$to ).
- "</SELECT>\n".
- '</TD></TR>'.
- '<TR><TD COLSPAN=2>'.
- qq!<INPUT TYPE="button" VALUE="map" onClick="toke_$name(this.form)">!.
- '</TD></TR><TR><TD COLSPAN=2>'.
- qq!<TEXTAREA NAME="$name" COLS=80 ROWS=8></TEXTAREA>!.
- '</TD></TR></TABLE>'.
- "<script>
- function toke_$name() {
- fromObject = document.OneTrueForm.${name}_from;
- for (var i=fromObject.options.length-1;i>-1;i--) {
- if (fromObject.options[i].selected)
- fromname = deleteOption_$name(fromObject,i);
- }
- toObject = document.OneTrueForm.${name}_to;
- for (var i=toObject.options.length-1;i>-1;i--) {
- if (toObject.options[i].selected)
- toname = deleteOption_$name(toObject,i);
- }
- document.OneTrueForm.$name.value = document.OneTrueForm.$name.value + fromname + ' => ' + toname + '\\n';
- }
- function deleteOption_$name(object,index) {
- value = object.options[index].value;
- object.options[index] = null;
- return value;
- }
- </script>".
- '';
- }
-
-%>
diff --git a/httemplate/search/report_cc.cgi b/httemplate/search/report_cc.cgi
index c2ab726b6..ff8c1fb0b 100755
--- a/httemplate/search/report_cc.cgi
+++ b/httemplate/search/report_cc.cgi
@@ -1,7 +1,8 @@
<!-- mason kludge -->
<%
-my $user = getotaker;
+#my $user = getotaker;
+my $user = $FS::UID::user; #dumb 1.4 8-char workaround
$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
my $beginning = $1;
diff --git a/httemplate/search/report_credit.cgi b/httemplate/search/report_credit.cgi
index 2adafc06e..05017f4a9 100755
--- a/httemplate/search/report_credit.cgi
+++ b/httemplate/search/report_credit.cgi
@@ -1,7 +1,8 @@
<!-- mason kludge -->
<%
-my $user = getotaker;
+#my $user = getotaker;
+my $user = $FS::UID::user; #dumb 1.4 8-char workaround
$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
my $beginning = $1;
diff --git a/httemplate/search/report_receivables.cgi b/httemplate/search/report_receivables.cgi
index fdd3779a9..04a41366f 100755
--- a/httemplate/search/report_receivables.cgi
+++ b/httemplate/search/report_receivables.cgi
@@ -1,7 +1,8 @@
<!-- mason kludge -->
<%
-my $user = getotaker;
+#my $user = getotaker;
+my $user = $FS::UID::user; #dumb 1.4 8-char workaround
print header('Current Receivables Report Results');
diff --git a/httemplate/search/report_tax.cgi b/httemplate/search/report_tax.cgi
index ac76fad6e..835554a2e 100755
--- a/httemplate/search/report_tax.cgi
+++ b/httemplate/search/report_tax.cgi
@@ -1,7 +1,8 @@
<!-- mason kludge -->
<%
-my $user = getotaker;
+#my $user = getotaker;
+my $user = $FS::UID::user; #dumb 1.4 8-char workaround
$cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/;
my $beginning = $1;
diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi
index e43f4f79b..728f2c25f 100755
--- a/httemplate/search/svc_acct.cgi
+++ b/httemplate/search/svc_acct.cgi
@@ -1,5 +1,7 @@
<%
+my $mydomain = '';
+
my $conf = new FS::Conf;
my $maxrecords = $conf->config('maxsearchrecordsperpage');
@@ -145,8 +147,14 @@ END
$domain = "<A HREF=\"${p}view/svc_domain.cgi?". $svc_domain->svcnum.
"\">". $svc_domain->domain. "</A>";
} else {
- die "No svc_domain.svcnum record for svc_acct.domsvc: ".
- $svc_acct->domsvc;
+ unless ( $mydomain ) {
+ my $conf = new FS::Conf;
+ unless ( $mydomain = $conf->config('domain') ) {
+ die "No legacy domain config file and no svc_domain.svcnum record ".
+ "for svc_acct.domsvc: ". $svc_acct->domsvc;
+ }
+ }
+ $domain = "<i>$mydomain</i><FONT COLOR=\"#FF0000\">*</FONT>";
}
my($cust_pkg,$cust_main);
if ( $cust_svc->pkgnum ) {
@@ -208,8 +216,17 @@ END
}
- print "</TABLE>$pager<BR>".
- '</BODY></HTML>';
+ print "</TABLE>$pager<BR>";
+
+ if ( $mydomain ) {
+ print "<BR><FONT COLOR=\"#FF0000\">*</FONT> The <I>$mydomain</I> domain ".
+ "is contained in your legacy <CODE>domain</CODE> ".
+ "<A HREF=\"${p}docs/config.html#domain\">configuration file</A>. ".
+ "You should run the <CODE>bin/fs-migrate-svc_acct_sm</CODE> script ".
+ "to create a proper svc_domain record for this domain.";
+ }
+
+ print '</BODY></HTML>';
}
diff --git a/httemplate/search/svc_acct_sm.cgi b/httemplate/search/svc_acct_sm.cgi
new file mode 100755
index 000000000..4ee300612
--- /dev/null
+++ b/httemplate/search/svc_acct_sm.cgi
@@ -0,0 +1,84 @@
+<%
+
+my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
+
+$cgi->param('domuser') =~ /^([a-z0-9_\-]{0,32})$/;
+my $domuser = $1;
+
+$cgi->param('domain') =~ /^([\w\-\.]+)$/ or die "Illegal domain";
+my $svc_domain = qsearchs('svc_domain',{'domain'=>$1})
+ or die "Unknown domain";
+my $domsvc = $svc_domain->svcnum;
+
+my @svc_acct_sm;
+if ($domuser) {
+ @svc_acct_sm=qsearch('svc_acct_sm',{
+ 'domuser' => $domuser,
+ 'domsvc' => $domsvc,
+ });
+} else {
+ @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $domsvc});
+}
+
+if ( scalar(@svc_acct_sm) == 1 ) {
+ my($svcnum)=$svc_acct_sm[0]->svcnum;
+ print $cgi->redirect(popurl(2). "view/svc_acct_sm.cgi?$svcnum");
+} elsif ( scalar(@svc_acct_sm) > 1 ) {
+%>
+<!-- mason kludge -->
+<%
+ print header('Mail Alias Search Results'), &table(), <<END;
+ <TR>
+ <TH>Mail to<BR><FONT SIZE=-1>(click to view mail alias)</FONT></TH>
+ <TH>Forwards to<BR><FONT SIZE=-1>(click to view account)</FONT></TH>
+ </TR>
+END
+
+ my($svc_acct_sm);
+ foreach $svc_acct_sm (@svc_acct_sm) {
+ my($svcnum,$domuser,$domuid,$domsvc)=(
+ $svc_acct_sm->svcnum,
+ $svc_acct_sm->domuser,
+ $svc_acct_sm->domuid,
+ $svc_acct_sm->domsvc,
+ );
+
+ my $svc_domain = qsearchs( 'svc_domain', { 'svcnum' => $domsvc } );
+ if ( $svc_domain ) {
+ my $domain = $svc_domain->domain;
+
+ print qq!<TR><TD><A HREF="!. popurl(2). qq!view/svc_acct_sm.cgi?$svcnum">!,
+ #print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser );
+ ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ),
+ qq!\@$domain</A> </TD>!,
+ ;
+ } else {
+ my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum";
+ warn $warning;
+ print "<TR><TD>WARNING: $warning</TD>";
+ }
+
+ my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } );
+ if ( $svc_acct ) {
+ my $username = $svc_acct->username;
+ my $svc_acct_svcnum =$svc_acct->svcnum;
+ print qq!<TD><A HREF="!, popurl(2),
+ qq!view/svc_acct.cgi?$svc_acct_svcnum">$username\@$mydomain</A>!,
+ qq!</TD></TR>!
+ ;
+ } else {
+ my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!";
+ warn $warning;
+ print "<TD>WARNING: $warning</TD></TR>";
+ }
+
+ }
+
+ print '</TABLE></BODY></HTML>';
+
+} else { #error
+ idiot("Mail Alias not found");
+}
+
+%>
diff --git a/httemplate/search/svc_acct_sm.html b/httemplate/search/svc_acct_sm.html
new file mode 100755
index 000000000..0719856db
--- /dev/null
+++ b/httemplate/search/svc_acct_sm.html
@@ -0,0 +1,23 @@
+<HTML>
+ <HEAD>
+ <TITLE>Mail Alias Search</TITLE>
+ </HEAD>
+ <BODY>
+ <CENTER>
+ <H1>Mail Alias Search</H1>
+ </CENTER>
+ <HR>
+ <FORM ACTION="svc_acct_sm.cgi" METHOD="post">
+ Search for <B>mail alias</B>:
+ <INPUT TYPE="text" NAME="domuser"><FONT SIZE=-1>(opt.)</FONT> @
+ <INPUT TYPE="text" NAME="domain"><FONT SIZE=-1>(req.)</FONT>
+
+ <P><INPUT TYPE="submit" VALUE="Search">
+
+ </FORM>
+
+ <HR>
+
+ </BODY>
+</HTML>
+
diff --git a/httemplate/search/svc_domain.cgi b/httemplate/search/svc_domain.cgi
index c0acf1143..fbdecc118 100755
--- a/httemplate/search/svc_domain.cgi
+++ b/httemplate/search/svc_domain.cgi
@@ -1,6 +1,7 @@
<%
my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
my($query)=$cgi->keywords;
$query ||= ''; #to avoid use of unitialized value errors
@@ -67,6 +68,18 @@ END
$svc_domain->svcnum,
$svc_domain->domain,
);
+ #my($malias);
+ #if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) {
+ # $malias=(
+ # qq|<FORM ACTION="svc_acct_sm.cgi" METHOD="post">|.
+ # qq|<INPUT TYPE="hidden" NAME="domuser" VALUE="">|.
+ # qq|<INPUT TYPE="hidden" NAME="domain" VALUE="$domain">|.
+ # qq|<INPUT TYPE="submit" VALUE="(mail aliases)">|.
+ # qq|</FORM>|
+ # );
+ #} else {
+ # $malias='';
+ #}
#don't display all accounts here
my $rowspan = 1;
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 1d6243e23..9b7b5d029 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -22,23 +22,10 @@ my $custnum = $1;
my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
die "Customer not found!" unless $cust_main;
-print qq!<A HREF="${p}edit/cust_main.cgi?$custnum">Edit this customer</A>!;
-
-print <<END;
-<SCRIPT>
-function cancel_areyousure(href) {
- if (confirm("Perminantly delete all services and cancel this customer?") == true)
- window.location.href = href;
-}
-</SCRIPT>
-END
-
-print qq! | <A HREF="javascript:cancel_areyousure('${p}misc/cust_main-cancel.cgi?$custnum')">!.
- 'Cancel this customer</A>'
- if $cust_main->ncancelled_pkgs;
-
-print qq! | <A HREF="${p}misc/delete-customer.cgi?$custnum">!.
- 'Delete this customer</A>'
+print qq!<A HREF="!, popurl(2),
+ qq!edit/cust_main.cgi?$custnum">Edit this customer</A>!;
+print qq! | <A HREF="!, popurl(2),
+ qq!misc/delete-customer.cgi?$custnum"> Delete this customer</A>!
if $conf->exists('deletecustomers');
unless ( $conf->exists('disable_customer_referrals') ) {
diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi
index 2e324c13c..47a93586d 100755
--- a/httemplate/view/svc_acct.cgi
+++ b/httemplate/view/svc_acct.cgi
@@ -2,6 +2,7 @@
<%
my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
@@ -31,7 +32,11 @@ if ( $svc_acct->domsvc ) {
die "Unknown domain" unless $svc_domain;
$domain = $svc_domain->domain;
} else {
- die "No svc_domain.svcnum record for svc_acct.domsvc: ". $cust_svc->domsvc;
+ unless ( $mydomain ) {
+ die "No legacy domain config file and no svc_domain.svcnum record ".
+ "for svc_acct.domsvc: ". $cust_svc->domsvc;
+ }
+ $domain = $mydomain;
}
%>
diff --git a/httemplate/view/svc_acct_sm.cgi b/httemplate/view/svc_acct_sm.cgi
new file mode 100755
index 000000000..4e5acc427
--- /dev/null
+++ b/httemplate/view/svc_acct_sm.cgi
@@ -0,0 +1,58 @@
+<!-- mason kludge -->
+<%
+
+my $conf = new FS::Conf;
+my $mydomain = $conf->config('domain');
+
+my($query) = $cgi->keywords;
+$query =~ /^(\d+)$/;
+my $svcnum = $1;
+my $svc_acct_sm = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum});
+die "Unknown svcnum" unless $svc_acct_sm;
+
+my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
+my $pkgnum = $cust_svc->getfield('pkgnum');
+my($cust_pkg, $custnum);
+if ($pkgnum) {
+ $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
+ $custnum=$cust_pkg->getfield('custnum');
+} else {
+ $cust_pkg = '';
+ $custnum = '';
+}
+
+my $part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } )
+ or die "Unkonwn svcpart";
+
+print header('Mail Alias View', menubar(
+ ( ( $pkgnum || $custnum )
+ ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
+ "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
+ )
+ : ( "Cancel this (unaudited) account" =>
+ "${p}misc/cancel-unaudited.cgi?$svcnum" )
+ ),
+ "Main menu" => $p,
+));
+
+my($domsvc,$domuid,$domuser) = (
+ $svc_acct_sm->domsvc,
+ $svc_acct_sm->domuid,
+ $svc_acct_sm->domuser,
+);
+my $svc = $part_svc->svc;
+my $svc_domain = qsearchs('svc_domain',{'svcnum'=>$domsvc})
+ or die "Corrupted database: no svc_domain.svcnum matching domsvc $domsvc";
+my $domain = $svc_domain->domain;
+my $svc_acct = qsearchs('svc_acct',{'uid'=>$domuid})
+ or die "Corrupted database: no svc_acct.uid matching domuid $domuid";
+my $username = $svc_acct->username;
+
+print qq!<A HREF="${p}edit/svc_acct_sm.cgi?$svcnum">Edit this information</A>!,
+ "<BR>Service #$svcnum",
+ "<BR>Service: <B>$svc</B>",
+ qq!<BR>Mail to <B>!, ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ) , qq!</B>\@<B>$domain</B> forwards to <B>$username</B>\@$mydomain mailbox.!,
+ '</BODY></HTML>'
+;
+
+%>
diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi
deleted file mode 100644
index 164b5b22c..000000000
--- a/httemplate/view/svc_broadband.cgi
+++ /dev/null
@@ -1,91 +0,0 @@
-<!-- mason kludge -->
-<%
-
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-my $svcnum = $1;
-my $svc_broadband = qsearchs( 'svc_broadband', { 'svcnum' => $svcnum } )
- or die "svc_broadband: Unknown svcnum $svcnum";
-
-#false laziness w/all svc_*.cgi
-my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $svcnum } );
-my $pkgnum = $cust_svc->getfield('pkgnum');
-my($cust_pkg, $custnum);
-if ($pkgnum) {
- $cust_pkg = qsearchs( 'cust_pkg', { 'pkgnum' => $pkgnum } );
- $custnum = $cust_pkg->custnum;
-} else {
- $cust_pkg = '';
- $custnum = '';
-}
-#eofalse
-
-my $router = $svc_broadband->addr_block->router;
-
-if (not $router) { die "Could not lookup router for svc_broadband (svcnum $svcnum)" };
-
-my (
- $routername,
- $routernum,
- $speed_down,
- $speed_up,
- $ip_addr
- ) = (
- $router->getfield('routername'),
- $router->getfield('routernum'),
- $svc_broadband->getfield('speed_down'),
- $svc_broadband->getfield('speed_up'),
- $svc_broadband->getfield('ip_addr')
- );
-
-
-
-print header('Broadband Service View', menubar(
- ( ( $custnum )
- ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
- )
- : ( "Cancel this (unaudited) website" =>
- "${p}misc/cancel-unaudited.cgi?$svcnum" )
- ),
- "Main menu" => $p,
-)).
- qq!<A HREF="${p}edit/svc_broadband.cgi?$svcnum">Edit this information</A><BR>!.
- ntable("#cccccc"). '<TR><TD>'. ntable("#cccccc",2).
- qq!<TR><TD ALIGN="right">Service number</TD>!.
- qq!<TD BGCOLOR="#ffffff">$svcnum</TD></TR>!.
- qq!<TR><TD ALIGN="right">Router</TD>!.
- qq!<TD BGCOLOR="#ffffff">$routernum: $routername</TD></TR>!.
- qq!<TR><TD ALIGN="right">Download Speed</TD>!.
- qq!<TD BGCOLOR="#ffffff">$speed_down</TD></TR>!.
- qq!<TR><TD ALIGN="right">Upload Speed</TD>!.
- qq!<TD BGCOLOR="#ffffff">$speed_up</TD></TR>!.
- qq!<TR><TD ALIGN="right">IP Address</TD>!.
- qq!<TD BGCOLOR="#ffffff">$ip_addr</TD></TR>!.
- '</TD></TR><TR ROWSPAN="1"><TD></TD></TR>';
-
-
-# foreach my $sb_field
-# ( qsearch('sb_field', { svcnum => $svcnum }) ) {
-# my $part_sb_field = qsearchs('part_sb_field',
-# { sbfieldpart => $sb_field->sbfieldpart });
-# print q!<TR><TD ALIGN="right">! . $part_sb_field->name .
-# q!</TD><TD BGCOLOR="#ffffff">! . $sb_field->value .
-# q!</TD></TR>!;
-# }
-# print '</TABLE>';
-
-
- my $sb_field = $svc_broadband->sb_field_hashref;
- foreach (sort { $a cmp $b } keys(%{$sb_field})) {
- print q!<TR><TD ALIGN="right">! . $_ .
- q!</TD><TD BGCOLOR="#ffffff">! . $sb_field->{$_} .
- q!</TD></TR>!;
- }
- print '</TABLE>';
-
-
-print '<BR>'. joblisting({'svcnum'=>$svcnum}, 1).
- '</BODY></HTML>'
-;
-%>