openproject-meeting 3.0.2 → 3.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +9 -9
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +3 -3
  4. data/app/assets/stylesheets/meeting/meeting.css.erb +19 -10
  5. data/app/controllers/meeting_agendas_controller.rb +11 -3
  6. data/app/controllers/meeting_contents_controller.rb +21 -7
  7. data/app/controllers/meeting_minutes_controller.rb +11 -3
  8. data/app/controllers/meetings_controller.rb +11 -3
  9. data/app/helpers/meeting_contents_helper.rb +11 -3
  10. data/app/helpers/meetings_helper.rb +17 -3
  11. data/app/mailers/meeting_mailer.rb +11 -3
  12. data/app/models/journal/meeting_content_journal.rb +40 -0
  13. data/app/models/journal/meeting_journal.rb +38 -0
  14. data/app/models/meeting.rb +17 -6
  15. data/app/models/meeting_agenda.rb +11 -66
  16. data/app/models/meeting_content.rb +30 -4
  17. data/app/models/meeting_minutes.rb +11 -67
  18. data/app/models/meeting_participant.rb +11 -3
  19. data/app/views/hooks/meetings/_activity_index_head.html.erb +21 -0
  20. data/app/views/meeting_contents/_form.html.erb +11 -3
  21. data/app/views/meeting_contents/_show.html.erb +11 -3
  22. data/app/views/meeting_contents/diff.html.erb +13 -6
  23. data/app/views/meeting_contents/history.html.erb +11 -3
  24. data/app/views/meeting_contents/show.html.erb +11 -3
  25. data/app/views/meeting_mailer/content_for_review.html.erb +11 -3
  26. data/app/views/meeting_mailer/content_for_review.text.erb +20 -0
  27. data/app/views/meetings/_form.html.erb +11 -3
  28. data/app/views/meetings/edit.html.erb +11 -3
  29. data/app/views/meetings/index.html.erb +11 -3
  30. data/app/views/meetings/new.html.erb +11 -3
  31. data/app/views/meetings/show.html.erb +12 -4
  32. data/app/views/shared/_meeting_header.html.erb +11 -3
  33. data/config/locales/de.yml +22 -0
  34. data/config/locales/en.yml +22 -0
  35. data/config/routes.rb +11 -3
  36. data/db/migrate/20110106210555_create_meetings.rb +11 -3
  37. data/db/migrate/20110106221214_create_meeting_contents.rb +11 -3
  38. data/db/migrate/20110106221946_create_meeting_content_versions.rb +11 -3
  39. data/db/migrate/20110108230721_create_meeting_participants.rb +11 -3
  40. data/db/migrate/20110224180804_add_lock_to_meeting_content.rb +11 -3
  41. data/db/migrate/20110819162852_create_initial_meeting_journals.rb +11 -3
  42. data/db/migrate/20111605171815_merge_meeting_content_versions_with_journals.rb +11 -3
  43. data/db/migrate/20130731151542_remove_meeting_role_id_from_meeting_participants.rb +11 -3
  44. data/db/migrate/20130822113942_create_meeting_journals.rb +39 -0
  45. data/db/migrate/20130924091342_legacy_meeting_journal_data.rb +36 -0
  46. data/db/migrate/20130924093842_legacy_meeting_agenda_journal_data.rb +62 -0
  47. data/db/migrate/20130924114042_legacy_meeting_minutes_journal_data.rb +62 -0
  48. data/doc/{COPYRIGHT.rdoc → COPYRIGHT.md} +1 -1
  49. data/doc/COPYRIGHT_short.md +16 -0
  50. data/lib/open_project/meeting.rb +11 -3
  51. data/lib/open_project/meeting/engine.rb +12 -4
  52. data/lib/open_project/meeting/hooks.rb +12 -4
  53. data/lib/open_project/meeting/patches/project_patch.rb +11 -3
  54. data/lib/open_project/meeting/version.rb +12 -4
  55. data/lib/openproject-meeting.rb +11 -3
  56. data/spec/controllers/meetings_controller_spec.rb +11 -3
  57. data/spec/factories/meeting_agenda_factory.rb +11 -3
  58. data/spec/factories/meeting_content_journal_factory.rb +23 -0
  59. data/spec/factories/meeting_factory.rb +11 -3
  60. data/spec/factories/meeting_journal_factory.rb +31 -0
  61. data/spec/factories/meeting_minutes_factory.rb +11 -3
  62. data/spec/factories/meeting_participant_factory.rb +11 -3
  63. data/spec/mailers/meeting_mailer_spec.rb +11 -3
  64. data/spec/models/meeting_agenda_spec.rb +14 -6
  65. data/spec/models/meeting_content_journal_spec.rb +30 -0
  66. data/spec/models/meeting_minutes_spec.rb +11 -3
  67. data/spec/models/meeting_spec.rb +11 -3
  68. data/spec/models/user_deletion_spec.rb +16 -14
  69. data/spec/spec_helper.rb +11 -3
  70. data/spec/support/plugin_spec_helper.rb +14 -22
  71. metadata +18 -13
  72. data/app/views/hooks/_activity_index_head.html.erb +0 -13
  73. data/spec/factories/meeting_agenda_journal_factory.rb +0 -18
  74. data/spec/factories/meeting_minutes_journal_factory.rb +0 -18
  75. data/spec/models/meeting_agenda_journal_spec.rb +0 -21
  76. data/spec/models/meeting_minutes_journal_spec.rb +0 -21
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjQxNGYzYWRjNTk1ZmRiZGQ2MWMyOWJmNmVjZTE2NmJjOWFlMzI1MQ==
4
+ MDg3ZDE3YmFkYzMwMWFkMmY3YzM1NTU4ZTFjZGM5MjVmMWQxYjUxMQ==
5
5
  data.tar.gz: !binary |-
