Scrutinizer Auto-Fixes

This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
pull/2487/head
Scrutinizer Auto-Fixer 9 years ago
parent a699a9f0a4
commit b3ec3c22f6
  1. 60
      main/admin/access_url_add_users_to_url.php
  2. 26
      main/dashboard/dashboard.php
  3. 24
      main/document/slideshow.inc.php
  4. 2
      main/forum/viewforumcategory.php
  5. 4
      main/forum/viewthread_threaded.inc.php
  6. 18
      main/gradebook/gradebook_display_certificate.php
  7. 24
      main/gradebook/lib/be/gradebookitem.class.php
  8. 124
      main/mySpace/coaches.php
  9. 182
      main/reports/templates/courseArticulate.reports.php
  10. 8
      main/session/add_many_session_to_category.php
  11. 14
      main/session/add_teachers_to_session.php
  12. 40
      main/session/resume_session.php
  13. 10
      main/session/session_category_edit.php
  14. 72
      main/session/session_course_edit.php
  15. 52
      main/session/session_course_list.php
  16. 14
      main/session/session_course_user_list.php
  17. 2
      main/social/vcard_export.php
  18. 6
      main/survey/reporting.php
  19. 20
      main/survey/survey.lib.php
  20. 2
      main/timeline/index.php
  21. 8
      src/Chamilo/CoreBundle/Component/Editor/Connector.php
  22. 4
      src/Chamilo/CoreBundle/Component/Editor/Driver/DropBoxDriver.php
  23. 4
      src/Chamilo/CoreBundle/Component/Editor/TinyMce/Toolbar/Basic.php
  24. 14
      src/Chamilo/CoreBundle/Component/Filesystem/Data.php
  25. 1
      src/Chamilo/CoreBundle/Entity/AccessUrlRelUserGroup.php
  26. 22
      src/Chamilo/CoreBundle/Entity/ExtraFieldOptionRelFieldOption.php
  27. 14
      src/Chamilo/CoreBundle/Entity/ExtraFieldValues.php
  28. 2
      src/Chamilo/CoreBundle/Entity/Repository/SequenceRepository.php

@ -13,8 +13,8 @@ $this_section = SECTION_PLATFORM_ADMIN;
api_protect_global_admin_script(); api_protect_global_admin_script();
if (!api_get_multiple_access_url()) { if (!api_get_multiple_access_url()) {
header('Location: index.php'); header('Location: index.php');
exit; exit;
} }
$form_sent = 0; $form_sent = 0;
@ -44,36 +44,36 @@ echo '</div>';
api_display_tool_title($tool_name); api_display_tool_title($tool_name);
if ($_POST['form_sent']) { if ($_POST['form_sent']) {
$form_sent = $_POST['form_sent']; $form_sent = $_POST['form_sent'];
$users = is_array($_POST['user_list']) ? $_POST['user_list'] : array() ; $users = is_array($_POST['user_list']) ? $_POST['user_list'] : array() ;
$url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ; $url_list = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ;
$first_letter_user = $_POST['first_letter_user']; $first_letter_user = $_POST['first_letter_user'];
foreach($users as $key => $value) { foreach($users as $key => $value) {
$users[$key] = intval($value); $users[$key] = intval($value);
} }
if ($form_sent == 1) { if ($form_sent == 1) {
if (count($users) == 0 || count($url_list) == 0) { if (count($users) == 0 || count($url_list) == 0) {
Display :: display_error_message(get_lang('AtLeastOneUserAndOneURL')); Display :: display_error_message(get_lang('AtLeastOneUserAndOneURL'));
} else { } else {
UrlManager::add_users_to_urls($users,$url_list); UrlManager::add_users_to_urls($users,$url_list);
Display :: display_confirmation_message(get_lang('UsersBelongURL')); Display :: display_confirmation_message(get_lang('UsersBelongURL'));
} }
} }
} }
/* Display GUI */ /* Display GUI */
if (empty($first_letter_user)) { if (empty($first_letter_user)) {
$sql = "SELECT count(*) as nb_users FROM $tbl_user"; $sql = "SELECT count(*) as nb_users FROM $tbl_user";
$result = Database::query($sql); $result = Database::query($sql);
$num_row = Database::fetch_array($result); $num_row = Database::fetch_array($result);
if ($num_row['nb_users']>1000) { if ($num_row['nb_users']>1000) {
//if there are too much users to gracefully handle with the HTML select list, //if there are too much users to gracefully handle with the HTML select list,
// assign a default filter on users names // assign a default filter on users names
$first_letter_user = 'A'; $first_letter_user = 'A';
} }
unset($result); unset($result);
} }
$first_letter_user_lower = Database::escape_string(api_strtolower($first_letter_user)); $first_letter_user_lower = Database::escape_string(api_strtolower($first_letter_user));
@ -104,7 +104,7 @@ unset($result);
<option value="">--</option> <option value="">--</option>
<?php <?php
echo Display :: get_alphabet_options($first_letter_user); echo Display :: get_alphabet_options($first_letter_user);
?> ?>
</select> </select>
</td> </td>
<td width="20%">&nbsp;</td> <td width="20%">&nbsp;</td>
@ -116,14 +116,14 @@ unset($result);
<td width="40%" align="center"> <td width="40%" align="center">
<select name="user_list[]" multiple="multiple" size="20" style="width:380px;"> <select name="user_list[]" multiple="multiple" size="20" style="width:380px;">
<?php <?php
foreach ($db_users as $user) { foreach ($db_users as $user) {
?> ?>
<option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>> <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>>
<?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?> <?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?>
</option> </option>
<?php <?php
} }
?> ?>
</select> </select>
</td> </td>
<td width="20%" valign="middle" align="center"> <td width="20%" valign="middle" align="center">
@ -132,14 +132,14 @@ unset($result);
<td width="40%" align="center"> <td width="40%" align="center">
<select name="url_list[]" multiple="multiple" size="20" style="width:230px;"> <select name="url_list[]" multiple="multiple" size="20" style="width:230px;">
<?php <?php
foreach ($db_urls as $url_obj) { foreach ($db_urls as $url_obj) {
?> ?>
<option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>> <option value="<?php echo $url_obj['id']; ?>" <?php if(in_array($url_obj['id'],$url_list)) echo 'selected="selected"'; ?>>
<?php echo $url_obj['url']; ?> <?php echo $url_obj['url']; ?>
</option> </option>
<?php <?php
} }
?> ?>
</select> </select>
</td> </td>
</tr> </tr>

