summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/cust_main_note.cgi
blob: d9251f042ffe1ea175b2fb882ff949549c351564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
%
%
%$cgi->param('custnum') =~ /^(\d+)$/
%  or die "Illegal custnum: ". $cgi->param('custnum');
%my $custnum = $1;
%
%my $otaker = $FS::CurrentUser::CurrentUser->name;
%$otaker = $FS::CurrentUser::CurrentUser->username
%  if ($otaker eq "User, Legacy");
%
%my $new = new FS::cust_main_note ( {
%  custnum  => $custnum,
%  _date    => time,
%  otaker   => $otaker,
%  comments =>  $cgi->param('comment'),
%} );
%
%my $error = $new->insert;
%
%if ($error) {
%  $cgi->param('error', $error);
%  print $cgi->redirect(popurl(2). 'cust_main_note.cgi?'. $cgi->query_string );
%}
%
%    
<% header('Note added') %>
    <SCRIPT TYPE="text/javascript">
      window.top.location.reload();
    </SCRIPT>

    </BODY></HTML>
%
%