Restore proper activity functionality for meeting contents.

pull/6827/head
Felix Schäfer 14 years ago committed by Tim Felgentreff
parent e793fb6919
commit 018ee71b8f
  1. 12
      app/models/meeting_agenda.rb
  2. 12
      app/models/meeting_minutes.rb
  3. 4
      init.rb

@ -1,7 +1,15 @@
class MeetingAgenda < MeetingContent
unloadable
acts_as_journalized :activity_type => 'meetings'
acts_as_journalized :activity_type => 'meetings',
:activity_permission => :view_meetings,
:activity_find_options => {:include => {:meeting => :project}},
:event_title => Proc.new {|o| "#{l :label_meeting_agenda}: #{o.meeting.title}"},
:event_url => Proc.new {|o| {:controller => 'meetings', :action => 'show', :id => o.meeting}}
def activity_type
'meetings'
end
# TODO: internationalize the comments
def lock!(user = User.current)
@ -17,6 +25,8 @@ class MeetingAgenda < MeetingContent
end
MeetingAgendaJournal.class_eval do
unloadable
attr_protected :data
after_save :compress_version_text

@ -1,7 +1,15 @@
class MeetingMinutes < MeetingContent
unloadable
acts_as_journalized :activity_type => 'meetings'
acts_as_journalized :activity_type => 'meetings',
:activity_permission => :view_meetings,
:activity_find_options => {:include => {:meeting => :project}},
:event_title => Proc.new {|o| "#{l :label_meeting_agenda}: #{o.meeting.title}"},
:event_url => Proc.new {|o| {:controller => 'meetings', :action => 'show', :id => o.meeting}}
def activity_type
'meetings'
end
def editable?
meeting.agenda.present? && meeting.agenda.locked?
@ -17,6 +25,8 @@ class MeetingMinutes < MeetingContent
end
MeetingMinutesJournal.class_eval do
unloadable
attr_protected :data
after_save :compress_version_text

@ -33,6 +33,8 @@ Redmine::Plugin.register :redmine_meeting do
Redmine::Search.map do |search|
search.register :meetings
end
activity_provider :meetings, :default => false, :class_name => ['MeetingAgenda', 'MeetingMinutes']
menu :project_menu, :meetings, {:controller => 'meetings', :action => 'index'}, :caption => :project_module_meetings, :param => :project_id, :after => :wiki
end

Loading…
Cancel
Save