skala
Julio Montoya 16 years ago
commit 5d11e0eb60
  1. 2
      main/admin/add_many_session_to_category.php
  2. 3
      main/admin/session_category_edit.php
  3. 4
      main/admin/session_course_edit.php
  4. 2
      main/admin/session_course_list.php
  5. 4
      main/admin/session_course_user_list.php
  6. 6
      main/admin/session_list.php
  7. 2
      main/coursecopy/copy_course_session.php
  8. 2
      main/inc/lib/add_course.lib.inc.php
  9. 30
      main/mySpace/course.php
  10. 6
      main/mySpace/myStudents.php
  11. 3
      main/mySpace/session.php
  12. 31
      main/mySpace/student.php
  13. 1
      main/mySpace/teachers.php
  14. 2
      main/tracking/courseLog.php

@ -50,7 +50,7 @@ if(isset($_GET['add_type']) && $_GET['add_type']!=''){
$add_type = Security::remove_XSS($_REQUEST['add_type']); $add_type = Security::remove_XSS($_REQUEST['add_type']);
} }
if (!api_is_platform_admin()) { if (!api_is_platform_admin() && !api_is_session_admin()) {
$sql = 'SELECT session_admin_id FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).' WHERE id='.$id_session; $sql = 'SELECT session_admin_id FROM '.Database :: get_main_table(TABLE_MAIN_SESSION).' WHERE id='.$id_session;
$rs = Database::query($sql); $rs = Database::query($sql);
if (Database::result($rs,0,0)!=$_user['user_id']) { if (Database::result($rs,0,0)!=$_user['user_id']) {

@ -45,9 +45,10 @@ if (!$infos=Database::fetch_array($result)) {
list($year_start,$month_start,$day_start)=explode('-',$infos['date_start']); list($year_start,$month_start,$day_start)=explode('-',$infos['date_start']);
list($year_end,$month_end,$day_end)=explode('-',$infos['date_end']); list($year_end,$month_end,$day_end)=explode('-',$infos['date_end']);
if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id']) { if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id'] && !api_is_session_admin()) {
api_not_allowed(true); api_not_allowed(true);
} }
if ($_POST['formSent']) { if ($_POST['formSent']) {
$formSent=1; $formSent=1;
$name= $_POST['name']; $name= $_POST['name'];

@ -12,9 +12,9 @@ $cidReset=true;
require '../inc/global.inc.php'; require '../inc/global.inc.php';
require_once '../inc/lib/sessionmanager.lib.php'; require_once '../inc/lib/sessionmanager.lib.php';
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section=SECTION_PLATFORM_ADMIN; /*$this_section=SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script();*/
$id_session=intval($_GET['id_session']); $id_session=intval($_GET['id_session']);
$course_code=trim(stripslashes($_GET['course_code'])); $course_code=trim(stripslashes($_GET['course_code']));

@ -15,7 +15,7 @@ include('../inc/global.inc.php');
// setting the section (for the tabs) // setting the section (for the tabs)
$this_section=SECTION_PLATFORM_ADMIN; $this_section=SECTION_PLATFORM_ADMIN;
api_protect_admin_script(); api_protect_admin_script(true);
// Database Table Definitions // Database Table Definitions
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);

@ -9,7 +9,7 @@
$language_file='admin'; $language_file='admin';
$cidReset=true; $cidReset=true;
include('../inc/global.inc.php'); include('../inc/global.inc.php');
api_protect_admin_script(); api_protect_admin_script(true);
$tbl_user=Database::get_main_table(TABLE_MAIN_USER); $tbl_user=Database::get_main_table(TABLE_MAIN_USER);
$tbl_course=Database::get_main_table(TABLE_MAIN_COURSE); $tbl_course=Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session=Database::get_main_table(TABLE_MAIN_SESSION); $tbl_session=Database::get_main_table(TABLE_MAIN_SESSION);
@ -57,7 +57,7 @@ $limit=20;
$from=$page * $limit; $from=$page * $limit;
$is_western_name_order = api_is_western_name_order(); $is_western_name_order = api_is_western_name_order();
$result=Database::query("SELECT user_id,".($is_western_name_order ? 'firstname,lastname' : 'lastname,firstname').",username FROM $tbl_session_rel_course_rel_user,$tbl_user WHERE user_id=id_user AND id_session='$id_session' AND course_code='".addslashes($course_code)."' ORDER BY $sort LIMIT $from,".($limit+1)); $result=Database::query("SELECT u.user_id,".($is_western_name_order ? 'u.firstname, u.lastname' : 'u.lastname, u.firstname').", u.username FROM $tbl_session_rel_course_rel_user scru, $tbl_user u WHERE u.user_id=scru.id_user AND scru.id_session='$id_session' AND scru.status<>2 AND scru.course_code='".addslashes($course_code)."' ORDER BY $sort LIMIT $from,".($limit+1));
$Users=Database::store_result($result); $Users=Database::store_result($result);
$nbr_results=sizeof($Users); $nbr_results=sizeof($Users);

@ -137,6 +137,11 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
$cond_url.= '&amp;id_category='.$id_category; $cond_url.= '&amp;id_category='.$id_category;
} }
$user_id= $_user['user_id'];
if (api_is_session_admin()==true) {
$where.=" AND s.session_admin_id = $user_id ";
}
//Get list sessions //Get list sessions
$sort = ($sort != "name_category")? 's.'.$sort : 'category_name'; $sort = ($sort != "name_category")? 's.'.$sort : 'category_name';
$query = "SELECT s.id, s.name, s.nbr_courses, s.date_start, s.date_end, u.firstname, u.lastname , sc.name as category_name, s.visibility $query = "SELECT s.id, s.name, s.nbr_courses, s.date_start, s.date_end, u.firstname, u.lastname , sc.name as category_name, s.visibility
@ -175,6 +180,7 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
} }
} }
$result_rows = Database::query($query_rows); $result_rows = Database::query($query_rows);
$recorset = Database::fetch_array($result_rows); $recorset = Database::fetch_array($result_rows);
$num = $recorset['total_rows']; $num = $recorset['total_rows'];

