diff --git a/main/admin/add_many_session_to_category.php b/main/admin/add_many_session_to_category.php index e535a78acf..64632a3858 100644 --- a/main/admin/add_many_session_to_category.php +++ b/main/admin/add_many_session_to_category.php @@ -144,7 +144,13 @@ if (empty($rows_session_category)) { exit; } -$sql = "SELECT id, name FROM $tbl_session $where ORDER BY name"; +if (api_get_multiple_access_url()) { + $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); + $access_url_id = api_get_current_access_url_id(); + $sql = "SELECT s.id, s.name FROM $tbl_session s INNER JOIN $table_access_url_rel_session u ON s.id = u.session_id $where AND u.access_url_id = $access_url_id ORDER BY name"; +} else { + $sql = "SELECT id, name FROM $tbl_session $where ORDER BY name"; +} $result=Database::query($sql); $rows_session = Database::store_result($result); ?>