new admin documentation, quick one-pkg order
[freeside.git] / httemplate / edit / part_svc.cgi
index 6617d25..01574e9 100755 (executable)
@@ -1,4 +1,4 @@
-<!-- $Id: part_svc.cgi,v 1.2 2001-08-11 04:55:03 ivan Exp $ -->
+<!-- $Id: part_svc.cgi,v 1.6 2001-09-04 14:44:06 ivan Exp $ -->
 <% 
    my $part_svc;
    if ( $cgi->param('error') ) { #error
@@ -6,9 +6,10 @@
        map { $_, scalar($cgi->param($_)) } fields('part_svc')
      } );
    } elsif ( $cgi->keywords ) { #edit
-     my $query = $cgi->keywords;
-     $query =~ /^(\d+)$/;
-     $part_svc=qsearchs('part_svc',{'svcpart'=>$1});
+     my($query) = $cgi->keywords;
+     $query =~ /^(\d+)$/ or die "malformed query: $query";
+     $part_svc=qsearchs('part_svc', { 'svcpart'=>$1 } )
+       or die "unknown svcpart: $1";
    } else { #adding
      $part_svc = new FS::part_svc {};
    }
@@ -30,7 +31,7 @@ function visualize(what) {
 
 <%= header("$action Service Definition",
            menubar( 'Main Menu'         => $p,
-                    'View all services' => "${p}browse/part_svc.cgi"
+                    'View all service definitions' => "${p}browse/part_svc.cgi"
                   ),
            " onLoad=\"visualize()\""
            )
@@ -49,8 +50,9 @@ Service  <INPUT TYPE="text" NAME="svc" VALUE="<%= $hashref->{svc} %>">
 </PRE>
 Services are items you offer to your customers.
 <UL><LI>svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
-    <LI>svc_domain - Virtual domains
-    <LI>svc_acct_sm - Virtual domain mail aliasing
+    <LI>svc_domain - Domains
+    <LI>svc_acct_sm - <B>depreciated</B> (use svc_forward for new installations) Virtual domain mail aliasing.
+    <LI>svc_forward - mail forwarding
     <LI>svc_www - Virtual domain website
 <!--   <LI>svc_charge - One-time charges (Partially unimplemented)
        <LI>svc_wo - Work orders (Partially unimplemented)
@@ -67,10 +69,10 @@ var svcdb = null;
 var something = null;
 function changed(what) {
   svcdb = what.options[what.selectedIndex].value;
-<% foreach my $svcdb ( qw( svc_acct svc_domain svc_acct_sm svc_www ) ) { %>
+<% foreach my $svcdb ( qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ) ) { %>
   if (svcdb == "<%= $svcdb %>" ) {
     <% foreach my $not ( grep { $_ ne $svcdb } (
-                           qw(svc_acct svc_domain svc_acct_sm svc_www) ) ) { %>
+                           qw(svc_acct svc_domain svc_acct_sm svc_forward svc_www) ) ) { %>
       if (document.getElementById) {
         document.getElementById('d<%= $not %>').style.visibility = "hidden";
       } else {
@@ -88,7 +90,7 @@ function changed(what) {
 </SCRIPT>
 <% my @dbs = $hashref->{svcdb}
              ? ( $hashref->{svcdb} )
-             : qw( svc_acct svc_domain svc_acct_sm svc_www ); %>
+             : qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ); %>
 Table<SELECT NAME="svcdb" SIZE=1 onChange="changed(this)">
 <% foreach my $svcdb (@dbs) { %>
 <OPTION VALUE="<%= $svcdb %>" <%= ' SELECTED'x($svcdb eq $hashref->{svcdb}) %>><%= $svcdb %>
@@ -102,7 +104,7 @@ my %defs = (
   'svc_acct' => {
     'dir'       => 'Home directory',
     'uid'       => 'UID (set to fixed and blank for dial-only)',
-    'slipip'    => 'IP address (set to fixed and blank to disable dialin)',
+    'slipip'    => 'IP address (Set to fixed and blank to disable dialin, or, set a value to be exported to RADIUS Framed-IP-Address.  Use the special value <code>0e0</code> [zero e zero] to enable export to RADIUS without a Framed-IP-Address.)',
     'popnum'    => qq!<A HREF="$p/browse/svc_acct_pop.cgi/">POP number</A>!,
     'username'  => 'Username',
     'quota'     => '(unimplemented)',
@@ -110,6 +112,7 @@ my %defs = (
     'gid'       => 'GID (when blank, defaults to UID)',
     'shell'     => 'Shell (all service definitions should have a default or fixed shell that is present in the <b>shells</b> configuration file)',
     'finger'    => 'GECOS',
+    'domsvc'    => 'svcnum from svc_domain',
   },
   'svc_domain' => {
     'domain'    => 'Domain',
@@ -119,6 +122,11 @@ my %defs = (
     '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',
+    'dst'       => 'someone@another.domain.com to use when dstsvc is 0',
+  },
   'svc_charge' => {
     'amount'    => 'amount',
   },
@@ -134,7 +142,7 @@ my %defs = (
 
 #  svc_acct svc_domain svc_acct_sm svc_charge svc_wo
 foreach my $svcdb ( qw(
-  konq_kludge svc_acct svc_domain svc_acct_sm svc_www
+  konq_kludge svc_acct svc_domain svc_acct_sm svc_forward svc_www
 ) ) {
 
   my(@rows)=map { /^${svcdb}__(.*)$/; $1 }