From: mark Date: Sun, 19 Feb 2012 02:30:17 +0000 (+0000) Subject: more per-agent options, #15973 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=6fc993993d45b0e151a2c3383ef1031f817715ff more per-agent options, #15973 --- diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index b026afd33..d0d088ad4 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -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); diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 9d81b7514..4393dcfdd 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -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, }, { diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index f3f66020a..1da788cc6 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -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; ''; diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 82a5a8a61..139f92715 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -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; diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 78fac6c22..bf6c62339 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -480,7 +480,8 @@ % unless ( $conf->exists('cust-email-high-visibility')) { - <% $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) @@ -614,4 +615,6 @@ if ( $cust_main->custnum ) { $show_term = $term_sth->fetchrow_arrayref->[0]; } +my $agentnum = $cust_main->agentnum if $cust_main->custnum; + diff --git a/httemplate/edit/cust_main/contact.html b/httemplate/edit/cust_main/contact.html index 51c0960ca..4912327c6 100644 --- a/httemplate/edit/cust_main/contact.html +++ b/httemplate/edit/cust_main/contact.html @@ -21,7 +21,8 @@ % if ( $conf->exists('cust-email-high-visibility') && !$pre ) { - <% $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) @@ -209,4 +210,6 @@ my $r = qq!* !; my @invoicing_list = $cust_main->invoicing_list; +my $agentnum = $cust_main->agentnum if $cust_main->custnum; +