From 747c503331219f150d08bb7ad2f0de424bc83f3a Mon Sep 17 00:00:00 2001 From: Karel Picman Date: Fri, 1 Sep 2017 09:00:04 +0200 Subject: [PATCH] Access to plugin settings syntax changed --- app/controllers/dmsf_controller.rb | 2 +- app/controllers/dmsf_files_controller.rb | 4 ++-- app/controllers/dmsf_workflows_controller.rb | 8 ++++---- app/helpers/dmsf_upload_helper.rb | 4 ++-- app/models/dmsf_workflow.rb | 2 +- app/views/dmsf_files/_approval_workflow_button.html.erb | 4 +++- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/controllers/dmsf_controller.rb b/app/controllers/dmsf_controller.rb index bb0a2614..759dd54d 100644 --- a/app/controllers/dmsf_controller.rb +++ b/app/controllers/dmsf_controller.rb @@ -516,7 +516,7 @@ class DmsfController < ApplicationController recipients.each do |u| DmsfMailer.files_deleted(u, @project, deleted_files).deliver end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' unless recipients.empty? to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') diff --git a/app/controllers/dmsf_files_controller.rb b/app/controllers/dmsf_files_controller.rb index c115d6cf..4a41975b 100644 --- a/app/controllers/dmsf_files_controller.rb +++ b/app/controllers/dmsf_files_controller.rb @@ -170,7 +170,7 @@ class DmsfFilesController < ApplicationController recipients.each do |u| DmsfMailer.files_updated(u, @project, [@file]).deliver end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' unless recipients.empty? to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') @@ -203,7 +203,7 @@ class DmsfFilesController < ApplicationController recipients.each do |u| DmsfMailer.files_deleted(u, @project, [@file]).deliver end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' unless recipients.empty? to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') diff --git a/app/controllers/dmsf_workflows_controller.rb b/app/controllers/dmsf_workflows_controller.rb index 3f1ed6b1..22a9b59a 100644 --- a/app/controllers/dmsf_workflows_controller.rb +++ b/app/controllers/dmsf_workflows_controller.rb @@ -81,7 +81,7 @@ class DmsfWorkflowsController < ApplicationController :text_email_finished_approved, :text_email_to_see_history).deliver if user end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' unless recipients.blank? to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') @@ -104,7 +104,7 @@ class DmsfWorkflowsController < ApplicationController :text_email_to_see_history, action.note).deliver end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' unless recipients.blank? to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') @@ -125,7 +125,7 @@ class DmsfWorkflowsController < ApplicationController :text_email_finished_delegated, :text_email_to_proceed, action.note).deliver - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' flash[:warning] = l(:warning_email_notifications, :to => delegate.name) end end @@ -156,7 +156,7 @@ class DmsfWorkflowsController < ApplicationController :text_email_finished_step_short, :text_email_to_see_status).deliver end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' recipients = assignments.collect{ |a| a.user } recipients << to if to recipients.uniq! diff --git a/app/helpers/dmsf_upload_helper.rb b/app/helpers/dmsf_upload_helper.rb index 6a900c42..66cf99ca 100644 --- a/app/helpers/dmsf_upload_helper.rb +++ b/app/helpers/dmsf_upload_helper.rb @@ -40,7 +40,7 @@ module DmsfUploadHelper file.project_id = project.id file.name = name file.dmsf_folder = folder - file.notification = Setting.plugin_redmine_dmsf[:dmsf_default_notifications].present? + file.notification = Setting.plugin_redmine_dmsf['dmsf_default_notifications'].present? new_revision.minor_version = 0 new_revision.major_version = 0 else @@ -140,7 +140,7 @@ module DmsfUploadHelper recipients.each do |u| DmsfMailer.files_updated(u, project, files).deliver end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' unless recipients.empty? to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') diff --git a/app/models/dmsf_workflow.rb b/app/models/dmsf_workflow.rb index cf317467..c4358fd4 100644 --- a/app/models/dmsf_workflow.rb +++ b/app/models/dmsf_workflow.rb @@ -231,7 +231,7 @@ class DmsfWorkflow < ActiveRecord::Base :text_email_started, :text_email_to_proceed).deliver end - if Setting.plugin_redmine_dmsf[:dmsf_display_notified_recipients] == '1' + if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients'] == '1' unless recipients.blank? to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ') to << ((recipients.count > DMSF_MAX_NOTIFICATION_RECEIVERS_INFO) ? ',...' : '.') diff --git a/app/views/dmsf_files/_approval_workflow_button.html.erb b/app/views/dmsf_files/_approval_workflow_button.html.erb index 08536151..0bb73743 100644 --- a/app/views/dmsf_files/_approval_workflow_button.html.erb +++ b/app/views/dmsf_files/_approval_workflow_button.html.erb @@ -53,7 +53,9 @@ <% else %> <% end %> - <% when DmsfWorkflow::STATE_APPROVED, DmsfWorkflow::STATE_REJECTED %> + <% when DmsfWorkflow::STATE_APPROVED %> + + <% when DmsfWorkflow::STATE_REJECTED %> <% else %> <% if workflows_available %>