Browse Source

Minor - format code.

Julio Montoya 10 years ago
parent
commit
4dd8d91be5
2 changed files with 52 additions and 28 deletions
  1. 21 14
      main/inc/lib/tracking.lib.php
  2. 31 14
      main/tracking/courseLog.php

+ 21 - 14
main/inc/lib/tracking.lib.php

@@ -149,7 +149,6 @@ class Tracking
         }
 
         $result_disabled_ext_all = true;
-
         $chapterTypes = learnpath::getChapterTypes();
 
         // Show lp items
@@ -884,17 +883,23 @@ class Tracking
                                         if ($action == 'classic') {
                                             if ($origin != 'tracking') {
                                                 if (!$is_allowed_to_edit && $result_disabled_ext_all) {
-                                                    $output .= '<td><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '"></td>';
+                                                    $output .= '<td>
+                                                            <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
+                                                            </td>';
                                                 } else {
-                                                    $output .= '<td><a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent">
-                                                <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '"></a></td>';
+                                                    $output .= '<td>
+                                                            <a href="../exercice/exercise_show.php?origin=' . $origin . '&id=' . $my_exe_id . '&cidReq=' . $courseCode . '" target="_parent">
+                                                            <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="' . get_lang('ShowAttempt') . '" title="' . get_lang('ShowAttempt') . '">
+                                                            </a></td>';
                                                 }
                                             } else {
                                                 if (!$is_allowed_to_edit && $result_disabled_ext_all) {
-                                                    $output .= '<td><img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>';
+                                                    $output .= '<td>
+                                                                <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz_na.gif" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></td>';
                                                 } else {
-                                                    $output .= '<td><a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent">
-                                                 <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>';
+                                                    $output .= '<td>
+                                                                    <a href="../exercice/exercise_show.php?cidReq=' . $courseCode . '&origin=correct_exercise_in_lp&id=' . $my_exe_id . '" target="_parent">
+                                                                    <img src="' . api_get_path(WEB_IMG_PATH) . 'quiz.gif" alt="' . get_lang('ShowAndQualifyAttempt') . '" title="' . get_lang('ShowAndQualifyAttempt') . '"></a></td>';
                                                 }
                                             }
                                         }
@@ -5592,12 +5597,14 @@ class TrackingCourseLog
     public function get_addtional_profile_information_of_field($field_id)
     {
     	// Database table definition
-    	$table_user             = Database::get_main_table(TABLE_MAIN_USER);
-    	$table_user_field_values     = Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES);
+        $table_user = Database::get_main_table(TABLE_MAIN_USER);
+        $table_user_field_values = Database::get_main_table(TABLE_MAIN_USER_FIELD_VALUES);
 
