From 5f71517b3de709a86c89dbacc6247cd6e52f4c42 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 31 Mar 2010 07:35:47 +0000 Subject: [PATCH] fix customer notes and attachments wrt s/otaker/usernum/ changes; still need to look at the migration, RT#7935 --- httemplate/edit/process/cust_main_attach.cgi | 4 +--- httemplate/edit/process/cust_main_note.cgi | 8 ++------ httemplate/view/cust_main/attachments.html | 2 +- httemplate/view/cust_main/notes.html | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/httemplate/edit/process/cust_main_attach.cgi b/httemplate/edit/process/cust_main_attach.cgi index 092714122..291135718 100644 --- a/httemplate/edit/process/cust_main_attach.cgi +++ b/httemplate/edit/process/cust_main_attach.cgi @@ -25,8 +25,6 @@ $cgi->param('attachnum') =~ /^(\d*)$/ my $attachnum = $1; my $curuser = $FS::CurrentUser::CurrentUser; -my $otaker = $curuser->name; -$otaker = $curuser->username if ($otaker eq "User, Legacy"); my $delete = $cgi->param('delete'); my $undelete = $cgi->param('undelete'); @@ -36,7 +34,7 @@ my $new = new FS::cust_attachment ( { attachnum => $attachnum, custnum => $custnum, _date => time, - otaker => $otaker, + usernum => $curuser->usernum, disabled => '', }); my $old; diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index 5127c72d1..f09189aa9 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -18,16 +18,12 @@ $cgi->param('notenum') =~ /^(\d*)$/ or die "Illegal notenum: ". $cgi->param('notenum'); my $notenum = $1; -my $otaker = $FS::CurrentUser::CurrentUser->name; -$otaker = $FS::CurrentUser::CurrentUser->username - if ($otaker eq "User, Legacy"); - my $new = new FS::cust_main_note ( { notenum => $notenum, custnum => $custnum, _date => time, - otaker => $otaker, - comments => $cgi->param('comment'), + usernum => $FS::CurrentUser::CurrentUser->usernum, + comments => scalar($cgi->param('comment')), } ); my $error; diff --git a/httemplate/view/cust_main/attachments.html b/httemplate/view/cust_main/attachments.html index b16a81eae..bdd4f5917 100755 --- a/httemplate/view/cust_main/attachments.html +++ b/httemplate/view/cust_main/attachments.html @@ -82,7 +82,7 @@ <% note_datestr($attach,$conf,$bgcolor) %> -  <% $attach->otaker%> +  <% $attach->usernum ? $attach->access_user->name : $attach->otaker %>  <% $attach->filename %> diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html index f8a6a2533..74d3f602b 100755 --- a/httemplate/view/cust_main/notes.html +++ b/httemplate/view/cust_main/notes.html @@ -50,7 +50,7 @@ <% note_datestr($note,$conf,$bgcolor) %> -  <% $note->otaker%> +  <% $note->usernum ? $note->access_user->name : $note->otaker %>  <% $note->comments | defang %> -- 2.11.0