effective_cpd 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/controllers/admin/cpd_audits_controller.rb +4 -4
- data/app/controllers/admin/cpd_statement_activities_controller.rb +3 -5
- data/app/controllers/admin/cpd_statements_controller.rb +0 -2
- data/app/controllers/effective/cpd_audits_controller.rb +1 -1
- data/app/datatables/admin/effective_cpd_audit_reviews_datatable.rb +6 -6
- data/app/datatables/admin/effective_cpd_audits_datatable.rb +10 -10
- data/app/datatables/admin/effective_cpd_bulk_audits_datatable.rb +3 -4
- data/app/datatables/admin/effective_cpd_rules_datatable.rb +4 -4
- data/app/datatables/admin/effective_cpd_special_rules_datatable.rb +2 -2
- data/app/datatables/admin/effective_cpd_statement_activities_datatable.rb +3 -3
- data/app/datatables/admin/effective_cpd_statements_datatable.rb +1 -1
- data/app/datatables/effective_cpd_available_audit_reviews_datatable.rb +2 -2
- data/app/datatables/effective_cpd_available_audits_datatable.rb +1 -1
- data/app/datatables/effective_cpd_available_cycles_datatable.rb +1 -1
- data/app/datatables/effective_cpd_completed_audit_reviews_datatable.rb +3 -3
- data/app/datatables/effective_cpd_completed_audits_datatable.rb +2 -2
- data/app/datatables/effective_cpd_completed_statements_datatable.rb +3 -3
- data/app/helpers/effective_cpd_audits_helper.rb +1 -2
- data/app/helpers/effective_cpd_helper.rb +58 -6
- data/app/models/concerns/effective_cpd_audit.rb +27 -19
- data/app/models/concerns/effective_cpd_audit_level.rb +1 -1
- data/app/models/concerns/effective_cpd_audit_review.rb +1 -1
- data/app/models/concerns/effective_cpd_bulk_audit.rb +1 -1
- data/app/models/concerns/effective_cpd_statement.rb +1 -1
- data/app/models/effective/cpd_activity.rb +1 -1
- data/app/models/effective/cpd_audit_level_question.rb +1 -1
- data/app/models/effective/cpd_audit_level_question_option.rb +1 -1
- data/app/models/effective/cpd_audit_level_section.rb +1 -1
- data/app/models/effective/cpd_audit_response.rb +1 -1
- data/app/models/effective/cpd_audit_review_item.rb +1 -1
- data/app/models/effective/cpd_category.rb +1 -1
- data/app/models/effective/cpd_cycle.rb +1 -1
- data/app/models/effective/cpd_special_rule.rb +1 -1
- data/app/models/effective/cpd_statement_activity.rb +1 -1
- data/app/views/admin/cpd_activities/_form.html.haml +1 -1
- data/app/views/admin/cpd_audit_level_questions/_form.html.haml +1 -1
- data/app/views/admin/cpd_audit_levels/_form.html.haml +4 -4
- data/app/views/admin/cpd_audit_levels/_form_content_audit.html.haml +1 -1
- data/app/views/admin/cpd_audit_levels/_form_content_audit_review.html.haml +1 -1
- data/app/views/admin/cpd_audit_levels/_form_cpd_audit_level.html.haml +25 -18
- data/app/views/admin/cpd_audit_levels/_form_cpd_audit_level_section.html.haml +1 -1
- data/app/views/admin/cpd_audit_reviews/_form.html.haml +2 -2
- data/app/views/admin/cpd_audits/_audit_reviewer_fields.html.haml +1 -1
- data/app/views/admin/cpd_audits/_auditee_fields.html.haml +2 -2
- data/app/views/admin/cpd_audits/_form_chat.html.haml +2 -2
- data/app/views/admin/cpd_audits/_form_close.html.haml +2 -2
- data/app/views/admin/cpd_audits/_form_complete.html.haml +4 -4
- data/app/views/admin/cpd_audits/_form_conflict.html.haml +5 -5
- data/app/views/admin/cpd_audits/_form_cpd_audit.html.haml +6 -6
- data/app/views/admin/cpd_audits/_form_deadlines.html.haml +2 -2
- data/app/views/admin/cpd_audits/_form_exemption.html.haml +2 -2
- data/app/views/admin/cpd_audits/_form_extension.html.haml +2 -2
- data/app/views/admin/cpd_audits/_form_files.html.haml +1 -1
- data/app/views/admin/cpd_audits/_form_missing_info.html.haml +1 -1
- data/app/views/admin/cpd_audits/_form_new.html.haml +10 -12
- data/app/views/admin/cpd_audits/_form_process.html.haml +1 -1
- data/app/views/admin/cpd_audits/_status.html.haml +7 -10
- data/app/views/admin/cpd_bulk_audits/_form_cpd_bulk_audit.html.haml +6 -6
- data/app/views/admin/cpd_categories/_form.html.haml +2 -2
- data/app/views/admin/cpd_cycles/_form_cpd_cycle.html.haml +5 -5
- data/app/views/admin/cpd_special_rules/_form.html.haml +2 -2
- data/app/views/admin/cpd_statements/_cpd_statement.html.haml +2 -2
- data/app/views/admin/users/_form_cpd.html.haml +2 -2
- data/app/views/admin/users/_form_cpd_audits.html.haml +4 -4
- data/app/views/effective/cpd/_dashboard.html.haml +10 -10
- data/app/views/effective/cpd_audit_reviews/_cpd_audit_level_section.html.haml +1 -1
- data/app/views/effective/cpd_audit_reviews/_summary.html.haml +3 -3
- data/app/views/effective/cpd_audit_reviews/conflict.html.haml +1 -1
- data/app/views/effective/cpd_audit_reviews/cpd_audit_level_section.html.haml +1 -1
- data/app/views/effective/cpd_audit_reviews/cpd_statement.html.haml +1 -1
- data/app/views/effective/cpd_audit_reviews/feedback.html.haml +3 -3
- data/app/views/effective/cpd_audit_reviews/files.html.haml +2 -2
- data/app/views/effective/cpd_audit_reviews/instructions.html.haml +1 -1
- data/app/views/effective/cpd_audit_reviews/questionnaire.html.haml +1 -1
- data/app/views/effective/cpd_audit_reviews/recommendation.html.haml +3 -3
- data/app/views/effective/cpd_audit_reviews/start.html.haml +4 -4
- data/app/views/effective/cpd_audit_reviews/statements.html.haml +6 -6
- data/app/views/effective/cpd_audit_reviews/submit.html.haml +1 -1
- data/app/views/effective/cpd_audit_reviews/submitted.html.haml +3 -3
- data/app/views/effective/cpd_audit_reviews/waiting.html.haml +1 -1
- data/app/views/effective/cpd_audits/_missing_info.html.haml +3 -3
- data/app/views/effective/cpd_audits/_summary.html.haml +2 -2
- data/app/views/effective/cpd_audits/conflict.html.haml +2 -2
- data/app/views/effective/cpd_audits/start.html.haml +2 -2
- data/app/views/effective/cpd_audits/submit.html.haml +3 -3
- data/app/views/effective/cpd_audits/submitted.haml +4 -4
- data/app/views/effective/cpd_audits/waiting.html.haml +1 -1
- data/app/views/effective/cpd_statements/_activities_new.html.haml +1 -1
- data/app/views/effective/cpd_statements/_activities_table.html.haml +2 -2
- data/app/views/effective/cpd_statements/_summary.html.haml +1 -1
- data/app/views/effective/cpd_statements/agreements.html.haml +1 -1
- data/app/views/effective/cpd_statements/submit.html.haml +1 -1
- data/config/effective_cpd.rb +0 -5
- data/config/locales/effective_cpd.en.yml +28 -0
- data/config/routes.rb +1 -1
- data/lib/effective_cpd/version.rb +1 -1
- data/lib/effective_cpd.rb +1 -1
- data/lib/generators/effective_cpd/install_generator.rb +4 -0
- data/lib/tasks/effective_cpd_tasks.rake +23 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 68280b10b19be0a77c79173eb4428f429b8905cfeb252ceac7e1d72279da36a0
|
|
4
|
+
data.tar.gz: ca76a95fadc2e71549f943069e8403d6d3f70c349f5c22847ee48396e371e48d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ca2c3fa8c4af2d901fedbcb5859dc2b09be5f99783cbaaf18d4bf2b858830116fe91e9caf51f741b4597283212685125237b6f10b62278d6103498908d3bb50
|
|
7
|
+
data.tar.gz: 21b70b0f7f7e22169059c0df7e3b8cd098e4ac117e7580c42329b2cd2c7c4b04c0c4c6dda76f0e9762a9510318e17f19671a94c1f87d6171f93799d7019af81b
|
data/README.md
CHANGED
|
@@ -167,6 +167,14 @@ def cpd_statement_required_score(cpd_statement)
|
|
|
167
167
|
end
|
|
168
168
|
```
|
|
169
169
|
|
|
170
|
+
## Rake Tasks
|
|
171
|
+
|
|
172
|
+
You can use
|
|
173
|
+
|
|
174
|
+
`bundle exec rake effective_cpd:notify_auditees`
|
|
175
|
+
|
|
176
|
+
to send the cpd_audit_opened notification to all opened (but not yet started) auditees.
|
|
177
|
+
|
|
170
178
|
## Authorization
|
|
171
179
|
|
|
172
180
|
All authorization checks are handled via the effective_resources gem found in the `config/initializers/effective_resources.rb` file.
|
|
@@ -15,7 +15,7 @@ module Admin
|
|
|
15
15
|
].compact.join(' ')
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
submit :close, 'Close
|
|
18
|
+
submit :close, 'Close', success: -> {
|
|
19
19
|
[
|
|
20
20
|
"Successfully closed #{resource}",
|
|
21
21
|
("and sent #{resource.user.email} a notification" unless resource.email_form_skip?)
|
|
@@ -36,17 +36,17 @@ module Admin
|
|
|
36
36
|
].compact.join(' ')
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
submit :complete, 'Complete
|
|
39
|
+
submit :complete, 'Complete', success: -> {
|
|
40
40
|
[
|
|
41
41
|
"Successfully completed #{resource}",
|
|
42
|
-
("and sent
|
|
42
|
+
("and sent notifications" unless resource.email_form_skip)
|
|
43
43
|
].compact.join(' ')
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
submit :complete, 'Ready to Review', success: -> {
|
|
47
47
|
[
|
|
48
48
|
"Successfully completed #{resource}",
|
|
49
|
-
("and sent
|
|
49
|
+
("and sent notifications" unless resource.email_form_skip)
|
|
50
50
|
].compact.join(' ')
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -5,11 +5,9 @@ module Admin
|
|
|
5
5
|
|
|
6
6
|
include Effective::CrudController
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
# params.require(:effective_cpd_statement).permit!
|
|
12
|
-
# end
|
|
8
|
+
def permitted_params
|
|
9
|
+
params.require(:effective_cpd_statement_activity).permit!
|
|
10
|
+
end
|
|
13
11
|
|
|
14
12
|
end
|
|
15
13
|
end
|
|
@@ -8,8 +8,6 @@ module Admin
|
|
|
8
8
|
resource_scope -> { EffectiveCpd.CpdStatement.deep.all }
|
|
9
9
|
datatable -> { EffectiveResources.best('Admin::EffectiveCpdStatementsDatatable').new }
|
|
10
10
|
|
|
11
|
-
page_title(only: :index) { "#{EffectiveCpd.program_label} Statements" }
|
|
12
|
-
|
|
13
11
|
private
|
|
14
12
|
|
|
15
13
|
def permitted_params
|
|
@@ -2,8 +2,8 @@ module Admin
|
|
|
2
2
|
class EffectiveCpdAuditReviewsDatatable < Effective::Datatable
|
|
3
3
|
filters do
|
|
4
4
|
scope :all
|
|
5
|
-
scope :completed
|
|
6
5
|
scope :available, label: 'In Progress'
|
|
6
|
+
scope :completed
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
datatable do
|
|
@@ -11,22 +11,22 @@ module Admin
|
|
|
11
11
|
col :updated_at, visible: false
|
|
12
12
|
col :id, visible: false
|
|
13
13
|
|
|
14
|
-
col :cpd_audit
|
|
15
|
-
col :cpd_audit_level, search: EffectiveCpd.CpdAuditLevel.all.sorted
|
|
14
|
+
col :cpd_audit, label: cpd_audit_label
|
|
15
|
+
col :cpd_audit_level, label: cpd_audit_level_label, search: EffectiveCpd.CpdAuditLevel.all.sorted
|
|
16
16
|
|
|
17
|
-
col :auditee do |cpd_audit_review|
|
|
17
|
+
col :auditee, label: cpd_auditee_label do |cpd_audit_review|
|
|
18
18
|
user = cpd_audit_review.cpd_audit.user
|
|
19
19
|
url = "/admin/users/#{user.to_param}/edit"
|
|
20
20
|
link_to(user, url)
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
col :user, label:
|
|
23
|
+
col :user, label: cpd_reviewer_label
|
|
24
24
|
|
|
25
25
|
col :due_date
|
|
26
26
|
col :submitted_at, as: :date, label: 'Submitted'
|
|
27
27
|
col :conflict_of_interest
|
|
28
28
|
col :recommendation
|
|
29
|
-
col :comments
|
|
29
|
+
col :comments
|
|
30
30
|
|
|
31
31
|
actions_col(edit: false)
|
|
32
32
|
end
|
|
@@ -6,8 +6,8 @@ module Admin
|
|
|
6
6
|
scope :available, label: 'In Progress'
|
|
7
7
|
scope :done
|
|
8
8
|
scope :waiting_on_admin
|
|
9
|
-
scope :waiting_on_auditee
|
|
10
|
-
scope :waiting_on_reviewers
|
|
9
|
+
scope :waiting_on_auditee, label: "Waiting on #{cpd_auditee_label}"
|
|
10
|
+
scope :waiting_on_reviewers, label: "Waiting on #{cpd_reviewers_label}"
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
datatable do
|
|
@@ -19,11 +19,11 @@ module Admin
|
|
|
19
19
|
|
|
20
20
|
col :token, visible: false
|
|
21
21
|
|
|
22
|
-
col :cpd_audit_level, label:
|
|
22
|
+
col :cpd_audit_level, label: cpd_audit_level_label, search: EffectiveCpd.CpdAuditLevel.sorted.all
|
|
23
23
|
|
|
24
|
-
col :user, search: :string
|
|
24
|
+
col :user, search: :string
|
|
25
25
|
|
|
26
|
-
col(:cpd_audit_reviews,
|
|
26
|
+
col(:cpd_audit_reviews, search: :string) do |cpd_audit|
|
|
27
27
|
cpd_audit.cpd_audit_reviews.map(&:user).map do |user|
|
|
28
28
|
content_tag(:div, class: 'col-resource_item') do
|
|
29
29
|
url = view.respond_to?(:edit_admin_user_path) ? edit_admin_user_path(user) : "/admin/users/#{user.to_param}/edit"
|
|
@@ -42,8 +42,8 @@ module Admin
|
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
col :notification_date
|
|
46
|
-
col :extension_date,
|
|
45
|
+
col :notification_date
|
|
46
|
+
col :extension_date, visible: false
|
|
47
47
|
col :due_date
|
|
48
48
|
|
|
49
49
|
col :status
|
|
@@ -54,7 +54,7 @@ module Admin
|
|
|
54
54
|
end.join.html_safe
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
col(:
|
|
57
|
+
col(:cpd_audit_review_item_recommendations, label: 'Item Recommendations', search: :string, visible: false) do |cpd_audit|
|
|
58
58
|
recommendations = cpd_audit.cpd_audit_reviews.map(&:recommendation)
|
|
59
59
|
item_recommendations = cpd_audit.cpd_audit_reviews.flat_map { |r| r.cpd_audit_review_items.map(&:recommendation) }
|
|
60
60
|
|
|
@@ -62,7 +62,7 @@ module Admin
|
|
|
62
62
|
reviews.to_sentence
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
col(:cpd_audit_comments,
|
|
65
|
+
col(:cpd_audit_comments, search: :string, visible: false) do |cpd_audit|
|
|
66
66
|
item_comments = cpd_audit.cpd_audit_reviews.flat_map { |r| r.cpd_audit_review_items.map(&:comments) }.join
|
|
67
67
|
|
|
68
68
|
cpd_audit.cpd_audit_reviews.map(&:comments).map do |comments|
|
|
@@ -72,7 +72,7 @@ module Admin
|
|
|
72
72
|
|
|
73
73
|
col :determination
|
|
74
74
|
|
|
75
|
-
col(:auditee_cpd_statements,
|
|
75
|
+
col(:auditee_cpd_statements, visible: false) do |cpd_audit|
|
|
76
76
|
cpd_audit.user.cpd_statements.map do |cpd_statement|
|
|
77
77
|
content_tag(:div, class: 'col-resource_item') do
|
|
78
78
|
link_to(cpd_statement.to_s, effective_cpd.admin_cpd_statement_path(cpd_statement))
|
|
@@ -8,11 +8,10 @@ module Admin
|
|
|
8
8
|
col :updated_at, label: 'Updated', visible: false
|
|
9
9
|
col :created_at, label: 'Created'
|
|
10
10
|
|
|
11
|
-
col :cpd_audit_level
|
|
12
|
-
col :audits
|
|
13
|
-
col :audit_reviewers_per_audit
|
|
11
|
+
col :cpd_audit_level, label: cpd_audit_level_label
|
|
12
|
+
col :audits, label: cpd_audits_label
|
|
13
|
+
col :audit_reviewers_per_audit, label: "#{cpd_reviewers_label} per #{cpd_audit_label}"
|
|
14
14
|
col :notification_date
|
|
15
|
-
col :email_form_skip
|
|
16
15
|
|
|
17
16
|
actions_col
|
|
18
17
|
end
|
|
@@ -12,7 +12,7 @@ module Admin
|
|
|
12
12
|
col :created_at, visible: false
|
|
13
13
|
col :updated_at, visible: false
|
|
14
14
|
|
|
15
|
-
col :cpd_cycle
|
|
15
|
+
col :cpd_cycle
|
|
16
16
|
|
|
17
17
|
col :ruleable, label: 'Category or Activity', search: {
|
|
18
18
|
collection: {
|
|
@@ -26,10 +26,10 @@ module Admin
|
|
|
26
26
|
content_tag(:div, cpd_activity.formula, style: 'white-space: nowrap;')
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
col :credit_description
|
|
29
|
+
col :credit_description, label: "#{cpd_credit_label} Description"
|
|
30
30
|
|
|
31
|
-
col :max_credits_per_cycle, label: 'Max ' + cpd_credits_label
|
|
32
|
-
col :max_cycles_can_carry_forward, label: 'Max ' + cpd_cycles_label
|
|
31
|
+
col :max_credits_per_cycle, label: 'Max ' + cpd_credits_label
|
|
32
|
+
col :max_cycles_can_carry_forward, label: 'Max ' + cpd_cycles_label
|
|
33
33
|
|
|
34
34
|
col :unavailable
|
|
35
35
|
|
|
@@ -5,12 +5,12 @@ module Admin
|
|
|
5
5
|
col :created_at, visible: false
|
|
6
6
|
col :updated_at, visible: false
|
|
7
7
|
|
|
8
|
-
col :cpd_cycle
|
|
8
|
+
col :cpd_cycle
|
|
9
9
|
|
|
10
10
|
col :cpd_rules
|
|
11
11
|
|
|
12
12
|
col :category
|
|
13
|
-
col :max_credits_per_cycle, label: 'Max ' + cpd_credits_label
|
|
13
|
+
col :max_credits_per_cycle, label: 'Max ' + cpd_credits_label
|
|
14
14
|
|
|
15
15
|
actions_col
|
|
16
16
|
end
|
|
@@ -13,15 +13,15 @@ module Admin
|
|
|
13
13
|
col :created_at, visible: false
|
|
14
14
|
col :updated_at, visible: false
|
|
15
15
|
|
|
16
|
-
col :cpd_cycle,
|
|
17
|
-
col :cpd_statement, visible: false
|
|
16
|
+
col :cpd_cycle, search: Effective::CpdCycle.sorted
|
|
17
|
+
col :cpd_statement, label: cpd_statement_label, visible: false
|
|
18
18
|
|
|
19
19
|
col :user
|
|
20
20
|
|
|
21
21
|
col :date
|
|
22
22
|
col :description
|
|
23
23
|
|
|
24
|
-
col :score, label: cpd_credits_label
|
|
24
|
+
col :score, label: cpd_credits_label do |csa|
|
|
25
25
|
cpd_score(csa.score)
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -14,7 +14,7 @@ module Admin
|
|
|
14
14
|
col :created_at, visible: false
|
|
15
15
|
col :updated_at, visible: false
|
|
16
16
|
|
|
17
|
-
col :cpd_cycle,
|
|
17
|
+
col :cpd_cycle, search: Effective::CpdCycle.sorted
|
|
18
18
|
col :user
|
|
19
19
|
col :submitted_at, as: :date, label: 'Submitted on'
|
|
20
20
|
|
|
@@ -6,9 +6,9 @@ class EffectiveCpdAvailableAuditReviewsDatatable < Effective::Datatable
|
|
|
6
6
|
|
|
7
7
|
col :token, visible: false
|
|
8
8
|
|
|
9
|
-
col :cpd_audit_level, label:
|
|
9
|
+
col :cpd_audit_level, label: cpd_audit_level_label
|
|
10
10
|
col :due_date
|
|
11
|
-
col :name, label:
|
|
11
|
+
col :name, label: cpd_auditee_label, action: false
|
|
12
12
|
|
|
13
13
|
col :ready_to_review do |cpd_audit|
|
|
14
14
|
cpd_audit.ready_to_review? ? 'Yes' : 'No'
|
|
@@ -6,7 +6,7 @@ class EffectiveCpdAvailableCyclesDatatable < Effective::Datatable
|
|
|
6
6
|
|
|
7
7
|
col :start_at, visible: false
|
|
8
8
|
|
|
9
|
-
col(:title, label: cpd_cycle_label
|
|
9
|
+
col(:title, label: cpd_cycle_label)
|
|
10
10
|
col :available_date, label: 'Available'
|
|
11
11
|
|
|
12
12
|
col :required_score, label: 'Required' do |cpd_cycle|
|
|
@@ -6,9 +6,9 @@ class EffectiveCpdCompletedAuditReviewsDatatable < Effective::Datatable
|
|
|
6
6
|
|
|
7
7
|
col :token, visible: false
|
|
8
8
|
|
|
9
|
-
col :cpd_audit_level, label:
|
|
10
|
-
col :notification_date
|
|
11
|
-
col :name, label:
|
|
9
|
+
col :cpd_audit_level, label: cpd_audit_level_label
|
|
10
|
+
col :notification_date
|
|
11
|
+
col :name, label: cpd_auditee_label, action: false
|
|
12
12
|
|
|
13
13
|
col :recommendation do |cpd_audit|
|
|
14
14
|
cpd_audit.cpd_audit_reviews.find { |r| r.user_id == current_user.id }.recommendation
|
|
@@ -6,8 +6,8 @@ class EffectiveCpdCompletedAuditsDatatable < Effective::Datatable
|
|
|
6
6
|
|
|
7
7
|
col :token, visible: false
|
|
8
8
|
|
|
9
|
-
col :cpd_audit_level, label:
|
|
10
|
-
col :notification_date
|
|
9
|
+
col :cpd_audit_level, label: cpd_audit_level_label
|
|
10
|
+
col :notification_date
|
|
11
11
|
col :status
|
|
12
12
|
col :determination
|
|
13
13
|
|
|
@@ -4,12 +4,12 @@ class EffectiveCpdCompletedStatementsDatatable < Effective::Datatable
|
|
|
4
4
|
datatable do
|
|
5
5
|
order :cpd_cycle_id
|
|
6
6
|
|
|
7
|
-
col(:cpd_cycle_id, label:
|
|
7
|
+
col(:cpd_cycle_id, label: cpd_statement_label) do |statement|
|
|
8
8
|
statement.cpd_cycle.to_s
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
col :submitted_at
|
|
12
|
-
col :score, label: cpd_credits_label
|
|
11
|
+
col :submitted_at
|
|
12
|
+
col :score, label: cpd_credits_label
|
|
13
13
|
|
|
14
14
|
col :required_score, label: 'Required' do |cpd_statement|
|
|
15
15
|
cpd_score(cpd_statement.required_score || cpd_statement.targeted_score)
|
|
@@ -21,8 +21,7 @@ module EffectiveCpdAuditsHelper
|
|
|
21
21
|
|
|
22
22
|
users.map do |user|
|
|
23
23
|
in_progress = content_tag(:span, class: 'badge badge-info') do
|
|
24
|
-
|
|
25
|
-
"#{pluralize(reviews, 'review')} in progress"
|
|
24
|
+
user.cpd_audit_reviews.count { |review| review.in_progress? }.to_s + ' in progress'
|
|
26
25
|
end
|
|
27
26
|
|
|
28
27
|
html = content_tag(:div, "#{user} #{in_progress}")
|
|
@@ -1,19 +1,71 @@
|
|
|
1
1
|
module EffectiveCpdHelper
|
|
2
2
|
|
|
3
|
+
def cpd_name_label
|
|
4
|
+
et('effective_cpd.name')
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def cpd_credit_label
|
|
8
|
+
et('effective_cpd.credit')
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def cpd_credits_label
|
|
12
|
+
ets('effective_cpd.credit')
|
|
13
|
+
end
|
|
14
|
+
|
|
3
15
|
def cpd_cycle_label
|
|
4
|
-
(
|
|
16
|
+
et(Effective::CpdCycle)
|
|
5
17
|
end
|
|
6
18
|
|
|
7
19
|
def cpd_cycles_label
|
|
8
|
-
(
|
|
20
|
+
ets(Effective::CpdCycle)
|
|
9
21
|
end
|
|
10
22
|
|
|
11
|
-
def
|
|
12
|
-
(EffectiveCpd.
|
|
23
|
+
def cpd_statement_label
|
|
24
|
+
et(EffectiveCpd.CpdStatement)
|
|
13
25
|
end
|
|
14
26
|
|
|
15
|
-
def
|
|
16
|
-
(EffectiveCpd.
|
|
27
|
+
def cpd_statements_label
|
|
28
|
+
ets(EffectiveCpd.CpdStatement)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def cpd_audit_label
|
|
32
|
+
et(EffectiveCpd.CpdAudit)
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def cpd_audits_label
|
|
36
|
+
ets(EffectiveCpd.CpdAudit)
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def cpd_audit_review_label
|
|
40
|
+
et(EffectiveCpd.CpdAuditReview)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def cpd_audit_reviews_label
|
|
44
|
+
ets(EffectiveCpd.CpdAuditReview)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def cpd_auditee_label
|
|
48
|
+
et(EffectiveCpd.CpdAudit, :user)
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def cpd_auditees_label
|
|
52
|
+
ets(EffectiveCpd.CpdAudit, :user)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def cpd_reviewer_label
|
|
56
|
+
et(EffectiveCpd.CpdAuditReview, :user)
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def cpd_reviewers_label
|
|
60
|
+
ets(EffectiveCpd.CpdAuditReview, :user)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def cpd_audit_level_label
|
|
64
|
+
et(EffectiveCpd.CpdAuditLevel)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def cpd_audit_levels_label
|
|
68
|
+
ets(EffectiveCpd.CpdAuditLevel)
|
|
17
69
|
end
|
|
18
70
|
|
|
19
71
|
def cpd_rule_formula_hint(cpd_activity)
|
|
@@ -226,7 +226,7 @@ module EffectiveCpdAudit
|
|
|
226
226
|
|
|
227
227
|
validate(if: -> { determination.present? }) do
|
|
228
228
|
unless cpd_audit_level.determinations.include?(determination)
|
|
229
|
-
self.errors.add(:determination, '
|
|
229
|
+
self.errors.add(:determination, 'is not included')
|
|
230
230
|
end
|
|
231
231
|
end
|
|
232
232
|
|
|
@@ -240,9 +240,7 @@ module EffectiveCpdAudit
|
|
|
240
240
|
before_save(if: -> { submitted? }) { try_complete! }
|
|
241
241
|
before_save(if: -> { completed? }) { try_review! }
|
|
242
242
|
|
|
243
|
-
after_commit(on: :create)
|
|
244
|
-
send_email(:cpd_audit_opened)
|
|
245
|
-
end
|
|
243
|
+
after_commit(on: :create) { notify! }
|
|
246
244
|
|
|
247
245
|
def dynamic_wizard_steps
|
|
248
246
|
cpd_audit_level.cpd_audit_level_sections.each_with_object({}) do |section, h|
|
|
@@ -314,7 +312,7 @@ module EffectiveCpdAudit
|
|
|
314
312
|
end
|
|
315
313
|
|
|
316
314
|
def to_s
|
|
317
|
-
(cpd_audit_level.present? && name.present?) ? "#{cpd_audit_level}
|
|
315
|
+
(cpd_audit_level.present? && name.present?) ? "#{cpd_audit_level} #{model_name.human} of #{name}" : model_name.human
|
|
318
316
|
end
|
|
319
317
|
|
|
320
318
|
def name
|
|
@@ -362,41 +360,46 @@ module EffectiveCpdAudit
|
|
|
362
360
|
end
|
|
363
361
|
|
|
364
362
|
def summary
|
|
363
|
+
audit = model_name.human
|
|
364
|
+
auditee = EffectiveCpd.CpdAudit.human_attribute_name(:user)
|
|
365
|
+
reviewer = EffectiveCpd.CpdAuditReview.human_attribute_name(:user)
|
|
366
|
+
reviewers = EffectiveCpd.CpdAuditReview.human_attribute_name(:user).pluralize
|
|
367
|
+
|
|
365
368
|
case status_was
|
|
366
369
|
when 'opened'
|
|
367
|
-
"The audit has been opened. The auditee and
|
|
370
|
+
"The #{audit} has been opened. The #{auditee} and #{reviewers} have been notified. Waiting for the #{auditee} to submit."
|
|
368
371
|
when 'started'
|
|
369
|
-
"The auditee has
|
|
372
|
+
"The #{auditee} has started their #{audit}. Waiting for the #{auditee} to submit."
|
|
370
373
|
when 'conflicted'
|
|
371
|
-
"The auditee has declared a conflict of interest. A new reviewer will be assigned."
|
|
374
|
+
"The #{auditee} has declared a conflict of interest. A new #{reviewer} will be assigned."
|
|
372
375
|
when 'conflicted_resolved'
|
|
373
|
-
"The auditee had declared a conflict of interest. This has been resolved. Waiting for the auditee to submit
|
|
376
|
+
"The #{auditee} had declared a conflict of interest. This has been resolved. Waiting for the #{auditee} to submit."
|
|
374
377
|
when 'exemption_requested'
|
|
375
|
-
"The auditee has requested an exemption. Waiting for request to be granted or denied."
|
|
378
|
+
"The #{auditee} has requested an exemption. Waiting for request to be granted or denied."
|
|
376
379
|
when 'exemption_granted'
|
|
377
|
-
"The exemption request has been granted. This audit may now be closed."
|
|
380
|
+
"The exemption request has been granted. This #{audit} may now be closed."
|
|
378
381
|
when 'exemption_denied'
|
|
379
|
-
"The exemption request has been denied. The audit will continue. Waiting for the auditee to submit
|
|
382
|
+
"The exemption request has been denied. The #{audit} will continue. Waiting for the #{auditee} to submit."
|
|
380
383
|
when 'extension_requested'
|
|
381
|
-
"The auditee has requested an extension. Waiting for request to be granted or denied."
|
|
384
|
+
"The #{auditee} has requested an extension. Waiting for request to be granted or denied."
|
|
382
385
|
when 'extension_granted'
|
|
383
|
-
"The extension request has been granted. There is a new deadline. Waiting for the auditee to submit
|
|
386
|
+
"The extension request has been granted. There is a new deadline. Waiting for the #{auditee} to submit."
|
|
384
387
|
when 'extension_denied'
|
|
385
|
-
"The extension request has been denied. The deadline remains. Waiting for the auditee to submit
|
|
388
|
+
"The extension request has been denied. The deadline remains. Waiting for the #{auditee} to submit."
|
|
386
389
|
when 'submitted'
|
|
387
|
-
summary = "
|
|
390
|
+
summary = "#{auditee} has submitted their #{audit} wizard."
|
|
388
391
|
tasks = "The following tasks remain before it can be completed:"
|
|
389
392
|
approval = "Waiting on completeness check, review and determination."
|
|
390
393
|
items = completed_requirements.map { |item, done| "<li>#{item}: #{done ? 'Complete' : 'Incomplete'}</li>" }.join
|
|
391
394
|
completed_requirements.present? ? "<p>#{summary} #{tasks}</p><ul>#{items}</ul>" : "#{summary} #{approval}"
|
|
392
395
|
when 'completed'
|
|
393
|
-
"All required materials have been provided. Ready to review. This audit will transition to 'reviewed' after all reviewers have
|
|
396
|
+
"All required materials have been provided. Ready to review. This #{audit} will transition to 'reviewed' after all #{reviewers} have submitted."
|
|
394
397
|
when 'missing_info'
|
|
395
398
|
"Missing the following information: <ul><li>#{missing_info_reason}</li></ul>"
|
|
396
399
|
when 'reviewed'
|
|
397
|
-
"The audit has been reviewed and is ready for the final determination to be made."
|
|
400
|
+
"The #{audit} has been reviewed and is ready for the final determination to be made."
|
|
398
401
|
when 'closed'
|
|
399
|
-
"This audit has been closed with a final determination #{determination}. All done."
|
|
402
|
+
"This #{audit} has been closed with a final determination #{determination}. All done."
|
|
400
403
|
else
|
|
401
404
|
raise("unexpected status #{status}")
|
|
402
405
|
end.html_safe
|
|
@@ -413,6 +416,11 @@ module EffectiveCpdAudit
|
|
|
413
416
|
cpd_audit_response ||= cpd_audit_responses.build(cpd_audit: self, cpd_audit_level_question: cpd_audit_level_question)
|
|
414
417
|
end
|
|
415
418
|
|
|
419
|
+
def notify!
|
|
420
|
+
send_email(:cpd_audit_opened)
|
|
421
|
+
true
|
|
422
|
+
end
|
|
423
|
+
|
|
416
424
|
# Auditee wizard action
|
|
417
425
|
def start!
|
|
418
426
|
started!
|