Email notification subject in Redmine format
This commit is contained in:
parent
2dad76503f
commit
c55fbe8dfa
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Redmine plugin for Document Management System "Features"
|
# Redmine plugin for Document Management System "Features"
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-15 Karel Pičman <karel.picman@kontron.com>
|
# Copyright (C) 2011-16 Karel Pičman <karel.picman@kontron.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -223,6 +223,7 @@ class DmsfWorkflowsController < ApplicationController
|
|||||||
@dmsf_workflow = DmsfWorkflow.new
|
@dmsf_workflow = DmsfWorkflow.new
|
||||||
@dmsf_workflow.name = params[:dmsf_workflow][:name]
|
@dmsf_workflow.name = params[:dmsf_workflow][:name]
|
||||||
@dmsf_workflow.project_id = @project.id if @project
|
@dmsf_workflow.project_id = @project.id if @project
|
||||||
|
@dmsf_workflow.author = User.current
|
||||||
@dmsf_workflow.save
|
@dmsf_workflow.save
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -29,7 +29,8 @@ class DmsfMailer < Mailer
|
|||||||
files = files.select { |file| file.notify? }
|
files = files.select { |file| file.notify? }
|
||||||
redmine_headers 'Project' => project.identifier if project
|
redmine_headers 'Project' => project.identifier if project
|
||||||
@files = files
|
@files = files
|
||||||
@project = project
|
@project = project
|
||||||
|
message_id project
|
||||||
set_language_if_valid user.language
|
set_language_if_valid user.language
|
||||||
mail :to => user.mail,
|
mail :to => user.mail,
|
||||||
:subject => "[#{@project.name} - #{l(:menu_dmsf)}] #{l(:text_email_doc_updated_subject)}"
|
:subject => "[#{@project.name} - #{l(:menu_dmsf)}] #{l(:text_email_doc_updated_subject)}"
|
||||||
@ -41,7 +42,8 @@ class DmsfMailer < Mailer
|
|||||||
files = files.select { |file| file.notify? }
|
files = files.select { |file| file.notify? }
|
||||||
redmine_headers 'Project' => project.identifier if project
|
redmine_headers 'Project' => project.identifier if project
|
||||||
@files = files
|
@files = files
|
||||||
@project = project
|
@project = project
|
||||||
|
message_id project
|
||||||
set_language_if_valid user.language
|
set_language_if_valid user.language
|
||||||
mail :to => user.mail,
|
mail :to => user.mail,
|
||||||
:subject => "[#{@project.name} - #{l(:menu_dmsf)}] #{l(:text_email_doc_deleted_subject)}"
|
:subject => "[#{@project.name} - #{l(:menu_dmsf)}] #{l(:text_email_doc_deleted_subject)}"
|
||||||
@ -70,6 +72,7 @@ class DmsfMailer < Mailer
|
|||||||
end
|
end
|
||||||
set_language_if_valid user.language
|
set_language_if_valid user.language
|
||||||
@user = user
|
@user = user
|
||||||
|
message_id workflow
|
||||||
@workflow = workflow
|
@workflow = workflow
|
||||||
@revision = revision
|
@revision = revision
|
||||||
@text1 = l(text1_id, :name => workflow.name, :filename => revision.file.name, :notice => notice)
|
@text1 = l(text1_id, :name => workflow.name, :filename => revision.file.name, :notice => notice)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Redmine plugin for Document Management System "Features"
|
# Redmine plugin for Document Management System "Features"
|
||||||
#
|
#
|
||||||
# Copyright (C) 2011-15 Karel Picman <karel.picman@kontron.com>
|
# Copyright (C) 2011-16 Karel Pičman <karel.picman@kontron.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -20,7 +20,8 @@
|
|||||||
|
|
||||||
class DmsfWorkflow < ActiveRecord::Base
|
class DmsfWorkflow < ActiveRecord::Base
|
||||||
|
|
||||||
has_many :dmsf_workflow_steps, -> { order 'step ASC, operator DESC' }, :dependent => :destroy
|
has_many :dmsf_workflow_steps, -> { order 'step ASC, operator DESC' }, :dependent => :destroy
|
||||||
|
belongs_to :author, :class_name => 'User'
|
||||||
|
|
||||||
scope :sorted, lambda { order('name ASC') }
|
scope :sorted, lambda { order('name ASC') }
|
||||||
scope :global, lambda { where('project_id IS NULL') }
|
scope :global, lambda { where('project_id IS NULL') }
|
||||||
@ -245,6 +246,7 @@ class DmsfWorkflow < ActiveRecord::Base
|
|||||||
new_wf = self.dup
|
new_wf = self.dup
|
||||||
new_wf.name = name if name
|
new_wf.name = name if name
|
||||||
new_wf.project_id = project ? project.id : nil
|
new_wf.project_id = project ? project.id : nil
|
||||||
|
new_wf.author = User.current
|
||||||
if new_wf.save
|
if new_wf.save
|
||||||
self.dmsf_workflow_steps.each do |step|
|
self.dmsf_workflow_steps.each do |step|
|
||||||
step.copy_to(new_wf)
|
step.copy_to(new_wf)
|
||||||
|
|||||||
34
db/migrate/20160222140401_approval_workflow_std_fields.rb
Normal file
34
db/migrate/20160222140401_approval_workflow_std_fields.rb
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# encoding: utf-8
|
||||||
|
#
|
||||||
|
# Redmine plugin for Document Management System "Features"
|
||||||
|
#
|
||||||
|
# Copyright (C) 2011-16 Karel Pičman <karel.picman@kontron.com>
|
||||||
|
#
|
||||||
|
# This program 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 2
|
||||||
|
# of the License, or (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program 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 this program; if not, write to the Free Software
|
||||||
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
class ApprovalWorkflowStdFields < ActiveRecord::Migration
|
||||||
|
def self.up
|
||||||
|
add_column :dmsf_workflows, :updated_on, :timestamp
|
||||||
|
add_column :dmsf_workflows, :created_on, :datetime
|
||||||
|
add_column :dmsf_workflows, :author_id, :integer
|
||||||
|
DmsfWorkflow.update_all 'updated_on = now(), created_on = now(), author_id = (select id from users where admin = 1 limit 1)'
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.down
|
||||||
|
remove_column :dmsf_workflows, :updated_on
|
||||||
|
remove_column :dmsf_workflows, :created_on
|
||||||
|
remove_column :dmsf_workflows, :author_id
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user