projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve handling of deleted attachments
[freeside.git]
/
httemplate
/
edit
/
cust_main_attach.cgi
diff --git
a/httemplate/edit/cust_main_attach.cgi
b/httemplate/edit/cust_main_attach.cgi
index
7c9e407
..
dd460fa
100755
(executable)
--- a/
httemplate/edit/cust_main_attach.cgi
+++ b/
httemplate/edit/cust_main_attach.cgi
@@
-24,7
+24,7
@@
Filename <INPUT TYPE="file" NAME="file"><BR>
<INPUT TYPE="submit" NAME="submit"
VALUE="<% $attachnum ? "Apply Changes" : "Upload File" %>">
<INPUT TYPE="submit" NAME="submit"
VALUE="<% $attachnum ? "Apply Changes" : "Upload File" %>">
-% if(defined $attach) {
+% if(defined $attach
and $curuser->access_right('Delete attachment')
) {
<BR>
<INPUT TYPE="submit" NAME="delete" value="Delete File">
% }
<BR>
<INPUT TYPE="submit" NAME="delete" value="Delete File">
% }
@@
-35,6
+35,7
@@
Filename <INPUT TYPE="file" NAME="file"><BR>
<%init>
<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
my $attachnum = '';
my $attach;
if ( $cgi->param('error') ) {
my $attachnum = '';
my $attach;
if ( $cgi->param('error') ) {
@@
-52,7
+53,7
@@
my $custnum = $1;
my $action = $attachnum ? 'Edit' : 'Add';
die "access denied"
my $action = $attachnum ? 'Edit' : 'Add';
die "access denied"
- unless $
FS::CurrentUser::CurrentU
ser->access_right("$action customer note");
+ unless $
curu
ser->access_right("$action customer note");
</%init>
</%init>