skala
iflores 16 years ago
commit 0e0b9b5b4a
  1. 1
      documentation/changelog.html
  2. 2
      documentation/installation_guide.html
  3. 2
      documentation/installation_guide_es_ES.html
  4. 65
      main/admin/session_export.php
  5. 288
      main/admin/session_import.php
  6. 4
      main/admin/user_import.php
  7. 25
      main/auth/my_progress.php
  8. 49
      main/chat/chat_banner.php
  9. 20
      main/chat/chat_whoisonline.php
  10. 11
      main/group/group_category.php
  11. 7
      main/group/group_edit.php
  12. 15
      main/group/group_space.php
  13. 4
      main/inc/lib/add_course.lib.inc.php
  14. 12
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/_ajax_get_details_listing.php
  15. 13
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/ajaxfilemanager.php
  16. 2
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/inc/config.base.php
  17. 4
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/jscripts/ajaxfilemanager_c.js
  18. 5
      main/inc/lib/fckeditor/editor/plugins/ajaxfilemanager/theme/default/css/fckeditor.css
  19. 17
      main/inc/lib/groupmanager.lib.php
  20. 2
      main/install/migrate-db-1.8.6.1-1.8.6.2-pre.sql
  21. 30
      main/mySpace/myStudents.php

@ -30,6 +30,7 @@
<li>Added sessions history (optional access to previous sessions in read-only for students)</li>
<li>Added advanced search in sessions: you can also search by session name, session category, tutor and visibility. (DT#5541)</li>
<li>Added an option to configure courses as "auto-registered" (every user has it in his courses list and is automatically subscribed)</li>
<li>Added chat tool to the groups(DT#3318)</li>
<li>Allowed password to be recovered using username *or* e-mail</li>
<li>Added editable section to the registration form</li>
<li>Reporting: notification of user who have never been active yet</li>

@ -72,7 +72,7 @@ optimal flexibility, remote control and scalability. <br />
<br />
Dokeos is mainly a LMS running <span style="font-weight: bold;">Apache</span>, <span style="font-weight: bold;">MySQL</span> and <span style="font-weight: bold;">PHP5</span> (the so called <span style="font-weight: bold;">AMP</span> trilogy). <br />
Dokeos is mainly a LMS running <span style="font-weight: bold;">Apache 1.3, 2.0</span>, <span style="font-weight: bold;">MySQL 5.1</span> and <span style="font-weight: bold;">PHP 5.1</span> (the so called <span style="font-weight: bold;">AMP</span> trilogy). <br />
<br />

@ -83,7 +83,7 @@ control remoto y escalabilidad. <br />
<br />
Dokeos es principalmente un LMS que se ejecuta con <span style="font-weight: bold;">Apache</span>, <span style="font-weight: bold;">MySQL</span> y <span style="font-weight: bold;">PHP5</span> (tambien llamada la trilogía <span style="font-weight: bold;">AMP</span>). <br />
Dokeos es principalmente un LMS que se ejecuta con <span style="font-weight: bold;">Apache 1.3, 2.0</span>, <span style="font-weight: bold;">MySQL 5.1</span> y <span style="font-weight: bold;">PHP 5.1</span> (tambien llamada la trilogía <span style="font-weight: bold;">AMP</span>). <br />
<br />

@ -69,7 +69,7 @@ if($_POST['formSent'] )
$session_id=$_POST['session_id'];
if(empty($session_id))
{
$sql = "SELECT id,name,id_coach,username,date_start,date_end FROM $tbl_session INNER JOIN $tbl_user
$sql = "SELECT id,name,id_coach,username,date_start,date_end,visibility,session_category_id FROM $tbl_session INNER JOIN $tbl_user
ON $tbl_user.user_id = $tbl_session.id_coach ORDER BY id";
global $_configuration;
@ -77,7 +77,7 @@ if($_POST['formSent'] )
$tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
$access_url_id = api_get_current_access_url_id();
if ($access_url_id != -1){
$sql = "SELECT id, name,id_coach,username,date_start,date_end FROM $tbl_session s INNER JOIN $tbl_session_rel_access_url as session_rel_url
$sql = "SELECT id, name,id_coach,username,date_start,date_end,visibility,session_category_id FROM $tbl_session s INNER JOIN $tbl_session_rel_access_url as session_rel_url
ON (s.id= session_rel_url.session_id) INNER JOIN $tbl_user u ON (u.user_id = s.id_coach)
WHERE access_url_id = $access_url_id
ORDER BY id";
@ -88,7 +88,7 @@ if($_POST['formSent'] )
}
else
{
$sql = "SELECT id,name,username,date_start,date_end
$sql = "SELECT id,name,username,date_start,date_end,visibility,session_category_id
FROM $tbl_session
INNER JOIN $tbl_user
ON $tbl_user.user_id = $tbl_session.id_coach
@ -125,7 +125,7 @@ if($_POST['formSent'] )
if($file_type == 'csv')
{
$cvs = true;
fputs($fp,"SessionName;Coach;DateStart;DateEnd;Users;Courses;\n");
fputs($fp,"SessionName;Coach;DateStart;DateEnd;Visibility;SessionCategory;Users;Courses;\n");
}
else
{
@ -140,15 +140,19 @@ if($_POST['formSent'] )
$row['username'] = str_replace(';',',',$row['username']);
$row['date_start'] = str_replace(';',',',$row['date_start']);
$row['date_end'] = str_replace(';',',',$row['date_end']);
$row['visibility'] = str_replace(';',',',$row['visibility']);
$row['session_category'] = str_replace(';',',',$row['session_category_id']);
if($cvs){
$add.= $row['name'].';'.$row['username'].';'.$row['date_start'].';'.$row['date_end'].';';
$add.= $row['name'].';'.$row['username'].';'.$row['date_start'].';'.$row['date_end'].';'.$row['visibility'].';'.$row['session_category'].';';
}
else {
$add = "\t<Session>\n"
."\t\t<SessionName>$row[name]</SessionName>\n"
."\t\t<Coach>$row[username]</Coach>\n"
."\t\t<DateStart>$row[date_start]</DateStart>\n"
."\t\t<DateEnd>$row[date_end]</DateEnd>\n";
."\t\t<DateEnd>$row[date_end]</DateEnd>\n"
."\t\t<Visibility>$row[visibility]</Visibility>\n"
."\t\t<SessionCategory>$row[session_category]</SessionCategory>\n";
}
//users
@ -176,37 +180,55 @@ if($_POST['formSent'] )
$add .= $users;
//courses
$sql = "SELECT DISTINCT $tbl_course.code, $tbl_user.username FROM $tbl_course
INNER JOIN $tbl_session_course
ON $tbl_course.code = $tbl_session_course.course_code
AND $tbl_session_course.id_session = '".$row['id']."'
LEFT JOIN $tbl_user
ON $tbl_user.user_id = $tbl_session_course.id_coach";
$sql = "SELECT DISTINCT $tbl_course.code
FROM $tbl_course
INNER JOIN $tbl_session_course_user
ON $tbl_course.code = $tbl_session_course_user.course_code
AND $tbl_session_course_user.id_session = '".$row['id']."'";
$rsCourses = Database::query($sql,__FILE__,__LINE__);
$courses = '';
while($rowCourses = Database::fetch_array($rsCourses)){
// get coachs from a course
$sql = "SELECT u.username
FROM $tbl_session_course_user scu
INNER JOIN $tbl_user u ON u.user_id = scu.id_user
WHERE scu.course_code = '{$rowCourses['code']}'
AND scu.id_session = '".$row['id']."' AND scu.status = 2 ";
$rs_coachs = Database::query($sql,__FILE__,__LINE__);
$coachs = array();
while ($row_coachs = Database::fetch_array($rs_coachs)) {
$coachs[] = $row_coachs['username'];
}
$coachs = implode(",",$coachs);
if($cvs){
$courses .= str_replace(';',',',$rowCourses['code']);
$courses .= '['.str_replace(';',',',$rowCourses['username']).'][';
$courses .= '['.str_replace(';',',',$coachs).'][';
}
else {
$courses .= "\t\t<Course>\n";
$courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n";
$courses .= "\t\t\t<Coach>$rowCourses[username]</Coach>\n";
$courses .= "\t\t\t<Coach>$coachs</Coach>\n";
}
// rel user courses
$sql = "SELECT DISTINCT username
FROM $tbl_user
INNER JOIN $tbl_session_course_user
ON $tbl_session_course_user.id_user = $tbl_user.user_id
AND $tbl_session_course_user.course_code='".$rowCourses['code']."'
AND id_session='".$row['id']."'";
$sql = "SELECT DISTINCT u.username
FROM $tbl_session_course_user scu
INNER JOIN $tbl_session_user su ON scu.id_user = su.id_user AND scu.id_session = su.id_session
INNER JOIN $tbl_user u
ON scu.id_user = u.user_id
AND scu.course_code='".$rowCourses['code']."'
AND scu.id_session='".$row['id']."'";
$rsUsersCourse = Database::query($sql,__FILE__,__LINE__);
$userscourse = '';
while($rowUsersCourse = Database::fetch_array($rsUsersCourse)){
if($cvs){
$userscourse .= str_replace(';',',',$rowUsersCourse['username']).',';
}
@ -224,12 +246,11 @@ if($_POST['formSent'] )
$courses .= "\t\t</Course>\n";
}
}
if(!empty($courses) && $cvs)
$courses = api_substr($courses , 0, api_strlen($courses)-1);
$add .= $courses;
if($cvs) {
$breakline = api_is_windows_os()?"\r\n":"\n";
$add .= ";$breakline";

@ -69,6 +69,7 @@ if ($_POST['formSent']) {
// $root = @simplexml_load_string(api_utf8_encode_xml(file_get_contents($_FILES['import_file']['tmp_name'])));
// To ease debugging let us use:
$content = file_get_contents($_FILES['import_file']['tmp_name']);
$content = api_utf8_encode_xml($content);
$root = @simplexml_load_string($content);
unset($content);
@ -241,6 +242,7 @@ if ($_POST['formSent']) {
// Creating sessions from <Sessions> base node.
if (count($root->Session) > 0) {
foreach ($root->Session as $node_session) {
$course_counter = 0;
@ -287,6 +289,9 @@ if ($_POST['formSent']) {
}
}
$visibility = trim(api_utf8_decode($node_session->Visibility));
$session_category_id = trim(api_utf8_decode($node_session->SessionCategory));
if (!$updatesession) {
// Always create a session.
$unique_name = false; // This MUST be initializead.
@ -311,6 +316,8 @@ if ($_POST['formSent']) {
id_coach = '$coach_id',
date_start = '$date_start',
date_end = '$date_end',
visibility = '$visibility',
session_category_id = '$session_category_id',
session_admin_id=".intval($_user['user_id']);
$rs_session = Database::query($sql_session, __FILE__, __LINE__);
$session_id = Database::insert_id();
@ -326,6 +333,8 @@ if ($_POST['formSent']) {
id_coach = '$coach_id',
date_start = '$date_start',
date_end = '$date_end',
visibility = '$visibility',
session_category_id = '$session_category_id',
session_admin_id=".intval($_user['user_id']);
$rs_session = Database::query($sql_session, __FILE__, __LINE__);
$session_id = Database::insert_id();
@ -335,7 +344,9 @@ if ($_POST['formSent']) {
$sql_session = "UPDATE $tbl_session SET
id_coach = '$coach_id',
date_start = '$date_start',
date_end = '$date_end'
date_end = '$date_end',
visibility = '$visibility',
session_category_id = '$session_category_id'
WHERE name = '$session_name'";
$rs_session = Database::query($sql_session, __FILE__, __LINE__);
$session_id = Database::query("SELECT id FROM $tbl_session WHERE name='$session_name'", __FILE__, __LINE__);
@ -358,6 +369,7 @@ if ($_POST['formSent']) {
UrlManager::add_session_to_url($session_id, 1);
}
// Adding users to the new session.
foreach ($node_session->User as $node_user) {
$username = UserManager::purify_username(api_utf8_decode($node_user), $purification_option_for_usernames);
@ -371,24 +383,18 @@ if ($_POST['formSent']) {
}
}
// Adding courses to a session.
foreach ($node_session->Course as $node_course) {
$course_code = Database::escape_string(trim(api_utf8_decode($node_course->CourseCode)));
// Verify that the course pointed by the course code node exists.
if (CourseManager::course_exists($course_code)) {
// If the course exists we continue.
$course_info = CourseManager::get_course_information($course_code);
// Searching the coach.
$coach = UserManager::purify_username(api_utf8_decode($node_course->Coach), $purification_option_for_usernames);
if (!empty($coach)) {
$coach_id = UserManager::get_user_id_from_username($coach);
if ($coach_id === false) {
$error_message .= get_lang('UserDoesNotExist').' : '.$coach.'<br />';
$coach_id = '';
}
} else {
$coach_id = '';
}
$session_course_relation = SessionManager::relation_session_course_exist($session_id, $course_code);
if (!$session_course_relation) {
$sql_course = "INSERT INTO $tbl_session_course SET
@ -396,34 +402,53 @@ if ($_POST['formSent']) {
id_session='$session_id'";
$rs_course = Database::query($sql_course, __FILE__, __LINE__);
}
if (Database::affected_rows()) {
$course_counter++;
$users_in_course_counter = 0;
foreach ($node_course->User as $node_user) {
$username = UserManager::purify_username(api_utf8_decode($node_user), $purification_option_for_usernames);
$user_id = UserManager::get_user_id_from_username($username);
if ($user_id !== false) {
// Adding to session_rel_user table.
$sql = "INSERT IGNORE INTO $tbl_session_user SET
id_user='$user_id',
id_session = '$session_id'";
$rs_user = Database::query($sql, __FILE__, __LINE__);
$user_counter++;
// Adding to session_rel_user_rel_course table.
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$user_id',
course_code='$course_code',
id_session = '$session_id'";
$rs_users = Database::query($sql, __FILE__, __LINE__);
$users_in_course_counter++;
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$username.'<br />';
}
$course_coachs = explode(",",$node_course->Coach);
// adding coachs to session course user
foreach ($course_coachs as $course_coach) {
$coach_id = UserManager::purify_username(api_utf8_decode($course_coach), $purification_option_for_usernames);
$coach_id = UserManager::get_user_id_from_username($course_coach);
if ($coach_id !== false) {
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$coach_id',
course_code='$course_code',
id_session = '$session_id',
status = 2 ";
$rs_coachs = Database::query($sql, __FILE__, __LINE__);
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$user.'<br />';
}
}
// adding users
$course_counter++;
$users_in_course_counter = 0;
foreach ($node_course->User as $node_user) {
$username = UserManager::purify_username(api_utf8_decode($node_user), $purification_option_for_usernames);
$user_id = UserManager::get_user_id_from_username($username);
if ($user_id !== false) {
// Adding to session_rel_user table.
$sql = "INSERT IGNORE INTO $tbl_session_user SET
id_user='$user_id',
id_session = '$session_id'";
$rs_user = Database::query($sql, __FILE__, __LINE__);
$user_counter++;
// Adding to session_rel_user_rel_course table.
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$user_id',
course_code='$course_code',
id_session = '$session_id'";
$rs_users = Database::query($sql, __FILE__, __LINE__);
$users_in_course_counter++;
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$username.'<br />';
}
$update_session_course = "UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='$course_code'";
Database::query($update_session_course, __FILE__, __LINE__);
$inserted_in_course[$course_code] = $course_info['title'];
}
$update_session_course = "UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='$course_code'";
Database::query($update_session_course, __FILE__, __LINE__);
$inserted_in_course[$course_code] = $course_info['title'];
}
if (CourseManager::course_exists($course_code, true)) {
@ -434,52 +459,62 @@ if ($_POST['formSent']) {
if ($vcourse['code'] == $course_code) {
// Ignore, this has already been inserted.
} else {
$coach = UserManager::purify_username(api_utf8_decode($node_course->Coach), $purification_option_for_usernames);
if (!empty($coach)) {
$coach_id = UserManager::get_user_id_from_username($coach);
if ($user_id === false) {
$error_message .= get_lang('UserDoesNotExist').' : '.$coach.'<br />';
$coach_id = '';
}
} else {
$coach_id = '';
}
$sql_course = "INSERT INTO $tbl_session_course SET
course_code = '".$vcourse['code']."',
id_session='$session_id'";
$rs_course = Database::query($sql_course, __FILE__, __LINE__);
if (Database::affected_rows()) {
$course_counter++;
$users_in_course_counter = 0;
foreach ($node_course->User as $node_user) {
$username = UserManager::purify_username(api_utf8_decode($node_user), $purification_option_for_usernames);
$user_id = UserManager::get_user_id_from_username($username);
if ($user_id !== false) {
$sql = "INSERT IGNORE INTO $tbl_session_user SET
id_user='$user_id',
id_session = '$session_id'";
$rs_user = Database::query($sql, __FILE__, __LINE__);
if (Database::affected_rows()) {
$user_counter++;
}
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$user_id',
course_code='".$vcourse['code']."',
id_session = '$session_id'";
$rs_users = Database::query($sql, __FILE__, __LINE__);
if (Database::affected_rows()) {
$users_in_course_counter++;
}
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$username.'<br />';
}
$course_coachs = explode(",",$node_course->Coach);
// adding coachs to session course user
foreach ($course_coachs as $course_coach) {
$coach_id = UserManager::purify_username(api_utf8_decode($course_coach), $purification_option_for_usernames);
$coach_id = UserManager::get_user_id_from_username($course_coach);
if ($coach_id !== false) {
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$coach_id',
course_code='{$vcourse['code']}',
id_session = '$session_id',
status = 2 ";
$rs_coachs = Database::query($sql, __FILE__, __LINE__);
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$user.'<br />';
}
}
// adding users
$course_counter++;
$users_in_course_counter = 0;
foreach ($node_course->User as $node_user) {
$username = UserManager::purify_username(api_utf8_decode($node_user), $purification_option_for_usernames);
$user_id = UserManager::get_user_id_from_username($username);
if ($user_id !== false) {
// Adding to session_rel_user table.
$sql = "INSERT IGNORE INTO $tbl_session_user SET
id_user='$user_id',
id_session = '$session_id'";
$rs_user = Database::query($sql, __FILE__, __LINE__);
$user_counter++;
// Adding to session_rel_user_rel_course table.
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$user_id',
course_code='{$vcourse['code']}',
id_session = '$session_id'";
$rs_users = Database::query($sql, __FILE__, __LINE__);
$users_in_course_counter++;
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$username.'<br />';
}
Database::query("UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='$course_code'",__FILE__,__LINE__);
}
$update_session_course = "UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='$course_code'";
Database::query($update_session_course, __FILE__, __LINE__);
$inserted_in_course[$course_code] = $course_info['title'];
}
$inserted_in_course[$vcourse['code']] = $vcourse['title'];
}
} else {
// Tthe course does not exist.
$error_message .= get_lang('CourseDoesNotExist').' : '.$course_code.'<br />';
@ -502,6 +537,7 @@ if ($_POST['formSent']) {
///////////////////
$content = file($_FILES['import_file']['tmp_name']);
if (!api_strstr($content[0], ';')) {
$error_message = get_lang('NotCSV');
} else {
@ -523,6 +559,7 @@ if ($_POST['formSent']) {
}
}
}
// looping the sessions
foreach ($sessions as $enreg) {
$user_counter = 0;
@ -531,6 +568,8 @@ if ($_POST['formSent']) {
$session_name = $enreg['SessionName'];
$date_start = $enreg['DateStart'];
$date_end = $enreg['DateEnd'];
$visibility = $enreg['Visibility'];
$session_category_id = $enreg['SessionCategory'];
// searching a coach
if (!empty($enreg['Coach'])) {
@ -569,6 +608,8 @@ if ($_POST['formSent']) {
id_coach = '$coach_id',
date_start = '$date_start',
date_end = '$date_end',
visibility = '$visibility',
session_category_id = '$session_category_id',
session_admin_id=".intval($_user['user_id']);
$rs_session = Database::query($sql_session, __FILE__, __LINE__);
$session_id = Database::insert_id();
@ -582,7 +623,10 @@ if ($_POST['formSent']) {
name = '$session_name',
id_coach = '$coach_id',
date_start = '$date_start',
date_end = '$date_end'";
date_end = '$date_end',
visibility = '$visibility',
session_category_id = '$session_category_id'";
$rs_session = Database::query($sql_session, __FILE__, __LINE__);
// We get the last insert id.
$my_session_result = SessionManager::get_session_by_name($session_name);
@ -593,7 +637,9 @@ if ($_POST['formSent']) {
$sql_session = "UPDATE $tbl_session SET
id_coach = '$coach_id',
date_start = '$date_start',
date_end = '$date_end'
date_end = '$date_end',
visibility = '$visibility',
session_category_id = '$session_category_id'
WHERE name = '$session_name'";
$rs_session = Database::query($sql_session, __FILE__, __LINE__);
$session_id = Database::query("SELECT id FROM $tbl_session WHERE name='$session_name'", __FILE__, __LINE__);
@ -626,6 +672,7 @@ if ($_POST['formSent']) {
foreach ($courses as $course) {
$course_code = api_strtoupper(api_substr($course, 0, api_strpos($course, '[')));
if (CourseManager::course_exists($course_code)) {
// If the course exists we continue
@ -649,12 +696,34 @@ if ($_POST['formSent']) {
$rs_course = Database::query($sql_course, __FILE__, __LINE__);
$course_counter++;
$users = api_substr($course, api_strpos($course, '[', 1) + 1 , api_strpos($course, ']', 1));
$users = explode('|', $enreg['Users']);
$users_in_course_counter = 0;
$course_split = array();
$tok = strtok($course, "[]");
while ($tok !== false) {
$course_split[] = $tok;
$tok = strtok("[]");
}
$course_coachs = explode(",",$course_split[1]);
$course_users = explode(",",$course_split[2]);
// adding coachs to session course user
foreach ($course_coachs as $course_coach) {
$coach_id = UserManager::get_user_id_from_username($course_coach);
if ($coach_id !== false) {
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$coach_id',
course_code='$course_code',
id_session = '$session_id',
status = 2 ";
$rs_coachs = Database::query($sql, __FILE__, __LINE__);
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$user.'<br />';
}
}
$users_in_course_counter = 0;
// Adding the relationship "Session - Course - User".
foreach ($users as $user) {
foreach ($course_users as $user) {
$user_id = UserManager::get_user_id_from_username($user);
if ($user_id !== false) {
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
@ -667,7 +736,8 @@ if ($_POST['formSent']) {
$error_message .= get_lang('UserDoesNotExist').' : '.$user.'<br />';
}
}
Database::query("UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='$course_code'", __FILE__, __LINE__);
$sql = "UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='$course_code'";
Database::query($sql,__FILE__,__LINE__);
$course_info = CourseManager::get_course_information($course_code);
$inserted_in_course[$course_code] = $course_info['title'];
@ -676,47 +746,55 @@ if ($_POST['formSent']) {
}
if (CourseManager::course_exists($course_code, true)) {
$list = CourseManager :: get_courses_info_from_visual_code($course_code);
foreach ($list as $vcourse) {
if ($vcourse['code'] == $course_code) {
// Ignore, this has already been inserted.
} else {
$coach = api_strstr($course, '[');
$coach = api_substr($coach, 1, api_strpos($coach,']') - 1);
if (!empty($coach)) {
$sql_coach = "SELECT user_id FROM $tbl_user WHERE username='$coach'";
$rs_coach = Database::query($sql_coach,__FILE__,__LINE__);
list($coach) = (Database::fetch_array($rs_coach));
} else {
$coach = '';
}
// Adding the relationship "Session - Course".
$sql_course = "INSERT IGNORE INTO $tbl_session_course SET
course_code = '".$vcourse['code']."',
id_session='$session_id'";
course_code = '".$vcourse['code']."',
id_session='$session_id'";
$rs_course = Database::query($sql_course, __FILE__, __LINE__);
if (Database::affected_rows()) {
$course_counter++;
$users = api_substr($course , api_strpos($course,'[', 1) + 1, api_strpos($course,']', 1));
$users = explode('|', $enreg['Users']);
$users_in_course_counter = 0;
foreach ($users as $user) {
$sqlUser = "SELECT user_id FROM $tbl_user WHERE username='".$user."'";
$rs_user = Database::query($sqlUser);
list($user_id) = (Database::fetch_array($rs_user));
$sql = "INSERT INTO $tbl_session_course_user SET
// adding coachs to session course user
foreach ($course_coachs as $course_coach) {
$coach_id = UserManager::get_user_id_from_username($course_coach);
if ($coach_id !== false) {
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$coach_id',
course_code='{$vcourse['code']}',
id_session = '$session_id',
status = 2 ";
$rs_coachs = Database::query($sql, __FILE__, __LINE__);
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$user.'<br />';
}
}
$users_in_course_counter = 0;
// Adding the relationship "Session - Course - User".
foreach ($course_users as $user) {
$user_id = UserManager::get_user_id_from_username($user);
if ($user_id !== false) {
$sql = "INSERT IGNORE INTO $tbl_session_course_user SET
id_user='$user_id',
course_code='".$vcourse['code']."',
course_code='{$vcourse['code']}',
id_session = '$session_id'";
$rs_users = Database::query($sql, __FILE__, __LINE__);
if (Database::affected_rows()) {
$users_in_course_counter++;
}
$users_in_course_counter++;
} else {
$error_message .= get_lang('UserDoesNotExist').' : '.$user.'<br />';
}
Database::query("UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='".$vcourse['code']."'", __FILE__, __LINE__);
}
Database::query("UPDATE $tbl_session_course SET nbr_users='$users_in_course_counter' WHERE course_code='".$vcourse['code']."'", __FILE__, __LINE__);
}
}
$inserted_in_course[$vcourse['code']] = $vcourse['title'];

@ -360,8 +360,8 @@ if ($_POST['formSent'] AND $_FILES['import_file']['size'] !== 0) {
$_SESSION['session_message_import_users'] = $error_message;
$error_message = 'session_message';
}
header('Location: user_list.php?action=show_message&message='.urlencode($see_message_import).'&warn='.urlencode($error_message).'&sec_token='.$tok);
exit ();
header('Location: '.api_get_path(WEB_CODE_PATH).'admin/user_list.php?action=show_message&message='.urlencode($see_message_import).'&warn='.urlencode($error_message).'&sec_token='.$tok);
exit;
}
Display :: display_header($tool_name);

@ -156,18 +156,23 @@ foreach ($courses as $enreg) {
$session_name = Database::result($rs, 0, 'name');
$session_coach_id = intval(Database::result($rs, 0, 'id_coach'));
// get coach of the course in the session
$sql = 'SELECT id_coach FROM '.$tbl_session_course.'
WHERE id_session='.$session_id.'
AND course_code = "'.Database::escape_string($_GET['course']).'"';
$sql = 'SELECT id_user FROM ' . $tbl_session_course_user . '
WHERE id_session=' . $session_id . '
AND course_code = "' . Database :: escape_string($course) . '" AND status=2';
$rs = Database::query($sql, __FILE__, __LINE__);
$session_course_coach_id = intval(Database::result($rs, 0, 0));
if ($session_course_coach_id != 0) {
$coach_info = UserManager :: get_user_info_by_id($session_course_coach_id);
$course_info['tutor_name'] = api_get_person_name($coach_info['firstname'], $coach_info['lastname']);
$course_coachs = array();
while ($row_coachs = Database::fetch_array($rs)) {
$course_coachs[] = $row_coachs['id_user'];
}
else if($session_coach_id != 0) {
if (!empty($course_coachs)) {
$info_tutor_name = array();
foreach ($course_coachs as $course_coach) {
$coach_infos = UserManager :: get_user_info_by_id($course_coach);
$info_tutor_name[] = api_get_person_name($coach_infos['firstname'], $coach_infos['lastname']);
}
$course_info['tutor_name'] = implode(",",$info_tutor_name);
} else if($session_coach_id != 0) {
$coach_info = UserManager :: get_user_info_by_id($session_coach_id);
$course_info['tutor_name'] = api_get_person_name($coach_info['firstname'], $coach_info['lastname']);
}

@ -31,15 +31,54 @@
*/
$language_file = array ('chat');
include('../inc/global.inc.php');
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
//$interbreadcrumb[] = array ("url" => "chat.php", "name" => get_lang("Chat"));
//$noPHP_SELF=true;
//$shortBanner=false;
//Display::display_header(null,"Chat");
$tool_name = get_lang('Chat');
// If it is a group chat then the breadcrumbs.
if ($_SESSION['_gid'] OR $_GET['group_id']) {
if (isset($_SESSION['_gid'])) {
$_clean['group_id']=(int)$_SESSION['_gid'];
}
if (isset($_GET['group_id'])) {
$_clean['group_id']=(int)Database::escape_string($_GET['group_id']);
}
$group_properties = GroupManager :: get_group_properties($_clean['group_id']);
$interbreadcrumb[] = array ("url" => "../group/group.php", "name" => get_lang('Groups'));
$interbreadcrumb[] = array ("url"=>"../group/group_space.php?gidReq=".$_SESSION['_gid'], "name"=> get_lang('GroupSpace').' ('.$group_properties['name'].')');
$noPHP_SELF=true;
$shortBanner=false;
$add_group_to_title = ' ('.$group_properties['name'].')';
$groupfilter='group_id="'.$_clean['group_id'].'"';
$interbreadcrumb[] = array ("url" => "chat.php", "name" => get_lang("Chat"));
$noPHP_SELF=true;
$shortBanner=false;
//ensure this tool in groups whe it's private or deactivated
/*if ($group_properties['chat_state']==0)
{
echo api_not_allowed();
}
elseif ($group_properties['chat_state']==2)
{
if (!api_is_allowed_to_edit(false,true) and !GroupManager :: is_user_in_group($_user['user_id'], $_SESSION['_gid']))
{
echo api_not_allowed();
}
}*/
Display::display_header(null,"Chat");
}
else
{
$groupfilter='group_id=0';
}
Display::display_header($tool_name, 'Chat');
//$is_allowed_to_edit = api_is_allowed_to_edit(false,true);
?>
</body>

@ -83,14 +83,25 @@ if (!empty($course))
$Users[$coach['user_id']] = $coach;
// select session course coach
$query="SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session_course t3 WHERE t1.user_id=t2.user_id AND t3.id_coach=t2.user_id AND t3.id_session = '".$_SESSION['id_session']."' AND t3.course_code = '".$_course['sysCode']."' AND t2.last_connection>'".$date_inter."' ORDER BY username";
$query="SELECT DISTINCT t1.user_id,username,firstname,lastname,picture_uri
FROM $tbl_user t1,$tbl_chat_connected t2,$tbl_session_course_user t3
WHERE t1.user_id=t2.user_id
AND t3.id_user=t2.user_id AND t3.status=2
AND t3.id_session = '".$_SESSION['id_session']."'
AND t3.course_code = '".$_course['sysCode']."'
AND t2.last_connection>'".$date_inter."' ORDER BY username";
$result=Database::query($query,__FILE__,__LINE__);
if($coach = Database::fetch_array($result))
$Users[$coach['user_id']] = $coach;
$course_coachs = array();
while ($coachs = Database::fetch_array($result)) {
//$course_coachs[] = $coachs['user_id'];
$Users[$coachs['user_id']] = $coachs;
}
//if($coach = Database::fetch_array($result))
//$Users[$coach['user_id']] = $coach;
}
$user_id=$enreg['user_id'];
include('header_frame.inc.php');
?>
@ -99,6 +110,7 @@ if (!empty($course))
<?php
foreach($Users as $enreg)
{
if(!isset($_SESSION['id_session']))
{
$status=$enreg['status'];

@ -81,7 +81,7 @@ if (api_get_setting('allow_group_categories') == 'true')
{
$nameTools = get_lang('AddCategory');
// default values for new category
$category = array ('groups_per_user' => 1, 'doc_state' => TOOL_PRIVATE, 'work_state' => TOOL_PRIVATE, 'wiki_state' => TOOL_PRIVATE, 'calendar_state' => TOOL_PRIVATE, 'announcements_state'=> TOOL_PRIVATE, 'forum_state' => TOOL_PRIVATE, 'max_student' => 0);
$category = array ('groups_per_user' => 1, 'doc_state' => TOOL_PRIVATE, 'work_state' => TOOL_PRIVATE, 'wiki_state' => TOOL_PRIVATE , 'chat_state' => TOOL_PRIVATE, 'calendar_state' => TOOL_PRIVATE, 'announcements_state'=> TOOL_PRIVATE, 'forum_state' => TOOL_PRIVATE, 'max_student' => 0);
}
}
else
@ -189,6 +189,11 @@ $form->addElement('radio', 'wiki_state', get_lang('GroupWiki'), get_lang('NotAva
$form->addElement('radio', 'wiki_state', null, get_lang('Public'), TOOL_PUBLIC);
$form->addElement('radio', 'wiki_state', null, get_lang('Private'), TOOL_PRIVATE);
// Chat Settings
$form->addElement('radio', 'chat_state', get_lang('Chat'), get_lang('NotAvailable'), TOOL_NOT_AVAILABLE);
$form->addElement('radio', 'chat_state', null, get_lang('Public'), TOOL_PUBLIC);
$form->addElement('radio', 'chat_state', null, get_lang('Private'), TOOL_PRIVATE);
// Submit
$form->addElement('style_submit_button', 'submit', get_lang('PropModify'), 'class="save"');
// If form validates -> save data
@ -208,12 +213,12 @@ if ($form->validate())
switch ($values['action'])
{
case 'update_settings' :
GroupManager :: update_category($values['id'], $values['title'], $values['description'], $values['doc_state'], $values['work_state'], $values['calendar_state'], $values['announcements_state'], $values['forum_state'], $values['wiki_state'], $self_reg_allowed, $self_unreg_allowed, $max_member, $values['groups_per_user']);
GroupManager :: update_category($values['id'], $values['title'], $values['description'], $values['doc_state'], $values['work_state'], $values['calendar_state'], $values['announcements_state'], $values['forum_state'], $values['wiki_state'], $values['chat_state'], $self_reg_allowed, $self_unreg_allowed, $max_member, $values['groups_per_user']);
$msg = urlencode(get_lang("GroupPropertiesModified"));
header('Location: group.php?action=show_msg&msg='.$msg.'&category='.$values['id']);
break;
case 'add_category' :
GroupManager :: create_category($values['title'], $values['description'], $values['doc_state'], $values['work_state'], $values['calendar_state'], $values['announcements_state'], $values['forum_state'], $values['wiki_state'], $self_reg_allowed, $self_unreg_allowed, $max_member, $values['groups_per_user']);
GroupManager :: create_category($values['title'], $values['description'], $values['doc_state'], $values['work_state'], $values['calendar_state'], $values['announcements_state'], $values['forum_state'], $values['wiki_state'], $values['chat_state'], $self_reg_allowed, $self_unreg_allowed, $max_member, $values['groups_per_user']);
$msg = urlencode(get_lang("CategoryCreated"));
header('Location: group.php?action=show_msg&msg='.$msg);
break;

@ -201,6 +201,11 @@ $form->addElement('radio', 'wiki_state', get_lang('GroupWiki'), get_lang('NotAva
$form->addElement('radio', 'wiki_state', null, get_lang('Public'), TOOL_PUBLIC);
$form->addElement('radio', 'wiki_state', null, get_lang('Private'), TOOL_PRIVATE);
// Chat settings
$form->addElement('radio', 'chat_state', get_lang('Chat'), get_lang('NotAvailable'), TOOL_NOT_AVAILABLE);
$form->addElement('radio', 'chat_state', null, get_lang('Public'), TOOL_PUBLIC);
$form->addElement('radio', 'chat_state', null, get_lang('Private'), TOOL_PRIVATE);
// getting all the users
if (isset($_SESSION['id_session'])) {
$complete_user_list = CourseManager :: get_user_list_from_course_code($_course['id'],true,$_SESSION['id_session']);
@ -283,7 +288,7 @@ if ($form->validate()) {
}
$self_registration_allowed = isset ($values['self_registration_allowed']) ? 1 : 0;
$self_unregistration_allowed = isset ($values['self_unregistration_allowed']) ? 1 : 0;
GroupManager :: set_group_properties($current_group['id'], strip_tags($values['name']), strip_tags($values['description']), $max_member, $values['doc_state'], $values['work_state'], $values['calendar_state'], $values['announcements_state'], $values['forum_state'],$values['wiki_state'], $self_registration_allowed, $self_unregistration_allowed);
GroupManager :: set_group_properties($current_group['id'], strip_tags($values['name']), strip_tags($values['description']), $max_member, $values['doc_state'], $values['work_state'], $values['calendar_state'], $values['announcements_state'], $values['forum_state'],$values['wiki_state'], $values['chat_state'], $self_registration_allowed, $self_unregistration_allowed);
// storing the tutors (we first remove all the tutors and then add only those who were selected)
GroupManager :: unsubscribe_all_tutors($current_group['id']);

@ -79,7 +79,7 @@ if (is_array($forums_of_groups)) {
}
}
if ($current_group['doc_state']!=1 and $current_group['calendar_state']!=1 and $current_group['work_state']!=1 and $current_group['announcements_state']!=1 and $current_group['wiki_state']!=1 and $forum_state_public!=1) {
if ($current_group['doc_state']!=1 and $current_group['calendar_state']!=1 and $current_group['work_state']!=1 and $current_group['announcements_state']!=1 and $current_group['wiki_state']!=1 and $current_group['chat_state']!=1 and $forum_state_public!=1) {
if (!api_is_allowed_to_edit(null,true) and !GroupManager :: is_user_in_group($_user['user_id'], $current_group['id'])) {
echo api_not_allowed($print_headers);
}
@ -214,6 +214,13 @@ if (api_is_allowed_to_edit(false,true) OR GroupManager :: is_user_in_group($_SES
//link to the wiki area of this group
$tools .= "<div style='margin-bottom: 5px;'><a href=\"../wiki/index.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."\">".Display::return_icon('wiki.gif', get_lang("GroupWiki"))."&nbsp;".get_lang("GroupWiki")."</a></div>";
}
if ( $current_group['chat_state'] != TOOL_NOT_AVAILABLE)
{
//link to the chat area of this group
$tools .= "<div style='margin-bottom: 5px;'><a href=\"../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."\">".Display::return_icon('chat.gif', get_lang("Chat"))."&nbsp;".get_lang("Chat")."</a></div>";
}
echo '<div class="actions-message" style="margin-bottom:4px;"><b>'.get_lang("Tools").':</b></div>';
if (!empty($tools))
{
@ -263,6 +270,12 @@ if (api_is_allowed_to_edit(false,true) OR GroupManager :: is_user_in_group($_SES
$tools .= "<a href=\"../wiki/index.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."\">".Display::return_icon('wiki.gif', get_lang('GroupWiki'))."&nbsp;".get_lang('GroupWiki')."</a><br/>";
}
if ( $current_group['chat_state'] == TOOL_PUBLIC )
{
//link to the chat area of this group
$tools .= "<a href=\"../chat/chat.php?".api_get_cidreq()."&amp;toolgroup=".$current_group['id']."\">".Display::return_icon('chat.gif', get_lang('Chat'))."&nbsp;".get_lang('Chat')."</a><br/>";
}
echo '<br/>';
echo '<div class="actions-message" style="margin-bottom:4px;"><b>'.get_lang("Tools").':</b></div>';

@ -628,7 +628,7 @@ function update_Db_course($courseDbName)
start_time datetime NOT NULL default '0000-00-00 00:00:00',
end_time datetime NOT NULL default '0000-00-00 00:00:00',
feedback_type int NOT NULL default 0,
expired_time int NOT NULL default '0',
expired_time int NOT NULL default '0',
session_id smallint default 0,
PRIMARY KEY (id)
)";
@ -1001,6 +1001,7 @@ function update_Db_course($courseDbName)
announcements_state tinyint unsigned NOT NULL default 0,
forum_state tinyint unsigned NOT NULL default 0,
wiki_state tinyint unsigned NOT NULL default 1,
chat_state tinyint unsigned NOT NULL default 1,
secret_directory varchar(255) default NULL,
self_registration_allowed tinyint unsigned NOT NULL default '0',
self_unregistration_allowed tinyint unsigned NOT NULL default '0',
@ -1019,6 +1020,7 @@ function update_Db_course($courseDbName)
announcements_state tinyint unsigned NOT NULL default 1,
forum_state tinyint unsigned NOT NULL default 1,
wiki_state tinyint unsigned NOT NULL default 1,
chat_state tinyint unsigned NOT NULL default 1,
max_student smallint unsigned NOT NULL default 8,
self_reg_allowed tinyint unsigned NOT NULL default 0,
self_unreg_allowed tinyint unsigned NOT NULL default 0,

@ -7,7 +7,7 @@
<th width="10" class="fileColumns">&nbsp;</th>
<th class="docName"><?php echo LBL_NAME; ?></th>
<th width="70" class="fileColumns"><?php echo LBL_SIZE; ?></th>
<!-- hidde by now while implementing this dokeos -->
<!-- hide while implementing this Dokeos -->
<!--<th class="fileColumns"><?php // echo LBL_MODIFIED; ?></th> -->
</tr>
</thead>
@ -25,7 +25,7 @@
$strClass = ($file['is_writable']?"left":" leftDisabled");
///First step for hidden some type of Dokeos files and folders
//Juan Carlos Ra<EFBFBD>a
//Juan Carlos Raña
//hidden files and folders deleted by Dokeos. Hidde folders css, hotpotatoes, chat_files
$deleted_by_dokeos_file=' DELETED '; // ' DELETED ' not '_DELETED_' because in $file['name'] _ is replaced with blank see class.manager.php
@ -52,7 +52,7 @@
$shared_folder='shared folder'; //'shared folder' not 'shared_folder' because in $file['name'] _ is replaced with blank see class.manager.php
///Second step: hiding as the case
//Juan Carlos Ra<EFBFBD>a
//Juan Carlos Raña
if((!ereg($deleted_by_dokeos_file, $file['name']) || !ereg($deleted_by_dokeos_folder, $file['path'])) && !ereg($css_folder_dokeos, $file['path']) && !ereg($hotpotatoes_folder_dokeos, $file['path']) && !ereg($chat_files_dokeos, $file['path']) && $show_doc_group==true && $file['name'][0]!='.')
{
@ -62,11 +62,11 @@
?>
<tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" >
<td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?> /></td>
<td align="center" class="fileColumns" id="tdst<?php echo $count; ?>">&nbsp;<a id="a<?php echo $count; ?>" href="<?php echo "../".$file['path']; ?>" target="_blank"><span class="<?php echo $file['cssClass']; ?>">&nbsp;</span></a></td><!-- Juan Carlos Ra<EFBFBD>a Fix for Dokeos: On the path I put a directory up echo "../".$ file [ 'path'], what makes good show when pressed next on window preview, don't only one image -->
<td align="center" class="fileColumns" id="tdst<?php echo $count; ?>">&nbsp;<a id="a<?php echo $count; ?>" href="<?php echo "../".$file['path']; ?>" target="_blank"><span class="<?php echo $file['cssClass']; ?>">&nbsp;</span></a></td><!-- Juan Carlos Raña Fix for Dokeos: On the path I put a directory up echo "../".$ file [ 'path'], what makes good show when pressed next on window preview, don't only one image -->
<td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><a id="aa<?php echo $count; ?>" href="<?php echo "../".$file['path']; ?>" target="_blank"><?php echo $file['name']; ?></a></td>
<td class="docInfo" id="tdrd<?php echo $count; ?>"><?php echo transformFileSize($file['size']); ?></td>
<!-- hidde by now while implementing this dokeos -->
<!-- hide while implementing this Dokeos -->
<!--<td class="docInfo" id="tdth<?php //echo $count; ?>"><?php //echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> -->
</tr>
<?php
@ -98,7 +98,7 @@
<td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><a id="aa<?php echo $count; ?>" href="<?php echo "../".$file['path']; ?>" target="_blank"><?php echo $file['name']; ?></a></td>
<td class="docInfo" id="tdrd<?php echo $count; ?>">&nbsp;</td>
<!-- hidde by now while implementing this dokeos -->
<!-- hide while implementing this Dokeos -->
<!--<td class="docInfo" id="tdth<?php// echo $count; ?>"><?php //echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> -->
</tr>
<?php

@ -214,7 +214,7 @@ $(document).ready(
<div id="header">
<dl id="currentFolderInfo">
<dt><?php echo LBL_CURRENT_FOLDER_PATH; ?></dt>
<dd id="currentFolderPath"><?php echo $folderInfo['path']; ?></dd>
<dt id="currentFolderPath"><?php echo $folderInfo['path']; ?></dt><!-- hack for breadcrumb for Dokeos change <dd> by <dt> -->
</dl>
<div id="viewList">
@ -466,7 +466,7 @@ $(document).ready(
foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
{
if(hideFolderName($k))
if(hideFolderName($k))
{
//shows only those permitted by Dokeos
?>
@ -477,7 +477,8 @@ $(document).ready(
}
?>
</select>
</select>
<?php
}
?></span>
@ -502,10 +503,8 @@ $(document).ready(
</td><td><!--add a col while integratins -->
<b><?php // echo LBL_SEARCH_RECURSIVELY; ?></b>&nbsp;&nbsp;
<!--change for Dokeos recursively by default -->
<input type="radio" name="search_recursively" value="1" id="search_recursively_1" class="radio" <?php echo (empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php //echo LBL_RECURSIVELY_YES; ?>
<!-- <input type="radio" name="search_recursively" value="1" id="search_recursively_1" class="radio" <?php //echo (empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php //echo LBL_RECURSIVELY_YES; ?> -->
<!-- <input type="radio" name="search_recursively" value="0" id="search_recursively_0" class="radio" <?php //echo (!empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php //echo LBL_RECURSIVELY_NO; ?> -->
</td>
</tr>
</tbody>
@ -514,7 +513,7 @@ $(document).ready(
<p class="searchButtons">
<span class="left" id="linkClose" style="display:none">
<!-- comment these lines while integrating into dokeos -->
<!-- comment these lines while integrating into Dokeos -->
<!--<input type="button" value="<?php // echo LBL_ACTION_CLOSE; ?>" onclick="return cancelSelectFile();" class="button"> -->
</span>
<span class="right" id="linkSearch">

@ -195,7 +195,7 @@
define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'fckeditor')); // run mode fckeditor (Dokeos editor)
define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default
define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'thumbnail':'detail')); //thumbnail or detail
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10);
define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10000); //change 10 by 10000 while pagination is deactivated on Dokeos
define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client

@ -140,8 +140,8 @@ return false;}; function getUrl(index,limitNeeded , viewNeeded, searchNeeded)
}
if(typeof(viewNeeded) == 'boolean' && viewNeeded)
{ queryStr += (queryStr == ''?'':'&') + 'view=' + getView(); excluded[excluded.length] = 'view';}
if(typeof(searchNeeded) == 'boolean' && searchNeeded && searchRequired)
{ var search_recursively = 0; $('input[@name=search_recursively][@checked]').each( function()
if(typeof(searchNeeded) == 'boolean' && searchNeeded && searchRequired) // Below a temporal hack for Dokeos, change var search_recursively from = 0 to = 1 while radio button is deactivated into ajaxfilemanager.php Now alltime is recursively
{ var search_recursively = 1; $('input[@name=search_recursively][@checked]').each( function()
{ search_recursively = this.value;} ); var searchFolder = document.getElementById('search_folder'); queryStr += (queryStr == ''?'':'&') + 'search=1&search_name=' + $('#search_name').val() + '&search_recursively=' + search_recursively + '&search_mtime_from=' + $('#search_mtime_from').val() + '&search_mtime_to=' + $('#search_mtime_to').val() + '&search_folder=' + searchFolder.options[searchFolder.selectedIndex].value; excluded[excluded.length] = 'search'; excluded[excluded.length] = 'search_recursively'; excluded[excluded.length] = 'search_mtime_from'; excluded[excluded.length] = 'search_mtime_to'; excluded[excluded.length] = 'search_folder'; excluded[excluded.length] = 'search_name'; excluded[excluded.length] = 'search';}
return appendQueryString(appendQueryString(urls[index], queryString), queryStr, excluded);}; function changeView()
{ var url = getUrl('view', true, true); $('#rightCol').empty(); ajaxStart('#rightCol'); $('#rightCol').load(url, {}, function(){ ajaxStop('#rightCol img.ajaxLoadingImg'); urls.present = getUrl('home', true, true); initAfterListingLoaded();});}; function goParentFolder()

@ -48,6 +48,7 @@ input{ padding: 0; background-color: transparent;}
#wrapper
{
margin: 0px 0px;
margin-top:15px;
min-width:760px;
width:100%;
padding:0px;
@ -58,6 +59,7 @@ position:absolute;
top:60px;
width:100%;
border-color:#0000CC;
margin-top:15px;
}
#leftCol{
background:#e8e8e8;
@ -79,7 +81,7 @@ margin-left: 50%;
margin-top:100px;
}
#content{
margin-left: 200px;
margin-left: 200px;
overflow: auto;
overflow-x: hidden;
max-height:380px;
@ -183,7 +185,6 @@ float:left;
font-size: 14px;
font-weight: bold;
color: #666666;
}
#currentFolderInfo dt{
font-size:12px;

@ -68,6 +68,7 @@ define("GROUP_TOOL_CALENDAR","2");
define("GROUP_TOOL_ANNOUNCEMENT","3");
define("GROUP_TOOL_WORK","4");
define("GROUP_TOOL_WIKI", "5");
define("GROUP_TOOL_CHAT", "6");
/**
* Fixed id's for group categories
@ -226,7 +227,7 @@ class GroupManager {
}
$sql = "INSERT INTO ".$table_group." SET
category_id='".Database::escape_string($category_id)."', max_student = '".$places."', doc_state = '".$category['doc_state']."',
calendar_state = '".$category['calendar_state']."', work_state = '".$category['work_state']."', announcements_state = '".$category['announcements_state']."', forum_state = '".$category['forum_state']."', wiki_state = '".$category['wiki_state']."', self_registration_allowed = '".$category['self_reg_allowed']."', self_unregistration_allowed = '".$category['self_unreg_allowed']."', session_id='".Database::escape_string($my_id_session)."'";
calendar_state = '".$category['calendar_state']."', work_state = '".$category['work_state']."', announcements_state = '".$category['announcements_state']."', forum_state = '".$category['forum_state']."', wiki_state = '".$category['wiki_state']."', chat_state = '".$category['chat_state']."', self_registration_allowed = '".$category['self_reg_allowed']."', self_unregistration_allowed = '".$category['self_unreg_allowed']."', session_id='".Database::escape_string($my_id_session)."'";
Database::query($sql,__FILE__,__LINE__);
$lastId = Database::insert_id();
/*$secret_directory = uniqid("")."_team_".$lastId;
@ -470,6 +471,7 @@ class GroupManager {
$result['announcements_state'] = $db_object->announcements_state;
$result['forum_state'] = $db_object->forum_state;
$result['wiki_state'] = $db_object->wiki_state;
$result['chat_state'] = $db_object->chat_state;
$result['directory'] = $db_object->secret_directory;
$result['self_registration_allowed'] = $db_object->self_registration_allowed;
$result['self_unregistration_allowed'] = $db_object->self_unregistration_allowed;
@ -489,11 +491,12 @@ class GroupManager {
* @param int Announcement tool's visibility (0=none,1=private,2=public)
* @param int Forum tool's visibility (0=none,1=private,2=public)
* @param int Wiki tool's visibility (0=none,1=private,2=public)
* @param int Chat tool's visibility (0=none,1=private,2=public)
* @param bool Whether self registration is allowed or not
* @param bool Whether self unregistration is allowed or not
* @return bool TRUE if properties are successfully changed, false otherwise
*/
public static function set_group_properties ($group_id, $name, $description, $maximum_number_of_students, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state,$wiki_state, $self_registration_allowed, $self_unregistration_allowed) {
public static function set_group_properties ($group_id, $name, $description, $maximum_number_of_students, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state, $wiki_state, $chat_state, $self_registration_allowed, $self_unregistration_allowed) {
$table_group = Database :: get_course_table(TABLE_GROUP);
$table_forum = Database :: get_course_table(TABLE_FORUM);
//$forum_id = get_forums_of_group($group_id);
@ -506,6 +509,7 @@ class GroupManager {
announcements_state = '".Database::escape_string($announcements_state)."',
forum_state = '".Database::escape_string($forum_state)."',
wiki_state = '".Database::escape_string($wiki_state)."',
chat_state = '".Database::escape_string($chat_state)."',
description='".Database::escape_string(trim($description))."',
max_student=".Database::escape_string($maximum_number_of_students).",
self_registration_allowed='".Database::escape_string($self_registration_allowed)."',
@ -642,7 +646,7 @@ class GroupManager {
* @param int $max_number_of_students
* @param int $groups_per_user
*/
public static function create_category ($title, $description, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state, $wiki_state, $self_registration_allowed, $self_unregistration_allowed, $maximum_number_of_students, $groups_per_user) {
public static function create_category ($title, $description, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state, $wiki_state, $chat_state, $self_registration_allowed, $self_unregistration_allowed, $maximum_number_of_students, $groups_per_user) {
$table_group_category = Database :: get_course_table(TABLE_GROUP_CATEGORY);
$sql = "SELECT MAX(display_order)+1 as new_order FROM $table_group_category ";
$res = Database::query($sql,__FILE__,__LINE__);
@ -661,6 +665,7 @@ class GroupManager {
announcements_state = '".Database::escape_string($announcements_state)."',
forum_state = '".Database::escape_string($forum_state)."',
wiki_state = '".Database::escape_string($wiki_state)."',
chat_state = '".Database::escape_string($chat_state)."',
groups_per_user = '".Database::escape_string($groups_per_user)."',
self_reg_allowed = '".Database::escape_string($self_registration_allowed)."',
self_unreg_allowed = '".Database::escape_string($self_unregistration_allowed)."',
@ -686,7 +691,7 @@ class GroupManager {
* @param int $max_number_of_students
* @param int $groups_per_user
*/
public static function update_category ($id, $title, $description, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state, $wiki_state, $self_registration_allowed, $self_unregistration_allowed, $maximum_number_of_students, $groups_per_user) {
public static function update_category ($id, $title, $description, $doc_state, $work_state, $calendar_state, $announcements_state, $forum_state, $wiki_state, $chat_state, $self_registration_allowed, $self_unregistration_allowed, $maximum_number_of_students, $groups_per_user) {
$table_group_category = Database :: get_course_table(TABLE_GROUP_CATEGORY);
$id = Database::escape_string($id);
$sql = "UPDATE ".$table_group_category."
@ -698,6 +703,7 @@ class GroupManager {
announcements_state = '".Database::escape_string($announcements_state)."',
forum_state = '".Database::escape_string($forum_state)."',
wiki_state = '".Database::escape_string($wiki_state)."',
chat_state = '".Database::escape_string($chat_state)."',
groups_per_user = ".Database::escape_string($groups_per_user).",
self_reg_allowed = '".Database::escape_string($self_registration_allowed)."',
self_unreg_allowed = '".Database::escape_string($self_unregistration_allowed)."',
@ -1485,6 +1491,9 @@ class GroupManager {
case GROUP_TOOL_WIKI :
$state_key = 'wiki_state';
break;
case GROUP_TOOL_CHAT :
$state_key = 'chat_state';
break;
default:
return false;
}

@ -57,3 +57,5 @@ ALTER TABLE link_category ADD COLUMN session_id smallint DEFAULT 0, ADD INDEX (s
ALTER TABLE item_property ADD id_session INT NOT NULL DEFAULT 0;
ALTER TABLE item_property DROP INDEX idx_item_property_toolref, ADD INDEX idx_item_property_toolref (tool, ref, id_session);
ALTER TABLE quiz ADD COLUMN expired_time int NOT NULL DEFAULT '0' AFTER feedback_type;
ALTER TABLE group_info ADD COLUMN chat_state TINYINT DEFAULT 1, ADD INDEX (chat_state);
ALTER TABLE group_category ADD COLUMN chat_state TINYINT DEFAULT 1, ADD INDEX (chat_state);

@ -511,8 +511,13 @@ if (!empty ($_GET['student'])) {
$rs = Database::query($sql, __FILE__, __LINE__);
$num_row = Database :: num_rows($rs);
if ($num_row > 0) {
$le_session_id = intval(Database :: result($rs, 0, 0));
if ($le_session_id > 0) {
// get session name and coach of the session
$sql = 'SELECT name, id_coach FROM ' . $tbl_session . '
WHERE id=' . $le_session_id;
@ -521,16 +526,35 @@ if (!empty ($_GET['student'])) {
$session_coach_id = intval(Database :: result($rs, 0, 'id_coach'));
// get coach of the course in the session
$sql = 'SELECT id_user FROM ' . $tbl_session_course_user . '
WHERE id_session=' . $le_session_id . '
AND course_code = "' . Database :: escape_string($_GET['course']) . '" AND status=2';
/*
$sql = 'SELECT id_coach FROM ' . $tbl_session_course . '
WHERE id_session=' . $le_session_id . '
AND course_code = "' . Database :: escape_string($_GET['course']) . '"';
*/
$rs = Database::query($sql, __FILE__, __LINE__);
$session_course_coach_id = intval(Database :: result($rs, 0, 0));
//$session_course_coach_id = intval(Database :: result($rs, 0, 0));
$course_coachs = array();
while ($row_coachs = Database::fetch_array($rs)) {
$course_coachs[] = $row_coachs['id_user'];
}
if ($session_course_coach_id != 0) {
if (!empty($course_coachs)) {
$info_tutor_name = array();
foreach ($course_coachs as $course_coach) {
$coach_infos = UserManager :: get_user_info_by_id($course_coach);
$info_tutor_name[] = api_get_person_name($coach_infos['firstname'], $coach_infos['lastname']);
}
$info_course['tutor_name'] = implode(",",$info_tutor_name);
}
/*if ($session_course_coach_id != 0) {
$coach_infos = UserManager :: get_user_info_by_id($session_course_coach_id);
$info_course['tutor_name'] = api_get_person_name($coach_infos['firstname'], $coach_infos['lastname']);
}
}*/
elseif ($session_coach_id != 0) {
$coach_infos = UserManager :: get_user_info_by_id($session_coach_id);
$info_course['tutor_name'] = api_get_person_name($coach_infos['firstname'], $coach_infos['lastname']);

Loading…
Cancel
Save