[Feature Request] - overriding preconfigured Revision Tags/Steps #351

This commit is contained in:
Karel Pičman 2015-02-18 12:39:14 +01:00
parent c36ee00c6c
commit 9348dea9b6
14 changed files with 84 additions and 20 deletions

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -106,14 +108,24 @@ class DmsfFilesController < ApplicationController
revision.major_version = last_revision.major_version revision.major_version = last_revision.major_version
revision.minor_version = last_revision.minor_version revision.minor_version = last_revision.minor_version
version = params[:version].to_i version = params[:version].to_i
file_upload = params[:file_upload] file_upload = params[:file_upload]
unless file_upload unless file_upload
revision.disk_filename = last_revision.disk_filename revision.disk_filename = last_revision.disk_filename
revision.increase_version(version, false) if version == 3
revision.major_version = params[:custom_version_major].to_i
revision.minor_version = params[:custom_version_minor].to_i
else
revision.increase_version(version, false)
end
revision.mime_type = last_revision.mime_type revision.mime_type = last_revision.mime_type
revision.size = last_revision.size revision.size = last_revision.size
else else
revision.increase_version(version, true) if version == 3
revision.major_version = params[:custom_version_major].to_i
revision.minor_version = params[:custom_version_minor].to_i
else
revision.increase_version(version, true)
end
revision.size = file_upload.size revision.size = file_upload.size
revision.disk_filename = revision.new_storage_filename revision.disk_filename = revision.new_storage_filename
revision.mime_type = Redmine::MimeType.of(file_upload.original_filename) revision.mime_type = Redmine::MimeType.of(file_upload.original_filename)

View File

@ -128,7 +128,13 @@ class DmsfUploadController < ApplicationController
new_revision.title = commited_file[:title] new_revision.title = commited_file[:title]
new_revision.description = commited_file[:description] new_revision.description = commited_file[:description]
new_revision.comment = commited_file[:comment] new_revision.comment = commited_file[:comment]
new_revision.increase_version(commited_file[:version].to_i, true) version = commited_file[:version].to_i
if version == 3
new_revision.major_version = commited_file[:custom_version_major].to_i
new_revision.minor_version = commited_file[:custom_version_minor].to_i
else
new_revision.increase_version(version, true)
end
new_revision.mime_type = Redmine::MimeType.of(new_revision.name) new_revision.mime_type = Redmine::MimeType.of(new_revision.name)
new_revision.size = File.size(commited_disk_filepath) new_revision.size = File.size(commited_disk_filepath)

View File

@ -1,9 +1,11 @@
<%#= <%#=
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk> # Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-14 Karel Pičman <karel.picman@kontron.com> # Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
@ -53,15 +55,23 @@
<%= label_tag('fileMinorVersionRadio', "#{l(:label_version)}:") %> <%= label_tag('fileMinorVersionRadio', "#{l(:label_version)}:") %>
</p> </p>
<div class="data clear"> <div class="data clear">
<%= radio_button_tag('version', 0, @revision.version == @file.last_revision.version, :id => 'fileSameVersionRadio') %> <%= radio_button_tag('version', 0,
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version %> <%= l(:option_version_same) %><br /> @revision.version == @file.last_revision.version) %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version %>
<%= l(:option_version_same) %><br/>
<%= radio_button_tag('version', 1, <%= radio_button_tag('version', 1,
@revision.major_version == @file.last_revision.major_version && @revision.minor_version != @file.last_revision.minor_version, @revision.major_version == @file.last_revision.major_version &&
:id => 'fileMinorVersionRadio') %> @revision.minor_version != @file.last_revision.minor_version) %>
<%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version + 1 %> <%= l(:option_version_minor) %><br /> <%= @file.last_revision.major_version %>.<%= @file.last_revision.minor_version + 1 %>
<%= radio_button_tag('version', 2, @revision.major_version != @file.last_revision.major_version) %> <%= l(:option_version_minor) %><br/>
<%= @file.last_revision.major_version + 1 %>.0 <%= l(:option_version_major) %><br /> <%= radio_button_tag('version', 2,
</div> @revision.major_version != @file.last_revision.major_version) %>
<%= @file.last_revision.major_version + 1 %>.0
<%= l(:option_version_major) %><br/>
<%= radio_button_tag('version', 3) %>
<%= select_tag 'custom_version_major', options_for_select(0..99, @file.last_revision.major_version + 2) %>.<%= select_tag 'custom_version_minor', options_for_select(0..99, @file.last_revision.minor_version + 1) %>
<%= l(:option_version_custom) %>
</div>
</div> </div>
<div class="splitcontentright clear"> <div class="splitcontentright clear">
<p> <p>

View File

