From 283ea2b5137ae3ec36882b492e6de024b0ce6027 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 9 Aug 2009 09:05:38 +0000 Subject: Add cust_attachment stuff --- httemplate/edit/cust_main_attach.cgi | 58 ++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 httemplate/edit/cust_main_attach.cgi (limited to 'httemplate/edit/cust_main_attach.cgi') diff --git a/httemplate/edit/cust_main_attach.cgi b/httemplate/edit/cust_main_attach.cgi new file mode 100755 index 000000000..7c9e407d9 --- /dev/null +++ b/httemplate/edit/cust_main_attach.cgi @@ -0,0 +1,58 @@ +<% include('/elements/header-popup.html', "$action File Attachment") %> + +<% include('/elements/error.html') %> + +
+ + + +

+ +% if(defined $attach) { +Filename
+MIME type +Size: <% $attach->size %>
+ +% } +% else { # !defined $attach + +Filename
+ +% } + +
+"> + +% if(defined $attach) { +
+ +% } + +
+ + + +<%init> + +my $attachnum = ''; +my $attach; +if ( $cgi->param('error') ) { + #$comment = $cgi->param('comment'); +} elsif ( $cgi->param('attachnum') =~ /^(\d+)$/ ) { + $attachnum = $1; + die "illegal query ". $cgi->keywords unless $attachnum; + $attach = qsearchs('cust_attachment', { 'attachnum' => $attachnum }); + 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"); + + + -- cgit v1.2.1