From bbb6965778f345c082bb66c58cf93a845f457d31 Mon Sep 17 00:00:00 2001 From: NicoDucou Date: Thu, 6 Jun 2024 09:49:36 +0200 Subject: [PATCH] Session: fix various name to title missing adaptation --- .../main/admin/add_sessions_to_promotion.php | 2 +- .../main/admin/add_sessions_to_usergroup.php | 4 ++-- .../admin/dashboard_add_sessions_to_user.php | 20 +++++++++---------- public/main/inc/lib/exercise.lib.php | 2 +- public/main/my_space/ti_report.php | 2 +- public/main/session/session_list_custom.php | 4 ++-- public/main/social/my_skills_report.php | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/public/main/admin/add_sessions_to_promotion.php b/public/main/admin/add_sessions_to_promotion.php index 7030988e1c0..6ec01e31d16 100644 --- a/public/main/admin/add_sessions_to_promotion.php +++ b/public/main/admin/add_sessions_to_promotion.php @@ -335,7 +335,7 @@ function search_sessions($needle, $type) $return = ''; if (!empty($needle) && !empty($type)) { $session_list = SessionManager::get_sessions_list( - ['s.name' => ['operator' => 'LIKE', 'value' => "$needle%"]] + ['s.title' => ['operator' => 'LIKE', 'value' => "$needle%"]] ); $return .= ''; @@ -205,17 +205,17 @@ function remove_item(origin) { } if (api_is_multiple_url_enabled()) { - $sql = "SELECT s.id, s.name + $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.name LIKE '$needle%' $without_assigned_sessions AND + s.title LIKE '$needle%' $without_assigned_sessions AND access_url_id = ".api_get_current_access_url_id().' - ORDER BY s.name'; + ORDER BY s.title'; } else { - $sql = "SELECT s.id, s.name FROM $tbl_session s - WHERE s.name LIKE '$needle%' $without_assigned_sessions - ORDER BY s.name"; + $sql = "SELECT s.id, s.title FROM $tbl_session s + WHERE s.title LIKE '$needle%' $without_assigned_sessions + ORDER BY s.title"; } $result = Database::query($sql); ?> diff --git a/public/main/inc/lib/exercise.lib.php b/public/main/inc/lib/exercise.lib.php index ca510671ff9..9f6eb740acb 100644 --- a/public/main/inc/lib/exercise.lib.php +++ b/public/main/inc/lib/exercise.lib.php @@ -1617,7 +1617,7 @@ public static function showTestsWhereQuestionIsUsed(int $questionId, int $exclud $sql = "SELECT qz.title quiz_title, c.title course_title, - s.name session_name, + s.title session_name, qz.iid as quiz_id, qz.c_id, qz.session_id diff --git a/public/main/my_space/ti_report.php b/public/main/my_space/ti_report.php index 1491d8fd44a..71d5a90728a 100644 --- a/public/main/my_space/ti_report.php +++ b/public/main/my_space/ti_report.php @@ -82,7 +82,7 @@ $second = DateTime::createFromFormat('Y-m-d', $endDate); $numberOfWeeks = floor($first->diff($second)->days / 7); - $sql = "SELECT sru.user_id, s.name, s.id as session_id, s.display_start_date, s.display_end_date + $sql = "SELECT sru.user_id, s.title, s.id as session_id, s.display_start_date, s.display_end_date FROM $tblSession s LEFT JOIN $tblSessionRelUser sru ON (sru.session_id = s.id AND sru.relation_type = ".Session::GENERAL_COACH.") diff --git a/public/main/session/session_list_custom.php b/public/main/session/session_list_custom.php index ed76250c5a2..6fa5c368ace 100644 --- a/public/main/session/session_list_custom.php +++ b/public/main/session/session_list_custom.php @@ -80,14 +80,14 @@ $filter->groupOp = 'OR'; $filter = json_encode($filter); - $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_force_search=true&rows=20&page=1&sidx=&sord=asc&filters='.$filter.'&searchField=s.name&searchString='.Security::remove_XSS($_REQUEST['keyword']).'&searchOper=in'; + $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_force_search=true&rows=20&page=1&sidx=&sord=asc&filters='.$filter.'&searchField=s.title&searchString='.Security::remove_XSS($_REQUEST['keyword']).'&searchOper=in'; } if (isset($_REQUEST['id_category'])) { $sessionCategory = SessionManager::get_session_category($_REQUEST['id_category']); if (!empty($sessionCategory)) { //Begin with see the searchOper param - $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_force_search=true&rows=20&page=1&sidx=&sord=asc&filters=&searchField=sc.name&searchString='.Security::remove_XSS($sessionCategory['name']).'&searchOper=in'; + $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_sessions&_force_search=true&rows=20&page=1&sidx=&sord=asc&filters=&searchField=sc.title&searchString='.Security::remove_XSS($sessionCategory['name']).'&searchOper=in'; } } diff --git a/public/main/social/my_skills_report.php b/public/main/social/my_skills_report.php index 38ceb39e64e..1244917d7f8 100644 --- a/public/main/social/my_skills_report.php +++ b/public/main/social/my_skills_report.php @@ -74,7 +74,7 @@ if ($frmStudents->validate()) { $selectedStudent = (int) $frmStudents->exportValue('student'); - $sql = "SELECT s.name, sru.acquired_skill_at, c.title, c.directory, c.id as course_id + $sql = "SELECT s.title, sru.acquired_skill_at, c.title, c.directory, c.id as course_id FROM $skillTable s INNER JOIN $skillRelUserTable sru ON s.id = sru.skill_id @@ -88,7 +88,7 @@ while ($resultData = Database::fetch_assoc($result)) { $tableRow = [ 'complete_name' => $followedStudents[$selectedStudent]['completeName'], - 'skill_name' => SkillModel::translateName($resultData['name']), + 'skill_name' => SkillModel::translateName($resultData['title']), 'achieved_at' => api_format_date($resultData['acquired_skill_at'], DATE_FORMAT_NUMBER), 'course_image' => Display::return_icon( 'course.png',