@ -1,9 +1,11 @@
<%#= <%#=
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk> # Copyright (C) 2012 Daniel Munn <dan.munn@munnster.co.uk>
# Copyright (C) 2011-14 Karel Pičman <karel.picman@kontron.com> # Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
@ -48,9 +50,14 @@
</p> </p>
<div class="data clear"> <div class="data clear">
<%= radio_button_tag("commited_files[#{i}][version]", 1, true) %> <%= radio_button_tag("commited_files[#{i}][version]", 1, true) %>
<%= upload.major_version %>.<%= upload.minor_version + 1 %> <%= l(:option_version_minor) %><br /> <%= upload.major_version %>.<%= upload.minor_version + 1 %>
<%= l(:option_version_minor) %><br/>
<%= radio_button_tag("commited_files[#{i}][version]", 2) %> <%= radio_button_tag("commited_files[#{i}][version]", 2) %>
<%= upload.major_version + 1 %>.0 <%= l(:option_version_major) %><br /> <%= upload.major_version + 1 %>.0
<%= l(:option_version_major) %><br/>
<%= radio_button_tag("commited_files[#{i}][version]", 3) %>
<%= select_tag "commited_files[#{i}][custom_version_major]", options_for_select(0..99, upload.major_version + 2) %>.<%= select_tag "commited_files[#{i}][custom_version_minor]", options_for_select(0..99, upload.minor_version + 1) %>
<%= l(:option_version_custom) %>
</div> </div>
</div> </div>
<div class="splitcontentright clear"> <div class="splitcontentright clear">

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -119,6 +121,7 @@ cs:
option_version_same: Stejná option_version_same: Stejná
option_version_minor: Podružná option_version_minor: Podružná
option_version_major: Hlavní option_version_major: Hlavní
option_version_custom: Vlastní
label_new_content: Nový obsah label_new_content: Nový obsah
label_maximum_files_upload: Maximální počet najednou nahraných souborů label_maximum_files_upload: Maximální počet najednou nahraných souborů
note_maximum_number_of_files_uploaded: Maximální počet najednou nahraných souborů. 0 znamená bez omezení. note_maximum_number_of_files_uploaded: Maximální počet najednou nahraných souborů. 0 znamená bez omezení.

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Terrence Miller # Copyright (C) 2011 Terrence Miller
@ -119,6 +121,7 @@ de:
option_version_major: Hauptversion option_version_major: Hauptversion
label_new_content: Neuer Inhalt label_new_content: Neuer Inhalt
label_maximum_files_upload: Maximal hochzuladende Dateien label_maximum_files_upload: Maximal hochzuladende Dateien
option_version_custom: Benutzerdefinierte
note_maximum_number_of_files_uploaded: Beschränkt die Anzahl der maximal auf einmal hochladbaren Dateien. 0 bedeutet unbeschränkt. note_maximum_number_of_files_uploaded: Beschränkt die Anzahl der maximal auf einmal hochladbaren Dateien. 0 bedeutet unbeschränkt.
label_maximum_files_download: Maximal herunterzuladende Dateien label_maximum_files_download: Maximal herunterzuladende Dateien
note_maximum_number_of_files_downloaded: Beschränkt die Anzahl der maximal auf einmal herunterladbaren Dateien (per ZIP oder Mail). 0 bedeutet unbeschränkt. note_maximum_number_of_files_downloaded: Beschränkt die Anzahl der maximal auf einmal herunterladbaren Dateien (per ZIP oder Mail). 0 bedeutet unbeschränkt.

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -119,6 +121,7 @@ en:
option_version_same: Same option_version_same: Same
option_version_minor: Minor option_version_minor: Minor
option_version_major: Major option_version_major: Major
option_version_custom: Custom
label_new_content: New content label_new_content: New content
label_maximum_files_upload: Maximum files upload label_maximum_files_upload: Maximum files upload
note_maximum_number_of_files_uploaded: Limits maximum number of files uploaded at once. 0 means unlimited. note_maximum_number_of_files_uploaded: Limits maximum number of files uploaded at once. 0 means unlimited.

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -119,6 +121,7 @@ es:
option_version_same: Same option_version_same: Same
option_version_minor: Minor option_version_minor: Minor
option_version_major: Major option_version_major: Major
option_version_custom: Custom
label_new_content: New content label_new_content: New content
label_maximum_files_upload: Maximum files upload label_maximum_files_upload: Maximum files upload
note_maximum_number_of_files_uploaded: Limits maximum number of files uploaded at once. 0 means unlimited. note_maximum_number_of_files_uploaded: Limits maximum number of files uploaded at once. 0 means unlimited.

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -119,6 +121,7 @@ ja:
option_version_same: 変更なし option_version_same: 変更なし
option_version_minor: マイナー option_version_minor: マイナー
option_version_major: メジャー option_version_major: メジャー
option_version_custom: Custom
label_new_content: 新規コンテンツ label_new_content: 新規コンテンツ
label_maximum_files_upload: 最大ファイルアップロード数 label_maximum_files_upload: 最大ファイルアップロード数
note_maximum_number_of_files_uploaded: 一度にアップロードできるファイル数の上限。0は無制限。 note_maximum_number_of_files_uploaded: 一度にアップロードできるファイル数の上限。0は無制限。

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -120,6 +122,7 @@ pl:
option_version_same: Same option_version_same: Same
option_version_minor: Minor option_version_minor: Minor
option_version_major: Major option_version_major: Major
option_version_custom: Custom
label_new_content: Nowa zawartość label_new_content: Nowa zawartość
label_maximum_files_upload: Maximum files upload label_maximum_files_upload: Maximum files upload
note_maximum_number_of_files_uploaded: Maksymalna liczba jednocześnie przesyłanych plików. 0 oznacza brak ograniczeń. note_maximum_number_of_files_uploaded: Maksymalna liczba jednocześnie przesyłanych plików. 0 oznacza brak ograniczeń.

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -119,6 +121,7 @@ ru:
option_version_same: Та же версия option_version_same: Та же версия
option_version_minor: Незначительные изменения option_version_minor: Незначительные изменения
option_version_major: Значительные изменения option_version_major: Значительные изменения
option_version_custom: Custom
label_new_content: Новое содержание label_new_content: Новое содержание
label_maximum_files_upload: Максимальное количество файлов для загрузки label_maximum_files_upload: Максимальное количество файлов для загрузки
note_maximum_number_of_files_uploaded: Ограничивает максимальное количество файлов, которое может быть загружено за один раз. 0 означает отсутствие ограничений. note_maximum_number_of_files_uploaded: Ограничивает максимальное количество файлов, которое может быть загружено за один раз. 0 означает отсутствие ограничений.

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 <zdravko.balorda@mks.si> # Copyright (C) 2011 <zdravko.balorda@mks.si>
@ -119,6 +121,7 @@ sl:
option_version_same: Enako option_version_same: Enako
option_version_minor: Minor option_version_minor: Minor
option_version_major: Major option_version_major: Major
option_version_custom: Custom
label_new_content: Nova vsebina label_new_content: Nova vsebina
label_maximum_files_upload: Maximum naloženih datotek label_maximum_files_upload: Maximum naloženih datotek
note_maximum_number_of_files_uploaded: Omejitev največjega števila datotek za nalaganje naenkrat. 0 pomeni neomejeno. note_maximum_number_of_files_uploaded: Omejitev največjega števila datotek za nalaganje naenkrat. 0 pomeni neomejeno.

