2021-04-18 13:34:55 +02:00
# frozen_string_literal: true
2021-11-23 20:30:24 +01:00
require 'additionals/plugin_version'
2021-12-07 19:03:09 +01:00
2021-12-07 18:51:09 +01:00
loader = RedminePluginKit :: Loader . new plugin_id : 'additionals'
2021-11-23 20:30:24 +01:00
2017-06-07 19:23:20 +02:00
Redmine :: Plugin . register :additionals do
name 'Additionals'
2013-11-11 11:57:30 +01:00
author 'AlphaNodes GmbH'
2022-03-11 16:43:14 +01:00
description 'Customizing Redmine, providing dashboards, wiki macros and other functions for better usability.' \
' As well as acting as a library/function provider for other Redmine plugins'
2021-11-23 19:16:49 +01:00
version Additionals :: PluginVersion :: VERSION
2015-01-11 16:48:15 +01:00
author_url 'https://alphanodes.com/'
2017-06-07 19:23:20 +02:00
url 'https://github.com/alphanodes/additionals'
2024-04-08 18:12:16 +02:00
directory File . dirname ( __FILE__ )
2013-11-11 11:57:30 +01:00
2022-04-21 12:11:19 +02:00
settings default : loader . default_settings ,
partial : 'additionals/settings/additionals'
2016-12-02 12:45:12 +01:00
permission :show_hidden_roles_in_memberbox , { }
2020-07-27 10:49:23 +02:00
permission :set_system_dashboards ,
{ } ,
require : :loggedin ,
read : true
2020-08-07 18:10:18 +02:00
permission :share_dashboards ,
2020-07-27 10:49:23 +02:00
{ dashboards : % i [ index new create edit update destroy ] } ,
require : :member ,
read : true
permission :save_dashboards ,
{ dashboards : % i [ index new create edit update destroy ] } ,
require : :loggedin ,
read : true
2016-12-02 12:45:12 +01:00
project_module :issue_tracking do
permission :edit_closed_issues , { }
2017-07-26 11:01:51 +02:00
permission :edit_issue_author , { }
permission :change_new_issue_author , { }
2018-10-17 11:59:11 +02:00
permission :issue_timelog_never_required , { }
2016-12-02 12:45:12 +01:00
end
2013-11-11 11:57:30 +01:00
2016-12-05 15:47:53 +01:00
project_module :time_tracking do
permission :log_time_on_closed_issues , { }
end
2013-11-11 11:57:30 +01:00
# required redmine version
2022-03-30 18:05:59 +02:00
requires_redmine version_or_higher : '5.0'
2013-11-11 11:57:30 +01:00
2017-06-07 19:23:20 +02:00
menu :admin_menu , :additionals , { controller : 'settings' , action : 'plugin' , id : 'additionals' } , caption : :label_additionals
2013-11-11 11:57:30 +01:00
end
2018-02-12 14:53:05 +01:00
2021-12-07 18:51:09 +01:00
RedminePluginKit :: Loader . persisting do
2021-11-27 08:01:01 +01:00
Redmine :: AccessControl . include Additionals :: Patches :: AccessControlPatch
Redmine :: AccessControl . singleton_class . prepend Additionals :: Patches :: AccessControlClassPatch
2021-12-02 08:18:43 +01:00
# Hooks
2021-12-07 18:51:09 +01:00
loader . load_model_hooks!
2021-11-27 08:01:01 +01:00
end
2021-12-07 18:51:09 +01:00
RedminePluginKit :: Loader . after_initialize do
2023-01-24 15:31:39 +01:00
unless defined? FONTAWESOME_ICONS
# @TODO: this should be moved to AdditionalsFontAwesome and use an instance of it
FONTAWESOME_ICONS = { fab : AdditionalsFontAwesome . load_icons ( :fab ) ,
far : AdditionalsFontAwesome . load_icons ( :far ) ,
fas : AdditionalsFontAwesome . load_icons ( :fas ) } . freeze
end
2020-04-15 14:57:09 +02:00
end