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.
- checksums.yaml +9 -9
- data/CHANGELOG.md +28 -0
- data/README.md +3 -3
- data/app/assets/stylesheets/meeting/meeting.css.erb +19 -10
- data/app/controllers/meeting_agendas_controller.rb +11 -3
- data/app/controllers/meeting_contents_controller.rb +21 -7
- data/app/controllers/meeting_minutes_controller.rb +11 -3
- data/app/controllers/meetings_controller.rb +11 -3
- data/app/helpers/meeting_contents_helper.rb +11 -3
- data/app/helpers/meetings_helper.rb +17 -3
- data/app/mailers/meeting_mailer.rb +11 -3
- data/app/models/journal/meeting_content_journal.rb +40 -0
- data/app/models/journal/meeting_journal.rb +38 -0
- data/app/models/meeting.rb +17 -6
- data/app/models/meeting_agenda.rb +11 -66
- data/app/models/meeting_content.rb +30 -4
- data/app/models/meeting_minutes.rb +11 -67
- data/app/models/meeting_participant.rb +11 -3
- data/app/views/hooks/meetings/_activity_index_head.html.erb +21 -0
- data/app/views/meeting_contents/_form.html.erb +11 -3
- data/app/views/meeting_contents/_show.html.erb +11 -3
- data/app/views/meeting_contents/diff.html.erb +13 -6
- data/app/views/meeting_contents/history.html.erb +11 -3
- data/app/views/meeting_contents/show.html.erb +11 -3
- data/app/views/meeting_mailer/content_for_review.html.erb +11 -3
- data/app/views/meeting_mailer/content_for_review.text.erb +20 -0
- data/app/views/meetings/_form.html.erb +11 -3
- data/app/views/meetings/edit.html.erb +11 -3
- data/app/views/meetings/index.html.erb +11 -3
- data/app/views/meetings/new.html.erb +11 -3
- data/app/views/meetings/show.html.erb +12 -4
- data/app/views/shared/_meeting_header.html.erb +11 -3
- data/config/locales/de.yml +22 -0
- data/config/locales/en.yml +22 -0
- data/config/routes.rb +11 -3
- data/db/migrate/20110106210555_create_meetings.rb +11 -3
- data/db/migrate/20110106221214_create_meeting_contents.rb +11 -3
- data/db/migrate/20110106221946_create_meeting_content_versions.rb +11 -3
- data/db/migrate/20110108230721_create_meeting_participants.rb +11 -3
- data/db/migrate/20110224180804_add_lock_to_meeting_content.rb +11 -3
- data/db/migrate/20110819162852_create_initial_meeting_journals.rb +11 -3
- data/db/migrate/20111605171815_merge_meeting_content_versions_with_journals.rb +11 -3
- data/db/migrate/20130731151542_remove_meeting_role_id_from_meeting_participants.rb +11 -3
- data/db/migrate/20130822113942_create_meeting_journals.rb +39 -0
- data/db/migrate/20130924091342_legacy_meeting_journal_data.rb +36 -0
- data/db/migrate/20130924093842_legacy_meeting_agenda_journal_data.rb +62 -0
- data/db/migrate/20130924114042_legacy_meeting_minutes_journal_data.rb +62 -0
- data/doc/{COPYRIGHT.rdoc → COPYRIGHT.md} +1 -1
- data/doc/COPYRIGHT_short.md +16 -0
- data/lib/open_project/meeting.rb +11 -3
- data/lib/open_project/meeting/engine.rb +12 -4
- data/lib/open_project/meeting/hooks.rb +12 -4
- data/lib/open_project/meeting/patches/project_patch.rb +11 -3
- data/lib/open_project/meeting/version.rb +12 -4
- data/lib/openproject-meeting.rb +11 -3
- data/spec/controllers/meetings_controller_spec.rb +11 -3
- data/spec/factories/meeting_agenda_factory.rb +11 -3
- data/spec/factories/meeting_content_journal_factory.rb +23 -0
- data/spec/factories/meeting_factory.rb +11 -3
- data/spec/factories/meeting_journal_factory.rb +31 -0
- data/spec/factories/meeting_minutes_factory.rb +11 -3
- data/spec/factories/meeting_participant_factory.rb +11 -3
- data/spec/mailers/meeting_mailer_spec.rb +11 -3
- data/spec/models/meeting_agenda_spec.rb +14 -6
- data/spec/models/meeting_content_journal_spec.rb +30 -0
- data/spec/models/meeting_minutes_spec.rb +11 -3
- data/spec/models/meeting_spec.rb +11 -3
- data/spec/models/user_deletion_spec.rb +16 -14
- data/spec/spec_helper.rb +11 -3
- data/spec/support/plugin_spec_helper.rb +14 -22
- metadata +18 -13
- data/app/views/hooks/_activity_index_head.html.erb +0 -13
- data/spec/factories/meeting_agenda_journal_factory.rb +0 -18
- data/spec/factories/meeting_minutes_journal_factory.rb +0 -18
- data/spec/models/meeting_agenda_journal_spec.rb +0 -21
- 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
|
-
|
4
|
+
MDg3ZDE3YmFkYzMwMWFkMmY3YzM1NTU4ZTFjZGM5MjVmMWQxYjUxMQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
7
|
-
|
6
|
+
NTA3NmUxNTI5NzVhOTFhMzY3NzlhMTcwNjg5MTQyNGIzMWUzNjM5NQ==
|
7
|
+
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTAyMGEyMGVhNDhjNzFlZmU2Nzc0NjgwNzA2OTQzYzljOWQzNmY0MTgzMTJm
|
10
|
+
MmM2MzU4NjNmMjVjZTI0OTJhNzFjNmY5NmYyMzg1NTk4MDc1Y2NkODg2ODBj
|
11
|
+
NTAwMTQ4ODRiZjZlM2E0MWI1YjMwMGQzMjcwZTQ3NmU2NmE2MGI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OWU4NTMwZWQwYzQ3YmMxMTdjYTlkNmRjOTQ1MGEzYzU3OTY5ZWYyODkwNWM1
|
14
|
+
ZjJmNzRlMjJiZTAwM2JlMTAyNmFkYmU5NzcxOWQzNWMwZTVmNDE1ODk5ZWQ0
|
15
|
+
ZjY0M2U1MWFlZWZmMjM2YmVmYTEyNTJjMTlmMWY1NTgxOWM1MTU=
|
data/CHANGELOG.md
CHANGED
@@ -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
|
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 -
|
79
|
+
(c) 2011 - 2013 - the OpenProject Foundation (OPF)
|
80
80
|
|
81
|
-
This plugin is licensed under the GNU GPL v3. See doc/COPYRIGHT.
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
-
#
|
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
|
-
#
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
-
#
|
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
|
data/app/models/meeting.rb
CHANGED
@@ -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
|
-
#
|
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.
|
38
|
-
|
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
|
-
#
|
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
|