@ -14,23 +14,23 @@ api_block_anonymous_users();
$views = array('blocks', 'list'); $views = array('blocks', 'list');
if(isset($_GET['view']) && in_array($_GET['view'], $views)){ if(isset($_GET['view']) && in_array($_GET['view'], $views)){
$dashboard_view = $_GET['view']; $dashboard_view = $_GET['view'];
} }
$link_blocks_view = $link_list_view = null; $link_blocks_view = $link_list_view = null;
if (isset($dashboard_view) && $dashboard_view == 'list') { if (isset($dashboard_view) && $dashboard_view == 'list') {
$link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'. $link_blocks_view = '<a href="'.api_get_self().'?view=blocks">'.
Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('blocks.png',get_lang('DashboardBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
} else { } else {
$link_list_view = '<a href="'.api_get_self().'?view=list">'. $link_list_view = '<a href="'.api_get_self().'?view=list">'.
Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('edit.png',get_lang('EditBlocks'),'',ICON_SIZE_MEDIUM).'</a>';
} }
$configuration_link = null; $configuration_link = null;
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
$configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">' $configuration_link = '<a href="'.api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins">'
.Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>'; .Display::return_icon('settings.png',get_lang('ConfigureDashboardPlugin'),'',ICON_SIZE_MEDIUM).'</a>';
} }
echo '<div class="actions">'; echo '<div class="actions">';
@ -87,10 +87,10 @@ if (isset($dashboard_view) && $dashboard_view == 'blocks') {
} }
} else { } else {
// block dashboard list // block dashboard list
if (isset($success)) { if (isset($success)) {
Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully')); Display::display_confirmation_message(get_lang('BlocksHaveBeenUpdatedSuccessfully'));
} }
$user_id = api_get_user_id(); $user_id = api_get_user_id();
DashboardManager::display_user_dashboard_list($user_id); DashboardManager::display_user_dashboard_list($user_id);
} }

@ -15,8 +15,6 @@
This file has two large sections. This file has two large sections.
1. code that belongs in document.php, but to avoid clutter I put the code here 1. code that belongs in document.php, but to avoid clutter I put the code here
2. the function resize_image that handles the image resizing 2. the function resize_image that handles the image resizing
* @author Patrick Cool * @author Patrick Cool
* @package chamilo.document * @package chamilo.document
* @todo convert comments to be understandable to phpDocumentor * @todo convert comments to be understandable to phpDocumentor
@ -34,16 +32,16 @@
* view is also possible when you choose not to resize the source images * view is also possible when you choose not to resize the source images
*/ */
function resize_image($image, $target_width, $target_height, $slideshow = 0) { function resize_image($image, $target_width, $target_height, $slideshow = 0) {
// Modifications by Ivan Tcholakov, 04-MAY-2009. // Modifications by Ivan Tcholakov, 04-MAY-2009.
$result = array(); $result = array();
if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) { if ( (isset($_SESSION['image_resizing']) && $_SESSION['image_resizing']== 'resizing') or $slideshow == 1) {
$new_sizes = api_resize_image($image, $target_width, $target_height); $new_sizes = api_resize_image($image, $target_width, $target_height);
$result[] = $new_sizes['height']; $result[] = $new_sizes['height'];
$result[] = $new_sizes['width']; $result[] = $new_sizes['width'];
} else { } else {
$size = api_getimagesize($image); $size = api_getimagesize($image);
$result[] = $size['height']; $result[] = $size['height'];
$result[] = $size['width']; $result[] = $size['width'];
} }
return $result; return $result;
} }

