From: ivan Date: Wed, 10 Apr 2002 13:42:49 +0000 (+0000) Subject: bulk checkin from working on the road: X-Git-Tag: freeside_1_4_0_pre12~98 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=0b65ce59c7d2ee712389c27954382274ddf718a5 bulk checkin from working on the road: - use msgcat for more error messages - should be all things that would come3 back from the signup server normally now - signup server: don't display access number ' unless @$pops; + return $pops->[0]{city}. ', '. $pops->[0]{state}. + ' ('. $pops->[0]{ac}. ')/'. $pops->[0]{exch}. + '' + if scalar(@$pops) == 1; + my %pop = (); push @{ $pop{$_->{state}} }, $_ foreach @$pops; @@ -359,6 +367,13 @@ sub success_default { #html to use if you don't specify a success file Signup successful Signup successful

Thanks for signing up! +

+Signup information for <%= $email_name %>: +

+Username: <%= $username %>
+Password: <%= $password %>
+Access number: (<%= $ac %>) / $exch - $local
+Package: <%= $pkg %>
END } @@ -515,13 +530,11 @@ Contact Information Password - - (blank to generate) + Re-enter Password - - + <%= if ( $init_data->{'security_phrase'} ) { @@ -536,10 +549,14 @@ ENDOUT $OUT .= ''; } %> - - Access number - <%= popselector($popnum) %> - +<%= + if ( scalar(@$pops) ) { + $OUT .= 'Access number'. + popselector($popnum). ''; + } else { + $OUT .= popselector($popnum); + } +%>

diff --git a/fs_signup/FS-SignupClient/cgi/signup.html b/fs_signup/FS-SignupClient/cgi/signup.html index 5d2f2d9c9..6c601410c 100755 --- a/fs_signup/FS-SignupClient/cgi/signup.html +++ b/fs_signup/FS-SignupClient/cgi/signup.html @@ -148,13 +148,11 @@ Contact Information Password - - (blank to generate) + Re-enter Password - - + <%= if ( $init_data->{'security_phrase'} ) { @@ -169,10 +167,14 @@ ENDOUT $OUT .= ''; } %> - - Access number - <%= popselector($popnum) %> - +<%= + if ( scalar(@$pops) ) { + $OUT .= 'Access number'. + popselector($popnum). ''; + } else { + $OUT .= popselector($popnum); + } +%>

diff --git a/fs_signup/FS-SignupClient/cgi/success.html b/fs_signup/FS-SignupClient/cgi/success.html index 6bc2d1fd7..0119b3b5e 100644 --- a/fs_signup/FS-SignupClient/cgi/success.html +++ b/fs_signup/FS-SignupClient/cgi/success.html @@ -1,4 +1,11 @@ Signup successful Signup successful

Thanks for signing up! +

+Signup information for <%= $email_name %>: +

