[freeside-commits] freeside/httemplate/view cust_main.cgi, 1.120, 1.121 attachment.html, NONE, 1.1

Mark Wells mark at wavetail.420.am
Sun Aug 9 02:05:39 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv5591/httemplate/view

Modified Files:
	cust_main.cgi 
Added Files:
	attachment.html 
Log Message:
Add cust_attachment stuff

--- NEW FILE: attachment.html ---
<%init>
my ($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
my $attachnum = $1 or die 'Invalid attachment number';
$FS::CurrentUser::CurrentUser->access_right('Download attachment') or die 'access denied';

my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die 'Attachment not found: $attachnum';

$m->clear_buffer;
$r->content_type($attach->mime_type || 'text/plain');
$r->headers_out->add('Content-Disposition' => 'attachment;filename=' . $attach->filename);

binmode STDOUT;
print STDOUT $attach->body;

</%init>

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main.cgi,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -d -r1.120 -r1.121
--- cust_main.cgi	28 Jul 2009 21:17:45 -0000	1.120
+++ cust_main.cgi	9 Aug 2009 09:05:37 -0000	1.121
@@ -113,7 +113,6 @@
 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
 
 %   unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) {
-      <BR>
       <A NAME="cust_main_note"><FONT SIZE="+2">Notes</FONT></A><BR>
 %   }
 
@@ -138,6 +137,22 @@
 <% include('cust_main/notes.html', 'custnum' => $cust_main->custnum ) %>
 
 % }
+<BR>
+
+% if(! $conf->config('disable_cust_attachment') 
+%  and $curuser->access_right('Add attachment')) {
+<% include( '/elements/popup_link-cust_main.html',
+              'label'       => 'Attach file',
+              'action'      => $p.'edit/cust_main_attach.cgi',
+              'actionlabel' => 'Upload file',
+              'cust_main'   => $cust_main,
+              'width'       => 616,
+              'height'      => 408,
+          )
+%>
+% }
+<% include('cust_main/attachments.html', 'custnum' => $cust_main->custnum ) %>
+<BR>
 
 % }
 
@@ -181,10 +196,6 @@
 
 % }
 
-% if ( $view eq 'change_history' ) { #  || $view eq 'jumbo'
-  <% include('cust_main/change_history.html', $cust_main ) %>
-% }
-
 <% include('/elements/footer.html') %>
 <%init>
 
@@ -218,12 +229,11 @@
        'Notes'            => 'notes', #notes and files?
 ;
 $views{'Tickets'}         =  'tickets'
-  if $conf->config('ticket_system');
+                               if $conf->config('ticket_system');
 $views{'Packages'}        =  'packages';
 $views{'Payment History'} =  'payment_history'
-  unless $conf->config('payby-default' eq 'HIDE');
-$views{'Change History'}  =  'change_history'
-  if $curuser->access_right('View customer history');
+                               unless $conf->config('payby-default' eq 'HIDE');
+#$views{'Change History'}  =  '';
 $views{'Jumbo'}           =  'jumbo';
 
 my %viewname = reverse %views;



More information about the freeside-commits mailing list