diff --git a/documentation/changelog.html b/documentation/changelog.html index 8d3fa7dc48..62e89d3dea 100755 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -54,6 +54,7 @@

Possibly breaking changes

Notable new Features

Improvements (minor features) and debug

diff --git a/documentation/installation_guide.html b/documentation/installation_guide.html index 888f132a6d..8446409fa5 100755 --- a/documentation/installation_guide.html +++ b/documentation/installation_guide.html @@ -384,6 +384,7 @@ As this is only a minor version change from previous 1.10.* versions of Chamilo,
  • point your browser on your portal URL + main/install/
  • choose your language and click Upgrade from 1.8.x/1.9.x
  • clean your archive/ directory: take a temporary copy of index.html, delete all the contents *in* this directory (do NOT remove the directory itself, only its contents!). It will all be re-generated. You can also delete the contents of this directory through the "Archive directory cleanup" option in the "System" box of the Administration page.
  • +
  • make sure "AllowOverride All" is present in your Apache configuration, as interpreting the .htaccess files is very important for Chamilo to work

  • diff --git a/main/admin/course_information.php b/main/admin/course_information.php index 7395550635..4a05150d0c 100755 --- a/main/admin/course_information.php +++ b/main/admin/course_information.php @@ -153,9 +153,8 @@ if (Database::num_rows($res) > 0) { } else { echo get_lang('NoUsersInCourse'); } -$courseInfo = api_get_course_info($course->code); -$session_list = SessionManager::get_session_by_course($courseInfo['real_id']); +$session_list = SessionManager::get_session_by_course($course->id); $url = api_get_path(WEB_CODE_PATH); if (!empty($session_list)) { diff --git a/main/admin/session_import.php b/main/admin/session_import.php index bddd3ca418..7ea9219c0a 100755 --- a/main/admin/session_import.php +++ b/main/admin/session_import.php @@ -380,8 +380,8 @@ if (isset($_POST['formSent']) && $_POST['formSent']) { if ($vcourse['code'] == $course_code) { // Ignore, this has already been inserted. } else { - $course_info = api_get_course_info($course['code']); - $courseId = $course_info['real_id']; + $course_info = api_get_course_info_by_id($course['id']); + $courseId = $course['real_id']; $sql_course = "INSERT INTO $tbl_session_course SET c_id = $courseId, diff --git a/main/admin/teacher_time_report.php b/main/admin/teacher_time_report.php index 223f08c3f3..0fcf143e97 100644 --- a/main/admin/teacher_time_report.php +++ b/main/admin/teacher_time_report.php @@ -187,7 +187,7 @@ if (!empty($selectedTeacher)) { if (!empty($courses)) { foreach ($courses as $course) { - $courseInfo = api_get_course_info($course['code']); + $courseInfo = api_get_course_info_by_id($course['real_id']); $totalTime = UserManager::getExpendedTimeInCourses( $selectedTeacher, @@ -219,11 +219,11 @@ if (!empty($selectedTeacher)) { 'name' => $session['name'] ); - $courseInfo = api_get_course_info($course['course_code']); + $courseInfo = api_get_course_info_by_id($course['c_id']); $totalTime = UserManager::getExpendedTimeInCourses( $selectedTeacher, - $course['real_id'], + $course['c_id'], $session['id'], $selectedFrom, $selectedUntil @@ -233,7 +233,7 @@ if (!empty($selectedTeacher)) { $timeReport->data[] = array( 'session' => $sessionData, 'course' => array( - 'id' => $courseInfo['real_id'], + 'id' => $course['c_id'], 'name' => $courseInfo['title'] ), 'coach' => $teacherData, @@ -249,7 +249,11 @@ if (empty($selectedCourse) && empty($selectedSession) && empty($selectedTeacher) 'username' => $teacher['username'], 'completeName' => $teacher['completeName'], ), - 'totalTime' => SessionManager::getTotalUserTimeInPlatform($teacher['user_id'], $selectedFrom, $selectedUntil) + 'totalTime' => SessionManager::getTotalUserTimeInPlatform( + $teacher['user_id'], + $selectedFrom, + $selectedUntil + ) ); } } diff --git a/main/admin/user_information.php b/main/admin/user_information.php index 58ce04a8aa..0dcda04cc8 100755 --- a/main/admin/user_information.php +++ b/main/admin/user_information.php @@ -137,7 +137,7 @@ if (count($sessions) > 0) { $csvContent[] = array($session_item['session_name']); $csvContent[] = $headerList; foreach ($session_item['courses'] as $my_course) { - $courseInfo = api_get_course_info($my_course['code']); + $courseInfo = api_get_course_info_by_id($my_course['real_id']); $sessionStatus = SessionManager::get_user_status_in_session( $user['user_id'], $courseInfo['real_id'], diff --git a/main/admin/user_move_stats.php b/main/admin/user_move_stats.php index 8a4c5a5457..d6f8ab43df 100755 --- a/main/admin/user_move_stats.php +++ b/main/admin/user_move_stats.php @@ -669,7 +669,9 @@ if (!empty($user_list)) { if (is_array($course_list) && !empty($course_list)) { foreach ($course_list as $my_course) { - $key = $my_course['code'].'_'.$my_course['session_id']; + $courseInfo = api_get_course_info_by_id($my_course['c_id']); + $my_course['real_id'] = $my_course['c_id']; + $key = $courseInfo['code'].'_'.$my_course['session_id']; if (!in_array($key, $new_course_list)) { $my_course['not_registered'] = 1; @@ -679,7 +681,7 @@ if (!empty($user_list)) { } foreach ($course_list_registered as & $course) { - $courseInfo = api_get_course_info($course['code']); + $courseInfo = api_get_course_info_by_id($course['real_id']); $course['name'] = $courseInfo['name']; } diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index ba2cb60260..ccdf3a4049 100755 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -51,7 +51,7 @@ $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY); $course_id = api_get_course_int_id(); -$_course = api_get_course_info(); +$_course = api_get_course_info_by_id($course_id); $group_id = api_get_group_id(); api_protect_course_group(GroupManager::GROUP_TOOL_ANNOUNCEMENT); diff --git a/main/course_info/infocours.php b/main/course_info/infocours.php index da93a5ec6d..703f875abe 100755 --- a/main/course_info/infocours.php +++ b/main/course_info/infocours.php @@ -434,7 +434,7 @@ if ($form->validate() && is_settings_editable()) { isset($_configuration[$urlId]['hosting_limit_active_courses']) && $_configuration[$urlId]['hosting_limit_active_courses'] > 0 ) { - $courseInfo = api_get_course_info($course_code); + $courseInfo = api_get_course_info_by_id($courseId); // Check if if ($courseInfo['visibility'] == COURSE_VISIBILITY_HIDDEN && diff --git a/main/coursecopy/copy_course_session_selected.php b/main/coursecopy/copy_course_session_selected.php index 7b0685d763..d25e8e31ce 100644 --- a/main/coursecopy/copy_course_session_selected.php +++ b/main/coursecopy/copy_course_session_selected.php @@ -29,8 +29,9 @@ if (!api_is_coach()) { api_not_allowed(true); } -$courseCode = api_get_course_id(); -$courseInfo = api_get_course_info($courseCode); +$courseId = api_get_course_int_id(); +$courseInfo = api_get_course_info($courseId); +$courseCode = $courseInfo['code']; $sessionId = api_get_session_id(); if (empty($courseCode) OR empty($sessionId)) { diff --git a/main/document/show_content.php b/main/document/show_content.php index fcdeb86c59..925fd9a43d 100755 --- a/main/document/show_content.php +++ b/main/document/show_content.php @@ -14,8 +14,9 @@ $noPHP_SELF = true; $header_file = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null; $document_id = intval($_GET['id']); -$course_info = api_get_course_info(); -$course_code = api_get_course_id(); +$courseId = api_get_course_int_id(); +$course_info = api_get_course_info_by_id($courseId); +$course_code = $course_info['code']; $session_id = api_get_session_id(); if (empty($course_info)) { diff --git a/main/exercice/TestCategory.php b/main/exercice/TestCategory.php index c647555128..59b58633ae 100644 --- a/main/exercice/TestCategory.php +++ b/main/exercice/TestCategory.php @@ -85,8 +85,8 @@ class TestCategory Database::query($sql); // add test_category in item_property table - $course_code = api_get_course_id(); - $course_info = api_get_course_info($course_code); + $course_id = api_get_course_int_id(); + $course_info = api_get_course_info_by_id($course_id); api_item_property_update( $course_info, TOOL_TEST_CATEGORY, @@ -117,13 +117,13 @@ class TestCategory if (Database::affected_rows($result) <= 0) { return false; } else { + $course_id = api_get_course_int_id(); // remove link between question and category $sql2 = "DELETE FROM $tbl_question_rel_cat - WHERE category_id=$v_id AND c_id=".api_get_course_int_id(); + WHERE category_id=$v_id AND c_id=".$course_id; Database::query($sql2); // item_property update - $course_code = api_get_course_id(); - $course_info = api_get_course_info($course_code); + $course_info = api_get_course_info_by_id($course_id); api_item_property_update( $course_info, TOOL_TEST_CATEGORY, @@ -151,8 +151,8 @@ class TestCategory return false; } else { // item_property update - $course_code = api_get_course_id(); - $course_info = api_get_course_info($course_code); + $course_id = api_get_course_int_id(); + $course_info = api_get_course_info_by_id($course_id); api_item_property_update( $course_info, TOOL_TEST_CATEGORY, diff --git a/main/exercice/exercise.php b/main/exercice/exercise.php index 0258cdee3c..5b1a41f8de 100644 --- a/main/exercice/exercise.php +++ b/main/exercice/exercise.php @@ -37,9 +37,9 @@ $is_allowedToEdit = api_is_allowed_to_edit(null, true); $is_tutor = api_is_allowed_to_edit(true); $is_tutor_course = api_is_course_tutor(); $courseInfo = api_get_course_info(); -$courseId = api_get_course_int_id(); -$userId = api_get_user_id(); +$courseId = $courseInfo['real_id']; $userInfo = api_get_user_info(); +$userId = $userInfo['id']; $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh( $userId, $courseInfo diff --git a/main/forum/download.php b/main/forum/download.php index c62d874e45..fa04e1694c 100755 --- a/main/forum/download.php +++ b/main/forum/download.php @@ -54,6 +54,7 @@ $tbl_forum_attachment = Database::get_course_table(TABLE_FORUM_ATTACHMENT); $tbl_forum_post = Database::get_course_table(TABLE_FORUM_POST); $course_id = api_get_course_int_id(); +$courseInfo = api_get_course_info_by_id($course_id); // launch event Event::event_download($doc_url); @@ -71,13 +72,13 @@ $result = Database::query($sql); $row = Database::fetch_array($result); $forum_thread_visibility = api_get_item_visibility( - api_get_course_info($course_code), + $courseInfo, TOOL_FORUM_THREAD, $row['thread_id'], api_get_session_id() ); $forum_forum_visibility = api_get_item_visibility( - api_get_course_info($course_code), + $courseInfo, TOOL_FORUM, $row['forum_id'], api_get_session_id() @@ -86,7 +87,7 @@ $forum_forum_visibility = api_get_item_visibility( if ($forum_thread_visibility==1 && $forum_forum_visibility==1) { if (Security::check_abs_path( $full_file_name, - api_get_path(SYS_COURSE_PATH).api_get_course_path().'/upload/forum/') + api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/upload/forum/') ) { DocumentManager::file_send_for_download( $full_file_name, diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index a2f4bfce13..c4951d28d8 100755 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -2240,7 +2240,7 @@ function count_number_of_forums_in_category($cat_id) */ function store_thread($current_forum, $values, $courseInfo = array(), $showMessage = true) { - $courseInfo = empty($courseInfo) ? api_get_course_info() :$courseInfo ; + $courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo ; $_user = api_get_user_info(); $course_id = $courseInfo['real_id']; $courseCode = $courseInfo['code']; diff --git a/main/gradebook/exercise_jump.php b/main/gradebook/exercise_jump.php index 6d28faf6c8..26b35c22a3 100755 --- a/main/gradebook/exercise_jump.php +++ b/main/gradebook/exercise_jump.php @@ -14,8 +14,8 @@ require_once '../inc/global.inc.php'; api_block_anonymous_users(); $this_section=SECTION_COURSES; -$course_code = api_get_course_id(); -$course_info = api_get_course_info($course_code); +$course_id = api_get_course_int_id(); +$course_info = api_get_course_info_by_id($course_id); $course_title = $course_info['title']; $course_code = $return_result['code']; $gradebook = Security::remove_XSS($_GET['gradebook']); diff --git a/main/gradebook/lib/GradebookUtils.php b/main/gradebook/lib/GradebookUtils.php index 21ed30f40e..47be580da5 100644 --- a/main/gradebook/lib/GradebookUtils.php +++ b/main/gradebook/lib/GradebookUtils.php @@ -1211,7 +1211,7 @@ class GradebookUtils continue; } - $courseInfo = api_get_course_info($course['code']); + $courseInfo = api_get_course_info_by_id($course['real_id']); $courseList[] = [ 'course' => $courseInfo['title'], diff --git a/main/gradebook/lib/be/category.class.php b/main/gradebook/lib/be/category.class.php index 00e1af6361..63ba04c8dd 100755 --- a/main/gradebook/lib/be/category.class.php +++ b/main/gradebook/lib/be/category.class.php @@ -288,7 +288,7 @@ class Category implements GradebookItem return $cats; } - $courseCode = api_get_course_info(api_get_course_id()); + $courseCode = api_get_course_info_by_id(api_get_course_int_id()); $courseCode = $courseCode['code']; $session_id = intval($session_id); diff --git a/main/inc/ajax/course.ajax.php b/main/inc/ajax/course.ajax.php index 278ef93483..9be4136fe7 100755 --- a/main/inc/ajax/course.ajax.php +++ b/main/inc/ajax/course.ajax.php @@ -28,7 +28,7 @@ switch ($action) { $list_course_all_info = CourseManager::get_courses_list_by_user_id($user_id, false); if (!empty($list_course_all_info)) { foreach ($list_course_all_info as $course_item) { - $course_info = api_get_course_info($course_item['code']); + $course_info = api_get_course_info_by_id($course_item['real_id']); echo $course_info['title'].'
    '; } } else { diff --git a/main/inc/ajax/exercise.ajax.php b/main/inc/ajax/exercise.ajax.php index 435ed724a9..26a09d5341 100755 --- a/main/inc/ajax/exercise.ajax.php +++ b/main/inc/ajax/exercise.ajax.php @@ -184,7 +184,7 @@ switch ($action) { } break; case 'update_question_order': - $course_info = api_get_course_info($course_code); + $course_info = api_get_course_info_by_id($course_id); $course_id = $course_info['real_id']; $exercise_id = isset($_REQUEST['exercise_id']) ? $_REQUEST['exercise_id'] : null; @@ -221,7 +221,7 @@ switch ($action) { } break; case 'save_exercise_by_now': - $course_info = api_get_course_info($course_code); + $course_info = api_get_course_info_by_id($course_id); $course_id = $course_info['real_id']; // Use have permissions? diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index f2dd4c1911..d2e8fcc704 100755 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -456,53 +456,33 @@ if (!empty($valid_languages)) { $language_interface_initial_value = $language_interface; /** - * Include all necessary language files - * - trad4all - * - notification - * - custom tool language files + * Include the trad4all language file */ -$language_files = array(); -$language_files[] = 'trad4all'; - -if (isset($language_file)) { - if (!is_array($language_file)) { - $language_files[] = $language_file; - } else { - $language_files = array_merge($language_files, $language_file); +// if the sub-language feature is on +$parent_path = SubLanguageManager::get_parent_language_path($language_interface); +if (!empty($parent_path)) { + // include English + include $langpath.'english/trad4all.inc.php'; + // prepare string for current language and its parent + $lang_file = $langpath.$language_interface.'/trad4all.inc.php'; + $parent_lang_file = $langpath.$parent_path.'/trad4all.inc.php'; + // load the parent language file first + if (file_exists($parent_lang_file)) { + include $parent_lang_file; } -} -// if a set of language files has been properly defined -if (is_array($language_files)) { - // if the sub-language feature is on - if (api_get_setting('allow_use_sub_language') == 'true') { - $parent_path = SubLanguageManager::get_parent_language_path($language_interface); - foreach ($language_files as $index => $language_file) { - // include English - include $langpath.'english/'.$language_file.'.inc.php'; - // prepare string for current language and its parent - $lang_file = $langpath.$language_interface.'/'.$language_file.'.inc.php'; - $parent_lang_file = $langpath.$parent_path.'/'.$language_file.'.inc.php'; - // load the parent language file first - if (file_exists($parent_lang_file)) { - include $parent_lang_file; - } - // overwrite the parent language translations if there is a child - if (file_exists($lang_file)) { - include $lang_file; - } - } - } else { - // if the sub-languages feature is not on, then just load the - // set language interface - foreach ($language_files as $index => $language_file) { - // include English - include $langpath.'english/'.$language_file.'.inc.php'; - // prepare string for current language - $langfile = $langpath.$language_interface.'/'.$language_file.'.inc.php'; - if (file_exists($langfile)) { - include $langfile; - } - } + // overwrite the parent language translations if there is a child + if (file_exists($lang_file)) { + include $lang_file; + } +} else { + // if the sub-languages feature is not on, then just load the + // set language interface + // include English + include $langpath.'english/trad4all.inc.php'; + // prepare string for current language + $langfile = $langpath.$language_interface.'/trad4all.inc.php'; + if (file_exists($langfile)) { + include $langfile; } } diff --git a/main/inc/lib/AnnouncementManager.php b/main/inc/lib/AnnouncementManager.php index c27be50c7b..3a5994e339 100755 --- a/main/inc/lib/AnnouncementManager.php +++ b/main/inc/lib/AnnouncementManager.php @@ -1623,9 +1623,9 @@ class AnnouncementManager $tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT); $tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY); - $course_id = api_get_course_int_id(); - $_course = api_get_course_info(); $session_id = api_get_session_id(); + $_course = api_get_course_info(); + $course_id = $_course['real_id']; $userId = api_get_user_id(); $condition_session = api_get_session_condition($session_id, true, true, 'announcement.session_id'); diff --git a/main/inc/lib/agenda.lib.php b/main/inc/lib/agenda.lib.php index cfdc6da2de..9e69db31a3 100644 --- a/main/inc/lib/agenda.lib.php +++ b/main/inc/lib/agenda.lib.php @@ -931,7 +931,7 @@ class Agenda $my_session_id = $session_item['session_id']; if (!empty($my_courses)) { foreach ($my_courses as $course_item) { - $courseInfo = api_get_course_info($course_item['code']); + $courseInfo = api_get_course_info_by_id($course_item['real_id']); $this->getCourseEvents($start, $end, $courseInfo, 0, $my_session_id); } } @@ -2953,7 +2953,7 @@ class Agenda // get agenda-items for every course $courses = api_get_user_courses($user_id,false); foreach ($courses as $id => $course) { - $c = api_get_course_info($course['code']); + $c = api_get_course_info_by_id($course['real_id']); //databases of the courses $t_a = Database :: get_course_table(TABLE_AGENDA, $course['db']); $t_ip = Database :: get_course_table(TABLE_ITEM_PROPERTY, $course['db']); diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index 2e7fb445d9..f0983aa9bb 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -1322,7 +1322,7 @@ function api_get_user_courses($userid, $fetch_session = true) $t_course = Database::get_main_table(TABLE_MAIN_COURSE); $t_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER); - $sql = "SELECT cc.code code, cc.directory dir, cu.status status + $sql = "SELECT cc.id as real_id, cc.code code, cc.directory dir, cu.status status FROM $t_course cc, $t_course_user cu WHERE @@ -1406,7 +1406,7 @@ function _api_format_user($user, $add_password = false) $result['email'] = isset($user['mail'])? $user['mail'] : null; } $user_id = intval($user['user_id']); - $result['user_id'] = $user_id; + $result['user_id'] = $result['id'] = $user_id; $saveUserLastLogin = api_get_configuration_value('save_user_last_login'); if ($saveUserLastLogin) { diff --git a/main/inc/lib/attendance.lib.php b/main/inc/lib/attendance.lib.php index a59324080a..8aaccee51f 100755 --- a/main/inc/lib/attendance.lib.php +++ b/main/inc/lib/attendance.lib.php @@ -293,8 +293,8 @@ class Attendance $table_link = Database:: get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $session_id = api_get_session_id(); $user_id = api_get_user_id(); - $course_code = api_get_course_id(); - $course_id = api_get_course_int_id(); + $course_code = $_course['code']; + $course_id = $_course['real_id']; $title_gradebook= Database::escape_string($this->attendance_qualify_title); $value_calification = 0; $weight_calification = floatval($this->attendance_weight); @@ -364,8 +364,8 @@ class Attendance $session_id = api_get_session_id(); $user_id = api_get_user_id(); $attendance_id = intval($attendance_id); - $course_code = api_get_course_id(); - $course_id = api_get_course_int_id(); + $course_code = $_course['code']; + $course_id = $_course['real_id']; $title_gradebook = Database::escape_string($this->attendance_qualify_title); $value_calification = 0; $weight_calification= floatval($this->attendance_weight); @@ -418,7 +418,7 @@ class Attendance $_course = api_get_course_info(); $tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE); $user_id = api_get_user_id(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; if (is_array($attendance_id)) { foreach ($attendance_id as $id) { $id = intval($id); @@ -456,7 +456,7 @@ class Attendance $_course = api_get_course_info(); $tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE); $user_id = api_get_user_id(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; if (is_array($attendance_id)) { foreach ($attendance_id as $id) { $id = intval($id); @@ -500,7 +500,7 @@ class Attendance $_course = api_get_course_info(); $tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE); $user_id = api_get_user_id(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; $status = intval($status); $action = 'visible'; diff --git a/main/inc/lib/banner.lib.php b/main/inc/lib/banner.lib.php index aee8ddda32..3c16d9cbc2 100755 --- a/main/inc/lib/banner.lib.php +++ b/main/inc/lib/banner.lib.php @@ -201,7 +201,7 @@ function return_logo($theme) { function return_notification_menu() { $_course = api_get_course_info(); - $course_id = api_get_course_id(); + $course_id = $_course['code']; $user_id = api_get_user_id(); $html = ''; @@ -497,7 +497,7 @@ function return_breadcrumb($interbreadcrumb, $language_file, $nameTools) $session_name = api_get_session_name($session_id); $_course = api_get_course_info(); $user_id = api_get_user_id(); - $course_id = api_get_course_id(); + $course_id = $_course['real_id']; /* Plugins for banner section */ $web_course_path = api_get_path(WEB_COURSE_PATH); diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php index af9b366bec..2f00635e60 100755 --- a/main/inc/lib/blog.lib.php +++ b/main/inc/lib/blog.lib.php @@ -282,7 +282,7 @@ class Blog { $_user = api_get_user_info(); $_course = api_get_course_info(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; $blog_table_attachment = Database::get_course_table(TABLE_BLOGS_ATTACHMENT); $upload_ok=true; @@ -2010,7 +2010,7 @@ class Blog $_course = api_get_course_info(); $is_western_name_order = api_is_western_name_order(); $session_id = api_get_session_id(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; $currentCourse = $_course['code']; $tbl_users = Database::get_main_table(TABLE_MAIN_USER); diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 4c0283685c..bac1b92324 100755 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -706,18 +706,19 @@ class CourseManager } /** - * Subscribe a user $user_id to a course $course_code. + * Subscribe a user $user_id to a course defined by $courseCode. * @author Hugues Peeters * @author Roan Embrechts * * @param int $user_id the id of the user - * @param string $course_code the course code - * @param string $status (optional) The user's status in the course + * @param string $courseCode the course code + * @param int $status (optional) The user's status in the course + * @param int The user category in which this subscription will be classified * * @return boolean true if subscription succeeds, boolean false otherwise. * @assert ('', '') === false */ - public static function add_user_to_course($user_id, $course_code, $status = STUDENT, $userCourseCategoryId = 0) + public static function add_user_to_course($user_id, $courseCode, $status = STUDENT, $userCourseCategoryId = 0) { $debug = false; $user_table = Database::get_main_table(TABLE_MAIN_USER); @@ -725,16 +726,16 @@ class CourseManager $course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER); $status = ($status == STUDENT || $status == COURSEMANAGER) ? $status : STUDENT; - if (empty($user_id) || empty($course_code) || ($user_id != strval(intval($user_id)))) { + if (empty($user_id) || empty($courseCode) || ($user_id != strval(intval($user_id)))) { return false; } - $course_code = Database::escape_string($course_code); - $courseInfo = api_get_course_info($course_code); + $courseCode = Database::escape_string($courseCode); + $courseInfo = api_get_course_info($courseCode); $courseId = $courseInfo['real_id']; // Check in advance whether the user has already been registered on the platform. - $sql = "SELECT status FROM " . $user_table . " WHERE user_id = '$user_id' "; + $sql = "SELECT status FROM " . $user_table . " WHERE user_id = $user_id "; if (Database::num_rows(Database::query($sql)) == 0) { if ($debug) { error_log('The user has not been registered to the platform'); @@ -745,9 +746,9 @@ class CourseManager // Check whether the user has already been subscribed to this course. $sql = "SELECT * FROM $course_user_table WHERE - user_id = '$user_id' AND - relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND - c_id = '$courseId'"; + user_id = $user_id AND + relation_type <> " . COURSE_RELATION_TYPE_RRHH . " AND + c_id = $courseId"; if (Database::num_rows(Database::query($sql)) > 0) { if ($debug) { error_log('The user has been already subscribed to the course'); @@ -755,14 +756,16 @@ class CourseManager return false; // The user has been subscribed to the course. } - // Check in advance whether subscription is allowed or not for this course. - $sql = "SELECT code, visibility FROM $course_table - WHERE id = $courseId AND subscribe = '" . SUBSCRIBE_NOT_ALLOWED . "'"; - if (Database::num_rows(Database::query($sql)) > 0) { - if ($debug) { - error_log('Subscription is not allowed for this course'); + if (!api_is_course_admin()) { + // Check in advance whether subscription is allowed or not for this course. + $sql = "SELECT code, visibility FROM $course_table + WHERE id = $courseId AND subscribe = '" . SUBSCRIBE_NOT_ALLOWED . "'"; + if (Database::num_rows(Database::query($sql)) > 0) { + if ($debug) { + error_log('Subscription is not allowed for this course'); + } + return false; // Subscription is not allowed for this course. } - return false; // Subscription is not allowed for this course. } // Ok, subscribe the user. @@ -774,6 +777,7 @@ class CourseManager 'sort' => $max_sort + 1, 'user_course_cat' => $userCourseCategoryId ]; + error_log(print_r($params, 1)); $insertId = Database::insert($course_user_table, $params); return $insertId; diff --git a/main/inc/lib/fileUpload.lib.php b/main/inc/lib/fileUpload.lib.php index 974667dcb7..7c9ef7c5b3 100755 --- a/main/inc/lib/fileUpload.lib.php +++ b/main/inc/lib/fileUpload.lib.php @@ -1677,8 +1677,6 @@ function move_uploaded_file_collection_into_directory( */ function replace_img_path_in_html_file($original_img_path, $new_img_path, $html_file) { - $_course = api_get_course_info(); - // Open the file $fp = fopen($html_file, 'r'); diff --git a/main/inc/lib/groupmanager.lib.php b/main/inc/lib/groupmanager.lib.php index b96552713a..6476a51baf 100755 --- a/main/inc/lib/groupmanager.lib.php +++ b/main/inc/lib/groupmanager.lib.php @@ -160,7 +160,7 @@ class GroupManager { $_course = api_get_course_info(); $session_id = api_get_session_id(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; $currentCourseRepository = $_course['path']; diff --git a/main/inc/lib/link.lib.php b/main/inc/lib/link.lib.php index 7a568c6f15..82cc361292 100755 --- a/main/inc/lib/link.lib.php +++ b/main/inc/lib/link.lib.php @@ -156,8 +156,8 @@ class Link extends Model global $msgErr; $ok = true; - $course_id = api_get_course_int_id(); $_course = api_get_course_info(); + $course_id = $_course['real_id']; $session_id = api_get_session_id(); if ($type == 'link') { @@ -231,8 +231,8 @@ class Link extends Model LIBRARY_PATH ) . 'specific_fields_manager.lib.php'; - $course_int_id = api_get_course_int_id(); - $courseid = api_get_course_id(); + $course_int_id = $_course['real_id']; + $courseCode = $_course['code']; $specific_fields = get_specific_field_list(); $ic_slide = new IndexableChunk(); @@ -251,7 +251,7 @@ class Link extends Model ); add_specific_field_value( $specific_field['id'], - $courseid, + $courseCode, TOOL_LINK, $link_id, $sterm @@ -263,10 +263,10 @@ class Link extends Model // Build the chunk to index. $ic_slide->addValue('title', $title); - $ic_slide->addCourseId($courseid); + $ic_slide->addCourseId($courseCode); $ic_slide->addToolId(TOOL_LINK); $xapian_data = array( - SE_COURSE_ID => $courseid, + SE_COURSE_ID => $courseCode, SE_TOOL_ID => TOOL_LINK, SE_DATA => array( 'link_id' => (int)$link_id @@ -320,7 +320,7 @@ class Link extends Model $sql, $tbl_se_ref, $course_int_id, - $courseid, + $courseCode, TOOL_LINK, $link_id, $did @@ -351,11 +351,11 @@ class Link extends Model $order = intval($order); $session_id = api_get_session_id(); $sql = "INSERT INTO " . $tbl_categories . " (c_id, category_title, description, display_order, session_id) - VALUES (" . $course_id . ", + VALUES ($course_id, '" . Database::escape_string($category_title) . "', '" . Database::escape_string($description) . "', '$order', - '$session_id' + $session_id )"; Database:: query($sql); $linkId = Database:: insert_id(); @@ -389,7 +389,7 @@ class Link extends Model $tbl_link = Database:: get_course_table(TABLE_LINK); $tbl_categories = Database:: get_course_table(TABLE_LINK_CATEGORY); - $course_id = api_get_course_int_id(); + $course_id = $courseInfo['real_id']; $id = intval($id); if (empty($id)) { @@ -508,8 +508,8 @@ class Link extends Model public static function editLink($id, $values = array()) { $tbl_link = Database:: get_course_table(TABLE_LINK); - $course_id = api_get_course_int_id(); $_course = api_get_course_info(); + $course_id = $_course['real_id']; $values['url'] = trim($values['url']); $values['title'] = trim($values['title']); diff --git a/main/inc/lib/search/tool_processors/link_processor.class.php b/main/inc/lib/search/tool_processors/link_processor.class.php index dc2b8fba1f..3518ff2fb6 100755 --- a/main/inc/lib/search/tool_processors/link_processor.class.php +++ b/main/inc/lib/search/tool_processors/link_processor.class.php @@ -40,10 +40,10 @@ class link_processor extends search_processor { public function process() { $results = array(); - foreach ($this->links as $courseid => $one_course_links) { - $course_info = api_get_course_info($courseid); + foreach ($this->links as $courseCode => $one_course_links) { + $course_info = api_get_course_info($courseCode); $search_show_unlinked_results = (api_get_setting('search_show_unlinked_results') == 'true'); - $course_visible_for_user = api_is_course_visible_for_user(NULL, $courseid); + $course_visible_for_user = api_is_course_visible_for_user(NULL, $courseCode); // can view course? if ($course_visible_for_user || $search_show_unlinked_results) { $result = NULL; @@ -53,7 +53,7 @@ class link_processor extends search_processor { if ($visibility) { // if one is visible let show the result for a course // also asume all data of this item like the data of the whole group of links(Ex. author) - list($thumbnail, $image, $name, $author, $url) = $this->get_information($courseid, $one_link['link_id']); + list($thumbnail, $image, $name, $author, $url) = $this->get_information($courseCode, $one_link['link_id']); $result_tmp = array( 'toolid' => TOOL_LINK, 'score' => $one_course_links['total_score'] / (count($one_course_links) - 1), // not count total_score array item diff --git a/main/inc/lib/search/tool_processors/quiz_processor.class.php b/main/inc/lib/search/tool_processors/quiz_processor.class.php index 8304c3fcd6..32019a0afc 100755 --- a/main/inc/lib/search/tool_processors/quiz_processor.class.php +++ b/main/inc/lib/search/tool_processors/quiz_processor.class.php @@ -106,8 +106,8 @@ class quiz_processor extends search_processor { /** * Get learning path information */ - private function get_information($course_id, $exercise_id) { - $course_information = api_get_course_info($course_id); + private function get_information($courseCode, $exercise_id) { + $course_information = api_get_course_info($courseCode); $course_id = $course_information['real_id']; if (!empty($course_information)) { @@ -118,9 +118,11 @@ class quiz_processor extends search_processor { $dk_result = Database::query($sql); //actually author isn't saved on exercise tool, but prepare for when it's ready + /* $sql = "SELECT insert_user_id FROM $item_property_table WHERE ref = $doc_id AND tool = '" . TOOL_DOCUMENT . "' AND c_id = $course_id LIMIT 1"; + */ $name = ''; if ($row = Database::fetch_array($dk_result)) { diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 2b48ef17b7..5e6c284cd1 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -2048,7 +2048,7 @@ class SessionManager foreach ($existingCourses as $existingCourse) { if (!in_array($existingCourse['c_id'], $courseList)) { - $courseInfo = api_get_course_info($existingCourse['c_id']); + $courseInfo = api_get_course_info_by_id($existingCourse['c_id']); $sql = "DELETE FROM $tbl_session_rel_course WHERE c_id = '" . $existingCourse['c_id'] . "' AND session_id = $sessionId"; @@ -2059,7 +2059,7 @@ class SessionManager Database::query($sql); CourseManager::remove_course_ranking( - $courseInfo['real_id'], + $existingCourse['c_id'], $sessionId ); @@ -2082,7 +2082,7 @@ class SessionManager if (!$exists) { //if the course isn't subscribed yet $sql = "INSERT INTO $tbl_session_rel_course (session_id, c_id) - VALUES ('$sessionId', '$courseId')"; + VALUES ($sessionId, $courseId)"; Database::query($sql); // We add the current course in the existing courses array, @@ -2095,22 +2095,22 @@ class SessionManager foreach ($user_list as $enreg_user) { $enreg_user_id = intval($enreg_user['user_id']); $sql = "INSERT IGNORE INTO $tbl_session_rel_course_rel_user (session_id, c_id, user_id) - VALUES ($sessionId, '$courseId', $enreg_user_id)"; + VALUES ($sessionId, $courseId, $enreg_user_id)"; $result = Database::query($sql); if (Database::affected_rows($result)) { $nbr_users++; } } $sql = "UPDATE $tbl_session_rel_course - SET nbr_users=$nbr_users - WHERE session_id ='$sessionId' AND c_id='$courseId'"; + SET nbr_users = $nbr_users + WHERE session_id = $sessionId AND c_id = $courseId"; Database::query($sql); } } $sql = "UPDATE $tbl_session SET nbr_courses = $nbr_courses - WHERE id = '$sessionId'"; + WHERE id = $sessionId"; Database::query($sql); } @@ -5617,7 +5617,7 @@ class SessionManager /** * Get the courses list by a course coach * @param int $coachId The coach id - * @return array + * @return array (id, user_id, session_id, c_id, visibility, status, legal_agreement) */ public static function getCoursesListByCourseCoach($coachId) { diff --git a/main/install/data.sql b/main/install/data.sql index a438bbf972..ba16737e96 100644 --- a/main/install/data.sql +++ b/main/install/data.sql @@ -695,6 +695,16 @@ INSERT INTO language (original_name, english_name, isocode, dokeos_folder, avail ('isiXhosa', 'xhosa', 'xh', 'xhosa', 0), ('Yorùbá','yoruba','yo','yoruba',0); +-- Set parent language to Spanish for all close-by languages, same for Italian, French, Portuguese and Chinese +UPDATE language SET parent_id = 49 WHERE english_name = 'quechua_cusco'; +UPDATE language SET parent_id = 49 WHERE english_name = 'galician'; +UPDATE language SET parent_id = 49 WHERE english_name = 'esperanto'; +UPDATE language SET parent_id = 49 WHERE english_name = 'catalan'; +UPDATE language SET parent_id = 49 WHERE english_name = 'asturian'; +UPDATE language SET parent_id = 28 WHERE english_name = 'friulian'; +UPDATE language SET parent_id = 18 WHERE english_name = 'occitan'; +UPDATE language SET parent_id = 40 WHERE english_name = 'brazilian'; +UPDATE language SET parent_id = 45 WHERE english_name = 'trad_chinese'; INSERT INTO course_category VALUES (1,'Language skills','LANG',NULL,1,0,'TRUE','TRUE'),(2,'PC Skills','PC',NULL,2,0,'TRUE','TRUE'),(3,'Projects','PROJ',NULL,3,0,'TRUE','TRUE'); @@ -1617,4 +1627,4 @@ INSERT INTO sequence_type_entity VALUES (2,'Quiz', 'Quiz and Tests','c_quiz'), (3,'LpItem', 'Items of a Learning Path','c_lp_item'); -UPDATE settings_current SET selected_value = '1.10.0.36' WHERE variable = 'chamilo_database_version'; +UPDATE settings_current SET selected_value = '1.10.0.37' WHERE variable = 'chamilo_database_version'; diff --git a/main/install/index.php b/main/install/index.php index e82dc8451c..2fbfad0803 100755 --- a/main/install/index.php +++ b/main/install/index.php @@ -204,8 +204,8 @@ if (!isset($_GET['running'])) { if (isset($email_parts[1]) && $email_parts[1] == 'localhost') { $emailForm .= '.localdomain'; } - $adminLastName = 'Doe'; - $adminFirstName = 'John'; + $adminLastName = get_lang('DefaultInstallAdminLastname'); + $adminFirstName = get_lang('DefaultInstallAdminFirstname'); $loginForm = 'admin'; $passForm = api_generate_password(); diff --git a/main/lang/english/trad4all.inc.php b/main/lang/english/trad4all.inc.php index 32b9c159bd..28984701a6 100644 --- a/main/lang/english/trad4all.inc.php +++ b/main/lang/english/trad4all.inc.php @@ -1056,7 +1056,7 @@ $AllStudents = "All learners"; $StudentsQualified = "Qualified learners"; $StudentsNotQualified = "Unqualified learners"; $NamesAndLastNames = "Names and last names"; -$MaxScore = "Score"; +$MaxScore = "Max score"; $QualificationCanNotBeGreaterThanMaxScore = "Grade cannot exceed max score"; $ThreadStatistics = "Thread statistics"; $Thread = "Thread"; @@ -7225,17 +7225,24 @@ $ShibbolethLogin = "Shibboleth Login"; $NewStatus = "New status"; $Reason = "Reason"; $RequestStatus = "Request new status"; -$StatusRequestMessage = "You have been logged-in with default rights. If you can request more rights by submitting the following request."; +$StatusRequestMessage = "You have been logged-in with default permissions. You can request more permissions by submitting the following request."; $ReasonIsMandatory = "You reason field is mandatory. Please fill it in before submitting."; $RequestSubmitted = "Your request has been submitted."; $RequestFailed = "We are not able to fulfill your request at this time. Please contact your administrator."; $InternalLogin = "Internal login"; $AlreadyLoggedIn = "You are already logged in"; -$Draggable = "Draggable"; +$Draggable = "Sequence ordering"; $Incorrect = "Incorrect"; -$YouNotYetAchievedCertificates = "You not yet achieved certificates"; +$YouNotYetAchievedCertificates = "You have not achieved any certificate just yet. Continue on your learning path to get one!"; $SearchCertificates = "Search certificates"; -$TheUserXNotYetAchievedCertificates = "The user %s not yet achieved certificates"; -$CertificatesNotPublic = "Certificates not public"; -$MatchingDraggable = "Matching Draggable"; +$TheUserXNotYetAchievedCertificates = "User %s hast not acquired any certificate yet"; +$CertificatesNotPublic = "Certificates are not publicly available"; +$MatchingDraggable = "Match by dragging"; +$ForumThreadPeerScoring = "Thread scored by peers"; +$ForumThreadPeerScoringComment = "If selected, this option will require each student to qualify at least 2 other students in order to get his score greater than 0 in the gradebook."; +$ForumThreadPeerScoringStudentComment = "To get the expected score in this forum, your contribution will have to be scored by another student, and you will have to score at least 2 other students' contributions. Until you reach this objective, even if scored, your contribution will show as a 0 score in the global grades for this course."; +$Readable = "Readable"; +$NotReadable = "Not readable"; +$DefaultInstallAdminFirstname = "John"; +$DefaultInstallAdminLastname = "Doe"; ?> \ No newline at end of file diff --git a/main/lang/french/trad4all.inc.php b/main/lang/french/trad4all.inc.php index 02f21b09af..6f43b9f573 100755 --- a/main/lang/french/trad4all.inc.php +++ b/main/lang/french/trad4all.inc.php @@ -1135,6 +1135,7 @@ $AdminPass = "Mot de passe de l'administrateur (en choisir u $EducationManager = "Responsable du contenu"; $CampusName = "Nom du campus"; $DBSettingIntro = "Le script d'installation créera les bases de données principales de Chamilo. Veuillez prendre en compte que Chamilo devra créer plusieurs bases de données. Si vous êtes restreint à une seule base de données par votre hébergeur, Chamilo ne fonctionnera pas, à moins que vous ne choisissiez l'option \"Une seule base de données\"."; +$TimeSpentByStudentsInCourses = "Temps passé par les étudiants dans les cours"; $Step3 = "Étape 3 sur 6"; $Step4 = "Étape 4 sur 6"; $Step5 = "Étape 5 sur 6"; @@ -1144,6 +1145,7 @@ $DBSetting = "Paramètres de MySQL"; $MainLang = "Langue principale"; $Licence = "Licence"; $LastCheck = "Dernière vérification avant installation"; +$AutoEvaluation = "Auto-évaluation"; $DbPrefixForm = "Préfixe pour le nom de base MySQL"; $DbPrefixCom = "Laissez vide si non requis"; $EncryptUserPass = "Crypter les mots de passes des utilisateur dans la base de données"; @@ -4035,6 +4037,14 @@ $Authoring = "Production"; $SessionIdentifier = "Identifiant de session"; $SessionCategory = "Catégorie de sessions"; $ConvertToUniqueAnswer = "Convertir à réponse unique"; +$ReportsRequiresNoSetting = "Ce type de rapport ne requiert aucun paramètre"; +$ShowWizard = "Montrer l'assistant"; +$ReportFormat = "Format de rapport"; +$ReportType = "Type de rapport"; +$PleaseChooseReportType = "Veuillez choisir un type de rapport"; +$PleaseFillFormToBuildReport = "Veuillez compléter le formulaire pour générer le rapport"; +$UnknownFormat = "Format non reconnu"; +$ErrorWhileBuildingReport = "Une erreur est survenue durant la génération du rapport"; $WikiSearchResults = "Résultats de recherche du wiki"; $StartPage = "Page d'accueil"; $EditThisPage = "Modifier cette page"; @@ -5245,6 +5255,7 @@ $ReadTheInstallGuide = "lisez le guide d'installation"; $HereAreTheValuesYouEntered = "Voici les valeurs que vous avez introduites"; $PrintThisPageToRememberPassAndOthers = "Imprimez cette page pour conserver votre mot de passe et autres paramètres"; $TheInstallScriptWillEraseAllTables = "Le script d'installation va supprimer toutes les tables des bases de données sélectionnées. Nous recommandons avec insistance pour que vous fassiez une copie de sauvegarde complète de celles-ci avant de confirmer cette dernière étape de l'installation."; +$Published = "Publié"; $ReadWarningBelow = "lire l'avertissement ci-dessous"; $SecurityAdvice = "Conseil de sécurité"; $YouHaveMoreThanXCourses = "Vous avez plus de %d cours sur votre campus Chamilo ! %d cours seulement ont été mis à jour. Pour mettre les autres à jour, %s cliquez ici %s"; @@ -7195,4 +7206,32 @@ $SaveBadge = "Enregistrer le badge"; $BadgeMeasuresXPixelsInPNG = "Propriétés recommandées du badge: 200x200 pixels au format PNG"; $SetTutor = "Faire coach"; $UniqueAnswerImage = "Sélection d'image"; +$TimeSpentByStudentsInCoursesGroupedByCode = "Temps passé par les étudiants dans les cours, regroupés par code"; +$TestResultsByStudentsGroupesByCode = "Résultats des tests par les groupes d'étudiants, par code"; +$TestResultsByStudents = "Résultats des tests par étudiant"; +$SystemCouldNotLogYouIn = "Le système n'a pas pu vous authentifier. Merci de contacter l'administrateur."; +$ShibbolethLogin = "Login par Shibboleth"; +$NewStatus = "Nouveau statut"; +$Reason = "Raison"; +$RequestStatus = "Demander un nouveau statut"; +$StatusRequestMessage = "Vous avez été authentifié avec les permissions par défaut. Si vous le souhaitez, vous pouvez demander plus de permissions en envoyant la requête suivante."; +$ReasonIsMandatory = "Le champ 'raison' est obligatoire. Merci de le remplir avant d'envoyer le formulaire."; +$RequestSubmitted = "Votre demande a été envoyée."; +$RequestFailed = "Impossible de traiter votre demande en ce moment. Merci de contacter votre administrateur."; +$InternalLogin = "Login interne"; +$AlreadyLoggedIn = "Vous êtes déjà authentifié"; +$Draggable = "Ordonnancement"; +$Incorrect = "Incorrect"; +$YouNotYetAchievedCertificates = "Vous n'avez pas encore obtenu de certificat"; +$SearchCertificates = "Chercher un certificat"; +$TheUserXNotYetAchievedCertificates = "L'utilisateur %s n'a pas encore obtenu de certificat"; +$CertificatesNotPublic = "Les certificats ne sont pas publics"; +$MatchingDraggable = "Correspondances glisser-déplacer"; +$ForumThreadPeerScoring = "Fil évalué par les pairs"; +$ForumThreadPeerScoringComment = "Lorsque cette option est sélectionnée, chaque étudiant devra évaluer la participation d'au moins 2 autres étudiants afin d'obtenir un score supérieur à 0 pour sa participation."; +$ForumThreadPeerScoringStudentComment = "Afin d'obtenir le résultat (note) de votre participation dans ce fil de discussion, votre participation devra être évaluée par un autre étudiant, et vous devrez avoir évalué un minimum de 2 autres étudiants. Votre participation restera à 0, même si vous avez été évalué, jusqu'à ce que vous ayez réalisé votre évaluation de 2 autres étudiants."; +$Readable = "Lisible"; +$NotReadable = "Non accessible en lecture"; +$DefaultInstallAdminFirstname = "Jean"; +$DefaultInstallAdminLastname = "Dupont"; ?> \ No newline at end of file diff --git a/main/lang/spanish/trad4all.inc.php b/main/lang/spanish/trad4all.inc.php index e9a3b767de..cc98e3d9bc 100644 --- a/main/lang/spanish/trad4all.inc.php +++ b/main/lang/spanish/trad4all.inc.php @@ -1142,6 +1142,7 @@ $AdminPass = "Contraseña del administrador (puede que desee $EducationManager = "Responsable educativo"; $CampusName = "Nombre de su plataforma"; $DBSettingIntro = "El script de instalación creará las principales bases de datos de Chamilo. Por favor, recuerde que Chamilo necesitará crear varias bases de datos. Si sólo puede tener una base de datos en su proveedor, Chamilo no funcionará."; +$TimeSpentByStudentsInCourses = "Tiempo dedicado por los estudiantes en los cursos"; $Step3 = "Paso 3 de 6"; $Step4 = "Paso 4 de 6"; $Step5 = "Paso 5 de 6"; @@ -1151,6 +1152,7 @@ $DBSetting = "Parámetros de las bases de datos MySQL"; $MainLang = "Idioma principal"; $Licence = "Licencia"; $LastCheck = "Última comprobación antes de instalar"; +$AutoEvaluation = "Auto-evaluación"; $DbPrefixForm = "Prefijo MySQL"; $DbPrefixCom = "No completar si no se requiere"; $EncryptUserPass = "Encriptar las contraseñas de los usuarios en la base de datos"; @@ -4044,6 +4046,14 @@ $Authoring = "Creación de contenidos"; $SessionIdentifier = "Identificador de la sesión"; $SessionCategory = "Categoría de la sesión"; $ConvertToUniqueAnswer = "Convertir a respuesta única"; +$ReportsRequiresNoSetting = "Este tipo de reporte no requiere parámetros"; +$ShowWizard = "Mostrar la guía"; +$ReportFormat = "Formato de reporte"; +$ReportType = "Tipo de reporte"; +$PleaseChooseReportType = "Elija un tipo de reporte"; +$PleaseFillFormToBuildReport = "Llene el formulario para generar el reporte"; +$UnknownFormat = "Formato desconocido"; +$ErrorWhileBuildingReport = "Se ha producido un error al momento de generar el reporte"; $WikiSearchResults = "Resultados de la búsqueda en el Wiki"; $StartPage = "Página de inicio del Wiki"; $EditThisPage = "Editar esta página"; @@ -5254,6 +5264,7 @@ $ReadTheInstallGuide = "leer la guía de instalación"; $HereAreTheValuesYouEntered = "Éstos son los valores que ha introducido"; $PrintThisPageToRememberPassAndOthers = "Imprima esta página para recordar su contraseña y otras configuraciones"; $TheInstallScriptWillEraseAllTables = "El programa de instalación borrará todas las tablas de las bases de datos seleccionadas. Le recomendamos encarecidamente que realice una copia de seguridad completa de todas ellas antes de confirmar este último paso de la instalación."; +$Published = "Publicado"; $ReadWarningBelow = "lea la advertencia inferior"; $SecurityAdvice = "Aviso de seguridad"; $YouHaveMoreThanXCourses = "¡ Tiene más de %d cursos en su plataforma Chamilo ! Sólamente se han actualizado los cursos de %d. Para actualizar los otros cursos, %s haga clic aquí %s"; @@ -7235,6 +7246,20 @@ $SaveBadge = "Guardar insignia"; $BadgeMeasuresXPixelsInPNG = "Medidas de la insignia 200x200 píxeles en formato PNG"; $SetTutor = "Hacer tutor"; $UniqueAnswerImage = "Respuesta de imagen única"; +$TimeSpentByStudentsInCoursesGroupedByCode = "Tiempo dedicado por los estudiantes en los cursos, agrupados por código"; +$TestResultsByStudentsGroupesByCode = "Resultados de ejercicios por grupos de estudiantes, por código"; +$TestResultsByStudents = "Resultados de ejercicios por estudiante"; +$SystemCouldNotLogYouIn = "El sistema no ha podido identificarlo/a. Por favor contacte con su administrador."; +$ShibbolethLogin = "Login Shibboleth"; +$NewStatus = "Nuevo estatus"; +$Reason = "Razón"; +$RequestStatus = "Pedir nuevo estatus"; +$StatusRequestMessage = "Ha sido autentificado con los permisos por defecto. Si desea más permisos, puede pedirlos a través del siguiente formulario."; +$ReasonIsMandatory = "El campo 'razón' es obligatorio. Complételo antes de enviar su pedida."; +$RequestSubmitted = "Su pedida ha sido enviada."; +$RequestFailed = "No podemos completar esta pedida en este momento. Por favor contacte su administrador."; +$InternalLogin = "Login interno"; +$AlreadyLoggedIn = "Ya está conectado/a"; $Draggable = "Arrastrable"; $Incorrect = "Incorrecto"; $YouNotYetAchievedCertificates = "Aún no ha logrado certificados"; @@ -7242,4 +7267,11 @@ $SearchCertificates = "Buscar certificados"; $TheUserXNotYetAchievedCertificates = "El usuario %s aún no ha logrado certificados"; $CertificatesNotPublic = "Los certificados no son públicos"; $MatchingDraggable = "Coincidencia arrastrable"; +$ForumThreadPeerScoring = "Tema evaluado por pares"; +$ForumThreadPeerScoringComment = "Si esta opción está seleccionada, requerirá que cada estudiante califique a 2 otros estudiantes para obtener un score superior a 0 en su propia evaluación."; +$ForumThreadPeerScoringStudentComment = "Para obtener su resultado en este tema de discusión, su participación tendrá que ser evaluada por lo mínimo por un otro estudiante, y usted tendrá que evaluar por lo mínimo la participación 2 otros estudiantes. Hasta que lo haya hecho, su resultado se mantendrá a 0 aquí y, de ser el caso, en los resultados de este tema de foro en la hoja de evaluación global del curso."; +$Readable = "Accesible en lectura"; +$NotReadable = "No accesible en lectura"; +$DefaultInstallAdminFirstname = "Juan"; +$DefaultInstallAdminLastname = "Perez"; ?> \ No newline at end of file diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index d4d31e053a..ad1378d804 100755 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -8650,7 +8650,7 @@ class learnpath $selfUrl = api_get_self(); $courseIdReq = api_get_cidreq(); $course = api_get_course_info(); - $course_id = api_get_course_int_id(); + $course_id = $course['real_id']; $tbl_link = Database::get_course_table(TABLE_LINK); $linkCategoryTable = Database::get_course_table(TABLE_LINK_CATEGORY); $moveEverywhereIcon = Display::return_icon('move_everywhere.png', get_lang('Move'), array(), ICON_SIZE_TINY); @@ -8836,7 +8836,7 @@ class learnpath public function scorm_export() { $_course = api_get_course_info(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; // Remove memory and time limits as much as possible as this might be a long process... if (function_exists('ini_set')) { diff --git a/main/survey/survey.lib.php b/main/survey/survey.lib.php index f2d72e4ede..9418bc95e2 100755 --- a/main/survey/survey.lib.php +++ b/main/survey/survey.lib.php @@ -4380,7 +4380,7 @@ class SurveyUtil public static function getSurveyList($user_id) { $_course = api_get_course_info(); - $course_id = api_get_course_int_id(); + $course_id = $_course['real_id']; $user_id = intval($user_id); $sessionId = api_get_session_id(); diff --git a/main/tracking/courseLog.php b/main/tracking/courseLog.php index 1df74df498..53d2e94774 100755 --- a/main/tracking/courseLog.php +++ b/main/tracking/courseLog.php @@ -12,7 +12,7 @@ require_once '../inc/global.inc.php'; $current_course_tool = TOOL_TRACKING; $courseInfo = api_get_course_info(api_get_course_id()); -$courseCode = api_get_course_id(); +$courseCode = $courseInfo['code']; $from_myspace = false; $from = isset($_GET['from']) ? $_GET['from'] : null; diff --git a/main/tracking/course_log_resources.php b/main/tracking/course_log_resources.php index 43385a16a8..147dce4e12 100755 --- a/main/tracking/course_log_resources.php +++ b/main/tracking/course_log_resources.php @@ -11,7 +11,7 @@ $pathopen = isset($_REQUEST['pathopen']) ? $_REQUEST['pathopen'] : null; // Including the global initialization file require_once '../inc/global.inc.php'; $current_course_tool = TOOL_TRACKING; -$course_info = api_get_course_info(api_get_course_id()); +$course_info = api_get_course_info(); $from_myspace = false; $from = isset($_GET['from']) ? $_GET['from'] : null; diff --git a/main/tracking/course_log_tools.php b/main/tracking/course_log_tools.php index 9715db4e90..bd0c176e4b 100755 --- a/main/tracking/course_log_tools.php +++ b/main/tracking/course_log_tools.php @@ -12,7 +12,7 @@ $pathopen = isset($_REQUEST['pathopen']) ? $_REQUEST['pathopen'] : null; require_once '../inc/global.inc.php'; $current_course_tool = TOOL_TRACKING; -$course_info = api_get_course_info(api_get_course_id()); +$course_info = api_get_course_info(); $from_myspace = false; $from = isset($_GET['from']) ? $_GET['from'] : null; diff --git a/main/user/user.php b/main/user/user.php index df281068f5..b04e579918 100755 --- a/main/user/user.php +++ b/main/user/user.php @@ -38,8 +38,8 @@ $is_western_name_order = api_is_western_name_order(); $sort_by_first_name = api_sort_by_first_name(); $course_info = api_get_course_info(); $user_id = api_get_user_id(); -$courseCode = api_get_course_id(); -$courseId = api_get_course_int_id(); +$courseCode = $course_info['code']; +$courseId = $course_info['real_id']; //Can't auto unregister from a session if (!empty($sessionId)) { @@ -617,7 +617,7 @@ function get_user_data($from, $number_of_items, $column, $direction) $course_info = api_get_course_info(); $sessionId = api_get_session_id(); - $course_code = api_get_course_id(); + $course_code = $course_info['code']; $a_users = array(); diff --git a/main/work/upload.php b/main/work/upload.php index c288e8dad1..edfa4cd6d5 100755 --- a/main/work/upload.php +++ b/main/work/upload.php @@ -20,8 +20,8 @@ $course_id = api_get_course_int_id(); $user_id = api_get_user_id(); $userInfo = api_get_user_info(); $session_id = api_get_session_id(); -$course_code = api_get_course_id(); $course_info = api_get_course_info(); +$course_code = $course_info['code']; $group_id = api_get_group_id(); if (empty($work_id)) { diff --git a/main/work/upload_from_template.php b/main/work/upload_from_template.php index f8c082ef5a..72bb694632 100755 --- a/main/work/upload_from_template.php +++ b/main/work/upload_from_template.php @@ -21,8 +21,8 @@ $course_id = api_get_course_int_id(); $user_id = api_get_user_id(); $userInfo = api_get_user_info(); $session_id = api_get_session_id(); -$course_code = api_get_course_id(); $course_info = api_get_course_info(); +$course_code = $course_info['code']; $group_id = api_get_group_id(); if (empty($work_id)) { diff --git a/main/work/work.lib.php b/main/work/work.lib.php index 5c3fcfb8ae..2639697028 100755 --- a/main/work/work.lib.php +++ b/main/work/work.lib.php @@ -552,8 +552,8 @@ function display_student_publications_list( $session_id = api_get_session_id(); $condition_session = api_get_session_condition($session_id); - $course_id = api_get_course_int_id(); - $course_info = api_get_course_info(api_get_course_id()); + $course_info = api_get_course_info(); + $course_id = $course_info['real_id']; $sort_params = array(); @@ -1557,9 +1557,9 @@ function get_count_work($work_id, $onlyMeUserId = null, $notMeUserId = null) $session_id = api_get_session_id(); $condition_session = api_get_session_condition($session_id, true, false, 'work.session_id'); - $course_id = api_get_course_int_id(); $group_id = api_get_group_id(); - $course_info = api_get_course_info(api_get_course_id()); + $course_info = api_get_course_info(); + $course_id = $course_info['real_id']; $work_id = intval($work_id); if (!empty($group_id)) { @@ -1635,7 +1635,7 @@ function getWorkListStudent( $workTable = Database::get_course_table(TABLE_STUDENT_PUBLICATION); $workTableAssignment = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); $courseInfo = api_get_course_info(); - $course_id = api_get_course_int_id(); + $course_id = $courseInfo['real_id']; $session_id = api_get_session_id(); $condition_session = api_get_session_condition($session_id); $group_id = api_get_group_id(); @@ -2123,9 +2123,9 @@ function get_work_user_list( $user_table = Database::get_main_table(TABLE_MAIN_USER); $session_id = api_get_session_id(); - $course_id = api_get_course_int_id(); $group_id = api_get_group_id(); - $course_info = api_get_course_info(api_get_course_id()); + $course_info = api_get_course_info(); + $course_id = $course_info['real_id']; $work_id = intval($work_id); $column = !empty($column) ? Database::escape_string($column) : 'sent_date'; diff --git a/main/work/work.php b/main/work/work.php index f26bb4973d..e21e4db815 100755 --- a/main/work/work.php +++ b/main/work/work.php @@ -14,8 +14,8 @@ api_protect_course_script(true); require_once 'work.lib.php'; -$course_id = api_get_course_int_id(); $course_info = api_get_course_info(); +$course_id = $course_info['real_id']; $user_id = api_get_user_id(); $id_session = api_get_session_id(); @@ -33,7 +33,7 @@ $_course = api_get_course_info(); /* Constants and variables */ $tool_name = get_lang('StudentPublications'); -$course_code = api_get_course_id(); +$course_code = $_course['code']; $session_id = api_get_session_id(); $group_id = api_get_group_id(); diff --git a/src/Chamilo/CoreBundle/Migrations/Schema/V110/Version20150504182600.php b/src/Chamilo/CoreBundle/Migrations/Schema/V110/Version20150504182600.php new file mode 100644 index 0000000000..2061861dd7 --- /dev/null +++ b/src/Chamilo/CoreBundle/Migrations/Schema/V110/Version20150504182600.php @@ -0,0 +1,64 @@ +addSql(" + UPDATE language SET parent_id = 49 WHERE english_name = 'quechua_cusco' + "); + $this->addSql(" + UPDATE language SET parent_id = 49 WHERE english_name = 'galician' + "); + $this->addSql(" + UPDATE language SET parent_id = 49 WHERE english_name = 'esperanto' + "); + $this->addSql(" + UPDATE language SET parent_id = 49 WHERE english_name = 'catalan' + "); + $this->addSql(" + UPDATE language SET parent_id = 49 WHERE english_name = 'asturian' + "); + $this->addSql(" + UPDATE language SET parent_id = 28 WHERE english_name = 'friulian' + "); + $this->addSql(" + UPDATE language SET parent_id = 18 WHERE english_name = 'occitan' + "); + $this->addSql(" + UPDATE language SET parent_id = 40 WHERE english_name = 'brazilian' + "); + $this->addSql(" + UPDATE language SET parent_id = 45 WHERE english_name = 'trad_chinese' + "); + $this->addSql(" + UPDATE settings_current SET selected_value = '1.10.0.37' WHERE variable = 'chamilo_database_version' + "); + } + + /** + * We don't allow downgrades yet + * @param Schema $schema + */ + public function down(Schema $schema) + { + } +} diff --git a/user_portal.php b/user_portal.php index 7c3df816a6..d016f996da 100755 --- a/user_portal.php +++ b/user_portal.php @@ -54,7 +54,7 @@ if (api_get_setting('go_to_course_after_login') == 'true') { // Session only has 1 course. if (isset($sessionInfo['courses']) && count($sessionInfo['courses']) == 1) { $courseCode = $sessionInfo['courses'][0]['code']; - $courseInfo = api_get_course_info($courseCode); + $courseInfo = api_get_course_info_by_id($sessionInfo['courses'][0]['real_id']); $courseUrl = $courseInfo['course_public_url'].'?id_session='.$sessionInfo['session_id']; header('Location:'.$courseUrl); exit; @@ -77,7 +77,7 @@ if (api_get_setting('go_to_course_after_login') == 'true') { $courses = CourseManager::get_courses_list_by_user_id($userId); if (!empty($courses) && isset($courses[0]) && isset($courses[0]['code'])) { - $courseInfo = api_get_course_info($courses[0]['code']); + $courseInfo = api_get_course_info_by_id($courses[0]['real_id']); if (!empty($courseInfo)) { $courseUrl = $courseInfo['course_public_url']; header('Location:'.$courseUrl); diff --git a/whoisonlinesession.php b/whoisonlinesession.php index 2b80a5debc..5599e146aa 100755 --- a/whoisonlinesession.php +++ b/whoisonlinesession.php @@ -111,7 +111,7 @@ Display::display_header(get_lang('UserOnlineListSession')); echo " "; - $courseInfo = api_get_course_info($student_online['c_id']); + $courseInfo = api_get_course_info_by_id($student_online['c_id']); echo $courseInfo['title']; echo "