Redmine 4.1 compatibility

This commit is contained in:
Karel Pičman 2020-01-03 08:12:01 +01:00
parent 45a99f0d1c
commit 17f145af56
30 changed files with 37 additions and 10 deletions

View File

@ -26,5 +26,5 @@ gem 'activemodel-serializers-xml'
# Redmine extensions
unless %w(easyproject easy_gantt).any? { |plugin| Dir.exist?(File.expand_path("../../#{plugin}", __FILE__)) }
gem 'redmine_extensions', '~> 0.2.5'
gem 'redmine_extensions', '~> 0.3.9'
end

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#
@ -50,14 +51,14 @@ class CustomWorkflowsController < ApplicationController
end
def index
@workflows = CustomWorkflow.includes(:projects).order(:position => :asc)
@workflows = CustomWorkflow.includes(:projects).order(position: :asc)
respond_to do |format|
format.html
end
end
def export
send_data @workflow.export_as_xml, :filename => @workflow.name + '.xml', :type => :xml
send_data @workflow.export_as_xml, filename: "#{@workflow.name}.xml", type: :xml
end
def show
@ -87,7 +88,7 @@ class CustomWorkflowsController < ApplicationController
else
flash[:errors] = @workflow.errors.full_messages.to_sentence
end
rescue Exception => e
rescue => e
Rails.logger.warn "Workflow import error: #{e.message}\n #{e.backtrace.join("\n ")}"
flash[:errors] = l(:error_failed_import)
end

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#
@ -50,7 +51,7 @@ class CustomWorkflow < ActiveRecord::Base
end
def self.log_message(str, object)
Rails.logger.info str + " for #{object.class} (\##{object.id}) \"#{object}\""
Rails.logger.info "#{str} for #{object.class} (\##{object.id}) \"#{object}\""
end
def self.run_shared_code(object)
@ -96,7 +97,7 @@ class CustomWorkflow < ActiveRecord::Base
Rails.logger.info "== User workflow error: #{e.message}"
object.errors.add :base, e.error
false
rescue Exception => e
rescue => e
Rails.logger.error "== Custom workflow exception: #{e.message}\n #{e.backtrace.join("\n ")}"
object.errors.add :base, :custom_workflow_error
false
@ -109,7 +110,7 @@ class CustomWorkflow < ActiveRecord::Base
def validate_syntax_for(object, event)
object.instance_eval(read_attribute(event)) if respond_to?(event) && read_attribute(event)
rescue WorkflowError => _
rescue Exception => e
rescue => e
errors.add event, :invalid_script, error: e
end

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#
@ -23,7 +24,7 @@ class WorkflowError < StandardError
attr_accessor :error
def initialize(message)
@error = message.dup
@error = message
super message
end
end

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -21,7 +21,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
export REDMINE_GIT_REPO=git://github.com/redmine/redmine.git
export REDMINE_GIT_TAG=4.0-stable
export REDMINE_GIT_TAG=4.1-stable
clone()
{

View File

@ -4,7 +4,7 @@ custom_workflows_001:
before_save: "Rails.logger.info '>>> before save'"
after_save: "Rails.logger.info '>>> after save'"
name: 'Issue CW test'
description: NULL
description: 'Testing workflow'
position: 1
is_for_all: 0
author: 'karel.picman@kontron.com'

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#

View File

@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true
#
# Redmine plugin for Custom Workflows
#