Format code + fix PHP warning

ofaj
jmontoyaa 10 years ago
parent 162223cbbf
commit f4f0bd2a3e
  1. 2
      main/inc/lib/extra_field.lib.php
  2. 21
      main/inc/lib/tracking.lib.php
  3. 2
      main/user/user_import.php

@ -1277,7 +1277,7 @@ class ExtraField extends Model
$tagsSelect->setAttribute('id', "extra_{$field_details['variable']}");
$tagsSelect->setMultiple(true);
if ($this->type == 'user') {
if ($this->type === 'user') {
// The magic should be here
$user_tags = UserManager::get_user_tags($itemId, $field_details['id']);

@ -6110,13 +6110,14 @@ class TrackingCourseLog
$row[5] = '';
//@todo Improve this code please
switch ($table_name['table_name']) {
case 'document' :
case 'document':
$sql = "SELECT tool.title as title FROM $table_tool tool
WHERE c_id = $course_id AND id = $ref";
$rs_document = Database::query($sql);
$obj_document = Database::fetch_object($rs_document);
$row[5] = $obj_document->title;
if ($obj_document) {
$row[5] = $obj_document->title;
}
break;
case 'announcement':
$sql = "SELECT title FROM $table_tool
@ -6165,21 +6166,27 @@ class TrackingCourseLog
$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
if (Database::num_rows($rs) > 0) {
$obj = Database::fetch_object($rs);
$row[5] = $obj->title;
if ($obj) {
$row[5] = $obj->title;
}
}
break;
case 'thematic_advance':
$rs = Database::query("SELECT content FROM $table_tool WHERE c_id = $course_id AND id = $ref");
if (Database::num_rows($rs) > 0) {
$obj = Database::fetch_object($rs);
$row[5] = $obj->content;
if ($obj) {
$row[5] = $obj->content;
}
}
break;
case 'thematic_plan':
$rs = Database::query("SELECT title FROM $table_tool WHERE c_id = $course_id AND id = $ref");
if (Database::num_rows($rs) > 0) {
$obj = Database::fetch_object($rs);
$row[5] = $obj->title;
if ($obj) {
$row[5] = $obj->title;
}
}
break;
default:
@ -6193,7 +6200,6 @@ class TrackingCourseLog
$row[2] = $row2;
if (!empty($row['col3'])) {
$userInfo = api_get_user_info($row['user_id']);
$row['col3'] = Display::url(
$row['col3'],
$userInfo['profile_url']
@ -6495,7 +6501,6 @@ class TrackingCourseLog
}
$column = intval($column);
$from = intval($from);
$number_of_items = intval($number_of_items);

@ -21,9 +21,7 @@ $interbreadcrumb[] = array ("url" => "#", "name" => get_lang("ImportUsersToACour
$form = new FormValidator('user_import', 'post', 'user_import.php');
$form->addElement('header', $tool_name);
$form->addElement('file', 'import_file', get_lang('ImportCSVFileLocation'));
$form->addElement('checkbox', 'unsubscribe_users', null, get_lang('UnsubscribeUsersAlreadyAddedInCourse'));
$form->addButtonImport(get_lang('Import'));
$course_code = api_get_course_id();

Loading…
Cancel
Save