Skip to content

Commit 27fa710

Browse files
committed
Group: revert new group category options for future PR
1 parent d573589 commit 27fa710

File tree

2 files changed

+9
-77
lines changed

2 files changed

+9
-77
lines changed

public/main/group/group_category.php

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ function check_groups_per_user($value)
7575
'announcements_state' => GroupManager::TOOL_PRIVATE,
7676
'forum_state' => GroupManager::TOOL_PRIVATE,
7777
'max_student' => 0,
78-
'document_access' => 0,
79-
'allow_change_group_name' => GroupManager::GROUP_ONLY_TEACHER_CAN_RENAME,
80-
'only_me' => GroupManager::GROUP_VISIBILITY_DEFAULT,
78+
'document_access' => 0
8179
];
8280
}
8381

@@ -166,42 +164,6 @@ function check_groups_per_user($value)
166164
$form->addRule('max_member_group', get_lang('Please enter a valid number for the maximum number of members.'), 'callback', 'check_max_number_of_members');
167165
$form->addElement('html', '</div>');
168166

169-
// group naming settings
170-
$form->addElement('html', '<div class="col-md-6">');
171-
172-
$group = [
173-
$form->createElement('radio', 'allow_change_group_name', null, 'Seul les enseignants peuvent renommer les groupes', GroupManager::GROUP_ONLY_TEACHER_CAN_RENAME),
174-
$form->createElement('radio', 'allow_change_group_name', null, 'Les membres peuvent renommer les groupes', GroupManager::GROUP_STUDENT_CAN_RENAME),
175-
$form->createElement('radio', 'allow_change_group_name', null, 'Le groupe sera nommé avec les noms prénoms de ses membres', GroupManager::GROUP_AUTO_RENAME_WITH_SELF_MEMBERS),
176-
];
177-
$form->addGroup(
178-
$group,
179-
'',
180-
Display::getMdiIcon('rename', 'ch-tool-icon', null, ICON_SIZE_SMALL, 'Renommer').' Renommer',
181-
null,
182-
false
183-
);
184-
185-
$form->addElement('html', '</div>');
186-
187-
// visibility settings
188-
$form->addElement('html', '<div class="col-md-6">');
189-
190-
$group = [
191-
$form->createElement('radio', 'only_me', null, 'Par défaut', GroupManager::GROUP_VISIBILITY_DEFAULT),
192-
$form->createElement('radio', 'only_me', null, 'Afficher uniquement les groupes dont l\'étudiant est membre', GroupManager::GROUP_ONLY_FOR_THOSE_JOINED),
193-
$form->createElement('radio', 'only_me', null, 'Afficher, sans leur nom ni la liste des membres, uniquement les groupes dont l\'étudiant est membre', GroupManager::GROUP_ONLY_FOR_THOSE_JOINED_WITHOUT_MEMBERS_INFOS),
194-
];
195-
$form->addGroup(
196-
$group,
197-
'',
198-
Display::getMdiIcon('eye', 'ch-tool-icon', null, ICON_SIZE_SMALL, 'Visibilité').' Visibilité',
199-
null,
200-
false
201-
);
202-
203-
$form->addElement('html', '</div>');
204-
205167
$form->addElement('html', '<div class="col-md-6">');
206168
// Self registration
207169
$group = [
@@ -445,9 +407,7 @@ function check_groups_per_user($value)
445407
$self_unreg_allowed,
446408
$max_member,
447409
$values['groups_per_user'],
448-
$values['document_access'] ?? 0,
449-
$values['allow_change_group_name'],
450-
$values['only_me']
410+
$values['document_access'] ?? 0
451411
);
452412
Display::addFlash(Display::return_message(get_lang('Group settings have been modified')));
453413
header('Location: '.$currentUrl.'&category='.$values['id']);
@@ -467,9 +427,7 @@ function check_groups_per_user($value)
467427
$self_unreg_allowed,
468428
$max_member,
469429
$values['groups_per_user'],
470-
$values['document_access'] ?? 0,
471-
$values['allow_change_group_name'],
472-
$values['only_me']
430+
$values['document_access'] ?? 0
473431
);
474432
Display::addFlash(Display::return_message(get_lang('Category created')));
475433
header('Location: '.$currentUrl);
@@ -494,9 +452,11 @@ function check_groups_per_user($value)
494452
$defaults['max_member_no_limit'] = 1;
495453
$defaults['max_member'] = $defaults['max_student'];
496454
}
455+
/*
497456
if (api_get_setting('allow_group_categories')) {
498457
$defaults['id'] = $_GET['id'];
499458
}
459+
*/
500460

