#Add workflow step name to mail notification #1196

This commit is contained in:
karel.picman@lbcfree.net 2020-12-28 09:30:27 +01:00
parent 99b24b8023
commit d4cb7de7ca
20 changed files with 52 additions and 43 deletions

View File

@ -122,7 +122,8 @@ class DmsfWorkflowsController < ApplicationController
:text_email_subject_delegated,
:text_email_finished_delegated,
:text_email_to_proceed,
action.note)
action.note,
action.dmsf_workflow_step_assignment.dmsf_workflow_step)
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
flash[:warning] = l(:warning_email_notifications, to: delegate.name)
end
@ -141,7 +142,9 @@ class DmsfWorkflowsController < ApplicationController
revision,
:text_email_subject_requires_approval,
:text_email_finished_step,
:text_email_to_proceed)
:text_email_to_proceed,
nil,
assignment.dmsf_workflow_step)
end
end
to = revision.dmsf_workflow_assigned_by_user

View File

@ -108,13 +108,14 @@ class DmsfMailer < Mailer
res
end
def self.deliver_workflow_notification(users, workflow, revision, subject_id, text1_id, text2_id, notice = nil)
def self.deliver_workflow_notification(users, workflow, revision, subject_id, text1_id, text2_id, notice = nil, step = nil)
users.each do |user|
workflow_notification(user, workflow, revision, subject_id.to_s, text1_id.to_s, text2_id.to_s, notice).deliver_now
workflow_notification(user, workflow, revision, subject_id.to_s, text1_id.to_s, text2_id.to_s, notice,
step&.name).deliver_now
end
end
def workflow_notification(user, workflow, revision, subject_id, text1_id, text2_id, notice = nil)
def workflow_notification(user, workflow, revision, subject_id, text1_id, text2_id, notice, stepname)
if user && workflow && revision
if revision.dmsf_file && revision.dmsf_file.project
@project = revision.dmsf_file.project
@ -125,13 +126,13 @@ class DmsfMailer < Mailer
message_id workflow
@workflow = workflow
@revision = revision
@text1 = l(text1_id, name: workflow.name, filename: revision.dmsf_file.name, notice: notice)
@text1 = l(text1_id, name: workflow.name, filename: revision.dmsf_file.name, notice: notice, stepname: stepname)
@text2 = l(text2_id)
@notice = notice
@author = revision.dmsf_workflow_assigned_by_user
@author = User.anonymous unless @author
@author ||= User.anonymous
mail to: user.mail,
subject: "[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)}"
subject: "[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)} #{stepname}"
end
end

View File

@ -218,7 +218,9 @@ class DmsfWorkflow < ActiveRecord::Base
revision,
:text_email_subject_started,
:text_email_started,
:text_email_to_proceed)
:text_email_to_proceed,
nil,
assignments.first&.dmsf_workflow_step)
if Setting.plugin_redmine_dmsf['dmsf_display_notified_recipients']
unless recipients.blank?
to = recipients.collect{ |r| r.name }.first(DMSF_MAX_NOTIFICATION_RECEIVERS_INFO).join(', ')

View File

@ -280,13 +280,13 @@ cs:
text_email_finished_rejected: "Schvalovací proces '%{name}' přiřazený k dokumentu '%{filename}' byl dokončen a
dokument byl zamítnut, protože '%{notice}'."
text_email_finished_delegated: "Schvalovací proces '%{name}' přiřazený k dokumentu '%{filename}' byl delegován,
protože '%{notice}' a od Vás se očekává schválení v aktuálním schvalovacím kroku."
protože '%{notice}' a od Vás se očekává schválení v aktuálním schvalovacím kroku '%{stepname}'."
text_email_finished_step: "Schvalovací proces '%{name}' přiřazený k dokumentu '%{filename}' právě ukončil jeden ze
schvalovacích kroků a od Vás se očekává schválení v dalším schvalovacím kroku."
text_email_finished_step_short: "Schvalovací proces '%{name}' přiřazený k dokumentu '%{filename}' právě ukončil jeden
ze schvalovacích kroků."
text_email_started: "Schvalovací proces '%{name}' přiřazený k dokumentu '%{filename}' byl zahájen a od Vás se očekává
schválení v aktuálním schvalovacím kroku."
schválení v aktuálním schvalovacím kroku '%{stepname}'."
text_email_to_proceed: Pro schválení klikněte na zaškrtávací ikonku vedle dokumentu v
text_email_to_see_history: Pro zobrazení historie schvalovacího procesu klikněte na status dokumentu v

