X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main_note.pm;h=ee63883d2419260fbe0666370cf69e6557885534;hb=292ef074d01bb925e9a466ed771bf2ac418bb44f;hp=0798825ac9750009d12e3b0e47e69c6a3a5df48d;hpb=f4cff6248e3340d2321e9d761fec9ea12b28f781;p=freeside.git diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm index 0798825ac..ee63883d2 100644 --- a/FS/FS/cust_main_note.pm +++ b/FS/FS/cust_main_note.pm @@ -1,8 +1,9 @@ package FS::cust_main_note; +use base qw( FS::otaker_Mixin FS::Record ); use strict; -use base qw( FS::otaker_Mixin FS::Record ); -use FS::Record qw( qsearch qsearchs ); +use Carp; +use FS::Record qw( qsearchs ); #qw( qsearch qsearchs ); =head1 NAME @@ -37,6 +38,8 @@ primary key =item custnum +=item classnum + =item _date =item usernum @@ -105,15 +108,36 @@ sub check { my $error = $self->ut_numbern('notenum') || $self->ut_number('custnum') + || $self->ut_foreign_keyn('classnum', 'cust_note_class', 'classnum') || $self->ut_numbern('_date') || $self->ut_textn('otaker') || $self->ut_anything('comments') + || $self->ut_numbern('sticky') ; return $error if $error; $self->SUPER::check; } +=item cust_note_class + +Returns the customer note class, as an FS::cust_note_class object, or the empty +string if there is no note class. + +=item classname + +Returns the customer note class name, or the empty string if there is no +customer note class. + +=cut + +sub classname { + my $self = shift; + my $cust_note_class = $self->cust_note_class; + $cust_note_class ? $cust_note_class->classname : ''; +} + + #false laziness w/otaker_Mixin & cust_attachment sub otaker { my $self = shift;