<% include('/elements/header-popup.html', "$action File Attachment") %> <% include('/elements/error.html') %>


% if(defined $attach) { Filename
MIME type Size: <% $attach->size %>
% } % else { # !defined $attach Filename
% }
"> % if(defined $attach and $curuser->access_right('Delete attachment')) {
% }
<%init> my $curuser = $FS::CurrentUser::CurrentUser; my $attachnum = ''; my $attach; if ( $cgi->param('error') ) { #$comment = $cgi->param('comment'); } elsif ( $cgi->param('attachnum') =~ /^(\d+)$/ ) { $attachnum = $1; die "illegal query ". $cgi->keywords unless $attachnum; $attach = qsearchs('cust_attachment', { 'attachnum' => $attachnum }); die "no such attachment: ". $attachnum unless $attach; } $cgi->param('custnum') =~ /^(\d+)$/ or die "illegal custnum"; my $custnum = $1; my $action = $attachnum ? 'Edit' : 'Add'; die "access denied" unless $curuser->access_right("$action attachment");