View File

@ -281,13 +281,13 @@ de:
text_email_finished_rejected: "Der Genehmigungs-Workflow '%{name}' zugewiesen an die Datei '%{filename}' ist
abgeschlossen, aber die Datei wurde abgelehnt, weil: '%{notice}'."
text_email_finished_delegated: "Der Genehmigungs-Workflow '%{name}' zugewiesen an die Datei '%{filename}' wurde an
dich deligiert, weil: '%{notice}' und weil deine Zustimmung im aktuellen Genehmigungsschritt benötigt wird."
dich deligiert, weil: '%{notice}' und weil deine Zustimmung im aktuellen Genehmigungsschritt '%{stepname}' benötigt wird."
text_email_finished_step: "Der Genehmigungs-Workflow '%{name}' zugewiesen an die Datei '%{filename}' hat grade einen
Zustimmungsschritt abgeschlossen und im nächsten Genehmigungsschritt wird deine Zustimmung benötigt."
text_email_finished_step_short: "Der Genehmigungs-Workflow '%{name}' zugewiesen an die Datei '%{filename}' hat grade
einen Genehmigungsschritt abgeschlossen."
text_email_started: "Der Genehmigungs-Workflow '%{name}' zugewiesen an '%{filename}' wurde gestartet und im aktuellen
Genehmigungsschritt wird deine Zustimmung benötigt."
Genehmigungsschritt '%{stepname}' wird deine Zustimmung benötigt."
text_email_to_proceed: Um fortzufahren klicke auf das Häckchen neben der Datei in
text_email_to_see_history: Um den Verlauf des Genehmigungs-Workflows zu sehen klicke auf den Workflowstatus zur Datei
in

View File

@ -280,13 +280,13 @@ en:
text_email_finished_rejected: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
finished and the document has been rejected because of '%{notice}'."
text_email_finished_delegated: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
delegated because of '%{notice}' and you are expected to do an approval in the current approval step."
delegated because of '%{notice}' and you are expected to do an approval in the current approval step '%{stepname}'."
text_email_finished_step: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished one
of the approval steps and you are expected to do an approval in the next approval step."
text_email_finished_step_short: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished
one of the approval steps."
text_email_started: "The approval workflow '%{name}' assigned to '%{filename}' document has just been started and you
are expected to do an approval in the current approval step."
are expected to do an approval in the current approval step '%{stepname}'."
text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in

View File

@ -280,13 +280,13 @@ es:
text_email_finished_rejected: "El flujo de trabajo de aprobación '%{name}' asignado al documento '%{filename}' acaba
de ser terminado y él ha sido rechazado por el siguiente motivo '%{notice}'."
text_email_finished_delegated: "El flujo de trabajo de aprobación '%{name}' asignado al documento '%{filename}' acaba
de ser delegado por '%{notice}' y se espera que haga una aprobación en la etapa de aprobación actual."
de ser delegado por '%{notice}' y se espera que haga una aprobación en la etapa de aprobación actual '%{stepname}'."
text_email_finished_step: "El flujo de trabajo de aprobación '%{name}' asignado al documento '%{filename}' acaba de
terminar uno de los pasos de aprobación y se espera que haga una aprobación en el siguiente paso."
text_email_finished_step_short: "El flujo de trabajo de aprobación '%{name}' asignado al documento '%{filename}' acaba
de finalizar uno de los pasos de aprobación."
text_email_started: "El flujo de trabajo de aprobación '%{name}' asignado al documento '%{filename}' acaba de
iniciarse y se espera que haga una aprobación en la etapa de aprobación actual."
iniciarse y se espera que haga una aprobación en la etapa de aprobación actual '%{stepname}'."
text_email_to_proceed: "Para continuar, haga clic en el icono de la casilla de verificación al lado del documento"
text_email_to_see_history: "Para ver el historial de aprobación haga clic en el estado del flujo de trabajo del
documento"

