@@ -74,11 +74,14 @@ class OrganisationController {
74
74
Map availableReportCategories = null
75
75
List services = null
76
76
List targetPeriods = null
77
+ List dashboardData = null
77
78
if (adminVisible) {
78
79
dashboardReports + = [name :' announcements' , label :' Announcements' ]
79
80
availableReportCategories = settingService. getJson(SettingPageType . ORGANISATION_REPORT_CONFIG )
80
81
services = organisationService. findApplicableServices(organisation, metadataService. getProjectServices())
81
82
targetPeriods = organisationService. generateTargetPeriods(organisation)
83
+ List scores = services. collect{it. scores}. flatten()
84
+ dashboardData = organisationService. scoresForOrganisation(organisation, scores?. collect{it. scoreId}, ! hasEditorAccess)
82
85
}
83
86
boolean showTargets = userService. userIsSiteAdmin() && services && targetPeriods
84
87
@@ -110,7 +113,7 @@ class OrganisationController {
110
113
[about : [label : ' About' , visible : true , stopBinding : false , type :' tab' , default :! reportingVisible, displayedPrograms :projectGroups. displayedPrograms, servicesDashboard :[visible :true ]],
111
114
projects : [label : ' Reporting' , template :" /shared/projectListByProgram" , visible : reportingVisible, stopBinding :true , default :reportingVisible, type : ' tab' , reports :organisation. reports, adHocReportTypes :adHocReportTypes, reportOrder :reportOrder, hideDueDate :true , displayedPrograms :projectGroups. displayedPrograms, reportsFirst :true , declarationType :SettingPageType . RDP_REPORT_DECLARATION ],
112
115
sites : [label : ' Sites' , visible : reportingVisible, type : ' tab' , stopBinding :true , projectCount :organisation. projects?. size()?: 0 , showShapefileDownload :adminVisible],
113
- dashboard : [label : ' Dashboard' , visible : reportingVisible, stopBinding :true , type : ' tab' , template :' /shared/ dashboard' , reports :dashboardReports],
116
+ dashboard : [label : ' Dashboard' , visible : reportingVisible, stopBinding :true , type : ' tab' , template :' dashboard' , reports :dashboardReports, dashboardData :dashboardData ],
114
117
admin : [label : ' Admin' , visible : adminVisible, type : ' tab' , template :' admin' , showEditAnnoucements :showEditAnnoucements, availableReportCategories :availableReportCategories, targetPeriods :targetPeriods, services : services, showTargets :showTargets]]
115
118
116
119
}
@@ -200,7 +203,7 @@ class OrganisationController {
200
203
}
201
204
202
205
List existingLinks = links?. findResults { it. documentId }
203
- List toDeleteLinks = originalOrganisation?. links?. findAll { ! existingLinks. contains(it. documentId) }
206
+ List toDeleteLinks = originalOrganisation?. links?. findAll { ! existingLinks? . contains(it. documentId) }
204
207
// delete any links that were removed.
205
208
if (toDeleteLinks && ! result. error) {
206
209
toDeleteLinks. each { link ->
0 commit comments