fix customer notes and attachments wrt s/otaker/usernum/ changes; still need to look...
authorivan <ivan>
Wed, 31 Mar 2010 07:35:47 +0000 (07:35 +0000)
committerivan <ivan>
Wed, 31 Mar 2010 07:35:47 +0000 (07:35 +0000)
httemplate/edit/process/cust_main_attach.cgi
httemplate/edit/process/cust_main_note.cgi
httemplate/view/cust_main/attachments.html
httemplate/view/cust_main/notes.html

index 0927141..2911357 100644 (file)
@@ -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;
index 5127c72..f09189a 100755 (executable)
@@ -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;
index b16a81e..bdd4f59 100755 (executable)
@@ -82,7 +82,7 @@
     <TR>
       <% note_datestr($attach,$conf,$bgcolor) %>
       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-        &nbsp;<% $attach->otaker%>
+        &nbsp;<% $attach->usernum ? $attach->access_user->name : $attach->otaker %>
       </TD>
       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
        &nbsp;<% $attach->filename %>
index f8a6a25..74d3f60 100755 (executable)
@@ -50,7 +50,7 @@
     <TR>
       <% note_datestr($note,$conf,$bgcolor) %>
       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-        &nbsp;<% $note->otaker%>
+        &nbsp;<% $note->usernum ? $note->access_user->name : $note->otaker %>
       </TD>
       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
         &nbsp;<% $note->comments | defang %>