View File

@ -280,13 +280,13 @@ fr:
text_email_finished_rejected: "Le flux de validation '%{name}' assigné au document '%{filename}' vient de se terminer
et le document a été rejeté pour la raison '%{notice}'."
text_email_finished_delegated: "Le flux de validation '%{name}' assigné au document '%{filename}' a été délégué pour
la raison '%{notice}' et vous êtes tenu d'approuver l'étape actuelle."
la raison '%{notice}' et vous êtes tenu d'approuver l'étape actuelle '%{stepname}'."
text_email_finished_step: "Le flux de validation '%{name}' assigné au document '%{filename}' a passé une des étapes
d'approbation et vous êtes tenu d'approuver l'étape suivante."
text_email_finished_step_short: "Le flux de validation '%{name}' assigné au document '%{filename}' a passé une des
étapes d'approbation."
text_email_started: "Le flux de validation '%{name}' assigné au document '%{filename}' vient de démarrer et vous êtes
tenu d'approuver l'étape actuelle."
tenu d'approuver l'étape actuelle '%{stepname}'."
text_email_to_proceed: "Pour ce faire, cliquez sur l'icône de validation à côté du document dans"
text_email_to_see_history: "Pour consulter l'historique de validation, cliquez sur le statut du flux du document dans"

View File

@ -281,13 +281,13 @@ hu:
hozzárendelésre, befejeződött és visszautasításra került a következő üzenettel: '%{notice}'."
text_email_finished_delegated: "A '%{name}' jóváhagyási workflow amely a '%{filename}' dokumentumhoz került
hozzárendelésre, Önhöz került az alábbi megjegyzés '%{notice}' miatt és a jelenlegi lépésben az Ön jóváhagyására
vár."
vár '%{stepname}'."
text_email_finished_step: "A '%{name}' jóváhagyási workflow-ban amely a '%{filename}' dokumentumhoz került
hozzárendelésre, egy lépés teljesült és a következő lépésben lépésben az Ön jóváhagyására vár."
text_email_finished_step_short: "A '%{name}' jóváhagyási workflow-ban amely a '%{filename}' dokumentumhoz került
hozzárendelésre, egy lépés teljesült a folyamatban."
text_email_started: "A '%{name}' jóváhagyási workflow amely a '%{filename}' dokumentumhoz került hozzárendelésre,
elindult és a jelenlegi lépésben az Ön jóváhagyására vár."
elindult és a jelenlegi lépésben az Ön jóváhagyására vár '%{stepname}'."
text_email_to_proceed: A folytatáshoz kattintson a négyzetre a dokumentum mellett
text_email_to_see_history: Ha meg akarja nézni a jóváhagyási előzményeket, akkor kattintson a dokumentumon belül a
workflow státuszra

View File

@ -280,13 +280,13 @@ it: # Italian strings thx 2 Matteo Arceci!
text_email_finished_rejected: "L'approvazione di flusso di lavoro '%{name}' assegnato a '%{filename}' è stata
completata ma il documento è stato rifiutato a causa di '%{notice}'."
text_email_finished_delegated: "L'approvazione di flusso di lavoro '%{name}' assegnato a '%{filename}' è stata
delegata a causa di '%{notice}' e sei tenuto ad approvare nel passo corrente."
delegata a causa di '%{notice}' e sei tenuto ad approvare nel passo corrente '%{stepname}'."
text_email_finished_step: "L'approvazione di flusso di lavoro '%{name}' assegnato a '%{filename}' ha completato uno
dei passi di approvazione e sei tenuto ad approvare il prossimo passo."
text_email_finished_step_short: "L'approvazione di flusso di lavoro '%{name}' assegnato a '%{filename}' ha completato
uno dei passi di approvazione."
text_email_started: "L'approvazione di flusso di lavoro '%{name}' assegnato a '%{filename}' è stato inizializzato e
sei tenuto ad approvare il passo corrente."
sei tenuto ad approvare il passo corrente '%{stepname}'."
text_email_to_proceed: Per proseguire clicca sull'icona checkbox a fianco del documento
text_email_to_see_history: Per vedere la storia di approvazione clicca sullo stato del flusso di lavoro del documento

