diff --git a/main/inc/lib/auth.lib.php b/main/inc/lib/auth.lib.php index cd978c0293..42720b1e8a 100644 --- a/main/inc/lib/auth.lib.php +++ b/main/inc/lib/auth.lib.php @@ -429,8 +429,7 @@ class Auth $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); $TABLE_COURSE_FIELD = Database::get_main_table(TABLE_MAIN_COURSE_FIELD); $TABLE_COURSE_FIELD_VALUE = Database::get_main_table(TABLE_MAIN_COURSE_FIELD_VALUES); - $table_course_ranking = Database::get_main_table(TABLE_STATISTIC_TRACK_COURSE_RANKING); - + // get course list auto-register $sql = "SELECT course_code FROM $TABLE_COURSE_FIELD_VALUE tcfv INNER JOIN $TABLE_COURSE_FIELD tcf ON tcfv.field_id = tcf.id @@ -487,10 +486,8 @@ class Auth if ($row['tutor_name'] == '0') { $row['tutor_name'] = get_lang('NoManager'); - } - - $point_info = CourseManager::get_course_ranking($row['id'], 0); - + } + $point_info = CourseManager::get_course_ranking($row['id'], 0); $courses[] = array( 'real_id' => $row['id'], 'point_info' => $point_info, @@ -504,6 +501,7 @@ class Auth 'unsubscribe' => $row['unsubscribe'], 'registration_code' => $row['registration_code'], 'creation_date' => $row['creation_date'], + 'visibility' => $row['visibility'], 'count_users' => $count_users, 'count_connections' => $count_connections_last_month ); diff --git a/main/template/default/auth/courses_categories.php b/main/template/default/auth/courses_categories.php index 7c504d98ee..a5f41949d0 100644 --- a/main/template/default/auth/courses_categories.php +++ b/main/template/default/auth/courses_categories.php @@ -31,15 +31,13 @@ $stok = Security::get_token(); -
- -
- - - -   -
-
+
+
'.get_lang('RandomPick').''; - $code = ''; - } else { - }*/ + if (!empty($browse_course_categories)) { echo ''.get_lang('RandomPick').'

'; // level 1 @@ -110,6 +103,7 @@ $stok = Security::get_token(); ?>
+
'; - + echo '
'; echo '
'; echo '
'; if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') { @@ -159,8 +152,8 @@ $stok = Security::get_token(); echo '

'; // we display the icon to subscribe or the text already subscribed - if (!in_array($course['code'], $user_coursecodes)) { - + + if (!in_array($course['code'], $user_coursecodes) || empty($user_coursecodes)) { if ($course['visibility'] == COURSE_VISIBILITY_OPEN_WORLD || ($course['visibility'] == COURSE_VISIBILITY_OPEN_PLATFORM && !api_is_anonymous())) { echo ''.get_lang('GoToCourse').''; } else {