X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main_attach.cgi;h=4d9688fe9f3051003fad0f996caae90bb717d37a;hb=dd65ba99bb9281571f19744154a3b03bcd3f01ab;hp=dd460fa5e1ec396bad871e88f28c1187c9238e72;hpb=ae898cc8e6de40fbecb30c973f91cd955434b159;p=freeside.git diff --git a/httemplate/edit/cust_main_attach.cgi b/httemplate/edit/cust_main_attach.cgi index dd460fa5e..4d9688fe9 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) { "> - + VALUE="<% $attachnum ? emt("Apply changes") : emt("Upload File") %>"> +% } % 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 customer note"); +my $disabled=''; +if(! $curuser->access_right("$action attachment")) { + $disabled = ' disabled="disabled"'; +} + +$cgi->param('custnum') =~ /^(\d+)$/ or die "illegal custnum"; +my $custnum = $1;