X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main_note.pm;h=4c48eb60908d8b95eceeb456ebb14a7439b61c00;hp=06da0965a24eaf3007f1a0f9ee294b4f597d567f;hb=389b6f1116c3309c2ee57a6c295ed1a793503095;hpb=457da870c23db87fbbc29d7c667a73f41422dd71 diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm index 06da0965a..4c48eb609 100644 --- a/FS/FS/cust_main_note.pm +++ b/FS/FS/cust_main_note.pm @@ -1,10 +1,10 @@ package FS::cust_main_note; +use base qw( FS::otaker_Mixin FS::Record ); use strict; -use base qw( FS::otaker_Mixin FS::Record ); use Carp; -use FS::Record qw( qsearch qsearchs ); -use FS::cust_note_class; +use FS::Record qw( qsearchs ); #qw( qsearch qsearchs ); +use FS::Conf; =head1 NAME @@ -113,9 +113,17 @@ sub check { || $self->ut_numbern('_date') || $self->ut_textn('otaker') || $self->ut_anything('comments') + || $self->ut_numbern('sticky') ; 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; } @@ -124,17 +132,6 @@ sub check { Returns the customer note class, as an FS::cust_note_class object, or the empty string if there is no note class. -=cut - -sub cust_note_class { - my $self = shift; - if ( $self->classnum ) { - qsearchs('cust_note_class', { 'classnum' => $self->classnum } ); - } else { - return ''; - } -} - =item classname Returns the customer note class name, or the empty string if there is no