diff --git a/.github/workflows/rubyonrails.yml b/.github/workflows/rubyonrails.yml index c701e6b0..80609fda 100644 --- a/.github/workflows/rubyonrails.yml +++ b/.github/workflows/rubyonrails.yml @@ -20,9 +20,9 @@ name: "GitHub CI" on: push: - branches: ["devel"] + branches: ["cleanup"] pull_request: - branches: ["devel"] + branches: ["cleanup"] jobs: plugin_tests: strategy: diff --git a/app/models/epm_dmsf_locked_documents.rb b/app/models/epm_dmsf_locked_documents.rb deleted file mode 100644 index 82a3a9c6..00000000 --- a/app/models/epm_dmsf_locked_documents.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -# My locked documents - My page panel -class EpmDmsfLockedDocuments < EasyPageModule - def category_name - @category_name ||= 'easy_dms' - end - - def get_show_data(_settings, _user, _page_context = {}) - {} - end - - def get_edit_data(_settings, _user, _page_context = {}) - {} - end - - def registered_in_plugin - 'redmine_dmsf' - end -end diff --git a/app/models/epm_dmsf_open_approvals.rb b/app/models/epm_dmsf_open_approvals.rb deleted file mode 100644 index a293f29d..00000000 --- a/app/models/epm_dmsf_open_approvals.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -# My open approvals - My page panel -class EpmDmsfOpenApprovals < EasyPageModule - def category_name - @category_name ||= 'easy_dms' - end - - def get_show_data(_settings, _user, _page_context = {}) - {} - end - - def get_edit_data(_settings, _user, _page_context = {}) - {} - end - - def registered_in_plugin - 'redmine_dmsf' - end -end diff --git a/app/models/epm_dmsf_watched_documents.rb b/app/models/epm_dmsf_watched_documents.rb deleted file mode 100644 index 66883c44..00000000 --- a/app/models/epm_dmsf_watched_documents.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -# My open approvals - My page panel -class EpmDmsfWatchedDocuments < EasyPageModule - def category_name - @category_name ||= 'easy_dms' - end - - def get_show_data(_settings, _user, _page_context = {}) - {} - end - - def get_edit_data(_settings, _user, _page_context = {}) - {} - end - - def registered_in_plugin - 'redmine_dmsf' - end -end diff --git a/app/views/easy_page_modules/easy_dms/_dmsf_locked_documents_edit.html.erb b/app/views/easy_page_modules/easy_dms/_dmsf_locked_documents_edit.html.erb deleted file mode 100644 index 48573928..00000000 --- a/app/views/easy_page_modules/easy_dms/_dmsf_locked_documents_edit.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% - # encoding: utf-8 - # - # Redmine plugin for Document Management System "Features" - # - # Karel Pičman - # - # This file is part of Redmine DMSF plugin. - # - # Redmine DMSF plugin 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 3 of the License, or (at your option) any - # later version. - # - # Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - # . -%> - -<% 'Nothing to show' %> diff --git a/app/views/easy_page_modules/easy_dms/_dmsf_locked_documents_show.html.erb b/app/views/easy_page_modules/easy_dms/_dmsf_locked_documents_show.html.erb deleted file mode 100644 index d753f51f..00000000 --- a/app/views/easy_page_modules/easy_dms/_dmsf_locked_documents_show.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% - # encoding: utf-8 - # - # Redmine plugin for Document Management System "Features" - # - # Karel Pičman - # - # This file is part of Redmine DMSF plugin. - # - # Redmine DMSF plugin 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 3 of the License, or (at your option) any - # later version. - # - # Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - # . -%> - -<%= render partial: 'my/blocks/locked_documents' %> diff --git a/app/views/easy_page_modules/easy_dms/_dmsf_open_approvals_edit.html.erb b/app/views/easy_page_modules/easy_dms/_dmsf_open_approvals_edit.html.erb deleted file mode 100644 index 48573928..00000000 --- a/app/views/easy_page_modules/easy_dms/_dmsf_open_approvals_edit.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% - # encoding: utf-8 - # - # Redmine plugin for Document Management System "Features" - # - # Karel Pičman - # - # This file is part of Redmine DMSF plugin. - # - # Redmine DMSF plugin 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 3 of the License, or (at your option) any - # later version. - # - # Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - # . -%> - -<% 'Nothing to show' %> diff --git a/app/views/easy_page_modules/easy_dms/_dmsf_open_approvals_show.html.erb b/app/views/easy_page_modules/easy_dms/_dmsf_open_approvals_show.html.erb deleted file mode 100644 index a529c0c9..00000000 --- a/app/views/easy_page_modules/easy_dms/_dmsf_open_approvals_show.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% - # encoding: utf-8 - # - # Redmine plugin for Document Management System "Features" - # - # Karel Pičman - # - # This file is part of Redmine DMSF plugin. - # - # Redmine DMSF plugin 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 3 of the License, or (at your option) any - # later version. - # - # Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - # . -%> - -<%= render partial: 'my/blocks/open_approvals' %> diff --git a/app/views/easy_page_modules/easy_dms/_dmsf_watched_documents_edit.html.erb b/app/views/easy_page_modules/easy_dms/_dmsf_watched_documents_edit.html.erb deleted file mode 100644 index 48573928..00000000 --- a/app/views/easy_page_modules/easy_dms/_dmsf_watched_documents_edit.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% - # encoding: utf-8 - # - # Redmine plugin for Document Management System "Features" - # - # Karel Pičman - # - # This file is part of Redmine DMSF plugin. - # - # Redmine DMSF plugin 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 3 of the License, or (at your option) any - # later version. - # - # Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - # . -%> - -<% 'Nothing to show' %> diff --git a/app/views/easy_page_modules/easy_dms/_dmsf_watched_documents_show.html.erb b/app/views/easy_page_modules/easy_dms/_dmsf_watched_documents_show.html.erb deleted file mode 100644 index 08c63e19..00000000 --- a/app/views/easy_page_modules/easy_dms/_dmsf_watched_documents_show.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -<% - # encoding: utf-8 - # - # Redmine plugin for Document Management System "Features" - # - # Karel Pičman - # - # This file is part of Redmine DMSF plugin. - # - # Redmine DMSF plugin 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 3 of the License, or (at your option) any - # later version. - # - # Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - # . -%> - -<%= render partial: 'my/blocks/watched_documents' %> diff --git a/app/views/hooks/easy_dmsf/_view_layouts_base_html_head.html.erb b/app/views/hooks/easy_dmsf/_view_layouts_base_html_head.html.erb deleted file mode 100644 index eb2e5ff7..00000000 --- a/app/views/hooks/easy_dmsf/_view_layouts_base_html_head.html.erb +++ /dev/null @@ -1,23 +0,0 @@ -<% - # encoding: utf-8 - # - # Redmine plugin for Document Management System "Features" - # - # Karel Pičman - # - # This file is part of Redmine DMSF plugin. - # - # Redmine DMSF plugin 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 3 of the License, or (at your option) any - # later version. - # - # Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - # . -%> - -<%= stylesheet_link_tag('easy_dmsf') %> -<%= javascript_include_tag('easy_dmsf', defer: true) %> diff --git a/assets/javascripts/easy_dmsf.js b/assets/javascripts/easy_dmsf.js deleted file mode 100644 index 3d9f9f76..00000000 --- a/assets/javascripts/easy_dmsf.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - Redmine plugin for Document Management System "Features" - - Karel Pičman - - This file is part of Redmine DMSF plugin. - - Redmine DMSF plugin 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 3 of the License, or (at your option) any - later version. - - Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - . -*/ - -/* -*= require select2.min -*= require redmine_dmsf -*= require attachments_dmsf - */ diff --git a/assets/stylesheets/easy_dmsf.css b/assets/stylesheets/easy_dmsf.css deleted file mode 100644 index 1399a84d..00000000 --- a/assets/stylesheets/easy_dmsf.css +++ /dev/null @@ -1,23 +0,0 @@ -/* - Redmine plugin for Document Management System "Features" - - Karel Pičman - - This file is part of Redmine DMSF plugin. - - Redmine DMSF plugin 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 3 of the License, or (at your option) any - later version. - - Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see - . -*/ - -/* -*= require redmine_dmsf -*= require select2.min -*/ diff --git a/assets/stylesheets/img/loading.gif b/assets/stylesheets/img/loading.gif deleted file mode 100644 index f0109d17..00000000 Binary files a/assets/stylesheets/img/loading.gif and /dev/null differ diff --git a/assets/stylesheets/img/plupload.png b/assets/stylesheets/img/plupload.png deleted file mode 100644 index 6b629d01..00000000 Binary files a/assets/stylesheets/img/plupload.png and /dev/null differ diff --git a/config/initializers/easy_assets.rb b/config/initializers/easy_assets.rb deleted file mode 100644 index 99b3799c..00000000 --- a/config/initializers/easy_assets.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Vít Jonáš , Daniel Munn , Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -Rails.application.configure do - asset_paths = EasyAssets.plugin_asset_paths('plugins/redmine_dmsf') - config.assets.paths.concat asset_paths - config.assets.precompile << 'easy_dmsf.js' - config.assets.precompile << 'easy_dmsf.css' -end diff --git a/config/initializers/easy_software.rb b/config/initializers/easy_software.rb deleted file mode 100644 index abc9f1b8..00000000 --- a/config/initializers/easy_software.rb +++ /dev/null @@ -1,178 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Vít Jonáš , Daniel Munn , Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -require 'redmine' -require 'zip' -require "#{File.dirname(__FILE__)}/../../lib/redmine_dmsf" - -Rails.application.config.after_initialize do - require 'redmine_dmsf/preview' - - webdav = if Redmine::Plugin.installed?('easy_hosting_services') && EasyHostingServices::EasyMultiTenancy.activated? - '1' - else - '0' - end - options = { - 'dmsf_max_file_download' => 0, - 'dmsf_max_email_filesize' => 0, - 'dmsf_storage_directory' => 'files/dmsf', - 'dmsf_index_database' => File.expand_path('dmsf_index', Rails.root), - 'dmsf_stemming_lang' => 'english', - 'dmsf_stemming_strategy' => 'STEM_NONE', - 'dmsf_webdav' => webdav, - 'dmsf_display_notified_recipients' => '0', - 'dmsf_global_title_format' => '', - 'dmsf_columns' => %w[title size modified version workflow author], - 'dmsf_webdav_ignore' => '^(\._|\.DS_Store$|Thumbs.db$)', - 'dmsf_webdav_disable_versioning' => '^\~\$|\.tmp$', - 'dmsf_keep_documents_locked' => '0', - 'dmsf_act_as_attachable' => '0', - 'dmsf_documents_email_from' => '', - 'dmsf_documents_email_reply_to' => '', - 'dmsf_documents_email_links_only' => '0', - 'dmsf_enable_cjk_ngrams' => '0', - 'dmsf_webdav_use_project_names' => '1', - 'dmsf_webdav_ignore_1b_file_for_authentication' => '1', - 'dmsf_projects_as_subfolders' => '0', - 'only_approval_zero_minor_version' => '0', - 'dmsf_max_notification_receivers_info' => 10, - 'office_bin' => 'libreoffice', - 'dmsf_global_menu_disabled' => '0', - 'dmsf_default_query' => '0', - 'empty_minor_version_by_default' => '0', - 'remove_original_documents_module' => '0', - 'dmsf_webdav_authentication' => 'Digest', - 'dmsf_really_delete_files' => '0' - } - - Setting.define_setting 'plugin_redmine_dmsf', { 'default' => options, 'serialized' => true } - Redmine::Plugin.find(:redmine_dmsf).settings = { partial: 'settings/dmsf_settings' } - - # Administration menu extension - Redmine::MenuManager.map :admin_menu do |menu| - menu.push :dmsf_approvalworkflows, :dmsf_workflows_path, - caption: :label_dmsf_workflow_plural, - icon: 'workflows', - html: { class: 'icon icon-workflows' }, - if: proc { |_| User.current.admin? } - end - - # Project menu extension - Redmine::MenuManager.map :project_menu do |menu| - menu.push :dmsf, { controller: 'dmsf', action: 'show' }, - caption: :menu_dmsf, - before: :documents, - param: :id, - html: { class: 'icon icon-dmsf' } - end - - # Main menu extension - Redmine::MenuManager.map :top_menu do |menu| - menu.push :dmsf, { controller: 'dmsf', action: 'index' }, - caption: :menu_dmsf, - html: { class: 'icon-dmsf', category: :rest_extension_modules }, - if: proc { - User.current.allowed_to?(:view_dmsf_folders, nil, global: true) && - ActiveRecord::Base.connection.data_source_exists?('settings') && - !RedmineDmsf.dmsf_global_menu_disabled? - } - end - - Redmine::AccessControl.map do |map| - map.project_module :dmsf do |pmap| - pmap.permission :view_dmsf_file_revision_accesses, {}, read: true - pmap.permission :view_dmsf_file_revisions, {}, read: true - pmap.permission :view_dmsf_folders, { dmsf: %i[show index] }, read: true - pmap.permission :user_preferences, { dmsf_state: [:user_pref_save] }, require: :member - pmap.permission(:view_dmsf_files, - { dmsf: %i[entries_operation entries_email download_email_entries add_email append_email - autocomplete_for_user], - dmsf_files: %i[show view thumbnail], - dmsf_workflows: [:log] }, - read: true) - pmap.permission :email_documents, - { dmsf_public_urls: [:create] } - pmap.permission :folder_manipulation, - { dmsf: %i[new create delete edit save edit_root save_root lock unlock notify_activate - notify_deactivate restore drop copymove], - dmsf_folder_permissions: %i[new append autocomplete_for_user], - dmsf_context_menus: [:dmsf] } - pmap.permission :file_manipulation, - { dmsf_files: %i[create_revision lock unlock delete_revision obsolete_revision - notify_activate notify_deactivate restore], - dmsf_upload: %i[upload_files upload commit_files commit delete_dmsf_attachment - delete_dmsf_link_attachment multi_upload], - dmsf_links: %i[new create destroy restore autocomplete_for_project autocomplete_for_folder], - dmsf_context_menus: [:dmsf] } - pmap.permission :file_delete, - { dmsf: %i[trash delete_entries empty_trash], - dmsf_files: [:delete], - dmsf_trash_context_menus: [:trash] } - pmap.permission :force_file_unlock, {} - pmap.permission :file_approval, - { dmsf_workflows: %i[action new_action autocomplete_for_user start assign assignment] } - pmap.permission :manage_workflows, - { dmsf_workflows: %i[index new create destroy show new_step add_step remove_step - reorder_steps update update_step delete_step edit] } - pmap.permission :display_system_folders, {}, read: true - # Watchers - pmap.permission :view_dmsf_file_watchers, {}, read: true - pmap.permission :add_dmsf_file_watchers, { watchers: %i[new create append autocomplete_for_user] } - pmap.permission :delete_dmsf_file_watchers, { watchers: :destroy } - pmap.permission :view_dmsf_folder_watchers, {}, read: true - pmap.permission :add_dmsf_folder_watchers, { watchers: %i[new create append autocomplete_for_user] } - pmap.permission :delete_dmsf_folder_watchers, { watchers: :destroy } - pmap.permission :view_project_watchers, {}, read: true - pmap.permission :add_project_watchers, { watchers: %i[new create append autocomplete_for_user] } - pmap.permission :delete_project_watchers, { watchers: :destroy } - end - end - - # Register panels for My page - EpmDmsfLockedDocuments.register_to_scope :user, plugin: :redmine_dmsf - EpmDmsfOpenApprovals.register_to_scope :user, plugin: :redmine_dmsf - EpmDmsfWatchedDocuments.register_to_scope :user, plugin: :redmine_dmsf - - # DMSF WebDAV digest token - Token.add_action :dmsf_webdav_digest, max_instances: 1, validity_time: nil -end - -Rails.application.configure do - # Rubyzip configuration - Zip.unicode_names = true - - Rails.application.config.after_initialize do - # DMS custom fields - CustomFieldsHelper::CUSTOM_FIELDS_TABS << { name: 'DmsfFileRevisionCustomField', partial: 'custom_fields/index', - label: :dmsf } - # Searchable modules - Redmine::Search.map do |search| - search.register :dmsf_files - search.register :dmsf_folders - end - - # Activities - Redmine::Activity.register :dmsf_file_revision_accesses, default: false - Redmine::Activity.register :dmsf_file_revisions - end - - require "#{File.dirname(__FILE__)}/../../lib/redmine_dmsf/webdav/custom_middleware" - config.middleware.insert_before ActionDispatch::Cookies, RedmineDmsf::Webdav::CustomMiddleware -end diff --git a/config/initializers/webdav.rb b/config/initializers/webdav.rb deleted file mode 100644 index 072d6ff8..00000000 --- a/config/initializers/webdav.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Vít Jonáš , Daniel Munn , Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -require 'redmine_dmsf/webdav/custom_middleware' - -Rails.application.configure do - config.middleware.insert_before ActionDispatch::Cookies, RedmineDmsf::Webdav::CustomMiddleware -end diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 730eba26..e6c0603a 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -495,14 +495,6 @@ cs: warning_folder_unlockable: Složku nelze odemknout redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/de.yml b/config/locales/de.yml index 514157e5..4c6fc8b4 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -491,14 +491,6 @@ de: warning_folder_unlockable: Der Ordner kann nicht entsperrt werden redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: Von mir gesperrte Dokumente - dmsf_open_approvals: Offene Genehmigungen - dmsf_watched_documents: Meine beobachteten Dokumente - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/en.yml b/config/locales/en.yml index 7b53f546..0a3b8f12 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -494,15 +494,6 @@ en: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/es.yml b/config/locales/es.yml index da1cd657..85757eed 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -494,14 +494,6 @@ es: label_dmsf_commit: Commit label_dmsf_upload_commit: Upload and commit - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 34dac73a..77e67a05 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -473,14 +473,6 @@ fa: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: اسناد قفل شده‌ی من - dmsf_open_approvals: تاییدهای باز من - dmsf_watched_documents: My watched documents - module_category: - easy_dms: مدیریت اسناد آسان - activerecord: errors: messages: diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 3100d2b5..ea99646a 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -494,14 +494,6 @@ fr: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/hu.yml b/config/locales/hu.yml index ab8e1158..7790ae3d 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -493,14 +493,6 @@ hu: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/it.yml b/config/locales/it.yml index 97ab60c9..d4ef24a0 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -494,14 +494,6 @@ it: # Italian strings thx 2 Matteo Arceci! warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index ac3de256..f9087d21 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -495,14 +495,6 @@ ja: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: 自分がロック中の文書 - dmsf_open_approvals: 自分が未承認の文書 - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/ko.yml b/config/locales/ko.yml index bea0daa7..68aa478a 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -494,14 +494,6 @@ ko: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: 내 잠긴 파일 - dmsf_open_approvals: 내 열린 승인 - dmsf_watched_documents: My watched documents - module_category: - easy_dms: DMS - activerecord: errors: messages: diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 122cd2a6..df58c1f0 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -494,14 +494,6 @@ nl: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 1a2c12a8..618e1ff2 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -494,14 +494,6 @@ pl: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 18d327dd..b00355ef 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -494,14 +494,6 @@ pt-BR: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/sl.yml b/config/locales/sl.yml index 773c896b..e26aca4a 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -494,14 +494,6 @@ sl: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/uk.yml b/config/locales/uk.yml index 4ca42571..efe5b810 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -496,14 +496,6 @@ uk: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: Мої заблоковані документи - dmsf_open_approvals: Мої відкриті дозволи - dmsf_watched_documents: Мої переглянуті документи - module_category: - easy_dms: Легкий DMS - activerecord: errors: messages: diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 6661f296..8a612d20 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -493,14 +493,6 @@ zh-TW: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 8d120597..43b3e4f4 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -494,14 +494,6 @@ zh: warning_folder_unlockable: The folder can't be unlocked redmine_dmsf: Redmine DMSF - easy_pages: - modules: - dmsf_locked_documents: My locked documents - dmsf_open_approvals: My open approvals - dmsf_watched_documents: My watched documents - module_category: - easy_dms: Easy DMS - activerecord: errors: messages: diff --git a/lib/easy_page_module.rb b/lib/easy_page_module.rb deleted file mode 100644 index 79dda0ad..00000000 --- a/lib/easy_page_module.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -unless defined?(EasyExtensions) - # Foo class - class EasyPageModule - def foo; end - end -end diff --git a/lib/redmine_dmsf.rb b/lib/redmine_dmsf.rb index 0eed415a..58dc7326 100644 --- a/lib/redmine_dmsf.rb +++ b/lib/redmine_dmsf.rb @@ -297,5 +297,3 @@ end after_easy_init do require "#{File.dirname(__FILE__)}/redmine_dmsf/field_formats/dmsf_file_revision_format" end - -require "#{File.dirname(__FILE__)}/easy_page_module" unless defined?(EasyExtensions) diff --git a/patches/easy_crm_case_patch.rb b/patches/easy_crm_case_patch.rb deleted file mode 100644 index 27959973..00000000 --- a/patches/easy_crm_case_patch.rb +++ /dev/null @@ -1,164 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -module RedmineDmsf - module Patches - # Easy CRM case - module EasyCrmCasePatch - ################################################################################################################## - # New methods - - def self.included(base) - base.class_eval do - before_destroy :delete_system_folder, prepend: true - end - end - - def attributes_editable? - true - end - - def save_dmsf_attachments(dmsf_attachments) - @saved_dmsf_attachments = [] - return unless dmsf_attachments - - dmsf_attachments.each_value do |dmsf_attachment| - a = Attachment.find_by_token(dmsf_attachment[:token]) - @saved_dmsf_attachments << a if a - end - end - - def saved_dmsf_attachments - @saved_dmsf_attachments || [] - end - - def save_dmsf_links(dmsf_links) - @saved_dmsf_links = [] - return unless dmsf_links - - dmsf_links.each_value do |id| - l = DmsfLink.find_by(id: id) - @saved_dmsf_links << l if l - end - end - - def saved_dmsf_links - @saved_dmsf_links || [] - end - - def save_dmsf_attachments_wfs(dmsf_attachments_wfs, dmsf_attachments) - return unless dmsf_attachments_wfs - - @dmsf_attachments_wfs = {} - dmsf_attachments_wfs.each do |attachment_id, approval_workflow_id| - attachment = dmsf_attachments[attachment_id] - next unless attachment - - a = Attachment.find_by_token(attachment[:token]) - wf = DmsfWorkflow.find_by(id: approval_workflow_id) - @dmsf_attachments_wfs[a.id] = wf if wf && a - end - end - - def saved_dmsf_attachments_wfs - @dmsf_attachments_wfs || [] - end - - def save_dmsf_links_wfs(dmsf_links_wfs) - return unless dmsf_links_wfs - - @saved_dmsf_links_wfs = {} - dmsf_links_wfs.each do |dmsf_link_id, approval_workflow_id| - wf = DmsfWorkflow.find_by(id: approval_workflow_id) - @saved_dmsf_links_wfs[dmsf_link_id.to_i] = wf if wf - end - end - - def saved_dmsf_links_wfs - @saved_dmsf_links_wfs || {} - end - - def system_folder(create: false) - parent = DmsfFolder.issystem.find_by(project_id: project_id, title: '.CRM cases') - if create && !parent - parent = DmsfFolder.new - parent.project_id = project_id - parent.title = '.CRM cases' - parent.description = 'Documents assigned to CRM cases' - parent.user_id = User.anonymous.id - parent.system = true - parent.save - end - if parent - folder = DmsfFolder.issystem.where( - ['project_id = ? AND dmsf_folder_id = ? AND title LIKE ?', project_id, parent.id, "#{id} - %"] - ).first - if create && !folder - folder = DmsfFolder.new - folder.dmsf_folder_id = parent.id - folder.project_id = project_id - folder.title = "#{id} - #{name}" - folder.user_id = User.anonymous.id - folder.system = true - folder.save - end - end - folder - end - - def dmsf_files - system_folder&.dmsf_files || [] - end - - def dmsf_links - system_folder&.dmsf_links || [] - end - - def delete_system_folder - system_folder&.destroy - end - - def dmsf_file_added(dmsf_file) - journalize_dmsf_file dmsf_file, :added - end - - def dmsf_file_removed(dmsf_file) - journalize_dmsf_file dmsf_file, :removed - end - - # Adds a journal detail for an attachment that was added or removed - def journalize_dmsf_file(dmsf_file, added_or_removed) - key = added_or_removed == :removed ? :old_value : :value - init_journal User.current - current_journal.details << JournalDetail.new( - property: 'dmsf_file', - prop_key: dmsf_file.id, - key => dmsf_file.title - ) - current_journal.save - end - end - end -end - -# Apply the patch -if defined?(EasyPatchManager) - EasyPatchManager.register_model_patch 'EasyCrmCase', 'RedmineDmsf::Patches::EasyCrmCasePatch', - if: -> { EasyPluginLoader.plugin_active? 'easy_crm_2_0' } -end diff --git a/patches/easy_crm_cases_controller_patch.rb b/patches/easy_crm_cases_controller_patch.rb deleted file mode 100644 index 53782d03..00000000 --- a/patches/easy_crm_cases_controller_patch.rb +++ /dev/null @@ -1,134 +0,0 @@ -# frozen_string_literal: true - -# Redmine plugin for Document Management System "Features" -# -# Karel Pičman -# -# This file is part of Redmine DMSF plugin. -# -# Redmine DMSF plugin 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 3 of the License, or (at your option) any -# later version. -# -# Redmine DMSF plugin 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 Redmine DMSF plugin. If not, see -# . - -module RedmineDmsf - module Patches - # Easy CRM cases controller - module EasyCrmCasesControllerPatch - ################################################################################################################## - # Overridden methods - - def easy_crm_after_save - super - easy_crm_cases = @easy_crm_cases - easy_crm_cases ||= [@easy_crm_case] - easy_crm_cases.each do |easy_crm_case| - # Attach DMS documents - uploaded_files = params[:dmsf_attachments] - details = params[:committed_files] - if uploaded_files - system_folder = easy_crm_case.system_folder(create: true) - uploaded_files.each do |key, uploaded_file| - upload = DmsfUpload.create_from_uploaded_attachment(easy_crm_case.project, system_folder, uploaded_file) - next unless upload - - uploaded_file[:disk_filename] = upload.disk_filename - uploaded_file[:name] = upload.name - uploaded_file[:title] = upload.title - if details - uploaded_file[:description] = details[key][:description] - uploaded_file[:comment] = details[key][:comment] - uploaded_file[:version_major] = details[key][:version_major] - uploaded_file[:version_minor] = details[key][:version_minor] - uploaded_file[:version_patch] = details[key][:version_patch] - else - uploaded_file[:version_major] = 0 - uploaded_file[:version_minor] = 1 - end - uploaded_file[:size] = upload.size - uploaded_file[:mime_type] = upload.mime_type - uploaded_file[:tempfile_path] = upload.tempfile_path - uploaded_file[:digest] = upload.digest - if params[:dmsf_attachments_wfs].present? && params[:dmsf_attachments_wfs][key].present? - uploaded_file[:workflow_id] = params[:dmsf_attachments_wfs][key].to_i - end - uploaded_file[:custom_field_values] = details[key][:custom_field_values] if details - end - DmsfUploadHelper.commit_files_internal uploaded_files, easy_crm_case.project, system_folder, self, - easy_crm_case, new_object: false - end - # Attach DMS links - easy_crm_case.saved_dmsf_links.each do |l| - file = l.target_file - revision = file.last_revision - system_folder = easy_crm_case.system_folder(create: true) - next unless system_folder - - l.project_id = system_folder.project_id - l.dmsf_folder_id = system_folder.id - easy_crm_case.dmsf_file_added(file) if l.save - wf = easy_crm_case.saved_dmsf_links_wfs[l.id] - next unless wf - - # Assign the workflow - revision.set_workflow wf.id, 'assign' - revision.assign_workflow wf.id - # Start the workflow - revision.set_workflow wf.id, 'start' - if revision.save - wf.notify_users easy_crm_case.project, revision, self - begin - file.lock! - rescue DmsfLockError => e - Rails.logger.warn e.message - end - else - Rails.logger.error l(:error_workflow_assign) - end - end - copied_from = EasyCrmCase.find_by(id: params[:copy_from]) if params[:copy_from].present? - # Save documents - next unless copied_from - - copied_from.dmsf_files.each do |dmsf_file| - dmsf_file.copy_to easy_crm_case.project, easy_crm_cases.system_folder(create: true) - end - end - end - - ################################################################################################################## - # New methods - - def self.prepended(base) - base.class_eval do - before_action :controller_easy_crm_cases_before_save, only: %i[create update bulk_update] - end - end - - def controller_easy_crm_cases_before_save - easy_crm_cases = @easy_crm_cases - easy_crm_cases ||= [@easy_crm_case] - easy_crm_cases.each do |easy_crm_case| - easy_crm_case.save_dmsf_attachments(params[:dmsf_attachments]) - easy_crm_case.save_dmsf_links(params[:dmsf_links]) - easy_crm_case.save_dmsf_attachments_wfs(params[:dmsf_attachments_wfs], params[:dmsf_attachments]) - easy_crm_case.save_dmsf_links_wfs(params[:dmsf_links_wfs]) - end - end - end - end -end - -# Apply the patch -if defined?(EasyPatchManager) - EasyPatchManager.register_controller_patch 'EasyCrmCasesController', - 'RedmineDmsf::Patches::EasyCrmCasesControllerPatch', - prepend: true, - if: -> { Redmine::Plugin.installed? 'easy_crm_2_0' } -end