From a80f9b8927c7b71d02ee9728f95392612f99d8b0 Mon Sep 17 00:00:00 2001 From: Hunt Redmine Date: Thu, 5 Dec 2024 18:38:17 +0800 Subject: [PATCH 1/3] Emails are not sent to the author if no_self_notified --- app/models/dmsf_mailer.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/app/models/dmsf_mailer.rb b/app/models/dmsf_mailer.rb index 1abf8883..83cb4d41 100644 --- a/app/models/dmsf_mailer.rb +++ b/app/models/dmsf_mailer.rb @@ -158,9 +158,19 @@ class DmsfMailer < Mailer @notice = notice @author = revision.dmsf_workflow_assigned_by_user @author ||= User.anonymous - mail to: user, - subject: - "[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)} #{step_name}" + skip_no_self_notified = false + begin + # We need to switch off no_self_notified temporarily otherwise the email won't be sent + if (@author == user) && @author.pref.no_self_notified + @author.pref.no_self_notified = false + skip_no_self_notified = true + end + mail to: user, + subject: + "[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)} #{step_name}" + ensure + @author.pref.no_self_notified = true if skip_no_self_notified + end end # force_notification = true => approval workflow's notifications From 0ca3304a32dd58166c3026a122968d741317e3ec Mon Sep 17 00:00:00 2001 From: Hunt Redmine Date: Fri, 6 Dec 2024 15:12:04 +0800 Subject: [PATCH 2/3] Align the keys of a hash literal if they span more than one line. --- app/models/dmsf_mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/dmsf_mailer.rb b/app/models/dmsf_mailer.rb index 83cb4d41..252559f4 100644 --- a/app/models/dmsf_mailer.rb +++ b/app/models/dmsf_mailer.rb @@ -166,7 +166,7 @@ class DmsfMailer < Mailer skip_no_self_notified = true end mail to: user, - subject: + subject: "[#{@project.name} - #{l(:field_label_dmsf_workflow)}] #{@workflow.name} #{l(subject_id)} #{step_name}" ensure @author.pref.no_self_notified = true if skip_no_self_notified From 5d67fd0e250c6071be4032f745b63146bc396f66 Mon Sep 17 00:00:00 2001 From: laaber Date: Tue, 10 Dec 2024 19:30:31 +0000 Subject: [PATCH 3/3] Update de.yml Change translation of "label_dmsf_permissions: Allow access only to". The german translation was missing the fact that you can lock out the roles you didn't set the checkbox ("only"). --- config/locales/de.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/de.yml b/config/locales/de.yml index 747e5759..38fbd0b9 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -387,7 +387,7 @@ de: text_dmsf_fast_links_info: Ermöglicht durch Eingabe der Ordner-ID auf einfache Art und Weise eine Verknüpfung auf den Zielordner zu erstellen. - label_dmsf_permissions: Zugriff erlaubt für + label_dmsf_permissions: Zugriff ausschließlich erlaubt für label_inherited_permissions: Zugriff vererbt für button_edit_content: Dokument bearbeiten