View File

@ -280,13 +280,13 @@ ja:
text_email_finished_rejected: "承認ワークフロー '%{name}' において '%{filename}' が否認されました。理由:'%{notice}'。"
text_email_finished_delegated: "承認ワークフロー '%{name}' において代理承認が依頼されました。承認対象 '%{filename}'
の内容をご確認の上、承認・否認のご判断をお願い致します(依頼主コメント:'%{notice}')。"
の内容をご確認の上、承認・否認のご判断をお願い致します(依頼主コメント:'%{notice}')。'%{stepname}'"
text_email_finished_step: "承認ワークフロー '%{name}' からの承認依頼です。承認対象 '%{filename}'
の内容をご確認の上、承認・否認のご判断をお願い致します。"
text_email_finished_step_short: "承認ワークフロー '%{name}' において '%{filename}' の承認ステップが一つ終了しました。"
text_email_started: "承認ワークフロー '%{name}' からの承認依頼です。承認対象 '%{filename}'
の内容をご確認の上、承認・否認のご判断をお願い致します。"
の内容をご確認の上、承認・否認のご判断をお願い致します。'%{stepname}'"
text_email_to_proceed: 次のURLを開き内容を確認の上、右端のチェックマークをクリックし承認・否認の選択をしてください。
text_email_to_see_history: 次のURLで承認ワークフローの履歴を確認することができます。

View File

@ -279,13 +279,13 @@ ko:
text_email_finished_rejected: "'%{filename}' 문서에 지정된 승인 작업 흐름 '%{name}'이 방금 완료되었지만, '%{notice}'로 인해 문서가 반려되었습니다."
text_email_finished_delegated: "'%{filename}' 문서에 지정된 승인 작업 흐름 '%{name}'이 방금 완료되었지만, '%{notice}'로 인해 위임되었으며, 사용자는 현재 승인 과정에서 승인하셔야 합니다."
text_email_finished_delegated: "'%{filename}' 문서에 지정된 승인 작업 흐름 '%{name}'이 방금 완료되었지만, '%{notice}'로 인해 위임되었으며, 사용자는 현재 승인 과정에서 승인하셔야 합니다 '%{stepname}'."
text_email_finished_step: "'%{filename}' 문서에 지정된 승인 작업 흐름 '%{name}'이 방금 완료되었지만, 승인 단계 중 한 개가 승인되었으며 사용자께서 다음 승인 단계를 승인하셔야 합니다"
text_email_finished_step_short: "'%{filename}'문서에 지정된 승인 작업 흐름 '%{name}'이 방금 완료되었으며, 승인 단계 중 한 단계가 완료되었습니다."
text_email_started: "'%{filename}'문서에 지정된 승인 작업 흐름 '%{name}'이 방금 시작되었으며, 사용자께서는 현재 승인 단계에서 승인을 하셔야 합니다."
text_email_started: "'%{filename}'문서에 지정된 승인 작업 흐름 '%{name}'이 방금 시작되었으며, 사용자께서는 현재 승인 단계에서 승인을 하셔야 합니다 '%{stepname}'."
text_email_to_proceed: 다음으로 진행하기 위해 문서 옆에 있는 체크 상지 아이콘을 클릭하세요
text_email_to_see_history: 승인 내역을 확인하기 위해 작업 흐름 상태 문서를 클릭하세요

View File

