[Erp5-report] r16941 - in /erp5/trunk/products/ERP5: Document/ Tool/ bootstrap/erp5_core/Sk...
nobody at svn.erp5.org
nobody at svn.erp5.org
Wed Oct 10 18:28:08 CEST 2007
Author: kazuhiko
Date: Wed Oct 10 18:28:08 2007
New Revision: 16941
URL: http://svn.erp5.org?rev=16941&view=rev
Log:
* set filename into source_reference.
* try to use source_reference first as filename.
Modified:
erp5/trunk/products/ERP5/Document/File.py
erp5/trunk/products/ERP5/Tool/ContributionTool.py
erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml
erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
Modified: erp5/trunk/products/ERP5/Document/File.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/File.py?rev=16941&r1=16940&r2=16941&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/File.py (original)
+++ erp5/trunk/products/ERP5/Document/File.py Wed Oct 10 18:28:08 2007
@@ -109,7 +109,7 @@
### Special edit method
security.declarePrivate( '_edit' )
- def _edit(self, **kw):
+ def _edit(self, set_filename__=1, **kw):
"""\
This is used to edit files
"""
@@ -118,6 +118,10 @@
precondition = kw.get('precondition')
if self._isNotEmpty(file):
self._setFile(file, precondition=precondition)
+ if set_filename__:
+ filename = getattr(file, 'filename', None)
+ if filename is not None:
+ kw['source_reference'] = filename
del kw['file']
Base._edit(self, **kw)
Modified: erp5/trunk/products/ERP5/Tool/ContributionTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/ContributionTool.py?rev=16941&r1=16940&r2=16941&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/ContributionTool.py (original)
+++ erp5/trunk/products/ERP5/Tool/ContributionTool.py Wed Oct 10 18:28:08 2007
@@ -311,7 +311,7 @@
try:
# Then edit the document contents (so that upload can happen)
- document._edit(**kw)
+ document._edit(set_filename__=0, **kw)
if url:
document.fromURL(url)
finally:
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml?rev=16941&r1=16940&r2=16941&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_download.xml Wed Oct 10 18:28:08 2007
@@ -76,7 +76,7 @@
else:\n
response.RESPONSE.setHeader(\'Content-type\', context.getFormat())\n
\n
-file_name = context.getTitle() or context.getSourceReference() or context.getId()\n
+file_name = context.getSourceReference() or context.getTitle() or context.getId()\n
response.setHeader(\'Content-disposition\', \'attachment;; filename="%s"\' % file_name)\n
return context.index_html(request, response)\n
</string> </value>
Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=16941&r1=16940&r2=16941&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision Wed Oct 10 18:28:08 2007
@@ -1,1 +1,1 @@
-522
+523
More information about the Erp5-report
mailing list