public static function get_coachs_from_course_to_string(
$session_id = 0,
$course_code = null,
@ -1943,6 +1950,11 @@ class CourseManager
return $coaches_to_string;
}
/**
* @param string $course_code
* @param int $session_id
* @return string
*/
public static function get_coach_list_from_course_code_to_string($course_code, $session_id)
{
$tutor_data = '';
@ -1960,11 +1972,13 @@ class CourseManager
}
/**
* Return user info array of all users registered in the specified course
* this includes the users of the course itsel and the users of all linked courses.
* Return user info array of all users registered in the specified course
* this includes the users of the course itself and the users of all linked courses.
*
* @param array $course_info
* @return array with user info
* @param string $course_code
* @param bool $with_sessions
* @param int $session_id
* @return array with user info
*/
public static function get_real_and_linked_user_list($course_code, $with_sessions = true, $session_id = 0)
{
@ -1991,14 +2005,14 @@ class CourseManager
}
/**
* Return an array of arrays, listing course info of all courses in the list
* linked to the real course $real_course_code, to which the user $user_id is subscribed.
* Return an array of arrays, listing course info of all courses in the list
* linked to the real course $real_course_code, to which the user $user_id is subscribed.
*
* @param $user_id, the id (int) of the user
* @param $real_course_code, the id (char) of the real course
* @param $user_id, the id (int) of the user
* @param $real_course_code, the id (char) of the real course
*
* @return array of course info arrays
* @deprecated virtual course feature is not supported
* @return array of course info arrays
* @deprecated virtual course feature is not supported
*/
public static function get_list_of_virtual_courses_for_specific_user_and_real_course($user_id, $course_code)
{
@ -2027,9 +2041,9 @@ class CourseManager
/**
* Get the list of groups from the course
* @param string Course code
* @param int Session ID (optional)
* @param boolean get empty groups (optional)
* @param string $course_code
* @param int $session_id Session ID (optional)
* @param boolean $in_get_empty_group get empty groups (optional)
* @return array List of groups info
*/
public static function get_group_list_of_course($course_code, $session_id = 0, $in_get_empty_group = 0)
@ -2482,10 +2496,12 @@ class CourseManager
$course_found = true;
$course_sort = $courses['sort'];
if ($counter == 0) {
$sql = 'UPDATE '.$TABLECOURSUSER.' SET sort = sort+1 WHERE user_id= "'.$user_id.'" AND relation_type<>'.COURSE_RELATION_TYPE_RRHH.' AND user_course_cat="0" AND sort > "'.$course_sort.'"';
$sql = 'UPDATE '.$TABLECOURSUSER.' SET sort = sort+1
WHERE user_id= "'.$user_id.'" AND relation_type<>'.COURSE_RELATION_TYPE_RRHH.' AND user_course_cat="0" AND sort > "'.$course_sort.'"';
$course_sort++;
} else {
$sql = 'UPDATE '.$TABLECOURSUSER.' SET sort = sort+1 WHERE user_id= "'.$user_id.'" AND relation_type<>'.COURSE_RELATION_TYPE_RRHH.' AND user_course_cat="0" AND sort >= "'.$course_sort.'"';
$sql = 'UPDATE '.$TABLECOURSUSER.' SET sort = sort+1
WHERE user_id= "'.$user_id.'" AND relation_type<>'.COURSE_RELATION_TYPE_RRHH.' AND user_course_cat="0" AND sort >= "'.$course_sort.'"';
}
Database::query($sql);
break;
@ -2610,7 +2626,11 @@ class CourseManager
}
}
public static function get_special_course_list() {
* @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();
@ -2712,6 +2733,7 @@ class CourseManager
}
}
}
return $course_list;
}
@ -2876,7 +2898,8 @@ class CourseManager
}
/**
* Update course attributes. Will only update attributes with a non-empty value. Note that you NEED to check that your attributes are valid before using this function
* Update course attributes. Will only update attributes with a non-empty value.
* Note that you NEED to check that your attributes are valid before using this function
*
* @param int Course id
* @param array Associative array with field names as keys and field values as values
$sql = "SELECT s.course_code FROM $tbl_course_rel_user s INNER JOIN $tbl_course_rel_access_url a ON (a.course_code = s.course_code) WHERE user_id = $hr_manager_id AND relation_type=".COURSE_RELATION_TYPE_RRHH." AND access_url_id = ".api_get_current_access_url_id()."";
$sql = "SELECT s.course_code FROM $tbl_course_rel_user s
INNER JOIN $tbl_course_rel_access_url a ON (a.course_code = s.course_code)
WHERE user_id = $hr_manager_id AND relation_type=".COURSE_RELATION_TYPE_RRHH." AND access_url_id = ".api_get_current_access_url_id()."";
} else {
$sql = "SELECT course_code FROM $tbl_course_rel_user WHERE user_id = $hr_manager_id AND relation_type=".COURSE_RELATION_TYPE_RRHH." ";
$sql = "SELECT course_code FROM $tbl_course_rel_user
WHERE user_id = $hr_manager_id AND relation_type=".COURSE_RELATION_TYPE_RRHH." ";
}
$result = Database::query($sql);
if (Database::num_rows($result) > 0) {
@ -3574,10 +3602,10 @@ class CourseManager
public static function display_special_courses($user_id, $load_dirs = false)