[freeside-commits] branch FREESIDE_3_BRANCH updated. 06f584e3a7d4621169d89490c72484615aecf841
Jonathan Prykop
jonathan at 420.am
Fri Sep 2 23:21:08 PDT 2016
The branch, FREESIDE_3_BRANCH has been updated
via 06f584e3a7d4621169d89490c72484615aecf841 (commit)
via 798ba64e8c02a2288b2162ee7d5fdb6f476c41eb (commit)
from 8f244f35b1451cb984f43dbdf569482e2760e703 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 06f584e3a7d4621169d89490c72484615aecf841
Author: Jonathan Prykop <jonathan at freeside.biz>
Date: Sat Sep 3 01:20:21 2016 -0500
72225: OQH - Mandatory Fields on Customer Creation [v3]
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 1f13608..d6fa70a 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4440,7 +4440,7 @@ and customer address. Include units.',
{
'key' => 'cust_main-require_classnum',
- 'section' => 'customer_fields',
+ 'section' => '',
'description' => 'Customer class is required: require customer class for all customer records.',
'type' => 'checkbox',
},
commit 798ba64e8c02a2288b2162ee7d5fdb6f476c41eb
Author: Jonathan Prykop <jonathan at freeside.biz>
Date: Fri Sep 2 22:02:03 2016 -0500
72225: OQH - Mandatory Fields on Customer Creation
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index bf21a1b..1f13608 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -4439,6 +4439,13 @@ and customer address. Include units.',
},
{
+ 'key' => 'cust_main-require_classnum',
+ 'section' => 'customer_fields',
+ 'description' => 'Customer class is required: require customer class for all customer records.',
+ 'type' => 'checkbox',
+ },
+
+ {
'key' => 'cust_main-check_unique',
'section' => '',
'description' => 'Warn before creating a customer record where these fields duplicate another customer.',
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index 8e2fa19..90b93f2 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -2158,6 +2158,10 @@ sub check {
&& ! $self->custnum
&& $conf->exists('cust_main-require_locale');
+ return "Please select a customer class"
+ if ! $self->classnum
+ && $conf->exists('cust_main-require_classnum');
+
foreach my $flag (qw( tax spool_cdr squelch_cdr archived email_csv_cdr )) {
$self->$flag() =~ /^(Y?)$/ or return "Illegal $flag: ". $self->$flag();
$self->$flag($1);
diff --git a/httemplate/edit/cust_main/top_misc.html b/httemplate/edit/cust_main/top_misc.html
index c19f347..3a79444 100644
--- a/httemplate/edit/cust_main/top_misc.html
+++ b/httemplate/edit/cust_main/top_misc.html
@@ -141,9 +141,12 @@
% }
%# class
+% my $rclass = $conf->exists('cust_main-require_classnum') ? $r : '';
<& /elements/tr-select-cust_class.html,
- 'curr_value' => $cust_main->classnum,
- 'label' => emt("Class"),
+ 'curr_value' => $cust_main->classnum,
+ 'label' => $rclass . emt("Class"),
+ 'empty_label' => $rclass ? 'Select class' : '(none)',
+ 'disable_empty' => ($rclass && $cust_main->classnum) ? 1 : 0,
&>
%#sales person
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Conf.pm | 7 +++++++
FS/FS/cust_main.pm | 4 ++++
httemplate/edit/cust_main/top_misc.html | 7 +++++--
3 files changed, 16 insertions(+), 2 deletions(-)
More information about the freeside-commits
mailing list