Minor - Format code

pull/2487/head
Julio 8 years ago
parent 3c6542df82
commit 66f4745584
  1. 4
      main/badge/assign.php
  2. 6
      main/inc/lib/grade_model.lib.php
  3. 2
      main/inc/lib/myspace.lib.php
  4. 6
      main/mySpace/lp_tracking.php
  5. 12
      main/mySpace/users.php
  6. 5
      main/mySpace/works_in_session_report.php
  7. 1
      main/session/session_add.php
  8. 13
      main/session/session_course_list.php
  9. 3
      main/session/session_course_user_list.php
  10. 1
      main/session/session_edit.php
  11. 3
      main/session/session_export.php
  12. 16
      main/session/session_import.php
  13. 6
      main/session/session_import_drh.php

@ -186,7 +186,9 @@ if (!empty($skillIdFromGet)) {
if (isset($subSkillList[$counter+1])) {
$nextSkill = $skillRepo->find($subSkillList[$counter+1]);
$formDefaultValues['sub_skill_id_'.($counter+1)] = $nextSkill->getId();
if ($nextSkill) {
$formDefaultValues['sub_skill_id_'.($counter+1)] = $nextSkill->getId();
}
}
$newSubSkillList[] = $subSkillId;
$counter++;

@ -55,8 +55,10 @@ class GradeModel extends Model
{
// action links
echo '<div class="actions" style="margin-bottom:20px">';
echo '<a href="grade_models.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="grade_models.php">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_self().'?action=add">'.
Display::return_icon('add.png', get_lang('Add'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
echo Display::grid_html('grade_model');
}

@ -616,7 +616,7 @@ class MySpace
foreach ($all_datas as $row) {
$table -> addRow($row, 'align="right"');
}
$table -> display();
$table->display();
}
/**

@ -36,7 +36,7 @@ $isBoss = UserManager::userIsBossOfStudent(api_get_user_id(), $user_id);
if (!api_is_platform_admin(true) &&
!CourseManager :: is_course_teacher(api_get_user_id(), $courseCode) &&
!$isBoss &&
!Tracking :: is_allowed_to_coach_student(api_get_user_id(), $user_id) && !api_is_drh() && !api_is_course_tutor()
!Tracking::is_allowed_to_coach_student(api_get_user_id(), $user_id) && !api_is_drh() && !api_is_course_tutor()
) {
api_not_allowed(
api_get_origin() !== 'learnpath'
@ -71,7 +71,8 @@ $output = require_once api_get_path(SYS_CODE_PATH).'lp/lp_stats.php';
Display :: display_header($nameTools);
echo '<div class ="actions">';
echo '<a href="javascript:history.back();">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="javascript:history.back();">'.
Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="javascript: void(0);" onclick="javascript: window.print();">
'.Display::return_icon('printer.png', get_lang('Print'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_self().'?export=csv&'.Security::remove_XSS($_SERVER['QUERY_STRING']).'">
@ -82,6 +83,7 @@ $session_name = api_get_session_name($session_id);
$table_title = ($session_name ? Display::return_icon('session.png', get_lang('Session'), array(), ICON_SIZE_SMALL).' '.$session_name.' ' : ' ').
Display::return_icon('course.png', get_lang('Course'), array(), ICON_SIZE_SMALL).' '.$course_info['name'].' '.
Display::return_icon('user.png', get_lang('User'), array(), ICON_SIZE_SMALL).' '.$name;
echo Display::page_header($table_title);
echo Display::page_subheader(
'<h3>'.Display::return_icon(

@ -122,13 +122,13 @@ function get_users($from, $limit, $column, $direction)
$courseInfo = api_get_course_info($course_code);
$courseId = $courseInfo['real_id'];
if (CourseManager :: is_user_subscribed_in_course($student_id, $course_code, true)) {
$avg_time_spent += Tracking :: get_time_spent_on_the_course($student_id, $courseId, $_GET['id_session']);
$my_average = Tracking :: get_avg_student_score($student_id, $course_code);
if (CourseManager::is_user_subscribed_in_course($student_id, $course_code, true)) {
$avg_time_spent += Tracking::get_time_spent_on_the_course($student_id, $courseId, $_GET['id_session']);
$my_average = Tracking::get_avg_student_score($student_id, $course_code);
if (is_numeric($my_average)) {
$avg_student_score += $my_average;
}
$avg_student_progress += Tracking :: get_avg_student_progress($student_id, $course_code);
$avg_student_progress += Tracking::get_avg_student_progress($student_id, $course_code);
$nb_courses_student++;
}
}
@ -152,8 +152,8 @@ function get_users($from, $limit, $column, $direction)
$row[] = $student_data['lastname'];
$row[] = $student_data['firstname'];
}
$string_date = Tracking :: get_last_connection_date($student_id, true);
$first_date = Tracking :: get_first_connection_date($student_id);
$string_date = Tracking::get_last_connection_date($student_id, true);
$first_date = Tracking::get_first_connection_date($student_id);
$row[] = $first_date;
$row[] = $string_date;

@ -49,7 +49,6 @@ $usersInfo = [];
if ($session) {
$sessionCourses = $session->getCourses();
foreach ($sessionCourses as $sessionCourse) {
/** @var Course $course */
$course = $sessionCourse->getCourse();
@ -109,7 +108,8 @@ if ($session) {
}
$usersInfo[$user->getId()][$course->getId().'_last_sent_date'] = api_get_local_time(
$lastPublication->getSentDate()->getTimestamp());
$lastPublication->getSentDate()->getTimestamp()
);
}
}
}
@ -143,7 +143,6 @@ if (isset($_GET['export']) && $session && ($coursesInfo && $usersInfo)) {
Export::arrayToCsv($dataToExport, $fileName);
break;
}
exit;
}

