Minor - format code

pull/2913/head
Julio Montoya 6 years ago
parent 4cb5d98d42
commit ee03b66d1c
  1. 2
      main/inc/lib/MoodleImport.php
  2. 1
      main/inc/lib/ScheduledAnnouncement.php
  3. 11
      main/inc/lib/message.lib.php
  4. 49
      main/inc/lib/myspace.lib.php
  5. 2
      main/inc/lib/skill.lib.php

@ -106,9 +106,7 @@ class MoodleImport
$filesXml = @file_get_contents($destinationDir.'/files.xml');
$mainFileModuleValues = $this->getAllQuestionFiles($filesXml);
$currentResourceFilePath = $destinationDir.'/files/';
$importedFiles = [];
foreach ($mainFileModuleValues as $fileInfo) {
$dirs = new RecursiveDirectoryIterator($currentResourceFilePath);
foreach (new RecursiveIteratorIterator($dirs) as $file) {

@ -265,7 +265,6 @@ class ScheduledAnnouncement extends Model
{
$file = $this->getAttachment($id);
if (!empty($file) && !empty($file['value'])) {
//$file = api_get_uploaded_web_url('schedule_announcement', $id, basename($file['value']));
$url = api_get_path(WEB_UPLOAD_PATH).$file['value'];
return get_lang('Attachment').': '.Display::url(basename($file['value']), $url, ['target' => '_blank']);

@ -272,12 +272,6 @@ class MessageManager
$message = $repo->find($row['id']);
$messages[] = $message;
}
/*$criteria = [
'userReceiverId' => $aboutUserInfo['id'],
'msgStatus' => MESSAGE_STATUS_CONVERSATION,
];
$repo = Database::getManager()->getRepository('ChamiloCoreBundle:Message');
$messages = $repo->findBy($criteria, ['sendDate' => 'DESC']);*/
return $messages;
}
@ -771,8 +765,8 @@ class MessageManager
if ($id != strval(intval($id))) {
return false;
}
$user_receiver_id = intval($user_receiver_id);
$id = intval($id);
$id = (int) $id;
$user_receiver_id = (int) $user_receiver_id;
$sql = "SELECT * FROM $table
WHERE id = ".$id." AND msg_status <>".MESSAGE_STATUS_OUTBOX;
$rs = Database::query($sql);
@ -1578,7 +1572,6 @@ class MessageManager
}
$webCodePath = api_get_path(WEB_CODE_PATH);
$iconCalendar = Display::returnFontAwesomeIcon('calendar');
$langEdit = get_lang('Edit');

@ -475,19 +475,19 @@ class MySpace
$order = [
0 => 'firstname',
1 => 'lastname',
2 => ($sort_by_first_name ? 'firstname' : 'lastname'),
2 => $sort_by_first_name ? 'firstname' : 'lastname',
3 => 'login_date',
4 => ($sort_by_first_name ? 'firstname' : 'lastname'),
5 => ($sort_by_first_name ? 'firstname' : 'lastname'),
4 => $sort_by_first_name ? 'firstname' : 'lastname',
5 => $sort_by_first_name ? 'firstname' : 'lastname',
];
} else {
$order = [
0 => 'lastname',
1 => 'firstname',
2 => ($sort_by_first_name ? 'firstname' : 'lastname'),
2 => $sort_by_first_name ? 'firstname' : 'lastname',
3 => 'login_date',
4 => ($sort_by_first_name ? 'firstname' : 'lastname'),
5 => ($sort_by_first_name ? 'firstname' : 'lastname'),
4 => $sort_by_first_name ? 'firstname' : 'lastname',
5 => $sort_by_first_name ? 'firstname' : 'lastname',
];
}
$table = new SortableTable(
@ -1046,17 +1046,6 @@ class MySpace
*/
public static function display_tracking_course_overview()
{
/*$t_head = '<table style="width: 100%;border:0;padding:0;border-collapse:collapse;table-layout: fixed">';
$t_head .= '<tr>';
$t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgTimeSpentInTheCourse'), 6, true).'</span></th>';
$t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgStudentsProgress'), 6, true).'</span></th>';
$t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('AvgCourseScore'), 6, true).'</span></th>';
$t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('TotalNumberOfMessages'), 6, true).'</span></th>';
$t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('TotalNumberOfAssignments'), 6, true).'</span></th>';
$t_head .= '<th width="105px" style="border-bottom:0"><span>'.get_lang('TotalExercisesScoreObtained').'</span></th>';
$t_head .= '<th style="padding:0;border-bottom:0"><span>'.cut(get_lang('TotalExercisesAnswered'), 6, true).'</span></th>';
$t_head .= '<th style="padding:0;border-bottom:0;border-right:0;"><span>'.get_lang('LatestLogin').'</span></th>';
$t_head .= '</tr></table>';*/
$params = ['view' => 'admin', 'display' => 'courseoverview'];
$table = new SortableTable(
'tracking_session_overview',
@ -1070,12 +1059,7 @@ class MySpace
]
);
$table->additional_parameters = $params;
//$table->set_header(0, '', false, null, ['style' => 'display: none']);
//$table->set_header(1, get_lang('Course'), true, ['style' => 'font-size:8pt'], ['style' => 'font-size:8pt']);
//$table->set_header(2, $t_head, false, ['style' => 'width:90%;border:0;padding:0;font-size:7.5pt;'], ['style' => 'width:90%;padding:0;font-size:7.5pt;']);
$table->set_column_filter(0, ['MySpace', 'course_tracking_filter']);
$tableContent = $table->return_table();
$tpl = new Template('', false, false, false, false, false, false);
@ -1215,9 +1199,8 @@ class MySpace
$last_login_date == false
) { // TODO: To be cleaned
$last_login_date = $last_login_date_tmp;
} elseif ($last_login_date_tmp != false &&
$last_login_date != false
) { // TODO: Repeated previous condition. To be cleaned.
} elseif ($last_login_date_tmp != false && $last_login_date != false) {
// TODO: Repeated previous condition. To be cleaned.
// Find the max and assign it to first_login_date
if (strtotime($last_login_date_tmp) > strtotime($last_login_date)) {
$last_login_date = $last_login_date_tmp;
@ -2002,11 +1985,11 @@ class MySpace
$csv_row = [];
$csv_row[] = get_lang('OfficialCode');
if ($is_western_name_order) {
$csv_row[] = get_lang('FirstName', '');
$csv_row[] = get_lang('LastName', '');
$csv_row[] = get_lang('FirstName');
$csv_row[] = get_lang('LastName');
} else {
$csv_row[] = get_lang('LastName', '');
$csv_row[] = get_lang('FirstName', '');
$csv_row[] = get_lang('LastName');
$csv_row[] = get_lang('FirstName');
}
$csv_row[] = get_lang('LoginName');
$csv_row[] = get_lang('CourseCode');
@ -2857,9 +2840,6 @@ class MySpace
['MySpace', 'getUserDataAccessTrackingOverview'],
0
);
//$table->additional_parameters = $form->exportValues();
$table->set_header(0, get_lang('LoginDate'), true);
$table->set_header(1, get_lang('Username'), true);
if (api_is_western_name_order()) {
@ -2966,11 +2946,6 @@ class MySpace
$sql .= " AND u.user_id = ".$userId;
}
if (isset($_GET['student_id']) && !empty($_GET['student_id'])) {
$userId = (int) $_GET['student_id'];
$sql .= " AND u.user_id = ".$userId;
}
if (isset($_GET['date']) && !empty($_GET['date'])) {
$dates = DateRangePicker::parseDateRange($_GET['date']);
if (isset($dates['start']) && !empty($dates['start'])) {

@ -1289,7 +1289,7 @@ class Skill extends Model
/**
* Get user's skills.
*
* @param int $userId User's id
* @param int $userId
* @param bool $getSkillData
* @param int $courseId
* @param int $sessionId

Loading…
Cancel
Save