X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main_attach.cgi;h=ebbaf3cf3aaff068d4fb252049e368079aeedbea;hb=e0a26680d75fc2000bde195eba7946805a3aaa28;hp=43d2e292816d29d49317f3cbf063f44907cfc1f7;hpb=84c255838ffdeea5df83556b417bda29d8c71331;p=freeside.git diff --git a/httemplate/edit/cust_main_attach.cgi b/httemplate/edit/cust_main_attach.cgi index 43d2e2928..ebbaf3cf3 100755 --- a/httemplate/edit/cust_main_attach.cgi +++ b/httemplate/edit/cust_main_attach.cgi @@ -2,31 +2,39 @@ <% include('/elements/error.html') %> -
+

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

+% if(! $disabled) { "> - +% } % if(defined $attach and $curuser->access_right('Delete attachment')) {
- + % }
@@ -36,6 +44,7 @@ Filename
<%init> my $curuser = $FS::CurrentUser::CurrentUser; + my $attachnum = ''; my $attach; if ( $cgi->param('error') ) { @@ -47,13 +56,15 @@ if ( $cgi->param('error') ) { 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"); +my $disabled=''; +if(! $curuser->access_right("$action attachment")) { + $disabled = ' disabled="disabled"'; +} + +$cgi->param('custnum') =~ /^(\d+)$/ or die "illegal custnum"; +my $custnum = $1;