diff --git a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb index b28cf1ad..9e8e2630 100644 --- a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb +++ b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb @@ -71,7 +71,9 @@ module RedmineDmsf end def view_issues_show_thumbnails(context={}) - show_thumbnails(context[:container], context[:controller]) + unless context[:options][:only_mails].present? + show_thumbnails(context[:container], context[:controller]) + end end def view_issues_dms_thumbnails(context={}) diff --git a/lib/redmine_dmsf/patches/easy_crm_case_patch.rb b/lib/redmine_dmsf/patches/easy_crm_case_patch.rb index 1b979328..819793b8 100644 --- a/lib/redmine_dmsf/patches/easy_crm_case_patch.rb +++ b/lib/redmine_dmsf/patches/easy_crm_case_patch.rb @@ -178,9 +178,10 @@ module RedmineDmsf end end -# Apply patch -Rails.configuration.to_prepare do - unless EasyCrmCase.included_modules.include?(RedmineDmsf::Patches::EasyCrmCasePatch) - EasyCrmCase.send(:include, RedmineDmsf::Patches::EasyCrmCasePatch) +if Redmine::Plugin.installed?(:easy_crm) + Rails.configuration.to_prepare do + unless EasyCrmCase.included_modules.include?(RedmineDmsf::Patches::EasyCrmCasePatch) + EasyCrmCase.send(:include, RedmineDmsf::Patches::EasyCrmCasePatch) + end end -end +end \ No newline at end of file diff --git a/lib/redmine_dmsf/patches/easy_crm_cases_controller_patch.rb b/lib/redmine_dmsf/patches/easy_crm_cases_controller_patch.rb index 5222bd38..25ed21e2 100644 --- a/lib/redmine_dmsf/patches/easy_crm_cases_controller_patch.rb +++ b/lib/redmine_dmsf/patches/easy_crm_cases_controller_patch.rb @@ -95,8 +95,10 @@ module RedmineDmsf end end -Rails.configuration.to_prepare do - unless EasyCrmCasesController.included_modules.include?(RedmineDmsf::EasyCrmCasesControllerPatch) - EasyCrmCasesController.send(:include, RedmineDmsf::EasyCrmCasesControllerPatch) +if Redmine::Plugin.installed?(:easy_crm) + Rails.configuration.to_prepare do + unless EasyCrmCasesController.included_modules.include?(RedmineDmsf::EasyCrmCasesControllerPatch) + EasyCrmCasesController.send(:include, RedmineDmsf::EasyCrmCasesControllerPatch) + end end end