Removal of unnnecessary files

This commit is contained in:
1redmine 2025-07-01 12:56:00 +02:00
parent 3efaf826f3
commit 8c5dec6c19
39 changed files with 2 additions and 1004 deletions

View File

@ -20,9 +20,9 @@
name: "GitHub CI"
on:
push:
branches: ["devel"]
branches: ["cleanup"]
pull_request:
branches: ["devel"]
branches: ["cleanup"]
jobs:
plugin_tests:
strategy:

View File

@ -1,37 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
# 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

View File

@ -1,37 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
# 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

View File

@ -1,37 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
# 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

View File

@ -1,22 +0,0 @@
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
%>
<% 'Nothing to show' %>

View File

@ -1,22 +0,0 @@
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
%>
<%= render partial: 'my/blocks/locked_documents' %>

View File

@ -1,22 +0,0 @@
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
%>
<% 'Nothing to show' %>

View File

@ -1,22 +0,0 @@
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
%>
<%= render partial: 'my/blocks/open_approvals' %>

View File

@ -1,22 +0,0 @@
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
%>
<% 'Nothing to show' %>

View File

@ -1,22 +0,0 @@
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
%>
<%= render partial: 'my/blocks/watched_documents' %>

View File

@ -1,23 +0,0 @@
<%
# encoding: utf-8
#
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
%>
<%= stylesheet_link_tag('easy_dmsf') %>
<%= javascript_include_tag('easy_dmsf', defer: true) %>

View File

@ -1,24 +0,0 @@
/*
Redmine plugin for Document Management System "Features"
Karel Pičman <karel.picman@kontron.com>
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
<https://www.gnu.org/licenses/>.
*/
/*
*= require select2.min
*= require redmine_dmsf
*= require attachments_dmsf
*/

View File

@ -1,23 +0,0 @@
/*
Redmine plugin for Document Management System "Features"
Karel Pičman <karel.picman@kontron.com>
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
<https://www.gnu.org/licenses/>.
*/
/*
*= require redmine_dmsf
*= require select2.min
*/

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -1,25 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Vít Jonáš <vit.jonas@gmail.com>, Daniel Munn <dan.munn@munnster.co.uk>, Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
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

View File

@ -1,178 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Vít Jonáš <vit.jonas@gmail.com>, Daniel Munn <dan.munn@munnster.co.uk>, Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
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

View File

@ -1,24 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Vít Jonáš <vit.jonas@gmail.com>, Daniel Munn <dan.munn@munnster.co.uk>, Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
require 'redmine_dmsf/webdav/custom_middleware'
Rails.application.configure do
config.middleware.insert_before ActionDispatch::Cookies, RedmineDmsf::Webdav::CustomMiddleware
end

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -1,25 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
unless defined?(EasyExtensions)
# Foo class
class EasyPageModule
def foo; end
end
end

View File

@ -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)

View File

@ -1,164 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
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

View File

@ -1,134 +0,0 @@
# frozen_string_literal: true
# Redmine plugin for Document Management System "Features"
#
# Karel Pičman <karel.picman@kontron.com>
#
# 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
# <https://www.gnu.org/licenses/>.
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