@ -155,7 +155,6 @@ $(function() {
url: '".$url."',
data: 'a=session_info&load_empty_extra_fields=true&session_id=' + sessionId,
success: function(data) {
//console.log(data);
if (data.session_category_id > 0) {
$('#session_category').val(data.session_category_id);
$('#session_category').selectpicker('render');

@ -14,8 +14,8 @@ $id_session = intval($_GET['id_session']);
SessionManager::protectSession($id_session);
// Database Table Definitions
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
@ -23,9 +23,9 @@ if (empty($id_session)) {
api_not_allowed();
}
$page = isset($_GET['page']) ? intval($_GET['page']) : 0;
$page = isset($_GET['page']) ? intval($_GET['page']) : 0;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
$sort = isset($_GET['sort']) && in_array($_GET['sort'], array('title', 'nbr_users')) ? $_GET['sort'] : 'title';
$sort = isset($_GET['sort']) && in_array($_GET['sort'], array('title', 'nbr_users')) ? $_GET['sort'] : 'title';
$result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'");
@ -52,8 +52,8 @@ if ($action == 'delete') {
exit();
}
$limit = 20;
$from = $page * $limit;
$limit = 20;
$from = $page * $limit;
$sql = "SELECT c.id, c.code, c.title, nbr_users
FROM $tbl_session_rel_course, $tbl_course c
@ -64,7 +64,6 @@ $result = Database::query($sql);
$Courses = Database::store_result($result);
$tool_name = api_htmlentities($session_name, ENT_QUOTES, $charset).' : '.get_lang('CourseListInSession');
//$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList'));
$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']), "name" => get_lang('SessionOverview'));

@ -88,7 +88,6 @@ switch ($action) {
break;
}
$limit = 20;
$from = $page * $limit;
$is_western_name_order = api_is_western_name_order();
@ -117,7 +116,6 @@ $nbr_results = sizeof($users);
$tool_name = get_lang('Session').': '.$session_name.' - '.get_lang('Course').': '.$course_title;
//$interbreadcrumb[] = array("url" => "index.php","name" => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array("url" => "session_list.php", "name" => get_lang('SessionList'));
$interbreadcrumb[] = array(
'url' => "resume_session.php?id_session=".$id_session,
@ -125,7 +123,6 @@ $interbreadcrumb[] = array(
);
Display::display_header($tool_name);
echo Display::page_header($tool_name);
?>
<form method="post"

@ -11,7 +11,6 @@ require_once __DIR__.'/../inc/global.inc.php';
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
$formSent = 0;
// Crop picture plugin for session images

@ -146,8 +146,7 @@ if (isset($_POST['formSent'])) {
$sql = "SELECT DISTINCT c.code, sc.id, c_id
FROM $tbl_course c
INNER JOIN $tbl_session_course_user sc
ON c.id = sc.c_id
AND sc.session_id = '".$row['id']."'";
ON c.id = sc.c_id AND sc.session_id = '".$row['id']."'";
$rsCourses = Database::query($sql);

@ -13,13 +13,13 @@ api_protect_admin_script(true);
api_protect_limit_for_session_admin();
$form_sent = 0;
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_session_user = Database::get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tool_name = get_lang('ImportSessionListXMLCSV');
@ -46,9 +46,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
$session_counter = 0;
if ($file_type == 'xml') {
// XML
// SimpleXML for PHP5 deals with various encodings, but how many they are, what are version issues, do we need to waste time with configuration options?
// For avoiding complications we go some sort of "PHP4 way" - we convert the input xml-file into UTF-8 before passing it to the parser.
// Instead of:

@ -33,7 +33,11 @@ if (!empty($error_message)) {
echo Display::return_message($error_message, 'normal', false);
}
$form = new FormValidator('import_sessions', 'post', api_get_self(), null, array('enctype' => 'multipart/form-data'));
$form = new FormValidator(
'import_sessions',
'post', api_get_self(), null, array('enctype' => 'multipart/form-data')
);
$form->addElement('file', 'import_file', get_lang('ImportFileLocation'));
$form->addElement('checkbox', 'remove_old_relationships', null, get_lang('RemoveOldRelationships'));
//$form->addElement('checkbox', 'send_email', null, get_lang('SendMailToUsers'));

Loading…
Cancel
Save