summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/Conf.pm6
-rw-r--r--FS/FS/cust_main_note.pm8
2 files changed, 9 insertions, 5 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index d3d437db4..8e07c72bb 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5747,11 +5747,7 @@ and customer address. Include units.',
'section' => 'UI',
'description' => 'Use customer note classes',
'type' => 'select',
- 'select_hash' => [
- 0 => 'Disabled',
- 1 => 'Enabled',
- 2 => 'Enabled, with tabs',
- ],
+ 'select_enum' => [ '', 'Enabled', 'Required' ],
},
{
diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm
index 44d99d8c4..1723951d1 100644
--- a/FS/FS/cust_main_note.pm
+++ b/FS/FS/cust_main_note.pm
@@ -5,6 +5,7 @@ use base qw( FS::otaker_Mixin FS::Record );
use Carp;
use FS::Record qw( qsearch qsearchs );
use FS::cust_note_class;
+use FS::Conf;
=head1 NAME
@@ -117,6 +118,13 @@ sub check {
;
return $error if $error;
+ if (!$self->classnum) {
+ my $conf = new FS::Conf;
+ return 'Note class is required'
+ if $conf->exists('note-classes')
+ and $conf->config('note-classes') eq 'Required';
+ }
+
$self->SUPER::check;
}