6
- YjE0ZDhlNmI4YWI1ZGRjNDNmOWJkZjg1Mjg3OGE4MGY5MjkyZjViNA==
7
- !binary "U0hBNTEy":
6
+ NTA3NmUxNTI5NzVhOTFhMzY3NzlhMTcwNjg5MTQyNGIzMWUzNjM5NQ==
7
+ SHA512:
8
8
  metadata.gz: !binary |-
9
- MTUzZmIxOThmY2ZjOWYwZDY1MzZhYTcxMGJiNzQwNmRjZjA1NGJiOGRkZDFm
10
- NGIwNTA4Y2UzZDYxNjg4ODAxMGRhZDI1OGZiNGVjYjUzMGE2MDJlZWZiZDk2
11
- Nzc0ZDE4OWE1ZmUyM2Q0MjNhNjUyNmEyZGYyOGRkNTExMzA0MmY=
9
+ MTAyMGEyMGVhNDhjNzFlZmU2Nzc0NjgwNzA2OTQzYzljOWQzNmY0MTgzMTJm
10
+ MmM2MzU4NjNmMjVjZTI0OTJhNzFjNmY5NmYyMzg1NTk4MDc1Y2NkODg2ODBj
11
+ NTAwMTQ4ODRiZjZlM2E0MWI1YjMwMGQzMjcwZTQ3NmU2NmE2MGI=
12
12
  data.tar.gz: !binary |-
