aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stif/dashboard.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stif/dashboard.rb')
-rw-r--r--lib/stif/dashboard.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/stif/dashboard.rb b/lib/stif/dashboard.rb
index b6b6b8284..46c635091 100644
--- a/lib/stif/dashboard.rb
+++ b/lib/stif/dashboard.rb
@@ -4,12 +4,16 @@ module Stif
@workbench ||= current_organisation.workbenches.find_by(name: "Gestion de l'offre")
end
+ def workgroup
+ workbench.workgroup
+ end
+
def referentials
@referentials ||= self.workbench.all_referentials
end
def calendars
- @calendars ||= Calendar.where('organisation_id = ? OR shared = ?', current_organisation.id, true)
+ @calendars ||= Calendar.where('(organisation_id = ? OR shared = ?) AND workgroup_id = ?', current_organisation.id, true, workgroup.id)
end
end
end