diff --git a/assets/stylesheets/easy_extensions.css b/assets/stylesheets/easy_dmsf.css similarity index 97% rename from assets/stylesheets/easy_extensions.css rename to assets/stylesheets/easy_dmsf.css index caefb928..3c04ff32 100644 --- a/assets/stylesheets/easy_extensions.css +++ b/assets/stylesheets/easy_dmsf.css @@ -227,4 +227,13 @@ div.autoscroll.dmsf-revision-access { .dmsf-info-title { font-weight: bold; +} + +/* Also available as */ +.other-formats a.csv::before { + content: "" !important; +} + +.other-formats a::before { + content: "|" !important; } \ No newline at end of file diff --git a/lib/redmine_dmsf/hooks/views/base_view_hooks.rb b/lib/redmine_dmsf/hooks/views/base_view_hooks.rb index ffa75b2f..2a32d93f 100644 --- a/lib/redmine_dmsf/hooks/views/base_view_hooks.rb +++ b/lib/redmine_dmsf/hooks/views/base_view_hooks.rb @@ -36,7 +36,7 @@ module RedmineDmsf "\n".html_safe + javascript_include_tag('redmine_dmsf.js', plugin: :redmine_dmsf, defer: true) + "\n".html_safe + javascript_include_tag('attachments_dmsf.js', plugin: :redmine_dmsf, defer: true) if defined?(EasyExtensions) - meta << ("\n".html_safe + stylesheet_link_tag('easy_extensions.css', plugin: :redmine_dmsf)) + meta << ("\n".html_safe + stylesheet_link_tag('easy_dmsf.css', plugin: :redmine_dmsf)) end meta end diff --git a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb index 62065aad..c7ca14d3 100644 --- a/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb +++ b/lib/redmine_dmsf/hooks/views/issue_view_hooks.rb @@ -81,8 +81,6 @@ module RedmineDmsf end def view_issues_show_attachments_table_bottom(context = {}) - return if context[:options][:only_mails].blank? - show_attached_documents context[:container], context[:controller], context[:attachments] end @@ -91,12 +89,10 @@ module RedmineDmsf end def view_issues_show_thumbnails(context = {}) - show_thumbnails(context[:container], context[:controller]) if context[:options][:only_mails].blank? + show_thumbnails(context[:container], context[:controller]) end def view_issues_dms_thumbnails(context = {}) - return if context[:options][:only_mails].blank? - links = get_links(context[:container]) return unless links.present? && Setting.thumbnails_enabled? diff --git a/lib/redmine_dmsf/patches/access_control_patch.rb b/lib/redmine_dmsf/patches/access_control_patch.rb index 4be2f78d..6d2f0f8a 100644 --- a/lib/redmine_dmsf/patches/access_control_patch.rb +++ b/lib/redmine_dmsf/patches/access_control_patch.rb @@ -47,7 +47,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_patch_to_be_first 'Redmine::Acts::Attachable::InstanceMethods', + EasyPatchManager.register_patch_to_be_first 'Redmine::Acts::Attachable::InstanceMethods', 'RedmineDmsf::Patches::AccessControlPatch', prepend: true, first: true diff --git a/lib/redmine_dmsf/patches/application_helper_patch.rb b/lib/redmine_dmsf/patches/application_helper_patch.rb index fe282c95..d7129d51 100644 --- a/lib/redmine_dmsf/patches/application_helper_patch.rb +++ b/lib/redmine_dmsf/patches/application_helper_patch.rb @@ -26,10 +26,9 @@ module RedmineDmsf # Overridden methods def xapian_link_to_entity(entity, html_options = {}) - case entity.is_a? - when DmsfFolder + if entity.is_a?(DmsfFolder) link_to h(entity.to_s), dmsf_folder_path(id: entity.project_id, folder_id: entity), class: 'icon icon-folder' - when DmsfFile + elsif entity.is_a?(DmsfFile) link_to h(entity.to_s), dmsf_file_path(id: entity), class: 'icon icon-file' else super diff --git a/lib/redmine_dmsf/patches/attachable_patch.rb b/lib/redmine_dmsf/patches/attachable_patch.rb index 54d6275b..5373ba12 100644 --- a/lib/redmine_dmsf/patches/attachable_patch.rb +++ b/lib/redmine_dmsf/patches/attachable_patch.rb @@ -36,7 +36,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_patch_to_be_first 'Redmine::Acts::Attachable::InstanceMethods', + EasyPatchManager.register_patch_to_be_first 'Redmine::Acts::Attachable::InstanceMethods', 'RedmineDmsf::Patches::AttachablePatch', prepend: true, first: true diff --git a/lib/redmine_dmsf/patches/custom_field_patch.rb b/lib/redmine_dmsf/patches/custom_field_patch.rb index aef6c39c..7db19969 100644 --- a/lib/redmine_dmsf/patches/custom_field_patch.rb +++ b/lib/redmine_dmsf/patches/custom_field_patch.rb @@ -33,7 +33,7 @@ end # Apply patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_model_patch 'CustomField', 'RedmineDmsf::Patches::CustomFieldPatch' + EasyPatchManager.register_model_patch 'CustomField', 'RedmineDmsf::Patches::CustomFieldPatch' else CustomField.include RedmineDmsf::Patches::CustomFieldPatch end diff --git a/lib/redmine_dmsf/patches/easy_crm_case_patch.rb b/lib/redmine_dmsf/patches/easy_crm_case_patch.rb index d87f25d1..e046b3cc 100644 --- a/lib/redmine_dmsf/patches/easy_crm_case_patch.rb +++ b/lib/redmine_dmsf/patches/easy_crm_case_patch.rb @@ -158,7 +158,6 @@ module RedmineDmsf end # Apply the patch -if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_model_patch 'EasyCrmCase', 'RedmineDmsf::Patches::EasyCrmCasePatch', - if: proc { Redmine::Plugin.installed?('easy_crm') } +if Redmine::Plugin.installed?('easy_crm') + EasyPatchManager.register_model_patch 'EasyCrmCase', 'RedmineDmsf::Patches::EasyCrmCasePatch' end 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 6b7cc572..613d20cf 100644 --- a/lib/redmine_dmsf/patches/easy_crm_cases_controller_patch.rb +++ b/lib/redmine_dmsf/patches/easy_crm_cases_controller_patch.rb @@ -116,9 +116,8 @@ module RedmineDmsf end # Apply the patch -if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_controller_patch 'EasyCrmCasesController', - 'RedmineDmsf::Patches::EasyCrmCasesControllerPatch', - prepend: true, - if: proc { Redmine::Plugin.installed?('easy_crm') } +if Redmine::Plugin.installed?('easy_crm') + EasyPatchManager.register_controller_patch 'EasyCrmCasesController', + 'RedmineDmsf::Patches::EasyCrmCasesControllerPatch', + prepend: true end diff --git a/lib/redmine_dmsf/patches/issue_patch.rb b/lib/redmine_dmsf/patches/issue_patch.rb index cd2cc0bf..36cd58e9 100644 --- a/lib/redmine_dmsf/patches/issue_patch.rb +++ b/lib/redmine_dmsf/patches/issue_patch.rb @@ -162,7 +162,7 @@ end # Apply patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_model_patch 'Issue', 'RedmineDmsf::Patches::IssuePatch' + EasyPatchManager.register_model_patch 'Issue', 'RedmineDmsf::Patches::IssuePatch' else Issue.prepend RedmineDmsf::Patches::IssuePatch end diff --git a/lib/redmine_dmsf/patches/notifiable_patch.rb b/lib/redmine_dmsf/patches/notifiable_patch.rb index f1941400..562757d7 100644 --- a/lib/redmine_dmsf/patches/notifiable_patch.rb +++ b/lib/redmine_dmsf/patches/notifiable_patch.rb @@ -45,4 +45,6 @@ module RedmineDmsf end # Apply the patch -Redmine::Notifiable.prepend RedmineDmsf::Patches::NotifiablePatch unless RedmineDmsf::Plugin.an_obsolete_plugin_present? +unless defined?(EasyExtensions) || RedmineDmsf::Plugin.an_obsolete_plugin_present? + Redmine::Notifiable.prepend RedmineDmsf::Patches::NotifiablePatch +end diff --git a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb index 6985a079..e5047569 100644 --- a/lib/redmine_dmsf/patches/notifiable_ru_patch.rb +++ b/lib/redmine_dmsf/patches/notifiable_ru_patch.rb @@ -48,4 +48,6 @@ module RedmineDmsf end # Apply the patch -Redmine::Notifiable.include RedmineDmsf::Patches::NotifiableRuPatch if RedmineDmsf::Plugin.an_obsolete_plugin_present? +if !defined?(EasyExtensions) && RedmineDmsf::Plugin.an_obsolete_plugin_present? + Redmine::Notifiable.include RedmineDmsf::Patches::NotifiableRuPatch +end diff --git a/lib/redmine_dmsf/patches/pdf_patch.rb b/lib/redmine_dmsf/patches/pdf_patch.rb index f89b0941..9f6dddbe 100644 --- a/lib/redmine_dmsf/patches/pdf_patch.rb +++ b/lib/redmine_dmsf/patches/pdf_patch.rb @@ -43,7 +43,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_patch_to_be_first 'Redmine::Export::PDF::ITCPDF', + EasyPatchManager.register_patch_to_be_first 'Redmine::Export::PDF::ITCPDF', 'RedmineDmsf::Patches::PdfPatch', prepend: true, first: true diff --git a/lib/redmine_dmsf/patches/project_patch.rb b/lib/redmine_dmsf/patches/project_patch.rb index 3e827834..a540d3ae 100644 --- a/lib/redmine_dmsf/patches/project_patch.rb +++ b/lib/redmine_dmsf/patches/project_patch.rb @@ -134,7 +134,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_model_patch 'Project', 'RedmineDmsf::Patches::ProjectPatch', prepend: true + EasyPatchManager.register_model_patch 'Project', 'RedmineDmsf::Patches::ProjectPatch', prepend: true else Project.prepend RedmineDmsf::Patches::ProjectPatch end diff --git a/lib/redmine_dmsf/patches/queries_controller_patch.rb b/lib/redmine_dmsf/patches/queries_controller_patch.rb index 375ca76a..f476125c 100644 --- a/lib/redmine_dmsf/patches/queries_controller_patch.rb +++ b/lib/redmine_dmsf/patches/queries_controller_patch.rb @@ -40,7 +40,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_controller_patch 'QueriesController', + EasyPatchManager.register_controller_patch 'QueriesController', 'RedmineDmsf::Patches::QueriesControllerPatch', prepend: true else diff --git a/lib/redmine_dmsf/patches/role_patch.rb b/lib/redmine_dmsf/patches/role_patch.rb index e794acc7..1e592dfe 100644 --- a/lib/redmine_dmsf/patches/role_patch.rb +++ b/lib/redmine_dmsf/patches/role_patch.rb @@ -42,7 +42,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_model_patch 'Role', 'RedmineDmsf::Patches::RolePatch', prepend: true + EasyPatchManager.register_model_patch 'Role', 'RedmineDmsf::Patches::RolePatch', prepend: true else Role.prepend RedmineDmsf::Patches::RolePatch end diff --git a/lib/redmine_dmsf/patches/search_controller_patch.rb b/lib/redmine_dmsf/patches/search_controller_patch.rb index 7b2bfd03..43688e31 100644 --- a/lib/redmine_dmsf/patches/search_controller_patch.rb +++ b/lib/redmine_dmsf/patches/search_controller_patch.rb @@ -39,7 +39,7 @@ end # Apply the patch if Redmine::Plugin.installed?(:easy_extensions) - RedmineExtensions::PatchManager.register_controller_patch 'SearchController', + EasyPatchManager.register_controller_patch 'SearchController', 'RedmineDmsf::Patches::SearchControllerPatch', prepend: true end diff --git a/lib/redmine_dmsf/patches/search_patch.rb b/lib/redmine_dmsf/patches/search_patch.rb index 6766889d..c54ff96b 100644 --- a/lib/redmine_dmsf/patches/search_patch.rb +++ b/lib/redmine_dmsf/patches/search_patch.rb @@ -47,7 +47,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_patch_to_be_first 'Redmine::Acts::Attachable::InstanceMethods', + EasyPatchManager.register_patch_to_be_first 'Redmine::Acts::Attachable::InstanceMethods', 'RedmineDmsf::Patches::SearchPatch', prepend: true, first: true diff --git a/lib/redmine_dmsf/patches/user_patch.rb b/lib/redmine_dmsf/patches/user_patch.rb index e167e28c..466b9ad7 100644 --- a/lib/redmine_dmsf/patches/user_patch.rb +++ b/lib/redmine_dmsf/patches/user_patch.rb @@ -64,7 +64,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_model_patch 'User', 'RedmineDmsf::Patches::UserPatch' + EasyPatchManager.register_model_patch 'User', 'RedmineDmsf::Patches::UserPatch' else User.prepend RedmineDmsf::Patches::UserPatch end diff --git a/lib/redmine_dmsf/patches/user_preference_patch.rb b/lib/redmine_dmsf/patches/user_preference_patch.rb index 2b4629c2..76915375 100644 --- a/lib/redmine_dmsf/patches/user_preference_patch.rb +++ b/lib/redmine_dmsf/patches/user_preference_patch.rb @@ -60,7 +60,7 @@ end # Apply the patch if Redmine::Plugin.installed?('easy_extensions') - RedmineExtensions::PatchManager.register_model_patch 'UserPreference', 'RedmineDmsf::Patches::UserPreferencePatch' + EasyPatchManager.register_model_patch 'UserPreference', 'RedmineDmsf::Patches::UserPreferencePatch' else UserPreference.prepend RedmineDmsf::Patches::UserPreferencePatch end diff --git a/lib/xapian_easy_search/dmsf_file_mapper.rb b/lib/xapian_easy_search/dmsf_file_mapper.rb index 4592c546..b980fb85 100644 --- a/lib/xapian_easy_search/dmsf_file_mapper.rb +++ b/lib/xapian_easy_search/dmsf_file_mapper.rb @@ -47,5 +47,3 @@ module XapianEasySearch end end end - -XapianEasySearch::DmsfFileMapper.attach if Redmine::Plugin.installed?('easy_extensions') diff --git a/lib/xapian_easy_search/dmsf_folder_mapper.rb b/lib/xapian_easy_search/dmsf_folder_mapper.rb index 6e008fd7..47853353 100644 --- a/lib/xapian_easy_search/dmsf_folder_mapper.rb +++ b/lib/xapian_easy_search/dmsf_folder_mapper.rb @@ -38,5 +38,3 @@ module XapianEasySearch end end end - -XapianEasySearch::DmsfFolderMapper.attach if Redmine::Plugin.installed?('easy_extensions')