#6344 - In Course>Users>Usergroups, add a action button for usergroups to have the preview list members#6880
#6344 - In Course>Users>Usergroups, add a action button for usergroups to have the preview list members#6880chamilo-uga wants to merge 5 commits intochamilo:masterfrom
Conversation
| } | ||
| } | ||
|
|
||
| public function unsubscribe_only_courses_from_usergroup($usergroup_id, $delete_items, $sessionId = 0) |
There was a problem hiding this comment.
PHPDoc block needed to document the method
There was a problem hiding this comment.
Method should provide a return type
ywarnier
left a comment
There was a problem hiding this comment.
In general, please try using even more the code from src/ rather than using code from legacy libraries. This will help us move faster to remove/migrate all legacy code.
Please see and attend change requests before we merge.
| $groupId = isset($_GET['id']) ? (int) $_GET['id'] : 0; | ||
| foreach ($delete_items as $course_id) { | ||
| $course_info = api_get_course_info_by_id($course_id); | ||
| if ($course_info) { |
There was a problem hiding this comment.
This is inefficient. api_get_course_info_by_id() is a heavy function. Please just replace by a validation that $course_id is an int, and that should be enough (worst case: the course_id is not present in usergroup_rel_course and the delete fails but does not break the process).
There was a problem hiding this comment.
$course_info['code'] is used in function CourseManager::unsubscribe_user we use
| ); | ||
| } | ||
| if (0 != $sessionId && 0 != $groupId) { | ||
| $this->subscribe_sessions_to_usergroup($groupId, [0]); |
There was a problem hiding this comment.
You cannot add a "subscribe*()" call inside a method that is called "unsubscribe_only_courses_from_usergroup()". What is the goal here ?
| if (0 != $sessionId && 0 != $groupId) { | ||
| $this->subscribe_sessions_to_usergroup($groupId, [0]); | ||
| } else { | ||
| $s = $sessionId; |
There was a problem hiding this comment.
This $s is never used. It should either be removed or used and documented.
| @@ -0,0 +1,72 @@ | |||
| <?php | |||
| @@ -0,0 +1,30 @@ | |||
| <?php | |||
There was a problem hiding this comment.
This code should go into a new file called UsergroupController.php rather than ClassController.php (we don't use the term "Class" in the code anymore).
| /** | ||
| * @author Julio Montoya <gugli100@gmail.com> | ||
| */ | ||
| #[Route('/user')] |
There was a problem hiding this comment.
Removing /user is not a super nice idea. Better leave it and use /user/overview as path for overview().
Paths with "main" are only kept until all the legacy code is migrated to Vue
| @@ -0,0 +1,98 @@ | |||
| {% extends "@ChamiloCore/Layout/base-layout.html.twig" %} | |||
There was a problem hiding this comment.
Please move to src/CoreBundle/Resources/views/Usergroup/overview.html.twig
See #6344
the goal is to allow teachers to quickly have a full users list page of members of a class registered to a course.
It is a very simple and basic overview page with