Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

use current user for meeting content update

ulferts313749af8842
diff --git a/modules/meeting/app/controllers/meeting_contents_controller.rb b/modules/meeting/app/controllers/meeting_contents_controller.rb
index a64ce39a451..de9156d6a62 100644
--- a/modules/meeting/app/controllers/meeting_contents_controller.rb
+++ b/modules/meeting/app/controllers/meeting_contents_controller.rb
@@ -138,6 +138,6 @@ class MeetingContentsController < ApplicationController
end
def content_params
- params.require(@content_type).permit(:text, :lock_version, :comment)
+ params.require(@content_type).permit(:text, :lock_version, :journal_notes)
end
end
diff --git a/modules/meeting/app/controllers/meetings_controller.rb b/modules/meeting/app/controllers/meetings_controller.rb
index 0807efab224..17b26b6f2ba 100644
--- a/modules/meeting/app/controllers/meetings_controller.rb
+++ b/modules/meeting/app/controllers/meetings_controller.rb
@@ -68,7 +68,7 @@ class MeetingsController < ApplicationController
if params[:copied_from_meeting_id].present? && params[:copied_meeting_agenda_text].present?
@meeting.agenda = MeetingAgenda.new(
text: params[:copied_meeting_agenda_text],
- comment: "Copied from Meeting ##{params[:copied_from_meeting_id]}"
+ journal_notes: I18n.t('meeting.copied', id: params[:copied_from_meeting_id])
)
@meeting.agenda.author = User.current
end
diff --git a/modules/meeting/app/models/meeting.rb b/modules/meeting/app/models/meeting.rb
index 6c72592e24b..3c44476dd8f 100644
--- a/modules/meeting/app/models/meeting.rb
+++ b/modules/meeting/app/models/meeting.rb
@@ -180,7 +180,9 @@ class Meeting < ApplicationRecord
attachments = agenda.attachments.map { |a| [a, a.copy] }
original_text = String(agenda.text)
- minutes = create_minutes(text: original_text, comment: 'Minutes created', attachments: attachments.map(&:last))
+ minutes = create_minutes(text: original_text,
+ journal_notes: I18n.t('events.meeting_minutes_created'),
+ attachments: attachments.map(&:last))
# substitute attachment references in text to use the respective copied attachments
updated_text = original_text.gsub(/(?<=\(\/api\/v3\/attachments\/)\d+(?=\/content\))/) do |id|
diff --git a/modules/meeting/app/models/meeting_agenda.rb b/modules/meeting/app/models/meeting_agenda.rb
index 29d725ef2c8..6d3cc55fc4f 100644
--- a/modules/meeting/app/models/meeting_agenda.rb
+++ b/modules/meeting/app/models/meeting_agenda.rb
@@ -27,16 +27,15 @@
#++
class MeetingAgenda < MeetingContent
- # TODO: internationalize the comments
def lock!(user = User.current)
- self.comment = 'Agenda closed'
+ self.journal_notes = I18n.t('events.meeting_agenda_closed')
self.author = user
self.locked = true
save
end
def unlock!(user = User.current)
- self.comment = 'Agenda opened'
+ self.journal_notes = I18n.t('events.meeting_agenda_opened')
self.author = user
self.locked = false
save
diff --git a/modules/meeting/app/models/meeting_content.rb b/modules/meeting/app/models/meeting_content.rb
index 2e9b520c94d..223c259e7bc 100644
--- a/modules/meeting/app/models/meeting_content.rb
+++ b/modules/meeting/app/models/meeting_content.rb
@@ -31,13 +31,7 @@ class MeetingContent < ApplicationRecord
include OpenProject::Journal::AttachmentHelper
belongs_to :meeting
- belongs_to :author, class_name: 'User', foreign_key: 'author_id'
-
- attr_accessor :comment
-
- validates_length_of :comment, maximum: 255, allow_nil: true
-
- before_save :comment_to_journal_notes
+ belongs_to :author, class_name: 'User'
acts_as_attachable(
after_remove: :attachments_changed,
@@ -77,13 +71,5 @@ class MeetingContent < ApplicationRecord
end
# Show the project on activity and search views
- def project
- meeting.project
- end
-
- private
-
- def comment_to_journal_notes
- add_journal(author, comment) unless changes.empty?
- end
+ delegate :project, to: :meeting
end
diff --git a/modules/meeting/app/views/meeting_contents/_form.html.erb b/modules/meeting/app/views/meeting_contents/_form.html.erb
index 9d2d4ff638b..fe3fdef3eda 100644
--- a/modules/meeting/app/views/meeting_contents/_form.html.erb
+++ b/modules/meeting/app/views/meeting_contents/_form.html.erb
@@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details.
<%= f.hidden_field :lock_version %>
<% path = send("preview_#{content_type}_path", content.meeting) %>
- <p><%= f.text_field :comment, :size => 120 %></p>
+ <p><%= f.text_field :journal_notes, label: :comments %></p>
<p><%= styled_button_tag t(:button_save), class: '-highlight -with-icon icon-checkmark button--save-agenda' %>
<%= link_to t(:button_cancel), "#", data: { 'content-type': content_type }, class: 'button -with-icon icon-cancel button--cancel-agenda' %>
<% end %>
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index 223ed4e1481..496036e0c57 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -75,6 +75,9 @@ en:
label_time_zone: "Time zone"
label_start_date: "Start date"
+ meeting:
+ copied: "Copied from Meeting #%{id}"
+
notice_successful_notification: "Notification sent successfully"
notice_timezone_missing: No time zone is set and %{zone} is assumed. To choose your time zone, please click here.