From b687119d1dd3393b4e8f7679d4ee4db7245eec7d Mon Sep 17 00:00:00 2001 From: "karel.picman@lbcfree.net" Date: Mon, 17 May 2021 15:47:41 +0200 Subject: [PATCH] h in model --- Gemfile | 3 ++- after_init.rb | 2 +- app/models/dmsf_workflow.rb | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index 227db57c..2a25bc14 100644 --- a/Gemfile +++ b/Gemfile @@ -22,7 +22,6 @@ source 'https://rubygems.org' do gem 'zip-zip' - gem 'simple_enum' gem 'uuidtools' gem 'dalli' gem 'active_record_union' @@ -30,6 +29,8 @@ source 'https://rubygems.org' do # Redmine extensions unless %w(easyproject easy_gantt).any? { |plugin| Dir.exist?(File.expand_path("../../#{plugin}", __FILE__)) } gem 'redmine_extensions', '~> 0.3.9' + gem 'simple_enum' + group :test do gem 'rails-controller-testing' diff --git a/after_init.rb b/after_init.rb index 9b179507..36665353 100644 --- a/after_init.rb +++ b/after_init.rb @@ -40,7 +40,7 @@ def dmsf_init # Main menu extension Redmine::MenuManager.map :top_menu do |menu| menu.push :dmsf, { controller: 'dmsf', action: 'index' }, caption: :menu_dmsf, - html: { class: 'icon-dmsf' }, + html: { class: 'icon-dmsf', category: :rest_extension_modules}, if: Proc.new { User.current.allowed_to?(:view_dmsf_folders, nil, global: true) } end diff --git a/app/models/dmsf_workflow.rb b/app/models/dmsf_workflow.rb index fa2a03a0..e1b833fe 100644 --- a/app/models/dmsf_workflow.rb +++ b/app/models/dmsf_workflow.rb @@ -221,11 +221,12 @@ class DmsfWorkflow < ActiveRecord::Base :text_email_to_proceed, nil, assignments.first&.dmsf_workflow_step) - if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] && controller unless recipients.blank? - to = recipients.collect{ |r| h(r.name) }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') + to = recipients.collect{ |r| controller.__send__(:h, r.name) }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join( + ', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') - controller.flash[:warning] = l(:warning_email_notifications, to: to) if controller + controller.flash[:warning] = l(:warning_email_notifications, to: to) end end end