diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2016-10-14 20:49:38 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2016-10-14 20:49:38 -0500 |
commit | d4114381c5d95e8acd0d0fc2bbc2b3528bde2ecf (patch) | |
tree | 0faeea2676923a328eed57019d8365bf8998a95c /FS | |
parent | c5a2d3613acdc3b9ab6f32eaf5316c2834071417 (diff) |
72901: OFM Freeside Note Classes
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Conf.pm | 6 | ||||
-rw-r--r-- | FS/FS/Upgrade.pm | 8 | ||||
-rw-r--r-- | FS/FS/cust_main_note.pm | 8 |
3 files changed, 17 insertions, 5 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index f4f7d2602..a48125d09 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -5419,11 +5419,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 c959ba947..1c1095e37 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 ee63883d2..4c48eb609 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; } |