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


% if(defined $attach) { % if($curuser->access_right("Download attachment")) { Download this file
% } % } % else { # !defined $attach % }
Filename >
Description
MIME type
Size <% $attach->size %>
Filename
Description

% if(! $disabled) { "> % } % 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; } my $action = $attachnum ? 'Edit' : 'Add'; my $disabled=''; if(! $curuser->access_right("$action attachment")) { $disabled = ' disabled="disabled"'; } $cgi->param('custnum') =~ /^(\d+)$/ or die "illegal custnum"; my $custnum = $1;