@ -280,14 +280,14 @@ nl:
text_email_finished_rejected: "De goedkeuring workflow '%{name}' toegewezen aan '%{filename}' document is zojuist
afgerond en het document is afgewezen vanwege '%{notice}'."
text_email_finished_delegated: "De goedkeuring workflow '%{name}' toegewezen aan '%{filename}' document is zojuist
gedelegeerd omdat '%{notice}' en er wordt verwacht dat u een goedkeuring doet in de huidige goedkeuringsstap."
gedelegeerd omdat '%{notice}' en er wordt verwacht dat u een goedkeuring doet in de huidige goedkeuringsstap '%{stepname}'."
text_email_finished_step: "De goedkeuring workflow '%{name}' toegewezen aan '%{filename}' document heeft zojuist een
van de goedkeurende stappen afgerond en er wordt verwacht dat u een goedkeuring doet in de volgenden
goedkeuringsstap."
text_email_finished_step_short: "De goedkeuring workflow '%{name}' toegewezen aan '%{filename}' document heeft zojuist
een van de goedkeuringsstappen afgerond."
text_email_started: "De goedkeurende workflow '%{name}' toegewezen aan '%{filename}' document is zojuist gestart en er
wordt verwacht dat u een goedkeuring doet in de huidige goedkeuringsstap."
wordt verwacht dat u een goedkeuring doet in de huidige goedkeuringsstap '%{stepname}'."
text_email_to_proceed: Klik om door te gaan om het het vinkjes icoon naast het document in
text_email_to_see_history: Klik om de goedkeuringsgeschiedenis te bekijken op de workflow status van het document in
text_email_to_see_status: Klik om de huidige status van de goedkeuring workflow te bekijken op het workflow status

View File

@ -280,13 +280,13 @@ pl:
text_email_finished_rejected: "Proces akceptacji '%{name}' dokumentu '%{filename}' został właśnie zakończony. Dokument
został odrzucony z powodu '%{notice}'."
text_email_finished_delegated: "Proces akceptacji '%{name}' dokumentu '%{filename}' został właśnie delegowany z powodu
'%{notice}'. Zostałeś wskazany jako akceptujący w bieżącym kroku zatwierdzania."
'%{notice}'. Zostałeś wskazany jako akceptujący w bieżącym kroku zatwierdzania '%{stepname}'."
text_email_finished_step: "Zakończono krok w procesie akceptacji '%{name}' dokumentu '%{filename}'. Jesteś kolejną
osobą decyzyjną w procesie akceptacji."
text_email_finished_step_short: "Zakończono krok w procesie akceptacji '%{name}' dokumentu '%{filename}'."
text_email_started: "Proces akceptacji '%{name}' dokuentu '%{filename}' został uruchomiony. Jesteś osobą akceptującą w
bieżącym kroku zatwierdzania."
bieżącym kroku zatwierdzania '%{stepname}'."
text_email_to_proceed: Aby procedować zaznacz check box przy dokumencie
text_email_to_see_history: Aby zobaczyć historię akceptacji kliknij w proces akceptacji dokumentu

View File

@ -280,13 +280,13 @@ pt-BR:
text_email_finished_rejected: "O workflow de aprovação '%{name}' definido para o documento '%{filename}' foi
finalizado e o documento foi reprovado devido a '%{notice}'."
text_email_finished_delegated: "O workflow de aprovação '%{name}' definido para o documento '%{filename}' foi
atribuido pois '%{notice}' e está aguardando a sua aprovação na etapa atual."
atribuido pois '%{notice}' e está aguardando a sua aprovação na etapa atual '%{stepname}'."
text_email_finished_step: "O workflow de aprovação '%{name}' definido para o documento '%{filename}' foi aprovado na
etapa anterior e está aguardando a sua aprovação na etapa atual."
text_email_finished_step_short: "O workflow de aprovação '%{name}' definido para o documento '%{filename}' foi
aprovado em uma das suas etapas de aprovação."
text_email_started: "O workflow de aprovação '%{name}' definido para o documento '%{filename}' foi iniciado e está
aguardando a sua aprovação na etapa atual."
aguardando a sua aprovação na etapa atual '%{stepname}'."
text_email_to_proceed: Para dar continuidade ao fluxo, clique no íncone ao lado do documento
text_email_to_see_history: Para visualizar o histórico de workflow de aprovação clique no status do workflow
disponível ao lado do documento

