Commit 3a24558c authored by Yoshinori Okuji's avatar Yoshinori Okuji

Add a version number to the file name.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2220 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e4abada6
...@@ -123,7 +123,7 @@ class TemplateTool (BaseTool): ...@@ -123,7 +123,7 @@ class TemplateTool (BaseTool):
Save in a format or another Save in a format or another
""" """
cfg = getConfiguration() cfg = getConfiguration()
path = os.path.join(cfg.clienthome, '%s.bt5' % business_template.getTitle()) path = os.path.join(cfg.clienthome, '%s-%s.bt5' % (business_template.getTitle(), business_template.getVersion()))
export_string = self.manage_exportObject(id=business_template.getId(), toxml=1, download=1) export_string = self.manage_exportObject(id=business_template.getId(), toxml=1, download=1)
f = open(path, 'wb') f = open(path, 'wb')
try: try:
...@@ -146,7 +146,7 @@ class TemplateTool (BaseTool): ...@@ -146,7 +146,7 @@ class TemplateTool (BaseTool):
if RESPONSE is not None: if RESPONSE is not None:
RESPONSE.setHeader('Content-type','application/data') RESPONSE.setHeader('Content-type','application/data')
RESPONSE.setHeader('Content-Disposition', RESPONSE.setHeader('Content-Disposition',
'inline;filename=%s.bt5' % business_template.getTitle()) 'inline;filename=%s-%s.bt5' % (business_template.getTitle(), business_template.getVersion()))
return export_string return export_string
def publish(self, business_template, url, username=None, password=None): def publish(self, business_template, url, username=None, password=None):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment