diff --git a/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb b/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb index 1b66980f..55766e78 100644 --- a/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb +++ b/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb @@ -1,8 +1,10 @@ +# encoding: utf-8 +# # Redmine plugin for Document Management System "Features" # # Copyright (C) 2011 Vít Jonáš # Copyright (C) 2012 Daniel Munn -# Copyright (C) 2011-15 Karel Picman +# Copyright (C) 2011-15 Karel Pičman # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -40,24 +42,21 @@ module RedmineDmsf module InstanceMethods def render_custom_fields_tabs_with_render_custom_tab(types) - add_cf - render_custom_fields_tabs_without_render_custom_tab(types) - end - - def custom_field_type_options_with_custom_tab_options - add_cf - custom_field_type_options_without_custom_tab_options - end - - private - - def add_cf cf = {:name => 'DmsfFileRevisionCustomField', :partial => 'custom_fields/index', :label => :dmsf} unless CustomFieldsHelper::CUSTOM_FIELDS_TABS.index { |f| f[:name] == cf[:name] } CustomFieldsHelper::CUSTOM_FIELDS_TABS << cf end + render_custom_fields_tabs_without_render_custom_tab(types) end - + + def custom_field_type_options_with_custom_tab_options + cf = {:name => 'DmsfFileRevisionCustomField', :partial => 'custom_fields/index', :label => :dmsf} + unless CustomFieldsHelper::CUSTOM_FIELDS_TABS.index { |f| f[:name] == cf[:name] } + CustomFieldsHelper::CUSTOM_FIELDS_TABS << cf + end + custom_field_type_options_without_custom_tab_options + end + end end end diff --git a/lib/redmine_dmsf/webdav/dmsf_resource.rb b/lib/redmine_dmsf/webdav/dmsf_resource.rb index 553d5d54..064be154 100644 --- a/lib/redmine_dmsf/webdav/dmsf_resource.rb +++ b/lib/redmine_dmsf/webdav/dmsf_resource.rb @@ -221,8 +221,7 @@ module RedmineDmsf if (parent.projectless_path != '/') return Conflict unless parent.folder? parent_folder = parent.folder.id - end - #f = DmsfFolder.new({:title => basename, :dmsf_folder_id => parent_folder, :description => 'Folder created from WebDav'}) + end f = DmsfFolder.new f.title = basename f.dmsf_folder_id = parent_folder