more per-agent options, #15973
authormark <mark>
Sun, 19 Feb 2012 02:30:17 +0000 (02:30 +0000)
committermark <mark>
Sun, 19 Feb 2012 02:30:17 +0000 (02:30 +0000)
FS/FS/ClientAPI/Signup.pm
FS/FS/Conf.pm
FS/FS/cust_main.pm
FS/FS/svc_acct.pm
httemplate/edit/cust_main/billing.html
httemplate/edit/cust_main/contact.html

index b026afd..d0d088a 100644 (file)
@@ -186,7 +186,6 @@ sub signup_info {
       'company_name'       => scalar($conf->config('company_name')),
       #per-agent?
       'agent_ship_address' => scalar($conf->exists('agent-ship_address')),
-      'require_phone'      => scalar($conf->exists('cust_main-require_phone')),
       'logo'               => scalar($conf->config_binary('logo.png')),
       'prepaid_template_custnum' => $conf->exists('signup_server-prepaid-template-custnum'),
     };
@@ -405,6 +404,9 @@ sub signup_info {
           qw( head body_header body_footer ) ),
         ( map { $_ => join("\n", $conf->config("signup_server-$_", $agentnum ) ) }
           qw( terms_of_service ) ),
+
+        ( map { $_ => scalar($conf->exists($_, $agentnum)) } 
+          qw(cust_main-require_phone) ),
       };
 
       $cache->set("signup_info_cache_agent$agentnum", $signup_info_cache_agent);
index 9d81b75..4393dcf 100644 (file)
@@ -1786,6 +1786,7 @@ and customer address. Include units.',
     'section'     => 'username',
     'description' => 'Allow uppercase characters in usernames.  Not recommended for use with FreeRADIUS with MySQL backend, which is case-insensitive by default.',
     'type'        => 'checkbox',
+    'per_agent'   => 1,
   },
 
   { 
@@ -3589,6 +3590,7 @@ and customer address. Include units.',
     'section'     => '',
     'description' => 'Require daytime or night phone for all customer records.',
     'type'        => 'checkbox',
+    'per_agent'   => 1,
   },
 
   {
@@ -3596,6 +3598,7 @@ and customer address. Include units.',
     'section'     => '',
     'description' => 'Email address field is required: require at least one invoicing email address for all customer records.',
     'type'        => 'checkbox',
+    'per_agent'   => 1,
   },
 
   {
index f3f6602..1da788c 100644 (file)
@@ -1847,7 +1847,7 @@ sub check {
     return $error if $error;
   }
 
-  if ( $conf->exists('cust_main-require_phone')
+  if ( $conf->exists('cust_main-require_phone', $self->agentnum)
        && ! length($self->daytime) && ! length($self->night) && ! length($self->mobile)
      ) {
 
@@ -3214,7 +3214,7 @@ sub check_invoicing_list {
   }
 
   return "Email address required"
-    if $conf->exists('cust_main-require_invoicing_list_email')
+    if $conf->exists('cust_main-require_invoicing_list_email', $self->agentnum)
     && ! grep { $_ !~ /^([A-Z]+)$/ } @$arrayref;
 
   '';
index 82a5a8a..139f927 100644 (file)
@@ -1163,6 +1163,7 @@ sub check {
 
   my $cust_pkg;
   local $username_letter = $username_letter;
+  local $username_uppercase = $username_uppercase;
   if ($self->svcnum) {
     my $cust_svc = $self->cust_svc
       or return "no cust_svc record found for svcnum ". $self->svcnum;
@@ -1174,6 +1175,8 @@ sub check {
   if ($cust_pkg) {
     $username_letter =
       $conf->exists('username-letter', $cust_pkg->cust_main->agentnum);
+    $username_uppercase =
+      $conf->exists('username-uppercase', $cust_pkg->cust_main->agentnum);
   }
 
   my $ulen = $usernamemax || $self->dbdef_table->column('username')->length;
index 78fac6c..bf6c623 100644 (file)
 % unless ( $conf->exists('cust-email-high-visibility')) {
     <TR>
       <TD ALIGN="right" WIDTH="200">
-        <% $conf->exists('cust_main-require_invoicing_list_email') ? $r : '' %>Email address(es)
+        <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) 
+            ? $r : '' %>Email address(es)
       </TD>
       <TD WIDTH="408"><INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>"></TD>
     </TR>
@@ -614,4 +615,6 @@ if ( $cust_main->custnum ) {
   $show_term = $term_sth->fetchrow_arrayref->[0];
 }
 
+my $agentnum = $cust_main->agentnum if $cust_main->custnum;
+
 </%init>
index 51c0960..4912327 100644 (file)
@@ -21,7 +21,8 @@
 % if ( $conf->exists('cust-email-high-visibility') && !$pre ) {
     <TR>
       <TD ALIGN="right" WIDTH="200">
-        <% $conf->exists('cust_main-require_invoicing_list_email') ? $r : '' %>Email address(es)
+        <% $conf->exists('cust_main-require_invoicing_list_email', $agentnum) 
+          ? $r : '' %>Email address(es)
       </TD>
       <TD bgcolor="#FFFF00">
         <INPUT TYPE="text" NAME="invoicing_list" VALUE="<% join(', ', grep { $_ !~ /^(POST|FAX)$/ } @invoicing_list ) %>">
@@ -209,4 +210,6 @@ my $r = qq!<font color="#ff0000">*</font>&nbsp;!;
 
 my @invoicing_list = $cust_main->invoicing_list;
 
+my $agentnum = $cust_main->agentnum if $cust_main->custnum;
+
 </%init>