Browse Source

Filter empty students list with student boss - refs BT#9431

Angel Fernando Quiroz Campos 10 years ago
parent
commit
8b5f2c7f37
1 changed files with 15 additions and 0 deletions
  1. 15 0
      main/inc/ajax/model.ajax.php

+ 15 - 0
main/inc/ajax/model.ajax.php

@@ -276,6 +276,11 @@ switch ($action) {
             $sessionIdList = array_unique($sessionIdList);
         }
 
+        if (api_is_student_boss() && empty($userIdList)) {
+            $count = 0;
+            break;
+        }
+
         if ($action == 'get_user_course_report') {
             $count = CourseManager::get_count_user_list_from_course_code(
                 false,
@@ -580,6 +585,11 @@ switch ($action) {
             //$sidx = 'training_hours';
         }
 
+        if (api_is_student_boss() && empty($userIdList)) {
+            $result = [];
+            break;
+        }
+
         $result = CourseManager::get_user_list_from_course_code(
             null,
             null,
@@ -634,6 +644,11 @@ switch ($action) {
             $sidx = 'title';
         }
 
+        if (api_is_student_boss() && empty($userIdList)) {
+            $result = [];
+            break;
+        }
+
         $result = CourseManager::get_user_list_from_course_code(
             null,
             null,