[freeside-commits] freeside/httemplate/edit cust_main_attach.cgi, 1.6, 1.6.4.1

Mark Wells mark at wavetail.420.am
Sun Jul 31 01:11:36 PDT 2011


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

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	cust_main_attach.cgi 
Log Message:
clean attachment filenames, #13843

Index: cust_main_attach.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/cust_main_attach.cgi,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -w -d -r1.6 -r1.6.4.1
--- cust_main_attach.cgi	16 Dec 2009 17:35:59 -0000	1.6
+++ cust_main_attach.cgi	31 Jul 2011 08:11:34 -0000	1.6.4.1
@@ -6,19 +6,22 @@
 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
 <INPUT TYPE="hidden" NAME="attachnum" VALUE="<% $attachnum %>">
 
-<BR><BR>
-
-<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
 % if(defined $attach) {
 %   if($curuser->access_right("Download attachment")) {
 <A HREF="<% $p.'view/attachment.html?'.$attachnum %>">Download this file</A><BR>
 %   }
+% }
+
+<BR>
+<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+% if ( defined $attach ) {
 <TR><TD> Filename </TD>
-<TD><INPUT TYPE="text" NAME="filename" SIZE=40 MAXLENGTH=255 VALUE="<% $attach->filename %>"<% $disabled %>></TD></TR>
+<TD><INPUT TYPE="text" NAME="file" SIZE=40 MAXLENGTH=255 VALUE="<% $cgi->param('file') || $attach->filename |h %>"<% $disabled %>></TD></TR>
 <TR><TD> Description </TD>
-<TD><INPUT TYPE="text" NAME="title" SIZE=40 MAXLENGTH=80 VALUE="<% $attach->title %>"<% $disabled %></TD></TR>
+<TD><INPUT TYPE="text" NAME="title" SIZE=40 MAXLENGTH=80 VALUE="<% $cgi->param('title') || $attach->title |h %>"<% $disabled %></TD></TR>
 <TR><TD> MIME type </TD>
-<TD><INPUT TYPE="text" NAME="mime_type" VALUE="<% $attach->mime_type %>"<% $disabled %></TD></TR>
+<TD><INPUT TYPE="text" NAME="mime_type" SIZE=40 VALUE="<% $cgi->param('mime_type') || $attach->mime_type |h %>"<% $disabled %></TD></TR>
 <TR><TD> Size </TD><TD><% $attach->size %></TD></TR>
 % }
 % else { # !defined $attach
@@ -47,9 +50,8 @@
 
 my $attachnum = '';
 my $attach;
-if ( $cgi->param('error') ) {
-  #$comment     = $cgi->param('comment');
-} elsif ( $cgi->param('attachnum') =~ /^(\d+)$/ ) {
+
+if ( $cgi->param('attachnum') =~ /^(\d+)$/ ) {
   $attachnum = $1;
   die "illegal query ". $cgi->keywords unless $attachnum;
   $attach = qsearchs('cust_attachment', { 'attachnum' => $attachnum });



More information about the freeside-commits mailing list