[rt-commit] [svn] r489 - in rt/branches: . autrijus-3.1/html/CustomFieldValue autrijus-3.1/html/Download autrijus-3.1/html/Download/CustomFieldValue autrijus-3.1/html/Elements

autrijus at fsck.com autrijus at fsck.com
Sun Mar 7 11:06:11 EST 2004


Author: autrijus
Date: Sun Mar  7 11:06:08 2004
New Revision: 489

Added:
   rt/branches/autrijus-3.1/html/Download/
   rt/branches/autrijus-3.1/html/Download/CustomFieldValue/
   rt/branches/autrijus-3.1/html/Download/CustomFieldValue/dhandler
Removed:
   rt/branches/autrijus-3.1/html/CustomFieldValue/
Modified:
   rt/branches/   (props changed)
   rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary
   rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage
Log:
* change download path to /Download/CustomFieldValue on suggstion from obra.


Added: rt/branches/autrijus-3.1/html/Download/CustomFieldValue/dhandler
==============================================================================
--- (empty file)
+++ rt/branches/autrijus-3.1/html/Download/CustomFieldValue/dhandler	Sun Mar  7 11:06:08 2004
@@ -0,0 +1,53 @@
+%# BEGIN LICENSE BLOCK
+%# 
+%# Copyright (c) 1996-2003 Jesse Vincent <jesse at bestpractical.com>
+%# 
+%# (Except where explictly superceded by other copyright notices)
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# Unless otherwise specified, all modifications, corrections or
+%# extensions to this work which alter its source code become the
+%# property of Best Practical Solutions, LLC when submitted for
+%# inclusion in the work.
+%# 
+%# 
+%# END LICENSE BLOCK
+<%perl>
+my $id;
+my $arg = $m->dhandler_arg;                # get rest of path
+if ($arg =~ /^(\d+)\//) {
+    $id = $1;
+}
+else {
+    Abort("Corrupted customfieldvalue URL.");
+}
+my $OCFV = RT::ObjectCustomFieldValue->new($session{'CurrentUser'});
+$OCFV->Load($id) || Abort("OCFV '$id' could not be loaded");
+
+unless ($OCFV->id) {
+    Abort("Bad OCFV id. Couldn't find OCFV '$id'\n");
+}
+
+my $content_type = $OCFV->ContentType || 'text/plain';
+    
+unless ($RT::TrustHTMLAttachments) {
+    $content_type = 'text/plain' if ($content_type =~ /^text\/html/i);
+}
+
+$r->content_type( $content_type );
+$m->clear_buffer();
+$m->out($OCFV->LargeContent);
+$m->abort; 
+</%perl>
+<%attr>
+AutoFlush => 0
+</%attr>

Modified: rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary
==============================================================================
--- rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary	(original)
+++ rt/branches/autrijus-3.1/html/Elements/EditCustomFieldBinary	Sun Mar  7 11:06:08 2004
@@ -23,7 +23,7 @@
 %# END LICENSE BLOCK
 % while (my $value = $Values->Next ) {
 %# XXX - let user download the file(s) here?
-<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><a href="/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br>
+<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><a href="/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br>
 % }
 % if (!$MaxValues or $Values->Count < $MaxValues) {
 <input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload">

Modified: rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage
==============================================================================
--- rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage	(original)
+++ rt/branches/autrijus-3.1/html/Elements/EditCustomFieldImage	Sun Mar  7 11:06:08 2004
@@ -23,7 +23,7 @@
 %# END LICENSE BLOCK
 % while (my $value = $Values->Next ) {
 %# XXX - let user download the file(s) here?
-<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><a href="/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br>
+<input type="checkbox" name="<%$NamePrefix%><%$CustomField->Id%>-DeleteValueIds" value="<% $value->Id %>"><a href="/Download/CustomFieldValue/<% $value->Id %>/<% $value->Content %>"><% $value->Content %></a><br>
 % }
 % if (!$MaxValues or $Values->Count < $MaxValues) {
 <input type="file" name="<%$NamePrefix%><%$CustomField->Id%>-Upload">



More information about the Rt-commit mailing list