Minor - format code.

1.9.x
Julio Montoya 11 years ago
parent 28baec78d2
commit 6b21e859a5
  1. 4
      main/admin/user_edit.php
  2. 320
      main/admin/user_move_stats.php
  3. 7
      main/inc/lib/course.lib.php

@ -260,7 +260,6 @@ $creatorInfo = api_get_user_info($user_data['creator_id']);
$date = sprintf(get_lang('CreatedByXYOnZ'), 'user_information.php?user_id='.$user_data['creator_id'], $creatorInfo['username'], $user_data['registration_date']);
$form->addElement('html', '<div class="control-group"><label class="control-label">'.get_lang('RegistrationDate').'</label><div class="controls">'.$date.'</div></div>');
if (!$user_data['platform_admin']) {
// Expiration Date
$form->addElement('radio', 'radio_expiration_date', get_lang('ExpirationDate'), get_lang('NeverExpires'), 0);
@ -274,7 +273,6 @@ if (!$user_data['platform_admin']) {
$form->addElement('radio', 'active', '', get_lang('Inactive'), 0);
}
// EXTRA FIELDS
$return_params = UserManager::set_extra_fields_in_form($form, $extra_data, 'user_edit', true, $user_id);
$jquery_ready_content = $return_params['jquery_ready_content'];
@ -432,7 +430,7 @@ if ($form->validate()) {
} else {
UserManager::update_extra_field_value($user_id, substr($key, 6), $value);
}
} elseif (strpos($key,'remove_extra') !== false) {
} elseif (strpos($key, 'remove_extra') !== false) {
$extra_value = Security::filter_filename(urldecode(key($value)));
// To remove from user_field_value and folder
UserManager::update_extra_field_value($user_id, substr($key,13), $extra_value);

@ -1,12 +1,10 @@
<?php
/* For licensing terms, see /license.txt */
/**
* User move scripti (to move between courses and sessions)
* User move script (to move between courses and sessions)
* @package chamilo.admin
*/
/**
* Code
*/
$language_file = 'admin';
$cidReset = true;
@ -20,14 +18,14 @@ $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAd
$debug = 0;
function compare_data($result_message) {
foreach ($result_message as $table=>$data) {
foreach ($result_message as $table=>$data) {
$title = $table;
if ($table == 'TRACK_E_EXERCISES') {
$title = get_lang('Exercises');
} elseif ($table == 'TRACK_E_EXERCISES_IN_LP') {
$title = get_lang('ExercisesInLp');
} elseif ($table == 'LP_VIEW') {
} elseif ($table == 'LP_VIEW') {
$title = get_lang('LearningPaths');
}
echo '<br / ><h3>'.get_lang($title).' </h3><hr />';
@ -70,22 +68,22 @@ function compare_data($result_message) {
if (isset($_REQUEST['load_ajax'])) {
//Checking the variable $_SESSION['combination'] that has all the information of the selected course (instead of using a lots of hidden variables ... )
if (isset($_SESSION['combination']) && !empty($_SESSION['combination'])) {
$combinations = $_SESSION['combination'];
$combinations = $_SESSION['combination'];
$combination_result = $combinations[$_REQUEST['unique_id']];
if (empty($combination_result)) {
echo get_lang('ThereWasAnError');
echo get_lang('ThereWasAnError');
} else {
$origin_course_code = $combination_result['course_code'];
$origin_session_id = intval($combination_result['session_id']);
$new_session_id = intval($_REQUEST['session_id']);
//if (!isset($_REQUEST['view_stat'])) {
if ($origin_session_id == $new_session_id ) {
echo get_lang('CantMoveToTheSameSession');
exit;
}
if ($origin_session_id == $new_session_id ) {
echo get_lang('CantMoveToTheSameSession');
exit;
}
//}
$user_id = intval($_REQUEST['user_id']);
$user_id = intval($_REQUEST['user_id']);
$new_course_list = SessionManager::get_course_list_by_session_id($new_session_id);
@ -96,7 +94,6 @@ if (isset($_REQUEST['load_ajax'])) {
}
}
$result_message = array();
$result_message_compare = array();
@ -117,8 +114,8 @@ if (isset($_REQUEST['load_ajax'])) {
}
//Begin with the import process
$course_info = api_get_course_info($origin_course_code);
$course_id = $course_info['real_id'];
$course_info = api_get_course_info($origin_course_code);
$course_id = $course_info['real_id'];
$TABLETRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
@ -135,13 +132,11 @@ if (isset($_REQUEST['load_ajax'])) {
$TBL_DROPBOX_POST = Database::get_course_table(TABLE_DROPBOX_POST);
$TBL_AGENDA = Database::get_course_table(TABLE_AGENDA);
$course_code = Database::escape_string($course_code);
//1. track_e_exercises
//ORIGINAL COURSE
$sql = "SELECT * FROM $TABLETRACK_EXERCICES WHERE exe_cours_id = '$origin_course_code' AND session_id = $origin_session_id AND exe_user_id = $user_id ";
$sql = "SELECT * FROM $TABLETRACK_EXERCICES
WHERE exe_cours_id = '$origin_course_code' AND session_id = $origin_session_id AND exe_user_id = $user_id ";
$res = Database::query($sql);
$list = array();
while($row = Database::fetch_array($res,'ASSOC')) {
@ -149,19 +144,19 @@ if (isset($_REQUEST['load_ajax'])) {
}
if (!empty($list))
foreach ($list as $exe_id =>$data) {
if ($update_database) {
$sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
$res = Database::query($sql);
$result_message[$TABLETRACK_EXERCICES]++;
} else {
if(!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) {
$result_message['TRACK_E_EXERCISES'][$exe_id] = $data;
foreach ($list as $exe_id =>$data) {
if ($update_database) {
$sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
$res = Database::query($sql);
$result_message[$TABLETRACK_EXERCICES]++;
} else {
$result_message['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data;
if(!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) {
$result_message['TRACK_E_EXERCISES'][$exe_id] = $data;
} else {
$result_message['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data;
}
}
}
}
//DESTINY COURSE
@ -175,19 +170,19 @@ if (isset($_REQUEST['load_ajax'])) {
}
if (!empty($list))
foreach ($list as $exe_id =>$data) {
if ($update_database) {
$sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
$res = Database::query($sql);
$result_message[$TABLETRACK_EXERCICES]++;
} else {
if(!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) {
$result_message_compare['TRACK_E_EXERCISES'][$exe_id] = $data;
foreach ($list as $exe_id =>$data) {
if ($update_database) {
$sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
$res = Database::query($sql);
$result_message[$TABLETRACK_EXERCICES]++;
} else {
$result_message_compare['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data;
if(!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) {
$result_message_compare['TRACK_E_EXERCISES'][$exe_id] = $data;
} else {
$result_message_compare['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data;
}
}
}
}
}
//2.track_e_attempt, track_e_attempt_recording, track_e_downloads
@ -203,17 +198,17 @@ if (isset($_REQUEST['load_ajax'])) {
}
if (!empty($list))
foreach ($list as $id => $data) {
if ($update_database) {
$sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = '$new_session_id' WHERE course_access_id = $id";
if ($debug) echo $sql;
$res = Database::query($sql);
if ($debug) var_dump($res);
$result_message[$TBL_TRACK_E_COURSE_ACCESS]++;
} else {
//$result_message[$TBL_TRACK_E_COURSE_ACCESS][$id] = $data;
foreach ($list as $id => $data) {
if ($update_database) {
$sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = '$new_session_id' WHERE course_access_id = $id";
if ($debug) echo $sql;
$res = Database::query($sql);
if ($debug) var_dump($res);
$result_message[$TBL_TRACK_E_COURSE_ACCESS]++;
} else {
//$result_message[$TBL_TRACK_E_COURSE_ACCESS][$id] = $data;
}
}
}
//4. track_e_lastaccess
@ -224,18 +219,18 @@ if (isset($_REQUEST['load_ajax'])) {
$list[] = $row['access_id'];
}
if (!empty($list))
foreach ($list as $id) {
if ($update_database) {
$sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = '$new_session_id' WHERE access_id = $id";
if ($debug) echo $sql;
$res = Database::query($sql);
if ($debug) var_dump($res);
$result_message[$TBL_TRACK_E_LAST_ACCESS]++;
foreach ($list as $id) {
if ($update_database) {
$sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = '$new_session_id' WHERE access_id = $id";
if ($debug) echo $sql;
$res = Database::query($sql);
if ($debug) var_dump($res);
$result_message[$TBL_TRACK_E_LAST_ACCESS]++;
}
}
}
//5. lp_item_view
//CHECK ORIGIN
//CHECK ORIGIN
$sql = "SELECT * FROM $TBL_LP_VIEW WHERE user_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id ";
$res = Database::query($sql);
@ -253,44 +248,44 @@ if (isset($_REQUEST['load_ajax'])) {
}
if (!empty($list))
foreach ($list as $id=>$data) {
if ($update_database) {
$sql = "UPDATE $TBL_LP_VIEW SET session_id = '$new_session_id' WHERE c_id = $course_id AND id = $id ";
if ($debug) var_dump($sql);
$res = Database::query($sql);
if ($debug) var_dump($res);
$result_message[$TBL_LP_VIEW]++;
} else {
//Getting all information of that lp_item_id
$score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id);
$progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id);
$result_message['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
foreach ($list as $id=>$data) {
if ($update_database) {
$sql = "UPDATE $TBL_LP_VIEW SET session_id = '$new_session_id' WHERE c_id = $course_id AND id = $id ";
if ($debug) var_dump($sql);
$res = Database::query($sql);
if ($debug) var_dump($res);
$result_message[$TBL_LP_VIEW]++;
} else {
//Getting all information of that lp_item_id
$score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id);
$progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id);
$result_message['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
}
}
}
//CHECk DESTINY
if (!$update_database) {
$sql = "SELECT * FROM $TBL_LP_VIEW WHERE user_id = $user_id AND session_id = $new_session_id AND c_id = $course_id";
$res = Database::query($sql);
$sql = "SELECT * FROM $TBL_LP_VIEW WHERE user_id = $user_id AND session_id = $new_session_id AND c_id = $course_id";
$res = Database::query($sql);
//Getting the list of LPs in the new session
$lp_list = new LearnpathList($user_id, $origin_course_code, $new_session_id);
$flat_list = $lp_list->get_flat_list();
//Getting the list of LPs in the new session
$lp_list = new LearnpathList($user_id, $origin_course_code, $new_session_id);
$flat_list = $lp_list->get_flat_list();
$list = array();
while($row = Database::fetch_array($res,'ASSOC')) {
//Checking if the LP exist in the new session
if (in_array($row['lp_id'], array_keys($flat_list))) {
$list[$row['id']] = $row;
}
$list = array();
while($row = Database::fetch_array($res,'ASSOC')) {
//Checking if the LP exist in the new session
if (in_array($row['lp_id'], array_keys($flat_list))) {
$list[$row['id']] = $row;
}
if (!empty($list))
}
if (!empty($list))
foreach ($list as $id=>$data) {
//Getting all information of that lp_item_id
$score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
$progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
$result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
//Getting all information of that lp_item_id
$score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
$progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
$result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
}
}
@ -301,8 +296,8 @@ if (isset($_REQUEST['load_ajax'])) {
$sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'calendar_event' AND insert_user_id = $user_id AND c_id = $course_id ";
$res = Database::query($sql);
while($row = Database::fetch_array($res,'ASSOC')) {
$id = $row['ref'];
if ($update_database) {
$id = $row['ref'];
if ($update_database) {
$sql = "UPDATE $TBL_AGENDA SET session_id = '$new_session_id' WHERE c_id = $course_id AND id = $id ";
if ($debug) var_dump($sql);
$res_update = Database::query($sql);
@ -360,13 +355,13 @@ if (isset($_REQUEST['load_ajax'])) {
if ($update_database) {
$dir_name = substr($parent_data['url'], 1);
$created_dir = create_unexisting_work_directory($base_work_dir, $dir_name);
$created_dir = '/'.$created_dir;
$now = api_get_utc_datetime();
//Creating directory
$sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION . " SET " .
"url = '".$created_dir."',
$dir_name = substr($parent_data['url'], 1);
$created_dir = create_unexisting_work_directory($base_work_dir, $dir_name);
$created_dir = '/'.$created_dir;
$now = api_get_utc_datetime();
//Creating directory
$sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION . " SET " .
"url = '".$created_dir."',
c_id = '".$course_id."',
title = '".$parent_data['title']."',
description = '".$parent_data['description']." folder_moved_from_session_id_$origin_session_id ',
@ -380,15 +375,15 @@ if (isset($_REQUEST['load_ajax'])) {
qualificator_id = '',
date_of_qualification = '0000-00-00 00:00:00',
session_id = ".$new_session_id;
$rest_insert = Database::query($sql_add_publication);
if ($debug) echo ($sql_add_publication);
// add the directory
$id = Database::insert_id();
//Folder created
api_item_property_update($course_info, 'work', $id, 'DirectoryCreated', api_get_user_id());
if ($debug) var_dump($rest_insert);
$new_parent_id = $id;
$result_message[$TBL_STUDENT_PUBLICATION.' - new folder created called: '.$created_dir]++;
$rest_insert = Database::query($sql_add_publication);
if ($debug) echo ($sql_add_publication);
// add the directory
$id = Database::insert_id();
//Folder created
api_item_property_update($course_info, 'work', $id, 'DirectoryCreated', api_get_user_id());
if ($debug) var_dump($rest_insert);
$new_parent_id = $id;
$result_message[$TBL_STUDENT_PUBLICATION.' - new folder created called: '.$created_dir]++;
}
}
@ -411,10 +406,10 @@ if (isset($_REQUEST['load_ajax'])) {
$id = Database::insert_id();
$sql_update = "UPDATE " . $TBL_STUDENT_PUBLICATION . " SET " .
"has_properties = '".$id."',
"has_properties = '".$id."',
view_properties = '1'
WHERE id = ".$new_parent_id;
if ($debug) echo $sql_update;
if ($debug) echo $sql_update;
$rest_update = Database::query($sql_update);
@ -429,7 +424,7 @@ if (isset($_REQUEST['load_ajax'])) {
if ($update_database) {
//Creating a new work
$sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION . " SET " .
"url = '" . $new_url . "',
"url = '" . $new_url . "',
c_id = '".$course_id."',
title = '" . $data['title']. "',
description = '" . $data['description'] . " file moved',
@ -480,7 +475,7 @@ if (isset($_REQUEST['load_ajax'])) {
if ($update_database) {
$sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = '$new_session_id' WHERE c_id = $course_id AND id = $id";
if ($debug) var_dump($sql);
$res = Database::query($sql);
$res = Database::query($sql);
if ($debug) var_dump($res);
$sql = "UPDATE $TBL_DROPBOX_POST SET session_id = '$new_session_id' WHERE file_id = $id";
@ -506,47 +501,47 @@ if (isset($_REQUEST['load_ajax'])) {
if ($debug) var_dump($sql);
$res = Database::query($sql);
if ($debug) var_dump($res);
}
}
}
if ($update_database) {
echo '<h2>'.get_lang('StatsMoved').'</h2>';
if (is_array($result_message))
if (is_array($result_message))
foreach ($result_message as $table=>$times) {
echo 'Table '.$table.' - '.$times.' records updated <br />';
}
} else {
echo '<h2>'.get_lang('UserInformationOfThisCourse').'</h2>';
echo '<h2>'.get_lang('UserInformationOfThisCourse').'</h2>';
echo '<br />';
echo '<table width="100%">';
echo '<tr>';
echo '<td width="50%" valign="top">';
echo '<br />';
echo '<table width="100%">';
echo '<tr>';
echo '<td width="50%" valign="top">';
if ($origin_session_id == 0 ) {
echo '<h4>'.get_lang('OriginCourse').'</h4>';
} else {
echo '<h4>'.get_lang('OriginSession').' #'.$origin_session_id.'</h4>';
}
compare_data($result_message);
echo '</td>';
echo '<td width="50%" valign="top">';
if ($new_session_id == 0 ) {
echo '<h4>'.get_lang('DestinyCourse').'</h4>';
} else {
echo '<h4>'.get_lang('DestinySession').' #'.$new_session_id.'</h4>';
}
compare_data($result_message_compare);
echo '</td>';
echo '</tr>';
echo '</table>';
if ($origin_session_id == 0 ) {
echo '<h4>'.get_lang('OriginCourse').'</h4>';
} else {
echo '<h4>'.get_lang('OriginSession').' #'.$origin_session_id.'</h4>';
}
compare_data($result_message);
echo '</td>';
echo '<td width="50%" valign="top">';
if ($new_session_id == 0 ) {
echo '<h4>'.get_lang('DestinyCourse').'</h4>';
} else {
echo '<h4>'.get_lang('DestinySession').' #'.$new_session_id.'</h4>';
}
compare_data($result_message_compare);
echo '</td>';
echo '</tr>';
echo '</table>';
}
} else {
echo get_lang('CourseDoesNotExistInThisSession');
}
}
} else {
echo get_lang('ThereWasAnError');
echo get_lang('ThereWasAnError');
}
exit;
}
@ -589,7 +584,7 @@ $htmlHeadXtra[] = '<script type="text/javascript">
function get_courses_list_by_user_id_based_in_exercises($user_id) {
$TABLETRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$user_id = intval($user_id);
//$sql = "SELECT DISTINCT exe_user_id, exe_cours_id as code, session_id as id_session FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id GROUP BY exe_user_id, exe_cours_id ORDER by exe_user_id, exe_cours_id ASC";
//$sql = "SELECT DISTINCT exe_user_id, exe_cours_id as code, session_id as id_session FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id GROUP BY exe_user_id, exe_cours_id ORDER by exe_user_id, exe_cours_id ASC";
$sql = "SELECT DISTINCT exe_user_id, exe_cours_id as code, session_id as id_session FROM $TABLETRACK_EXERCICES WHERE exe_user_id = $user_id ORDER by exe_user_id, exe_cours_id ASC";
$res = Database::query($sql);
@ -624,7 +619,7 @@ $navigation = "$begin - $end / $count<br />";
if ($page > 1) {
$navigation .='<a href="'.api_get_self().'?page='.($page - 1).'">'.get_lang('Previous').'</a>';
} else {
$navigation .= get_lang('Previous');
$navigation .= get_lang('Previous');
}
$navigation .= '&nbsp;';
$page ++;
@ -639,7 +634,7 @@ $session_list = SessionManager::get_sessions_list(array(),array('name'));
$options = '';
$options .= '<option value="0">--'.get_lang('SelectASession').'--</option>';
foreach ($session_list as $session_data) {
$my_session_list[$session_data['id']] =$session_data['name'];
$my_session_list[$session_data['id']] =$session_data['name'];
$options .= '<option value="'.$session_data['id'].'">'.$session_data['name'].'</option>';
}
@ -647,18 +642,20 @@ $combinations = array();
if (!empty($user_list)) {
foreach ($user_list as $user) {
$user_id = $user['user_id'];
//if ($user_id != 78 ) continue;
$name = $user['firstname'].' '.$user['lastname'];
$course_list_registered = CourseManager::get_courses_list_by_user_id($user_id, true, false);
$course_list_registered = CourseManager::get_courses_list_by_user_id(
$user_id,
true,
false
);
$new_course_list = array();
foreach ($course_list_registered as $course_reg) {
if (empty($course_reg['id_session'])) {
$course_reg['id_session'] = 0;
$course_reg['id_session'] = 0;
}
$new_course_list[] = $course_reg['code'].'_'.$course_reg['id_session'];
$new_course_list[] = $course_reg['code'].'_'.$course_reg['id_session'];
}
$course_list = get_courses_list_by_user_id_based_in_exercises($user_id);
@ -666,35 +663,40 @@ if (!empty($user_list)) {
if (is_array($course_list) && !empty($course_list)) {
foreach ($course_list as $my_course) {
$key = $my_course['code'].'_'.$my_course['id_session'];
if(!in_array($key,$new_course_list)) {
if (!in_array($key, $new_course_list)) {
$my_course['not_registered'] = 1;
$course_list_registered[] = $my_course;
}
$course_list_registered[] = $my_course;
}
}
}
foreach ($course_list_registered as & $course) {
$courseInfo = api_get_course_info($course['code']);
$course['name'] = $courseInfo['name'];
}
$course_list = $course_list_registered;
echo '<div>';
echo '<table class="data_table">';
echo '<tr>';
echo '<th style="text-align:left;" colspan="'.count($course_list).'">';
echo "<h3>$name #$user_id </h3> ";
echo '</th>';
echo '</tr>';
echo '<tr>';
echo '<th style="text-align:left;" colspan="'.count($course_list).'">';
echo "<h3>$name #$user_id </h3> ";
echo '</th>';
echo '</tr>';
if (!empty($course_list)) {
echo '<tr>';
foreach ($course_list as $course) {
echo '<td>';
if (isset($course['id_session']) && !empty($course['id_session'])) {
echo '<b>'.get_lang('SessionName').'</b> '.$my_session_list[$course['id_session']].'<br />';
echo '<b>'.get_lang('SessionName').'</b> '.$my_session_list[$course['id_session']].'<br />';
}
echo $course['title'];
echo $course['name'];
echo ' ('.$course['code'].') ';
if (isset($course['not_registered']) && !empty($course['not_registered'])) {
echo ' <i>'.get_lang('UserNotRegistered').'</i>';
echo ' <i>'.get_lang('UserNotRegistered').'</i>';
}
echo '</td>';
}
@ -704,9 +706,9 @@ if (!empty($user_list)) {
foreach ($course_list as $course) {
$course_code = $course['code'];
if (empty($course['id_session'])) {
$session_id = 0;
$session_id = 0;
} else {
$session_id = $course['id_session'];
$session_id = $course['id_session'];
}
echo '<td>';
echo get_lang('MoveTo'); echo '<br />';
@ -725,7 +727,7 @@ if (!empty($user_list)) {
echo '</tr>';
} else {
echo '<td>';
echo get_lang('NoCoursesForThisUser');
echo get_lang('NoCoursesForThisUser');
echo '</td>';
}
@ -735,5 +737,3 @@ if (!empty($user_list)) {
}
echo $navigation;
$_SESSION['combination'] = $combinations;

@ -2643,12 +2643,13 @@ class CourseManager
/**
* Get list of courses for a given user
* @param int user ID
* @param boolean Whether to include courses from session or not
* @param int $user_id
* @param boolean $include_sessions Whether to include courses from session or not
* @return array List of codes and db names
* @author isaac flores paz
*/
public static function get_courses_list_by_user_id($user_id, $include_sessions = false) {
public static function get_courses_list_by_user_id($user_id, $include_sessions = false)
{
$user_id = intval($user_id);
$course_list = array();
$codes = array();

Loading…
Cancel
Save