@ -503,7 +503,7 @@ if ($action_forums != 'add') {
$html .= '</div>'; $html .= '</div>';
$html .= '</div></div>'; $html .= '</div></div>';
} }
echo $html; echo $html;
} }
} }
if (count($forum_list) == 0) { if (count($forum_list) == 0) {

@ -457,8 +457,8 @@ if (!empty($attachment_list) && is_array($attachment_list)) {
// The post has been displayed => it can be removed from the what's new array // The post has been displayed => it can be removed from the what's new array
if (isset($whatsnew_post_info[$forumId][$threadId][$row['post_id']])) { if (isset($whatsnew_post_info[$forumId][$threadId][$row['post_id']])) {
unset($whatsnew_post_info[$forumId][$threadId][$row['post_id']]); unset($whatsnew_post_info[$forumId][$threadId][$row['post_id']]);
unset($_SESSION['whatsnew_post_info'][$forumId][$threadId][$row['post_id']]); unset($_SESSION['whatsnew_post_info'][$forumId][$threadId][$row['post_id']]);
} }
echo "</table>"; echo "</table>";

@ -162,17 +162,17 @@ if ($filter === 'true') {
if ($form->validate()) { if ($form->validate()) {
$officialCode = $form->getSubmitValue('filter'); $officialCode = $form->getSubmitValue('filter');
if ($officialCode == 'all') { if ($officialCode == 'all') {
$certificate_list = GradebookUtils::get_list_users_certificates($cat_id); $certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
} else { } else {
$userList = UserManager::getUsersByOfficialCode($officialCode); $userList = UserManager::getUsersByOfficialCode($officialCode);
if (!empty($userList)) { if (!empty($userList)) {
$certificate_list = GradebookUtils::get_list_users_certificates( $certificate_list = GradebookUtils::get_list_users_certificates(
$cat_id, $cat_id,
$userList $userList
); );
} }
} }
} else { } else {
$certificate_list = GradebookUtils::get_list_users_certificates($cat_id); $certificate_list = GradebookUtils::get_list_users_certificates($cat_id);
} }

@ -8,16 +8,16 @@
*/ */
interface GradebookItem interface GradebookItem
{ {
public function get_item_type(); public function get_item_type();
public function get_id(); public function get_id();
public function get_name(); public function get_name();
public function get_description(); public function get_description();
public function get_course_code(); public function get_course_code();
public function get_weight(); public function get_weight();
public function get_date(); public function get_date();
public function is_visible(); public function is_visible();
public function get_icon_name(); public function get_icon_name();
public function getStudentList(); public function getStudentList();
public function setStudentList($list); public function setStudentList($list);
public function calc_score($stud_id = null, $type = null); public function calc_score($stud_id = null, $type = null);
} }

@ -41,26 +41,26 @@ $tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
*/ */
if (isset($_POST['export'])) { if (isset($_POST['export'])) {
$order_clause = api_is_western_name_order(PERSON_NAME_DATA_EXPORT) ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname'; $order_clause = api_is_western_name_order(PERSON_NAME_DATA_EXPORT) ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
} else { } else {
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname'; $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname' : ' ORDER BY lastname, firstname';
} }
if (isset($_GET["id_student"])) { if (isset($_GET["id_student"])) {
$id_student = intval($_GET["id_student"]); $id_student = intval($_GET["id_student"]);
$sql_coachs = "SELECT DISTINCT srcru.user_id as id_coach $sql_coachs = "SELECT DISTINCT srcru.user_id as id_coach
FROM $tbl_session_rel_course_rel_user as srcru FROM $tbl_session_rel_course_rel_user as srcru
WHERE srcru.user_id='$id_student' AND srcru.status=2"; WHERE srcru.user_id='$id_student' AND srcru.status=2";
} else { } else {
if (api_is_platform_admin()) { if (api_is_platform_admin()) {
$sql_coachs = "SELECT DISTINCT $sql_coachs = "SELECT DISTINCT
srcru.user_id as id_coach, user_id, lastname, firstname srcru.user_id as id_coach, user_id, lastname, firstname
FROM $tbl_user, $tbl_session_rel_course_rel_user srcru FROM $tbl_user, $tbl_session_rel_course_rel_user srcru
WHERE WHERE
srcru.user_id=user_id AND srcru.user_id=user_id AND
srcru.status=2 ".$order_clause; srcru.status=2 ".$order_clause;
} else { } else {
$sql_coachs = "SELECT DISTINCT user_id as id_coach, user.user_id, lastname, firstname $sql_coachs = "SELECT DISTINCT user_id as id_coach, user.user_id, lastname, firstname
FROM FROM
$tbl_user as user, $tbl_user as user,
$tbl_session_rel_course_user as srcu, $tbl_session_rel_course_user as srcu,
@ -74,13 +74,13 @@ if (isset($_GET["id_student"])) {
srcu.user_id = user.user_id AND srcu.user_id = user.user_id AND
srcu.status = 2 srcu.status = 2
".$order_clause; ".$order_clause;
} }
} }
$result_coachs = Database::query($sql_coachs); $result_coachs = Database::query($sql_coachs);
if (api_is_western_name_order()) { if (api_is_western_name_order()) {
echo '<table class="data_table"> echo '<table class="data_table">
<tr> <tr>
<th>'.get_lang('FirstName').'</th> <th>'.get_lang('FirstName').'</th>
<th>'.get_lang('LastName').'</th> <th>'.get_lang('LastName').'</th>
@ -89,7 +89,7 @@ if (api_is_western_name_order()) {
<th>'.get_lang('Students').'</th> <th>'.get_lang('Students').'</th>
</tr>'; </tr>';
} else { } else {
echo '<table class="data_table"> echo '<table class="data_table">
<tr> <tr>
<th>'.get_lang('LastName').'</th> <th>'.get_lang('LastName').'</th>
<th>'.get_lang('FirstName').'</th> <th>'.get_lang('FirstName').'</th>
@ -100,79 +100,79 @@ if (api_is_western_name_order()) {
} }
if (api_is_western_name_order(PERSON_NAME_DATA_EXPORT)) { if (api_is_western_name_order(PERSON_NAME_DATA_EXPORT)) {
$header[] = get_lang('FirstName', ''); $header[] = get_lang('FirstName', '');
$header[] = get_lang('LastName', ''); $header[] = get_lang('LastName', '');
} else { } else {
$header[] = get_lang('LastName', ''); $header[] = get_lang('LastName', '');
$header[] = get_lang('FirstName', ''); $header[] = get_lang('FirstName', '');
} }
$header[] = get_lang('ConnectionTime', ''); $header[] = get_lang('ConnectionTime', '');
if (Database::num_rows($result_coachs) > 0) { if (Database::num_rows($result_coachs) > 0) {
while ($coachs = Database::fetch_array($result_coachs)) { while ($coachs = Database::fetch_array($result_coachs)) {
$id_coach = $coachs["id_coach"]; $id_coach = $coachs["id_coach"];
if (isset($_GET["id_student"])) { if (isset($_GET["id_student"])) {
$sql_infos_coach = "SELECT lastname, firstname $sql_infos_coach = "SELECT lastname, firstname
FROM $tbl_user FROM $tbl_user
WHERE user_id='$id_coach'"; WHERE user_id='$id_coach'";
$result_coachs_infos = Database::query($sql_infos_coach); $result_coachs_infos = Database::query($sql_infos_coach);
$lastname = Database::result($result_coachs_infos, 0, "lastname"); $lastname = Database::result($result_coachs_infos, 0, "lastname");
$firstname = Database::result($result_coachs_infos, 0, "firstname"); $firstname = Database::result($result_coachs_infos, 0, "firstname");
} else { } else {
$lastname = $coachs["lastname"]; $lastname = $coachs["lastname"];
$firstname = $coachs["firstname"]; $firstname = $coachs["firstname"];
} }
$sql_connection_time = "SELECT login_date, logout_date $sql_connection_time = "SELECT login_date, logout_date
FROM $tbl_track_login FROM $tbl_track_login
WHERE login_user_id ='$id_coach' AND logout_date <> 'null'"; WHERE login_user_id ='$id_coach' AND logout_date <> 'null'";
$result_connection_time = Database::query($sql_connection_time); $result_connection_time = Database::query($sql_connection_time);
$nb_seconds = 0; $nb_seconds = 0;
while ($connections = Database::fetch_array($result_connection_time)) { while ($connections = Database::fetch_array($result_connection_time)) {
$login_date = $connections["login_date"]; $login_date = $connections["login_date"];
$logout_date = $connections["logout_date"]; $logout_date = $connections["logout_date"];
$timestamp_login_date = strtotime($login_date); $timestamp_login_date = strtotime($login_date);
$timestamp_logout_date = strtotime($logout_date); $timestamp_logout_date = strtotime($logout_date);
$nb_seconds += ($timestamp_logout_date - $timestamp_login_date); $nb_seconds += ($timestamp_logout_date - $timestamp_login_date);
} }
if ($nb_seconds == 0) { if ($nb_seconds == 0) {
$s_connection_time = ''; $s_connection_time = '';
} else { } else {
$s_connection_time = api_time_to_hms($nb_seconds); $s_connection_time = api_time_to_hms($nb_seconds);
} }
if ($i % 2 == 0) { if ($i % 2 == 0) {
$css_class = "row_odd"; $css_class = "row_odd";
if ($i % 20 == 0 && $i != 0) { if ($i % 20 == 0 && $i != 0) {
if (api_is_western_name_order()) { if (api_is_western_name_order()) {
echo '<tr> echo '<tr>
<th>'.get_lang('FirstName').'</th> <th>'.get_lang('FirstName').'</th>
<th>'.get_lang('LastName').'</th> <th>'.get_lang('LastName').'</th>
<th>'.get_lang('ConnectionTime').'</th> <th>'.get_lang('ConnectionTime').'</th>
<th>'.get_lang('AdminCourses').'</th> <th>'.get_lang('AdminCourses').'</th>
<th>'.get_lang('Students').'</th> <th>'.get_lang('Students').'</th>
</tr>'; </tr>';
} else { } else {
echo '<tr> echo '<tr>
<th>'.get_lang('LastName').'</th> <th>'.get_lang('LastName').'</th>
<th>'.get_lang('FirstName').'</th> <th>'.get_lang('FirstName').'</th>
<th>'.get_lang('ConnectionTime').'</th> <th>'.get_lang('ConnectionTime').'</th>
<th>'.get_lang('AdminCourses').'</th> <th>'.get_lang('AdminCourses').'</th>
<th>'.get_lang('Students').'</th> <th>'.get_lang('Students').'</th>
</tr>'; </tr>';
} }
} }
} else { } else {
$css_class = "row_even"; $css_class = "row_even";
} }
$i++; $i++;
if (api_is_western_name_order()) { if (api_is_western_name_order()) {
echo '<tr class="'.$css_class.'"> echo '<tr class="'.$css_class.'">
<td>'.$firstname.'</td><td>'.$lastname.'</td><td>'.$s_connection_time.'</td> <td>'.$firstname.'</td><td>'.$lastname.'</td><td>'.$s_connection_time.'</td>
<td> <td>
<a href="course.php?type=coach&user_id='.$id_coach.'"> <a href="course.php?type=coach&user_id='.$id_coach.'">
@ -185,8 +185,8 @@ if (Database::num_rows($result_coachs) > 0) {
</a> </a>
</td> </td>
</tr>'; </tr>';
} else { } else {
echo '<tr class="'.$css_class.'"> echo '<tr class="'.$css_class.'">
<td>'.$lastname.'</td><td>'.$firstname.'</td> <td>'.$lastname.'</td><td>'.$firstname.'</td>
<td>'.$s_connection_time.'</td> <td>'.$s_connection_time.'</td>
<td> <td>

@ -1,9 +1,9 @@
<?php <?php
$reports_template['CourseArticulate'] = array( $reports_template['CourseArticulate'] = array(
'description' => 'CourseArticulate', 'description' => 'CourseArticulate',
'getSQL' => 'reports_template_CourseArticulate_getSQL', 'getSQL' => 'reports_template_CourseArticulate_getSQL',
'wizard' => 'wizard' =>
' '
<span id="CourseArticulate" class="step"> <span id="CourseArticulate" class="step">
<span class="font_normal_07em_black">This report does not need any particular settings</span><br /> <span class="font_normal_07em_black">This report does not need any particular settings</span><br />
@ -12,113 +12,113 @@ $reports_template['CourseArticulate'] = array(
'); ');
function reports_template_CourseArticulate_getSQL() { function reports_template_CourseArticulate_getSQL() {
// settings // settings
// Nom, prenom // Nom, prenom
$query = 'select u.lastname as "Last name", u.firstname as "First name" '; $query = 'select u.lastname as "Last name", u.firstname as "First name" ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' order by u.user_id '; $query .= ' order by u.user_id ';
$queries[0] = $query; $queries[0] = $query;
$extraFieldType = \Chamilo\CoreBundle\Entity\ExtraField::USER_FIELD_TYPE; $extraFieldType = \Chamilo\CoreBundle\Entity\ExtraField::USER_FIELD_TYPE;
// Custom Field // Custom Field
foreach (array("tags" => "tags") as $k => $v) { // FIXME foreach (array("tags" => "tags") as $k => $v) { // FIXME
$query = 'select ufv.value as "'.$v.'" '; $query = 'select ufv.value as "'.$v.'" ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= 'left join'.Database::get_main_table(TABLE_EXTRA_FIELD).' uf '; $query .= 'left join'.Database::get_main_table(TABLE_EXTRA_FIELD).' uf ';
$query .= ' on uf.variable ="'.$k.'" '; $query .= ' on uf.variable ="'.$k.'" ';
$query .= 'left outer join '.Database::get_main_table(TABLE_EXTRA_FIELD_VALUES).' ufv '; $query .= 'left outer join '.Database::get_main_table(TABLE_EXTRA_FIELD_VALUES).' ufv ';
$query .= ' on ufv.item_id = u.user_id and ufv.field_id = uf.id '; $query .= ' on ufv.item_id = u.user_id and ufv.field_id = uf.id ';
$query .= 'where ufv.extra_field_type = '.$extraFieldType.' AND u.user_id in ('.reports_getVisibilitySQL().') '; $query .= 'where ufv.extra_field_type = '.$extraFieldType.' AND u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' order by u.user_id '; $query .= ' order by u.user_id ';
$queries[] = $query; $queries[] = $query;
} }
// Stored Value // Stored Value
$sv = array(); $sv = array();
foreach ($sv as $k => $v) { foreach ($sv as $k => $v) {
if (!isset($v['sql'])) if (!isset($v['sql']))
$v['sql'] = 'FIELD'; $v['sql'] = 'FIELD';
$sqlField = str_replace('FIELD', 'sv.sv_value', $v['sql']); $sqlField = str_replace('FIELD', 'sv.sv_value', $v['sql']);
$query = 'select '.$sqlField.' as "'.$v['title'].'" '; $query = 'select '.$sqlField.' as "'.$v['title'].'" ';
// $query = 'select sec_to_time(sv.sv_value) as "'.$v.'" '; // $query = 'select sec_to_time(sv.sv_value) as "'.$v.'" ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= ' left outer join '.Database::get_main_table(TABLE_TRACK_STORED_VALUES).' sv '; $query .= ' left outer join '.Database::get_main_table(TABLE_TRACK_STORED_VALUES).' sv ';
$query .= 'on sv.user_id = u.user_id and sv_key = "'.$k.'" '; $query .= 'on sv.user_id = u.user_id and sv_key = "'.$k.'" ';
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' group by u.user_id '; $query .= ' group by u.user_id ';
$query .= ' order by u.user_id '; $query .= ' order by u.user_id ';
$queries[] = $query; $queries[] = $query;
} }
// first and last connection // first and last connection
$query = 'select min(tel.login_date) as "First connection", max(tel.logout_date) as "Latest connection" '; $query = 'select min(tel.login_date) as "First connection", max(tel.logout_date) as "Latest connection" ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= 'left outer join '.Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN).' tel '; $query .= 'left outer join '.Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN).' tel ';
$query .= ' on tel.login_user_id = u.user_id '; $query .= ' on tel.login_user_id = u.user_id ';
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' group by u.user_id '; $query .= ' group by u.user_id ';
$query .= ' order by u.user_id '; $query .= ' order by u.user_id ';
$queries[] = $query; $queries[] = $query;
// SCORM Data // SCORM Data
$scormData = array(); $scormData = array();
$course_list = CourseManager::get_courses_list(); $course_list = CourseManager::get_courses_list();
foreach ($course_list as $code => $details) { foreach ($course_list as $code => $details) {
$courseId = $details['id']; $courseId = $details['id'];
$list = Database::query('SELECT l.id as lid, l.name as lname, li.id as liid, li.title as lititle '. $list = Database::query('SELECT l.id as lid, l.name as lname, li.id as liid, li.title as lititle '.
' FROM '.Database::get_course_table(TABLE_LP_MAIN).' l, '.Database::get_course_table(TABLE_LP_ITEM).' li '. ' FROM '.Database::get_course_table(TABLE_LP_MAIN).' l, '.Database::get_course_table(TABLE_LP_ITEM).' li '.
' WHERE l.c_id = '.$courseId.' AND li.c_id = '.$courseId.' AND l.id = li.lp_id'); ' WHERE l.c_id = '.$courseId.' AND li.c_id = '.$courseId.' AND l.id = li.lp_id');
while ($lpItem = Database::fetch_assoc($list)) { while ($lpItem = Database::fetch_assoc($list)) {
$scormData[] = array( $scormData[] = array(
//'coursedb' => $details['db_name'], //'coursedb' => $details['db_name'],
'lid' => $lpItem['lid'], 'lid' => $lpItem['lid'],
'liid' => $lpItem['liid'], 'liid' => $lpItem['liid'],
'target_view_count' => 1, 'target_view_count' => 1,
'target_indicator' => 'score', 'target_indicator' => 'score',
'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/1/score', 'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/1/score',
'sql' => 'FIELD'); 'sql' => 'FIELD');
$scormData[] = array( $scormData[] = array(
//'coursedb' => $details['db_name'], //'coursedb' => $details['db_name'],
'lid' => $lpItem['lid'], 'lid' => $lpItem['lid'],
'liid' => $lpItem['liid'], 'liid' => $lpItem['liid'],
'target_view_count' => 2, 'target_view_count' => 2,
'target_indicator' => 'score', 'target_indicator' => 'score',
'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/2/score', 'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/2/score',
'sql' => 'FIELD'); 'sql' => 'FIELD');
$scormData[] = array( $scormData[] = array(
//'coursedb' => $details['db_name'], //'coursedb' => $details['db_name'],
'lid' => $lpItem['lid'], 'lid' => $lpItem['lid'],
'liid' => $lpItem['liid'], 'liid' => $lpItem['liid'],
'target_view_count' => null, 'target_view_count' => null,
'target_indicator' => 'score', 'target_indicator' => 'score',
'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/all/score', 'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/all/score',
'sql' => 'avg(FIELD)'); 'sql' => 'avg(FIELD)');
} }
} }
foreach ($scormData as $v) { foreach ($scormData as $v) {
if (!isset($v['sql'])) { if (!isset($v['sql'])) {
$v['sql'] = 'FIELD'; $v['sql'] = 'FIELD';
} }
$sqlField = str_replace('FIELD', $v['target_indicator'], $v['sql']); $sqlField = str_replace('FIELD', $v['target_indicator'], $v['sql']);
$query = 'select '.$sqlField.' as "'.$v['title'].'" '; $query = 'select '.$sqlField.' as "'.$v['title'].'" ';
$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
$query .= 'left outer join '.Database::get_course_table(TABLE_LP_VIEW).' lv '; $query .= 'left outer join '.Database::get_course_table(TABLE_LP_VIEW).' lv ';
$query .= ' on u.user_id = lv.user_id and lv.lp_id = '.$v['lid']; $query .= ' on u.user_id = lv.user_id and lv.lp_id = '.$v['lid'];
$query .= ' left outer join '.Database::get_course_table(TABLE_LP_ITEM_VIEW).' liv '; $query .= ' left outer join '.Database::get_course_table(TABLE_LP_ITEM_VIEW).' liv ';
$query .= ' on lv.id = liv.lp_view_id '; $query .= ' on lv.id = liv.lp_view_id ';
if ($v['target_view_count']) if ($v['target_view_count'])
$query .= ' and liv.view_count = '.$v['target_view_count']; $query .= ' and liv.view_count = '.$v['target_view_count'];
$query .= ' and liv.lp_item_id = '.$v['liid'].' '; $query .= ' and liv.lp_item_id = '.$v['liid'].' ';
$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
$query .= ' group by u.user_id '; $query .= ' group by u.user_id ';
$query .= ' order by u.user_id '; $query .= ' order by u.user_id ';
$queries[] = $query; $queries[] = $query;
} }
return $queries; return $queries;
} }

@ -196,12 +196,12 @@ if (!empty($OkMsg)) {
if (!empty($rows_session_category)) { if (!empty($rows_session_category)) {
foreach($rows_session_category as $category) { foreach($rows_session_category as $category) {
if($category['id'] == $categoryId) if($category['id'] == $categoryId)
echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>'; echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>';
else else
echo '<option value="'.$category['id'].'">'.$category['name'].'</option>'; echo '<option value="'.$category['id'].'">'.$category['name'].'</option>';
} }
} }
?> ?>
</select> </select>
</td> </td>
</tr> </tr>

@ -70,13 +70,13 @@ echo Display::input('hidden', 'form_sent', '1');
<tr> <tr>
<td align="center"> <td align="center">
<?php <?php
echo Display::select( echo Display::select(
'sessions[]', 'sessions[]',
$sessionList, $sessionList,
'', '',
array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'sessions', 'size'=>'15px'), array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'sessions', 'size'=>'15px'),
false false
); );
?> ?>
</td> </td>
<td align="center"> <td align="center">

@ -155,7 +155,7 @@ if ($sessionInfo['nbr_courses'] == 0) {
$sessionRepository = Database::getManager()->getRepository('ChamiloCoreBundle:Session'); $sessionRepository = Database::getManager()->getRepository('ChamiloCoreBundle:Session');
$courses = $sessionRepository->getCoursesOrderedByPosition($session); $courses = $sessionRepository->getCoursesOrderedByPosition($session);
foreach ($courses as $course) { foreach ($courses as $course) {
//select the number of users //select the number of users
$sql = "SELECT count(*) $sql = "SELECT count(*)
FROM $tbl_session_rel_user sru, FROM $tbl_session_rel_user sru,
@ -167,37 +167,37 @@ if ($sessionInfo['nbr_courses'] == 0) {
sru.relation_type <> ".SESSION_RELATION_TYPE_RRHH." AND sru.relation_type <> ".SESSION_RELATION_TYPE_RRHH." AND
srcru.session_id = '".intval($sessionId)."'"; srcru.session_id = '".intval($sessionId)."'";
$rs = Database::query($sql); $rs = Database::query($sql);
$numberOfUsers = Database::result($rs, 0, 0); $numberOfUsers = Database::result($rs, 0, 0);
// Get coachs of the courses in session // Get coachs of the courses in session
$sql = "SELECT user.lastname, user.firstname, user.username $sql = "SELECT user.lastname, user.firstname, user.username
FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user FROM $tbl_session_rel_course_rel_user session_rcru, $tbl_user user
WHERE WHERE
session_rcru.user_id = user.user_id AND session_rcru.user_id = user.user_id AND
session_rcru.session_id = '".intval($sessionId)."' AND session_rcru.session_id = '".intval($sessionId)."' AND
session_rcru.c_id ='".intval($course->getId())."' AND session_rcru.c_id ='".intval($course->getId())."' AND
session_rcru.status=2"; session_rcru.status=2";
$rs = Database::query($sql); $rs = Database::query($sql);
$coachs = array(); $coachs = array();
if (Database::num_rows($rs) > 0) { if (Database::num_rows($rs) > 0) {
while($info_coach = Database::fetch_array($rs)) { while($info_coach = Database::fetch_array($rs)) {
$coachs[] = api_get_person_name( $coachs[] = api_get_person_name(
$info_coach['firstname'], $info_coach['firstname'],
$info_coach['lastname'] $info_coach['lastname']
).' ('.$info_coach['username'].')'; ).' ('.$info_coach['username'].')';
} }
} else { } else {
$coach = get_lang('None'); $coach = get_lang('None');
} }
if (count($coachs) > 0) { if (count($coachs) > 0) {
$coach = implode('<br />',$coachs); $coach = implode('<br />',$coachs);
} else { } else {
$coach = get_lang('None'); $coach = get_lang('None');
} }
$orderButtons = null; $orderButtons = null;
@ -233,8 +233,8 @@ if ($sessionInfo['nbr_courses'] == 0) {
$courseUrl = api_get_course_url($course->getCode(), $sessionId); $courseUrl = api_get_course_url($course->getCode(), $sessionId);
// hide_course_breadcrumb the parameter has been added to hide the name // hide_course_breadcrumb the parameter has been added to hide the name
// of the course, that appeared in the default $interbreadcrumb // of the course, that appeared in the default $interbreadcrumb
$courseItem .= ' $courseItem .= '
<tr> <tr>
<td class="title">'.Display::url( <td class="title">'.Display::url(
@ -262,7 +262,7 @@ if ($sessionInfo['nbr_courses'] == 0) {
</td> </td>
</tr>'; </tr>';
$count++; $count++;
} }
$courseListToShow .= $courseItem; $courseListToShow .= $courseItem;
} }
$courseListToShow .= '</table><br />'; $courseListToShow .= '</table><br />';

@ -29,15 +29,15 @@ $interbreadcrumb[] = array(
$sql = "SELECT * FROM $tbl_session_category WHERE id='".$id."' ORDER BY name"; $sql = "SELECT * FROM $tbl_session_category WHERE id='".$id."' ORDER BY name";
$result = Database::query($sql); $result = Database::query($sql);
if (!$infos = Database::fetch_array($result)) { if (!$infos = Database::fetch_array($result)) {
header('Location: session_list.php'); header('Location: session_list.php');
exit(); exit();
} }
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'] && !api_is_session_admin()) { 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 (isset($_POST['formSent']) && $_POST['formSent']) { if (isset($_POST['formSent']) && $_POST['formSent']) {
@ -60,7 +60,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
$day_end $day_end
); );
if ($return == strval(intval($return))) { if ($return == strval(intval($return))) {
Display::addFlash(Display::return_message(get_lang('SessionCategoryUpdate'))); Display::addFlash(Display::return_message(get_lang('SessionCategoryUpdate')));
header('Location: session_category_list.php'); header('Location: session_category_list.php');
exit(); exit();
} }
@ -73,7 +73,7 @@ $thisDay = date('d');
// display the header // display the header
Display::display_header($tool_name); Display::display_header($tool_name);
if (!empty($return)) { if (!empty($return)) {
Display::display_error_message($return,false); Display::display_error_message($return,false);
} }
?> ?>
<div class="row"> <div class="row">

@ -37,8 +37,8 @@ $sql = "SELECT s.name, c.title
$result = Database::query($sql); $result = Database::query($sql);
if (!list($session_name,$course_title) = Database::fetch_row($result)) { if (!list($session_name,$course_title) = Database::fetch_row($result)) {
header('Location: session_course_list.php?id_session='.$id_session); header('Location: session_course_list.php?id_session='.$id_session);
exit(); exit();
} }
//$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
@ -48,63 +48,63 @@ $interbreadcrumb[]=array('url' => "session_course_list.php?id_session=$id_sessio
$arr_infos = array(); $arr_infos = array();
if (isset($_POST['formSent']) && $_POST['formSent']) { if (isset($_POST['formSent']) && $_POST['formSent']) {
$formSent = 1; $formSent = 1;
// get all tutor by course_code in the session // get all tutor by course_code in the session
$sql = "SELECT user_id $sql = "SELECT user_id
FROM $tbl_session_rel_course_rel_user FROM $tbl_session_rel_course_rel_user
WHERE session_id = '$id_session' AND c_id = '".$courseId."' AND status = 2"; WHERE session_id = '$id_session' AND c_id = '".$courseId."' AND status = 2";
$rs_coaches = Database::query($sql); $rs_coaches = Database::query($sql);
$coaches_course_session = array(); $coaches_course_session = array();
if (Database::num_rows($rs_coaches) > 0){ if (Database::num_rows($rs_coaches) > 0){
while ($row_coaches = Database::fetch_row($rs_coaches)) { while ($row_coaches = Database::fetch_row($rs_coaches)) {
$coaches_course_session[] = $row_coaches[0]; $coaches_course_session[] = $row_coaches[0];
} }
} }
$id_coaches= $_POST['id_coach']; $id_coaches= $_POST['id_coach'];
if (is_array($id_coaches) && count($id_coaches) > 0) { if (is_array($id_coaches) && count($id_coaches) > 0) {
foreach ($id_coaches as $id_coach) { foreach ($id_coaches as $id_coach) {
$id_coach = intval($id_coach); $id_coach = intval($id_coach);
$rs1 = SessionManager::set_coach_to_course_session( $rs1 = SessionManager::set_coach_to_course_session(
$id_coach, $id_coach,
$id_session, $id_session,
$courseId $courseId
); );
} }
// set status to 0 other tutors from multiple list // set status to 0 other tutors from multiple list
$array_intersect = array_diff($coaches_course_session,$id_coaches); $array_intersect = array_diff($coaches_course_session,$id_coaches);
foreach ($array_intersect as $no_coach_user_id) { foreach ($array_intersect as $no_coach_user_id) {
$rs2 = SessionManager::set_coach_to_course_session( $rs2 = SessionManager::set_coach_to_course_session(
$no_coach_user_id, $no_coach_user_id,
$id_session, $id_session,
$courseId, $courseId,
true true
); );
} }
header('Location: '.Security::remove_XSS($_GET['page']).'?id_session='.$id_session); header('Location: '.Security::remove_XSS($_GET['page']).'?id_session='.$id_session);
exit(); exit();
} }
} else { } else {
$sql = "SELECT user_id $sql = "SELECT user_id
FROM $tbl_session_rel_course_rel_user FROM $tbl_session_rel_course_rel_user
WHERE WHERE
session_id = '$id_session' AND session_id = '$id_session' AND
c_id = '".$courseId."' AND c_id = '".$courseId."' AND
status = 2 "; status = 2 ";
$rs = Database::query($sql); $rs = Database::query($sql);
if (Database::num_rows($rs) > 0) { if (Database::num_rows($rs) > 0) {
while ($infos = Database::fetch_array($rs)) { while ($infos = Database::fetch_array($rs)) {
$arr_infos[] = $infos['user_id']; $arr_infos[] = $infos['user_id'];
} }
} }
} }
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';

@ -30,26 +30,26 @@ $sort = in_array($_GET['sort'],array('title','nbr_users'))?$_GET['sort']:'titl
$result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'"); $result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'");
if (!list($session_name)=Database::fetch_row($result)) { if (!list($session_name)=Database::fetch_row($result)) {
header('Location: session_list.php'); header('Location: session_list.php');
exit; exit;
} }
if ($action == 'delete') { if ($action == 'delete') {
$idChecked = $_REQUEST['idChecked']; $idChecked = $_REQUEST['idChecked'];
if (is_array($idChecked) && count($idChecked)>0) { if (is_array($idChecked) && count($idChecked)>0) {
$my_temp = array(); $my_temp = array();
foreach ($idChecked as $id){ foreach ($idChecked as $id){
$my_temp[]= Database::escape_string($id);// forcing the escape_string $my_temp[]= Database::escape_string($id);// forcing the escape_string
} }
$idChecked = $my_temp; $idChecked = $my_temp;
$idChecked="'".implode("','", $idChecked)."'"; $idChecked="'".implode("','", $idChecked)."'";
$result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)"); $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)");
$nbr_affected_rows=Database::affected_rows($result); $nbr_affected_rows=Database::affected_rows($result);
Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)"); Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)");
Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'"); Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'");
} }
header('Location: '.api_get_self().'?id_session='.$id_session.'&sort='.$sort); header('Location: '.api_get_self().'?id_session='.$id_session.'&sort='.$sort);
exit(); exit();
} }
$limit = 20; $limit = 20;
@ -82,17 +82,17 @@ $tableHeader[] = array(get_lang('Actions'));
$tableCourses = array(); $tableCourses = array();
foreach ($Courses as $key=>$enreg) { foreach ($Courses as $key=>$enreg) {
$course = array(); $course = array();
$course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">'; $course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">';
$course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset); $course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset);
$course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>'; $course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>';
$course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'. $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'.
Display::return_icon('course_home.gif', get_lang('Course')).'</a> Display::return_icon('course_home.gif', get_lang('Course')).'</a>
<a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'. <a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'.
Display::return_icon('edit.png', get_lang('Edit')).'</a> Display::return_icon('edit.png', get_lang('Edit')).'</a>
<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'. <a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.
Display::return_icon('delete.png', get_lang('Delete')).'</a>'; Display::return_icon('delete.png', get_lang('Delete')).'</a>';
$tableCourses[] = $course; $tableCourses[] = $course;
} }
echo '<form method="post" action="'.api_get_self().'">'; echo '<form method="post" action="'.api_get_self().'">';
Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ()); Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ());

@ -50,8 +50,8 @@ $sql = "SELECT s.name, c.title
$result = Database::query($sql); $result = Database::query($sql);
if (!list($session_name,$course_title) = Database::fetch_row($result)) { if (!list($session_name,$course_title) = Database::fetch_row($result)) {
header('Location: session_course_list.php?id_session='.$id_session); header('Location: session_course_list.php?id_session='.$id_session);
exit(); exit();
} }
switch ($action) { switch ($action) {
@ -122,7 +122,7 @@ if($page) {
<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a> <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page-1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Previous');?></a>
<?php <?php
} else { } else {
echo get_lang('Previous'); echo get_lang('Previous');
} }
?> ?>
| |
@ -132,7 +132,7 @@ if($nbr_results > $limit) {
<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a> <a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&page=<?php echo $page+1; ?>&sort=<?php echo $sort; ?>"><?php echo get_lang('Next');?></a>
<?php <?php
} else { } else {
echo get_lang('Next'); echo get_lang('Next');
} }
?> ?>
</div> </div>
@ -154,9 +154,9 @@ if($nbr_results > $limit) {
$i=0; $i=0;
foreach ($users as $key => $enreg) { foreach ($users as $key => $enreg) {
if ($key == $limit) { if ($key == $limit) {
break; break;
} }
?> ?>
<tr class="<?php echo $i?'row_odd':'row_even'; ?>"> <tr class="<?php echo $i?'row_odd':'row_even'; ?>">
<td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td> <td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td>

@ -14,7 +14,7 @@ use JeroenDesloovere\VCard\VCard;
api_block_anonymous_users(); api_block_anonymous_users();
if (isset($_REQUEST['userId'])) { if (isset($_REQUEST['userId'])) {
$userId = intval($_REQUEST['userId']); $userId = intval($_REQUEST['userId']);
} else { } else {
api_not_allowed(); api_not_allowed();
} }

@ -88,15 +88,15 @@ $isDrhOfCourse = CourseManager::isUserSubscribedInCourseAsDrh(
/** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/ /** @todo this has to be moved to a more appropriate place (after the display_header of the code)*/
if (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) { if (!api_is_allowed_to_edit(false, true) || $isDrhOfCourse) {
Display :: display_header(get_lang('ToolSurvey')); Display :: display_header(get_lang('ToolSurvey'));
// Show error message if the survey can be seen only by tutors // Show error message if the survey can be seen only by tutors
if ($survey_data['visible_results'] != SURVEY_VISIBLE_TUTOR) { if ($survey_data['visible_results'] != SURVEY_VISIBLE_TUTOR) {
SurveyUtil::handle_reporting_actions($survey_data, $people_filled); SurveyUtil::handle_reporting_actions($survey_data, $people_filled);
} else { } else {
Display :: display_error_message(get_lang('NotAllowed'), false); Display :: display_error_message(get_lang('NotAllowed'), false);
} }
Display :: display_footer(); Display :: display_footer();
exit; exit;
} }
// Database table definitions // Database table definitions

@ -1184,16 +1184,16 @@ class SurveyManager
} }
/** /**
* This function saves the question in the shared database * This function saves the question in the shared database
* *
* @param array $form_content all the information of the form * @param array $form_content all the information of the form
* @param array $survey_data all the information of the survey * @param array $survey_data all the information of the survey
* *
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University * @author Patrick Cool <patrick.cool@UGent.be>, Ghent University
* @version February 2007 * @version February 2007
* *
* @todo editing of a shared question * @todo editing of a shared question
*/ */
public function save_shared_question($form_content, $survey_data) public function save_shared_question($form_content, $survey_data)
{ {
$_course = api_get_course_info(); $_course = api_get_course_info();

@ -48,7 +48,7 @@ $columns = array(get_lang('Name'), get_lang('Actions'));
$column_model = array( $column_model = array(
array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'), array('name'=>'name', 'index'=>'name', 'width'=>'120', 'align'=>'left'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false') array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left', 'sortable'=>'false')
); );
//Autowidth //Autowidth
$extra_params['autowidth'] = 'true'; $extra_params['autowidth'] = 'true';
//height auto //height auto

@ -51,7 +51,7 @@ class Connector
'root_sys' => api_get_path(SYS_PATH), 'root_sys' => api_get_path(SYS_PATH),
'sys_root' => api_get_path(SYS_PATH), // just an alias 'sys_root' => api_get_path(SYS_PATH), // just an alias
'sys_course_path' => api_get_path(SYS_COURSE_PATH), 'sys_course_path' => api_get_path(SYS_COURSE_PATH),
// 'sys_config_path' => $app['path.config'], // 'sys_config_path' => $app['path.config'],
'path.temp' => api_get_path(SYS_ARCHIVE_PATH), 'path.temp' => api_get_path(SYS_ARCHIVE_PATH),
//'sys_log_path' => $app['path.logs'] //'sys_log_path' => $app['path.logs']
); );
@ -326,9 +326,9 @@ class Connector
**/ **/
public function access($attr, $path, $data, $volume) public function access($attr, $path, $data, $volume)
{ {
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot) return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true ? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
: null; // else elFinder decide it itself : null; // else elFinder decide it itself
} }
/** /**

@ -633,8 +633,8 @@ class DropBoxDriver extends \elFinderVolumeMySQL implements DriverInterface
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function _archive($dir, $files, $name, $arc) { protected function _archive($dir, $files, $name, $arc) {
return false; return false;
} }

@ -22,8 +22,8 @@ class Basic extends Toolbar
"searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
"save table contextmenu directionality emoticons template paste textcolor" "save table contextmenu directionality emoticons template paste textcolor"
), ),
'content_css'=> "css/content.css", 'content_css'=> "css/content.css",
'toolbar' => "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l ink image | print preview media fullpage | forecolor backcolor emoticons", 'toolbar' => "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l ink image | print preview media fullpage | forecolor backcolor emoticons",
'file_browser_callback' => 'elFinderBrowser' 'file_browser_callback' => 'elFinderBrowser'
); );

@ -86,13 +86,13 @@ class Data
return $this->get($file); return $this->get($file);
} }
/** /**
* Gets a file from the data/courses/MATHS/scorm directory * Gets a file from the data/courses/MATHS/scorm directory
* @param string $courseCode * @param string $courseCode
* @param string $file * @param string $file
* *
* @return SplFileInfo * @return SplFileInfo
*/ */
public function getCourseScormDocument($courseCode, $file) public function getCourseScormDocument($courseCode, $file)
{ {
$file = 'courses/'.$courseCode.'/scorm/'.$file; $file = 'courses/'.$courseCode.'/scorm/'.$file;

@ -26,7 +26,6 @@ class AccessUrlRelUserGroup
* @var integer * @var integer
* *
* @ORM\Column(name="access_url_id", type="integer") * @ORM\Column(name="access_url_id", type="integer")
*/ */
private $accessUrlId; private $accessUrlId;

@ -42,11 +42,11 @@ class ExtraFieldOptionRelFieldOption
*/ */
protected $relatedFieldOptionId; protected $relatedFieldOptionId;
/** /**
* @var integer * @var integer
* *
* @ORM\Column(name="role_id", type="integer", precision=0, scale=0, nullable=true, unique=false) * @ORM\Column(name="role_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
*/ */
protected $roleId; protected $roleId;
/** /**
@ -128,12 +128,12 @@ class ExtraFieldOptionRelFieldOption
return $this->relatedFieldOptionId; return $this->relatedFieldOptionId;
} }
/** /**
* Set roleId * Set roleId
* *
* @param integer $roleId * @param integer $roleId
* @return ExtraFieldOptionRelFieldOption * @return ExtraFieldOptionRelFieldOption
*/ */
public function setRoleId($roleId) public function setRoleId($roleId)
{ {
$this->roleId = $roleId; $this->roleId = $roleId;

@ -158,13 +158,13 @@ class ExtraFieldValues extends BaseAttributeValue
return $this; return $this;
} }
/** /**
* Set comment * Set comment
* *
* @param string $comment * @param string $comment
* *
* @return ExtraFieldValues * @return ExtraFieldValues
*/ */
public function setComment($comment) public function setComment($comment)
{ {
$this->comment = $comment; $this->comment = $comment;

@ -25,7 +25,7 @@ class SequenceRepository extends EntityRepository
*/ */
public function findRequirementForResource($resourceId, $type) public function findRequirementForResource($resourceId, $type)
{ {
/* $criteria = Criteria::create() /* $criteria = Criteria::create()
->where(Criteria::expr()->eq("resourceId", $resourceId)) ->where(Criteria::expr()->eq("resourceId", $resourceId))
->andWhere(Criteria::expr()->eq("type", $type)); ->andWhere(Criteria::expr()->eq("type", $type));
*/ */

Loading…
Cancel
Save