From 0d68f85684a28f28dd895bd37c6a59d0bd91c496 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 24 Nov 2009 01:11:22 +0000 Subject: cust_attachment improvement, RT#4964 and #6225 --- httemplate/edit/cust_main_attach.cgi | 42 ++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'httemplate/edit/cust_main_attach.cgi') diff --git a/httemplate/edit/cust_main_attach.cgi b/httemplate/edit/cust_main_attach.cgi index 43d2e2928..5e9b16c99 100755 --- a/httemplate/edit/cust_main_attach.cgi +++ b/httemplate/edit/cust_main_attach.cgi @@ -2,31 +2,39 @@ <% include('/elements/error.html') %> -
+

+<% include('/elements/table.html') %> % if(defined $attach) { -Filename
-MIME type -Size: <% $attach->size %>
- +% if($curuser->access_right("Download attachment")) { +Download this file
+% } + Filename +> + Description + + MIME type + + Size <% $attach->size %> % } % else { # !defined $attach - -Filename
- + Filename + Description % } - +
+% if(! $disabled) { "> - +% } % if(defined $attach and $curuser->access_right('Delete attachment')) {
- + % }
@@ -47,13 +55,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; -- cgit v1.2.1