Merge 1.9.x

1.10.x
Julio Montoya 10 years ago
commit 3301ca921a
  1. 3
      .travis.yml
  2. 4
      main/admin/add_users_to_group.php
  3. 13
      main/admin/add_users_to_session.php
  4. 19
      main/admin/user_list.php
  5. 2
      main/auth/courses.php
  6. 16
      main/css/base.css
  7. 26
      main/css/chamilo/default.css
  8. BIN
      main/css/chamilo/fonts/OpenSans-Bold.woff
  9. BIN
      main/css/chamilo/fonts/OpenSans-Bold.woff2
  10. BIN
      main/css/chamilo/fonts/OpenSans-Light.woff
  11. BIN
      main/css/chamilo/fonts/OpenSans-Light.woff2
  12. BIN
      main/css/chamilo/fonts/OpenSans-Semibold.woff
  13. BIN
      main/css/chamilo/fonts/OpenSans-Semibold.woff2
  14. BIN
      main/css/chamilo/fonts/OpenSans.woff
  15. BIN
      main/css/chamilo/fonts/OpenSans.woff2
  16. BIN
      main/img/icons/32/sessions_category.png
  17. BIN
      main/img/icons/48/sessions_category.png
  18. BIN
      main/img/icons/64/sessions_category.png
  19. 102
      main/inc/ajax/model.ajax.php
  20. 230
      main/inc/lib/course.lib.php
  21. 31
      main/inc/lib/online.inc.php
  22. 5
      main/inc/lib/social.lib.php
  23. 3
      main/inc/lib/template.lib.php
  24. 28
      main/inc/lib/userportal.lib.php
  25. 5
      main/mySpace/company_reports.php
  26. 6
      main/social/group_topics.php
  27. 2
      main/template/default/gradebook/certificate_report.tpl
  28. 6
      main/template/default/skill/skill_tree.tpl
  29. 4
      main/template/default/skill/skill_tree_student.tpl
  30. 2
      plugin/courselegal/CourseLegalPlugin.php
  31. 39
      plugin/ticket/src/tutor.php
  32. 2
      whoisonline.php

@ -52,4 +52,5 @@ script:
# configure notifications (email, IRC, campfire etc)
notifications:
irc: "irc.freenode.org#chamilo"
# IRC notifications - disabled for creating a lot of noise on the channel
# irc: "irc.freenode.org#chamilo"

@ -448,9 +448,9 @@ if (!empty($errorMsg)) {
<?php
} else {
?>
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))"><i class="fa fa-arrow-left"></i></button>
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))"><i class="fa fa-arrow-right"></i></button>
<br /><br />
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))"><i class="fa fa-arrow-right"></i></button>
<button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))"><i class="fa fa-arrow-left"></i></button>
<?php
}
?>

