From c2c2bebdbd508f9dbe1110ab78f4a3d6019aea6d Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Fri, 1 Mar 2013 14:27:14 +0100 Subject: [PATCH] Multiple DMSF tabs in Administration->Custom fields fixed --- .../patches/custom_fields_helper.rb | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/redmine_dmsf/patches/custom_fields_helper.rb b/lib/redmine_dmsf/patches/custom_fields_helper.rb index d700bd31..bd2b5009 100644 --- a/lib/redmine_dmsf/patches/custom_fields_helper.rb +++ b/lib/redmine_dmsf/patches/custom_fields_helper.rb @@ -1,3 +1,20 @@ +# Copyright (C) 2011 Vit Jons +# Copyright (C) 2012 Daniel Munn +# Copyright (C) 2013 Karel Picman +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + module RedmineDmsf module Patches module CustomFieldsHelper @@ -7,9 +24,13 @@ module RedmineDmsf end end - def custom_fields_tabs_with_customer_tab - tabs = custom_fields_tabs_without_customer_tab - tabs << {:name => 'DmsfFileRevisionCustomField', :partial => 'custom_fields/index', :label => :DMSF_custom_field} + def custom_fields_tabs_with_customer_tab + cf = {:name => 'DmsfFileRevisionCustomField', :partial => 'custom_fields/index', :label => :dmsf} + unless CustomField::CUSTOM_FIELDS_NAMES.include?(cf[:name]) + CustomField::CUSTOM_FIELDS_TABS << cf + CustomField::CUSTOM_FIELDS_NAMES << cf[:name] + end + custom_fields_tabs_without_customer_tab end end end