summaryrefslogtreecommitdiff
path: root/FS/FS
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2016-10-14 20:49:38 -0500
committerJonathan Prykop <jonathan@freeside.biz>2016-10-24 22:56:05 -0500
commit47625b00ce71ca8d0e8b3e18458864c9d6ae9006 (patch)
treeb52a7c40c7addb8efa16e9271446e8df06557152 /FS/FS
parentf7a89831184a190064628668183c04250b43dd97 (diff)
72901: OFM Freeside Note Classes
Diffstat (limited to 'FS/FS')
-rw-r--r--FS/FS/Conf.pm6
-rw-r--r--FS/FS/Upgrade.pm8
-rw-r--r--FS/FS/cust_main_note.pm8
3 files changed, 17 insertions, 5 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index ab16a99..8794bfd 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -5455,11 +5455,7 @@ and customer address. Include units.',
'section' => 'customer_fields',
'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/Upgrade.pm b/FS/FS/Upgrade.pm
index 5a1ac2b..05ff8fc 100644
--- a/FS/FS/Upgrade.pm
+++ b/FS/FS/Upgrade.pm
@@ -178,6 +178,14 @@ If you need to continue using the old Form 477 report, turn on the
$conf->set('cust-fields',$cust_fields);
}
+ #repurposed
+ $conf->set('note-classes','Enabled')
+ if $conf->exists('note-classes')
+ and grep {$_ eq $conf->config('note-classes')} ('1','2');
+ $conf->set('note-classes','')
+ if $conf->exists('note-classes')
+ and '0' eq $conf->config('note-classes');
+
enable_banned_pay_pad() unless length($conf->config('banned_pay-pad'));
# if translate-auto-insert is enabled for a locale, ensure that invoice
diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm
index ee63883..4c48eb6 100644
--- a/FS/FS/cust_main_note.pm
+++ b/FS/FS/cust_main_note.pm
@@ -4,6 +4,7 @@ use base qw( FS::otaker_Mixin FS::Record );
use strict;
use Carp;
use FS::Record qw( qsearchs ); #qw( qsearch qsearchs );
+use FS::Conf;
=head1 NAME
@@ -116,6 +117,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;
}