diff --git a/assets/vue/components/Breadcrumb.vue b/assets/vue/components/Breadcrumb.vue index 166ea67a24..1a9b71c0f9 100644 --- a/assets/vue/components/Breadcrumb.vue +++ b/assets/vue/components/Breadcrumb.vue @@ -117,7 +117,7 @@ const foo = computed(() => { let sessionTitle = "" if (session.value) { - sessionTitle = " (" + session.value.name + ") " + sessionTitle = " (" + session.value.title + ") " } items.push({ diff --git a/assets/vue/components/course/CourseCard.vue b/assets/vue/components/course/CourseCard.vue index d1845d218d..f6d9f6546f 100644 --- a/assets/vue/components/course/CourseCard.vue +++ b/assets/vue/components/course/CourseCard.vue @@ -17,7 +17,7 @@ class="course-card__home-link" > - {{ session.name }} - + {{ session.title }} - {{ course.title }} diff --git a/assets/vue/components/course/ShortCutList.vue b/assets/vue/components/course/ShortCutList.vue index e29e150911..8f1fc1c578 100644 --- a/assets/vue/components/course/ShortCutList.vue +++ b/assets/vue/components/course/ShortCutList.vue @@ -4,7 +4,7 @@
@@ -13,7 +13,7 @@
- {{ shortcut.name }} + {{ shortcut.title }}
diff --git a/assets/vue/components/coursecategory/Filter.vue b/assets/vue/components/coursecategory/Filter.vue index 8c4df7aa91..4d1d03b0f2 100644 --- a/assets/vue/components/coursecategory/Filter.vue +++ b/assets/vue/components/coursecategory/Filter.vue @@ -3,7 +3,7 @@ diff --git a/assets/vue/components/coursecategory/Form.vue b/assets/vue/components/coursecategory/Form.vue index 8e8312869f..d3416d31d0 100644 --- a/assets/vue/components/coursecategory/Form.vue +++ b/assets/vue/components/coursecategory/Form.vue @@ -4,12 +4,12 @@ @@ -72,11 +72,11 @@ export default { nameErrors() { const errors = []; - if (!this.$v.item.name.$dirty) return errors; + if (!this.$v.item.title.$dirty) return errors; - has(this.violations, 'name') && errors.push(this.violations.name); + has(this.violations, 'title') && errors.push(this.violations.title); - !this.$v.item.name.required && errors.push(this.$t('Field is required')); + !this.$v.item.title.required && errors.push(this.$t('Field is required')); return errors; }, diff --git a/assets/vue/components/glossary/GlossaryForm.vue b/assets/vue/components/glossary/GlossaryForm.vue index 4e12961b51..1b5d81a920 100644 --- a/assets/vue/components/glossary/GlossaryForm.vue +++ b/assets/vue/components/glossary/GlossaryForm.vue @@ -2,8 +2,8 @@
{ } try { const glossary = await glossaryService.getGlossaryTerm(props.termId) - formData.name = glossary.name + formData.name = glossary.title formData.description = glossary.description } catch (error) { console.error("Error glossary term:", error) @@ -108,7 +108,7 @@ const submitGlossaryForm = async () => { } const postData = { - name: formData.name, + title: formData.name, description: formData.description, parentResourceNodeId: parentResourceNodeId.value, resourceLinkList: resourceLinkList.value, diff --git a/assets/vue/components/glossary/GlossaryTermList.vue b/assets/vue/components/glossary/GlossaryTermList.vue index fd99721ea1..2ced8801b5 100644 --- a/assets/vue/components/glossary/GlossaryTermList.vue +++ b/assets/vue/components/glossary/GlossaryTermList.vue @@ -10,7 +10,7 @@ @@ -284,4 +284,4 @@ export default { }, }, } - \ No newline at end of file + diff --git a/assets/vue/views/course/CatalogSession.vue b/assets/vue/views/course/CatalogSession.vue index aec384187a..9b6e73ea1d 100644 --- a/assets/vue/views/course/CatalogSession.vue +++ b/assets/vue/views/course/CatalogSession.vue @@ -3,7 +3,7 @@ - {{ data.category.name }} + {{ data.category.title }} @@ -125,7 +125,7 @@ @@ -279,4 +279,4 @@ export default { }, }, } - \ No newline at end of file + diff --git a/assets/vue/views/course/CourseHome.vue b/assets/vue/views/course/CourseHome.vue index 340e662d3a..449b6a4b47 100644 --- a/assets/vue/views/course/CourseHome.vue +++ b/assets/vue/views/course/CourseHome.vue @@ -78,7 +78,7 @@

{{ course.title }} - ({{ session.name }}) + ({{ session.title }})

@@ -182,7 +182,7 @@ :key="'tool-' + index.toString()" :change-visibility="changeVisibility" :data-index="index" - :data-tool="tool.name" + :data-tool="tool.title" :go-to-setting-course-tool="goToSettingCourseTool" :tool="tool" /> @@ -251,7 +251,7 @@ const routerTools = ["document", "link", "glossary", "agenda", "student_publicat courseService.loadCTools(course.value.id, session.value?.id) .then((cTools) => { tools.value = cTools.map(element => { - if (routerTools.includes(element.name)) { + if (routerTools.includes(element.title)) { element.to = element.url } @@ -294,7 +294,7 @@ const toggleCourseTMenu = (event) => { } function goToSettingCourseTool(tool) { - return "/course/" + course.value.id + "/settings/" + tool.tool.name + "?sid=" + session.value?.id + return "/course/" + course.value.id + "/settings/" + tool.tool.title + "?sid=" + session.value?.id } function goToShortCut(shortcut) { @@ -361,7 +361,7 @@ async function updateDisplayOrder(htmlItem, newIndex) { if (typeof tools !== "undefined" && Array.isArray(tools.value)) { const toolList = tools.value - toolItem = toolList.find((element) => element.name === tool) + toolItem = toolList.find((element) => element.title === tool) } else { console.error("Error: tools.value is undefined") return diff --git a/assets/vue/views/course/Home.vue b/assets/vue/views/course/Home.vue new file mode 100644 index 0000000000..ef2172e160 --- /dev/null +++ b/assets/vue/views/course/Home.vue @@ -0,0 +1,419 @@ + + + diff --git a/assets/vue/views/course/Show.vue b/assets/vue/views/course/Show.vue index d41c10d7b2..7bcc9c1e61 100644 --- a/assets/vue/views/course/Show.vue +++ b/assets/vue/views/course/Show.vue @@ -53,7 +53,7 @@
- {{ item["category"].name }} + {{ item["category"].title }}
-
@@ -129,4 +129,4 @@ export default { }), }, } - \ No newline at end of file + diff --git a/assets/vue/views/coursecategory/List.vue b/assets/vue/views/coursecategory/List.vue index 8ad5aa5e83..0edc128332 100644 --- a/assets/vue/views/coursecategory/List.vue +++ b/assets/vue/views/coursecategory/List.vue @@ -74,7 +74,7 @@ export default { data() { return { headers: [ - { text: "name", value: "name" }, + { text: "title", value: "title" }, { text: "code", value: "code" }, //{ text: 'description', value: 'description' }, { @@ -106,4 +106,4 @@ export default { }), }, } - \ No newline at end of file + diff --git a/assets/vue/views/coursecategory/Show.vue b/assets/vue/views/coursecategory/Show.vue index 78b6cd6a52..711af669cd 100644 --- a/assets/vue/views/coursecategory/Show.vue +++ b/assets/vue/views/coursecategory/Show.vue @@ -32,7 +32,7 @@ {{ $t("name") }} - {{ item["name"] }} + {{ item["title"] }} @@ -93,4 +93,4 @@ export default { }), }, } - \ No newline at end of file + diff --git a/assets/vue/views/ctoolintro/Show.vue b/assets/vue/views/ctoolintro/Show.vue index 50415f3bd8..b3553c7a13 100644 --- a/assets/vue/views/ctoolintro/Show.vue +++ b/assets/vue/views/ctoolintro/Show.vue @@ -53,7 +53,7 @@
- {{ item["category"].name }} + {{ item["category"].title }}
-
@@ -129,4 +129,4 @@ export default { }), }, } - \ No newline at end of file + diff --git a/assets/vue/views/documents/DocumentForHtmlEditor.vue b/assets/vue/views/documents/DocumentForHtmlEditor.vue index 822a15a8e6..554a07e485 100644 --- a/assets/vue/views/documents/DocumentForHtmlEditor.vue +++ b/assets/vue/views/documents/DocumentForHtmlEditor.vue @@ -111,7 +111,7 @@ class="p-fluid" >
- + \ No newline at end of file + diff --git a/assets/vue/views/documents/DocumentsList.vue b/assets/vue/views/documents/DocumentsList.vue index bac8678254..bea3816bab 100644 --- a/assets/vue/views/documents/DocumentsList.vue +++ b/assets/vue/views/documents/DocumentsList.vue @@ -221,12 +221,12 @@ :class="{ 'p-invalid': submitted && !item.title }" autocomplete="off" autofocus - name="name" + name="title" required="true" />
{ if (!resourceNode.value) { return false } - return resourceNode.value.resourceType.name !== "courses" + return resourceNode.value.resourceType.title !== "courses" }) function back() { diff --git a/assets/vue/views/glossary/GlossaryList.vue b/assets/vue/views/glossary/GlossaryList.vue index c1dcfaaf2e..59d7b35929 100644 --- a/assets/vue/views/glossary/GlossaryList.vue +++ b/assets/vue/views/glossary/GlossaryList.vue @@ -157,7 +157,7 @@ const termToDeleteString = computed(() => { if (termToDelete.value === null) { return "" } - return termToDelete.value.name + return termToDelete.value.title }) onMounted(() => { diff --git a/assets/vue/views/links/LinksList.vue b/assets/vue/views/links/LinksList.vue index cac430cada..bfb17d1f79 100644 --- a/assets/vue/views/links/LinksList.vue +++ b/assets/vue/views/links/LinksList.vue @@ -92,7 +92,7 @@ icon="folder-generic" size="big" /> -
{{ category.info.name }}
+
{{ category.info.title }}
-

{{ categoryToDelete.info.name }}

+

{{ categoryToDelete.info.title }}

{{ t("With links") }}: {{ (categoryToDelete.links || []).map((l) => l.title).join(", ") }}

diff --git a/assets/vue/views/page/List.vue b/assets/vue/views/page/List.vue index 18f632182f..dd8e131795 100644 --- a/assets/vue/views/page/List.vue +++ b/assets/vue/views/page/List.vue @@ -109,7 +109,7 @@ />
{ deleteItemDialog.value = false } - \ No newline at end of file + diff --git a/assets/vue/views/personalfile/List.vue b/assets/vue/views/personalfile/List.vue index 29f4867334..539844affa 100644 --- a/assets/vue/views/personalfile/List.vue +++ b/assets/vue/views/personalfile/List.vue @@ -155,7 +155,7 @@ class="p-fluid" >
- + \ No newline at end of file + diff --git a/assets/vue/views/usergroup/List.vue b/assets/vue/views/usergroup/List.vue index ec941038ce..81d0f22894 100644 --- a/assets/vue/views/usergroup/List.vue +++ b/assets/vue/views/usergroup/List.vue @@ -224,7 +224,7 @@ class="p-fluid" >
- + \ No newline at end of file + diff --git a/public/main/admin/career_dashboard.php b/public/main/admin/career_dashboard.php index 9824f9644e..59e34b5ea6 100644 --- a/public/main/admin/career_dashboard.php +++ b/public/main/admin/career_dashboard.php @@ -93,7 +93,7 @@ if (!empty($careers)) { // Getting all promotions $promotions = $promotion->get_all_promotions_by_career_id( $career_item['id'], - 'name ASC' + 'title ASC' ); $career_content = ''; $promotion_array = []; @@ -117,13 +117,13 @@ if (!empty($careers)) { } $promotion_array[$promotion_item['id']] = [ 'id' => $promotion_item['id'], - 'name' => $promotion_item['name'], + 'name' => $promotion_item['title'], 'sessions' => $session_list, ]; } } $career_array[$career_item['id']] = [ - 'name' => $career_item['name'], + 'name' => $career_item['title'], 'promotions' => $promotion_array, ]; $careerList = [ diff --git a/public/main/admin/course_edit.php b/public/main/admin/course_edit.php index e35200512a..c7bf997bf0 100644 --- a/public/main/admin/course_edit.php +++ b/public/main/admin/course_edit.php @@ -152,7 +152,7 @@ $courseCategoryNames = []; $courseCategoryIds = []; foreach ($categories as $category) { - $courseCategoryNames[$category->getId()] = $category->getName(); + $courseCategoryNames[$category->getId()] = $category->getTitle(); $courseCategoryIds[] = $category->getId(); } diff --git a/public/main/admin/course_list.php b/public/main/admin/course_list.php index 004ab1dc7b..718bd4ca08 100644 --- a/public/main/admin/course_list.php +++ b/public/main/admin/course_list.php @@ -57,7 +57,7 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc $select = "SELECT course.code AS col0, - title AS col1, + course.title AS col1, course.code AS col2, course_language AS col3, subscribe AS col5, @@ -91,7 +91,7 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc if (isset($_GET['keyword'])) { $keyword = Database::escape_string('%'.trim($_GET['keyword']).'%'); $sql .= " WHERE ( - title LIKE '".$keyword."' OR + course.title LIKE '".$keyword."' OR course.code LIKE '".$keyword."' OR visual_code LIKE '".$keyword."' ) @@ -109,7 +109,7 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc $sql .= " WHERE (course.code LIKE '".$keyword_code."' OR visual_code LIKE '".$keyword_code."') AND - title LIKE '".$keyword_title."' AND + course.title LIKE '".$keyword_title."' AND course_language LIKE '".$keyword_language."' AND visibility LIKE '".$keyword_visibility."' AND subscribe LIKE '".$keyword_subscribe."' AND @@ -151,14 +151,14 @@ function get_course_data($from, $number_of_items, $column, $direction, $dataFunc $courseInfo = api_get_course_info_by_id($course['id']); // get categories - $sqlCategoriesByCourseId = "SELECT category.name FROM $tblCourseCategory category + $sqlCategoriesByCourseId = "SELECT category.title FROM $tblCourseCategory category INNER JOIN $tblCourseRelCategory course_rel_category ON category.id = course_rel_category.course_category_id WHERE course_rel_category.course_id = ".$course['id']; $resultCategories = Database::query($sqlCategoriesByCourseId); $categories = []; while ($category = Database::fetch_array($resultCategories)) { - $categories[] = $category['name']; + $categories[] = $category['title']; } // Place colour icons in front of courses. diff --git a/public/main/admin/course_request_accepted.php b/public/main/admin/course_request_accepted.php index d7f1b3bec4..15a83ce481 100644 --- a/public/main/admin/course_request_accepted.php +++ b/public/main/admin/course_request_accepted.php @@ -95,7 +95,7 @@ function get_request_data($from, $number_of_items, $column, $direction) $sql = "SELECT id AS col0, code AS col1, - title AS col2, + course.title AS col2, course_category.code AS col3, tutor_name AS col4, request_date AS col5, @@ -106,7 +106,7 @@ function get_request_data($from, $number_of_items, $column, $direction) if ('' != $keyword) { $sql .= " AND ( - title LIKE '%".$keyword."%' OR + course.title LIKE '%".$keyword."%' OR code LIKE '%".$keyword."%' OR visual_code LIKE '%".$keyword."%' )"; diff --git a/public/main/admin/gradebook_list.php b/public/main/admin/gradebook_list.php index 7b305cf4ee..cd132e3bba 100644 --- a/public/main/admin/gradebook_list.php +++ b/public/main/admin/gradebook_list.php @@ -122,7 +122,7 @@ switch ($action) { } $category = new GradebookCategory(); $category - ->setName($values['name']) + ->setTitle($values['name']) ->setWeight($values['weight']) ->setVisible(1) ->setLocked(0) @@ -222,7 +222,7 @@ switch ($action) { $form->addButtonSave(get_lang('Edit')); $defaults = [ - 'name' => $category->getName(), + 'name' => $category->getTitle(), 'weight' => $category->getWeight(), 'gradebooks_to_validate_in_dependence' => $categoryData['gradebooks_to_validate_in_dependence'], 'depends' => array_keys($options), @@ -232,7 +232,7 @@ switch ($action) { $contentForm = $form->returnForm(); if ($form->validate()) { $values = $form->getSubmitValues(); - $category->setName($values['name']); + $category->setTitle($values['name']); $category->setWeight($values['weight']); $em->persist($category); $em->flush(); diff --git a/public/main/admin/resource_sequence.php b/public/main/admin/resource_sequence.php index 09ec959282..149c775288 100644 --- a/public/main/admin/resource_sequence.php +++ b/public/main/admin/resource_sequence.php @@ -35,7 +35,7 @@ $em = Database::getManager(); if ($formSequence->validate()) { $values = $formSequence->exportValues(); $sequence = new Sequence(); - $sequence->setName($values['name']); + $sequence->setTitle($values['name']); $em->persist($sequence); $em->flush(); Display::addFlash(Display::return_message(get_lang('Saved'))); diff --git a/public/main/admin/teacher_time_report.php b/public/main/admin/teacher_time_report.php index db14c2ca23..d391ca1ee1 100644 --- a/public/main/admin/teacher_time_report.php +++ b/public/main/admin/teacher_time_report.php @@ -296,7 +296,7 @@ if (!empty($selectedTeacher)) { $timeReport->data[] = [ 'session' => [ 'id' => $session->getId(), - 'name' => $session->getName(), + 'name' => $session->getTitle(), ], 'course' => [ 'id' => $course->getId(), diff --git a/public/main/admin/teachers_time_by_session_report.php b/public/main/admin/teachers_time_by_session_report.php index 755d803fb9..36c0d73eb2 100644 --- a/public/main/admin/teachers_time_by_session_report.php +++ b/public/main/admin/teachers_time_by_session_report.php @@ -107,7 +107,7 @@ if (isset($_GET['export']) && $session && $coursesInfo && $usersInfo) { $fileName = get_lang('Teachers time report').' '.api_get_local_time(); $dataToExport = []; - $dataToExport[] = [$toolName, $session->getName()]; + $dataToExport[] = [$toolName, $session->getTitle()]; $dataToExport['headers'] = [ get_lang('Code'), get_lang('Coach name'), @@ -147,7 +147,7 @@ if (isset($_GET['export']) && $session && $coursesInfo && $usersInfo) { $contents[] = $course['time_spent_of_course']; } - $dataToExport[] = [get_lang('Session'), $session->getName()]; + $dataToExport[] = [get_lang('Session'), $session->getTitle()]; $dataToExport[] = $headers; $dataToExport[] = $contents; } @@ -174,7 +174,7 @@ $view = new Template($toolName); $view->assign('form', $form->returnForm()); if ($session) { - $view->assign('session', ['id' => $session->getId(), 'name' => $session->getName()]); + $view->assign('session', ['id' => $session->getId(), 'name' => $session->getTitle()]); $view->assign('courses', $coursesInfo); $view->assign('users', $usersInfo); diff --git a/public/main/admin/user_information.php b/public/main/admin/user_information.php index b06908f6b6..9881f55b3f 100644 --- a/public/main/admin/user_information.php +++ b/public/main/admin/user_information.php @@ -304,7 +304,7 @@ if (count($sessions) > 0) { $personal_course_list = []; $sessionId = $session->getId(); - $csvContent[] = [$session->getName()]; + $csvContent[] = [$session->getTitle()]; $csvContent[] = $headerList; foreach ($session->getCourses() as $sessionRelCourse) { $course = $sessionRelCourse->getCourse(); @@ -391,7 +391,7 @@ if (count($sessions) > 0) { ); $sessionInformation .= Display::page_subheader( ''. - $session->getName().'', + $session->getTitle().'', $certificateLink.' '.$dates['access'] ); @@ -695,7 +695,7 @@ if ('true' === api_get_setting('profile.allow_career_users')) { $table->setHeaderContents(0, 0, get_lang('Career')); $row = 1; foreach ($careers as $carerData) { - $table->setCellContents($row, 0, $carerData['name']); + $table->setCellContents($row, 0, $carerData['title']); $row++; } echo $table->toHtml(); diff --git a/public/main/announcements/announcements.php b/public/main/announcements/announcements.php index c6e9ea465d..f8f820159a 100644 --- a/public/main/announcements/announcements.php +++ b/public/main/announcements/announcements.php @@ -58,7 +58,7 @@ if (!empty($group_id)) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), - 'name' => get_lang('Group area').' '.$groupEntity->getName(), + 'name' => get_lang('Group area').' '.$groupEntity->getTitle(), ]; if (false === $allowToEdit) { diff --git a/public/main/attendance/index.php b/public/main/attendance/index.php index d847086b1e..d469226733 100644 --- a/public/main/attendance/index.php +++ b/public/main/attendance/index.php @@ -197,13 +197,13 @@ $interbreadcrumb[] = [ ]; if ($attendanceEntity) { - $interbreadcrumb[] = ['url' => '#', 'name' => $attendanceEntity->getName()]; + $interbreadcrumb[] = ['url' => '#', 'name' => $attendanceEntity->getTitle()]; } if ('calendar_list' === $action || 'calendar_edit' === $action) { $interbreadcrumb[] = [ 'url' => 'index.php?'.api_get_cidreq().'&action=attendance_sheet_list&attendance_id='.$attendanceId, - 'name' => $attendanceEntity->getName(), + 'name' => $attendanceEntity->getTitle(), ]; $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('Attendance calendar')]; } @@ -457,7 +457,7 @@ switch ($action) { $groupList = isset($_POST['groups']) ? [$_POST['groups']] : []; $interbreadcrumb[] = [ 'url' => 'index.php?'.api_get_cidreq().'&action=attendance_sheet_list&attendance_id='.$attendanceId, - 'name' => $attendanceEntity->getName(), + 'name' => $attendanceEntity->getTitle(), ]; $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('Add a date and time')]; diff --git a/public/main/auth/my_progress.php b/public/main/auth/my_progress.php index a8644d3ace..4fd92d10a7 100644 --- a/public/main/auth/my_progress.php +++ b/public/main/auth/my_progress.php @@ -123,7 +123,7 @@ if ($show) { $row = 1; foreach ($careers as $careerData) { - $table->setCellContents($row, 0, $careerData['name']); + $table->setCellContents($row, 0, $careerData['title']); $url = api_get_path(WEB_CODE_PATH).'user/career_diagram.php?career_id='.$careerData['id']; $diagram = Display::url(get_lang('Diagram'), $url); $table->setCellContents($row, 1, $diagram); diff --git a/public/main/course_progress/index.php b/public/main/course_progress/index.php index e8a6d35c9a..831b93c1ae 100644 --- a/public/main/course_progress/index.php +++ b/public/main/course_progress/index.php @@ -163,7 +163,7 @@ $attendance_list = $attendance->getAttendanceList($course, $session); $attendance_select = []; $attendance_select[0] = get_lang('Select an attendance'); foreach ($attendance_list as $attendanceEntity) { - $attendance_select[$attendanceEntity->getIid()] = $attendanceEntity->getName(); + $attendance_select[$attendanceEntity->getIid()] = $attendanceEntity->getTitle(); } $token = Security::get_token(); diff --git a/public/main/cron/course_finished.php b/public/main/cron/course_finished.php index 077fdb3a52..7931c3a1da 100644 --- a/public/main/cron/course_finished.php +++ b/public/main/cron/course_finished.php @@ -58,7 +58,7 @@ foreach ($sessions as $session) { $user = $sessionUser->getUser(); $subjectTemplate = new Template(null, false, false, false, false, false); - $subjectTemplate->assign('session_name', $session->getName()); + $subjectTemplate->assign('session_name', $session->getTitle()); $subjectLayout = $subjectTemplate->get_template( 'mail/cron_course_finished_subject.tpl' @@ -66,7 +66,7 @@ foreach ($sessions as $session) { $bodyTemplate = new Template(null, false, false, false, false, false); $bodyTemplate->assign('complete_user_name', UserManager::formatUserFullName($user)); - $bodyTemplate->assign('session_name', $session->getName()); + $bodyTemplate->assign('session_name', $session->getTitle()); $bodyLayout = $bodyTemplate->get_template( 'mail/cron_course_finished_body.tpl' @@ -83,7 +83,7 @@ foreach ($sessions as $session) { echo '============'.PHP_EOL; echo "Email sent to: ".UserManager::formatUserFullName($user)." ({$user->getEmail()})".PHP_EOL; - echo "Session: {$session->getName()}".PHP_EOL; + echo "Session: {$session->getTitle()}".PHP_EOL; echo "End date: {$session->getAccessEndDate()->format('Y-m-d h:i')}".PHP_EOL; } } diff --git a/public/main/dropbox/dropbox_functions.inc.php b/public/main/dropbox/dropbox_functions.inc.php index 255ab464d0..ab407d2499 100644 --- a/public/main/dropbox/dropbox_functions.inc.php +++ b/public/main/dropbox/dropbox_functions.inc.php @@ -207,7 +207,7 @@ function display_move_form( $options = ['0' => get_lang('root')]; foreach ($target as $category) { - $options[$category['cat_id']] = $category['cat_name']; + $options[$category['cat_id']] = $category['title']; } $form->addSelect('move_target', get_lang('Move file to'), $options); $form->addButtonMove(get_lang('Move the file'), 'do_move'); @@ -367,7 +367,7 @@ function store_addcategory() WHERE c_id = $course_id AND user_id='".$_user['user_id']."' AND - cat_name='".Database::escape_string($_POST['category_name'])."' AND + title='".Database::escape_string($_POST['category_name'])."' AND received='".$received."' AND sent='$sent' AND session_id='$session_id'"; @@ -378,7 +378,7 @@ function store_addcategory() $params = [ 'cat_id' => 0, 'c_id' => $course_id, - 'cat_name' => $_POST['category_name'], + 'title' => $_POST['category_name'], 'received' => $received, 'sent' => $sent, 'user_id' => $_user['user_id'], @@ -397,7 +397,7 @@ function store_addcategory() } } else { $params = [ - 'cat_name' => $_POST['category_name'], + 'title' => $_POST['category_name'], 'received' => $received, 'sent' => $sent, ]; @@ -446,7 +446,7 @@ function display_addcategory_form($category_name = '', $id = 0, $action = '') // after an edit with an error we do not want to return to the // original name but the name we already modified. // (happens when createinrecievedfiles AND createinsentfiles are not checked) - $category_name = $row['cat_name']; + $category_name = $row['title']; } if ('1' == $row['received']) { $target = 'received'; diff --git a/public/main/dropbox/index.php b/public/main/dropbox/index.php index c79243e389..5de49e8f49 100644 --- a/public/main/dropbox/index.php +++ b/public/main/dropbox/index.php @@ -249,7 +249,7 @@ if ('add' != $action) { $actions .= ''. Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')). ""; - $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).' '; + $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['title']).' '; $movelist[0] = 'Root'; // move_received selectbox content } else { $actions .= ''. @@ -261,7 +261,7 @@ if ('add' != $action) { if (0 != $view_dropbox_category_received && api_is_allowed_to_session_edit(false, true)) { $actions .= ''. Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')).""; - $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['cat_name']).' '; + $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_received]['title']).' '; $movelist[0] = 'Root'; // move_received selectbox content } else { $actions .= ''. @@ -293,7 +293,7 @@ if ('add' != $action) { $actions .= ''. Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')). ""; - $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).' '; + $actions .= get_lang('Category').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['title']).' '; } else { $actions .= "". Display::getMdiIcon(ActionIcon::CREATE_FOLDER, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Add a new folder'))."\n"; @@ -307,7 +307,7 @@ if ('add' != $action) { ""; } if (0 != $view_dropbox_category_sent) { - $actions .= get_lang('You are in folder').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['cat_name']).' '; + $actions .= get_lang('You are in folder').': '.Security::remove_XSS($dropbox_categories[$view_dropbox_category_sent]['title']).' '; $actions .= ''. Display::getMdiIcon(ActionIcon::UP, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Up').' '.get_lang('root')). ""; @@ -477,22 +477,22 @@ if ('add' != $action) { $dropbox_received_category array;*/ $dropbox_category_data = []; if ('1' == $category['received']) { - $movelist[$category['cat_id']] = $category['cat_name']; + $movelist[$category['cat_id']] = $category['title']; // This is where the checkbox icon for the files appear $dropbox_category_data[] = $category['cat_id']; // The icon of the category $link_open = ''; - $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['cat_name']).''; + $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', $category['title']).''; $dropbox_category_data[] = ''. - Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')).''.$link_open.$category['cat_name'].''; + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')).''.$link_open.$category['title'].''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''. Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).' - '. + '. Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''; } if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { @@ -657,19 +657,19 @@ if ('add' != $action) { foreach ($dropbox_categories as $category) { $dropbox_category_data = []; if ('1' == $category['sent']) { - $moveList[$category['cat_id']] = $category['cat_name']; + $moveList[$category['cat_id']] = $category['title']; $dropbox_category_data[] = $category['cat_id']; // This is where the checkbox icon for the files appear. $link_open = ''; - $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['cat_name'])).''; + $dropbox_category_data[] = $link_open.DocumentManager::build_document_icon_tag('folder', Security::remove_XSS($category['title'])).''; $dropbox_category_data[] = ''. - Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')).''.$link_open.Security::remove_XSS($category['cat_name']).''; + Display::getMdiIcon(ActionIcon::SAVE_FORM, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Save')).''.$link_open.Security::remove_XSS($category['title']).''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''; $dropbox_category_data[] = ''. Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).' - '. + '. Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''; } if (is_array($dropbox_category_data) && count($dropbox_category_data) > 0) { diff --git a/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php b/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php index 9b7102a121..02f73fc658 100644 --- a/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php +++ b/public/main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php @@ -250,7 +250,7 @@ class MultipleAnswerTrueFalseDegreeCertainty extends Question if (!$options->isEmpty()) { foreach ($options as $optionData) { - $optionData->setName($optionData->getName()); + $optionData->setTitle($optionData->getTitle()); } } else { for ($i = 1; $i <= 8; $i++) { diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index c7ca323b7b..cfd4269a20 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -1869,7 +1869,7 @@ class Exercise if (!empty($categories)) { /** @var CExerciseCategory $category */ foreach ($categories as $category) { - $options[$category->getId()] = $category->getName(); + $options[$category->getId()] = $category->getTitle(); } } @@ -9913,7 +9913,7 @@ class Exercise $courseId = (int) $courseId; $sql = "SELECT - lp.name, + lp.title, lpi.lp_id, lpi.max_score FROM $tableLpItem lpi diff --git a/public/main/exercise/exercise.php b/public/main/exercise/exercise.php index 2ea47adb9e..f2e0f3ba2a 100644 --- a/public/main/exercise/exercise.php +++ b/public/main/exercise/exercise.php @@ -433,7 +433,7 @@ if ('true' !== api_get_setting('exercise.allow_exercise_categories')) { $down = Display::url(Display::getMdiIcon('arrow-down-bold', 'ch-tool-icon-disabled', null, ICON_SIZE_SMALL, get_lang('Move down')), '#'); } } - echo Display::page_subheader($category->getName().$up.$down); + echo Display::page_subheader($category->getTitle().$up.$down); echo Exercise::exerciseGridResource($category->getId(), $keyword); } } else { diff --git a/public/main/exercise/multiple_answer_true_false.class.php b/public/main/exercise/multiple_answer_true_false.class.php index 216faa9c9b..56f2f0ee7e 100644 --- a/public/main/exercise/multiple_answer_true_false.class.php +++ b/public/main/exercise/multiple_answer_true_false.class.php @@ -255,7 +255,7 @@ class MultipleAnswerTrueFalse extends Question if (!$options->isEmpty()) { foreach ($options as $optionData) { - $optionData->setName($optionData->getName()); + $optionData->setTitle($optionData>getTitle()); } } else { for ($i = 1; $i <= 3; $i++) { diff --git a/public/main/exercise/question.class.php b/public/main/exercise/question.class.php index 54da9ae929..caa5eb6f22 100644 --- a/public/main/exercise/question.class.php +++ b/public/main/exercise/question.class.php @@ -1534,7 +1534,7 @@ abstract class Question $option = new CQuizQuestionOption(); $option ->setQuestion($question) - ->setName($name) + ->setTitle($name) ->setPosition($position) ; $em = Database::getManager(); diff --git a/public/main/forum/editpost.php b/public/main/forum/editpost.php index 2fb8349eb5..da14e32044 100644 --- a/public/main/forum/editpost.php +++ b/public/main/forum/editpost.php @@ -155,11 +155,11 @@ if ('group' === $origin && $group_id) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), - 'name' => get_lang('Group area').' '.$groupEntity->getName(), + 'name' => get_lang('Group area').' '.$groupEntity->getTitle(), ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.api_get_cidreq().'&forum='.$forumId, - 'name' => prepare4display($forum->getForumTitle()), + 'name' => prepare4display($forum->getTitle()), ]; $interbreadcrumb[] = ['url' => 'javascript: void (0);', 'name' => get_lang('Edit a post')]; } else { @@ -169,15 +169,15 @@ if ('group' === $origin && $group_id) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?forumcategory='.$category->getIid().'&'.api_get_cidreq(), - 'name' => prepare4display($category->getCatTitle()), + 'name' => prepare4display($category->getTitle()), ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?forum='.$forumId.'&'.api_get_cidreq(), - 'name' => prepare4display($forum->getForumTitle()), + 'name' => prepare4display($forum->getTitle()), ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/viewthread.php?'.api_get_cidreq().'&forum='.$forumId.'&thread='.(int) ($_GET['thread']), - 'name' => prepare4display($thread->getThreadTitle()), + 'name' => prepare4display($thread->getTitle()), ]; $interbreadcrumb[] = ['url' => 'javascript: void (0);', 'name' => get_lang('Edit a post')]; } @@ -268,7 +268,7 @@ if ('learnpath' !== $origin) { echo '
'; echo '

'; echo Display::url( - prepare4display($forum->getForumTitle()), + prepare4display($forum->getTitle()), 'viewforum.php?'.api_get_cidreq().'&'.http_build_query([ 'origin' => $origin, 'forum' => $forum->getIid(), diff --git a/public/main/forum/editthread.php b/public/main/forum/editthread.php index 7167a1d56b..f8c3b10f2a 100644 --- a/public/main/forum/editthread.php +++ b/public/main/forum/editthread.php @@ -167,7 +167,7 @@ if (!empty($groupId)) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, - 'name' => $forum->getForumTitle(), + 'name' => $forum->getTitle(), ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/newthread.php?'.$cidreq.'&forum='.$forumId, @@ -177,11 +177,11 @@ if (!empty($groupId)) { $interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq, 'name' => $nameTools]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/index.php?'.$cidreq.'&forumcategory='.$category->getIid(), - 'name' => $category->getCatTitle(), + 'name' => $category->getTitle(), ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'forum/viewforum.php?'.$cidreq.'&forum='.$forumId, - 'name' => $forum->getForumTitle(), + 'name' => $forum->getTitle(), ]; $interbreadcrumb[] = ['url' => '#', 'name' => get_lang('Edit thread')]; } diff --git a/public/main/forum/forumfunction.inc.php b/public/main/forum/forumfunction.inc.php index bb62b7ed38..765c95671c 100644 --- a/public/main/forum/forumfunction.inc.php +++ b/public/main/forum/forumfunction.inc.php @@ -302,7 +302,7 @@ function forumForm(CForum $forum = null, int $lp_id = null): string $forum_categories = get_forum_categories(); $forum_categories_titles = []; foreach ($forum_categories as $value) { - $forum_categories_titles[$value->getIid()] = $value->getCatTitle(); + $forum_categories_titles[$value->getIid()] = $value->getTitle(); } $form->addSelect( 'forum_category', @@ -437,7 +437,7 @@ function forumForm(CForum $forum = null, int $lp_id = null): string } else { // the default values when editing = the data in the table $defaults['forum_id'] = $forum->getIid(); - $defaults['forum_title'] = prepare4display($forum->getForumTitle()); + $defaults['forum_title'] = prepare4display($forum->getTitle()); $defaults['forum_comment'] = prepare4display($forum->getForumComment()); $defaults['start_time'] = api_get_local_time($forum->getStartTime()); $defaults['end_time'] = api_get_local_time($forum->getEndTime()); @@ -541,7 +541,7 @@ function editForumCategoryForm(CForumCategory $category): string // Setting the default values. $defaultvalues['forum_category_id'] = $categoryId; - $defaultvalues['forum_category_title'] = $category->getCatTitle(); + $defaultvalues['forum_category_title'] = $category->getTitle(); $defaultvalues['forum_category_comment'] = $category->getCatComment(); $form->setDefaults($defaultvalues); @@ -587,7 +587,7 @@ function saveForumCategory(array $values, array $courseInfo = [], bool $showMess $category = $repo->find($values['forum_category_id']); $category ->setCatComment($values['forum_category_comment'] ?? '') - ->setCatTitle($values['forum_category_title']) + ->setTitle($values['forum_category_title']) ; $repo->update($category); $message = get_lang('The forum category has been modified'); @@ -607,7 +607,7 @@ function saveForumCategory(array $values, array $courseInfo = [], bool $showMess $category = new CForumCategory(); $category - ->setCatTitle($clean_cat_title) + ->setTitle($clean_cat_title) ->setCatComment($values['forum_category_comment'] ?? '') ->setCatOrder($new_max) ->setParent($course) @@ -735,7 +735,7 @@ function store_forum(array $values, array $courseInfo = [], bool $returnId = fal } $forum - ->setForumTitle($values['forum_title']) + ->setTitle($values['forum_title']) ->setForumComment($values['forum_comment'] ?? '') ->setForumCategory($forumCategory) ->setAllowAnonymous($values['allow_anonymous_group']['allow_anonymous'] ?? 0) @@ -1285,7 +1285,7 @@ function getThreadInfo(int $threadId): Array if ($forumThread) { $thread['iid'] = $forumThread->getIid(); $thread['threadId'] = $forumThread->getIid(); - $thread['threadTitle'] = $forumThread->getThreadTitle(); + $thread['threadTitle'] = $forumThread->getTitle(); $thread['forumId'] = $forumThread->getForum() ? $forumThread->getForum()->getIid() : 0; //$thread['sessionId'] = $forumThread->getSessionId(); $thread['threadSticky'] = $forumThread->getThreadSticky(); @@ -1384,7 +1384,7 @@ function getPosts( $postInfo = [ 'iid' => $post->getIid(), 'post_id' => $post->getIid(), - 'post_title' => $post->getPostTitle(), + 'post_title' => $post->getTitle(), 'post_text' => $post->getPostText(), 'thread_id' => $post->getThread() ? $post->getThread()->getIid() : 0, 'forum_id' => $post->getForum()->getIid(), @@ -1693,7 +1693,7 @@ function updateThread($values) // Simple update + set gradebook values to null $params = [ - 'thread_title' => $values['thread_title'], + 'title' => $values['thread_title'], 'thread_sticky' => $values['thread_sticky'] ?? 0, ]; $where = ['iid = ?' => [$values['thread_id']]]; @@ -1801,7 +1801,7 @@ function saveThread( // We first store an entry in the forum_thread table because the threadId is used in the forum_post table. $thread = new CForumThread(); $thread - ->setThreadTitle($clean_post_title) + ->setTitle($clean_post_title) ->setForum($forum) ->setUser($user) ->setThreadDate($post_date) @@ -1859,7 +1859,7 @@ function saveThread( // We now store the content in the table_post table. $post = new CForumPost(); $post - ->setPostTitle($clean_post_title) + ->setTitle($clean_post_title) ->setPostText($values['post_text']) ->setThread($thread) ->setForum($forum) @@ -2123,7 +2123,7 @@ function show_add_post_form(CForum $forum, CForumThread $thread, CForumPost $pos $form->addHidden('post_parent_id', $post->getIid()); // If we are replying or are quoting then we display a default title. $posterName = UserManager::formatUserFullName($post->getUser()); - $defaults['post_title'] = get_lang('Re:').api_html_entity_decode($post->getPostTitle(), ENT_QUOTES); + $defaults['post_title'] = get_lang('Re:').api_html_entity_decode($post->getTitle(), ENT_QUOTES); // When we are quoting a message then we have to put that message into the wysiwyg editor. // Note: The style has to be hardcoded here because using class="quote" didn't work. if ('quote' === $action) { @@ -2814,7 +2814,7 @@ function store_reply(CForum $forum, CForumThread $thread, $values, $courseId = 0 $post = new CForumPost(); $text = empty($values['post_text']) ? '' : $values['post_text']; $post - ->setPostTitle($values['post_title']) + ->setTitle($values['post_title']) ->setPostText($text) ->setThread($thread) ->setForum($forum) @@ -3032,7 +3032,7 @@ function show_edit_post_form( $form->addButtonUpdate(get_lang('Edit'), 'SubmitPost'); // Setting the default values for the form elements. - $defaults['post_title'] = $post->getPostTitle(); + $defaults['post_title'] = $post->getTitle(); $defaults['post_text'] = $post->getPostText(); if (1 == $post->getPostNotification()) { @@ -3100,7 +3100,7 @@ function store_edit_post(CForum $forum, $values) if (!empty($first_post) && $first_post['post_id'] == $values['post_id']) { // Simple edit $params = [ - 'thread_title' => $values['post_title'], + 'title' => $values['post_title'], 'thread_sticky' => isset($values['thread_sticky']) ? $values['thread_sticky'] : 0, ]; $where = ['iid = ?' => [$values['thread_id']]]; @@ -3125,7 +3125,7 @@ function store_edit_post(CForum $forum, $values) $post = $repo->find($postId); if ($post) { $post - ->setPostTitle($values['post_title']) + ->setTitle($values['post_title']) ->setPostText($values['post_text']) ->setPostNotification(isset($values['post_notification'])) ; @@ -3440,16 +3440,16 @@ function send_mail($userInfo, CForum $forum, CForumThread $thread, CForumPost $p $email_body = get_lang('Dear').' '. api_get_person_name($userInfo['firstname'], $userInfo['lastname'], null, PERSON_NAME_EMAIL_ADDRESS).",
\n\r"; $email_body .= get_lang('New Post in the forum'). - ': '.$forum->getForumTitle().' - '.$thread->getThreadTitle()."
\n"; + ': '.$forum->getTitle().' - '.$thread->getTitle()."
\n"; $courseId = (int) api_get_setting('forum.global_forums_course_id'); $subject = get_lang('New Post in the forum').' - '. - $_course['official_code'].': '.$forum->getForumTitle().' - '.$thread->getThreadTitle()."
\n"; + $_course['official_code'].': '.$forum->getTitle().' - '.$thread->getTitle()."
\n"; $courseInfoTitle = get_lang('Course').': '.$_course['name'].' - ['.$_course['official_code']."] -
\n"; if (!empty($courseId) && $_course['real_id'] == $courseId) { $subject = get_lang('New Post in the forum').': '. - $forum->getForumTitle().' - '.$thread->getThreadTitle()."
\n"; + $forum->getTitle().' - '.$thread->getTitle()."
\n"; $courseInfoTitle = "
\n"; } $email_body .= $courseInfoTitle; @@ -3511,10 +3511,10 @@ function move_thread_form()
'; $htmlcontent .= ' $arreval['id'], - 'name' => $name_log, + 'title' => $name_log, 'description' => $description_log, 'created_at' => $now, 'weight' => $arreval['weight'], diff --git a/public/main/gradebook/lib/be/attendancelink.class.php b/public/main/gradebook/lib/be/attendancelink.class.php index 1767cc498b..f27abd50d6 100644 --- a/public/main/gradebook/lib/be/attendancelink.class.php +++ b/public/main/gradebook/lib/be/attendancelink.class.php @@ -67,7 +67,7 @@ class AttendanceLink extends AbstractLink if (!empty($title)) { $cats[] = [$link->getIid(), $title]; } else { - $cats[] = [$link->getIid(), $link->getName()]; + $cats[] = [$link->getIid(), $link->getTitle()]; } } diff --git a/public/main/gradebook/lib/be/category.class.php b/public/main/gradebook/lib/be/category.class.php index 8fff7db68a..5f0efe44d3 100644 --- a/public/main/gradebook/lib/be/category.class.php +++ b/public/main/gradebook/lib/be/category.class.php @@ -557,7 +557,7 @@ class Category implements GradebookItem } $category = new GradebookCategory(); - $category->setName($this->name); + $category->setTitle($this->name); $category->setDescription($this->description); $category->setUser(api_get_user_entity($this->user_id)); $category->setCourse($course); @@ -648,7 +648,7 @@ class Category implements GradebookItem } $course = api_get_course_entity(); - $category->setName($this->name); + $category->setTitle($this->name); $category->setDescription($this->description); $category->setUser(api_get_user_entity($this->user_id)); $category->setCourse($course); @@ -2557,7 +2557,7 @@ class Category implements GradebookItem while ($data = Database::fetch_array($result)) { $cat = new Category(); $cat->set_id($data['id']); - $cat->set_name($data['name']); + $cat->set_name($data['title']); $cat->set_description($data['description']); $cat->set_user_id($data['user_id']); $courseInfo = api_get_course_info_by_id($data['c_id']); diff --git a/public/main/gradebook/lib/be/evaluation.class.php b/public/main/gradebook/lib/be/evaluation.class.php index 6276f413ab..294f719e54 100644 --- a/public/main/gradebook/lib/be/evaluation.class.php +++ b/public/main/gradebook/lib/be/evaluation.class.php @@ -334,7 +334,7 @@ class Evaluation implements GradebookItem $evaluation ->setDescription($this->description) ->setCourse(api_get_course_entity($courseId)) - ->setName($this->get_name()) + ->setTitle($this->get_name()) ->setCategory($category) ->setUser(api_get_user_entity($this->get_user_id())) ->setWeight(api_float_val($this->get_weight())) @@ -369,7 +369,7 @@ class Evaluation implements GradebookItem $current_date = api_get_utc_datetime(); $params = [ 'id_linkeval_log' => $arreval['id'], - 'name' => $arreval['name'], + 'title' => $arreval['name'], 'description' => $arreval['description'], 'created_at' => $current_date, 'weight' => $row_old_weight['weight'], @@ -389,7 +389,7 @@ class Evaluation implements GradebookItem { $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION); $sql = 'UPDATE '.$tbl_grade_evaluations - ." SET name = '".Database::escape_string($this->get_name())."'" + ." SET title = '".Database::escape_string($this->get_name())."'" .', description = '; if (isset($this->description)) { $sql .= "'".Database::escape_string($this->get_description())."'"; @@ -448,7 +448,7 @@ class Evaluation implements GradebookItem $tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION); $sql = "SELECT count(id) AS number FROM $tbl_grade_evaluations - WHERE name = '".Database::escape_string($name)."'"; + WHERE title = '".Database::escape_string($name)."'"; if (api_is_allowed_to_edit()) { $parent = Category::load($parent); @@ -947,7 +947,7 @@ class Evaluation implements GradebookItem while ($data = Database::fetch_array($result)) { $eval = new Evaluation(); $eval->set_id($data['id']); - $eval->set_name($data['name']); + $eval->set_name($data['title']); $eval->set_description($data['description']); $eval->set_user_id($data['user_id']); $eval->setCourseId($data['c_id']); diff --git a/public/main/gradebook/lib/be/exerciselink.class.php b/public/main/gradebook/lib/be/exerciselink.class.php index a2d8fe331d..815ffecd29 100644 --- a/public/main/gradebook/lib/be/exerciselink.class.php +++ b/public/main/gradebook/lib/be/exerciselink.class.php @@ -265,7 +265,7 @@ class ExerciseLink extends AbstractLink } else { $sql = "SELECT * FROM $tblHp hp INNER JOIN $tblDoc doc - ON (hp.exe_name = doc.path AND doc.c_id = hp.c_id) + ON (hp.title = doc.path AND doc.c_id = hp.c_id) WHERE hp.c_id = $courseId AND doc.iid = $exerciseId"; diff --git a/public/main/gradebook/lib/be/forumthreadlink.class.php b/public/main/gradebook/lib/be/forumthreadlink.class.php index d3dce37d14..a21b0e757f 100644 --- a/public/main/gradebook/lib/be/forumthreadlink.class.php +++ b/public/main/gradebook/lib/be/forumthreadlink.class.php @@ -76,7 +76,7 @@ class ForumThreadLink extends AbstractLink $result = Database::query($sql);*/ $cats = []; foreach ($threads as $thread) { - $title = $thread->getThreadTitle(); + $title = $thread->getTitle(); $threadQualify = $thread->getThreadTitleQualify(); if (!empty($threadQualify)) { $title = $threadQualify; @@ -246,7 +246,7 @@ class ForumThreadLink extends AbstractLink public function get_name() { $this->getThreadData(); - $thread_title = isset($this->exercise_data['thread_title']) ? $this->exercise_data['thread_title'] : ''; + $thread_title = isset($this->exercise_data['title']) ? $this->exercise_data['title'] : ''; $thread_title_qualify = isset($this->exercise_data['thread_title_qualify']) ? $this->exercise_data['thread_title_qualify'] : ''; if (isset($thread_title_qualify) && '' != $thread_title_qualify) { return $this->exercise_data['thread_title_qualify']; diff --git a/public/main/gradebook/lib/be/learnpathlink.class.php b/public/main/gradebook/lib/be/learnpathlink.class.php index 4f3dfa51b9..a16bcf030d 100644 --- a/public/main/gradebook/lib/be/learnpathlink.class.php +++ b/public/main/gradebook/lib/be/learnpathlink.class.php @@ -46,7 +46,7 @@ class LearnpathLink extends AbstractLink $list = []; /** @var CLp $lp */ foreach ($lps as $lp) { - $list[] = [$lp->getIid(), $lp->getName()]; + $list[] = [$lp->getIid(), $lp->getTitle()]; } return $list; diff --git a/public/main/group/group_space.php b/public/main/group/group_space.php index 44a39d64b0..c8bdb7953a 100644 --- a/public/main/group/group_space.php +++ b/public/main/group/group_space.php @@ -67,7 +67,7 @@ if (!empty($_GET['selfUnReg']) && } Display::display_header( - $nameTools.' '.Security::remove_XSS($groupEntity->getName()), + $nameTools.' '.Security::remove_XSS($groupEntity->getTitle()), 'Group' ); @@ -112,7 +112,7 @@ if (api_is_allowed_to_edit(false, true) || } echo Display::page_header( - Security::remove_XSS($groupEntity->getName()).' '.$edit_url.' '.$subscribe_group.' '.$unsubscribe_group + Security::remove_XSS($groupEntity->getTitle()).' '.$edit_url.' '.$subscribe_group.' '.$unsubscribe_group ); if (!empty($groupEntity->getDescription())) { @@ -134,7 +134,7 @@ if (api_is_allowed_to_edit(false, true) || $actions_array[] = [ 'url' => api_get_path(WEB_CODE_PATH). 'forum/viewforum.php?forum='.$forum->getIid().'&'.api_get_cidreq().'&origin=group', - 'content' => Display::getMdiIcon(ToolIcon::FORUM, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Forum').': '.$forum->getForumTitle()), + 'content' => Display::getMdiIcon(ToolIcon::FORUM, 'ch-tool-icon', null, ICON_SIZE_MEDIUM, get_lang('Forum').': '.$forum->getTitle()), ]; } } diff --git a/public/main/group/member_settings.php b/public/main/group/member_settings.php index 6eba202ede..c916ef8ef1 100644 --- a/public/main/group/member_settings.php +++ b/public/main/group/member_settings.php @@ -15,7 +15,7 @@ $groupEntity = api_get_group_entity($group_id); $nameTools = get_lang('Edit this group'); $interbreadcrumb[] = ['url' => 'group.php', 'name' => get_lang('Groups')]; -$interbreadcrumb[] = ['url' => 'group_space.php?'.api_get_cidreq(), 'name' => $groupEntity->getName()]; +$interbreadcrumb[] = ['url' => 'group_space.php?'.api_get_cidreq(), 'name' => $groupEntity->getTitle()]; $is_group_member = GroupManager::isTutorOfGroup(api_get_user_id(), $groupEntity); diff --git a/public/main/group/settings.php b/public/main/group/settings.php index cc971facc3..8ca77e2660 100644 --- a/public/main/group/settings.php +++ b/public/main/group/settings.php @@ -32,7 +32,7 @@ if (null === $groupEntity) { $nameTools = get_lang('Edit this group'); $interbreadcrumb[] = ['url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')]; -$interbreadcrumb[] = ['url' => 'group_space.php?'.api_get_cidreq(), 'name' => $groupEntity->getName()]; +$interbreadcrumb[] = ['url' => 'group_space.php?'.api_get_cidreq(), 'name' => $groupEntity->getTitle()]; $groupMember = GroupManager::isTutorOfGroup(api_get_user_id(), $groupEntity); if (!$groupMember && !api_is_allowed_to_edit(false, true)) { diff --git a/public/main/group/tutor_settings.php b/public/main/group/tutor_settings.php index 47135c1836..60d165cb15 100644 --- a/public/main/group/tutor_settings.php +++ b/public/main/group/tutor_settings.php @@ -19,7 +19,7 @@ $current_group = GroupManager::get_group_properties($group_id); $nameTools = get_lang('Edit this group'); $interbreadcrumb[] = ['url' => 'group.php?'.api_get_cidreq(), 'name' => get_lang('Groups')]; -$interbreadcrumb[] = ['url' => 'group_space.php?'.api_get_cidreq(), 'name' => $groupEntity->getName()]; +$interbreadcrumb[] = ['url' => 'group_space.php?'.api_get_cidreq(), 'name' => $groupEntity->getTitle()]; $is_group_member = GroupManager::isTutorOfGroup(api_get_user_id(), $groupEntity); diff --git a/public/main/inc/ajax/lp.ajax.php b/public/main/inc/ajax/lp.ajax.php index 23297d2943..91ee18d12d 100644 --- a/public/main/inc/ajax/lp.ajax.php +++ b/public/main/inc/ajax/lp.ajax.php @@ -46,7 +46,7 @@ switch ($action) { $data = []; if (!empty($lps)) { foreach ($lps as $lp) { - $data[] = ['id' => $lp->getIid(), 'text' => html_entity_decode($lp->getName())]; + $data[] = ['id' => $lp->getIid(), 'text' => html_entity_decode($lp->getTitle())]; } } echo json_encode($data); @@ -241,7 +241,7 @@ switch ($action) { if (null === $forumCategory) { $forumCategory = new CForumCategory(); $forumCategory - ->setCatTitle(get_lang('Learning paths')) + ->setTitle(get_lang('Learning paths')) ->setParent($course) ->addCourseLink($course, $session) ; @@ -250,7 +250,7 @@ switch ($action) { $forum = new CForum(); $forum - ->setForumTitle('forum2') + ->setTitle('forum2') ->setForumCategory($forumCategory) ->setParent($course) ->setLp($lp) @@ -266,7 +266,7 @@ switch ($action) { if (null === $thread) { $thread = new CForumThread(); $thread - ->setThreadTitle($title) + ->setTitle($title) ->setForum($forum) ->setUser(api_get_user_entity()) ->setParent($forum) diff --git a/public/main/inc/ajax/model.ajax.php b/public/main/inc/ajax/model.ajax.php index 2a0bdc8028..ffba646f55 100644 --- a/public/main/inc/ajax/model.ajax.php +++ b/public/main/inc/ajax/model.ajax.php @@ -289,6 +289,7 @@ if (($search || $forceSearch) && ('false' !== $search)) { if (!$sidx) { $sidx = 1; } +$options = []; //2. Selecting the count FIRST //@todo rework this @@ -1048,7 +1049,7 @@ switch ($action) { foreach ($items as $item) { $result[] = [ 'id' => $item->getId(), - 'name' => $item->getName(), + 'name' => $item->getTitle(), ]; } /*$result = $manager->get_all([ @@ -1957,9 +1958,9 @@ switch ($action) { $sord = 'DESC'; } } else { - $sidx = in_array($sidx, $columns) ? $sidx : 'name'; + $sidx = in_array($sidx, $columns) ? $sidx : 'title'; } - $orderBy = "$sidx $sord, s.name"; + $orderBy = "$sidx $sord, s.title"; $limit = 20; $total_pages = 0; if ($count > 0) { @@ -2060,6 +2061,8 @@ switch ($action) { break; case 'get_session_lp_progress': $sessionId = 0; + $date_from = $_GET['date_from']; + $date_to = $_GET['date_to']; if (!empty($_GET['session_id']) && !empty($_GET['course_id'])) { $sessionId = (int) $_GET['session_id']; $courseId = (int) $_GET['course_id']; @@ -2318,7 +2321,7 @@ switch ($action) { } $result = Database::select( - 'p.id,p.name, p.description, c.name as career, p.status', + 'p.id,p.name, p.description, c.title as career, p.status', "$obj->table p LEFT JOIN ".Database::get_main_table(TABLE_CAREER)." c ON c.id = p.career_id ", ['order' => "$sidx $sord", 'LIMIT' => "$start , $limit"] ); diff --git a/public/main/inc/ajax/session.ajax.php b/public/main/inc/ajax/session.ajax.php index 726f1f45c1..e2c89b66a1 100644 --- a/public/main/inc/ajax/session.ajax.php +++ b/public/main/inc/ajax/session.ajax.php @@ -47,7 +47,7 @@ switch ($action) { if (api_is_platform_admin()) { $sessions = SessionManager::get_sessions_list( [ - 's.name' => [ + 's.title' => [ 'operator' => 'LIKE', 'value' => "%".$_REQUEST['q']."%", ], @@ -77,7 +77,7 @@ switch ($action) { if (api_is_platform_admin()) { $results = SessionManager::get_sessions_list( [ - 's.name' => ['operator' => 'like', 'value' => "%".$_REQUEST['q']."%"], + 's.title' => ['operator' => 'like', 'value' => "%".$_REQUEST['q']."%"], 'c.id' => ['operator' => '=', 'value' => $_REQUEST['course_id']], ] ); @@ -106,7 +106,7 @@ switch ($action) { if (api_is_platform_admin()) { $results = SessionManager::get_sessions_list( [ - 's.name' => ['operator' => 'like', 'value' => "%".$_REQUEST['q']."%"], + 's.title' => ['operator' => 'like', 'value' => "%".$_REQUEST['q']."%"], 'c.id' => ['operator' => '=', 'value' => $_REQUEST['course_id']], ] ); diff --git a/public/main/inc/lib/AnnouncementManager.php b/public/main/inc/lib/AnnouncementManager.php index 94d2d5aa08..4b32eea6b0 100644 --- a/public/main/inc/lib/AnnouncementManager.php +++ b/public/main/inc/lib/AnnouncementManager.php @@ -657,8 +657,6 @@ class AnnouncementManager $end_date = api_get_utc_datetime(); } - $order = self::getLastAnnouncementOrder($courseInfo); - $course = api_get_course_entity($courseId); $session = api_get_session_entity($sessionId); $group = api_get_group_entity(); @@ -670,7 +668,6 @@ class AnnouncementManager ->setContent($content) ->setTitle($title) ->setEndDate(new DateTime($end_date)) - ->setDisplayOrder($order) ->setParent($course) ; @@ -740,7 +737,6 @@ class AnnouncementManager $sendToUsersInSession = false ) { $courseInfo = api_get_course_info(); - $order = self::getLastAnnouncementOrder($courseInfo); $em = Database::getManager(); $now = api_get_utc_datetime(); $courseId = api_get_course_int_id(); @@ -754,7 +750,6 @@ class AnnouncementManager ->setContent($newContent) ->setTitle($title) ->setEndDate(new DateTime($now)) - ->setDisplayOrder($order) ->setParent($course) ; diff --git a/public/main/inc/lib/CoursesAndSessionsCatalog.class.php b/public/main/inc/lib/CoursesAndSessionsCatalog.class.php index 96e45c288b..ade533f683 100644 --- a/public/main/inc/lib/CoursesAndSessionsCatalog.class.php +++ b/public/main/inc/lib/CoursesAndSessionsCatalog.class.php @@ -931,7 +931,7 @@ class CoursesAndSessionsCatalog 'url.sessionId = s.id' ) ->andWhere($qb->expr()->eq('url.accessUrlId', $urlId)) - ->andWhere('s.name LIKE :keyword') + ->andWhere('s.title LIKE :keyword') ->andWhere($qb->expr()->gt('s.nbrCourses', 0)) ->setParameter('keyword', "%$keyword%") ; @@ -1632,7 +1632,7 @@ class CoursesAndSessionsCatalog $cat = null; $catName = ''; } else { - $catName = $cat->getName(); + $catName = $cat->getTitle(); } $actions = null; @@ -1645,7 +1645,7 @@ class CoursesAndSessionsCatalog $sessionsBlock = [ 'id' => $session->getId(), - 'name' => $session->getName(), + 'name' => $session->getTitle(), 'image' => isset($imageField['value']) ? $imageField['value'] : null, 'nbr_courses' => $session->getNbrCourses(), 'nbr_users' => $session->getNbrUsers(), @@ -1663,12 +1663,12 @@ class CoursesAndSessionsCatalog $session->getId(), $userId ), - 'icon' => self::getSessionIcon($session->getName()), + 'icon' => self::getSessionIcon($session->getTitle()), 'date' => $sessionDates['display'], 'price' => !empty($isThisSessionOnSale['html']) ? $isThisSessionOnSale['html'] : '', 'subscribe_button' => isset($isThisSessionOnSale['buy_button']) ? $isThisSessionOnSale['buy_button'] : self::getRegisteredInSessionButton( $session->getId(), - $session->getName(), + $session->getTitle(), $hasRequirements ), 'show_description' => $session->getShowDescription(), diff --git a/public/main/inc/lib/ExerciseCategoryManager.php b/public/main/inc/lib/ExerciseCategoryManager.php index aa76c53780..9523bca188 100644 --- a/public/main/inc/lib/ExerciseCategoryManager.php +++ b/public/main/inc/lib/ExerciseCategoryManager.php @@ -57,7 +57,7 @@ class ExerciseCategoryManager extends Model if (!empty($categories)) { /** @var CExerciseCategory $category */ foreach ($categories as $category) { - $options[$category->getId()] = $category->getName(); + $options[$category->getId()] = $category->getTitle(); } } @@ -116,7 +116,7 @@ class ExerciseCategoryManager extends Model if ($category) { $category - ->setName($params['name']) + ->setTitle($params['name']) ->setDescription($params['description']) ; @@ -142,7 +142,7 @@ class ExerciseCategoryManager extends Model $repo = Container::getExerciseCategoryRepository(); $category = new CExerciseCategory(); $category - ->setName($params['name']) + ->setTitle($params['name']) ->setCourse($course) ->setDescription($params['description']) ->setParent($course) diff --git a/public/main/inc/lib/SkillModel.php b/public/main/inc/lib/SkillModel.php index 0ac368104d..a79063f07b 100644 --- a/public/main/inc/lib/SkillModel.php +++ b/public/main/inc/lib/SkillModel.php @@ -339,7 +339,7 @@ class SkillModel extends Model $row['asset'] = $assetRepo->getAssetUrl($skill->getAsset()); } - $row['name'] = self::translateName($skill->getName()); + $row['name'] = self::translateName($skill->getTitle()); $row['short_code'] = self::translateCode($skill->getShortCode()); $skillRelSkill = new SkillRelSkillModel(); $parents = $skillRelSkill->getSkillParents($skillId); @@ -2094,7 +2094,7 @@ class SkillModel extends Model /** @var CForumThread $item */ $item = $em->getRepository(CForumThread::class)->find($itemId); if ($item) { - $itemInfo['name'] = $item->getThreadTitle(); + $itemInfo['name'] = $item->getTitle(); } break; } diff --git a/public/main/inc/lib/TicketManager.php b/public/main/inc/lib/TicketManager.php index 366c41e2d9..e5dd576928 100644 --- a/public/main/inc/lib/TicketManager.php +++ b/public/main/inc/lib/TicketManager.php @@ -1265,7 +1265,7 @@ class TicketManager $row['lp_url'] = ''. - $lp->getName(). + $lp->getTitle(). ''; } } @@ -1877,7 +1877,7 @@ class TicketManager $list = []; /** @var TicketStatus $row */ foreach ($items as $row) { - $list[$row->getId()] = $row->getName(); + $list[$row->getId()] = $row->getTitle(); } return $list; @@ -1928,7 +1928,7 @@ class TicketManager $list = []; /** @var TicketPriority $row */ foreach ($projects as $row) { - $list[$row->getId()] = $row->getName(); + $list[$row->getId()] = $row->getTitle(); } return $list; @@ -1947,7 +1947,7 @@ class TicketManager $list[] = [ 'id' => $row->getId(), '0' => $row->getId(), - '1' => $row->getName(), + '1' => $row->getTitle(), '2' => $row->getDescription(), '3' => $row->getId(), ]; @@ -1969,7 +1969,7 @@ class TicketManager 'id' => $row->getId(), '0' => $row->getId(), '1' => Display::url( - $row->getName(), + $row->getTitle(), api_get_path(WEB_CODE_PATH).'ticket/tickets.php?project_id='.$row->getId() ), '2' => $row->getDescription(), @@ -1996,7 +1996,7 @@ class TicketManager public static function addProject($params) { $project = new TicketProject(); - $project->setName($params['name']); + $project->setTitle($params['name']); $project->setDescription($params['description']); $project->setInsertUserId(api_get_user_id()); @@ -2021,7 +2021,7 @@ class TicketManager public static function updateProject($id, $params) { $project = self::getProject($id); - $project->setName($params['name']); + $project->setTitle($params['name']); $project->setDescription($params['description']); $project->setLastEditDateTime(new DateTime($params['sys_lastedit_datetime'])); $project->setLastEditUserId($params['sys_lastedit_user_id']); @@ -2070,7 +2070,7 @@ class TicketManager 'id' => $row->getId(), 'code' => $row->getCode(), '0' => $row->getId(), - '1' => $row->getName(), + '1' => $row->getTitle(), '2' => $row->getDescription(), '3' => $row->getId(), ]; @@ -2117,7 +2117,7 @@ class TicketManager { $item = new TicketStatus(); $item->setCode(URLify::filter($params['name'])); - $item->setName($params['name']); + $item->setTitle($params['name']); $item->setDescription($params['description']); Database::getManager()->persist($item); @@ -2141,7 +2141,7 @@ class TicketManager public static function updateStatus($id, $params) { $item = self::getStatus($id); - $item->setName($params['name']); + $item->setTitle($params['name']); $item->setDescription($params['description']); Database::getManager()->persist($item); @@ -2189,7 +2189,7 @@ class TicketManager 'id' => $row->getId(), 'code' => $row->getCode(), '0' => $row->getId(), - '1' => $row->getName(), + '1' => $row->getTitle(), '2' => $row->getDescription(), '3' => $row->getId(), ]; @@ -2217,7 +2217,7 @@ class TicketManager $item = new TicketPriority(); $item ->setCode(URLify::filter($params['name'])) - ->setName($params['name']) + ->setTitle($params['name']) ->setDescription($params['description']) ->setColor('') ->setInsertUserId(api_get_user_id()) @@ -2245,7 +2245,7 @@ class TicketManager public static function updatePriority($id, $params) { $item = self::getPriority($id); - $item->setName($params['name']); + $item->setTitle($params['name']); $item->setDescription($params['description']); Database::getManager()->persist($item); diff --git a/public/main/inc/lib/VideoChat.php b/public/main/inc/lib/VideoChat.php index 09576f54ad..501fa5f096 100644 --- a/public/main/inc/lib/VideoChat.php +++ b/public/main/inc/lib/VideoChat.php @@ -63,7 +63,7 @@ class VideoChat [ 'from_user' => $fromUser, 'to_user' => $toUser, - 'room_name' => $chatName, + 'title' => $chatName, 'datetime' => api_get_utc_datetime(), ] ); @@ -82,7 +82,7 @@ class VideoChat 'COUNT(1) AS count', Database::get_main_table(TABLE_MAIN_CHAT_VIDEO), [ - 'where' => ['room_name = ?' => $name], + 'where' => ['title = ?' => $name], ], 'first' ); diff --git a/public/main/inc/lib/add_course.lib.inc.php b/public/main/inc/lib/add_course.lib.inc.php index 9d01335c1f..77d45d227f 100644 --- a/public/main/inc/lib/add_course.lib.inc.php +++ b/public/main/inc/lib/add_course.lib.inc.php @@ -561,12 +561,12 @@ class AddCourse $course_code = $courseInfo['code']; // father gradebook Database::query( - "INSERT INTO $TABLEGRADEBOOK (name, locked, generate_certificates, description, user_id, c_id, parent_id, weight, visible, certif_min_score, session_id, document_id) + "INSERT INTO $TABLEGRADEBOOK (title, locked, generate_certificates, description, user_id, c_id, parent_id, weight, visible, certif_min_score, session_id, document_id) VALUES ('$course_code','0',0,'',1,$course_id,0,100,0,75,NULL,$certificateId)" ); $gbid = Database::insert_id(); Database::query( - "INSERT INTO $TABLEGRADEBOOK (name, locked, generate_certificates, description, user_id, c_id, parent_id, weight, visible, certif_min_score, session_id, document_id) + "INSERT INTO $TABLEGRADEBOOK (title, locked, generate_certificates, description, user_id, c_id, parent_id, weight, visible, certif_min_score, session_id, document_id) VALUES ('$course_code','0',0,'',1,$course_id,$gbid,100,1,75,NULL,$certificateId)" ); $gbid = Database:: insert_id(); diff --git a/public/main/inc/lib/api.lib.php b/public/main/inc/lib/api.lib.php index 59b10a644e..2f7420038e 100644 --- a/public/main/inc/lib/api.lib.php +++ b/public/main/inc/lib/api.lib.php @@ -5337,7 +5337,7 @@ function api_get_tool_information_by_name($name) $course_id = api_get_course_int_id(); $sql = "SELECT id FROM tool - WHERE name = '".Database::escape_string($name)."' "; + WHERE title = '".Database::escape_string($name)."' "; $rs = Database::query($sql); $data = Database::fetch_array($rs); if ($data) { diff --git a/public/main/inc/lib/attendance.lib.php b/public/main/inc/lib/attendance.lib.php index 8512dbb9b7..5d4388044e 100644 --- a/public/main/inc/lib/attendance.lib.php +++ b/public/main/inc/lib/attendance.lib.php @@ -181,7 +181,7 @@ class Attendance foreach ($attendances as $attendance) { $row = []; $id = $attendance->getIid(); - $name = $attendance->getName(); + $name = $attendance->getTitle(); $active = $attendance->getActive(); $session_star = ''; /*if ($session_id == $attendance[6]) { @@ -347,7 +347,7 @@ class Attendance $course = api_get_course_entity(); $attendance = new CAttendance(); $attendance - ->setName($this->name) + ->setTitle($this->name) ->setDescription($this->description) ->setAttendanceQualifyTitle($titleGradebook) ->setAttendanceWeight($weightCalification) @@ -411,7 +411,7 @@ class Attendance if ($attendance) { $attendanceId = $attendance->getIid(); $attendance - ->setName($this->name) + ->setTitle($this->name) ->setDescription($this->description) ->setAttendanceQualifyTitle($title_gradebook) ->setAttendanceWeight($weight_calification) @@ -2225,8 +2225,8 @@ class Attendance $attendancesProcess[3] = $courseItem['real_id']; $attendancesProcess['courseId'] = $courseItem['real_id']; - $attendancesProcess[4] = $attendanceData->getName(); - $attendancesProcess['attendanceName'] = $attendanceData->getName(); + $attendancesProcess[4] = $attendanceData->getTitle(); + $attendancesProcess['attendanceName'] = $attendanceData->getTitle(); $attendancesProcess['courseCode'] = $courseItem['course_code']; $attendancesProcess[5] = $attendanceId; @@ -2300,8 +2300,8 @@ class Attendance $attendancesProcess['courseTitle'] = $courseItem['title']; $attendancesProcess[3] = $courseItem['real_id']; $attendancesProcess['courseId'] = $courseItem['real_id']; - $attendancesProcess[4] = $attendanceData->getName(); - $attendancesProcess['attendanceName'] = $attendanceData->getName(); + $attendancesProcess[4] = $attendanceData->getTitle(); + $attendancesProcess['attendanceName'] = $attendanceData->getTitle(); $attendancesProcess[5] = $attendanceId; $attendancesProcess['attendanceId'] = $attendanceId; $attendancesProcess['courseCode'] = $courseItem['official_code']; @@ -2406,7 +2406,7 @@ class Attendance if ($attendance) { $default = []; - $default['title'] = Security::remove_XSS($attendance->getName()); + $default['title'] = Security::remove_XSS($attendance->getTitle()); $default['description'] = Security::remove_XSS($attendance->getDescription(), STUDENT); $default['attendance_qualify_title'] = $attendance->getAttendanceQualifyTitle(); $default['attendance_weight'] = $attendance->getAttendanceWeight(); diff --git a/public/main/inc/lib/career.lib.php b/public/main/inc/lib/career.lib.php index 69d8463d00..43565012ef 100644 --- a/public/main/inc/lib/career.lib.php +++ b/public/main/inc/lib/career.lib.php @@ -240,7 +240,7 @@ class Career extends Model { $career = new CareerEntity(); $career - ->setName($params['name']) + ->setTitle($params['name']) ->setStatus((int) $params['status']) ->setDescription($params['description']); diff --git a/public/main/inc/lib/course.lib.php b/public/main/inc/lib/course.lib.php index 85fb26daa9..be2dc6f01d 100644 --- a/public/main/inc/lib/course.lib.php +++ b/public/main/inc/lib/course.lib.php @@ -639,7 +639,7 @@ class CourseManager $endDate = new DateTime(); $endDate->add($duration); $session = new SessionEntity(); - $session->setName( + $session->setTitle( sprintf(get_lang('FirstnameLastnameCourses'), $user->getFirstname(), $user->getLastname()) ); $session->setAccessEndDate($endDate); @@ -4111,7 +4111,7 @@ class CourseManager $output['skill'] = null; if ($skill) { - $output['skill']['name'] = $skill->getName(); + $output['skill']['name'] = $skill->getTitle(); $output['skill']['icon'] = $skill->getIcon(); } } @@ -5845,7 +5845,7 @@ class CourseManager 'disabled' => $userDisabled, 'value' => "GROUP:".$groupId, // The space before "G" is needed in order to advmultiselect.php js puts groups first - 'content' => " G: ".$thisGroup->getName()." - ".$userCount." ".$userLabel, + 'content' => " G: ".$thisGroup->getTitle()." - ".$userCount." ".$userLabel, ]; } } diff --git a/public/main/inc/lib/course_category.lib.php b/public/main/inc/lib/course_category.lib.php index 70cea72727..436cad6b5b 100644 --- a/public/main/inc/lib/course_category.lib.php +++ b/public/main/inc/lib/course_category.lib.php @@ -99,7 +99,7 @@ class CourseCategory $sql = "SELECT t1.id, - t1.name, + t1.title, t1.code, t1.parent_id, t1.tree_pos, @@ -112,7 +112,7 @@ class CourseCategory WHERE 1=1 $whereCondition GROUP BY - t1.name, + t1.title, t1.code, t1.parent_id, t1.tree_pos, @@ -152,7 +152,7 @@ class CourseCategory $repo = Container::getCourseCategoryRepository(); $category = new CourseCategoryEntity(); $category - ->setName($name) + ->setTitle($name) ->setCode($code) ->setDescription($description) ->setTreePos($tree_pos) @@ -193,7 +193,7 @@ class CourseCategory // First get to the highest level possible in the tree $result = Database::query("SELECT parent_id FROM $table WHERE id = '$categoryId'"); $row = Database::fetch_array($result); - if (false !== $row && 0 != $row['parent_id']) { + if (false !== $row && !empty($row['parent_id'])) { // if a parent was found, enter there to see if he's got one more parent self::updateParentCategoryChildrenCount($row['parent_id'], $delta); } @@ -216,7 +216,7 @@ class CourseCategory $name = trim($name); $category ->setCode($name) - ->setName($name) + ->setTitle($name) ->setDescription($description) ->setAuthCourseChild($canHaveCourses) ; @@ -428,7 +428,7 @@ class CourseCategory null, ICON_SIZE_SMALL, get_lang('Open this category') - ).' '.$category->getName().' ('.$code.')', + ).' '.$category->getTitle().' ('.$code.')', $url ); @@ -477,7 +477,7 @@ class CourseCategory public static function getCategoriesToDisplayInHomePage() { $table = Database::get_main_table(TABLE_MAIN_CATEGORY); - $sql = "SELECT name FROM $table + $sql = "SELECT title FROM $table WHERE parent_id IS NULL ORDER BY tree_pos"; @@ -496,7 +496,7 @@ class CourseCategory $whereCondition = ' AND a.access_url_id = '.api_get_current_access_url_id(); $tbl_category = Database::get_main_table(TABLE_MAIN_CATEGORY); - $sql = "SELECT c.id, c.code, name + $sql = "SELECT c.id, c.code, c.title FROM $tbl_category c $conditions WHERE (auth_course_child = 'TRUE' OR code = '".Database::escape_string($categoryCode)."') @@ -514,7 +514,7 @@ class CourseCategory if (!empty($categoryToAvoid) && $categoryToAvoid == $categoryCode) { continue; } - $categories[$cat['id']] = '('.$cat['code'].') '.$cat['name']; + $categories[$cat['id']] = '('.$cat['code'].') '.$cat['title']; ksort($categories); } @@ -608,11 +608,11 @@ class CourseCategory $keyword = Database::escape_string($keyword); - $sql = "SELECT c.*, c.name as text + $sql = "SELECT c.*, c.title as text FROM $tableCategory c $conditions WHERE ( - c.code LIKE '%$keyword%' OR name LIKE '%$keyword%' + c.code LIKE '%$keyword%' OR c.title LIKE '%$keyword%' ) AND auth_course_child = 'TRUE' $whereCondition "; $result = Database::query($sql); diff --git a/public/main/inc/lib/dashboard.lib.php b/public/main/inc/lib/dashboard.lib.php index f19e2a9a4a..7faa88fcc8 100644 --- a/public/main/inc/lib/dashboard.lib.php +++ b/public/main/inc/lib/dashboard.lib.php @@ -242,7 +242,7 @@ class DashboardManager $plugin_controller = Database::escape_string($plugin_info['controller']); } - $ins = "INSERT INTO $tbl_block(name, description, path, controller, active) + $ins = "INSERT INTO $tbl_block(title, description, path, controller, active) VALUES ('$plugin_name', '$plugin_description', '$plugin_path', '$plugin_controller', 1)"; $result = Database::query($ins); $affected_rows = Database::affected_rows($result); @@ -309,6 +309,9 @@ class DashboardManager $rs_block = Database::query($sql); if (Database::num_rows($rs_block) > 0) { while ($row_block = Database::fetch_array($rs_block)) { + if (!isset($row_block['name'])) { + $row_block['name'] = $row_block['title']; + } $block_data[] = $row_block; } } @@ -395,7 +398,7 @@ class DashboardManager $html .= ''; // checkboxes $html .= self::display_user_dashboard_list_checkboxes($user_id, $block['id']); - $html .= ''.$block['name'].''; + $html .= ''.$block['title'].''; $html .= ''.$block['description'].''; $html .= ' '; + echo ''; echo ''; echo ''; echo ''.get_lang('Edit').''; echo ' '; - $sql = 'SELECT id,name,description + $sql = 'SELECT id, title, description FROM '.$table_survey_question_group.' WHERE c_id = '.$course_id.' AND @@ -429,12 +429,12 @@ if ($is_survey_type_1) { $rs = Database::query($sql); $grouplist = ''; while ($row = Database::fetch_array($rs, 'ASSOC')) { - $grouplist .= ''.$row['name'].''.$row['description'].''. + $grouplist .= ''.$row['title'].''.$row['description'].''. ''. Display::getMdiIcon(ActionIcon::EDIT, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Edit')).' '. ''. + onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(sprintf(get_lang('Delete surveyGroup'), $row['title']).'?', ENT_QUOTES)).'\')) return false;">'. Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete')).''. ''; } diff --git a/public/main/survey/survey_question.php b/public/main/survey/survey_question.php index 1241dd8019..df92b167da 100644 --- a/public/main/survey/survey_question.php +++ b/public/main/survey/survey_question.php @@ -250,7 +250,7 @@ class survey_question // When survey type = 1?? if (1 == $surveyData['survey_type']) { $table_survey_question_group = Database::get_course_table(TABLE_SURVEY_QUESTION_GROUP); - $sql = 'SELECT id,name FROM '.$table_survey_question_group.' + $sql = 'SELECT id, title FROM '.$table_survey_question_group.' WHERE survey_id = '.$surveyId.' ORDER BY name'; $rs = Database::query($sql); diff --git a/public/main/template/default/course_info/tools.html.twig b/public/main/template/default/course_info/tools.html.twig index c78333e5f8..f3b45afcfc 100644 --- a/public/main/template/default/course_info/tools.html.twig +++ b/public/main/template/default/course_info/tools.html.twig @@ -6,10 +6,10 @@
- {{ tool.name }} + {{ tool.title }}
- {{ tool.name }} + {{ tool.title }}
{{ tool.action }}
diff --git a/public/main/template/default/skills/skill_level.html.twig b/public/main/template/default/skills/skill_level.html.twig index 78b62ff6e9..cf381f8b98 100644 --- a/public/main/template/default/skills/skill_level.html.twig +++ b/public/main/template/default/skills/skill_level.html.twig @@ -13,18 +13,18 @@ {% for item in list %} - {{ item.name }} - {{ item.shortName }} + {{ item.title }} + {{ item.shortTitle }} {{ item.profile }} {{ 'ActionIcon::EDIT'|mdi_icon(22) }} {{ 'ActionIcon::DELETE'|mdi_icon(22) }} diff --git a/public/main/ticket/assign_tickets.php b/public/main/ticket/assign_tickets.php index 380b3e415f..0f5121c6db 100644 --- a/public/main/ticket/assign_tickets.php +++ b/public/main/ticket/assign_tickets.php @@ -27,7 +27,7 @@ $sql_tasks = 'SELECT id AS colid, title as coltitle course_code = '$course_code' AND id != $id )"; -$sql_forum = 'SELECT thread_id AS colid, thread_title AS coltitle +$sql_forum = 'SELECT thread_id AS colid, title AS coltitle FROM '.Database::get_course_table(TABLE_FORUM_THREAD)." WHERE thread_id NOT IN ( SELECT forum_id diff --git a/public/main/ticket/categories_add_user.php b/public/main/ticket/categories_add_user.php index fc4261c7e7..4b61283c2b 100644 --- a/public/main/ticket/categories_add_user.php +++ b/public/main/ticket/categories_add_user.php @@ -66,7 +66,7 @@ $interbreadcrumb[] = [ $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'ticket/projects.php', - 'name' => $project->getName(), + 'name' => $project->getTitle(), ]; $interbreadcrumb[] = [ diff --git a/public/main/ticket/priorities.php b/public/main/ticket/priorities.php index f32499e57d..abc624971c 100644 --- a/public/main/ticket/priorities.php +++ b/public/main/ticket/priorities.php @@ -93,7 +93,7 @@ switch ($action) { $item = TicketManager::getPriority($_GET['id']); $form->setDefaults( [ - 'name' => $item->getName(), + 'name' => $item->getTitle(), 'description' => $item->getDescription(), ] ); diff --git a/public/main/ticket/projects.php b/public/main/ticket/projects.php index cda29cbfa2..7801575c9d 100644 --- a/public/main/ticket/projects.php +++ b/public/main/ticket/projects.php @@ -93,7 +93,7 @@ switch ($action) { $form = TicketManager::getProjectForm($url); $form->setDefaults([ - 'name' => $item->getName(), + 'name' => $item->getTitle(), 'description' => $item->getDescription(), ]); diff --git a/public/main/ticket/status.php b/public/main/ticket/status.php index f903d85e02..9ba3e1b93f 100644 --- a/public/main/ticket/status.php +++ b/public/main/ticket/status.php @@ -93,7 +93,7 @@ switch ($action) { $item = TicketManager::getStatus($id); $form->setDefaults([ - 'name' => $item->getName(), + 'name' => $item->getTitle(), 'description' => $item->getDescription(), ]); $formToString = $form->returnForm(); diff --git a/public/main/ticket/ticket_details.php b/public/main/ticket/ticket_details.php index dfcdb49b7f..c3e23e1d73 100644 --- a/public/main/ticket/ticket_details.php +++ b/public/main/ticket/ticket_details.php @@ -267,14 +267,14 @@ if ($allowEdition ); $newPriorityTitle = '-'; if ($newPriority) { - $newPriorityTitle = $newPriority->getName(); + $newPriorityTitle = $newPriority->getTitle(); } $oldPriority = TicketManager::getPriority( $ticket['ticket']['priority_id'] ); $oldPriorityTitle = '-'; if ($oldPriority) { - $oldPriorityTitle = $oldPriority->getName(); + $oldPriorityTitle = $oldPriority->getTitle(); } $messageToSend .= sprintf( get_lang('Priority changed from %s to %s'), @@ -289,7 +289,7 @@ if ($allowEdition ); $newTitle = '-'; if ($newStatus) { - $newTitle = $newStatus->getName(); + $newTitle = $newStatus->getTitle(); } $oldStatus = TicketManager::getStatus( $ticket['ticket']['status_id'] diff --git a/public/main/ticket/tutor_report.lib.php b/public/main/ticket/tutor_report.lib.php index 7674b2b11e..6425da33fc 100644 --- a/public/main/ticket/tutor_report.lib.php +++ b/public/main/ticket/tutor_report.lib.php @@ -96,7 +96,7 @@ function showResults($courseInfo, $weeksCount, $page) $results = []; $tableExport = []; - $sqlHeader = "SELECT rs.id as id,rs.week_id, w.title AS work_title, t.thread_title ,'EVALUATION' as eval_title ,'QUIZ' as pc_title + $sqlHeader = "SELECT rs.id as id,rs.week_id, w.title AS work_title, t.title ,'EVALUATION' as eval_title ,'QUIZ' as pc_title FROM $tableWeeklyReport rs LEFT JOIN $tableThread t ON t.thread_id = rs.forum_id LEFT JOIN $tableWork w ON w.id = rs.work_id @@ -114,7 +114,7 @@ function showResults($courseInfo, $weeksCount, $page) //$fila_export_encabezado[] = utf8_decode('Eval'.$rowe['week_id']); //$fila_export_encabezado[] = utf8_decode('PC'.$rowe['week_id']); $lineHeaderExport2[] = utf8_decode($rowe['work_title']); - $lineHeaderExport2[] = utf8_decode($rowe['thread_title']); + $lineHeaderExport2[] = utf8_decode($rowe['title']); //$fila_export_encabezado2[] = utf8_decode($rowe['eval_title']); //$fila_export_encabezado2[] = utf8_decode($rowe['pc_title']); $fila_export = ['Work'.$rowe['week_id'], 'Forum'.$rowe['week_id'], 'Eval'.$rowe['week_id'], 'PC'.$rowe['week_id']]; @@ -126,7 +126,7 @@ function showResults($courseInfo, $weeksCount, $page) '; $line .= ' Forum'.$rowe['week_id'].' -
'.$rowe['thread_title'].'
+
'.$rowe['title'].'
'; } diff --git a/public/main/tracking/courseLog.php b/public/main/tracking/courseLog.php index 89cff880d1..270d62f02e 100644 --- a/public/main/tracking/courseLog.php +++ b/public/main/tracking/courseLog.php @@ -1040,7 +1040,7 @@ if ($export_csv) { $sessionDates = SessionManager::parseSessionDates($session); array_unshift($csvContentInSession, [get_lang('Date'), $sessionDates['access']]); - array_unshift($csvContentInSession, [get_lang('Session name'), $session->getName()]); + array_unshift($csvContentInSession, [get_lang('Session name'), $session->getTitle()]); } Export::arrayToCsv($csvContentInSession, 'reporting_student_list'); diff --git a/public/main/tracking/exams.php b/public/main/tracking/exams.php index 9a38fe0aea..314f507702 100644 --- a/public/main/tracking/exams.php +++ b/public/main/tracking/exams.php @@ -228,7 +228,7 @@ if (!empty($courseList)) { } $sql = "SELECT visibility FROM $toolTable - WHERE c_id = $courseId AND name = 'quiz'"; + WHERE c_id = $courseId AND title = 'quiz'"; $result = Database::query($sql); // If main tool is visible. diff --git a/public/main/tracking/lp_report.php b/public/main/tracking/lp_report.php index 51c19515ab..4491b05a87 100644 --- a/public/main/tracking/lp_report.php +++ b/public/main/tracking/lp_report.php @@ -404,7 +404,7 @@ $headers[] = get_lang('FirstName'); $headers[] = get_lang('LastName'); $headers[] = get_lang('Username'); foreach ($lps as $lp) { - $lpName = $lp->getName(); + $lpName = $lp->getTitle(); $headers[] = get_lang('Progress').': '.$lpName; $headers[] = get_lang('FirstAccess').': '.$lpName; $headers[] = get_lang('LastAccess').': '.$lpName; diff --git a/public/main/user/add_users_to_session.php b/public/main/user/add_users_to_session.php index 9aef768350..c5fc3aaa89 100644 --- a/public/main/user/add_users_to_session.php +++ b/public/main/user/add_users_to_session.php @@ -487,7 +487,7 @@ if ('true' === $allowTutors) { } ?>" style="margin:0px;" > - '.$tool_name.' ('.$session->getName().') '; ?> + '.$tool_name.' ('.$session->getTitle().') '; ?> getName() + ).' '.$session->getTitle() ); echo Display::page_subheader(get_lang('General properties').$url); ?> @@ -118,7 +118,7 @@ if ('true' === $allowTutors) { getCategory()) { ?> - getCategory()->getName(); ?> + getCategory()->getTitle(); ?> diff --git a/public/main/webservices/api/tests/CreateSessionFromModelTest.php b/public/main/webservices/api/tests/CreateSessionFromModelTest.php index 7b9a76c7c0..d9fc629d20 100644 --- a/public/main/webservices/api/tests/CreateSessionFromModelTest.php +++ b/public/main/webservices/api/tests/CreateSessionFromModelTest.php @@ -79,7 +79,7 @@ class CreateSessionFromModelTest extends V2TestCase { // create a promotion $career = new Career(); - $careerId = $career->save(['name' => 'test career'.time()]); + $careerId = $career->save(['title' => 'test career'.time()]); $promotion = new Promotion(); $promotionId = $promotion->save(['career_id' => $careerId, 'name' => 'test promo'.time()]); diff --git a/public/main/webservices/cm_webservice_forum.php b/public/main/webservices/cm_webservice_forum.php index 5b9ae0748d..abe2406e87 100644 --- a/public/main/webservices/cm_webservice_forum.php +++ b/public/main/webservices/cm_webservice_forum.php @@ -100,7 +100,7 @@ class WSCMForum extends WSCM switch ($field) { case 'title': $htmlcode = true; - $field_table = "thread_title"; + $field_table = "title"; break; case 'date': $field_table = "thread_date"; @@ -143,7 +143,7 @@ class WSCMForum extends WSCM $thread_info = Database::fetch_array($result); $htmlcode = true; - $field_table = "thread_title"; + $field_table = "title"; return $thread_info[$field_table]; } else { @@ -271,7 +271,7 @@ class WSCMForum extends WSCM $postDate = new DateTime(api_get_utc_datetime(), new DateTimeZone('UTC')); $post = new \Chamilo\CourseBundle\Entity\CForumPost(); $post - ->setPostTitle($title) + ->setTitle($title) ->setPostText(isset($content) ? (api_html_entity_decode($content)) : null) ->setThread($thread_id) ->setForumId($forum_id) diff --git a/public/main/webservices/lp.php b/public/main/webservices/lp.php index ec04de6163..1498c8f70f 100644 --- a/public/main/webservices/lp.php +++ b/public/main/webservices/lp.php @@ -230,7 +230,7 @@ function WSImportLP($params) $userId ); $entity - ->setName($lpName) + ->setTitle($lpName) ->setContentLocal($proximity) ->setContentMaker($maker) ; diff --git a/public/main/work/student_work.php b/public/main/work/student_work.php index caa7dad2a8..59d0b868b4 100644 --- a/public/main/work/student_work.php +++ b/public/main/work/student_work.php @@ -41,7 +41,7 @@ if (!empty($group_id)) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), - 'name' => get_lang('Group area').' '.$group->getName(), + 'name' => get_lang('Group area').' '.$group->getTitle(), ]; } else { if (!(api_is_allowed_to_edit() || api_is_coach())) { diff --git a/public/main/work/work_list.php b/public/main/work/work_list.php index 3ce6b7038e..fe6b6f220c 100644 --- a/public/main/work/work_list.php +++ b/public/main/work/work_list.php @@ -49,7 +49,7 @@ if (!empty($group_id)) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), - 'name' => get_lang('Group area').' '.$group->getName(), + 'name' => get_lang('Group area').' '.$group->getTitle(), ]; } diff --git a/public/main/work/work_list_all.php b/public/main/work/work_list_all.php index fbf62fabd5..6fcbf969e3 100644 --- a/public/main/work/work_list_all.php +++ b/public/main/work/work_list_all.php @@ -67,7 +67,7 @@ if (!empty($group_id)) { $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), - 'name' => get_lang('Group area').' '.$group_properties->getName(), + 'name' => get_lang('Group area').' '.$group_properties->getTitle(), ]; } diff --git a/public/main/work/work_list_others.php b/public/main/work/work_list_others.php index 28560d80e0..d2bf6ac043 100644 --- a/public/main/work/work_list_others.php +++ b/public/main/work/work_list_others.php @@ -61,7 +61,7 @@ if (!empty($group_id)) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(), - 'name' => get_lang('Group area').' '.$group_properties->getName(), + 'name' => get_lang('Group area').' '.$group_properties->getTitle(), ]; } diff --git a/public/main/work/work_missing.php b/public/main/work/work_missing.php index 7a21e2c158..0c053ad3f8 100644 --- a/public/main/work/work_missing.php +++ b/public/main/work/work_missing.php @@ -78,7 +78,7 @@ if (!empty($group_id)) { ]; $interbreadcrumb[] = [ 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?gid='.$group_id, - 'name' => get_lang('Group area').' '.$group_properties->getName(), + 'name' => get_lang('Group area').' '.$group_properties->getTitle(), ]; } diff --git a/public/plugin/bbb/lib/bbb_plugin.class.php b/public/plugin/bbb/lib/bbb_plugin.class.php index a97646dd88..0bf70f09f4 100644 --- a/public/plugin/bbb/lib/bbb_plugin.class.php +++ b/public/plugin/bbb/lib/bbb_plugin.class.php @@ -293,7 +293,7 @@ class BBBPlugin extends Plugin Database::query($sql); // hack to get rid of Database::query warning (please add c_id...) - $sql = "DELETE FROM $t_tool WHERE name = 'bbb' AND c_id != 0"; + $sql = "DELETE FROM $t_tool WHERE title = 'bbb' AND c_id != 0"; Database::query($sql); if ($sm->tablesExist('plugin_bbb_room')) { diff --git a/public/plugin/customcertificate/src/export_pdf_all_in_one.php b/public/plugin/customcertificate/src/export_pdf_all_in_one.php index 2dd0dee040..cf76b6fb28 100644 --- a/public/plugin/customcertificate/src/export_pdf_all_in_one.php +++ b/public/plugin/customcertificate/src/export_pdf_all_in_one.php @@ -484,7 +484,7 @@ foreach ($userList as $userInfo) { $categoriesTempList = learnpath::getCategories($courseId); $categoryTest = new CLpCategory(); $categoryTest->setId(0); - $categoryTest->setName($plugin->get_lang('WithOutCategory')); + $categoryTest->setTitle($plugin->get_lang('WithOutCategory')); $categoryTest->setPosition(0); $categories = [$categoryTest]; @@ -526,8 +526,8 @@ foreach ($userList as $userInfo) { } if (count($categories) > 1 && count($flat_list) > 0) { - if ($item->getName() != $plugin->get_lang('WithOutCategory')) { - $items[] = '

'.$item->getName().'

'; + if ($item->getTitle() != $plugin->get_lang('WithOutCategory')) { + $items[] = '

'.$item->getTitle().'

'; } } diff --git a/public/plugin/customcertificate/src/print_certificate.php b/public/plugin/customcertificate/src/print_certificate.php index a8b0801283..5b280b2bd6 100644 --- a/public/plugin/customcertificate/src/print_certificate.php +++ b/public/plugin/customcertificate/src/print_certificate.php @@ -371,7 +371,7 @@ foreach ($userList as $userInfo) { $categoriesTempList = learnpath::getCategories($courseId); $categoryTest = new CLpCategory(); $categoryTest->setId(0); - $categoryTest->setName($plugin->get_lang('WithOutCategory')); + $categoryTest->setTitle($plugin->get_lang('WithOutCategory')); $categoryTest->setPosition(0); $categories = [$categoryTest]; @@ -413,8 +413,8 @@ foreach ($userList as $userInfo) { } if (count($categories) > 1 && count($flat_list) > 0) { - if ($item->getName() != $plugin->get_lang('WithOutCategory')) { - $items[] = '

'.$item->getName().'

'; + if ($item->getTitle() != $plugin->get_lang('WithOutCategory')) { + $items[] = '

'.$item->getTitle().'

'; } } diff --git a/public/plugin/dashboard/block_daily/block_daily.class.php b/public/plugin/dashboard/block_daily/block_daily.class.php index 642f1fe8f2..79486b42a6 100644 --- a/public/plugin/dashboard/block_daily/block_daily.class.php +++ b/public/plugin/dashboard/block_daily/block_daily.class.php @@ -164,7 +164,7 @@ class BlockDaily extends Block // Attendance table $table_course = Database::get_course_table(TABLE_ATTENDANCE); - $sql = "SELECT id, name, attendance_qualify_max FROM $table_course + $sql = "SELECT id, title, attendance_qualify_max FROM $table_course WHERE c_id = ".$course_info['real_id'].' AND active = 1 AND session_id = 0'; $rs = Database::query($sql); $attendance = []; diff --git a/public/plugin/learning_calendar/LearningCalendarPlugin.php b/public/plugin/learning_calendar/LearningCalendarPlugin.php index fefca69938..fc7ee1b82c 100644 --- a/public/plugin/learning_calendar/LearningCalendarPlugin.php +++ b/public/plugin/learning_calendar/LearningCalendarPlugin.php @@ -699,7 +699,7 @@ class LearningCalendarPlugin extends Plugin $tableEvaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION); $tableCourse = Database::get_main_table(TABLE_MAIN_COURSE); $tableResult = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT); - $sql = "SELECT DISTINCT e.name, e.id + $sql = "SELECT DISTINCT e.title, e.id FROM $tableEvaluation e INNER JOIN $tableCourse c ON (course_code = c.code) diff --git a/src/CoreBundle/Controller/Api/CreateCGlossaryAction.php b/src/CoreBundle/Controller/Api/CreateCGlossaryAction.php index e02dc58c2f..8c145106c6 100644 --- a/src/CoreBundle/Controller/Api/CreateCGlossaryAction.php +++ b/src/CoreBundle/Controller/Api/CreateCGlossaryAction.php @@ -23,7 +23,7 @@ class CreateCGlossaryAction extends BaseResourceFileAction $description = $data['description']; $parentResourceNodeId = $data['parentResourceNodeId']; $resourceLinkList = json_decode($data['resourceLinkList'], true); - $sid = (int) $data['sid']; + $sid = isset($data['sid']) ? (int) $data['sid'] : null; $cid = (int) $data['cid']; $course = null; diff --git a/src/CoreBundle/Controller/Api/UpdateCGlossaryAction.php b/src/CoreBundle/Controller/Api/UpdateCGlossaryAction.php index c58e8093ad..d7f8c5c6bb 100644 --- a/src/CoreBundle/Controller/Api/UpdateCGlossaryAction.php +++ b/src/CoreBundle/Controller/Api/UpdateCGlossaryAction.php @@ -23,7 +23,7 @@ class UpdateCGlossaryAction extends BaseResourceFileAction $description = $data['description']; $parentResourceNodeId = $data['parentResourceNodeId']; $resourceLinkList = json_decode($data['resourceLinkList'], true); - $sid = (int) $data['sid']; + $sid = isset($data['sid']) ? (int) $data['sid'] : null; $cid = (int) $data['cid']; $course = null; diff --git a/src/CoreBundle/Controller/CourseController.php b/src/CoreBundle/Controller/CourseController.php index e109b542d1..52bb2cf741 100644 --- a/src/CoreBundle/Controller/CourseController.php +++ b/src/CoreBundle/Controller/CourseController.php @@ -250,14 +250,14 @@ class CourseController extends ToolBaseController ): RedirectResponse { /** @var CTool|null $tool */ $tool = $repo->findOneBy([ - 'name' => $toolName, + 'title' => $toolName, ]); if (null === $tool) { throw new NotFoundHttpException($this->trans('Tool not found')); } - $tool = $toolChain->getToolFromName($tool->getTool()->getName()); + $tool = $toolChain->getToolFromName($tool->getTool()->getTitle()); $link = $tool->getLink(); if (null === $this->getCourse()) { diff --git a/src/CoreBundle/Controller/ResourceController.php b/src/CoreBundle/Controller/ResourceController.php index dcc87e3f2d..37b2da192c 100644 --- a/src/CoreBundle/Controller/ResourceController.php +++ b/src/CoreBundle/Controller/ResourceController.php @@ -359,10 +359,10 @@ class ResourceController extends AbstractResourceController implements CourseCon /** @var CTool $item */ foreach ($result as $item) { - if (\in_array($item->getName(), $skipTools, true)) { + if (\in_array($item->getTitle(), $skipTools, true)) { continue; } - $toolModel = $toolChain->getToolFromName($item->getTool()->getName()); + $toolModel = $toolChain->getToolFromName($item->getTool()->getTitle()); if (!\in_array($toolModel->getCategory(), ['authoring', 'interaction'], true)) { continue; diff --git a/src/CoreBundle/DataFixtures/CourseCategoryFixtures.php b/src/CoreBundle/DataFixtures/CourseCategoryFixtures.php index 889a10b06b..2a149579d5 100644 --- a/src/CoreBundle/DataFixtures/CourseCategoryFixtures.php +++ b/src/CoreBundle/DataFixtures/CourseCategoryFixtures.php @@ -33,7 +33,7 @@ class CourseCategoryFixtures extends Fixture foreach ($list as $key => $data) { $courseCategory = (new CourseCategory()) - ->setName($data['name']) + ->setTitle($data['name']) ->setCode($data['code']) ->setTreePos($key + 1) ->addUrl($url) diff --git a/src/CoreBundle/DataFixtures/CourseTypeFixtures.php b/src/CoreBundle/DataFixtures/CourseTypeFixtures.php index 952d1cd2f9..09d1506d79 100644 --- a/src/CoreBundle/DataFixtures/CourseTypeFixtures.php +++ b/src/CoreBundle/DataFixtures/CourseTypeFixtures.php @@ -21,7 +21,7 @@ class CourseTypeFixtures extends Fixture foreach ($list as $name) { $courseType = (new CourseType()) - ->setName($name) + ->setTitle($name) ; $manager->persist($courseType); } diff --git a/src/CoreBundle/DataFixtures/ResourceFormatFixtures.php b/src/CoreBundle/DataFixtures/ResourceFormatFixtures.php index 38c07b2899..185afcc05f 100644 --- a/src/CoreBundle/DataFixtures/ResourceFormatFixtures.php +++ b/src/CoreBundle/DataFixtures/ResourceFormatFixtures.php @@ -25,7 +25,7 @@ class ResourceFormatFixtures extends Fixture foreach ($list as $key => $data) { $resourceFormat = (new ResourceFormat()) - ->setName($data['name']) + ->setTitle($data['name']) ; $manager->persist($resourceFormat); } diff --git a/src/CoreBundle/DataFixtures/SequenceFixtures.php b/src/CoreBundle/DataFixtures/SequenceFixtures.php index 17489ae5b4..018f15886f 100644 --- a/src/CoreBundle/DataFixtures/SequenceFixtures.php +++ b/src/CoreBundle/DataFixtures/SequenceFixtures.php @@ -212,7 +212,7 @@ class SequenceFixtures extends Fixture $variables = []; foreach ($list as $item) { $sequenceVariable = (new SequenceVariable()) - ->setName($item['name']) + ->setTitle($item['name']) ->setDescription($item['description']) ->setDefaultValue($item['default_val']) ; @@ -315,7 +315,7 @@ class SequenceFixtures extends Fixture foreach ($list as $item) { $sequenceType = (new SequenceTypeEntity()) - ->setName($item['name']) + ->setTitle($item['name']) ->setDescription($item['description']) ->setEntityTable($item['entity_table']) ; diff --git a/src/CoreBundle/DataFixtures/SkillFixtures.php b/src/CoreBundle/DataFixtures/SkillFixtures.php index 55d26d60ec..3ca03b0c05 100644 --- a/src/CoreBundle/DataFixtures/SkillFixtures.php +++ b/src/CoreBundle/DataFixtures/SkillFixtures.php @@ -19,7 +19,7 @@ class SkillFixtures extends Fixture // @todo check if we still need skill_rel_skill $skill = (new Skill()) - ->setName('Root') + ->setTitle('Root') ->setShortCode('root') ->setAccessUrlId(1) ; diff --git a/src/CoreBundle/DataFixtures/TicketFixtures.php b/src/CoreBundle/DataFixtures/TicketFixtures.php index bef571811b..f82957f288 100644 --- a/src/CoreBundle/DataFixtures/TicketFixtures.php +++ b/src/CoreBundle/DataFixtures/TicketFixtures.php @@ -34,7 +34,7 @@ class TicketFixtures extends Fixture implements ContainerAwareInterface $ticketProject = new TicketProject(); $ticketProject - ->setName('Ticket System') + ->setTitle('Ticket System') ->setInsertUserId($adminId) ; @@ -55,7 +55,7 @@ class TicketFixtures extends Fixture implements ContainerAwareInterface // Online evaluation requires a course $ticketCategory = new TicketCategory(); $ticketCategory - ->setName($category) + ->setTitle($category) ->setDescription($description) ->setProject($ticketProject) ->setInsertUserId($adminId) @@ -78,7 +78,7 @@ class TicketFixtures extends Fixture implements ContainerAwareInterface foreach ($defaultPriorities as $code => $priority) { $ticketPriority = new TicketPriority(); $ticketPriority - ->setName($priority) + ->setTitle($priority) ->setCode($code) ->setInsertUserId($adminId) ; @@ -100,7 +100,7 @@ class TicketFixtures extends Fixture implements ContainerAwareInterface foreach ($defaultStatus as $code => $status) { $ticketStatus = new TicketStatus(); $ticketStatus - ->setName($status) + ->setTitle($status) ->setCode($code) ; $manager->persist($ticketStatus); diff --git a/src/CoreBundle/DataTransformer/CourseToolDataTranformer.php b/src/CoreBundle/DataTransformer/CourseToolDataTranformer.php index 00a1d9b98d..e631eaeed7 100644 --- a/src/CoreBundle/DataTransformer/CourseToolDataTranformer.php +++ b/src/CoreBundle/DataTransformer/CourseToolDataTranformer.php @@ -33,7 +33,7 @@ class CourseToolDataTranformer implements DataTransformerInterface $tool = $object->getTool(); $toolModel = $this->toolChain->getToolFromName( - $tool->getName() + $tool->getTitle() ); $course = $this->getCourse(); diff --git a/src/CoreBundle/Entity/BranchSync.php b/src/CoreBundle/Entity/BranchSync.php index ad30943535..9878cade76 100644 --- a/src/CoreBundle/Entity/BranchSync.php +++ b/src/CoreBundle/Entity/BranchSync.php @@ -33,8 +33,8 @@ class BranchSync #[ORM\Column(name: 'unique_id', type: 'string', length: 50, nullable: false, unique: true)] protected string $uniqueId; - #[ORM\Column(name: 'branch_name', type: 'string', length: 250)] - protected string $branchName; + #[ORM\Column(name: 'title', type: 'string', length: 250)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -128,21 +128,21 @@ class BranchSync return $this->id; } - public function setBranchName(string $branchName): self + public function setTitle(string $title): self { - $this->branchName = $branchName; + $this->title = $title; return $this; } /** - * Get branchName. + * Get title. * * @return string */ - public function getBranchName() + public function getTitle() { - return $this->branchName; + return $this->title; } public function setBranchIp(string $branchIp): self diff --git a/src/CoreBundle/Entity/Career.php b/src/CoreBundle/Entity/Career.php index 4cfa58cec2..9b68a63bca 100644 --- a/src/CoreBundle/Entity/Career.php +++ b/src/CoreBundle/Entity/Career.php @@ -30,8 +30,8 @@ class Career protected ?int $id = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: false)] protected ?string $description = null; @@ -62,16 +62,16 @@ class Career return $this->id; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setDescription(string $description): self diff --git a/src/CoreBundle/Entity/ChatVideo.php b/src/CoreBundle/Entity/ChatVideo.php index 013baf3603..6f8735b726 100644 --- a/src/CoreBundle/Entity/ChatVideo.php +++ b/src/CoreBundle/Entity/ChatVideo.php @@ -16,7 +16,7 @@ use Doctrine\ORM\Mapping as ORM; #[ORM\Index(name: 'idx_chat_video_to_user', columns: ['to_user'])] #[ORM\Index(name: 'idx_chat_video_from_user', columns: ['from_user'])] #[ORM\Index(name: 'idx_chat_video_users', columns: ['from_user', 'to_user'])] -#[ORM\Index(name: 'idx_chat_video_room_name', columns: ['room_name'])] +#[ORM\Index(name: 'idx_chat_video_title', columns: ['title'])] #[ORM\Entity] class ChatVideo { @@ -31,8 +31,8 @@ class ChatVideo #[ORM\Column(name: 'to_user', type: 'integer', nullable: false)] protected int $toUser; - #[ORM\Column(name: 'room_name', type: 'string', nullable: false)] - protected string $roomName; + #[ORM\Column(name: 'title', type: 'string', nullable: false)] + protected string $title; #[ORM\Column(name: 'datetime', type: 'datetime', nullable: false)] protected DateTime $datetime; @@ -82,25 +82,25 @@ class ChatVideo } /** - * Set room_name. + * Set title. * * @return ChatVideo */ - public function setRoomName(string $roomName) + public function setTitle(string $title) { - $this->roomName = $roomName; + $this->title = $title; return $this; } /** - * Get room_name. + * Get title. * * @return string */ - public function getRoomName() + public function getTitle() { - return $this->roomName; + return $this->title; } /** diff --git a/src/CoreBundle/Entity/CourseCategory.php b/src/CoreBundle/Entity/CourseCategory.php index 0491f2b22d..c610afd9b6 100644 --- a/src/CoreBundle/Entity/CourseCategory.php +++ b/src/CoreBundle/Entity/CourseCategory.php @@ -71,8 +71,8 @@ class CourseCategory implements Stringable protected Collection $children; #[Assert\NotBlank] #[Groups(['course_category:read', 'course_category:write', 'course:read', 'session:read'])] - #[ORM\Column(name: 'name', type: 'text', nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'text', nullable: false)] + protected string $title; #[Assert\NotBlank] #[Groups(['course_category:read', 'course_category:write', 'course:read'])] #[ORM\Column(name: 'code', type: 'string', length: 40, nullable: false)] @@ -124,7 +124,7 @@ class CourseCategory implements Stringable public function __toString(): string { - $name = strip_tags($this->name); + $name = strip_tags($this->title); return sprintf('%s (%s)', $name, $this->code); } @@ -167,14 +167,14 @@ class CourseCategory implements Stringable return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/CourseType.php b/src/CoreBundle/Entity/CourseType.php index f0b53ad9f4..c6fd7a5b5e 100644 --- a/src/CoreBundle/Entity/CourseType.php +++ b/src/CoreBundle/Entity/CourseType.php @@ -17,8 +17,8 @@ class CourseType #[ORM\GeneratedValue(strategy: 'IDENTITY')] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 50, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 50, nullable: false)] + protected string $title; #[ORM\Column(name: 'translation_var', type: 'string', length: 40, nullable: true)] protected ?string $translationVar = null; @@ -29,21 +29,21 @@ class CourseType #[ORM\Column(name: 'props', type: 'text', nullable: true)] protected ?string $props = null; - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } /** - * Get name. + * Get title. * * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } public function setTranslationVar(string $translationVar): self diff --git a/src/CoreBundle/Entity/GradeModel.php b/src/CoreBundle/Entity/GradeModel.php index 2052410378..19bb97ac3d 100644 --- a/src/CoreBundle/Entity/GradeModel.php +++ b/src/CoreBundle/Entity/GradeModel.php @@ -20,8 +20,8 @@ class GradeModel #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -35,21 +35,21 @@ class GradeModel #[ORM\Column(name: 'default_external_eval_prefix', type: 'string', length: 140, nullable: true)] protected ?string $defaultExternalEvalPrefix = null; - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } /** - * Get name. + * Get title. * * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } public function setDescription(string $description): self diff --git a/src/CoreBundle/Entity/GradebookCategory.php b/src/CoreBundle/Entity/GradebookCategory.php index 91c9be6708..8916b1d32b 100644 --- a/src/CoreBundle/Entity/GradebookCategory.php +++ b/src/CoreBundle/Entity/GradebookCategory.php @@ -49,8 +49,8 @@ class GradebookCategory protected ?int $id = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'text', nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'text', nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description; @@ -174,16 +174,16 @@ class GradebookCategory return $this->id; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setDescription(?string $description): self diff --git a/src/CoreBundle/Entity/GradebookEvaluation.php b/src/CoreBundle/Entity/GradebookEvaluation.php index 0821024870..c2231d9321 100644 --- a/src/CoreBundle/Entity/GradebookEvaluation.php +++ b/src/CoreBundle/Entity/GradebookEvaluation.php @@ -27,8 +27,8 @@ class GradebookEvaluation protected ?int $id = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'text', nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'text', nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -87,21 +87,21 @@ class GradebookEvaluation $this->visible = 1; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } /** - * Get name. + * Get title. * * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } public function setDescription(?string $description): self diff --git a/src/CoreBundle/Entity/GradebookLinkevalLog.php b/src/CoreBundle/Entity/GradebookLinkevalLog.php index 77ded266eb..7e169f27c9 100644 --- a/src/CoreBundle/Entity/GradebookLinkevalLog.php +++ b/src/CoreBundle/Entity/GradebookLinkevalLog.php @@ -25,8 +25,8 @@ class GradebookLinkevalLog #[ORM\Column(name: 'id_linkeval_log', type: 'integer', nullable: false)] protected int $idLinkevalLog; - #[ORM\Column(name: 'name', type: 'text')] - protected string $name; + #[ORM\Column(name: 'title', type: 'text')] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -70,21 +70,21 @@ class GradebookLinkevalLog return $this->idLinkevalLog; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } /** - * Get name. + * Get title. * * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } public function setDescription(string $description): self diff --git a/src/CoreBundle/Entity/Illustration.php b/src/CoreBundle/Entity/Illustration.php index ad1a8628f5..0c61c3551c 100644 --- a/src/CoreBundle/Entity/Illustration.php +++ b/src/CoreBundle/Entity/Illustration.php @@ -26,28 +26,28 @@ class Illustration extends AbstractResource implements ResourceInterface, String #[ORM\Id] protected Uuid $id; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; public function __construct() { $this->id = Uuid::v4(); - $this->name = 'illustration'; + $this->title = 'illustration'; } public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } public function getId(): Uuid { return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } @@ -57,10 +57,10 @@ class Illustration extends AbstractResource implements ResourceInterface, String } public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CoreBundle/Entity/Level.php b/src/CoreBundle/Entity/Level.php index 2ed935f08a..695740e4d1 100644 --- a/src/CoreBundle/Entity/Level.php +++ b/src/CoreBundle/Entity/Level.php @@ -22,15 +22,15 @@ class Level implements Stringable #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[Gedmo\SortablePosition] #[ORM\Column(name: 'position', type: 'integer')] protected int $position; - #[ORM\Column(name: 'short_name', type: 'string', length: 255, nullable: false)] - protected string $shortName; + #[ORM\Column(name: 'short_title', type: 'string', length: 255, nullable: false)] + protected string $shortTitle; #[Gedmo\SortableGroup] #[ORM\ManyToOne(targetEntity: Profile::class, inversedBy: 'levels')] @@ -39,7 +39,7 @@ class Level implements Stringable public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } /** @@ -53,14 +53,14 @@ class Level implements Stringable /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } @@ -77,14 +77,14 @@ class Level implements Stringable return $this; } - public function getShortName(): string + public function getShortTitle(): string { - return $this->shortName; + return $this->shortTitle; } - public function setShortName(string $shortName): self + public function setShortTitle(string $shortTitle): self { - $this->shortName = $shortName; + $this->shortTitle = $shortTitle; return $this; } diff --git a/src/CoreBundle/Entity/MailTemplate.php b/src/CoreBundle/Entity/MailTemplate.php index e55d4d68a7..526edb31e4 100644 --- a/src/CoreBundle/Entity/MailTemplate.php +++ b/src/CoreBundle/Entity/MailTemplate.php @@ -20,8 +20,8 @@ class MailTemplate #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', nullable: false)] + protected string $title; #[ORM\Column(name: 'template', type: 'text', nullable: true)] protected ?string $template = null; diff --git a/src/CoreBundle/Entity/Profile.php b/src/CoreBundle/Entity/Profile.php index 5f378c8ae5..f3cc5be07c 100644 --- a/src/CoreBundle/Entity/Profile.php +++ b/src/CoreBundle/Entity/Profile.php @@ -20,8 +20,8 @@ class Profile implements Stringable #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; /** * @var Collection @@ -44,7 +44,7 @@ class Profile implements Stringable public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } /** @@ -55,14 +55,14 @@ class Profile implements Stringable return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/Promotion.php b/src/CoreBundle/Entity/Promotion.php index bd7ead9615..1711f9efb0 100644 --- a/src/CoreBundle/Entity/Promotion.php +++ b/src/CoreBundle/Entity/Promotion.php @@ -27,8 +27,8 @@ class Promotion protected ?int $id = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: false)] protected ?string $description = null; @@ -69,16 +69,16 @@ class Promotion return $this->id; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setDescription(string $description): self diff --git a/src/CoreBundle/Entity/Resource/ResourceTag.php b/src/CoreBundle/Entity/Resource/ResourceTag.php index 65b289276a..3cac734c60 100644 --- a/src/CoreBundle/Entity/Resource/ResourceTag.php +++ b/src/CoreBundle/Entity/Resource/ResourceTag.php @@ -21,8 +21,8 @@ class ResourceTag #[ORM\GeneratedValue(strategy: 'AUTO')] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', nullable: false)] + protected string $title; #[ORM\ManyToOne(targetEntity: User::class)] #[ORM\JoinColumn(name: 'author_id', referencedColumnName: 'id', onDelete: 'SET NULL')] diff --git a/src/CoreBundle/Entity/ResourceFormat.php b/src/CoreBundle/Entity/ResourceFormat.php index 06d30a79b1..0c96fd2f50 100644 --- a/src/CoreBundle/Entity/ResourceFormat.php +++ b/src/CoreBundle/Entity/ResourceFormat.php @@ -25,7 +25,7 @@ class ResourceFormat #[ORM\Column] #[Assert\NotBlank] - protected string $name; + protected string $title; /** * @var Collection @@ -40,7 +40,7 @@ class ResourceFormat public function __toString(): string { - return $this->name; + return $this->title; } public function getId(): int @@ -48,14 +48,14 @@ class ResourceFormat return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/ResourceType.php b/src/CoreBundle/Entity/ResourceType.php index eb07a7fb6c..8560a1d817 100644 --- a/src/CoreBundle/Entity/ResourceType.php +++ b/src/CoreBundle/Entity/ResourceType.php @@ -29,7 +29,7 @@ class ResourceType implements Stringable #[Assert\NotBlank] #[ORM\Column] #[Groups(['resource_node:read'])] - protected string $name; + protected string $title; #[ORM\ManyToOne(targetEntity: Tool::class, inversedBy: 'resourceTypes')] #[ORM\JoinColumn(name: 'tool_id', referencedColumnName: 'id')] @@ -48,7 +48,7 @@ class ResourceType implements Stringable public function __toString(): string { - return $this->name; + return $this->title; } public function getId(): int @@ -56,14 +56,14 @@ class ResourceType implements Stringable return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/Sequence.php b/src/CoreBundle/Entity/Sequence.php index 2ffee3d68e..8ece04a5af 100644 --- a/src/CoreBundle/Entity/Sequence.php +++ b/src/CoreBundle/Entity/Sequence.php @@ -23,15 +23,15 @@ class Sequence implements Stringable #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string')] - protected string $name; + #[ORM\Column(name: 'title', type: 'string')] + protected string $title; #[ORM\Column(name: 'graph', type: 'text', nullable: true)] protected ?string $graph = null; public function __toString(): string { - return $this->name; + return $this->title; } /** @@ -45,14 +45,14 @@ class Sequence implements Stringable /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/SequenceRowEntity.php b/src/CoreBundle/Entity/SequenceRowEntity.php index 7647d1a8c5..7354e5f27e 100644 --- a/src/CoreBundle/Entity/SequenceRowEntity.php +++ b/src/CoreBundle/Entity/SequenceRowEntity.php @@ -26,8 +26,8 @@ class SequenceRowEntity #[ORM\Column(name: 'row_id', type: 'integer')] protected int $rowId; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\ManyToOne(targetEntity: SequenceTypeEntity::class)] #[ORM\JoinColumn(name: 'sequence_type_entity_id', referencedColumnName: 'id')] @@ -91,14 +91,14 @@ class SequenceRowEntity /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/SequenceTypeEntity.php b/src/CoreBundle/Entity/SequenceTypeEntity.php index d7d0ce806e..6a168c0c4c 100644 --- a/src/CoreBundle/Entity/SequenceTypeEntity.php +++ b/src/CoreBundle/Entity/SequenceTypeEntity.php @@ -17,8 +17,8 @@ class SequenceTypeEntity #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: false)] protected string $description; @@ -39,14 +39,14 @@ class SequenceTypeEntity /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/SequenceVariable.php b/src/CoreBundle/Entity/SequenceVariable.php index 131162692f..af2cad125b 100644 --- a/src/CoreBundle/Entity/SequenceVariable.php +++ b/src/CoreBundle/Entity/SequenceVariable.php @@ -19,8 +19,8 @@ class SequenceVariable protected ?int $id = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', nullable: true)] - protected ?string $name = null; + #[ORM\Column(name: 'title', type: 'string', nullable: true)] + protected ?string $title = null; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -41,14 +41,14 @@ class SequenceVariable /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/Session.php b/src/CoreBundle/Entity/Session.php index ffa5a0f161..afb18c6d79 100644 --- a/src/CoreBundle/Entity/Session.php +++ b/src/CoreBundle/Entity/Session.php @@ -46,15 +46,16 @@ use Symfony\Component\Validator\Constraints as Assert; denormalizationContext: ['groups' => ['session:write']], security: "is_granted('ROLE_ADMIN')" )] + #[ORM\Table(name: 'session')] -#[ORM\UniqueConstraint(name: 'name', columns: ['name'])] +#[ORM\UniqueConstraint(name: 'title', columns: ['title'])] #[ORM\EntityListeners([SessionListener::class])] #[ORM\Entity(repositoryClass: SessionRepository::class)] -#[UniqueEntity('name')] -#[ApiFilter(filterClass: SearchFilter::class, properties: ['name' => 'partial'])] +#[UniqueEntity('title')] +#[ApiFilter(filterClass: SearchFilter::class, properties: ['title' => 'partial'])] #[ApiFilter(filterClass: PropertyFilter::class)] -#[ApiFilter(filterClass: OrderFilter::class, properties: ['id', 'name'])] -class Session implements ResourceWithAccessUrlInterface, Stringable +#[ApiFilter(filterClass: OrderFilter::class, properties: ['id', 'title'])] +class Session implements ResourceWithAccessUrlInterface, \Stringable { public const VISIBLE = 1; public const READ_ONLY = 2; @@ -171,8 +172,8 @@ class Session implements ResourceWithAccessUrlInterface, Stringable 'course:read', 'track_e_exercise:read', ])] - #[ORM\Column(name: 'name', type: 'string', length: 150)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 150)] + protected string $title; #[Groups([ 'session:read', @@ -327,7 +328,7 @@ class Session implements ResourceWithAccessUrlInterface, Stringable public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } public static function getRelationTypeList(): array @@ -507,6 +508,13 @@ class Session implements ResourceWithAccessUrlInterface, Stringable return $this; } + public function setTitle(string $title): self + { + $this->title = $title; + + return $this; + } + public function getCourseSubscription(Course $course): ?SessionRelCourse { $criteria = Criteria::create()->where(Criteria::expr()->eq('course', $course)); @@ -514,6 +522,11 @@ class Session implements ResourceWithAccessUrlInterface, Stringable return $this->courses->matching($criteria)->current(); } + public function getTitle(): string + { + return $this->title; + } + public function getNbrUsers(): int { return $this->nbrUsers; diff --git a/src/CoreBundle/Entity/SessionCategory.php b/src/CoreBundle/Entity/SessionCategory.php index 9c4c18ee81..beacd51802 100644 --- a/src/CoreBundle/Entity/SessionCategory.php +++ b/src/CoreBundle/Entity/SessionCategory.php @@ -38,8 +38,8 @@ class SessionCategory implements Stringable protected Collection $sessions; #[Groups(['session_category:read', 'session_category:write', 'session:read', 'session_rel_user:read'])] #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 100, nullable: false, unique: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 100, nullable: false, unique: false)] + protected string $title; #[ORM\Column(name: 'date_start', type: 'date', nullable: true, unique: false)] protected ?DateTime $dateStart = null; #[ORM\Column(name: 'date_end', type: 'date', nullable: true, unique: false)] @@ -50,7 +50,7 @@ class SessionCategory implements Stringable } public function __toString(): string { - return $this->name; + return $this->title; } public function setUrl(AccessUrl $url): self { @@ -72,15 +72,15 @@ class SessionCategory implements Stringable { return $this->id; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setDateStart(DateTime $dateStart): self { diff --git a/src/CoreBundle/Entity/Skill.php b/src/CoreBundle/Entity/Skill.php index a9f99a2c04..ac77735181 100644 --- a/src/CoreBundle/Entity/Skill.php +++ b/src/CoreBundle/Entity/Skill.php @@ -65,8 +65,8 @@ class Skill implements Stringable protected Collection $gradeBookCategories; #[Assert\NotBlank] #[Groups(['skill:read', 'skill:write'])] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[Assert\NotBlank] #[Groups(['skill:read', 'skill:write'])] #[ORM\Column(name: 'short_code', type: 'string', length: 100, nullable: false)] @@ -102,17 +102,19 @@ class Skill implements Stringable } public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } - public function setName(string $name): self + + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + + public function getTitle(): string { - return $this->name; + return $this->title; } public function getShortCode(): string { diff --git a/src/CoreBundle/Entity/SkillProfile.php b/src/CoreBundle/Entity/SkillProfile.php index 16acf9ccd3..92867c065a 100644 --- a/src/CoreBundle/Entity/SkillProfile.php +++ b/src/CoreBundle/Entity/SkillProfile.php @@ -19,27 +19,27 @@ class SkillProfile protected ?int $id = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: false)] protected string $description; - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } /** - * Get name. + * Get title. * * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } public function setDescription(string $description): self diff --git a/src/CoreBundle/Entity/SpecificField.php b/src/CoreBundle/Entity/SpecificField.php index 93dbea6feb..a12d5aa587 100644 --- a/src/CoreBundle/Entity/SpecificField.php +++ b/src/CoreBundle/Entity/SpecificField.php @@ -19,8 +19,8 @@ class SpecificField #[ORM\Column(name: 'code', type: 'string', length: 1, nullable: false)] protected string $code; - #[ORM\Column(name: 'name', type: 'string', length: 200, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 200, nullable: false)] + protected string $title; #[ORM\Column(name: 'id', type: 'integer')] #[ORM\Id] @@ -50,25 +50,25 @@ class SpecificField } /** - * Set name. + * Set title. * * @return SpecificField */ - public function setName(string $name) + public function setTitle(string $title) { - $this->name = $name; + $this->title = $title; return $this; } /** - * Get name. + * Get title. * * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } /** diff --git a/src/CoreBundle/Entity/TicketCategory.php b/src/CoreBundle/Entity/TicketCategory.php index 4ba39cdaf7..fad568250b 100644 --- a/src/CoreBundle/Entity/TicketCategory.php +++ b/src/CoreBundle/Entity/TicketCategory.php @@ -21,8 +21,8 @@ class TicketCategory #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -66,14 +66,14 @@ class TicketCategory /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/TicketPriority.php b/src/CoreBundle/Entity/TicketPriority.php index e35b4c323d..50e4167aac 100644 --- a/src/CoreBundle/Entity/TicketPriority.php +++ b/src/CoreBundle/Entity/TicketPriority.php @@ -21,8 +21,8 @@ class TicketPriority #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'code', type: 'string', length: 255, nullable: false)] protected string $code; @@ -66,14 +66,14 @@ class TicketPriority /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/TicketProject.php b/src/CoreBundle/Entity/TicketProject.php index 090a49355e..10ee9d2fb0 100644 --- a/src/CoreBundle/Entity/TicketProject.php +++ b/src/CoreBundle/Entity/TicketProject.php @@ -21,8 +21,8 @@ class TicketProject #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -61,14 +61,14 @@ class TicketProject /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/TicketStatus.php b/src/CoreBundle/Entity/TicketStatus.php index 86a22da4b5..79d8c6acfb 100644 --- a/src/CoreBundle/Entity/TicketStatus.php +++ b/src/CoreBundle/Entity/TicketStatus.php @@ -23,8 +23,8 @@ class TicketStatus #[ORM\Column(name: 'code', type: 'string', length: 255, nullable: false)] protected string $code; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; @@ -55,14 +55,14 @@ class TicketStatus /** * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/CoreBundle/Entity/Tool.php b/src/CoreBundle/Entity/Tool.php index 3ff59c1e68..0e98a0a759 100644 --- a/src/CoreBundle/Entity/Tool.php +++ b/src/CoreBundle/Entity/Tool.php @@ -28,8 +28,8 @@ class Tool implements Stringable #[Assert\NotBlank] #[Groups(['tool:read'])] - #[ORM\Column(name: 'name', type: 'string', nullable: false, unique: true)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', nullable: false, unique: true)] + protected string $title; /** * @var Collection @@ -44,7 +44,7 @@ class Tool implements Stringable public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } /*public function getToolResourceRight() @@ -86,16 +86,16 @@ class Tool implements Stringable return $this->id; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } /** @@ -110,7 +110,7 @@ class Tool implements Stringable { if (0 !== $this->resourceTypes->count()) { $criteria = Criteria::create()->where( - Criteria::expr()->eq('name', $resourceType->getName()) + Criteria::expr()->eq('title', $resourceType->getTitle()) ); $relation = $this->resourceTypes->matching($criteria); @@ -127,9 +127,9 @@ class Tool implements Stringable return $this; } - /*public function getResourceTypeByName(string $name): ?ResourceType + /*public function getResourceTypeByName(string $title): ?ResourceType { - $criteria = Criteria::create()->where(Criteria::expr()->eq('name', $name)); + $criteria = Criteria::create()->where(Criteria::expr()->eq('title', $title)); return $this->getResourceTypes()->matching($criteria)->first(); }*/ diff --git a/src/CoreBundle/Entity/TrackEHotpotatoes.php b/src/CoreBundle/Entity/TrackEHotpotatoes.php index bffe834612..2b870db1a8 100644 --- a/src/CoreBundle/Entity/TrackEHotpotatoes.php +++ b/src/CoreBundle/Entity/TrackEHotpotatoes.php @@ -23,8 +23,8 @@ class TrackEHotpotatoes #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'exe_name', type: 'string', length: 255, nullable: false)] - protected string $exeName; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'exe_user_id', type: 'integer', nullable: true)] protected ?int $exeUserId = null; @@ -42,25 +42,25 @@ class TrackEHotpotatoes protected int $maxScore; /** - * Set exeName. + * Set title. * * @return TrackEHotpotatoes */ - public function setExeName(string $exeName) + public function setTitle(string $title) { - $this->exeName = $exeName; + $this->title = $title; return $this; } /** - * Get exeName. + * Get title. * * @return string */ - public function getExeName() + public function getTitle() { - return $this->exeName; + return $this->title; } /** diff --git a/src/CoreBundle/Entity/Usergroup.php b/src/CoreBundle/Entity/Usergroup.php index 84e213ddcb..cf93e856e7 100644 --- a/src/CoreBundle/Entity/Usergroup.php +++ b/src/CoreBundle/Entity/Usergroup.php @@ -32,8 +32,8 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI #[ORM\GeneratedValue] protected ?int $id = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 255)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description = null; #[Assert\NotBlank] @@ -94,7 +94,7 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI } public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } /** @@ -158,15 +158,15 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI { return $this->id; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setDescription(string $description): self { @@ -178,7 +178,6 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI { return $this->description; } - public function getGroupType(): int { return $this->groupType; @@ -287,10 +286,10 @@ class Usergroup extends AbstractResource implements ResourceInterface, ResourceI } public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CoreBundle/Form/JuryType.php b/src/CoreBundle/Form/JuryType.php index cf92f6518b..9bf3b5e9fc 100644 --- a/src/CoreBundle/Form/JuryType.php +++ b/src/CoreBundle/Form/JuryType.php @@ -44,12 +44,12 @@ class JuryType extends AbstractType 'entity', [ 'class' => 'Entity\BranchSync', - 'property' => 'branchName', + 'property' => 'title', 'query_builder' => function (EntityRepository $er) { return $er->createQueryBuilder('u') - // ->where('u.role LIKE :role') - // ->setParameter(':role', 'ROLE_JURY%') - ->orderBy('u.branchName', Criteria::DESC) + //->where('u.role LIKE :role') + //->setParameter(':role', 'ROLE_JURY%') + ->orderBy('u.title', Criteria::DESC) ; }, ] diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20201215160445.php b/src/CoreBundle/Migrations/Schema/V200/Version20201215160445.php index cb12d0bef4..2389997d57 100644 --- a/src/CoreBundle/Migrations/Schema/V200/Version20201215160445.php +++ b/src/CoreBundle/Migrations/Schema/V200/Version20201215160445.php @@ -223,8 +223,8 @@ final class Version20201215160445 extends AbstractMigrationChamilo continue; } - if (empty(trim($resource->getPostTitle()))) { - $resource->setPostTitle(sprintf('Post #%s', $resource->getIid())); + if (empty(trim($resource->getTitle()))) { + $resource->setTitle(sprintf('Post #%s', $resource->getIid())); } $threadId = (int) $itemData['thread_id']; diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20230508153435.php b/src/CoreBundle/Migrations/Schema/V200/Version20230508153435.php new file mode 100644 index 0000000000..f0fb4c96da --- /dev/null +++ b/src/CoreBundle/Migrations/Schema/V200/Version20230508153435.php @@ -0,0 +1,563 @@ +hasTable('block')) { + $this->addSql( + 'ALTER TABLE block CHANGE name title varchar(255) COLLATE "utf8_unicode_ci" NULL' + ); + } + + if ($schema->hasTable('branch_sync')) { + $this->addSql( + 'ALTER TABLE branch_sync CHANGE branch_name title VARCHAR(250) NOT NULL' + ); + } + + if ($schema->hasTable('c_attendance')) { + $this->addSql( + 'ALTER TABLE c_attendance CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('c_blog')) { + $this->addSql( + 'ALTER TABLE c_blog CHANGE blog_name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('c_dropbox_category')) { + $this->addSql( + 'ALTER TABLE c_dropbox_category CHANGE cat_name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('c_exercise_category')) { + $this->addSql( + 'ALTER TABLE c_exercise_category CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_forum_category')) { + $this->addSql( + 'ALTER TABLE c_forum_category CHANGE cat_title title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_forum_forum')) { + $this->addSql( + 'ALTER TABLE c_forum_forum CHANGE forum_title title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_forum_post')) { + $this->addSql( + 'ALTER TABLE c_forum_post CHANGE post_title title VARCHAR(250) NOT NULL' + ); + } + + if ($schema->hasTable('c_forum_thread')) { + $this->addSql( + 'ALTER TABLE c_forum_thread CHANGE thread_title title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_glossary')) { + $this->addSql( + 'ALTER TABLE c_glossary CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('c_group_info')) { + $this->addSql( + 'ALTER TABLE c_group_info CHANGE name title VARCHAR(100) NOT NULL' + ); + } + + if ($schema->hasTable('c_link_category')) { + $this->addSql( + 'ALTER TABLE c_link_category CHANGE category_title title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_lp')) { + $this->addSql( + 'ALTER TABLE c_lp CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_lp_category')) { + $this->addSql( + 'ALTER TABLE c_lp_category CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('c_online_link')) { + $this->addSql( + 'ALTER TABLE c_online_link CHANGE name title VARCHAR(50) NOT NULL' + ); + } + + if ($schema->hasTable('c_quiz_question_option')) { + $this->addSql( + 'ALTER TABLE c_quiz_question_option CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_survey_group')) { + $this->addSql( + 'ALTER TABLE c_survey_group CHANGE name title VARCHAR(100) NOT NULL' + ); + } + + if ($schema->hasTable('c_tool')) { + $this->addSql( + 'ALTER TABLE c_tool CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('career')) { + $this->addSql( + 'ALTER TABLE career CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('chat_video')) { + $this->addSql( + 'DROP INDEX idx_chat_video_room_name ON chat_video' + ); + $this->addSql( + 'ALTER TABLE chat_video CHANGE room_name title VARCHAR(255) NOT NULL' + ); + $this->addSql( + 'CREATE INDEX idx_chat_video_title ON chat_video (title)' + ); + } + + if ($schema->hasTable('class_item')) { + $this->addSql( + 'ALTER TABLE class_item CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('course_category')) { + $this->addSql( + 'ALTER TABLE course_category CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('course_module')) { + $this->addSql( + 'ALTER TABLE course_module CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('course_type')) { + $this->addSql( + 'ALTER TABLE course_type CHANGE name title VARCHAR(50) NOT NULL' + ); + } + + if ($schema->hasTable('grade_model')) { + $this->addSql( + 'ALTER TABLE grade_model CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('gradebook_linkeval_log')) { + $this->addSql( + 'ALTER TABLE gradebook_linkeval_log CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('gradebook_category')) { + $this->addSql( + 'ALTER TABLE gradebook_category CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('gradebook_evaluation')) { + $this->addSql( + 'ALTER TABLE gradebook_evaluation CHANGE name title LONGTEXT NOT NULL' + ); + } + + if ($schema->hasTable('mail_template')) { + $this->addSql( + 'ALTER TABLE mail_template CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('usergroup')) { + $this->addSql( + 'ALTER TABLE usergroup CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('sequence_row_entity')) { + $this->addSql( + 'ALTER TABLE sequence_row_entity CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('ticket_project')) { + $this->addSql( + 'ALTER TABLE ticket_project CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('skill')) { + $this->addSql( + 'ALTER TABLE skill CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('sequence_variable')) { + $this->addSql( + 'ALTER TABLE sequence_variable CHANGE name title VARCHAR(255) DEFAULT NULL' + ); + } + + + if ($schema->hasTable('specific_field')) { + $this->addSql( + 'ALTER TABLE specific_field CHANGE name title VARCHAR(200) NOT NULL' + ); + } + + if ($schema->hasTable('ticket_priority')) { + $this->addSql( + 'ALTER TABLE ticket_priority CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('sequence_type_entity')) { + $this->addSql( + 'ALTER TABLE sequence_type_entity CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('promotion')) { + $this->addSql( + 'ALTER TABLE promotion CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('sequence')) { + $this->addSql( + 'ALTER TABLE sequence CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('ticket_category')) { + $this->addSql( + 'ALTER TABLE ticket_category CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('session')) { + $this->addSql( + 'DROP INDEX name ON session' + ); + $this->addSql( + 'ALTER TABLE session CHANGE name title VARCHAR(150) NOT NULL' + ); + $this->addSql( + 'CREATE UNIQUE INDEX title ON session (title)' + ); + } + + if ($schema->hasTable('skill_profile')) { + $this->addSql( + 'ALTER TABLE skill_profile CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('ticket_status')) { + $this->addSql( + 'ALTER TABLE ticket_status CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('session_category')) { + $this->addSql( + 'ALTER TABLE session_category CHANGE name title VARCHAR(100) NOT NULL' + ); + } + + if ($schema->hasTable('skill_level')) { + $this->addSql( + 'ALTER TABLE skill_level CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('skill_level_profile')) { + $this->addSql( + 'ALTER TABLE skill_level_profile CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + } + + public function down(Schema $schema): void + { + $table = $schema->getTable('skill_level_profile'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE skill_level_profile CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('skill_level'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE skill_level CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('session_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE session_category CHANGE title name VARCHAR(100) NOT NULL'); + } + + $table = $schema->getTable('ticket_status'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE ticket_status CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('skill_profile'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE skill_profile CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('session'); + if ($table->hasColumn('title')) { + $this->addSql('DROP INDEX title ON session'); + $this->addSql('ALTER TABLE session CHANGE title name VARCHAR(150) NOT NULL'); + $this->addSql('CREATE UNIQUE INDEX name ON session (name)'); + } + + $table = $schema->getTable('ticket_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE ticket_category CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('sequence'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE sequence CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('promotion'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE promotion CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('mail_template'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE mail_template CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('sequence_type_entity'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE sequence_type_entity CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('ticket_priority'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE ticket_priority CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('specific_field'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE specific_field CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('sequence_variable'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE sequence_variable CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('skill'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE skill CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('ticket_project'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE ticket_project CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('sequence_row_entity'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE sequence_row_entity CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('usergroup'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE usergroup CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('gradebook_evaluation'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE gradebook_evaluation CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('gradebook_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE gradebook_category CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('gradebook_linkeval_log'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE gradebook_linkeval_log CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('grade_model'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE grade_model CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('course_type'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE course_type CHANGE title name VARCHAR(50) NOT NULL'); + } + + $table = $schema->getTable('course_module'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE course_module CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('course_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE course_category CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('class_item'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE class_item CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('chat_video'); + if ($table->hasColumn('title')) { + $this->addSql( + 'DROP INDEX idx_chat_video_title ON chat_video' + ); + $this->addSql( + 'ALTER TABLE chat_video CHANGE title room_name VARCHAR(255) NOT NULL' + ); + $this->addSql( + 'CREATE INDEX idx_chat_video_room_name ON chat_video (room_name)' + ); + } + + $table = $schema->getTable('career'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE career CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_tool'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_tool CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('c_survey_group'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_survey_group CHANGE title name VARCHAR(20) NOT NULL'); + } + + $table = $schema->getTable('c_quiz_question_option'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_quiz_question_option CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_online_link'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_online_link CHANGE title name VARCHAR(50) NOT NULL'); + } + + $table = $schema->getTable('c_lp_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_lp_category CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('c_lp'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_lp CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_link_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_link_category CHANGE title category_title VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_group_info'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_group_info CHANGE title name VARCHAR(100) NOT NULL'); + } + + $table = $schema->getTable('c_glossary'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_glossary CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('c_forum_thread'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_forum_thread CHANGE title thread_title VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_forum_post'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_forum_post CHANGE title post_title VARCHAR(250) NOT NULL'); + } + + $table = $schema->getTable('c_forum_forum'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_forum_forum CHANGE title forum_title VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_forum_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_forum_category CHANGE title cat_title VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_exercise_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_exercise_category CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_dropbox_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_dropbox_category CHANGE title cat_name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('c_blog'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_blog CHANGE title blog_name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('c_attendance'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_attendance CHANGE title name LONGTEXT NOT NULL'); + } + + $table = $schema->getTable('branch_sync'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE branch_sync CHANGE title branch_name VARCHAR(250) NOT NULL'); + } + + $table = $schema->getTable('block'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE block CHANGE title name varchar(255) COLLATE "utf8_unicode_ci" NULL'); + } + } +} diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20240114174300.php b/src/CoreBundle/Migrations/Schema/V200/Version20240114174300.php new file mode 100644 index 0000000000..639c6dab33 --- /dev/null +++ b/src/CoreBundle/Migrations/Schema/V200/Version20240114174300.php @@ -0,0 +1,162 @@ +hasTable('skill_level')) { + $this->addSql( + 'ALTER TABLE skill_level CHANGE short_name short_title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_chat_conversation')) { + $this->addSql( + 'ALTER TABLE c_chat_conversation CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_wiki_category')) { + $this->addSql( + 'ALTER TABLE c_wiki_category CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('c_shortcut')) { + $this->addSql( + 'ALTER TABLE c_shortcut CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('illustration')) { + $this->addSql( + 'ALTER TABLE illustration CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('resource_type')) { + $this->addSql( + 'ALTER TABLE resource_type CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('resource_format')) { + $this->addSql( + 'ALTER TABLE resource_format CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('tool')) { + $table = $schema->getTable('tool'); + if ($table->hasIndex('UNIQ_20F33ED15E237E06')) { + $this->addSql( + 'DROP INDEX UNIQ_20F33ED15E237E06 on tool' + ); + } + $this->addSql( + 'ALTER TABLE tool CHANGE name title VARCHAR(255) NOT NULL' + ); + $this->addSql( + 'CREATE UNIQUE INDEX UNIQ_20F33ED12B36786B ON tool (title)' + ); + } + + if ($schema->hasTable('resource_tag')) { + $this->addSql( + 'ALTER TABLE resource_tag CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('track_e_hotpotatoes')) { + $this->addSql( + 'ALTER TABLE track_e_hotpotatoes CHANGE exe_name title VARCHAR(255) NOT NULL' + ); + } + + if ($schema->hasTable('lti_external_tool')) { + $this->addSql( + 'ALTER TABLE lti_external_tool CHANGE name title VARCHAR(255) NOT NULL' + ); + } + + } + + public function down(Schema $schema): void + { + + $table = $schema->getTable('lti_external_tool'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE lti_external_tool CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('track_e_hotpotatoes'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE track_e_hotpotatoes CHANGE title exe_name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('resource_tag'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE resource_tag CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('tool'); + if ($table->hasIndex('UNIQ_20F33ED12B36786B')) { + $this->addSql( + 'DROP INDEX UNIQ_20F33ED12B36786B on tool' + ); + } + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE tool CHANGE title name VARCHAR(255) NOT NULL'); + } + $this->addSql( + 'CREATE UNIQUE INDEX UNIQ_20F33ED15E237E06 ON tool (title)' + ); + + $table = $schema->getTable('resource_format'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE resource_format CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('resource_type'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE resource_type CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('illustration'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE illustration CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_shortcut'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_shortcut CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_wiki_category'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_wiki_category CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('c_chat_conversation'); + if ($table->hasColumn('title')) { + $this->addSql('ALTER TABLE c_chat_conversation CHANGE title name VARCHAR(255) NOT NULL'); + } + + $table = $schema->getTable('skill_level'); + if ($table->hasColumn('short_title')) { + $this->addSql('ALTER TABLE skill_level CHANGE short_title short_name VARCHAR(255) NOT NULL'); + } + } +} diff --git a/src/CoreBundle/Repository/BranchSyncRepository.php b/src/CoreBundle/Repository/BranchSyncRepository.php index 02c03664b3..f710adf0a7 100644 --- a/src/CoreBundle/Repository/BranchSyncRepository.php +++ b/src/CoreBundle/Repository/BranchSyncRepository.php @@ -39,9 +39,9 @@ class BranchSyncRepository extends ServiceEntityRepository // Selecting courses for users // $qb->innerJoin('u.courses', 'c'); - // @todo check app settings - $qb->addOrderBy('b.branchName', 'ASC'); - $qb->where('b.branchName LIKE :keyword'); + //@todo check app settings + $qb->addOrderBy('b.title', 'ASC'); + $qb->where('b.title LIKE :keyword'); $qb->setParameter('keyword', "%$keyword%", Types::STRING); $q = $qb->getQuery(); diff --git a/src/CoreBundle/Repository/Node/IllustrationRepository.php b/src/CoreBundle/Repository/Node/IllustrationRepository.php index f1f58c267b..982b65e198 100644 --- a/src/CoreBundle/Repository/Node/IllustrationRepository.php +++ b/src/CoreBundle/Repository/Node/IllustrationRepository.php @@ -153,7 +153,7 @@ final class IllustrationRepository extends ResourceRepository $params = [ 'id' => $node->getUuid(), 'tool' => $node->getResourceType()->getTool(), - 'type' => $node->getResourceType()->getName(), + 'type' => $node->getResourceType()->getTitle(), ]; if (!empty($filter)) { diff --git a/src/CoreBundle/Repository/SessionRepository.php b/src/CoreBundle/Repository/SessionRepository.php index 7efd10e927..4d68f45d1d 100644 --- a/src/CoreBundle/Repository/SessionRepository.php +++ b/src/CoreBundle/Repository/SessionRepository.php @@ -88,7 +88,7 @@ class SessionRepository extends ServiceEntityRepository } if (!$session->hasCourse($course)) { - $msg = sprintf('Course %s is not subscribed to the session %s', $course->getTitle(), $session->getName()); + $msg = sprintf('Course %s is not subscribed to the session %s', $course->getTitle(), $session->getTitle()); throw new Exception($msg); } diff --git a/src/CoreBundle/Resources/views/LearnPath/list.html.twig b/src/CoreBundle/Resources/views/LearnPath/list.html.twig index 0f288d5ba0..c7de0e62b4 100644 --- a/src/CoreBundle/Resources/views/LearnPath/list.html.twig +++ b/src/CoreBundle/Resources/views/LearnPath/list.html.twig @@ -30,7 +30,7 @@ text-gray-800 {% endif %} "> - {{ lp_data.category.getName() | trim }} + {{ lp_data.category.getTitle() | trim }} {% if lp_data.category.iid > 0 %} {% if not session %} @@ -103,7 +103,7 @@ {% endif %}

{% elseif lp_data.lp_list is not empty %} - + {% endif %} {% endif %} @@ -422,10 +422,16 @@
{% endif %}

- {{ lp_data.category.getName() }} + + {{ lp_data.category.getTitle() }} +

-
+ {% set number = 1 %} +
{% if lp_data.lp_list %} diff --git a/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php b/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php index da56cd23a0..07036286d1 100644 --- a/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php +++ b/src/CoreBundle/Security/Authorization/Voter/ResourceNodeVoter.php @@ -94,7 +94,7 @@ class ResourceNodeVoter extends Voter }*/ /** @var ResourceNode $resourceNode */ $resourceNode = $subject; - $resourceTypeName = $resourceNode->getResourceType()->getName(); + $resourceTypeName = $resourceNode->getResourceType()->getTitle(); // Illustrations are always visible, nothing to check. if ('illustrations' === $resourceTypeName) { diff --git a/src/CoreBundle/Serializer/UserToJsonNormalizer.php b/src/CoreBundle/Serializer/UserToJsonNormalizer.php index aaf578119e..409d642655 100644 --- a/src/CoreBundle/Serializer/UserToJsonNormalizer.php +++ b/src/CoreBundle/Serializer/UserToJsonNormalizer.php @@ -375,7 +375,7 @@ final class UserToJsonNormalizer foreach ($result as $item) { $date = $item->getPostDate()->format($dateFormat); $list = [ - 'Title: '.$item->getPostTitle(), + 'Title: '.$item->getTitle(), 'Creation date: '.$date, ]; $cForumPostList[] = implode(', ', $list); @@ -391,7 +391,7 @@ final class UserToJsonNormalizer foreach ($result as $item) { $date = $item->getThreadDate()->format($dateFormat); $list = [ - 'Title: '.$item->getThreadTitle(), + 'Title: '.$item->getTitle(), 'Creation date: '.$date, ]; $cForumThreadList[] = implode(', ', $list); diff --git a/src/CoreBundle/State/CToolProvider.php b/src/CoreBundle/State/CToolProvider.php index 63dd34efc4..eeccd58e7b 100644 --- a/src/CoreBundle/State/CToolProvider.php +++ b/src/CoreBundle/State/CToolProvider.php @@ -60,7 +60,7 @@ class CToolProvider implements ProviderInterface /** @var CTool $cTool */ foreach ($result as $cTool) { $toolModel = $this->toolChain->getToolFromName( - $cTool->getTool()->getName() + $cTool->getTool()->getTitle() ); if (!$isAllowToEdit && 'admin' === $toolModel->getCategory()) { diff --git a/src/CoreBundle/Tool/ToolChain.php b/src/CoreBundle/Tool/ToolChain.php index dd2cd0d694..8d0a41ee72 100644 --- a/src/CoreBundle/Tool/ToolChain.php +++ b/src/CoreBundle/Tool/ToolChain.php @@ -86,7 +86,7 @@ class ToolChain $toolEntity = $toolFromDatabase; } else { $toolEntity = (new Tool()) - ->setName($name) + ->setTitle($name) ; if ($tool->isCourseTool()) { $this->setToolPermissions($toolEntity); @@ -99,7 +99,7 @@ class ToolChain if (!empty($types)) { foreach ($types as $key => $typeName) { $resourceType = (new ResourceType()) - ->setName($key) + ->setTitle($key) ; if ($toolEntity->hasResourceType($resourceType)) { diff --git a/src/CourseBundle/Component/CourseCopy/CourseBuilder.php b/src/CourseBundle/Component/CourseCopy/CourseBuilder.php index f9899e70fe..77b2798a4c 100644 --- a/src/CourseBundle/Component/CourseCopy/CourseBuilder.php +++ b/src/CourseBundle/Component/CourseCopy/CourseBuilder.php @@ -524,7 +524,7 @@ class CourseBuilder $sql = "SELECT * FROM $table WHERE c_id = $courseId $sessionCondition $idCondition - ORDER BY cat_title"; + ORDER BY title"; $result = Database::query($sql); while ($obj = Database::fetch_object($result)) { @@ -564,7 +564,7 @@ class CourseBuilder $sql = "SELECT * FROM $table WHERE c_id = $courseId $sessionCondition $idCondition - ORDER BY thread_title "; + ORDER BY title "; $result = Database::query($sql); while ($obj = Database::fetch_object($result)) { @@ -1498,7 +1498,7 @@ class CourseBuilder $lp = new CourseCopyLearnpath( $obj->id, $obj->lp_type, - $obj->name, + $obj->title, $obj->path, $obj->ref, $obj->description, diff --git a/src/CourseBundle/Component/CourseCopy/CourseSelectForm.php b/src/CourseBundle/Component/CourseCopy/CourseSelectForm.php index 90ea24cd75..2861f643e7 100644 --- a/src/CourseBundle/Component/CourseCopy/CourseSelectForm.php +++ b/src/CourseBundle/Component/CourseCopy/CourseSelectForm.php @@ -609,7 +609,7 @@ class CourseSelectForm continue; } $forum_id = $obj->obj->forum_id; - $title = $obj->obj->thread_title; + $title = $obj->obj->title; foreach ($posts as $post_id => $post) { if ($post->obj->thread_id == $thread_id && $forum_id == $post->obj->forum_id && diff --git a/src/CourseBundle/Component/CourseCopy/Resources/ForumCategory.php b/src/CourseBundle/Component/CourseCopy/Resources/ForumCategory.php index daca233b4f..34638dad6c 100644 --- a/src/CourseBundle/Component/CourseCopy/Resources/ForumCategory.php +++ b/src/CourseBundle/Component/CourseCopy/Resources/ForumCategory.php @@ -26,6 +26,6 @@ class ForumCategory extends Resource public function show() { parent::show(); - echo $this->obj->cat_title; + echo $this->obj->title; } } diff --git a/src/CourseBundle/Component/CourseCopy/Resources/ForumTopic.php b/src/CourseBundle/Component/CourseCopy/Resources/ForumTopic.php index 265b2154a8..c1c726e9b1 100644 --- a/src/CourseBundle/Component/CourseCopy/Resources/ForumTopic.php +++ b/src/CourseBundle/Component/CourseCopy/Resources/ForumTopic.php @@ -48,6 +48,6 @@ class ForumTopic extends Resource $user_info = api_get_user_info($this->obj->thread_poster_id); $extra = $user_info['complete_name'].', '.$extra; } - echo $this->obj->thread_title.' ('.$extra.')'; + echo $this->obj->title.' ('.$extra.')'; } } diff --git a/src/CourseBundle/Entity/CAttendance.php b/src/CourseBundle/Entity/CAttendance.php index 127b36b6ea..ec74510dba 100644 --- a/src/CourseBundle/Entity/CAttendance.php +++ b/src/CourseBundle/Entity/CAttendance.php @@ -26,8 +26,8 @@ class CAttendance extends AbstractResource implements ResourceInterface, Stringa protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'text', nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'text', nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description; @@ -82,19 +82,19 @@ class CAttendance extends AbstractResource implements ResourceInterface, Stringa public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setDescription(string $description): self @@ -241,11 +241,11 @@ class CAttendance extends AbstractResource implements ResourceInterface, Stringa public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CChatConversation.php b/src/CourseBundle/Entity/CChatConversation.php index 161b27dee3..bdf191c19d 100644 --- a/src/CourseBundle/Entity/CChatConversation.php +++ b/src/CourseBundle/Entity/CChatConversation.php @@ -24,12 +24,12 @@ class CChatConversation extends AbstractResource implements ResourceInterface, S #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: true)] - protected ?string $name = null; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: true)] + protected ?string $title = null; public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } public function getId(): int @@ -37,14 +37,14 @@ class CChatConversation extends AbstractResource implements ResourceInterface, S return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } @@ -59,11 +59,11 @@ class CChatConversation extends AbstractResource implements ResourceInterface, S public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CDropboxCategory.php b/src/CourseBundle/Entity/CDropboxCategory.php index 388dd7a531..6b0a5c695e 100644 --- a/src/CourseBundle/Entity/CDropboxCategory.php +++ b/src/CourseBundle/Entity/CDropboxCategory.php @@ -30,8 +30,8 @@ class CDropboxCategory protected int $catId; #[Assert\NotBlank] - #[ORM\Column(name: 'cat_name', type: 'text', nullable: false)] - protected string $catName; + #[ORM\Column(name: 'title', type: 'text', nullable: false)] + protected string $title; #[ORM\Column(name: 'received', type: 'boolean', nullable: false)] protected bool $received; @@ -46,25 +46,25 @@ class CDropboxCategory protected int $sessionId; /** - * Set catName. + * Set title. * * @return CDropboxCategory */ - public function setCatName(string $catName) + public function setTitle(string $title) { - $this->catName = $catName; + $this->title = $title; return $this; } /** - * Get catName. + * Get title. * * @return string */ - public function getCatName() + public function getTitle() { - return $this->catName; + return $this->title; } /** diff --git a/src/CourseBundle/Entity/CExerciseCategory.php b/src/CourseBundle/Entity/CExerciseCategory.php index d17cad2f5c..bce4b408cb 100644 --- a/src/CourseBundle/Entity/CExerciseCategory.php +++ b/src/CourseBundle/Entity/CExerciseCategory.php @@ -33,8 +33,8 @@ class CExerciseCategory extends AbstractResource implements ResourceInterface, S protected Course $course; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description; @@ -51,7 +51,7 @@ class CExerciseCategory extends AbstractResource implements ResourceInterface, S public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } /** @@ -62,14 +62,14 @@ class CExerciseCategory extends AbstractResource implements ResourceInterface, S return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } @@ -117,11 +117,11 @@ class CExerciseCategory extends AbstractResource implements ResourceInterface, S public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CForum.php b/src/CourseBundle/Entity/CForum.php index fd1e92d474..29b47173a9 100644 --- a/src/CourseBundle/Entity/CForum.php +++ b/src/CourseBundle/Entity/CForum.php @@ -30,8 +30,8 @@ class CForum extends AbstractResource implements ResourceInterface, Stringable protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'forum_title', type: 'string', length: 255, nullable: false)] - protected string $forumTitle; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'forum_comment', type: 'text', nullable: true)] protected ?string $forumComment; @@ -124,19 +124,19 @@ class CForum extends AbstractResource implements ResourceInterface, Stringable public function __toString(): string { - return $this->getForumTitle(); + return $this->getTitle(); } - public function setForumTitle(string $forumTitle): self + public function setTitle(string $title): self { - $this->forumTitle = $forumTitle; + $this->title = $title; return $this; } - public function getForumTitle(): string + public function getTitle(): string { - return $this->forumTitle; + return $this->title; } public function setForumComment(string $forumComment): self @@ -410,11 +410,11 @@ class CForum extends AbstractResource implements ResourceInterface, Stringable public function getResourceName(): string { - return $this->getForumTitle(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setForumTitle($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CForumCategory.php b/src/CourseBundle/Entity/CForumCategory.php index 67cf82ab29..6e1f484b5a 100644 --- a/src/CourseBundle/Entity/CForumCategory.php +++ b/src/CourseBundle/Entity/CForumCategory.php @@ -26,8 +26,8 @@ class CForumCategory extends AbstractResource implements ResourceInterface, Stri protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'cat_title', type: 'string', length: 255, nullable: false)] - protected string $catTitle; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'cat_comment', type: 'text', nullable: true)] protected ?string $catComment; @@ -54,7 +54,7 @@ class CForumCategory extends AbstractResource implements ResourceInterface, Stri public function __toString(): string { - return $this->getCatTitle(); + return $this->getTitle(); } public function getIid(): ?int @@ -62,16 +62,21 @@ class CForumCategory extends AbstractResource implements ResourceInterface, Stri return $this->iid; } - public function setCatTitle(string $catTitle): self + public function setTitle(string $title): self { - $this->catTitle = $catTitle; + $this->title = $title; return $this; } - public function getCatTitle(): string + /** + * Get title. + * + * @return string + */ + public function getTitle(): string { - return $this->catTitle; + return $this->title; } public function setCatComment(string $catComment): self @@ -125,11 +130,11 @@ class CForumCategory extends AbstractResource implements ResourceInterface, Stri public function getResourceName(): string { - return $this->getCatTitle(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setCatTitle($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CForumPost.php b/src/CourseBundle/Entity/CForumPost.php index c647f71d00..7837d96439 100644 --- a/src/CourseBundle/Entity/CForumPost.php +++ b/src/CourseBundle/Entity/CForumPost.php @@ -38,8 +38,8 @@ class CForumPost extends AbstractResource implements ResourceInterface, Stringab protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'post_title', type: 'string', length: 250, nullable: false)] - protected string $postTitle; + #[ORM\Column(name: 'title', type: 'string', length: 250, nullable: false)] + protected string $title; #[ORM\Column(name: 'post_text', type: 'text', nullable: true)] protected ?string $postText = null; @@ -97,19 +97,19 @@ class CForumPost extends AbstractResource implements ResourceInterface, Stringab public function __toString(): string { - return $this->getPostTitle(); + return $this->getTitle(); } - public function setPostTitle(string $postTitle): self + public function setTitle(string $title): self { - $this->postTitle = $postTitle; + $this->title = $title; return $this; } - public function getPostTitle(): string + public function getTitle(): string { - return $this->postTitle; + return $this->title; } public function setPostText(string $postText): self @@ -286,11 +286,11 @@ class CForumPost extends AbstractResource implements ResourceInterface, Stringab public function getResourceName(): string { - return $this->getPostTitle(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setPostTitle($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CForumThread.php b/src/CourseBundle/Entity/CForumThread.php index a1a4ac8edd..5f997b0001 100644 --- a/src/CourseBundle/Entity/CForumThread.php +++ b/src/CourseBundle/Entity/CForumThread.php @@ -31,8 +31,8 @@ class CForumThread extends AbstractResource implements ResourceInterface, String protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'thread_title', type: 'string', length: 255, nullable: false)] - protected string $threadTitle; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\ManyToOne(targetEntity: CForum::class, inversedBy: 'threads')] #[ORM\JoinColumn(name: 'forum_id', referencedColumnName: 'iid', nullable: true, onDelete: 'CASCADE')] @@ -113,7 +113,7 @@ class CForumThread extends AbstractResource implements ResourceInterface, String public function __toString(): string { - return $this->getThreadTitle(); + return $this->getTitle(); } public function isThreadPeerQualify(): bool @@ -128,16 +128,16 @@ class CForumThread extends AbstractResource implements ResourceInterface, String return $this; } - public function setThreadTitle(string $threadTitle): self + public function setTitle(string $title): self { - $this->threadTitle = $threadTitle; + $this->title = $title; return $this; } - public function getThreadTitle(): string + public function getTitle(): string { - return $this->threadTitle; + return $this->title; } public function setForum(CForum $forum = null): self @@ -334,11 +334,11 @@ class CForumThread extends AbstractResource implements ResourceInterface, String public function getResourceName(): string { - return $this->getThreadTitle(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setThreadTitle($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CGlossary.php b/src/CourseBundle/Entity/CGlossary.php index e03d13e3b5..81d04ad3f9 100644 --- a/src/CourseBundle/Entity/CGlossary.php +++ b/src/CourseBundle/Entity/CGlossary.php @@ -190,8 +190,8 @@ class CGlossary extends AbstractResource implements ResourceInterface, Stringabl #[Groups(['glossary:read', 'glossary:write'])] #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'text', nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'text', nullable: false)] + protected string $title; #[Groups(['glossary:read', 'glossary:write'])] #[ORM\Column(name: 'description', type: 'text', nullable: false)] @@ -199,19 +199,19 @@ class CGlossary extends AbstractResource implements ResourceInterface, Stringabl public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setDescription(string $description): self @@ -241,11 +241,11 @@ class CGlossary extends AbstractResource implements ResourceInterface, Stringabl public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CGroup.php b/src/CourseBundle/Entity/CGroup.php index 673c94b1a3..79323a0c18 100644 --- a/src/CourseBundle/Entity/CGroup.php +++ b/src/CourseBundle/Entity/CGroup.php @@ -37,9 +37,9 @@ class CGroup extends AbstractResource implements ResourceInterface, Stringable #[Groups(['group:read', 'group:write'])] protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 100, nullable: false)] + #[ORM\Column(name: 'title', type: 'string', length: 100, nullable: false)] #[Groups(['group:read', 'group:write'])] - protected string $name; + protected string $title; #[Assert\NotNull] #[ORM\Column(name: 'status', type: 'boolean', nullable: false)] protected bool $status; @@ -103,22 +103,24 @@ class CGroup extends AbstractResource implements ResourceInterface, Stringable } public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } public function getIid(): ?int { return $this->iid; } - public function setName(string $name): self + + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + + public function getTitle(): string { - return $this->name; + return $this->title; } public function setStatus(bool $status): self { @@ -331,10 +333,10 @@ class CGroup extends AbstractResource implements ResourceInterface, Stringable } public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CLinkCategory.php b/src/CourseBundle/Entity/CLinkCategory.php index a1afbbc84a..434da19ca2 100644 --- a/src/CourseBundle/Entity/CLinkCategory.php +++ b/src/CourseBundle/Entity/CLinkCategory.php @@ -140,8 +140,8 @@ class CLinkCategory extends AbstractResource implements ResourceInterface, Strin #[Groups(['link_category:read', 'link_category:write'])] #[Assert\NotBlank] - #[ORM\Column(name: 'category_title', type: 'string', length: 255, nullable: false)] - protected string $categoryTitle; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[Groups(['link_category:read', 'link_category:write'])] #[ORM\Column(name: 'description', type: 'text', nullable: true)] @@ -164,7 +164,7 @@ class CLinkCategory extends AbstractResource implements ResourceInterface, Strin public function __toString(): string { - return $this->getCategoryTitle(); + return $this->getTitle(); } public function getIid(): int @@ -172,16 +172,16 @@ class CLinkCategory extends AbstractResource implements ResourceInterface, Strin return $this->iid; } - public function setCategoryTitle(string $categoryTitle): self + public function setTitle(string $title): self { - $this->categoryTitle = $categoryTitle; + $this->title = $title; return $this; } - public function getCategoryTitle(): string + public function getTitle(): string { - return $this->categoryTitle; + return $this->title; } public function setDescription(string $description): self @@ -223,11 +223,11 @@ class CLinkCategory extends AbstractResource implements ResourceInterface, Strin public function getResourceName(): string { - return $this->getCategoryTitle(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setCategoryTitle($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CLp.php b/src/CourseBundle/Entity/CLp.php index 968836944e..dd290b3b9d 100644 --- a/src/CourseBundle/Entity/CLp.php +++ b/src/CourseBundle/Entity/CLp.php @@ -41,8 +41,8 @@ class CLp extends AbstractResource implements ResourceInterface, ResourceShowCou protected int $lpType; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'ref', type: 'text', nullable: true)] protected ?string $ref = null; @@ -188,7 +188,7 @@ class CLp extends AbstractResource implements ResourceInterface, ResourceShowCou public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } public function setLpType(int $lpType): self @@ -203,16 +203,16 @@ class CLp extends AbstractResource implements ResourceInterface, ResourceShowCou return $this->lpType; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setRef(string $ref): self @@ -625,11 +625,11 @@ class CLp extends AbstractResource implements ResourceInterface, ResourceShowCou public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CLpCategory.php b/src/CourseBundle/Entity/CLpCategory.php index ea2bc5a9b8..6c0da807df 100644 --- a/src/CourseBundle/Entity/CLpCategory.php +++ b/src/CourseBundle/Entity/CLpCategory.php @@ -31,8 +31,8 @@ class CLpCategory extends AbstractResource implements ResourceInterface, Stringa protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'text')] - protected string $name; + #[ORM\Column(name: 'title', type: 'text')] + protected string $title; #[Gedmo\SortablePosition] #[ORM\Column(name: 'position', type: 'integer')] @@ -58,7 +58,7 @@ class CLpCategory extends AbstractResource implements ResourceInterface, Stringa public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } public function getIid(): ?int @@ -66,9 +66,9 @@ class CLpCategory extends AbstractResource implements ResourceInterface, Stringa return $this->iid; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } @@ -76,9 +76,9 @@ class CLpCategory extends AbstractResource implements ResourceInterface, Stringa /** * Get category name. */ - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function setPosition(int $position): self @@ -173,11 +173,11 @@ class CLpCategory extends AbstractResource implements ResourceInterface, Stringa public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CQuizQuestionOption.php b/src/CourseBundle/Entity/CQuizQuestionOption.php index 30f8345170..8e64ba71db 100644 --- a/src/CourseBundle/Entity/CQuizQuestionOption.php +++ b/src/CourseBundle/Entity/CQuizQuestionOption.php @@ -21,8 +21,8 @@ class CQuizQuestionOption #[ORM\GeneratedValue] protected ?int $iid = null; - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\Column(name: 'position', type: 'integer', nullable: false)] protected int $position; @@ -32,9 +32,9 @@ class CQuizQuestionOption #[ORM\JoinColumn(name: 'question_id', referencedColumnName: 'iid', onDelete: 'CASCADE')] protected CQuizQuestion $question; - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } @@ -44,9 +44,9 @@ class CQuizQuestionOption * * @return string */ - public function getName() + public function getTitle() { - return $this->name; + return $this->title; } public function setPosition(int $position): self diff --git a/src/CourseBundle/Entity/CShortcut.php b/src/CourseBundle/Entity/CShortcut.php index 29fa4f6795..9d0bb721c9 100644 --- a/src/CourseBundle/Entity/CShortcut.php +++ b/src/CourseBundle/Entity/CShortcut.php @@ -26,8 +26,8 @@ class CShortcut extends AbstractResource implements ResourceInterface, Stringabl #[Assert\NotBlank] #[Groups(['cshortcut:read'])] - #[ORM\Column(name: 'name', type: 'string', length: 255, nullable: false)] - protected string $name; + #[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)] + protected string $title; #[ORM\OneToOne(targetEntity: ResourceNode::class, inversedBy: 'shortCut')] #[ORM\JoinColumn(name: 'shortcut_node_id', referencedColumnName: 'id', onDelete: 'CASCADE')] @@ -44,35 +44,35 @@ class CShortcut extends AbstractResource implements ResourceInterface, Stringabl public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function getUrl(): string { - return '/r/'.$this->getShortCutNode()->getResourceType()->getTool()->getName(). - '/'.$this->getShortCutNode()->getResourceType()->getName(). + return '/r/'.$this->getShortCutNode()->getResourceType()->getTool()->getTitle(). + '/'.$this->getShortCutNode()->getResourceType()->getTitle(). '/'.$this->getShortCutNode()->getId(). '/link'; } public function getTool(): string { - return $this->getShortCutNode()->getResourceType()->getTool()->getName(); + return $this->getShortCutNode()->getResourceType()->getTool()->getTitle(); } public function getType(): string { - return $this->getShortCutNode()->getResourceType()->getName(); + return $this->getShortCutNode()->getResourceType()->getTitle(); } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } @@ -101,11 +101,11 @@ class CShortcut extends AbstractResource implements ResourceInterface, Stringabl public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CStudentPublication.php b/src/CourseBundle/Entity/CStudentPublication.php index 914ddce9da..5418b8ac13 100644 --- a/src/CourseBundle/Entity/CStudentPublication.php +++ b/src/CourseBundle/Entity/CStudentPublication.php @@ -419,7 +419,7 @@ class CStudentPublication extends AbstractResource implements ResourceInterface, if ($this->hasResourceNode()) { $children = $this->getResourceNode()->getChildren(); foreach ($children as $child) { - $name = $child->getResourceType()->getName(); + $name = $child->getResourceType()->getTitle(); if ('student_publications_corrections' === $name) { return $child; } diff --git a/src/CourseBundle/Entity/CTool.php b/src/CourseBundle/Entity/CTool.php index 7a8e0b4078..0d3a60e757 100644 --- a/src/CourseBundle/Entity/CTool.php +++ b/src/CourseBundle/Entity/CTool.php @@ -50,8 +50,9 @@ class CTool extends AbstractResource implements ResourceInterface, ResourceShowC protected ?int $iid = null; #[Assert\NotBlank] - #[ORM\Column(name: 'name', type: 'text', nullable: false)] - protected string $name; + #[Groups(['ctool:read'])] + #[ORM\Column(name: 'title', type: 'text', nullable: false)] + protected string $title; #[ORM\Column(name: 'visibility', type: 'boolean', nullable: true)] protected ?bool $visibility = null; @@ -82,17 +83,22 @@ class CTool extends AbstractResource implements ResourceInterface, ResourceShowC public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } - public function getName(): string + public function getNameToTranslate(): string { - return $this->name; + return ucfirst(str_replace('_', ' ', $this->title)); } - public function setName(string $name): self + public function getTitle(): string { - $this->name = $name; + return $this->title; + } + + public function setTitle(string $title): self + { + $this->title = $title; return $this; } @@ -169,11 +175,11 @@ class CTool extends AbstractResource implements ResourceInterface, ResourceShowC public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } public function setResourceName(string $name): self { - return $this->setName($name); + return $this->setTitle($name); } } diff --git a/src/CourseBundle/Entity/CWikiCategory.php b/src/CourseBundle/Entity/CWikiCategory.php index 47c283bc5f..8862e5f882 100644 --- a/src/CourseBundle/Entity/CWikiCategory.php +++ b/src/CourseBundle/Entity/CWikiCategory.php @@ -23,8 +23,8 @@ class CWikiCategory #[ORM\Column(name: 'id', type: 'integer')] private ?int $id = null; - #[ORM\Column(name: 'name', type: 'string')] - private string $name; + #[ORM\Column(name: 'title', type: 'string')] + private string $title; #[ORM\ManyToMany(targetEntity: CWiki::class, mappedBy: 'categories')] private Collection $wikiPages; @@ -71,7 +71,7 @@ class CWikiCategory public function __toString(): string { - return $this->name; + return $this->title; } public function getId(): ?int @@ -79,19 +79,19 @@ class CWikiCategory return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } public function getNodeName(): string { - return str_repeat('    ', $this->lvl).$this->name; + return str_repeat('    ', $this->lvl).$this->title; } - public function setName(string $name): self + public function setTitle(string $title): self { - $this->name = $name; + $this->title = $title; return $this; } diff --git a/src/LtiBundle/Controller/CourseController.php b/src/LtiBundle/Controller/CourseController.php index d8d53fbc67..85f090c330 100644 --- a/src/LtiBundle/Controller/CourseController.php +++ b/src/LtiBundle/Controller/CourseController.php @@ -108,7 +108,7 @@ class CourseController extends ToolBaseController throw $this->createNotFoundException('Course tool not found.'); } - $courseTool->setName($tool->getName()); + $courseTool->setTitle($tool->getTitle()); $em->persist($courseTool); } @@ -168,13 +168,13 @@ class CourseController extends ToolBaseController ); $params['accept_media_types'] = '*/*'; $params['accept_presentation_document_targets'] = 'iframe'; - $params['title'] = $tool->getName(); + $params['title'] = $tool->getTitle(); $params['text'] = $tool->getDescription(); $params['data'] = 'tool:'.$tool->getId(); } else { $params['lti_message_type'] = 'basic-lti-launch-request'; $params['resource_link_id'] = $tool->getId(); - $params['resource_link_title'] = $tool->getName(); + $params['resource_link_title'] = $tool->getTitle(); $params['resource_link_description'] = $tool->getDescription(); $toolEval = $tool->getGradebookEval(); @@ -343,7 +343,7 @@ class CourseController extends ToolBaseController 'success', sprintf( $this->trans('External tool added: %s'), - $newTool->getName() + $newTool->getTitle() ) ); } @@ -556,7 +556,7 @@ class CourseController extends ToolBaseController /** @var ExternalTool $tool */ foreach ($tools as $tool) { - $slcLtiTools->addOption($tool->getName(), $tool->getId()); + $slcLtiTools->addOption($tool->getTitle(), $tool->getId()); } if (!$form->validate()) { @@ -577,7 +577,7 @@ class CourseController extends ToolBaseController } $eval = new Evaluation(); - $eval->set_name($tool->getName()); + $eval->set_name($tool->getTitle()); $eval->set_description($values['description']); $eval->set_user_id($values['hid_user_id']); @@ -770,7 +770,7 @@ class CourseController extends ToolBaseController $newTool->setActiveDeepLinking(false); if (!empty($contentItem['title'])) { - $newTool->setName($contentItem['title']); + $newTool->setTitle($contentItem['title']); } if (!empty($contentItem['text'])) { diff --git a/src/LtiBundle/Entity/ExternalTool.php b/src/LtiBundle/Entity/ExternalTool.php index 99b37acbf5..58afe1f824 100644 --- a/src/LtiBundle/Entity/ExternalTool.php +++ b/src/LtiBundle/Entity/ExternalTool.php @@ -30,8 +30,8 @@ class ExternalTool extends AbstractResource implements ResourceInterface, Resour #[ORM\GeneratedValue] protected ?int $id = null; - #[ORM\Column(name: 'name', type: 'string')] - protected string $name; + #[ORM\Column(name: 'title', type: 'string')] + protected string $title; #[ORM\Column(name: 'description', type: 'text', nullable: true)] protected ?string $description; @@ -115,7 +115,7 @@ class ExternalTool extends AbstractResource implements ResourceInterface, Resour public function __toString(): string { - return $this->getName(); + return $this->getTitle(); } public function getId(): int @@ -123,14 +123,14 @@ class ExternalTool extends AbstractResource implements ResourceInterface, Resour return $this->id; } - public function getName(): string + public function getTitle(): string { - return $this->name; + return $this->title; } - public function setName(string $name): static + public function setTitle(string $title): static { - $this->name = $name; + $this->title = $title; return $this; } @@ -541,12 +541,12 @@ class ExternalTool extends AbstractResource implements ResourceInterface, Resour public function getResourceName(): string { - return $this->getName(); + return $this->getTitle(); } - public function setResourceName(string $name): static + public function setResourceName(string $title): static { - return $this->setName($name); + return $this->setTitle($title); } public function getResourceIdentifier(): int diff --git a/tests/ChamiloTestTrait.php b/tests/ChamiloTestTrait.php index c66d61ed39..228a79f0be 100644 --- a/tests/ChamiloTestTrait.php +++ b/tests/ChamiloTestTrait.php @@ -73,7 +73,7 @@ trait ChamiloTestTrait $repo = static::getContainer()->get(SessionRepository::class); $session = (new Session()) - ->setName($title) + ->setTitle($title) ->addGeneralCoach($this->getUser('admin')) ->addAccessUrl($this->getAccessUrl()) ; @@ -87,7 +87,7 @@ trait ChamiloTestTrait $em = $this->getEntityManager(); $group = (new CGroup()) - ->setName($title) + ->setTitle($title) ->setParent($course) ->setCreator($this->getUser('admin')) ->setMaxStudent(100) @@ -104,7 +104,7 @@ trait ChamiloTestTrait $creator = $this->createUser('usergroup_creator'); $group = (new Usergroup()) - ->setName($title) + ->setTitle($title) ->setDescription('desc') ->setCreator($creator) ->addAccessUrl($this->getAccessUrl()) diff --git a/tests/CoreBundle/Controller/ResourceControllerTest.php b/tests/CoreBundle/Controller/ResourceControllerTest.php index a4f8f03369..f5e9748e10 100644 --- a/tests/CoreBundle/Controller/ResourceControllerTest.php +++ b/tests/CoreBundle/Controller/ResourceControllerTest.php @@ -175,7 +175,7 @@ class ResourceControllerTest extends WebTestCase $lpRepo = self::getContainer()->get(CLpRepository::class); $lp = (new CLp()) - ->setName('lp') + ->setTitle('lp') ->setParent($course) ->setCreator($admin) ->setLpType(CLp::LP_TYPE) diff --git a/tests/CoreBundle/Repository/CareerRepositoryTest.php b/tests/CoreBundle/Repository/CareerRepositoryTest.php index ef77815aca..6d8a282213 100644 --- a/tests/CoreBundle/Repository/CareerRepositoryTest.php +++ b/tests/CoreBundle/Repository/CareerRepositoryTest.php @@ -21,7 +21,7 @@ class CareerRepositoryTest extends AbstractApiTest $repo = self::getContainer()->get(CareerRepository::class); $career = (new Career()) - ->setName('Julio') + ->setTitle('Julio') ->setDescription('test') ->setStatus(1) ; diff --git a/tests/CoreBundle/Repository/CourseCategoryRepositoryTest.php b/tests/CoreBundle/Repository/CourseCategoryRepositoryTest.php index 93f1df4129..cba8016d4c 100644 --- a/tests/CoreBundle/Repository/CourseCategoryRepositoryTest.php +++ b/tests/CoreBundle/Repository/CourseCategoryRepositoryTest.php @@ -26,7 +26,7 @@ class CourseCategoryRepositoryTest extends AbstractApiTest $item = (new CourseCategory()) ->setCode('Course cat') - ->setName('Course cat') + ->setTitle('Course cat') ->setDescription('desc') ->setTreePos(1) ->setChildrenCount(0) @@ -62,14 +62,14 @@ class CourseCategoryRepositoryTest extends AbstractApiTest $item = (new CourseCategory()) ->setCode('Course cat') - ->setName('Course cat') + ->setTitle('Course cat') ; $em->persist($item); $em->flush(); $sub = (new CourseCategory()) ->setCode('Sub cat') - ->setName('Sub cat') + ->setTitle('Sub cat') ->setParent($item) ; $em->persist($sub); @@ -102,7 +102,7 @@ class CourseCategoryRepositoryTest extends AbstractApiTest $item = (new CourseCategory()) ->setCode('cat') - ->setName('cat') + ->setTitle('cat') ->setAsset($asset) ; @@ -143,7 +143,7 @@ class CourseCategoryRepositoryTest extends AbstractApiTest $courseCategory = (new CourseCategory()) ->setCode('cat') - ->setName('cat') + ->setTitle('cat') ->setAsset($asset) ; $repoCourseCategory->save($courseCategory); @@ -192,7 +192,7 @@ class CourseCategoryRepositoryTest extends AbstractApiTest $courseCategory = (new CourseCategory()) ->setCode('cat') - ->setName('cat') + ->setTitle('cat') ->setAsset($asset) ; $repoCourseCategory->save($courseCategory); @@ -234,7 +234,7 @@ class CourseCategoryRepositoryTest extends AbstractApiTest $category = (new CourseCategory()) ->setCode('Course cat') - ->setName('Course cat') + ->setTitle('Course cat') ; $em->persist($category); diff --git a/tests/CoreBundle/Repository/GradeBookCategoryRepositoryTest.php b/tests/CoreBundle/Repository/GradeBookCategoryRepositoryTest.php index fd3d0548e6..2fb2390518 100644 --- a/tests/CoreBundle/Repository/GradeBookCategoryRepositoryTest.php +++ b/tests/CoreBundle/Repository/GradeBookCategoryRepositoryTest.php @@ -33,7 +33,7 @@ class GradeBookCategoryRepositoryTest extends AbstractApiTest $course = $this->createCourse('new'); $category = (new GradebookCategory()) - ->setName('cat1') + ->setTitle('cat1') ->setDescription('desc') ->setCertifMinScore(100) ->setDocumentId(0) @@ -51,7 +51,7 @@ class GradeBookCategoryRepositoryTest extends AbstractApiTest $this->assertHasNoEntityViolations($category); $evaluation = (new GradebookEvaluation()) - ->setName('eva') + ->setTitle('eva') ->setDescription('desc') ->setCategory($category) ->setVisible(1) @@ -106,7 +106,7 @@ class GradeBookCategoryRepositoryTest extends AbstractApiTest $course = $this->createCourse('new'); $category = (new GradebookCategory()) - ->setName('cat1') + ->setTitle('cat1') ->setCourse($course) ->setWeight(100.00) ->setVisible(true) @@ -115,7 +115,7 @@ class GradeBookCategoryRepositoryTest extends AbstractApiTest $this->assertHasNoEntityViolations($category); $evaluation = (new GradebookEvaluation()) - ->setName('eva') + ->setTitle('eva') ->setCategory($category) ->setCourse($course) ->setWeight(100.00) diff --git a/tests/CoreBundle/Repository/Node/CourseRepositoryTest.php b/tests/CoreBundle/Repository/Node/CourseRepositoryTest.php index 7f02820abf..3b3a95c3f8 100644 --- a/tests/CoreBundle/Repository/Node/CourseRepositoryTest.php +++ b/tests/CoreBundle/Repository/Node/CourseRepositoryTest.php @@ -48,7 +48,7 @@ class CourseRepositoryTest extends AbstractApiTest $em = $this->getEntityManager(); $category = (new CourseCategory()) ->setCode('Course cat') - ->setName('Course cat') + ->setTitle('Course cat') ->setDescription('desc') ->setAuthCatChild('cat') ->setAuthCourseChild('cat') diff --git a/tests/CoreBundle/Repository/Node/UsergroupRepositoryTest.php b/tests/CoreBundle/Repository/Node/UsergroupRepositoryTest.php index 1b76c561ab..c6c9882e78 100644 --- a/tests/CoreBundle/Repository/Node/UsergroupRepositoryTest.php +++ b/tests/CoreBundle/Repository/Node/UsergroupRepositoryTest.php @@ -27,7 +27,7 @@ class UsergroupRepositoryTest extends KernelTestCase $repo = self::getContainer()->get(UsergroupRepository::class); $group = (new Usergroup()) - ->setName('test') + ->setTitle('test') ->setDescription('desc') ->setGroupType(1) ->setUrl('url') @@ -46,7 +46,7 @@ class UsergroupRepositoryTest extends KernelTestCase $this->assertSame('/img/icons/64/group_na.png', $group->getDefaultIllustration(64)); $this->assertSame(1, $repo->count([])); - $group->setName('test2'); + $group->setTitle('test2'); $repo->update($group); $this->assertSame(1, $repo->count([])); @@ -62,7 +62,7 @@ class UsergroupRepositoryTest extends KernelTestCase $em = $this->getEntityManager(); $group = (new Usergroup()) - ->setName('test') + ->setTitle('test') ->addAccessUrl($this->getAccessUrl()) ->setCreator($this->getUser('admin')) ; diff --git a/tests/CoreBundle/Repository/PromotionRepositoryTest.php b/tests/CoreBundle/Repository/PromotionRepositoryTest.php index 7d6cabe0fe..075c62ae01 100644 --- a/tests/CoreBundle/Repository/PromotionRepositoryTest.php +++ b/tests/CoreBundle/Repository/PromotionRepositoryTest.php @@ -23,13 +23,13 @@ class PromotionRepositoryTest extends AbstractApiTest $defaultCount = $repo->count([]); $career = (new Career()) - ->setName('Doctor') + ->setTitle('Doctor') ; $em->persist($career); $em->flush(); $promotion = (new Promotion()) - ->setName('2000') + ->setTitle('2000') ->setDescription('Promotion of 2000') ->setCareer($career) ->setStatus(1) diff --git a/tests/CoreBundle/Repository/SequenceRepositoryTest.php b/tests/CoreBundle/Repository/SequenceRepositoryTest.php index aea66669e2..1e86a2e7b6 100644 --- a/tests/CoreBundle/Repository/SequenceRepositoryTest.php +++ b/tests/CoreBundle/Repository/SequenceRepositoryTest.php @@ -21,7 +21,7 @@ class SequenceRepositoryTest extends AbstractApiTest $repo = self::getContainer()->get(SequenceRepository::class); $sequence = (new Sequence()) - ->setName('Sequence 1') + ->setTitle('Sequence 1') ->setGraph('') ; $this->assertHasNoEntityViolations($sequence); diff --git a/tests/CoreBundle/Repository/SessionRepositoryTest.php b/tests/CoreBundle/Repository/SessionRepositoryTest.php index bf5af8373c..87cf933788 100644 --- a/tests/CoreBundle/Repository/SessionRepositoryTest.php +++ b/tests/CoreBundle/Repository/SessionRepositoryTest.php @@ -51,7 +51,7 @@ class SessionRepositoryTest extends AbstractApiTest $repo = self::getContainer()->get(SessionRepository::class); $session = (new Session()) - ->setName($name) + ->setTitle($name) ->addGeneralCoach($this->getUser('admin')) ->addAccessUrl($this->getAccessUrl()) ; @@ -486,7 +486,7 @@ class SessionRepositoryTest extends AbstractApiTest $coach = $this->createUser('coach'); $category = (new SessionCategory()) - ->setName('cat') + ->setTitle('cat') ->setDateStart(new DateTime()) ->setDateEnd(new DateTime()) ->setUrl($this->getAccessUrl()) @@ -500,8 +500,8 @@ class SessionRepositoryTest extends AbstractApiTest $this->assertNotNull($category->getDateEnd()); $this->assertNotNull($category->getUrl()); - $session = $sessionRepo->create() - ->setName('session 1') + $session = ($sessionRepo->create()) + ->setTitle('session 1') ->addGeneralCoach($coach) ->addAccessUrl($url) ->setCategory($category) @@ -549,8 +549,8 @@ class SessionRepositoryTest extends AbstractApiTest $coach = $this->createUser('coach'); $course = $this->createCourse('new'); - $session = $sessionRepo->create() - ->setName('session 1') + $session = ($sessionRepo->create()) + ->setTitle('session 1') ->addGeneralCoach($coach) ->addAccessUrl($url) ->setVisibility(Session::INVISIBLE) diff --git a/tests/CoreBundle/Repository/SkillRepositoryTest.php b/tests/CoreBundle/Repository/SkillRepositoryTest.php index 5b2682a7b0..336d1112ad 100644 --- a/tests/CoreBundle/Repository/SkillRepositoryTest.php +++ b/tests/CoreBundle/Repository/SkillRepositoryTest.php @@ -35,7 +35,7 @@ class SkillRepositoryTest extends AbstractApiTest $accessUrl = $this->getAccessUrl(); $skill = (new Skill()) - ->setName('php') + ->setTitle('php') ->setShortCode('php') ->setDescription('desc') ->setStatus(Skill::STATUS_ENABLED) @@ -75,7 +75,7 @@ class SkillRepositoryTest extends AbstractApiTest $skillProfile = (new SkillProfile()) ->setDescription('desc') - ->setName('title') + ->setTitle('title') ; $em->persist($skillProfile); diff --git a/tests/CoreBundle/Repository/ToolRepositoryTest.php b/tests/CoreBundle/Repository/ToolRepositoryTest.php index eb813f8062..f5ed8b8cbe 100644 --- a/tests/CoreBundle/Repository/ToolRepositoryTest.php +++ b/tests/CoreBundle/Repository/ToolRepositoryTest.php @@ -22,12 +22,12 @@ class ToolRepositoryTest extends AbstractApiTest $defaultCount = $repo->count([]); $tool = (new Tool()) - ->setName('test') + ->setTitle('test') ; $em->persist($tool); $em->flush(); $this->assertSame($defaultCount + 1, $repo->count([])); - $this->assertSame('test', $tool->getName()); + $this->assertSame('test', $tool->getTitle()); } } diff --git a/tests/CoreBundle/Tool/ToolChainTest.php b/tests/CoreBundle/Tool/ToolChainTest.php index 9972053ef2..cf58cc24ed 100644 --- a/tests/CoreBundle/Tool/ToolChainTest.php +++ b/tests/CoreBundle/Tool/ToolChainTest.php @@ -166,7 +166,7 @@ class ToolChainTest extends AbstractApiTest $this->assertNotEmpty($items); $resourceType = (new ResourceType()) - ->setName('test') + ->setTitle('test') ; $this->assertHasNoEntityViolations($resourceType); $em->persist($resourceType); @@ -175,7 +175,7 @@ class ToolChainTest extends AbstractApiTest $collection->add($resourceType); $tool = (new Tool()) - ->setName('lasagna') + ->setTitle('lasagna') ->setResourceTypes($collection) ; $this->assertHasNoEntityViolations($tool); diff --git a/tests/CourseBundle/Repository/CExerciseCategoryRepositoryTest.php b/tests/CourseBundle/Repository/CExerciseCategoryRepositoryTest.php index 9014d68562..1d55f706f7 100644 --- a/tests/CourseBundle/Repository/CExerciseCategoryRepositoryTest.php +++ b/tests/CourseBundle/Repository/CExerciseCategoryRepositoryTest.php @@ -24,7 +24,7 @@ class CExerciseCategoryRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $item = (new CExerciseCategory()) - ->setName('cat') + ->setTitle('cat') ->setDescription('desc') ->setCourse($course) ->setParent($course) @@ -38,7 +38,7 @@ class CExerciseCategoryRepositoryTest extends AbstractApiTest $this->assertSame('cat', (string) $item); $this->assertSame($item->getId(), $item->getResourceIdentifier()); $this->assertSame('desc', $item->getDescription()); - $this->assertSame('cat', $item->getName()); + $this->assertSame('cat', $item->getTitle()); $this->assertSame(1, $repo->count([])); $this->assertCount(1, $repo->getCategories($course->getId())); diff --git a/tests/CourseBundle/Repository/CForumCategoryRepositoryTest.php b/tests/CourseBundle/Repository/CForumCategoryRepositoryTest.php index fbe05f04d2..ee2c14396a 100644 --- a/tests/CourseBundle/Repository/CForumCategoryRepositoryTest.php +++ b/tests/CourseBundle/Repository/CForumCategoryRepositoryTest.php @@ -28,7 +28,7 @@ class CForumCategoryRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $category = (new CForumCategory()) - ->setCatTitle('cat 1') + ->setTitle('cat 1') ->setCatComment('comment') ->setCatOrder(1) ->setLocked(1) @@ -47,7 +47,7 @@ class CForumCategoryRepositoryTest extends AbstractApiTest $this->assertSame('cat 1', (string) $category); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ->setForumCategory($category) diff --git a/tests/CourseBundle/Repository/CForumPostRepositoryTest.php b/tests/CourseBundle/Repository/CForumPostRepositoryTest.php index cbb7c1d5dc..590a1b1e40 100644 --- a/tests/CourseBundle/Repository/CForumPostRepositoryTest.php +++ b/tests/CourseBundle/Repository/CForumPostRepositoryTest.php @@ -33,14 +33,14 @@ class CForumPostRepositoryTest extends AbstractApiTest $attachmentRepo = self::getContainer()->get(CForumAttachmentRepository::class); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ; $forumRepo->create($forum); $thread = (new CForumThread()) - ->setThreadTitle('thread title') + ->setTitle('thread title') ->setForum($forum) ->setParent($course) ->setCreator($teacher) @@ -48,7 +48,7 @@ class CForumPostRepositoryTest extends AbstractApiTest $threadRepo->create($thread); $date = new DateTime(); $post = (new CForumPost()) - ->setPostTitle('post') + ->setTitle('post') ->setPostText('text') ->setPostDate($date) ->setPostNotification(true) diff --git a/tests/CourseBundle/Repository/CForumRepositoryTest.php b/tests/CourseBundle/Repository/CForumRepositoryTest.php index 6dc599dded..c8acbbcdec 100644 --- a/tests/CourseBundle/Repository/CForumRepositoryTest.php +++ b/tests/CourseBundle/Repository/CForumRepositoryTest.php @@ -28,7 +28,7 @@ class CForumRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setForumComment('comment') ->setForumThreads(0) ->setForumPosts(0) @@ -74,7 +74,7 @@ class CForumRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ; @@ -103,7 +103,7 @@ class CForumRepositoryTest extends AbstractApiTest $lpRepo->createLp($lp); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ->setLp($lp) @@ -130,7 +130,7 @@ class CForumRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ; diff --git a/tests/CourseBundle/Repository/CForumThreadRepositoryTest.php b/tests/CourseBundle/Repository/CForumThreadRepositoryTest.php index 9a3311792e..96e9ffa81f 100644 --- a/tests/CourseBundle/Repository/CForumThreadRepositoryTest.php +++ b/tests/CourseBundle/Repository/CForumThreadRepositoryTest.php @@ -31,7 +31,7 @@ class CForumThreadRepositoryTest extends AbstractApiTest $qualifyRepo = $em->getRepository(CForumThreadQualify::class); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ->addCourseLink($course) @@ -39,7 +39,7 @@ class CForumThreadRepositoryTest extends AbstractApiTest $forumRepo->create($forum); $thread = (new CForumThread()) - ->setThreadTitle('thread title') + ->setTitle('thread title') ->setThreadPeerQualify(true) ->setThreadReplies(0) ->setThreadDate(new DateTime()) @@ -103,7 +103,7 @@ class CForumThreadRepositoryTest extends AbstractApiTest $threadRepo = self::getContainer()->get(CForumThreadRepository::class); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ->addCourseLink($course) @@ -111,7 +111,7 @@ class CForumThreadRepositoryTest extends AbstractApiTest $forumRepo->create($forum); $thread = (new CForumThread()) - ->setThreadTitle('thread title') + ->setTitle('thread title') ->setForum($forum) ->setParent($course) ->setCreator($teacher) diff --git a/tests/CourseBundle/Repository/CGlossaryRepositoryTest.php b/tests/CourseBundle/Repository/CGlossaryRepositoryTest.php index a79e2c7ed9..8f4ff1dedb 100644 --- a/tests/CourseBundle/Repository/CGlossaryRepositoryTest.php +++ b/tests/CourseBundle/Repository/CGlossaryRepositoryTest.php @@ -27,7 +27,7 @@ class CGlossaryRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $glossary = (new CGlossary()) - ->setName('glossary') + ->setTitle('glossary') ->setDescription('desc') ->setDisplayOrder(1) ->setParent($course) diff --git a/tests/CourseBundle/Repository/CLinkCategoryRepositoryTest.php b/tests/CourseBundle/Repository/CLinkCategoryRepositoryTest.php index 0961e5e26b..40913fb189 100644 --- a/tests/CourseBundle/Repository/CLinkCategoryRepositoryTest.php +++ b/tests/CourseBundle/Repository/CLinkCategoryRepositoryTest.php @@ -24,7 +24,7 @@ class CLinkCategoryRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $category = (new CLinkCategory()) - ->setCategoryTitle('cat') + ->setTitle('cat') ->setDescription('desc') ->setDisplayOrder(1) ->setParent($course) diff --git a/tests/CourseBundle/Repository/CLpRepositoryTest.php b/tests/CourseBundle/Repository/CLpRepositoryTest.php index 60c6494d21..d49c97320a 100644 --- a/tests/CourseBundle/Repository/CLpRepositoryTest.php +++ b/tests/CourseBundle/Repository/CLpRepositoryTest.php @@ -115,7 +115,7 @@ class CLpRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $forum = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ->addCourseLink($course) @@ -123,7 +123,7 @@ class CLpRepositoryTest extends AbstractApiTest $forumRepo->create($forum); $forum2 = (new CForum()) - ->setForumTitle('forum2') + ->setTitle('forum2') ->setParent($course2) ->setCreator($teacher) ->addCourseLink($course) diff --git a/tests/CourseBundle/Repository/CQuizQuestionRepositoryTest.php b/tests/CourseBundle/Repository/CQuizQuestionRepositoryTest.php index 30d10d6d70..7b0c76ecbe 100644 --- a/tests/CourseBundle/Repository/CQuizQuestionRepositoryTest.php +++ b/tests/CourseBundle/Repository/CQuizQuestionRepositoryTest.php @@ -60,7 +60,7 @@ class CQuizQuestionRepositoryTest extends AbstractApiTest ; $option = (new CQuizQuestionOption()) - ->setName('option 1') + ->setTitle('option 1') ->setQuestion($question) ->setPosition(1) ; diff --git a/tests/CourseBundle/Repository/CQuizRepositoryTest.php b/tests/CourseBundle/Repository/CQuizRepositoryTest.php index 84f8545e9c..0a9cbfe248 100644 --- a/tests/CourseBundle/Repository/CQuizRepositoryTest.php +++ b/tests/CourseBundle/Repository/CQuizRepositoryTest.php @@ -105,7 +105,7 @@ class CQuizRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $category = (new CExerciseCategory()) - ->setName('cat') + ->setTitle('cat') ->setDescription('desc') ->setCourse($course) ->setParent($course) diff --git a/tests/CourseBundle/Repository/CShortcutRepositoryTest.php b/tests/CourseBundle/Repository/CShortcutRepositoryTest.php index 68b87cab5a..03917f2f86 100644 --- a/tests/CourseBundle/Repository/CShortcutRepositoryTest.php +++ b/tests/CourseBundle/Repository/CShortcutRepositoryTest.php @@ -29,7 +29,7 @@ class CShortcutRepositoryTest extends AbstractApiTest $teacher = $this->createUser('teacher'); $resource = (new CForum()) - ->setForumTitle('forum') + ->setTitle('forum') ->setParent($course) ->setCreator($teacher) ->addCourseLink($course) @@ -38,7 +38,7 @@ class CShortcutRepositoryTest extends AbstractApiTest $em->flush(); $shortcut = (new CShortcut()) - ->setName($resource->getResourceName()) + ->setTitle($resource->getResourceName()) ->setShortCutNode($resource->getResourceNode()) ->setCreator($teacher) ->setParent($resource) diff --git a/tests/CourseBundle/Repository/CToolRepositoryTest.php b/tests/CourseBundle/Repository/CToolRepositoryTest.php index 28d8d90a6d..fd80482cc3 100644 --- a/tests/CourseBundle/Repository/CToolRepositoryTest.php +++ b/tests/CourseBundle/Repository/CToolRepositoryTest.php @@ -32,7 +32,7 @@ class CToolRepositoryTest extends AbstractApiTest $this->assertNotNull($tool); $cTool = (new CTool()) - ->setName('test') + ->setTitle('test') ->setCourse($course) ->setTool($tool) ->setParent($course)