View File

@ -1,8 +1,10 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com> # Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
# # Copyright (C) 2013 Aecho Liu <aecho1028@gmail.com>
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
@ -17,9 +19,8 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Translated by Aecho Liu, (aecho1028@gmail.com) zh-TW:
"zh-TW":
dmsf: 文件總管 dmsf: 文件總管
label_dmsf_file_plural: 文件檔案 label_dmsf_file_plural: 文件檔案
label_dmsf_file_revision_plural: Dmsf document revisions label_dmsf_file_revision_plural: Dmsf document revisions
@ -122,6 +123,7 @@
option_version_same: Same option_version_same: Same
option_version_minor: Minor option_version_minor: Minor
option_version_major: Major option_version_major: Major
option_version_custom: Custom
label_new_content: 新的檔案內容 label_new_content: 新的檔案內容
label_maximum_files_upload: 最大上傳檔案數量 label_maximum_files_upload: 最大上傳檔案數量
note_maximum_number_of_files_uploaded: 同時間所能上傳的,最大檔案數量限制。 0 表示沒有限制。 note_maximum_number_of_files_uploaded: 同時間所能上傳的,最大檔案數量限制。 0 表示沒有限制。

View File

@ -1,3 +1,5 @@
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features" # Redmine plugin for Document Management System "Features"
# #
# Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com> # Copyright (C) 2011 Vít Jonáš <vit.jonas@gmail.com>
@ -119,6 +121,7 @@ zh:
option_version_same: Same option_version_same: Same
option_version_minor: Minor option_version_minor: Minor
option_version_major: Major option_version_major: Major
option_version_custom: Custom
label_new_content: 新内容 label_new_content: 新内容
label_maximum_files_upload: 最大上传文件数 label_maximum_files_upload: 最大上传文件数
note_maximum_number_of_files_uploaded: 一次上传的最大文件数量. 0表示无限制. note_maximum_number_of_files_uploaded: 一次上传的最大文件数量. 0表示无限制.