diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-01-28 02:23:34 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-01-28 02:23:34 -0800 |
commit | 8706262a6d18ef5103fb5972ca6443b73e700e6a (patch) | |
tree | 5721774954a691d74a36f4723cbad1ef26ecff62 /FS | |
parent | 27b43d1c9e3af3b8d384d1a30abc2922c1ac6ed7 (diff) |
sticky customer notes, RT#29311
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Schema.pm | 15 | ||||
-rw-r--r-- | FS/FS/cust_main.pm | 4 | ||||
-rw-r--r-- | FS/FS/cust_main_note.pm | 1 |
3 files changed, 11 insertions, 9 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index d01625a41..ef381e573 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -1416,13 +1416,14 @@ sub tables_hashref { 'cust_main_note' => { 'columns' => [ - 'notenum', 'serial', '', '', '', '', - 'custnum', 'int', '', '', '', '', - 'classnum', 'int', 'NULL', '', '', '', - '_date', @date_type, '', '', - 'otaker', 'varchar', 'NULL', 32, '', '', - 'usernum', 'int', 'NULL', '', '', '', - 'comments', 'text', 'NULL', '', '', '', + 'notenum', 'serial', '', '', '', '', + 'custnum', 'int', '', '', '', '', + 'classnum', 'int', 'NULL', '', '', '', + '_date', @date_type, '', '', + 'otaker', 'varchar', 'NULL', 32, '', '', + 'usernum', 'int', 'NULL', '', '', '', + 'comments', 'text', 'NULL', '', '', '', + 'sticky', 'int', '', '', 0, '', ], 'primary_key' => 'notenum', 'unique' => [], diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 3ad7f99bb..b43d7e35c 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2346,8 +2346,8 @@ Returns all notes (see L<FS::cust_main_note>) for this customer. sub notes { my($self,$orderby_classnum) = (shift,shift); - my $orderby = "_DATE DESC"; - $orderby = "CLASSNUM ASC, $orderby" if $orderby_classnum; + my $orderby = "sticky DESC, _date DESC"; + $orderby = "classnum ASC, $orderby" if $orderby_classnum; qsearch( 'cust_main_note', { 'custnum' => $self->custnum }, '', diff --git a/FS/FS/cust_main_note.pm b/FS/FS/cust_main_note.pm index 06da0965a..44d99d8c4 100644 --- a/FS/FS/cust_main_note.pm +++ b/FS/FS/cust_main_note.pm @@ -113,6 +113,7 @@ sub check { || $self->ut_numbern('_date') || $self->ut_textn('otaker') || $self->ut_anything('comments') + || $self->ut_numbern('sticky') ; return $error if $error; |