diff --git a/controllers/administration.js b/controllers/administration.js
index 0791f7c3a3..a97510134b 100644
--- a/controllers/administration.js
+++ b/controllers/administration.js
@@ -1289,7 +1289,7 @@ const getUsersWithoutConsent = async (req, roleName, classId) => {
.map((u) => u._id),
consentStatus: { $in: ['missing', 'parentsAgreed'] },
$limit: batchSize,
- $sort: { 'lastName': 1},
+ $sort: { lastName: 1 },
},
})).data,
);
@@ -2260,6 +2260,8 @@ const schoolUpdateHandler = async (req, res, next) => {
name,
language,
logo_dataUrl,
+ rocketChat,
+ videoconference,
} = req.body;
let logo;
@@ -2270,6 +2272,20 @@ const schoolUpdateHandler = async (req, res, next) => {
};
}
+ const features = new Set(req.body.features);
+
+ if (rocketChat) {
+ features.add('rocketChat');
+ } else {
+ features.delete('rocketChat');
+ }
+
+ if (videoconference) {
+ features.add('videoconference');
+ } else {
+ features.delete('videoconference');
+ }
+
const requestBody = {
name,
language,
@@ -2277,7 +2293,7 @@ const schoolUpdateHandler = async (req, res, next) => {
student: { LERNSTORE_VIEW: false },
teacher: { STUDENT_LIST: false },
},
- features: [],
+ features: Array.from(features),
logo,
};
@@ -2293,17 +2309,6 @@ const schoolUpdateHandler = async (req, res, next) => {
requestBody.permissions.student.LERNSTORE_VIEW = !!req.body.studentlernstorevisibility;
}
- // Update school features
- const possibleSchoolFeatures = [
- 'messenger', 'messengerSchoolRoom', 'messengerStudentRoomCreate', 'rocketChat', 'videoconference',
- ];
-
- for (const feature of possibleSchoolFeatures) {
- if (req.body[feature] === 'true') {
- requestBody.features.push(feature);
- }
- }
-
await api(req, { version: 'v3' }).patch(`/school/${res.locals.currentSchool}`, {
json: requestBody,
});
diff --git a/views/administration/school.hbs b/views/administration/school.hbs
index 8b1dff4828..9a1f72f748 100644
--- a/views/administration/school.hbs
+++ b/views/administration/school.hbs
@@ -344,6 +344,11 @@
{{/each}} {{/if}}
{{> "lib/components/csrfInput"}}
+
+ {{#each @root.school.features}}
+
+ {{/each}}
+