View File

@ -280,13 +280,13 @@ ru:
text_email_finished_rejected: "Процесс согласования '%{name}' документа '%{filename}' только что завершился и документ
был отклонен по причине '%{notice}'."
text_email_finished_delegated: "Процесс согласования '%{name}' документа '%{filename}' только что был делегирован по
причине '%{notice}' и и ожидает Вашего рассмотрения."
причине '%{notice}' и и ожидает Вашего рассмотрения '%{stepname}'."
text_email_finished_step: "Процесс согласования '%{name}' документа '%{filename}' только что завершил один из шагов
согласования и ожидает Вашего рассмотрения."
text_email_finished_step_short: "Процесс согласования '%{name}' документа '%{filename}' только что завершил один из
шагов."
text_email_started: "Процесс согласования '%{name}' документа '%{filename}' только что начался и ожидает Вашего
рассмотрения."
рассмотрения '%{stepname}'."
text_email_to_proceed: Для продолжения поставьте отметку рядом с документом в
text_email_to_see_history: Для просмотра истории согласования нажмите статус согласования документа в

View File

@ -280,13 +280,13 @@ sl:
text_email_finished_rejected: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
finished and the document has been rejected because of '%{notice}'."
text_email_finished_delegated: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
delegated because of '%{notice}' and you are expected to do an approval in the current approval step."
delegated because of '%{notice}' and you are expected to do an approval in the current approval step '%{stepname}'."
text_email_finished_step: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished one of
the approval steps and you are expected to do an approval in the next approval step."
text_email_finished_step_short: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished
one of the approval steps."
text_email_started: "The approval workflow '%{name}' assigned to '%{filename}' document has just been started and you
are expected to do an approval in the current approval step."
are expected to do an approval in the current approval step '%{stepname}'."
text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in

View File

@ -279,13 +279,13 @@ zh-TW:
text_email_finished_rejected: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
finished and the document has been rejected because of '%{notice}'."
text_email_finished_delegated: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
delegated because of '%{notice}' and you are expected to do an approval in the current approval step."
delegated because of '%{notice}' and you are expected to do an approval in the current approval step '%{stepname}'."
text_email_finished_step: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished one of
the approval steps and you are expected to do an approval in the next approval step."
text_email_finished_step_short: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished
one of the approval steps."
text_email_started: "The approval workflow '%{name}' assigned to '%{filename}' document has just been started and you
are expected to do an approval in the current approval step."
are expected to do an approval in the current approval step '%{stepname}'."
text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in

View File

@ -280,13 +280,13 @@ zh:
text_email_finished_rejected: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
finished and the document has been rejected because of '%{notice}'."
text_email_finished_delegated: "The approval workflow '%{name}' assigned to '%{filename}' document has just been
delegated because of '%{notice}' and you are expected to do an approval in the current approval step."
delegated because of '%{notice}' and you are expected to do an approval in the current approval step '%{stepname}'."
text_email_finished_step: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished one of
the approval steps and you are expected to do an approval in the next approval step."
text_email_finished_step_short: "The approval workflow '%{name}' assigned to '%{filename}' document has just finished
one of the approval steps."
text_email_started: "The approval workflow '%{name}' assigned to '%{filename}' document has just been started and you
are expected to do an approval in the current approval step."
are expected to do an approval in the current approval step '%{stepname}'."
text_email_to_proceed: To proceed click on the check box icon next to the document in
text_email_to_see_history: To see the approval history click on the workflow status of the document in

View File

@ -59,7 +59,10 @@ class DmsfAlertApprovals
revision,
:text_email_subject_requires_approval,
:text_email_finished_step,
:text_email_to_proceed)
:text_email_to_proceed,
nil,
assignment.dmsf_workflow_step
)
end
end
end