From 3bc82a61cf3822bdefca3df299ef2f2688402d42 Mon Sep 17 00:00:00 2001 From: "vit.jonas@gmail.com" Date: Wed, 25 May 2011 08:49:40 +0000 Subject: [PATCH] * fix in Zipping files git-svn-id: http://redmine-dmsf.googlecode.com/svn/trunk/redmine_dmsf@84 5e329b0b-a2ee-ea63-e329-299493fc886d --- README.txt | 2 +- app/helpers/dmsf_zip.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.txt b/README.txt index b7596975..8537dc8a 100644 --- a/README.txt +++ b/README.txt @@ -89,7 +89,7 @@ There is possibility to link DMSF files from Wiki entries: DMSF file id can be found in link for file download. There is possibility to link DMSF folders from Wiki entries: - {{dmsff(17)}} link to folder with id 5 + {{dmsff(5)}} link to folder with id 5 DMSF folder id can be found in link for folder opening. You can also publish Wiki help description. diff --git a/app/helpers/dmsf_zip.rb b/app/helpers/dmsf_zip.rb index 049386c2..f238090b 100644 --- a/app/helpers/dmsf_zip.rb +++ b/app/helpers/dmsf_zip.rb @@ -40,7 +40,9 @@ class DmsfZip end def add_file(file) - @zip_file.put_next_entry(file.dmsf_path_str) + string_path = file.folder.nil? ? "" : file.folder.dmsf_path_str + "/" + string_path += file.name + @zip_file.put_next_entry(string_path) File.open(file.last_revision.disk_file, "rb") do |f| buffer = "" while (buffer = f.read(8192))