+Username: <%= $username %>
+Password: <%= $password %>
+Access number: (<%= $ac %>) / $exch - $local
+Package: <%= $pkg %>
diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server index 871bbdf1b..ebf424cd7 100755 --- a/fs_signup/fs_signup_server +++ b/fs_signup/fs_signup_server @@ -47,6 +47,7 @@ while (1) { warn "[fs_signup_server] Connecting to $machine...\n" if $Debug; sshopen2($machine,$reader,$writer,$fs_signupd); + my @pops = qsearch('svc_acct_pop',{} ); my $init_data = { #'_protocol' => 'signup', @@ -63,7 +64,7 @@ while (1) { qsearch( 'part_pkg', { 'disabled' => '' } ) ], - 'svc_acct_pop' => [ map { $_->hashref } qsearch ('svc_acct_pop',{} ) ], + 'svc_acct_pop' => [ map { $_->hashref } @pops ], 'security_phrase' => $conf->exists('security_phrase'), @@ -96,8 +97,9 @@ while (1) { #things that aren't necessary in base class, but are for signup server #return "Passwords don't match" # if $hashref->{'_password'} ne $hashref->{'_password2'} - $error ||= "Empty password" unless $signup_data->{'_password'}; - $error ||= "No POP selected" unless $signup_data->{'popnum'}; + $error ||= gettext('empty_password') unless $signup_data->{'_password'}; + $error ||= gettext('no_access_number_selected') + unless $signup_data->{'popnum'} || !scalar(@pops); #shares some stuff with htdocs/edit/process/cust_main.cgi... take any # common that are still here and library them. @@ -150,11 +152,30 @@ while (1) { use Tie::RefHash; tie my %hash, 'Tie::RefHash'; %hash = ( $cust_pkg => [ $svc_acct ] ); - $error ||= $cust_main->insert( \%hash, \@invoicing_list ); + $error ||= $cust_main->insert( \%hash, \@invoicing_list ); #msgcat warn "[fs_signup_server] Sending results...\n" if $Debug; print $writer $error, "\n"; + if ( $conf->config('signup_server-realtime') ) { + + my $bill_error = $cust_main->bill; + warn "[fs_signup_server] error billing new customer: $bill_error" + if $bill_error; + + $cust_main->apply_payments; + $cust_main->apply_credits; + + $bill_error = $cust_main->collect; + warn "[fs_signup_server] error collecting from new customer: $bill_error" + if $bill_error; + + if ( $cust_main->balance ) { + #should check list for errors... + $cust_main->suspend; + } + } + if ( $error && $conf->config('signup_server-email') ) { warn "[fs_signup_server] Sending email...\n" if $Debug; @@ -171,18 +192,20 @@ while (1) { "Date: ". time2str("%a, %d %b %Y %X %z", time), "Subject: FREESIDE NOTIFICATION: Signup Server", ] ); - my $message = new Mail::Internet ( - 'Header' => $header, - 'Body' => [ - "This is an automatic message from your Freeside installation\n", - "informing you a customer has signed up via the signup server:\n", - "\n", - 'custnum: '. $cust_main->custnum. "\n", - 'Name : '. $cust_main->last. ", ". $cust_main->first. "\n", - 'Agent : '. $cust_main->agent->agent. "\n", - "\n", - ], - ); + my $body = [ + "This is an automatic message from your Freeside installation\n", + "informing you a customer has signed up via the signup server:\n", + "\n", + 'custnum: '. $cust_main->custnum. "\n", + 'Name : '. $cust_main->last. ", ". $cust_main->first. "\n", + 'Agent : '. $cust_main->agent->agent. "\n", + "\n", + ]; + if ( $cust_main->balance ) { + push @$body, + "This customer has an outstanding balance and has been suspended.\n"; + } + my $message = new Mail::Internet ( 'Header' => $header, 'Body' => $body ); $!=0; $message->smtpsend( Host => $smtpmachine ) or $message->smtpsend( Host => $smtpmachine, Debug => 1 ) diff --git a/httemplate/browse/msgcat.cgi b/httemplate/browse/msgcat.cgi index 774473b36..d4adf9f1a 100755 --- a/httemplate/browse/msgcat.cgi +++ b/httemplate/browse/msgcat.cgi @@ -1,7 +1,7 @@ <% -print header("Message catalog", menubar( +print header("View Message catalog", menubar( 'Main Menu' => $p, 'Edit message catalog' => $p. "edit/msgcat.cgi", )), '
'; diff --git a/httemplate/docs/signup.html b/httemplate/docs/signup.html index 117cf2947..5168f47d6 100644 --- a/httemplate/docs/signup.html +++ b/httemplate/docs/signup.html @@ -35,28 +35,22 @@ Then: Optional: diff --git a/httemplate/docs/upgrade8.html b/httemplate/docs/upgrade8.html index a7b5853b3..d1b13fe9c 100644 --- a/httemplate/docs/upgrade8.html +++ b/httemplate/docs/upgrade8.html @@ -325,6 +325,7 @@ ALTER TABLE cust_refund DROP COLUMN crednum;
  • IMPORTANT: run bin/create-history-tables
  • IMPORTANT: After running bin/create-history-tables, run bin/dbdef-create again.
  • set the user_policy configuration value as appropriate for your site. +
  • set the locale configuration value to en_US.
  • the mxmachines, nsmachines, arecords and cnamerecords configuration values have been deprecated. Set the defaultrecords configuration value instead.
  • Create the `/usr/local/etc/freeside/cache.datasrc' directory (owned by the freeside user). diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi index 5d256c05b..ee9b1c6b3 100755 --- a/httemplate/edit/msgcat.cgi +++ b/httemplate/edit/msgcat.cgi @@ -1,11 +1,12 @@ <% -print header("Message catalog", menubar( +print header("Edit Message catalog", menubar( # 'Main Menu' => $p, )), '
    '; -print qq!Error: !. $cgi->param('error') +print qq!Error: !. $cgi->param('error'). + '

    ' if $cgi->param('error'); my $widget = new HTML::Widgets::SelectLayers( @@ -28,7 +29,7 @@ my $widget = new HTML::Widgets::SelectLayers( ''. $msgcat->msgnum. ''. $msgcat->msgcode. ''. '!; + qq!VALUE="!. ($cgi->param($msgcat->msgnum)||$msgcat->msg). qq!">!; unless ( $layer eq 'en_US' ) { my $en_msgcat = qsearchs('msgcat', { 'locale' => 'en_US', diff --git a/httemplate/edit/process/msgcat.cgi b/httemplate/edit/process/msgcat.cgi index ab30f06b5..1f94f6668 100644 --- a/httemplate/edit/process/msgcat.cgi +++ b/httemplate/edit/process/msgcat.cgi @@ -3,6 +3,7 @@ my $error; foreach my $param ( grep { /^\d+$/ } $cgi->param ) { my $old = qsearchs('msgcat', { msgnum=>$param } ); + next if $old->msg eq $cgi->param($param); #no need to update identical records my $new = new FS::msgcat { $old->hash }; $new->msg($cgi->param($param)); $error = $new->replace($old);