-    	$sql = "SELECT user.user_id, field.field_value FROM $table_user user, $table_user_field_values field
-            WHERE user.user_id = field.user_id
-            AND field.field_id='".intval($field_id)."'";
+    	$sql = "SELECT user.user_id, field.field_value
+    	        FROM $table_user user, $table_user_field_values field
+                WHERE
+                    user.user_id = field.user_id AND
+                    field.field_id='".intval($field_id)."'";
     	$result = Database::query($sql);
     	while($row = Database::fetch_array($result)) {
     		$return[$row['user_id']][] = $row['field_value'];
@@ -5619,7 +5626,7 @@ class TrackingCourseLog
      * @since    Nov 2009
      * @version    1.8.6.2
      */
-    public function get_addtional_profile_information_of_field_by_user($field_id, $users)
+    public static function get_addtional_profile_information_of_field_by_user($field_id, $users)
     {
     	// Database table definition
     	$table_user                 = Database::get_main_table(TABLE_MAIN_USER);
@@ -5627,7 +5634,7 @@ class TrackingCourseLog
     	$result_extra_field         = UserManager::get_extra_field_information($field_id);
 
     	if (!empty($users)) {
-    		if ($result_extra_field['field_type'] == USER_FIELD_TYPE_TAG ) {
+    		if ($result_extra_field['field_type'] == UserManager::USER_FIELD_TYPE_TAG ) {
     			foreach($users as $user_id) {
     				$user_result = UserManager::get_user_tags($user_id, $field_id);
     				$tag_list = array();

+ 31 - 14
main/tracking/courseLog.php

@@ -5,8 +5,6 @@
  *	@package chamilo.tracking
  */
 
-/* INIT SECTION */
-
 $pathopen = isset($_REQUEST['pathopen']) ? $_REQUEST['pathopen'] : null;
 
 // Language files that need to be included.
@@ -183,17 +181,25 @@ Display::display_header($nameTools, 'Tracking');
 // getting all the students of the course
 if (empty($session_id)) {
     // Registered students in a course outside session.
-    $a_students = CourseManager::get_student_list_from_course_code(api_get_course_id());
+    $a_students = CourseManager::get_student_list_from_course_code(
+        api_get_course_id()
+    );
 } else {
     // Registered students in session.
-    $a_students = CourseManager::get_student_list_from_course_code(api_get_course_id(), true, api_get_session_id());
+    $a_students = CourseManager::get_student_list_from_course_code(
+        api_get_course_id(),
+        true,
+        api_get_session_id()
+    );
 }
 
 $nbStudents = count($a_students);
 $extra_info = array();
 
 // Getting all the additional information of an additional profile field.
-if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_profile_field'])) {
+if (isset($_GET['additional_profile_field']) &&
+    is_numeric($_GET['additional_profile_field'])
+) {
     $user_array = array();
     foreach ($a_students as $key => $item) {
         $user_array[] = $key;
@@ -203,20 +209,24 @@ if (isset($_GET['additional_profile_field']) && is_numeric($_GET['additional_pro
         $_GET['additional_profile_field'],
         $user_array
     );
-    $extra_info = UserManager::get_extra_field_information($_GET['additional_profile_field']);
+
+    $extra_info = UserManager::get_extra_field_information(
+        $_GET['additional_profile_field']
+    );
 }
 
 /* MAIN CODE */
 
 echo '<div class="actions">';
 
-echo Display::return_icon('user_na.png', get_lang('StudentsTracking'), array(), 32);
-echo Display::url(Display::return_icon('course.png', get_lang('CourseTracking'), array(), 32), 'course_log_tools.php?'.api_get_cidreq());
-echo Display::url(Display::return_icon('tools.png', get_lang('ResourcesTracking'), array(), 32), 'course_log_resources.php?'.api_get_cidreq());
-echo Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), 32), api_get_path(WEB_CODE_PATH).'tracking/exams.php?'.api_get_cidreq());
+echo Display::return_icon('user_na.png', get_lang('StudentsTracking'), array(), ICON_SIZE_MEDIUM);
+echo Display::url(Display::return_icon('course.png', get_lang('CourseTracking'), array(), ICON_SIZE_MEDIUM), 'course_log_tools.php?'.api_get_cidreq());
+echo Display::url(Display::return_icon('tools.png', get_lang('ResourcesTracking'), array(), ICON_SIZE_MEDIUM), 'course_log_resources.php?'.api_get_cidreq());
+echo Display::url(Display::return_icon('quiz.png', get_lang('ExamTracking'), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH).'tracking/exams.php?'.api_get_cidreq());
 
 echo '<span style="float:right; padding-top:0px;">';
-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="javascript: void(0);" onclick="javascript: window.print();">'.
+    Display::return_icon('printer.png', get_lang('Print'),'',ICON_SIZE_MEDIUM).'</a>';
 
 $addional_param = '';
 if (isset($_GET['additional_profile_field'])) {
@@ -292,7 +302,6 @@ if (!empty($coaches)) {
     echo $coaches;
 }
 
-
 $sessionList = SessionManager::get_session_by_course($courseInfo['code']);
 if (!empty($sessionList)) {
     echo Display::page_subheader2(get_lang('SessionList'));
@@ -312,7 +321,10 @@ $is_western_name_order = api_is_western_name_order();
 if (count($a_students) > 0) {
     $form = new FormValidator('reminder_form', 'get', api_get_path(REL_CODE_PATH).'announcements/announcements.php');
     $renderer = $form->defaultRenderer();
-    $renderer->setElementTemplate('<span>{label} {element}</span>&nbsp;<button class="save" type="submit">'.get_lang('SendNotification').'</button>','since');
+    $renderer->setElementTemplate(
+        '<span>{label} {element}</span>&nbsp;<button class="save" type="submit">'.get_lang('SendNotification').'</button>',
+        'since'
+    );
     $options = array (
         2 => '2 '.get_lang('Days'),
         3 => '3 '.get_lang('Days'),
@@ -325,7 +337,12 @@ if (count($a_students) > 0) {
         'never' => get_lang('Never')
     );
 
-    $el = $form->addElement('select', 'since', '<img width="ICON_SIZE_SMALL" align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" border="0" />'.get_lang('RemindInactivesLearnersSince'), $options);
+    $el = $form->addElement(
+        'select',
+        'since',
+        '<img width="ICON_SIZE_SMALL" align="middle" src="'.api_get_path(WEB_IMG_PATH).'messagebox_warning.gif" border="0" />'.get_lang('RemindInactivesLearnersSince'),
+        $options
+    );
     $el->setSelected(7);
 
     $form->addElement('hidden', 'action', 'add');