From c6795db40bd01456f4f371f9f99958cb8a719fe0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Wed, 30 Jul 2014 13:07:39 +0200 Subject: [PATCH] Custom fields tabs not work with last custom_fields_helper_patch.rb #267 --- .../patches/custom_fields_helper_patch.rb | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb b/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb index ca322fde..d9f3f8bb 100644 --- a/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb +++ b/lib/redmine_dmsf/patches/custom_fields_helper_patch.rb @@ -1,7 +1,7 @@ # Redmine plugin for Document Management System "Features" # -# Copyright (C) 2011 Vít Jonáš -# Copyright (C) 2012 Daniel Munn +# Copyright (C) 2011 Vít Jonáš +# Copyright (C) 2012 Daniel Munn # Copyright (C) 2011-14 Karel Picman # # This program is free software; you can redistribute it and/or @@ -61,9 +61,15 @@ module RedmineDmsf 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 + if Redmine::VERSION::MAJOR <= 2 && Redmine::VERSION::MINOR < 4 + unless CustomField::CUSTOM_FIELDS_TABS.index { |f| f[:name] == cf[:name] } + CustomField::CUSTOM_FIELDS_TABS << cf + end + else + unless CustomFieldsHelper::CUSTOM_FIELDS_TABS.index { |f| f[:name] == cf[:name] } + CustomFieldsHelper::CUSTOM_FIELDS_TABS << cf + end + end end end end