13
- Y2I1NzQzOTk4NzgwOTBhNWFlZjVmZjdjZmQ0NjJkYWEwYjcyOTBhODk5OWI1
14
- YjJjYmYyNTkyOTY1MjNmYWVhMWExMDZkZWM2YjBlNjZkY2YyNDcxNGMyYzM0
15
- YTEzMTRiNTYwZDE1YWM0OGYxMTFkYmUxMmQ3YjZlNWZmZTE2ZGQ=
13
+ OWU4NTMwZWQwYzQ3YmMxMTdjYTlkNmRjOTQ1MGEzYzU3OTY5ZWYyODkwNWM1
14
+ ZjJmNzRlMjJiZTAwM2JlMTAyNmFkYmU5NzcxOWQzNWMwZTVmNDE1ODk5ZWQ0
15
+ ZjY0M2U1MWFlZWZmMjM2YmVmYTEyNTJjMTlmMWY1NTgxOWM1MTU=
@@ -1,5 +1,33 @@
1
+ <!---- copyright
2
+ OpenProject is a project management system.
3
+ Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
4
+
5
+ This program is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU General Public License version 3.
7
+
8
+ This program is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ GNU General Public License for more details.
12
+
13
+ You should have received a copy of the GNU General Public License
14
+ along with this program; if not, write to the Free Software
15
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+
17
+ See doc/COPYRIGHT.md for more details.
18
+
19
+ ++-->
20
+
1
21
  # Changelog
2
22
 
23
+ ## 3.0.3
24
+
25
+ * `#1790` Adapt Meeting Plugin to the acts_as_journalized changes
26
+
27
+ ## 3.0.2
28
+
29
+ * `#1602` Copyright notice updates and wiring to specific Core versions because of coming update to acts_as_journalized
30
+
3
31
  ## 3.0.1
4
32
 
5
33
  * `#1673` Fixed missing translation in diff view
data/README.md CHANGED
@@ -15,7 +15,7 @@ Requirements
15
15
  ------------
16
16
 