501461
$form->setDefaults($defaults);
502462
$form->display();

public/main/inc/lib/groupmanager.lib.php

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,6 @@ class GroupManager
6868
public const DOCUMENT_MODE_READ_ONLY = 1;
6969
public const DOCUMENT_MODE_COLLABORATION = 2;
7070

71-
/**
72-
* Constant for the group category's naming rules
73-
*/
74-
public const GROUP_ONLY_TEACHER_CAN_RENAME = 0;
75-
public const GROUP_STUDENT_CAN_RENAME = 1;
76-
public const GROUP_AUTO_RENAME_WITH_SELF_MEMBERS = 2;
77-
78-
/**
79-
* Constant for the group category's visibility rules
80-
*/
81-
public const GROUP_VISIBILITY_DEFAULT = 0;
82-
public const GROUP_ONLY_FOR_THOSE_JOINED = 1;
83-
public const GROUP_ONLY_FOR_THOSE_JOINED_WITHOUT_MEMBERS_INFOS = 2;
84-
85-
8671
public function __construct()
8772
{
8873
}
@@ -1095,9 +1080,7 @@ public static function create_category(
10951080
$selfUnRegistrationAllowed = 0,
10961081
$maxStudent = 8,
10971082
$groupsPerUser = 0,
1098-
$documentAccess = 0,
1099-
$namingRule = GroupManager::GROUP_ONLY_TEACHER_CAN_RENAME,
1100-
$visibilityRule = GroupManager::GROUP_VISIBILITY_DEFAULT
1083+
$documentAccess = 0
11011084
) {
11021085
if (empty($title)) {
11031086
return false;
@@ -1124,8 +1107,6 @@ public static function create_category(
11241107
->setGroupsPerUser($groupsPerUser)
11251108
->setParent($course)
11261109
->addCourseLink($course, $session)
1127-
->setAllowChangeGroupName($namingRule)
1128-
->setOnlyMe($visibilityRule)
11291110
;
11301111

11311112
$repo = Container::getGroupCategoryRepository();
@@ -1168,9 +1149,7 @@ public static function update_category(
11681149
$selfUnRegistrationAllowed,
11691150
$maximum_number_of_students,
11701151
$groups_per_user,
1171-
$documentAccess,
1172-
$namingRule = GroupManager::GROUP_ONLY_TEACHER_CAN_RENAME,
1173-
$visibilityRule = GroupManager::GROUP_VISIBILITY_DEFAULT
1152+
$documentAccess
11741153
) {
11751154
$table = Database::get_course_table(TABLE_GROUP_CATEGORY);
11761155
$id = (int) $id;
@@ -1195,8 +1174,6 @@ public static function update_category(
11951174
groups_per_user = '".Database::escape_string($groups_per_user)."',
11961175
self_reg_allowed = '".Database::escape_string($selfRegistrationAllowed)."',
11971176
self_unreg_allowed = '".Database::escape_string($selfUnRegistrationAllowed)."',
1198-
allow_change_group_name = '".Database::escape_string($namingRule)."',
1199-
only_me = '".Database::escape_string($visibilityRule)."',
12001177
$documentCondition
12011178
max_student = ".intval($maximum_number_of_students)."
12021179
WHERE iid = $id";
@@ -2596,9 +2573,7 @@ public static function importCategoriesAndGroupsFromArray($groupData, $deleteNot
25962573
$data['self_unreg_allowed'],
25972574
$data['max_student'],
25982575
$data['groups_per_user'],
2599-
$data['document_access'],
2600-
$data['allow_change_group_name'],
2601-
$data['only_me']
2576+
$data['document_access']
26022577
);
26032578
$data['category_id'] = $categoryId;
26042579
$result['updated']['category'][] = $data;
@@ -2617,10 +2592,7 @@ public static function importCategoriesAndGroupsFromArray($groupData, $deleteNot
26172592
$data['self_reg_allowed'],
26182593
$data['self_unreg_allowed'],
26192594
$data['max_student'],
2620-
$data['groups_per_user'],
2621-
$data['document_access'] ?? 0,
2622-
$data['allow_change_group_name'],
2623-
$data['only_me']
2595+
$data['groups_per_user']
26242596
);
26252597

26262598
if ($categoryId) {

0 commit comments

Comments
 (0)