diff --git a/.env.dist b/.env.dist index ba83d89b7d..7cdb85c292 100644 --- a/.env.dist +++ b/.env.dist @@ -33,8 +33,6 @@ APP_LOCALE='en_US' APP_CUSTOM_VUE_TEMPLATE='0' -APP_MULTIPLE_ACCESS_URL='' - GOOGLE_MAPS_API_KEY='' #APP_API_PLATFORM_URL='http://localhost/api/' #deprecated diff --git a/assets/css/scss/atoms/_toast.scss b/assets/css/scss/atoms/_toast.scss index 6d3dc34620..23198e65e9 100644 --- a/assets/css/scss/atoms/_toast.scss +++ b/assets/css/scss/atoms/_toast.scss @@ -1,5 +1,5 @@ .p-toast { - @apply whitespace-pre-line break-words opacity-90 w-96; + @apply whitespace-pre-line break-words opacity-90 min-w-96; &.p-toast-top-center, &.p-toast-bottom-center { @apply -translate-x-1/2; @@ -52,7 +52,7 @@ @apply bg-warning text-gray-90 border-0; .p-toast-message-icon, .p-toast-icon-close { - @apply bg-gray-90; + @apply text-gray-90; } } @@ -65,14 +65,14 @@ } .p-toast-message-content { - @apply flex items-center p-4 border-0; + @apply flex items-start p-4 border-0; .p-toast-message-text { - @apply flex-auto m-0 ml-4; + @apply flex-auto m-0 ml-4 self-center; } .p-toast-message-icon { - @apply shrink-0 text-body-1; + @apply shrink-0 text-2xl; &.p-icon { @apply w-8 h-8; diff --git a/public/main/admin/course_edit.php b/public/main/admin/course_edit.php index 0ec8c7aede..14b6baa03e 100644 --- a/public/main/admin/course_edit.php +++ b/public/main/admin/course_edit.php @@ -59,19 +59,14 @@ while ($obj = Database::fetch_object($res)) { } // Get all possible teachers without the course teachers -if (api_is_multiple_url_enabled()) { - $access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); - $sql = "SELECT u.id as user_id,lastname,firstname - FROM $table_user as u - INNER JOIN $access_url_rel_user_table url_rel_user - ON (u.id=url_rel_user.user_id) - WHERE - url_rel_user.access_url_id = $urlId AND - status = 1".$order_clause; -} else { - $sql = "SELECT id as user_id, lastname, firstname - FROM $table_user WHERE status='1'".$order_clause; -} +$access_url_rel_user_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); +$sql = "SELECT u.id as user_id,lastname,firstname + FROM $table_user as u + INNER JOIN $access_url_rel_user_table url_rel_user + ON (u.id=url_rel_user.user_id) + WHERE + url_rel_user.access_url_id = $urlId AND + status = 1".$order_clause; $courseInfo['tutor_name'] = null; $res = Database::query($sql); diff --git a/public/main/admin/course_information.php b/public/main/admin/course_information.php index 40b74704e1..0a26fc89d4 100644 --- a/public/main/admin/course_information.php +++ b/public/main/admin/course_information.php @@ -138,17 +138,15 @@ echo Display::page_header(get_lang('Users')); $table_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER); $table_user = Database::get_main_table(TABLE_MAIN_USER); $sql = "SELECT *, cu.status as course_status - FROM $table_course_user cu, $table_user u"; -if (api_is_multiple_url_enabled()) { - $sql .= " INNER JOIN ".Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER)." url_rel_user - ON - u.id = url_rel_user.user_id AND - url_rel_user.access_url_id = ".api_get_current_access_url_id(); -} -$sql .= " WHERE - cu.user_id = u.id AND - cu.c_id = '".$courseId."' AND - cu.relation_type <> ".COURSE_RELATION_TYPE_RRHH; + FROM $table_course_user cu, $table_user u + INNER JOIN ".Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER)." url_rel_user + ON + u.id = url_rel_user.user_id AND + url_rel_user.access_url_id = ".api_get_current_access_url_id()." + WHERE + cu.user_id = u.id AND + cu.c_id = '".$courseId."' AND + cu.relation_type <> ".COURSE_RELATION_TYPE_RRHH; $res = Database::query($sql); $is_western_name_order = api_is_western_name_order(); if (Database::num_rows($res) > 0) { diff --git a/public/main/admin/course_list.php b/public/main/admin/course_list.php index 28dad9c0d1..2e3da2dcd9 100644 --- a/public/main/admin/course_list.php +++ b/public/main/admin/course_list.php @@ -80,9 +80,7 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc INNER JOIN $tblCourseCategory category ON course_rel_category.course_category_id = category.id "; } - if ((api_is_platform_admin() || api_is_session_admin()) && - api_is_multiple_url_enabled() && -1 != api_get_current_access_url_id() - ) { + if ((api_is_platform_admin() || api_is_session_admin())) { $access_url_rel_course_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); $sql .= " INNER JOIN $access_url_rel_course_table url_rel_course ON (course.id = url_rel_course.c_id)"; @@ -121,9 +119,7 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc } // Adding the filter to see the user's only of the current access_url. - if ((api_is_platform_admin() || api_is_session_admin()) && - api_is_multiple_url_enabled() && -1 != api_get_current_access_url_id() - ) { + if ((api_is_platform_admin() || api_is_session_admin())) { $sql .= ' AND url_rel_course.access_url_id='.api_get_current_access_url_id(); } diff --git a/public/main/admin/course_list_admin.php b/public/main/admin/course_list_admin.php index c2d6cc142d..14cf4df4c0 100644 --- a/public/main/admin/course_list_admin.php +++ b/public/main/admin/course_list_admin.php @@ -73,11 +73,10 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc } $sql = "$select FROM $table course"; - if (api_is_multiple_url_enabled()) { - $access_url_rel_course_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); - $sql .= " INNER JOIN $access_url_rel_course_table url_rel_course - ON (course.id = url_rel_course.c_id)"; - } + + $access_url_rel_course_table = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); + $sql .= " INNER JOIN $access_url_rel_course_table url_rel_course + ON (course.id = url_rel_course.c_id)"; $tableCourseRelUser = Database::get_main_table(TABLE_MAIN_COURSE_USER); $sql .= " @@ -119,9 +118,7 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc } // Adding the filter to see the user's only of the current access_url. - if (api_is_multiple_url_enabled()) { - $sql .= " AND url_rel_course.access_url_id = ".api_get_current_access_url_id(); - } + $sql .= " AND url_rel_course.access_url_id = ".api_get_current_access_url_id(); if ($addTeacherColumn) { $teachers = isset($_GET['course_teachers']) ? $_GET['course_teachers'] : []; diff --git a/public/main/admin/dashboard_add_courses_to_user.php b/public/main/admin/dashboard_add_courses_to_user.php index 57ece1d46f..5a938ebca9 100644 --- a/public/main/admin/dashboard_add_courses_to_user.php +++ b/public/main/admin/dashboard_add_courses_to_user.php @@ -76,21 +76,13 @@ function search_courses($needle, $type) $without_assigned_courses = ' AND c.code NOT IN('.implode(',', $assigned_courses_code).')'; } - if (api_is_multiple_url_enabled()) { - $sql = "SELECT c.code, c.title - FROM $tbl_course c - LEFT JOIN $tbl_course_rel_access_url a - ON (a.c_id = c.id) - WHERE - c.code LIKE '$needle%' $without_assigned_courses AND - access_url_id = ".api_get_current_access_url_id(); - } else { - $sql = "SELECT c.code, c.title - FROM $tbl_course c - WHERE - c.code LIKE '$needle%' - $without_assigned_courses "; - } + $sql = "SELECT c.code, c.title + FROM $tbl_course c + LEFT JOIN $tbl_course_rel_access_url a + ON (a.c_id = c.id) + WHERE + c.code LIKE '$needle%' $without_assigned_courses AND + access_url_id = ".api_get_current_access_url_id(); $rs = Database::query($sql); @@ -205,21 +197,14 @@ if (isset($_POST['firstLetterCourse'])) { $needle = Database::escape_string($firstLetter.'%'); } -if (api_is_multiple_url_enabled()) { - $sql = " SELECT c.code, c.title - FROM $tbl_course c - LEFT JOIN $tbl_course_rel_access_url a - ON (a.c_id = c.id) - WHERE - c.code LIKE '$needle' $without_assigned_courses AND - access_url_id = ".api_get_current_access_url_id().' - ORDER BY c.title'; -} else { - $sql = " SELECT c.code, c.title - FROM $tbl_course c - WHERE c.code LIKE '$needle' $without_assigned_courses - ORDER BY c.title"; -} +$sql = " SELECT c.code, c.title + FROM $tbl_course c + LEFT JOIN $tbl_course_rel_access_url a + ON (a.c_id = c.id) + WHERE + c.code LIKE '$needle' $without_assigned_courses AND + access_url_id = ".api_get_current_access_url_id().' + ORDER BY c.title'; $result = Database::query($sql); diff --git a/public/main/admin/dashboard_add_sessions_to_user.php b/public/main/admin/dashboard_add_sessions_to_user.php index f3c47eeaf9..6170bfe950 100644 --- a/public/main/admin/dashboard_add_sessions_to_user.php +++ b/public/main/admin/dashboard_add_sessions_to_user.php @@ -74,17 +74,12 @@ function search_sessions($needle, $type) $without_assigned_sessions = ' AND s.id NOT IN('.implode(',', $assigned_sessions_id).')'; } - if (api_is_multiple_url_enabled()) { - $sql = " SELECT s.id, s.title FROM $tbl_session s - LEFT JOIN $tbl_session_rel_access_url a - ON (s.id = a.session_id) - WHERE - s.title LIKE '$needle%' $without_assigned_sessions AND - access_url_id = ".api_get_current_access_url_id(); - } else { - $sql = "SELECT s.id, s.title FROM $tbl_session s - WHERE s.title LIKE '$needle%' $without_assigned_sessions "; - } + $sql = " SELECT s.id, s.title FROM $tbl_session s + LEFT JOIN $tbl_session_rel_access_url a + ON (s.id = a.session_id) + WHERE + s.title LIKE '$needle%' $without_assigned_sessions AND + access_url_id = ".api_get_current_access_url_id(); $rs = Database::query($sql); $return .= '