17
17
  The Meeting plugin currently requires the [OpenProject Core](https://github.com/opf/openproject/) in
18
- version 3.0.0pre9 to 3.0.0pre12.
18
+ version greater or equal to 3.0.0pre18.
19
19
 
20
20
 
21
21
  Installation
@@ -76,7 +76,7 @@ Special thanks go to
76
76
  License
77
77
  -------
78
78
 
79
- (c) 2011 - 2013 - Finn GmbH
79
+ (c) 2011 - 2013 - the OpenProject Foundation (OPF)
80
80
 
81
- This plugin is licensed under the GNU GPL v3. See doc/COPYRIGHT.rdoc and
81
+ This plugin is licensed under the GNU GPL v3. See doc/COPYRIGHT.md and
82
82
  doc/GPL.txt for details.
@@ -1,13 +1,22 @@
1
- //-- copyright
2
- // OpenProject is a project management system.
3
- //
4
- // Copyright (C) 2011-2013 the OpenProject Team
5
- //
6
- // This program is free software; you can redistribute it and/or
7
- // modify it under the terms of the GNU General Public License version 3.
8
- //
9
- // See doc/COPYRIGHT.rdoc for more details.
10
- //++
1
+ /*-- copyright
2
+ OpenProject is a project management system.
3
+ Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
4
+
5
+ This program is free software; you can redistribute it and/or
6
+ modify it under the terms of the GNU General Public License version 3.
7
+
8
+ This program is distributed in the hope that it will be useful,
9
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ GNU General Public License for more details.
12
+
13
+ You should have received a copy of the GNU General Public License
14
+ along with this program; if not, write to the Free Software
15
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+
17
+ See doc/COPYRIGHT.md for more details.
18
+
19
+ ++*/
11
20
 
12
21
  .meetings div.meeting {padding-bottom: 1em;}
13
22
  div.meeting_content {padding-bottom: 2em;}
@@ -1,12 +1,20 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  class MeetingAgendasController < MeetingContentsController
@@ -1,12 +1,20 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  class MeetingContentsController < ApplicationController
@@ -26,10 +34,16 @@ class MeetingContentsController < ApplicationController
26
34
  before_filter :authorize
27
35
 
28
36
  def show
29
- # Redirect links to the last version
30
- (redirect_to :controller => '/meetings', :action => :show, :id => @meeting, :tab => @content_type.sub(/^meeting_/, '') and return) if params[:id].present? && @content.version == params[:id].to_i
31
-
32
- @content = @content.journals.at params[:id].to_i unless params[:id].blank?
37
+ if params[:id].present? && @content.version == params[:id].to_i
38
+ # Redirect links to the last version
39
+ redirect_to :controller => '/meetings',
40
+ :action => :show,
41
+ :id => @meeting,
42
+ :tab => @content_type.sub(/^meeting_/, '')
43
+ return
44
+ end
45
+ #go to an old version if a version id is given
46
+ @content = @content.at_version params[:id] unless params[:id].blank?
33
47
  render 'meeting_contents/show'
34
48
  end
35
49
 
@@ -1,12 +1,20 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  class MeetingMinutesController < MeetingContentsController
@@ -1,12 +1,20 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  class MeetingsController < ApplicationController
@@ -1,12 +1,20 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  module MeetingContentsHelper
@@ -1,16 +1,30 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  module MeetingsHelper
13
21
  def format_participant_list(participants)
14
22
  participants.sort.collect{|p| link_to_user p.user}.join("; ").html_safe
15
23
  end
24
+
25
+ def render_meeting_journal(model, journal, options = {})
26
+ return "" if journal.initial?
27
+ journal_content = render_journal_details(journal, :label_updated_time_by, model, options)
28
+ content_tag "div", journal_content, { :id => "change-#{journal.id}", :class => "journal" }
29
+ end
16
30
  end
@@ -1,12 +1,20 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  class MeetingMailer < UserMailer
@@ -0,0 +1,40 @@
1
+ #-- encoding: UTF-8
2
+ #-- copyright
3
+ # OpenProject is a project management system.
4
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License version 3.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
+ #
18
+ # See doc/COPYRIGHT.md for more details.
19
+ #++
20
+
21
+ class Journal::MeetingContentJournal < ActiveRecord::Base
22
+ self.table_name = "meeting_content_journals"
23
+
24
+ belongs_to :journal
25
+ belongs_to :meeting
26
+ belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
27
+
28
+ @@journaled_attributes = [:meeting_id,
29
+ :author_id,
30
+ :text,
31
+ :locked]
32
+
33
+ def journaled_attributes
34
+ attributes.symbolize_keys.select{|k,_| @@journaled_attributes.include? k}
35
+ end
36
+
37
+ def editable?
38
+ false
39
+ end
40
+ end
@@ -0,0 +1,38 @@
1
+ #-- encoding: UTF-8
2
+ #-- copyright
3
+ # OpenProject is a project management system.
4
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
+ #
6
+ # This program is free software; you can redistribute it and/or
7
+ # modify it under the terms of the GNU General Public License version 3.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
+ #
18
+ # See doc/COPYRIGHT.md for more details.
19
+ #++
20
+
21
+ class Journal::MeetingJournal < ActiveRecord::Base
22
+ self.table_name = "meeting_journals"
23
+
24
+ belongs_to :journal
25
+ belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
26
+
27
+ @@journaled_attributes = [:title,
28
+ :author_id,
29
+ :project_id,
30
+ :location,
31
+ :start_time,
32
+ :duration]
33
+
34
+ def journaled_attributes
35
+ attributes.symbolize_keys.select{|k,_| @@journaled_attributes.include? k}
36
+ end
37
+
38
+ end
@@ -1,12 +1,20 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  class Meeting < ActiveRecord::Base
@@ -34,8 +42,11 @@ class Meeting < ActiveRecord::Base
34
42
  :date_column => "#{table_name}.created_at"
35
43
 
36
44
  acts_as_journalized :activity_find_options => {:include => [:agenda, :author, :project]},
37
- :event_title => Proc.new {|o| "#{l :label_meeting}: #{o.title} (#{format_date o.start_time} #{format_time o.start_time, false}-#{format_time o.end_time, false})"},
38
- :event_url => Proc.new {|o| {:controller => '/meetings', :action => 'show', :id => o.journaled}}
45
+ :event_title => Proc.new {|o| "#{l :label_meeting}: #{o.journal.journable.title} \
46
+ (#{format_date o.journal.journable.start_time} \
47
+ #{format_time o.journal.journable.start_time, false}-#{format_time o.journal.journable.end_time, false})"},
48
+ :event_url => Proc.new {|o| {:controller => '/meetings', :action => 'show', :id => o.journal.journable}},
49
+ :event_author => Proc.new {|o| o.journal.user}
39
50
 
40
51
  register_on_journal_formatter(:plaintext, 'title')
41
52
  register_on_journal_formatter(:fraction, 'duration')
@@ -133,7 +144,7 @@ class Meeting < ActiveRecord::Base
133
144
 
134
145
  def close_agenda_and_copy_to_minutes!
135
146
  self.agenda.lock!
136
- self.create_minutes(:text => agenda.text)
147
+ self.create_minutes(:text => agenda.text, :comment => "Minutes created")
137
148
  end
138
149
 
139
150
  alias :original_participants_attributes= :participants_attributes=
@@ -1,26 +1,24 @@
1
1
  #-- copyright
2
2
  # OpenProject is a project management system.
3
- #
4
- # Copyright (C) 2011-2013 the OpenProject Team
3
+ # Copyright (C) 2011-2013 the OpenProject Foundation (OPF)
5
4
  #
6
5
  # This program is free software; you can redistribute it and/or
7
6
  # modify it under the terms of the GNU General Public License version 3.
8
7
  #
9
- # See doc/COPYRIGHT.rdoc for more details.
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program; if not, write to the Free Software
15
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16
+ #
17
+ # See doc/COPYRIGHT.md for more details.
10
18
  #++
11
19
 
12
20
  class MeetingAgenda < MeetingContent
13
21
 
14
- acts_as_journalized :activity_type => 'meetings',
15
- :activity_permission => :view_meetings,
16
- :activity_find_options => {:include => {:meeting => :project}},
17
- :event_title => Proc.new {|o| "#{l :label_meeting_agenda}: #{o.meeting.title}"},
18
- :event_url => Proc.new {|o| {:controller => '/meetings', :action => 'show', :id => o.meeting}}
19
-
20
- def activity_type
21
- 'meetings'
22
- end
23
-
24
22
  # TODO: internationalize the comments
25
23
  def lock!(user = User.current)
26
24
  self.comment = "Agenda closed"
@@ -39,57 +37,4 @@ class MeetingAgenda < MeetingContent
39
37
  def editable?
40
38
  !locked?
41
39
  end
42
-
43
- MeetingAgendaJournal.class_eval do
44
- unloadable
45
-
46
- attr_protected :data
47
- after_save :compress_version_text
48
-
49
- # Wiki Content might be large and the data should possibly be compressed
50
- def compress_version_text
51
- self.text = changed_data["text"].last if changed_data["text"]
52
- self.text ||= self.journaled.text if self.journaled.text
53
- end
54
-
55
- def text=(plain)
56
- case Setting.wiki_compression
57
- when "gzip"
58
- begin
59
- text_hash :text => Zlib::Deflate.deflate(plain, Zlib::BEST_COMPRESSION), :compression => Setting.wiki_compression
60
- rescue
61
- text_hash :text => plain, :compression => ''
62
- end
63
- else
64
- text_hash :text => plain, :compression => ''
65
- end
66
- plain
67
- end
68
-
69
- def text_hash(hash)
70
- changed_data.delete("text")
71
- changed_data["data"] = hash[:text]
72
- changed_data["compression"] = hash[:compression]
73
- update_attribute(:changed_data, changed_data)
74
- # changed_data = changed_data
75
- end
76
-
77
- def text
78
- @text ||= case changed_data[:compression]
79
- when 'gzip'
80
- Zlib::Inflate.inflate(data)
81
- else
82
- # uncompressed data
83
- changed_data["data"]
84
- end
85
- end
86
-
87
- def meeting
88
- journaled.meeting
89
- end
90
-
91
- def editable?
92
- false
93
- end
94
- end
95
40
  end