From 51984ac3d3da3006809c6866fdecd4ad83610731 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Jul 2001 07:36:04 +0000 Subject: templates!!! --- httemplate/edit/part_svc.cgi | 218 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100755 httemplate/edit/part_svc.cgi (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi new file mode 100755 index 000000000..cc0ee6fd0 --- /dev/null +++ b/httemplate/edit/part_svc.cgi @@ -0,0 +1,218 @@ + +<% + my $part_svc; + if ( $cgi->param('error') ) { #error + $part_svc = new FS::part_svc ( { + map { $_, scalar($cgi->param($_)) } fields('part_svc') + } ); + } elsif ( $cgi->keywords ) { #edit + my $query = $cgi->keywords; + $query =~ /^(\d+)$/; + $part_svc=qsearchs('part_svc',{'svcpart'=>$1}); + } else { #adding + $part_svc = new FS::part_svc {}; + } + my $action = $part_svc->svcpart ? 'Edit' : 'Add'; + my $hashref = $part_svc->hashref; + my $p_svcdb = $part_svc->svcdb || 'svc_acct'; + +%> + + + +<%= header("$action Service Definition", + menubar( 'Main Menu' => $p, + 'View all services' => "${p}browse/part_svc.cgi" + ), + " onLoad=\"visualize()\"" + ) +%> + +<% if ( $cgi->param('error') ) { %> +Error: <%= $cgi->param('error') %> +<% } %> + +
+ + Service Part #<%= $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %> + +
+Service  
+
+Services are items you offer to your customers. + +For the selected table, you can give fields default or fixed (unchangable) +values. For example, a SLIP/PPP account may have a default (or perhaps fixed) +slipip of 0.0.0.0, while a POP mailbox will probably have a fixed +blank slipip as well as a fixed shell something like /bin/true or +/usr/bin/passwd. +

+ +Table + +<% +#these might belong somewhere else for other user interfaces +#pry need to eventually create stuff that's shared amount UIs +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)', + 'popnum' => qq!POP number!, + 'username' => 'Username', + 'quota' => '(unimplemented)', + '_password' => 'Password', + 'gid' => 'GID (when blank, defaults to UID)', + 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', + 'finger' => 'GECOS', + }, + '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_charge' => { + 'amount' => 'amount', + }, + 'svc_wo' => { + 'worker' => 'Worker', + '_date' => 'Date', + }, + 'svc_www' => { + #'recnum' => '', + #'usersvc' => '', + }, +); + +# 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 +) ) { + + my(@rows)=map { /^${svcdb}__(.*)$/; $1 } + grep ! /_flag$/, + grep /^${svcdb}__/, + fields('part_svc'); + #my($rowspan)=scalar(@rows); + + #my($ptmp)="$svcdb"; +# $visibility = $svcdb eq $part_svc->svcdb ? "SHOW" : "HIDDEN"; +# $visibility = $svcdb eq $p_svcdb ? "visible" : "hidden"; + my $visibility = "hidden"; +%> + + + + + +<% + print "$svcdb" unless $svcdb eq 'konq_kludge'; + print "
" unless $svcdb eq 'konq_kludge'; + + my($row); + foreach $row (@rows) { + my $value = $part_svc->getfield($svcdb. '__'. $row); + my $flag = $part_svc->getfield($svcdb. '__'. $row. '_flag'); + #print "$ptmp"; + print qq!"; + print qq!\n"; + #$ptmp=''; + } + print "
FieldModifier
$row"; + print "
$row"; + print "- $defs{$svcdb}{$row}" + if defined $defs{$svcdb}{$row}; + print "OffDefault "; + print qq!Fixed "; + print qq!!, + "
" unless $svcdb eq 'konq_kludge'; + +print qq!\n
! unless $svcdb eq 'konq_kludge'; + + print "
"; + print < + if (document.getElementById) { + document.write(""); + } else { + document.write(""); + } + +END +} +#print ""; +%> + + + + + + -- cgit v1.2.1 From 30d1e222f793498b0704de73b9d66edf3e1a6fb9 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 11 Aug 2001 04:55:03 +0000 Subject: don't have any other choices in svcdb dropdown for existing services, since you can't change it anyway --- httemplate/edit/part_svc.cgi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index cc0ee6fd0..6617d25ed 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -86,8 +86,11 @@ function changed(what) { <% } %> } +<% my @dbs = $hashref->{svcdb} + ? ( $hashref->{svcdb} ) + : qw( svc_acct svc_domain svc_acct_sm svc_www ); %> Table -- cgit v1.2.1 From 3d726debcb197b4304208eb758dc9ede7f619f86 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 11 Aug 2001 23:19:09 +0000 Subject: better error checking, fix scalar context to $cgi->keywords --- httemplate/edit/part_svc.cgi | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 6617d25ed..7fadf000f 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% 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 {}; } -- cgit v1.2.1 From 8a8c9386cbd3383b0134aae8e32b5995f8886fb2 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 19 Aug 2001 15:53:36 +0000 Subject: added user interface for svc_forward and vpopmail support --- httemplate/edit/part_svc.cgi | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 7fadf000f..b8715fb49 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -51,7 +51,8 @@ Service Services are items you offer to your customers.
  • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
  • svc_domain - Virtual domains -
  • svc_acct_sm - Virtual domain mail aliasing +
  • svc_acct_sm - Virtual domain mail aliasing (*depreciated*) +
  • svc_forward - mail forwarding
  • svc_www - Virtual domain website + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -104,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 0e0 [zero e zero] to enable export to RADIUS without a Framed-IP-Address.)', 'popnum' => qq!POP number!, 'username' => 'Username', 'quota' => '(unimplemented)', @@ -112,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 shells configuration file)', 'finger' => 'GECOS', + 'domsvc' => 'svcnum from svc_domain', }, 'svc_domain' => { 'domain' => 'Domain', -- cgit v1.2.1 From 1e4aa8069f25e1b4101da20bb9e0d3f60357ea52 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 4 Sep 2001 14:44:07 +0000 Subject: new admin documentation, quick one-pkg order --- httemplate/edit/part_svc.cgi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 5696e43f8..01574e992 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -31,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()\"" ) @@ -50,8 +50,8 @@ Service Services are items you offer to your customers.
    • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts -
    • svc_domain - Virtual domains -
    • svc_acct_sm - Virtual domain mail aliasing (*depreciated*) +
    • svc_domain - Domains +
    • svc_acct_sm - depreciated (use svc_forward for new installations) Virtual domain mail aliasing.
    • svc_forward - mail forwarding
    • svc_www - Virtual domain website + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -145,10 +145,9 @@ foreach my $svcdb ( qw( konq_kludge svc_acct svc_domain svc_acct_sm svc_forward svc_www ) ) { - my(@rows)=map { /^${svcdb}__(.*)$/; $1 } - grep ! /_flag$/, - grep /^${svcdb}__/, - fields('part_svc'); + my(@fields) = $svcdb eq 'konq_kludge' + ? () + : grep { $_ ne 'svcnum' } fields($svcdb) ); #my($rowspan)=scalar(@rows); #my($ptmp)="$svcdb"; @@ -177,22 +176,26 @@ function fixup(what) { print "$svcdb" unless $svcdb eq 'konq_kludge'; print "
      " unless $svcdb eq 'konq_kludge'; - my($row); - foreach $row (@rows) { - my $value = $part_svc->getfield($svcdb. '__'. $row); - my $flag = $part_svc->getfield($svcdb. '__'. $row. '_flag'); - #print "$ptmp$ptmp"; - print qq!"; - print qq!\n"; #$ptmp=''; } -- cgit v1.2.1 From f5266a4d07d116efd732f433d0f4f3a47b143a7d Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 00:08:18 +0000 Subject: faster (cached) fuzzy searches prelim. job queues! fixed part_svc editing --- httemplate/edit/part_svc.cgi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index c0d632fa5..c0a789667 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -147,7 +147,7 @@ foreach my $svcdb ( qw( my(@fields) = $svcdb eq 'konq_kludge' ? () - : grep { $_ ne 'svcnum' } fields($svcdb) ); + : grep { $_ ne 'svcnum' } fields($svcdb); #my($rowspan)=scalar(@rows); #my($ptmp)=""; @@ -180,7 +180,7 @@ function fixup(what) { my $part_svc_column = $part_svc->part_svc_column($field); my $value = $cgi->param('error') ? $cgi->param("${svcdb}__${field}") - : $$part_svc_column->columnvalue; + : $part_svc_column->columnvalue; my $flag = $cgi->param('error') ? $cgi->param("${svcdb}__${field}_flag") : $part_svc_column->columnflag; -- cgit v1.2.1 From 842df85f746a2e1b961d6c9e3a8c5cc3678ae6dd Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 03:15:58 +0000 Subject: cyrus support --- httemplate/edit/part_svc.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index c0a789667..0deed7b99 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -107,7 +107,7 @@ my %defs = ( '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 0e0 [zero e zero] to enable export to RADIUS without a Framed-IP-Address.)', 'popnum' => qq!POP number!, 'username' => 'Username', - 'quota' => '(unimplemented)', + 'quota' => '', '_password' => 'Password', 'gid' => 'GID (when blank, defaults to UID)', 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', -- cgit v1.2.1 From a97f85810afbd1db0ffa0cf581d074f51ca13ef8 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 12:42:54 +0000 Subject: fix service editing --- httemplate/edit/part_svc.cgi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 0deed7b99..e16f48e3a 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -145,9 +145,13 @@ foreach my $svcdb ( qw( konq_kludge svc_acct svc_domain svc_acct_sm svc_forward svc_www ) ) { - my(@fields) = $svcdb eq 'konq_kludge' - ? () - : grep { $_ ne 'svcnum' } fields($svcdb); +# my(@fields) = $svcdb eq 'konq_kludge' +# ? () +# : grep { $_ ne 'svcnum' } fields($svcdb); + #yucky kludge + my(@fields) = defined( $FS::Record::dbdef->table($svcdb) ) + ? grep { $_ ne 'svcnum' } fields($svcdb) + : (); #my($rowspan)=scalar(@rows); #my($ptmp)=""; -- cgit v1.2.1 From 58747692435f28de1c13496525af679659511b05 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 11 Sep 2001 19:16:41 +0000 Subject: forgot closing form tag, breaks ie, others? --- httemplate/edit/part_svc.cgi | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index e16f48e3a..7797230e8 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -44,10 +44,9 @@ function visualize(what) {
      Service Part #<%= $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %> - -
      +

      Service -
      +

      Services are items you offer to your customers.
      • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
      • svc_domain - Domains @@ -95,7 +94,7 @@ Table + <% #these might belong somewhere else for other user interfaces -- cgit v1.2.1 From a6d3e4dc73803cffad96fd4b6270b2fb5f4b0568 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 15 Oct 2001 10:42:29 +0000 Subject: price plans web gui 1st pass, oh my --- httemplate/edit/part_svc.cgi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 7797230e8..29778567e 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -65,7 +65,6 @@ blank slipip as well as a fixed shell something like /bin/true or

        + <% print "$svcdb" unless $svcdb eq 'konq_kludge'; -- cgit v1.2.1 From 1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 30 Jan 2002 14:18:09 +0000 Subject: remove use Module; and $cgi = new CGI; &cgisuidsetup(); from all templates. should work better under Mason. --- httemplate/edit/part_svc.cgi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index f2555a29f..39f49e14c 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,4 @@ - + <% my $part_svc; if ( $cgi->param('error') ) { #error @@ -51,7 +51,7 @@ Disable new orders
      • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
      • svc_domain - Domains -
      • svc_acct_sm - depreciated (use svc_forward for new installations) Virtual domain mail aliasing. +
      • svc_acct_sm - deprecated (use svc_forward for new installations) Virtual domain mail aliasing.
      • svc_forward - mail forwarding
      • svc_www - Virtual domain website from all files to fix any redirects, whew Mason handler.pl overrides CGI::redirect fixed strict; problems in edit/part_pkg.cgi & edit/process/part_pkg.cgi --- httemplate/edit/part_svc.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 39f49e14c..91995674a 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,4 +1,3 @@ - <% my $part_svc; if ( $cgi->param('error') ) { #error -- cgit v1.2.1 From a4c96748eb6eab29a70f3a944c6520283a635c78 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 10 Feb 2002 16:05:22 +0000 Subject: *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. *finally* seems to be working under Mason. sheesh. --- httemplate/edit/part_svc.cgi | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 91995674a..63ec1dce1 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,3 +1,4 @@ + <% my $part_svc; if ( $cgi->param('error') ) { #error -- cgit v1.2.1 From 8fe3fe6ae4075fab902685fd145c48122baedfcb Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 12 Feb 2002 01:13:23 +0000 Subject: service definition domsvc is now a domain pulldown closes: Bug#328 --- httemplate/edit/part_svc.cgi | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 63ec1dce1..ee0457bae 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -111,7 +111,13 @@ 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 shells configuration file)', 'finger' => 'GECOS', - 'domsvc' => 'svcnum from svc_domain', + 'domsvc' => { + desc =>'svcnum from svc_domain', + type =>'select', + select_table => 'svc_domain', + select_key => 'svcnum', + select_label => 'domain', + }, }, 'svc_domain' => { 'domain' => 'Domain', @@ -194,8 +200,10 @@ function fixup(what) { : $part_svc_column->columnflag; #print "
      $ptmp"; print qq!"; @@ -203,8 +211,24 @@ function fixup(what) { ' CHECKED'x($flag eq 'D'). ">Default "; print qq!Fixed "; - print qq!!, - "\n"; + print '
      '; + if ( ref($def) ) { + if ( $def->{type} eq 'select' ) { + print qq!!; + } + print "\n"; #$ptmp=''; } print "
      FieldModifier
      $row"; - print "
      $row"; - print "- $defs{$svcdb}{$row}" - if defined $defs{$svcdb}{$row}; + foreach my $field (@fields) { + my $part_svc_column = $part_svc->part_svc_column($field); + my $value = $cgi->param('error') + ? $cgi->param("${svcdb}__${field}") + : $$part_svc_column->columnvalue; + my $flag = $cgi->param('error') + ? $cgi->param("${svcdb}__${field}_flag") + : $part_svc_column->columnflag; + #print "
      $field"; + print "
      $field"; + print "- $defs{$svcdb}{$field}" + if defined $defs{$svcdb}{$field}; print "OffDefault "; - print qq!Fixed "; - print qq!!, + print qq!!, "
      $svcdb$svcdb
      $field"; print "
      $field"; - print "- $defs{$svcdb}{$field}" - if defined $defs{$svcdb}{$field}; + my $def = $defs{$svcdb}{$field}; + my $desc = ref($def) ? $def->{desc} : $def; + + print "- $desc" if $desc; print "Off
      " unless $svcdb eq 'konq_kludge'; -- cgit v1.2.1 From 69569a366264e4114f37d0e1036b5a09ceb56fd7 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 12 Feb 2002 01:25:06 +0000 Subject: red warning for unknown type :) --- httemplate/edit/part_svc.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index ee0457bae..c3a4942ea 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -223,7 +223,7 @@ function fixup(what) { $record->getfield($def->{select_label}); } } else { - print 'UNKNOWN TYPE '. $def->{type}; + print 'unknown type'. $def->{type}; } } else { print qq!!; -- cgit v1.2.1 From 412e2892a324cdd838f4a790102359adcc9b7400 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 18 Feb 2002 03:45:21 +0000 Subject: fix modified !; - print '' unless $value; foreach my $record ( qsearch( $def->{select_table}, {} ) ) { + warn $rvalue; my $rvalue = $record->getfield($def->{select_key}); print qq!'; } + print ''; } else { print 'unknown type'. $def->{type}; } -- cgit v1.2.1 From 0ab8b21b9b39d9349c94e6cea10dbb006ff176a5 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 18 Feb 2002 20:09:12 +0000 Subject: bad warning, causing errors with strict --- httemplate/edit/part_svc.cgi | 1 - 1 file changed, 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 918e6ab9c..57ab3985e 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -224,7 +224,6 @@ function fixup(what) { print qq!
      Disable new orders {disabled} eq 'Y' ? ' CHECKED' : '' %>>
      +
      Services are items you offer to your customers.
      • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts @@ -64,37 +56,6 @@ values. For example, a SLIP/PPP account may have a default (or perhaps fixed) blank slipip as well as a fixed shell something like /bin/true or /usr/bin/passwd.

        - -<% my @dbs = $hashref->{svcdb} - ? ( $hashref->{svcdb} ) - : qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www ); %> -Table <% #these might belong somewhere else for other user interfaces @@ -152,121 +113,81 @@ 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_forward svc_www -) ) { - -# my(@fields) = $svcdb eq 'konq_kludge' -# ? () -# : grep { $_ ne 'svcnum' } fields($svcdb); - #yucky kludge - my(@fields) = defined( $FS::Record::dbdef->table($svcdb) ) - ? grep { $_ ne 'svcnum' } fields($svcdb) - : (); - #my($rowspan)=scalar(@rows); - - #my($ptmp)="$svcdb"; -# $visibility = $svcdb eq $part_svc->svcdb ? "SHOW" : "HIDDEN"; -# $visibility = $svcdb eq $p_svcdb ? "visible" : "hidden"; - my $visibility = "hidden"; -%> - -
        - - - - -<% - #print "$svcdb
        " unless $svcdb eq 'konq_kludge'; - print table(). "FieldModifier" unless $svcdb eq 'konq_kludge'; - - foreach my $field (@fields) { - my $part_svc_column = $part_svc->part_svc_column($field); - my $value = $cgi->param('error') - ? $cgi->param("${svcdb}__${field}") - : $part_svc_column->columnvalue; - my $flag = $cgi->param('error') - ? $cgi->param("${svcdb}__${field}_flag") - : $part_svc_column->columnflag; - #print "$ptmp$field"; - print "$field"; - my $def = $defs{$svcdb}{$field}; - my $desc = ref($def) ? $def->{desc} : $def; - - print "- $desc" if $desc; - print ""; - print qq!Off"; - print qq!Default "; - print qq!Fixed "; - print '
        '; - if ( ref($def) ) { - if ( $def->{type} eq 'select' ) { - print qq!!. + table(). "FieldModifier"; + #yucky kludge + my @fields = defined( $FS::Record::dbdef->table($layer) ) + ? grep { $_ ne 'svcnum' } fields($layer) + : (); + foreach my $field (@fields) { + my $part_svc_column = $part_svc->part_svc_column($field); + my $value = $cgi->param('error') + ? $cgi->param("${layer}__${field}") + : $part_svc_column->columnvalue; + my $flag = $cgi->param('error') + ? $cgi->param("${layer}__${field}_flag") + : $part_svc_column->columnflag; + my $def = $defs{$layer}{$field}; + my $desc = ref($def) ? $def->{desc} : $def; + + $html .= "$field"; + $html .= "- $desc" if $desc; + $html .= ""; + $html .= + qq!Off". + qq!Default ". + qq!Fixed ". + '
        '; + if ( ref($def) ) { + if ( $def->{type} eq 'select' ) { + $html .= qq!'; + } else { + $html .= 'unknown type'. $def->{type}; + } + } else { + $html .= + qq!!; } - print ''; - } else { - print 'unknown type'. $def->{type}; + $html .= "\n"; } - } else { - print qq!!; - } - print "\n"; - #$ptmp=''; - } - print "" unless $svcdb eq 'konq_kludge'; + $html .= ""; -print qq!\n
        ! unless $svcdb eq 'konq_kludge'; + $html .= '
        '; - print ""; - print < - if (document.getElementById) { - document.write(""); - } else { - document.write(""); - } - -END -} -#print ""; -%> + $html; - + }, + ); +%> +Table <%= $widget->html %> -- cgit v1.2.1 From 20bb426a02c0ea54d8feaea7c5da51735ab70293 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 22 Mar 2002 18:56:33 +0000 Subject: RADIUS groups on the way! --- httemplate/edit/part_svc.cgi | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 3292a9b9b..b1bb7f3d3 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -86,6 +86,10 @@ my %defs = ( select_key => 'svcnum', select_label => 'domain', }, + 'radius_groups' => { + desc =>'ICRADIUS/FreeRADIUS groups', + type =>'radius_usergroup_selector', + }, }, 'svc_domain' => { 'domain' => 'Domain', -- cgit v1.2.1 From 74e64d70361848f089aad9a7881c2af9caf6e479 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 23 Mar 2002 17:49:01 +0000 Subject: okay group editing UI as well as part_svc group editing UI seem to be working --- httemplate/edit/part_svc.cgi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index b1bb7f3d3..b4900a01c 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -86,10 +86,10 @@ my %defs = ( select_key => 'svcnum', select_label => 'domain', }, - 'radius_groups' => { - desc =>'ICRADIUS/FreeRADIUS groups', - type =>'radius_usergroup_selector', - }, + 'usergroup' => { + desc =>'ICRADIUS/FreeRADIUS groups', + type =>'radius_usergroup_selector', + }, }, 'svc_domain' => { 'domain' => 'Domain', @@ -138,6 +138,7 @@ my %defs = ( my @fields = defined( $FS::Record::dbdef->table($layer) ) ? grep { $_ ne 'svcnum' } fields($layer) : (); + push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge foreach my $field (@fields) { my $part_svc_column = $part_svc->part_svc_column($field); my $value = $cgi->param('error') @@ -171,6 +172,9 @@ my %defs = ( $record->getfield($def->{select_label}). ''; } $html .= ''; + } elsif ( $def->{type} eq 'radius_usergroup_selector' ) { + $html .= FS::svc_acct::radius_usergroup_selector( + [ split(',', $value) ], "${layer}__${field}" ); } else { $html .= 'unknown type'. $def->{type}; } -- cgit v1.2.1 From e6ea57971831f25d682d97a0ba508c39b66ecd8b Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 12 Apr 2002 13:22:03 +0000 Subject: - should finish off the part_svc -> part_export s/one-to-many/many-to-many/ transition (closes: Bug#375) - fixes a nasty export scoping bug with message catalogs, whew --- httemplate/edit/part_svc.cgi | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index b4900a01c..e9c571f9c 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -132,8 +132,30 @@ my %defs = ( 'form_checkbox' => [ 'disabled' ], 'layer_callback' => sub { my $layer = shift; - my $html = qq!!. - table(). "FieldModifier"; + my $html = qq!!; + + my $columns = 3; + my $count = 0; + my @part_export = + grep { $layer eq FS::part_export::exporttype2svcdb($_->exporttype) } + qsearch( 'part_export', {} ); + $html .= '

        '. table(). + table(). "Exports"; + foreach my $part_export ( @part_export ) { + $html .= ' $part_export->exportnum, + svcpart => $part_svc->svcpart }); + $html .= '> '. $part_export->exporttype. ' to '. $part_export->machine. + ''; + $count++; + $html .= '' unless $count % $columns; + } + $html .= '

        '; + + $html .= table(). "FieldModifier"; #yucky kludge my @fields = defined( $FS::Record::dbdef->table($layer) ) ? grep { $_ ne 'svcnum' } fields($layer) -- cgit v1.2.1 From 3f9ac2ff50fff9d55ff5976ee1417dc6ba56f39e Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 16 May 2002 13:42:54 +0000 Subject: service definition cloning --- httemplate/edit/part_svc.cgi | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index e9c571f9c..f2073f935 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,10 +1,17 @@ <% my $part_svc; + my $clone = ''; if ( $cgi->param('error') ) { #error $part_svc = new FS::part_svc ( { map { $_, scalar($cgi->param($_)) } fields('part_svc') } ); + } elsif ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone + #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query"; + $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } ) + or die "unknown svcpart: $1"; + $clone = $part_svc->svcpart; + $part_svc->svcpart(''); } elsif ( $cgi->keywords ) { #edit my($query) = $cgi->keywords; $query =~ /^(\d+)$/ or die "malformed query: $query"; @@ -146,8 +153,8 @@ my %defs = ( ' NAME="exportnum'. $part_export->exportnum. '" VALUE="1" '; $html .= 'CHECKED' if qsearchs( 'export_svc', { - exportnum => $part_export->exportnum, - svcpart => $part_svc->svcpart }); + exportnum => $part_export->exportnum, + svcpart => $clone || $part_svc->svcpart }); $html .= '> '. $part_export->exporttype. ' to '. $part_export->machine. ''; $count++; @@ -161,6 +168,7 @@ my %defs = ( ? grep { $_ ne 'svcnum' } fields($layer) : (); push @fields, 'usergroup' if $layer eq 'svc_acct'; #kludge + $part_svc->svcpart($clone) if $clone; #haha, undone below foreach my $field (@fields) { my $part_svc_column = $part_svc->part_svc_column($field); my $value = $cgi->param('error') @@ -206,6 +214,7 @@ my %defs = ( } $html .= "\n"; } + $part_svc->svcpart('') if $clone; #undone $html .= ""; $html .= '
        Exports"; foreach my $part_export ( @part_export ) { $html .= ' Date: Sat, 15 Jun 2002 01:12:29 +0000 Subject: mark@pc-intouch.com: exporttype2svcdb removal --- httemplate/edit/part_svc.cgi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 36f764140..4ccb770fb 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -144,10 +144,8 @@ my %defs = ( my $columns = 3; my $count = 0; my @part_export = -# grep { $layer eq FS::part_export::exporttype2svcdb($_->exporttype) } -# qsearch( 'part_export', {} ); - map { qsearch( 'part_export', {exporttype => $_ } ) } - keys(%{FS::part_export::export_info($layer)}); + map { qsearch( 'part_export', {exporttype => $_ } ) } + keys %{FS::part_export::export_info($layer)}; $html .= '

        '. table(). table(). "Exports"; foreach my $part_export ( @part_export ) { -- cgit v1.2.1 From 44398c83f25bf4e43838df9f39331c29fdeff19d Mon Sep 17 00:00:00 2001 From: khoff Date: Mon, 9 Sep 2002 23:05:30 +0000 Subject: svc_broadband merge --- httemplate/edit/part_svc.cgi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 4ccb770fb..a23107a40 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -53,6 +53,7 @@ Services are items you offer to your customers.
      • svc_acct_sm - deprecated (use svc_forward for new installations) Virtual domain mail aliasing.
      • svc_forward - mail forwarding
      • svc_www - Virtual domain website +
      • svc_broadband - Broadband/High-speed Internet service @@ -122,11 +123,21 @@ 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_acct_sm svc_forward svc_www ); + : qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www svc_broadband ); tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs; my $widget = new HTML::Widgets::SelectLayers( -- cgit v1.2.1 From 3595c874f8e476e58b98b7ab6d86918d4dbb1d5c Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 17 Sep 2002 09:19:42 +0000 Subject: remove svc_acct_sm --- httemplate/edit/part_svc.cgi | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index a23107a40..b2862f5a3 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -50,7 +50,6 @@ Disable new orders
      • svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
      • svc_domain - Domains -
      • svc_acct_sm - deprecated (use svc_forward for new installations) Virtual domain mail aliasing.
      • svc_forward - mail forwarding
      • svc_www - Virtual domain website
      • svc_broadband - Broadband/High-speed Internet service @@ -102,11 +101,6 @@ 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', @@ -137,7 +131,7 @@ my %defs = ( my @dbs = $hashref->{svcdb} ? ( $hashref->{svcdb} ) - : qw( svc_acct svc_domain svc_acct_sm svc_forward svc_www svc_broadband ); + : qw( svc_acct svc_domain svc_forward svc_www svc_broadband ); tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs; my $widget = new HTML::Widgets::SelectLayers( -- cgit v1.2.1 From f076e082da5f5ec892e2ff6919e478baa1fd2274 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 21 Oct 2002 15:14:07 +0000 Subject: Prevent a fixed or default username or password from being defined --- httemplate/edit/part_svc.cgi | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index b2862f5a3..f1d42f341 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -80,7 +80,10 @@ my %defs = ( select_key => 'popnum', select_label => 'city', }, - 'username' => 'Username', + 'username' => { + desc => 'Username', + type => 'disabled', + }, 'quota' => '', '_password' => 'Password', 'gid' => 'GID (when blank, defaults to UID)', @@ -188,15 +191,20 @@ my %defs = ( $html .= "$field"; $html .= "- $desc" if $desc; $html .= ""; - $html .= - qq!Off". - qq!Default ". - qq!Fixed ". - '
        '; if ( ref($def) ) { + $flag = '' if $def->{type} eq 'disabled'; + $html .= + qq!Off". + ''; + unless ( $def->{type} eq 'disabled' ) { + $html .= + qq!Default ". + qq!Fixed ". + '
        '; + } if ( $def->{type} eq 'select' ) { $html .= qq!!; } else { $html .= 'unknown type'. $def->{type}; } -- cgit v1.2.1 From 7c220a811b73a1d237cf0ffd09c48a80ff985a3b Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 21 Oct 2002 15:20:41 +0000 Subject: don't disable for all items --- httemplate/edit/part_svc.cgi | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index f1d42f341..5fbec4f88 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -191,20 +191,20 @@ my %defs = ( $html .= "$field"; $html .= "- $desc" if $desc; $html .= ""; + $flag = '' if ref($def) && $def->{type} eq 'disabled'; + $html .= + qq!Off". + ''; + unless ( ref($def) && $def->{type} eq 'disabled' ) { + $html .= + qq!Default ". + qq!Fixed ". + '
        '; + } if ( ref($def) ) { - $flag = '' if $def->{type} eq 'disabled'; - $html .= - qq!Off". - ''; - unless ( $def->{type} eq 'disabled' ) { - $html .= - qq!Default ". - qq!Fixed ". - '
        '; - } if ( $def->{type} eq 'select' ) { $html .= qq! $part_export->exportnum, svcpart => $clone || $part_svc->svcpart }); - $html .= '> '. $part_export->exporttype. ' to '. $part_export->machine. - ''; + $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype. + ' to '. $part_export->machine. ''; $count++; $html .= '' unless $count % $columns; } -- cgit v1.2.1 From 50dbca8812cac271c584cbe5629d4583cd11a01c Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 16 Dec 2002 21:52:01 +0000 Subject: fix for Pg 7.3, are there others? --- httemplate/edit/part_svc.cgi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 0ee0a468a..d0cc9b645 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -160,7 +160,8 @@ my %defs = ( $html .= 'svcpart ) #null svcpart search causing error + && qsearchs( 'export_svc', { exportnum => $part_export->exportnum, svcpart => $clone || $part_svc->svcpart }); $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype. -- cgit v1.2.1 From db57fc8a00107bdbf5830b5c11b53dd0cfd7ec3b Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 13 Jan 2003 06:19:50 +0000 Subject: whitespace inconsistancy causing extraneous diffs --- httemplate/edit/part_svc.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index d0cc9b645..d4bb4704c 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -164,7 +164,7 @@ my %defs = ( && qsearchs( 'export_svc', { exportnum => $part_export->exportnum, svcpart => $clone || $part_svc->svcpart }); - $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype. + $html .= '>'. $part_export->exportnum. ': '. $part_export->exporttype. ' to '. $part_export->machine. ''; $count++; $html .= '' unless $count % $columns; -- cgit v1.2.1 From 58d44fbe5eb9ab32e6d87063a4a3b22ddba9a828 Mon Sep 17 00:00:00 2001 From: khoff Date: Tue, 5 Aug 2003 00:20:51 +0000 Subject: Virtual field merge --- httemplate/edit/part_svc.cgi | 72 +++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 21 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index d4bb4704c..45e0b6ffe 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -65,6 +65,9 @@ blank slipip as well as a fixed shell something like /bin/true or

        <% + +my %vfields; + #these might belong somewhere else for other user interfaces #pry need to eventually create stuff that's shared amount UIs my %defs = ( @@ -109,29 +112,43 @@ my %defs = ( 'dstsvc' => 'service to which mail is to be forwarded', 'dst' => 'someone@another.domain.com to use when dstsvc is 0', }, - 'svc_charge' => { - 'amount' => 'amount', - }, - 'svc_wo' => { - 'worker' => 'Worker', - '_date' => 'Date', - }, +# 'svc_charge' => { +# 'amount' => 'amount', +# }, +# 'svc_wo' => { +# 'worker' => 'Worker', +# '_date' => 'Date', +# }, 'svc_www' => { #'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', + 'blocknum' => 'Address block.', }, ); + foreach $svcdb (keys(%defs)) { + my $self = "FS::$svcdb"->new; + $vfields{$svcdb} = {}; + foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them + my $pvf = $self->pvf($field); + my @list = $pvf->list; + if (scalar @list) { + $defs{$svcdb}->{$field} = { desc => $pvf->label, + type => 'select', + select_list => \@list }; + } else { + $defs{$svcdb}->{$field} = $pvf->label; + } #endif + $vfields{$svcdb}->{$field} = $pvf; + warn "\$vfields{$svcdb}->{$field} = $pvf"; + } #next $field + } #next $svcdb + my @dbs = $hashref->{svcdb} ? ( $hashref->{svcdb} ) : qw( svc_acct svc_domain svc_forward svc_www svc_broadband ); @@ -157,7 +174,7 @@ my %defs = ( $html .= '

        '. table(). table(). "Exports"; foreach my $part_export ( @part_export ) { - $html .= 'svcpart ) #null svcpart search causing error @@ -202,19 +219,27 @@ my %defs = ( qq!Default ". qq!Fixed ". - '
        '; + ' CHECKED'x($flag eq 'F'). ">Fixed "; + $html .= '
        '; } if ( ref($def) ) { if ( $def->{type} eq 'select' ) { $html .= qq!'; } elsif ( $def->{type} eq 'radius_usergroup_selector' ) { $html .= FS::svc_acct::radius_usergroup_selector( @@ -229,6 +254,11 @@ my %defs = ( $html .= qq!!; } + + if($vfields{$layer}->{$field}) { + $html .= qq!
        Excluded "; + } $html .= "\n"; } $part_svc->svcpart('') if $clone; #undone -- cgit v1.2.1 From 032f01f95762edfb8dac47c95309f0f98ced223c Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 5 Sep 2003 02:31:24 +0000 Subject: -w-safe and run under a 1.4 schema too --- httemplate/edit/part_svc.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 45e0b6ffe..18319b341 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -131,7 +131,7 @@ my %defs = ( }, ); - foreach $svcdb (keys(%defs)) { + foreach my $svcdb (grep dbdef->table($_), keys %defs ) { my $self = "FS::$svcdb"->new; $vfields{$svcdb} = {}; foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them @@ -153,7 +153,7 @@ my %defs = ( ? ( $hashref->{svcdb} ) : qw( svc_acct svc_domain svc_forward svc_www svc_broadband ); - tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } @dbs; + tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } grep dbdef->table($_), @dbs; my $widget = new HTML::Widgets::SelectLayers( #'selected_layer' => $p_svcdb, 'selected_layer' => $hashref->{svcdb} || 'svc_acct', -- cgit v1.2.1 From 36f038b92a2cc9c8f7bc52a2e11c00dbb7ed6ce0 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 3 Nov 2003 11:30:42 +0000 Subject: kludge around this so i can add service definitions for now --- httemplate/edit/part_svc.cgi | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 18319b341..e033a7b09 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -131,23 +131,25 @@ my %defs = ( }, ); - foreach my $svcdb (grep dbdef->table($_), keys %defs ) { - my $self = "FS::$svcdb"->new; - $vfields{$svcdb} = {}; - foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them - my $pvf = $self->pvf($field); - my @list = $pvf->list; - if (scalar @list) { - $defs{$svcdb}->{$field} = { desc => $pvf->label, - type => 'select', - select_list => \@list }; - } else { - $defs{$svcdb}->{$field} = $pvf->label; - } #endif - $vfields{$svcdb}->{$field} = $pvf; - warn "\$vfields{$svcdb}->{$field} = $pvf"; - } #next $field - } #next $svcdb + #comment this out until it can be fixed, see bug#590 + # + #foreach my $svcdb (grep dbdef->table($_), keys %defs ) { + # my $self = "FS::$svcdb"->new; + # $vfields{$svcdb} = {}; + # foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them + # my $pvf = $self->pvf($field); + # my @list = $pvf->list; + # if (scalar @list) { + # $defs{$svcdb}->{$field} = { desc => $pvf->label, + # type => 'select', + # select_list => \@list }; + # } else { + # $defs{$svcdb}->{$field} = $pvf->label; + # } #endif + # $vfields{$svcdb}->{$field} = $pvf; + # warn "\$vfields{$svcdb}->{$field} = $pvf"; + # } #next $field + #} #next $svcdb my @dbs = $hashref->{svcdb} ? ( $hashref->{svcdb} ) -- cgit v1.2.1 From 47c39af359fc93c777714a5c50a6183747b66da9 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 3 Nov 2003 11:42:32 +0000 Subject: does this fix Bug#590?? --- httemplate/edit/part_svc.cgi | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index e033a7b09..18319b341 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -131,25 +131,23 @@ my %defs = ( }, ); - #comment this out until it can be fixed, see bug#590 - # - #foreach my $svcdb (grep dbdef->table($_), keys %defs ) { - # my $self = "FS::$svcdb"->new; - # $vfields{$svcdb} = {}; - # foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them - # my $pvf = $self->pvf($field); - # my @list = $pvf->list; - # if (scalar @list) { - # $defs{$svcdb}->{$field} = { desc => $pvf->label, - # type => 'select', - # select_list => \@list }; - # } else { - # $defs{$svcdb}->{$field} = $pvf->label; - # } #endif - # $vfields{$svcdb}->{$field} = $pvf; - # warn "\$vfields{$svcdb}->{$field} = $pvf"; - # } #next $field - #} #next $svcdb + foreach my $svcdb (grep dbdef->table($_), keys %defs ) { + my $self = "FS::$svcdb"->new; + $vfields{$svcdb} = {}; + foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them + my $pvf = $self->pvf($field); + my @list = $pvf->list; + if (scalar @list) { + $defs{$svcdb}->{$field} = { desc => $pvf->label, + type => 'select', + select_list => \@list }; + } else { + $defs{$svcdb}->{$field} = $pvf->label; + } #endif + $vfields{$svcdb}->{$field} = $pvf; + warn "\$vfields{$svcdb}->{$field} = $pvf"; + } #next $field + } #next $svcdb my @dbs = $hashref->{svcdb} ? ( $hashref->{svcdb} ) -- cgit v1.2.1 From 31d6d0e8d0d624cd051440acf322cd8893c1026e Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 23 Dec 2003 02:36:38 +0000 Subject: add svc_external --- httemplate/edit/part_svc.cgi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 18319b341..10e89288f 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -53,6 +53,7 @@ Services are items you offer to your customers.
      • svc_forward - mail forwarding
      • svc_www - Virtual domain website
      • svc_broadband - Broadband/High-speed Internet service +
      • svc_external - Externally-tracked service @@ -129,6 +130,10 @@ my %defs = ( 'ip_addr' => 'IP address. Leave blank for automatic assignment.', 'blocknum' => 'Address block.', }, + 'svc_external' => { + #'id' => '', + #'title' => '', + }, ); foreach my $svcdb (grep dbdef->table($_), keys %defs ) { @@ -151,7 +156,7 @@ my %defs = ( my @dbs = $hashref->{svcdb} ? ( $hashref->{svcdb} ) - : qw( svc_acct svc_domain svc_forward svc_www svc_broadband ); + : qw( svc_acct svc_domain svc_forward svc_www svc_broadband svc_external ); tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } grep dbdef->table($_), @dbs; my $widget = new HTML::Widgets::SelectLayers( -- cgit v1.2.1 From f4347a8f8e96f32125575704146bb23b422f9e6b Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 13 Feb 2004 13:53:24 +0000 Subject: typo --- httemplate/edit/part_svc.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 10e89288f..6868ffd65 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -179,7 +179,7 @@ my %defs = ( $html .= '

        '. table(). table(). "Exports"; foreach my $part_export ( @part_export ) { - $html .= 'svcpart ) #null svcpart search causing error -- cgit v1.2.1 From aef8e9696491331ed26197f43eb351ed4d416336 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 19 Aug 2004 10:53:32 +0000 Subject: shell field is now a dropdown of legal shells, closes: Bug#118 --- httemplate/edit/part_svc.cgi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 6868ffd65..72fffaeb8 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -71,6 +71,7 @@ my %vfields; #these might belong somewhere else for other user interfaces #pry need to eventually create stuff that's shared amount UIs +my $conf = new FS::Conf; my %defs = ( 'svc_acct' => { 'dir' => 'Home directory', @@ -91,7 +92,11 @@ my %defs = ( 'quota' => '', '_password' => 'Password', 'gid' => 'GID (when blank, defaults to UID)', - 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', + 'shell' => { + desc =>'Shell (all service definitions should have a default or fixed shell that is present in the shells configuration file)', + type =>'select', + select_list => [ $conf->config('shells') ], + }, 'finger' => 'GECOS', 'domsvc' => { desc =>'svcnum from svc_domain', -- cgit v1.2.1 From c70c1b17103b5bd20adb3c8a7c23ca2238fca73d Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 9 Sep 2004 12:04:53 +0000 Subject: rework edit/part_svc.cgi so it doesn't use a separate process/ file, this allows large error messages to be displayed properly --- httemplate/edit/part_svc.cgi | 105 ++++++++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 31 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 72fffaeb8..89f75a5f4 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -1,33 +1,74 @@ - -<% - my $part_svc; - my $clone = ''; - if ( $cgi->param('error') ) { #error - $part_svc = new FS::part_svc ( { - map { $_, scalar($cgi->param($_)) } fields('part_svc') - } ); - } elsif ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone - #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query"; - $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } ) - or die "unknown svcpart: $1"; - $clone = $part_svc->svcpart; - $part_svc->svcpart(''); - } elsif ( $cgi->keywords ) { #edit - 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 {}; - } - my $action = $part_svc->svcpart ? 'Edit' : 'Add'; - my $hashref = $part_svc->hashref; +<% +my $part_svc; +my $clone = ''; +my $error = ''; +if ( $cgi->param('magic') eq 'process' ) { + + my $svcpart = $cgi->param('svcpart'); + my $old = qsearchs('part_svc', { 'svcpart' => $svcpart }) if $svcpart; + + $cgi->param( 'svc_acct__usergroup', + join(',', $cgi->param('svc_acct__usergroup') ) ); + + my $new = new FS::part_svc ( { + map { + $_, scalar($cgi->param($_)); + # } qw(svcpart svc svcdb) + } ( fields('part_svc'), + map { my $svcdb = $_; + my @fields = fields($svcdb); + 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 ) + ) + } ); + + my %exportnums = + map { $_->exportnum => $cgi->param('exportnum'.$_->exportnum) } + qsearch('part_export', {} ); + + if ( $svcpart ) { + $error = $new->replace($old, '1.3-COMPAT', [ 'usergroup' ], \%exportnums ); + } else { + $error = $new->insert( [ 'usergroup' ], \%exportnums ); + $svcpart = $new->getfield('svcpart'); + } + + unless ( $error ) { #no error, redirect + #print $cgi->redirect(popurl(3)."browse/part_svc.cgi"); + print $cgi->redirect("${p}browse/part_svc.cgi"); + myexit; + } + + $part_svc = $new; #?? + #$part_svc = new FS::part_svc ( { + # map { $_, scalar($cgi->param($_)) } fields('part_svc') + #} ); + +} elsif ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {#clone + #$cgi->param('clone') =~ /^(\d+)$/ or die "malformed query: $query"; + $part_svc = qsearchs('part_svc', { 'svcpart'=>$1 } ) + or die "unknown svcpart: $1"; + $clone = $part_svc->svcpart; + $part_svc->svcpart(''); +} elsif ( $cgi->keywords ) { #edit + 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 {}; +} + +my $action = $part_svc->svcpart ? 'Edit' : 'Add'; +my $hashref = $part_svc->hashref; # my $p_svcdb = $part_svc->svcdb || 'svc_acct'; #" onLoad=\"visualize()\"" %> - + <%= header("$action Service Definition", menubar( 'Main Menu' => $p, 'View all service definitions' => "${p}browse/part_svc.cgi" @@ -35,8 +76,8 @@ ) %> -<% if ( $cgi->param('error') ) { %> -Error: <%= $cgi->param('error') %> +<% if ( $error ) { %> +Error: <%= $error %> <% } %>
        @@ -45,6 +86,7 @@

        Service
        Disable new orders {disabled} eq 'Y' ? ' CHECKED' : '' %>>
        +
        Services are items you offer to your customers. @@ -169,8 +211,9 @@ my %defs = ( 'selected_layer' => $hashref->{svcdb} || 'svc_acct', 'options' => \%svcdb, 'form_name' => 'dummy', - 'form_action' => 'process/part_svc.cgi', - 'form_text' => [ qw( svc svcpart ) ], + #'form_action' => 'process/part_svc.cgi', + 'form_action' => 'part_svc.cgi', #self + 'form_text' => [ qw( magic svc svcpart ) ], 'form_checkbox' => [ 'disabled' ], 'layer_callback' => sub { my $layer = shift; @@ -207,10 +250,10 @@ my %defs = ( $part_svc->svcpart($clone) if $clone; #haha, undone below foreach my $field (@fields) { my $part_svc_column = $part_svc->part_svc_column($field); - my $value = $cgi->param('error') + my $value = $error ? $cgi->param("${layer}__${field}") : $part_svc_column->columnvalue; - my $flag = $cgi->param('error') + my $flag = $error ? $cgi->param("${layer}__${field}_flag") : $part_svc_column->columnflag; my $def = $defs{$layer}{$field}; -- cgit v1.2.1 From 8fa7d60799d6d49bfe054e07b7b982c33772fb83 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 16 Sep 2004 13:22:51 +0000 Subject: add uid to mass duplicate checking on export changes, fix bug in new export editing, error message includes the number of duplicate customers also --- httemplate/edit/part_svc.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/edit/part_svc.cgi') diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 89f75a5f4..befd9b24a 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -25,9 +25,9 @@ if ( $cgi->param('magic') eq 'process' ) { } ); my %exportnums = - map { $_->exportnum => $cgi->param('exportnum'.$_->exportnum) } + map { $_->exportnum => ( $cgi->param('exportnum'.$_->exportnum) || '') } qsearch('part_export', {} ); - + if ( $svcpart ) { $error = $new->replace($old, '1.3-COMPAT', [ 'usergroup' ], \%exportnums ); } else { -- cgit v1.2.1