@ -90,19 +90,12 @@ function search_users($needle, $type)
$order_clause = ' ORDER BY official_code, firstname, lastname, username';
}
if (api_is_session_admin()
&& isset($_configuration['prevent_session_admins_to_manage_all_users'])
&& $_configuration['prevent_session_admins_to_manage_all_users'] == 'true'
) {
if (api_is_session_admin() && api_get_setting('prevent_session_admins_to_manage_all_users') === 'true') {
$order_clause = " AND user.creator_id = " . api_get_user_id() . $order_clause;
}
$cond_user_id = '';
if (api_is_session_admin() && api_get_setting('prevent_session_admins_to_manage_all_users') == 'true') {
$order_clause = " AND user.creator_id = ".api_get_user_id().$order_clause;
}
// Only for single & multiple
if (in_array($type, array('single','multiple')))
if (!empty($id_session)) {
@ -411,7 +404,9 @@ if ($ajax_search) {
}
}
}
if (api_is_session_admin() && api_get_setting('prevent_session_admins_to_manage_all_users') === 'true') {
$order_clause = " AND u.creator_id = " . api_get_user_id() . $order_clause;
}
if ($use_extra_fields) {
$sql = "SELECT user_id, lastname, firstname, username, id_session, official_code
FROM $tbl_user u

@ -124,6 +124,25 @@ $(document).ready(function() {
document.getElementById(\'extra_data_text\').style.display="none";
}
}
$(".agenda_opener").click(function() {
var url = this.href;
var dialog = $("#dialog");
if ($("#dialog").length == 0) {
dialog = $(\'<div id="dialog" style="display:hidden"></div> \').appendTo(\'body\');
}
// load remote content
dialog.load(
url,
{},
function(responseText, textStatus, XMLHttpRequest) {
dialog.dialog({width:720, height:550, modal:true});
}
);
//prevent the browser to follow the link
return false;
});
});
//Load user calendar

@ -19,7 +19,7 @@ if (api_get_setting('show_courses_descriptions_in_catalog') == 'true') {
$htmlHeadXtra[] = '
<script>
$(document).ready(function() {
$(\'.ajax\').live(\'click\', function() {
$(\'.ajax\').click(function() {
var url = this.href;
var dialog = $("#dialog");
if ($("#dialog").length == 0) {

@ -3778,11 +3778,11 @@ a:active{
height: 20px;
width: 20px;
position:absolute;
background: url("online.png") no-repeat scroll right center transparent;
background: url("../img/online.png") no-repeat scroll right center transparent;
}
.online_user_in_text {
background: url("online.png") no-repeat scroll right center transparent;
background: url("../img/online.png") no-repeat scroll right center transparent;
height: 16px;
width: 17px;
display: inline-block;
@ -4177,12 +4177,10 @@ a.forum_group_link {
display: none;
}
#online_grid_container li img {
height: 100px;
}
#online_grid_container .thumbnail .caption {
height: 30px;
#online_grid_container {
list-style: none;
margin: 0;
padding: 0;
}
#hide_bar_template {
@ -5457,6 +5455,8 @@ i.size-32.icon-new-work{
margin-right: 5px;
}
.sessions .subtitle-session{
font-size: 12px;
font-style: italic;
}
/**
* Modal for user avatar preview

@ -5,7 +5,31 @@
* Licensed GLP
* Based on Bootstrap
*/
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600,300,700);
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(fonts/OpenSans-Light.woff2) format('woff2'), url(fonts/OpenSans-Light.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 400;
src: local('Open Sans'), local('OpenSans'), url(fonts/OpenSans.woff2) format('woff2'), url(fonts/OpenSans.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 600;
src: local('Open Sans Semibold'), local('OpenSans-Semibold'), url(fonts/OpenSans-Semibold.woff2) format('woff2'), url(fonts/OpenSans-Semibold.woff) format('woff');
}
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 700;
src: local('Open Sans Bold'), local('OpenSans-Bold'), url(fonts/OpenSans-Bold.woff2) format('woff2'), url(fonts/OpenSans-Bold.woff) format('woff');
}
html {
-ms-text-size-adjust: 100%;

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@ -151,6 +151,8 @@ switch ($action) {
$courseCodeList = array();
$userIdList = array();
$sessionIdList = [];
$searchByGroups = false;
if (api_is_drh()) {
if (api_drh_can_access_all_session_content()) {
$userList = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus(
@ -188,44 +190,45 @@ switch ($action) {
exit;
}
} elseif (api_is_student_boss()) {
$users = UserManager::getUsersFollowedByStudentBoss($userId);
$userIdList = array_keys($users);
}
$sessionIdList = [];
if ($sessionId == -1) {
$userIdList = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus(
'admin',
null
);
$userIdList = array_column($userIdList, 'user_id');
$sessionList = SessionManager::get_sessions_list();
$sessionIdList = array_column($sessionList, 'id');
$courseCodeList = array();
foreach ($sessionList as $session) {
$courses = SessionManager::get_course_list_by_session_id($session['id']);
$courseCodeList = array_merge($courseCodeList, array_column($courses, 'code'));
$searchByGroups = true;
} elseif (api_is_platform_admin()) {
if ($sessionId == -1) {
$userIdList = SessionManager::getAllUsersFromCoursesFromAllSessionFromStatus(
'admin',
null
);
$userIdList = array_column($userIdList, 'user_id');
$sessionList = SessionManager::get_sessions_list();
$sessionIdList = array_column($sessionList, 'id');
$courseCodeList = array();
foreach ($sessionList as $session) {
$courses = SessionManager::get_course_list_by_session_id($session['id']);
$courseCodeList = array_merge($courseCodeList, array_column($courses, 'code'));
}
}
$searchByGroups = true;
}
$groups = GroupPortalManager::get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_ADMIN);
$groupsId = array_keys($groups);
if ($searchByGroups) {
$groups = GroupPortalManager::get_groups_by_user(api_get_user_id(), GROUP_USER_PERMISSION_ADMIN);
$groupsId = array_keys($groups);
if (is_array($groupsId)) {
foreach ($groupsId as $groupId) {
$groupUsers = GroupPortalManager::get_users_by_group($groupId);
if (is_array($groupsId)) {
foreach ($groupsId as $groupId) {
$groupUsers = GroupPortalManager::get_users_by_group($groupId);
if (!is_array($groupUsers)) {
continue;
}
foreach ($groupUsers as $memberId => $member) {
if ($member['user_id'] == $userId ) {
if (!is_array($groupUsers)) {
continue;
}
$userIdList[] = intval($member['user_id']);
foreach ($groupUsers as $memberId => $member) {
if ($member['user_id'] == $userId ) {
continue;
}
$userIdList[] = intval($member['user_id']);
}
}
}
}
@ -234,6 +237,32 @@ switch ($action) {
$userIdList = array_unique($userIdList);
}
if (api_is_student_boss()) {
$userCourses = [];
foreach ($userIdList as $userId) {
$userCourses = array_merge(
$userCourses,
CourseManager::get_courses_list_by_user_id($userId, true)
);
$userSessions = SessionManager::getSessionsFollowedByUser($userId);
$sessionIdList = array_merge(
$sessionIdList,
array_column($userSessions, 'id')
);
}
$courseCodeList = array_column($userCourses, 'code');
}
if (!empty($courseCodeList)) {
$courseCodeList = array_unique($courseCodeList);
}
if (!empty($sessionIdList)) {
$sessionIdList = array_unique($sessionIdList);
}
if ($action == 'get_user_course_report') {
$count = CourseManager::get_count_user_list_from_course_code(
false,
@ -573,6 +602,12 @@ switch ($action) {
$column_names[] = $extra['3'];
}
}
if (api_is_student_boss()) {
$columns[] = 'group';
$column_names[] = get_lang('Group');
}
if (!in_array($sidx, array('title'))) {
$sidx = 'title';
}
@ -592,6 +627,13 @@ switch ($action) {
null,
$sessionIdList
);
if (api_is_student_boss()) {
foreach ($result as &$item) {
$userGroups = GroupPortalManager::get_groups_by_user($item['user_id']);
$item['group'] = implode(", ", array_column($userGroups, 'name'));
unset($item['user_id']);
}
}
break;
case 'get_user_skill_ranking':

@ -78,8 +78,9 @@ class CourseManager
if (empty($params['wanted_code'])) {
$params['wanted_code'] = $params['title'];
// Check whether the requested course code has already been occupied.
$params['wanted_code'] = CourseManager::generate_course_code(api_substr($params['title'], 0,
self::MAX_COURSE_LENGTH_CODE));
$params['wanted_code'] = CourseManager::generate_course_code(
api_substr($params['title'], 0, self::MAX_COURSE_LENGTH_CODE)
);
}
// Create the course keys
@ -101,11 +102,16 @@ class CourseManager
if (!empty($course_info)) {
AddCourse::prepare_course_repository($course_info['directory'], $course_info['code']);
AddCourse::fill_db_course($course_id, $course_info['directory'], $course_info['course_language'],
$params['exemplary_content']);
AddCourse::fill_db_course(
$course_id,
$course_info['directory'],
$course_info['course_language'],
$params['exemplary_content']
);
if (api_get_setting('gradebook_enable_grade_model') == 'true') {
//Create gradebook_category for the new course and add a gradebook model for the course
//Create gradebook_category for the new course and add
// a gradebook model for the course
if (isset($params['gradebook_model_id']) &&
!empty($params['gradebook_model_id']) &&
$params['gradebook_model_id'] != '-1'
@ -155,7 +161,8 @@ class CourseManager
*/
public static function get_course_information($course_code)
{
return Database::fetch_array(Database::query(
return Database::fetch_array(
Database::query(
"SELECT *, id as real_id FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
WHERE code='" . Database::escape_string($course_code) . "'"), 'ASSOC'
);
@ -170,21 +177,25 @@ class CourseManager
*/
public static function get_course_information_by_id($course_id)
{
return Database::select('*, id as real_id', Database::get_main_table(TABLE_MAIN_COURSE),
array('where' => array('id = ?' => intval($course_id))), 'first');
return Database::select(
'*, id as real_id',
Database::get_main_table(TABLE_MAIN_COURSE),
array('where' => array('id = ?' => intval($course_id))),
'first'
);
}
/**
* Returns a list of courses. Should work with quickform syntax
* @param integer $from Offset (from the 7th = '6'). Optional.
* @param integer $howmany Number of results we want. Optional.
* @param string $orderby The column we want to order it by. Optional, defaults to first column.
* @param int $orderby The column we want to order it by. Optional, defaults to first column.
* @param string $orderdirection The direction of the order (ASC or DESC). Optional, defaults to ASC.
* @param string $visibility The visibility of the course, or all by default.
* @param int $visibility The visibility of the course, or all by default.
* @param string $startwith If defined, only return results for which the course *title* begins with this string
* @param string $urlId The Access URL ID, if using multiple URLs
* @param string $alsoSearchCode An extension option to indicate that we also want to search for course codes (not *only* titles)
* @param array $conditions
* @param bool $alsoSearchCode An extension option to indicate that we also want to search for course codes (not *only* titles)
* @param array $conditionsLike
* @return array
*/
public static function get_courses_list(
@ -283,8 +294,8 @@ class CourseManager
/**
* Returns the access settings of the course:
* which visibility;
* wether subscribing is allowed;
* wether unsubscribing is allowed.
* whether subscribing is allowed;
* whether unsubscribing is allowed.
*
* @param string $course_code , the course code
* @todo for more consistency: use course_info call from database API
@ -293,10 +304,12 @@ class CourseManager
*/
public static function get_access_settings($course_code)
{
return Database::fetch_array(Database::query("
SELECT visibility, subscribe, unsubscribe
return Database::fetch_array(
Database::query(
"SELECT visibility, subscribe, unsubscribe
FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
WHERE code = '" . Database::escape_string($course_code) . "'")
WHERE code = '" . Database::escape_string($course_code) . "'"
)
);
}
@ -309,9 +322,11 @@ class CourseManager
*/
public static function get_user_in_course_status($user_id, $course_code)
{
$result = Database::fetch_array(Database::query(
$result = Database::fetch_array(
Database::query(
"SELECT status FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
WHERE course_code = '" . Database::escape_string($course_code) . "' AND user_id = " . intval($user_id))
WHERE course_code = '" . Database::escape_string($course_code) . "' AND user_id = " . intval($user_id)
)
);
return $result['status'];
@ -324,9 +339,11 @@ class CourseManager
*/
public static function get_tutor_in_course_status($user_id, $course_code)
{
$result = Database::fetch_array(Database::query(
$result = Database::fetch_array(
Database::query(
"SELECT tutor_id FROM " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . "
WHERE course_code = '" . Database::escape_string($course_code) . "' AND user_id = " . intval($user_id))
WHERE course_code = '" . Database::escape_string($course_code) . "' AND user_id = " . intval($user_id)
)
);
return $result['tutor_id'];
@ -581,15 +598,19 @@ class CourseManager
}
// Add him/her in the table session_rel_course_rel_user
@Database::query("INSERT INTO " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . "
@Database::query(
"INSERT INTO " . Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER) . "
SET id_session ='" . $session_id . "',
course_code = '" . $course_code . "',
id_user = '" . $user_id . "'");
id_user = '" . $user_id . "'"
);
// Add him/her in the table session_rel_user
@Database::query("INSERT INTO " . Database::get_main_table(TABLE_MAIN_SESSION_USER) . "
@Database::query(
"INSERT INTO " . Database::get_main_table(TABLE_MAIN_SESSION_USER) . "
SET id_session ='" . $session_id . "',
id_user = '" . $user_id . "'");
id_user = '" . $user_id . "'"
);
// Update the table session
$row = Database::fetch_array(@Database::query("SELECT COUNT(*) FROM " . Database::get_main_table(TABLE_MAIN_SESSION_USER) . " WHERE id_session = '" . $session_id . "' AND relation_type<>" . SESSION_RELATION_TYPE_RRHH . ""));
@ -739,11 +760,13 @@ class CourseManager
// Ok, subscribe the user.
$max_sort = api_max_sort_value('0', $user_id);
return (bool)Database::query("INSERT INTO " . $course_user_table . "
return (bool)Database::query(
"INSERT INTO " . $course_user_table . "
SET course_code = '$course_code',
user_id = '$user_id',
status = '" . $status . "',
sort = '" . ($max_sort + 1) . "'");
sort = '" . ($max_sort + 1) . "'"
);
}
/**
@ -791,8 +814,8 @@ class CourseManager
*/
public static function get_real_course_list()
{
$sql_result = Database::query("
SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
$sql_result = Database::query(
"SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
WHERE target_course_code IS NULL"
);
$real_course_list = array();
@ -813,13 +836,15 @@ class CourseManager
if ($user_id != strval(intval($user_id))) {
return $result_array;
}
$sql_result = Database::query("SELECT *
$sql_result = Database::query(
"SELECT *
FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " course
LEFT JOIN " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " course_user
ON course.code = course_user.course_code
WHERE course.target_course_code IS NULL
AND course_user.user_id = '$user_id'
AND course_user.status = '1'");
AND course_user.status = '1'"
);
if ($sql_result === false) {
return $result_array;
}
@ -998,8 +1023,10 @@ class CourseManager
*/
public static function get_virtual_courses_linked_to_real_course($real_course_code)
{
$sql_result = Database::query("SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
WHERE target_course_code = '" . Database::get_main_table(TABLE_MAIN_COURSE) . "'");
$sql_result = Database::query(
"SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
WHERE target_course_code = '" . Database::get_main_table(TABLE_MAIN_COURSE) . "'"
);
$result_array = array();
while ($result = Database::fetch_array($sql_result)) {
$result_array[] = $result;
@ -1118,8 +1145,10 @@ class CourseManager
if ($user_id != strval(intval($user_id))) {
return false;
}
$sql_result = Database::query('SELECT status FROM ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) .
' WHERE course_code="' . Database::escape_string($course_code) . '" and user_id="' . $user_id . '"');
$sql_result = Database::query(
'SELECT status FROM ' . Database::get_main_table(TABLE_MAIN_COURSE_USER) .
' WHERE course_code="' . Database::escape_string($course_code) . '" and user_id="' . $user_id . '"'
);
if (Database::num_rows($sql_result) > 0) {
return Database::result($sql_result, 0, 'status') == 1;
}
@ -1144,14 +1173,17 @@ class CourseManager
if ($session_id == '') {
$result = Database::fetch_array(
Database::query("SELECT *
Database::query(
"SELECT *
FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " course
LEFT JOIN " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " course_user
ON course.code = course_user.course_code
WHERE
course_user.user_id = '$user_id' AND
course_user.relation_type<>" . COURSE_RELATION_TYPE_RRHH . " AND
( course.code = '$course_code' OR target_course_code = '$course_code')"));
( course.code = '$course_code' OR target_course_code = '$course_code')"
)
);
return !empty($result);
}
@ -1556,6 +1588,7 @@ class CourseManager
$user_data = UserManager::get_extra_user_data_by_field($user['user_id'], $extra['1']);
$report_info[$extra['1']] = $user_data[$extra['1']];
}
$report_info['user_id'] = $user['user_id'];
$users[] = $report_info;
}
} else {
@ -2387,8 +2420,8 @@ class CourseManager
* @author Carlos Vargas <carlos.vargas@dokeos.com>, Dokeos Latino
* @param int $user_id the id of the user
* @param string $course_code the course code
* @param string $send_to_tutor_also
* @return string we return the message that is displayed when the action is succesfull
* @param bool $send_to_tutor_also
* @return string we return the message that is displayed when the action is successful
*/
public static function email_to_tutor($user_id, $course_code, $send_to_tutor_also = false)
{
@ -2409,7 +2442,6 @@ class CourseManager
//if ($send_to_tutor_also = true)
// Proposed change:
if ($send_to_tutor_also) {
//
$sql .= " AND tutor_id=1";
} else {
$sql .= " AND status=1";
@ -2851,17 +2883,26 @@ class CourseManager
*/
public static function get_course_id_by_database_name($db_name)
{
return Database::result(Database::query('SELECT code FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) .
' WHERE db_name="' . Database::escape_string($db_name) . '"'), 0, 'code');
return Database::result(
Database::query(
'SELECT code FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) .
' WHERE db_name="' . Database::escape_string($db_name) . '"'
),
0,
'code'
);
}
public static function get_session_category_id_by_session_id($session_id)
{
return Database::result(Database::query('SELECT sc.id session_category
return Database::result(
Database::query('SELECT sc.id session_category
FROM ' . Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY) . ' sc
INNER JOIN ' . Database::get_main_table(TABLE_MAIN_SESSION) . ' s
ON sc.id=s.session_category_id WHERE s.id="' . Database::escape_string($session_id) . '"'),
0, 'session_category');
0,
'session_category'
);
}
/**
@ -2928,8 +2969,14 @@ class CourseManager
*/
public static function get_name_database_course($course_code)
{
return Database::result(Database::query('SELECT db_name FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) .
' WHERE code="' . Database::escape_string($course_code) . '"'), 0, 'db_name');
return Database::result(
Database::query(
'SELECT db_name FROM ' . Database::get_main_table(TABLE_MAIN_COURSE) .
' WHERE code="' . Database::escape_string($course_code) . '"'
),
0,
'db_name'
);
}
/**
@ -3031,9 +3078,9 @@ class CourseManager
/**
* Get count rows of a table inside a course database
* @param string The table of which the rows should be counted
* @param int optionally count rows by session id
* @return int The number of rows in the given table.
* @param string $table The table of which the rows should be counted
* @param int $session_id optionally count rows by session id
* @return int $course_id The number of rows in the given table.
* @deprecated
*/
public static function count_rows_course_table($table, $session_id = '', $course_id = null)
@ -3058,9 +3105,9 @@ class CourseManager
/**
* Subscribes courses to human resource manager (Dashboard feature)
* @param int Human Resource Manager id
* @param array Courses code
* @param int Relation type
* @param int $hr_manager_id Human Resource Manager id
* @param array $courses_list Courses code
* @return int
**/
public static function suscribe_courses_to_hr_manager($hr_manager_id, $courses_list)
{
@ -3255,6 +3302,7 @@ class CourseManager
/**
* check if a course is special (autoregister)
* @param string $course_code
* @return bool
*/
public static function is_special_course($course_code)
{
@ -3304,7 +3352,7 @@ class CourseManager
$my_course_image = new Image($source_file);
$result = $my_course_image->send_image($course_image, -1, 'png');
// Redimension image to 100x85 (should be 85x85 but 100x85 visually gives
// Resize image to 100x85 (should be 85x85 but 100x85 visually gives
// better results for most images people put as course icon)
if ($result) {
$medium = new Image($course_image);
@ -3379,7 +3427,7 @@ class CourseManager
$html .= '</div>';
$params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null;
$html .= '<div class="span1 pull-right course-box-actions">' . $params['right_actions'] . '</div>';
$html .= '<div class="pull-right course-box-actions">' . $params['right_actions'] . '</div>';
$html .= '</div>';
$html .= '</div>';
return $html;
@ -3388,10 +3436,21 @@ class CourseManager
public static function session_items_html($params, $is_sub_content = false)
{
$html = '';
$html.= '<li>';
$notifications = isset($params['notifications']) ? $params['notifications'] : null;
$html.= $params['title']. $notifications;
$html.='</li>';
$html .= '<div class="row">';
$html .= '<div class="col-md-2">';
if (!empty($params['link'])){
$html .= '<a class="thumbnail" href="'.$params['link'].'">';
$html .= $params['icon'];
$html .= '</a>';
}else{
$html .= $params['icon'];
}
$html .= '</div>';
$html .= '<div class="col-md-10">';
$html .= $params['title'];
$html .= $params['coaches'];
$html .= '</div>';
$html .= '</div>';
return $html;
}
@ -3399,29 +3458,28 @@ class CourseManager
public static function session_list_html($params,$items_session, $is_sub_content = false)
{
$html = '';
$params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null;
$class = "panel-body";
$html .= '<div class="sessions ' . $class . '">';
$html .= '<div class="row">';
$html .= '<div class="col-sx-6 col-md-2">';
$html .= '<div class="panel-heading">';
if (!empty($params['link'])){
$html.= '<a class="thumbnail" href="'.$params['link'].'">';
$html.= '<a href="'.$params['link'].'">';
$html.= $params['icon'];
$html.= '</a>';
}else{
$html.= $params['icon'];
}
$html .= '</div>';
$notifications = isset($params['notifications']) ? $params['notifications'] : null;
$params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null;
$html .= '<div class="col-sx-6 col-md-10">';
$html .= $params['title'];
$html .= '<div class="pull-right">' . $params['right_actions'] . '</div>';
$html .= '<h4>'.$params['title'].$notifications.'</h4>';
$html .= '</div>';
$html .= '<div class="sessions ' . $class . '">';
$html .= '<div class="row">';
$html .= '<div class="col-md-12">';
if (!empty($params['subtitle'])) {
$html .= '<p class="subtitle-session"><i class="fa fa-clock-o"></i> ' . $params['subtitle'] . '</p>';
}
if (isset($params['show_description'], $params['description']) && $params['show_description'] == 1) {
$html .= '<p class="description-session">' . $params['description'] . '</p>';
}
if (!empty($params['subtitle'])) {
$html .= '<p class="alert alert-info subtitle-session"><i class="fa fa-clock-o"></i> ' . $params['subtitle'] . '</p>';
}
$html .= $items_session;
$html .= '</div>';
$html .= '</div>';
@ -3498,6 +3556,12 @@ class CourseManager
return '<div class="panel panel-default">' . $main_content . $sub_content . $sub_sub_content . '</div>';
}
public static function session_item_parent($main_content, $sub_content, $sub_sub_content = null)
{
return '<div class="panel panel-default"><div class="panel-body">' . $main_content . $sub_content . $sub_sub_content . '</div></div>';
}
/**
* Display special courses (and only these) as several HTML divs of class userportal-course-item
*
@ -3987,9 +4051,13 @@ class CourseManager
'blackboard_blue.png',
api_htmlentities($course_info['name']),
array(),
ICON_SIZE_MEDIUM
ICON_SIZE_LARGE
);
// Display the "what's new" icons
$notifications = '';
if ($course_visibility != COURSE_VISIBILITY_CLOSED && $course_visibility != COURSE_VISIBILITY_HIDDEN) {
$notifications .= Display:: show_notification($course_info);
}
if ($session_accessible) {
if ($course_visibility != COURSE_VISIBILITY_CLOSED ||
$user_in_course_status == COURSEMANAGER
@ -4008,13 +4076,13 @@ class CourseManager
if ($user_in_course_status == COURSEMANAGER || $sessionCourseAvailable) {
$session_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/?id_session=' . $course_info['id_session'];
$session_title = '<a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/?id_session=' . $course_info['id_session'] . '">'. $params['icon'] .''. $course_info['name'] . '</a>';
$session_title = '<h4><a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/?id_session=' . $course_info['id_session'] . '">'. $course_info['name'] . '</a>'.$notifications.'</h4>';
} else {
$session_title = $course_info['name'];
}
} else {
$session_url = api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/';
$session_title = '<a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/">' . $course_info['name'] . '</a>';
$session_title = '<h4><a href="' . api_get_path(WEB_COURSE_PATH) . $course_info['path'] . '/">' . $course_info['name'] . '</a>'.$notifications.'</h4>';
}
} else {
$session_title = $course_info['name'] . ' ' . Display::tag('span', get_lang('CourseClosed'),
@ -4058,6 +4126,7 @@ class CourseManager
if (api_get_setting('display_teacher_in_courselist') == 'true') {
$teacher_list = null;
if (!$nosession) {
$teacher_list = CourseManager::get_teacher_list_from_course_code_to_string(
$course_info['code'],
self::USER_SEPARATOR,
@ -4069,12 +4138,12 @@ class CourseManager
self::USER_SEPARATOR,
true
);
$icon_coachs = Display::return_icon('teacher.png','',null,ICON_SIZE_TINY);
if ($course_info['status'] == COURSEMANAGER || ($course_info['status'] == STUDENT && empty($course_info['id_session'])) || empty($course_info['status'])) {
$params['teachers'] = $teacher_list;
}
if (($course_info['status'] == STUDENT && !empty($course_info['id_session'])) || ($is_coach && $course_info['status'] != COURSEMANAGER)) {
$params['coaches'] = $course_coachs;
$params['coaches'] = $icon_coachs.$course_coachs;
}
} else {
$params['teachers'] = $teacher_list;
@ -4084,11 +4153,6 @@ class CourseManager
$session_title .= isset($course['special_course']) ? ' ' . Display::return_icon('klipper.png',
get_lang('CourseAutoRegister')) : '';
// Display the "what's new" icons
if ($course_visibility != COURSE_VISIBILITY_CLOSED && $course_visibility != COURSE_VISIBILITY_HIDDEN) {
$session_title .= Display:: show_notification($course_info);
}
$params['title'] = $session_title;
$params['extra'] = '';
@ -4305,6 +4369,7 @@ class CourseManager
* @param int user id
* @param string course code
* @param int session id
* @return mixed
*/
public static function save_user_legal($user_id, $course_code, $session_id = null)
{
@ -4433,7 +4498,7 @@ class CourseManager
* @param int course id
* @param int session id
* @param id url id
*
* @return array
**/
public static function update_course_ranking(
$course_id = null,
@ -4610,6 +4675,7 @@ class CourseManager
* Returns an array with the hottest courses
* @param int $days number of days
* @param int $limit number of hottest courses
* @return array
*/
public static function return_hot_courses($days = 30, $limit = 5)
{

@ -110,7 +110,7 @@ function online_logout($user_id = null, $logout_redirect = false) {
}
// selecting the last login of the user
$sql_last_connection="SELECT login_id, login_date FROM $tbl_track_login WHERE login_user_id='$user_id' ORDER BY login_date DESC LIMIT 0,1";
$sql_last_connection="SELECT login_id, login_date FROM $tbl_track_login WHERE login_user_id=$user_id ORDER BY login_date DESC LIMIT 0,1";
$q_last_connection=Database::query($sql_last_connection);
if (Database::num_rows($q_last_connection)>0) {
$i_id_last_connection=Database::result($q_last_connection,0,"login_id");
@ -183,11 +183,11 @@ function user_is_online($user_id)
$query = " SELECT login_user_id,login_date
FROM $track_online_table track
INNER JOIN $table_user u ON (u.user_id=track.login_user_id)
INNER JOIN $table_user u ON (u.id=track.login_user_id)
WHERE
track.access_url_id = $access_url_id AND
login_date >= '".$limit_date."' AND
u.user_id = $user_id
u.id = $user_id
LIMIT 1 ";
$result = Database::query($query);
@ -250,7 +250,7 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
} else {
$query = "SELECT DISTINCT login_user_id, login_date
FROM ".$track_online_table ." e
INNER JOIN ".$table_user ." u ON (u.user_id=e.login_user_id)
INNER JOIN ".$table_user ." u ON (u.id = e.login_user_id)
WHERE u.status != ".ANONYMOUS." AND login_date >= '".$current_date."'
ORDER BY $column $direction
LIMIT $from, $number_of_items";
@ -261,7 +261,7 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
if ($access_url_id != -1) {
if ($friends) {
// friends from social network is online
$query = "SELECT distinct login_user_id,login_date
$query = "SELECT distinct login_user_id, login_date
FROM $track_online_table track INNER JOIN $friend_user_table
ON (friend_user_id = login_user_id)
WHERE track.access_url_id = $access_url_id AND
@ -275,7 +275,7 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
$query = "SELECT login_user_id, login_date
FROM ".$track_online_table ." track
INNER JOIN ".$table_user ." u
ON (u.user_id=track.login_user_id)
ON (u.id=track.login_user_id)
WHERE u.status != ".ANONYMOUS." AND track.access_url_id = $access_url_id AND
login_date >= '".$current_date."'
ORDER BY $column $direction
@ -285,8 +285,8 @@ function who_is_online($from, $number_of_items, $column = null, $direction = nul
}
//This query will show all registered users. Only for dev purposes.
/*$query = "SELECT DISTINCT u.user_id as login_user_id, login_date FROM ".$track_online_table ." e , $table_user u
GROUP by u.user_id
/*$query = "SELECT DISTINCT u.id as login_user_id, login_date FROM ".$track_online_table ." e , $table_user u
GROUP by u.id
ORDER BY $column $direction
LIMIT $from, $number_of_items";*/
@ -332,7 +332,7 @@ function who_is_online_count($time_limit = null, $friends = false)
// All users online
$query = "SELECT count(login_id) as count
FROM $track_online_table track INNER JOIN $table_user u
ON (u.user_id=track.login_user_id)
ON (u.id=track.login_user_id)
WHERE u.status != ".ANONYMOUS." AND login_date >= '$current_date' ";
}
@ -352,7 +352,7 @@ function who_is_online_count($time_limit = null, $friends = false)
} else {
// all users online
$query = "SELECT count(login_id) as count FROM $track_online_table track
INNER JOIN $table_user u ON (u.user_id=track.login_user_id)
INNER JOIN $table_user u ON (u.id=track.login_user_id)
WHERE
u.status != ".ANONYMOUS." AND
track.access_url_id = $access_url_id AND
@ -464,7 +464,7 @@ function GetFullUserName($uid) {
$uid = (int) $uid;
$uid = intval($uid);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$query = "SELECT firstname, lastname FROM ".$user_table." WHERE user_id='$uid'";
$query = "SELECT firstname, lastname FROM ".$user_table." WHERE id=$uid";
$result = @Database::query($query);
if (count($result)>0) {
$str = '';
@ -486,22 +486,23 @@ function chatcall() {
if (!$_user['user_id']) {
return (false);
}
$userId = intval($_user['user_id']);
$track_user_table = Database::get_main_table(TABLE_MAIN_USER);
$sql="SELECT chatcall_user_id, chatcall_date FROM $track_user_table
WHERE ( user_id = '".$_user['user_id']."' )";
WHERE ( id = $userId )";
$result=Database::query($sql);
$row=Database::fetch_array($result);
$login_date=$row['chatcall_date'];
$hour = substr($login_date,11,2);
$minute = substr($login_date,14,2);
$secund = substr($login_date,17,2);
$second = substr($login_date,17,2);
$month = substr($login_date,5,2);
$day = substr($login_date,8,2);
$year = substr($login_date,0,4);
$calltime = mktime($hour,$minute,$secund,$month,$day,$year);
$calltime = mktime($hour,$minute,$second,$month,$day,$year);
$time = api_get_utc_datetime($time);
$time = api_get_utc_datetime();
$minute_passed=5; //within this limit, the chat call request is valid
$limittime = mktime(date("H"),date("i")-$minute_passed,date("s"),date("m"),date("d"),date("Y"));

@ -911,10 +911,9 @@ class SocialManager extends UserManager
if (isset($_GET['id']) or count($user_list) < 1) {
return false;
}
$column_size = '9';
$column_size = '12';
$add_row = false;
if (api_is_anonymous()) {
$column_size = '12';
$add_row = true;
}
@ -962,7 +961,7 @@ class SocialManager extends UserManager
$img = '<img title = "'.$name.'" alt="'.$name.'" src="'.$friends_profile['file'].'">';
}
$name = '<a href="'.$url.'">'.$status_icon.$user_status.$name.'</a><br>';
$html .= '<li class="col-md-'.($column_size / 3).'"><div class="thumbnail">'.$img.'<div class="caption">'.$name.'</div</div></li>';
$html .= '<li class="col-md-'.($column_size / 3).' thumbnail">'.$img.'<div class="caption">'.$name.'</div></li>';
}
$counter = $_SESSION['who_is_online_counter'];

@ -454,7 +454,8 @@ class Template
'software_name' => $_configuration['software_name'],
'system_version' => $_configuration['system_version'],
'site_name' => api_get_setting('siteName'),
'institution' => api_get_setting('Institution')
'institution' => api_get_setting('Institution'),
'date' => api_format_date('now', DATE_FORMAT_LONG),
);
$this->assign('_s', $_s);
}

@ -1142,7 +1142,7 @@ class IndexManager
'window_list.png',
$session_box['title'],
array('id' => 'session_img_' . $session_id),
ICON_SIZE_BIG
ICON_SIZE_MEDIUM
);
$extra_info = !empty($session_box['coach']) ? $session_box['coach'] : null;
$extra_info .= !empty($session_box['coach']) ? ' - '.$session_box['dates'] : $session_box['dates'];
@ -1180,7 +1180,7 @@ class IndexManager
$params['description'] = $session_box['description'];
$params['show_description'] = $session_box['show_description'];
$items_courses_session = '<ul class="sessions-items">'.$html_courses_session.'</ul>';
$items_courses_session = '<div class="sessions-items">'.$html_courses_session.'</div>';
/* Icon session no category */
$parentInfo = CourseManager::session_list_html($params,$items_courses_session,true);
@ -1269,7 +1269,7 @@ class IndexManager
}
$params = array();
//Category
if ($count > 0) {
$session_box = Display:: get_session_title_box(
$session_id
@ -1278,7 +1278,7 @@ class IndexManager
'window_list.png',
$session_box['title'],
array('id' => 'session_img_' . $session_id),
ICON_SIZE_BIG
ICON_SIZE_MEDIUM
);
if (api_is_drh()) {
@ -1299,19 +1299,21 @@ class IndexManager
$params['subtitle'] = (!empty($session_box['coach']) ? $session_box['coach'] . ' | ' : '') . $session_box['dates'];
if (api_is_platform_admin()) {
$params['right_actions'] = '<a href="' . api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session=' . $session_id . '">' .
$params['right_actions'] = '<div class="pull-right"><a href="' . api_get_path(WEB_CODE_PATH) . 'admin/resume_session.php?id_session=' . $session_id . '">' .
Display::return_icon(
'edit.png',
get_lang('Edit'),
array('align' => 'absmiddle'),
ICON_SIZE_SMALL
) . '</a>';
) . '</a></div>';
}
/* Icon Session in category */
$parentInfo = CourseManager::course_item_html(
$params,
true
);
$parentInfo = '<div class="panel panel-default">';
$parentInfo .= '<div class="panel-heading">'.$params['title'].$params['right_actions'].'</div>';
$parentInfo .= '<div class="panel-body">';
$parentInfo .= $html_courses_session;
$parentInfo .= '</div>';
$parentInfo .= '</div>';
if (isset($_configuration['show_simple_session_info']) && $_configuration['show_simple_session_info']) {
$params['title'] = $session_box['title'];
@ -1320,7 +1322,7 @@ class IndexManager
);
}
$html_sessions .= $parentInfo . $html_courses_session;
$html_sessions .= $parentInfo;
$sessionCount++;
}
@ -1329,7 +1331,7 @@ class IndexManager
if ($count_courses_session > 0) {
$params = array();
$params['icon'] = Display::return_icon('folder_blue.png', $session_category['session_category']['name'], array(), ICON_SIZE_LARGE);
$params['icon'] = Display::return_icon('sessions_category.png', $session_category['session_category']['name'], array(), ICON_SIZE_LARGE);
if (api_is_platform_admin()) {
$params['right_actions'] = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/session_category_edit.php?&id='.$session_category['session_category']['id'].'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
@ -1354,7 +1356,7 @@ class IndexManager
$params['subtitle'] = get_lang('Until').' '.$session_category_end_date;
}
}
$sessions_with_category .= CourseManager::course_item_parent(
$sessions_with_category .= CourseManager::session_item_parent(
CourseManager::course_item_html($params, true),
$html_sessions
);

@ -64,6 +64,11 @@ if (!empty($extra_fields)) {
}
}
if (api_is_student_boss()) {
$column_model[] = array('name'=>'group', 'index'=>'group', 'width'=>'50', 'align'=>'left','sortable'=>'false');
$columns[] = get_lang('Group');
}
// Autowidth
$extra_params['autowidth'] = 'true';
// height auto

@ -176,7 +176,7 @@ $(document).ready(function() {
})
}
$(\'.group_message_popup\').live(\'click\', function() {
$(\'.group_message_popup\').click(function() {
var url = this.href;
var dialog = $("#dialog");
if ($("#dialog").length == 0) {
@ -191,13 +191,13 @@ $(document).ready(function() {
dialog.dialog({
modal : true,
width : 520,
height : 400,
height : 400
});
});
//prevent the browser to follow the link
return false;
});
});
});
</script>';

@ -109,7 +109,7 @@
</td>
<td>
{% for certificate in student.certificates %}
<a href="{{ _p.web }}certificates/index.php?id={{ certificate.id }}" class="btn">{{ 'Certificate' | get_lang }}</a>
<a href="{{ _p.web }}certificates/index.php?id={{ certificate.id }}" class="btn btn-default"><i class="fa fa-floppy-o"></i> {{ 'Certificate' | get_lang }}</a>
{% endfor %}
</td>
</tr>

@ -69,7 +69,7 @@ jsPlumb.ready(function() {
});
//Return to root button
$('#return_to_root').live('click', function(){
$('#return_to_root').click(function(){
clean_values();
console.log('Clean values');
console.log('Reopen the root ');
@ -193,7 +193,7 @@ jsPlumb.ready(function() {
});
//Clicking in a box skill (we use live instead of bind because we're creating divs on the fly )
$(".open_block").live('click', function() {
$(".open_block").click(function() {
var id = $(this).attr('id');
console.log('click.open_block id: ' + id);
@ -271,7 +271,7 @@ jsPlumb.ready(function() {
});
//Skill title click
$(".edit_block").live('click',function() {
$(".edit_block").click(function() {
var my_id = $(this).attr('id');
my_id = my_id.split('_')[2];

@ -41,7 +41,7 @@ jsPlumb.bind("ready", function() {
});
//Clicking in a box skill (we use live instead of bind because we're creating divs on the fly )
$(".open_block").live('click', function() {
$(".open_block").click(function() {
var id = $(this).attr('id');
console.log('click.open_block id: ' + id);
@ -119,7 +119,7 @@ jsPlumb.bind("ready", function() {
});
$(".edit_block").live('click',function() {
$(".edit_block").click(function() {
var my_id = $(this).attr('id');
my_id = my_id.split('_')[2];

@ -112,7 +112,7 @@ class CourseLegalPlugin extends Plugin
* @param int $courseCode
* @param int $sessionId
* @param boolean $sendEmail Optional. Indicate whether the mail must be sent. Default is true
* @return bool
* @return mixed
*/
public function saveUserLegal($userId, $courseCode, $sessionId, $sendEmail = true)
{

@ -13,26 +13,27 @@ require_once 'tutor_report.lib.php';
$htmlHeadXtra[] = '
<script type="text/javascript">
$(document).ready(function (){
$(".ajax").live("click", function() {
var url = this.href;
var dialog = $("#dialog");
if ($("#dialog").length == 0) {
dialog = $("' . '<div id="dialog" style="display:hidden"></div>' . '").appendTo("body");
}
$(".ajax").click(function() {
var url = this.href;
var dialog = $("#dialog");
if ($("#dialog").length == 0) {
dialog = $("' . '<div id="dialog" style="display:hidden"></div>' . '").appendTo("body");
}
// load remote content
dialog.load(
url,
{},
function(responseText, textStatus, XMLHttpRequest) {
dialog.dialog({
modal : true,
width : 540,
height : 400
});
});
//prevent the browser to follow the link
return false;
// load remote content
dialog.load(
url,
{},
function(responseText, textStatus, XMLHttpRequest) {
dialog.dialog({
modal : true,
width : 540,
height : 400
});
}
);
//prevent the browser to follow the link
return false;
});
});

@ -65,7 +65,7 @@ function hide_icon_edit(element_html) {
$(document).ready(function() {
$("#link_load_more_items").live("click", function() {
$("#link_load_more_items").click(function() {
page = $("#link_load_more_items").attr("data_link");
$.ajax({
beforeSend: function(objeto) {

Loading…
Cancel
Save