X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main_attach.cgi;h=ebbaf3cf3aaff068d4fb252049e368079aeedbea;hb=d6741df87df9e3352d7ae47a02d0e3f46154fef9;hp=7c9e407d96e603c0a53fadd88493a3f2842504b9;hpb=283ea2b5137ae3ec36882b492e6de024b0ce6027;p=freeside.git diff --git a/httemplate/edit/cust_main_attach.cgi b/httemplate/edit/cust_main_attach.cgi index 7c9e407d9..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) { +% } +% if(defined $attach and $curuser->access_right('Delete attachment')) {
- + % }
@@ -35,6 +43,8 @@ Filename
<%init> +my $curuser = $FS::CurrentUser::CurrentUser; + my $attachnum = ''; my $attach; if ( $cgi->param('error') ) { @@ -46,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 $FS::CurrentUser::CurrentUser->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;