@ -26,7 +26,7 @@ require_once '../inc/lib/xajax/xajax.inc.php';
$xajax = new xajax(); $xajax = new xajax();
$xajax -> registerFunction('search_courses'); $xajax -> registerFunction('search_courses');
if (!api_is_allowed_to_edit()) { if (!api_is_allowed_to_edit() && !api_is_session_admin()) {
api_not_allowed(true); api_not_allowed(true);
} }

@ -2115,7 +2115,7 @@ function fill_Db_course($courseDbName, $courseRepository, $language,$default_doc
Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_GRADEBOOK."','gradebook/index.php','gradebook.gif','".string2binary(api_get_setting('course_create_active_tools', 'gradebook')). "','0','squaregrey.gif','NO','_self','authoring','0')"); Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_GRADEBOOK."','gradebook/index.php','gradebook.gif','".string2binary(api_get_setting('course_create_active_tools', 'gradebook')). "','0','squaregrey.gif','NO','_self','authoring','0')");
Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_GLOSSARY."','glossary/index.php','glossary.gif','".string2binary(api_get_setting('course_create_active_tools', 'glossary')). "','0','squaregrey.gif','NO','_self','authoring','0')"); Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_GLOSSARY."','glossary/index.php','glossary.gif','".string2binary(api_get_setting('course_create_active_tools', 'glossary')). "','0','squaregrey.gif','NO','_self','authoring','0')");
Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_NOTEBOOK."','notebook/index.php','notebook.gif','".string2binary(api_get_setting('course_create_active_tools', 'notebook'))."','0','squaregrey.gif','NO','_self','interaction','0')"); Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_NOTEBOOK."','notebook/index.php','notebook.gif','".string2binary(api_get_setting('course_create_active_tools', 'notebook'))."','0','squaregrey.gif','NO','_self','interaction','0')");
Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_ATTENDANCE."','attendance/index.php','attendance.gif','".string2binary(api_get_setting('course_create_active_tools', 'attendances'))."','0','squaregrey.gif','NO','_self','interaction','0')"); Database::query("INSERT INTO `" . $tbl_course_homepage . "` VALUES (NULL, '" . TOOL_ATTENDANCE."','attendance/index.php','attendance.gif','".string2binary(api_get_setting('course_create_active_tools', 'attendances'))."','0','squaregrey.gif','NO','_self','authoring','0')");
if(api_get_setting('service_visio','active')=='true') if(api_get_setting('service_visio','active')=='true')
{ {
$mycheck = api_get_setting('service_visio','visio_host'); $mycheck = api_get_setting('service_visio','visio_host');

@ -62,11 +62,33 @@ Display :: display_header($nameTools);
$a_courses = array(); $a_courses = array();
if (api_is_drh()) { if (api_is_drh()) {
$a_courses = array_keys(CourseManager::get_courses_followed_by_drh($_user['user_id'])); $title = '';
if (empty($id_session)) {
if (isset($_GET['user_id'])) {
$user_id = intval($_GET['user_id']);
$user_info = api_get_user_info($user_id);
$title = get_lang('AssignedCoursesTo').' '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
$courses = CourseManager::get_course_list_of_user_as_course_admin($user_id);
} else {
$title = get_lang('YourCourseList');
$courses = CourseManager::get_courses_followed_by_drh($_user['user_id']);
}
} else {
$session_name = api_get_session_name($id_session);
$title = api_htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession');
$courses = Tracking::get_courses_list_from_session($id_session);
}
$a_courses = array_keys($courses);
$menu_items[] = '<a href="index.php?view=drh_students">'.get_lang('Students').'</a>'; $menu_items[] = '<a href="index.php?view=drh_students">'.get_lang('Students').'</a>';
$menu_items[] = '<a href="teachers.php">'.get_lang('Teachers').'</a>'; $menu_items[] = '<a href="teachers.php">'.get_lang('Teachers').'</a>';
$menu_items[] = get_lang('Courses');
if (empty($_GET['user_id']) && empty($id_session)) {
$menu_items[] = get_lang('Courses');
} else {
$menu_items[] = '<a href="course.php">'.get_lang('Courses').'</a>';
}
$menu_items[] = '<a href="session.php">'.get_lang('Sessions').'</a>'; $menu_items[] = '<a href="session.php">'.get_lang('Sessions').'</a>';
echo '<div class="actions-title" style ="font-size:10pt;">'; echo '<div class="actions-title" style ="font-size:10pt;">';
@ -83,7 +105,7 @@ if (api_is_drh()) {
echo '&nbsp;&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a> '; echo '&nbsp;&nbsp;<a href="javascript: void(0);" onclick="javascript: window.print()"><img align="absbottom" src="../img/printmgr.gif">&nbsp;'.get_lang('Print').'</a> ';
} }
echo '</div>'; echo '</div>';
echo '<br />'; echo '<h4>'.$title.'</h4>';
} }
// Database Table Definitions // Database Table Definitions
@ -156,7 +178,7 @@ if (is_array($a_courses)) {
$avg_assignments_in_course = $avg_messages_in_course = $avg_progress_in_course = $avg_score_in_course = $avg_time_spent_in_course = 0; $avg_assignments_in_course = $avg_messages_in_course = $avg_progress_in_course = $avg_score_in_course = $avg_time_spent_in_course = 0;
// students directly subscribed to the course // students directly subscribed to the course
if (empty($session_id)) { if (empty($id_session)) {
$sql = "SELECT user_id FROM $tbl_user_course as course_rel_user WHERE course_rel_user.status='5' AND course_rel_user.course_code='$course_code'"; $sql = "SELECT user_id FROM $tbl_user_course as course_rel_user WHERE course_rel_user.status='5' AND course_rel_user.course_code='$course_code'";
} else { } else {
$sql = "SELECT id_user as user_id FROM $tbl_session_course_user srcu WHERE srcu. course_code='$course_code' AND id_session = '$id_session' AND srcu.status<>2"; $sql = "SELECT id_user as user_id FROM $tbl_session_course_user srcu WHERE srcu. course_code='$course_code' AND id_session = '$id_session' AND srcu.status<>2";

@ -7,7 +7,7 @@
*/ */
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = array('registration', 'index', 'tracking', 'exercice', 'admin'); $language_file = array('registration', 'index', 'tracking', 'exercice', 'admin', 'gradebook');
require '../inc/global.inc.php'; require '../inc/global.inc.php';
@ -892,7 +892,7 @@ if ($timezone !== null) {
get_lang('Time', ''), get_lang('Time', ''),
get_lang('Progress', ''), get_lang('Progress', ''),
get_lang('Score', ''), get_lang('Score', ''),
get_lang('AttendanceFaults', ''), get_lang('AttendancesFaults', ''),
get_lang('Evaluations') get_lang('Evaluations')
); );
@ -933,7 +933,7 @@ if ($timezone !== null) {
<th>'.get_lang('Time').'</th> <th>'.get_lang('Time').'</th>
<th>'.get_lang('Progress').'</th> <th>'.get_lang('Progress').'</th>
<th>'.get_lang('Score').'</th> <th>'.get_lang('Score').'</th>
<th>'.get_lang('AttendanceFaults').'</th> <th>'.get_lang('AttendancesFaults').'</th>
<th>'.get_lang('Evaluations').'</th> <th>'.get_lang('Evaluations').'</th>
<th>'.get_lang('Details').'</th> <th>'.get_lang('Details').'</th>
</tr>'; </tr>';

@ -7,7 +7,7 @@
ob_start(); ob_start();
$nameTools= 'Sessions'; $nameTools= 'Sessions';
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = array ('registration', 'index', 'trad4all', 'tracking'); $language_file = array ('registration', 'index', 'trad4all', 'tracking', 'admin');
$cidReset = true; $cidReset = true;
require '../inc/global.inc.php'; require '../inc/global.inc.php';
@ -102,6 +102,7 @@ if (api_is_drh()) {
echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>'; echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
} }
echo '</div>'; echo '</div>';
echo '<h4>'.get_lang('YourSessionsList').'</h4>';
} else { } else {
if (api_is_platform_admin()) { if (api_is_platform_admin()) {

@ -5,7 +5,7 @@
*/ */
// name of the language file that needs to be included // name of the language file that needs to be included
$language_file = array ('registration', 'index', 'tracking'); $language_file = array ('registration', 'index', 'tracking', 'admin');
$cidReset = true; $cidReset = true;
require '../inc/global.inc.php'; require '../inc/global.inc.php';
@ -106,8 +106,30 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
if (api_is_drh()) { if (api_is_drh()) {
$title = get_lang('YourStudents');
if (!isset($_GET['id_session'])) { if (!isset($_GET['id_session'])) {
$students = array_keys(UserManager::get_users_followed_by_drh($_user['user_id'], STUDENT));
if (isset($_GET['user_id'])) {
$user_id = intval($_GET['user_id']);
$user_info = api_get_user_info($user_id);
$title = api_get_person_name($user_info['firstname'], $user_info['lastname']).' : '.get_lang('Students');
$courses_by_teacher = CourseManager::get_course_list_of_user_as_course_admin($user_id);
$students_by_course = array();
if (!empty($courses_by_teacher)) {
foreach ($courses_by_teacher as $course) {
$students_by_course = array_keys(CourseManager::get_student_list_from_course_code($course['course_code']));
if (count($students_by_course) > 0) {
foreach ($students_by_course as $student_by_course) {
$students[] = $student_by_course;
}
}
}
}
$students = array_unique($students);
} else {
$students = array_keys(UserManager::get_users_followed_by_drh($_user['user_id'], STUDENT));
}
$courses_of_the_platform = CourseManager :: get_real_course_list(); $courses_of_the_platform = CourseManager :: get_real_course_list();
foreach ($courses_of_the_platform as $course) { foreach ($courses_of_the_platform as $course) {
$courses[$course['code']] = $course['code']; $courses[$course['code']] = $course['code'];
@ -134,7 +156,10 @@ if ($isCoach || api_is_platform_admin() || api_is_drh()) {
echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>'; echo '<a href="'.api_get_self().'?export=csv"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsCSV').'</a>';
} }
echo '</div>'; echo '</div>';
echo '<h4>'.get_lang('YourStudentsList').'</h4>';
echo '<h4>'.$title.'</h4>';
} else { } else {
echo '<div align="left" style="float:left"><h4>'.$title.'</h4></div> echo '<div align="left" style="float:left"><h4>'.$title.'</h4></div>
<div align="right"> <div align="right">

@ -49,6 +49,7 @@ if (api_is_drh()) {
echo '<a href="'.api_get_self().'?export=xls"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsXLS').'</a>'; echo '<a href="'.api_get_self().'?export=xls"><img align="absbottom" src="../img/excel.gif">&nbsp;'.get_lang('ExportAsXLS').'</a>';
} }
echo '</div>'; echo '</div>';
echo '<h4>'.get_lang('YourTeachers').'</h4>';
echo '<br />'; echo '<br />';
} }

@ -37,7 +37,7 @@ if (isset($_GET['from']) && $_GET['from'] == 'myspace') {
// access restrictions // access restrictions
$is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || $is_courseCoach || $is_sessionAdmin || api_is_drh(); $is_allowedToTrack = $is_courseAdmin || $is_platformAdmin || $is_courseCoach || $is_sessionAdmin || api_is_drh();
if (!$is_allowedToTrack) { if (!$is_allowedToTrack && !api_is_session_admin()) {
Display :: display_header(null); Display :: display_header(null);
api_not_allowed(); api_not_allowed();
Display :: display_footer(); Display :: display_footer();

Loading…
Cancel
Save