Completed
Pull Request — 1.11.x (#1622)
by José
95:13 queued 68:43
created
main/badge/criteria.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         Display::return_message(get_lang('SkillNotFound'), 'error')
16 16
     );
17 17
 
18
-    header('Location: ' . api_get_path(WEB_PATH));
18
+    header('Location: '.api_get_path(WEB_PATH));
19 19
     exit;
20 20
 }
21 21
 
Please login to merge, or discard this patch.
main/help/allowed_html_tags.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,10 +53,10 @@
 block discarded – undo
53 53
 $table_header[] = array('tag', true);
54 54
 $table_header[] = array('attributes', false);
55 55
 foreach ($tags as $tag => & $attributes) {
56
-	$row = array();
57
-	$row[] = '<kbd>'.$tag.'</kbd>';
58
-	$row[] = '<kbd>&nbsp;'.implode(', ', array_keys($attributes)).'</kbd>';
59
-	$table_data[] = $row;
56
+    $row = array();
57
+    $row[] = '<kbd>'.$tag.'</kbd>';
58
+    $row[] = '<kbd>&nbsp;'.implode(', ', array_keys($attributes)).'</kbd>';
59
+    $table_data[] = $row;
60 60
 }
61 61
 Display::display_sortable_table($table_header, $table_data, array(), array(), array('fullpage' => intval($_GET['fullpage'])));
62 62
 ?>
Please login to merge, or discard this patch.
main/help/faq.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,9 +41,9 @@
 block discarded – undo
41 41
         $form->display();
42 42
     }
43 43
 } else {
44
-	$faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
45
-	$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
46
-	echo $faq_content;
44
+    $faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
45
+    $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
46
+    echo $faq_content;
47 47
 }
48 48
 
49 49
 Display::display_footer();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         array('ToolbarSet' => 'FAQ', 'Width' => '100%', 'Height' => '300')
30 30
     );
31 31
     $form->addButtonSave(get_lang('Ok'), 'faq_submit');
32
-    $faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html');
32
+    $faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/faq.html');
33 33
     $faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
34 34
     $form->setDefaults(array('faq_content' => $faq_content));
35 35
     if ($form->validate()) {
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         $form->display();
48 48
     }
49 49
 } else {
50
-	$faq_content = @(string)file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
50
+	$faq_content = @(string) file_get_contents(api_get_path(SYS_APP_PATH).'home/'.$faq_file);
51 51
 	$faq_content = api_to_system_encoding($faq_content, api_detect_encoding(strip_tags($faq_content)));
52 52
 	echo $faq_content;
53 53
 }
Please login to merge, or discard this patch.
main/reports/index.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,14 +134,14 @@
 block discarded – undo
134 134
                         <select class="input_field_12em link required" name="type" id="type">
135 135
 <?php
136 136
 foreach ($reports_template as $key => $value) {
137
-	echo '<option value="'.$key.'">'.$value['description'].'</option>';
137
+    echo '<option value="'.$key.'">'.$value['description'].'</option>';
138 138
 }
139 139
 ?>
140 140
                         </select><br />
141 141
                     </span>
142 142
 <?php
143 143
 foreach ($reports_template as $key => $value) {
144
-	echo $value['wizard'];
144
+    echo $value['wizard'];
145 145
 }
146 146
 ?>
147 147
                     <span id="format" class="step submit_step">
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
 $this_section = SECTION_REPORTS;
23 23
 
24 24
 // setting the name of the tool
25
-$tool_name=get_lang('Reports');
25
+$tool_name = get_lang('Reports');
26 26
 
27 27
 // Displaying the header
28 28
 foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js)
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,8 +25,9 @@
 block discarded – undo
25 25
 $tool_name=get_lang('Reports');
26 26
 
27 27
 // Displaying the header
28
-foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js)
28
+foreach (array('jquery.ba-bbq.min.js', 'jquery.validate.js', 'jquery.form.js', 'jquery.form.wizard.js', 'jquery.dataTables.min.js') as $js) {
29 29
     $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/'.$js.'" type="text/javascript" language="javascript"></script>'."\n";
30
+}
30 31
 
31 32
 // FIXME
32 33
 $htmlHeadXtra[] = '    <style type="text/css">
Please login to merge, or discard this patch.
main/reports/multiquery.lib.php 3 patches
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -2,62 +2,62 @@
 block discarded – undo
2 2
 
3 3
 // get fields informations
4 4
 function multiquery_query($array) {
5
-	$result = array();
6
-	$field = 0;
7
-	for ($i = 0; $i <sizeof($array); $i++) {
8
-		// mysql handler
9
-		$result[$i]['mysql'] = mysql_query($array[$i]);
10
-
11
-		if (! $result[$i]['mysql'])
12
-			die("error in query $i : ".$array[$i]);
13
-
14
-		// fields
15
-		$result[$i]['num_fields'] = mysql_num_fields($result[$i]['mysql']);
16
-		for ($j = 0; $j < $result[$i]['num_fields']; $j++) {
17
-			$name = mysql_field_name($result[$i]['mysql'], $j);
18
-			$result['field'][$field]['query']=$i;
19
-			$result['field'][$field]['name']=$name;
20
-			$result['field'][$field]['id']=$j;
21
-			$result['field_assoc'][$name][$field];
22
-			$field++;
23
-		}
24
-	}
25
-	$result['num_queries'] = sizeof($array);
26
-	// rows
27
-	$numberOfResult = mysql_num_rows($result[0]['mysql']);
28
-	for ($i = 1; $i <$result['num_queries']; $i++) 
29
-		if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
30
-			die("wrong number of row: $numberOfResult vs ".
31
-				mysql_num_rows($result[$i]['mysql'])." on query $i");
32
-
33
-	$result['num_rows'] = $numberOfResult;
34
-	$result['num_fields'] = $field;
35
-
36
-	return $result;
5
+    $result = array();
6
+    $field = 0;
7
+    for ($i = 0; $i <sizeof($array); $i++) {
8
+        // mysql handler
9
+        $result[$i]['mysql'] = mysql_query($array[$i]);
10
+
11
+        if (! $result[$i]['mysql'])
12
+            die("error in query $i : ".$array[$i]);
13
+
14
+        // fields
15
+        $result[$i]['num_fields'] = mysql_num_fields($result[$i]['mysql']);
16
+        for ($j = 0; $j < $result[$i]['num_fields']; $j++) {
17
+            $name = mysql_field_name($result[$i]['mysql'], $j);
18
+            $result['field'][$field]['query']=$i;
19
+            $result['field'][$field]['name']=$name;
20
+            $result['field'][$field]['id']=$j;
21
+            $result['field_assoc'][$name][$field];
22
+            $field++;
23
+        }
24
+    }
25
+    $result['num_queries'] = sizeof($array);
26
+    // rows
27
+    $numberOfResult = mysql_num_rows($result[0]['mysql']);
28
+    for ($i = 1; $i <$result['num_queries']; $i++) 
29
+        if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
30
+            die("wrong number of row: $numberOfResult vs ".
31
+                mysql_num_rows($result[$i]['mysql'])." on query $i");
32
+
33
+    $result['num_rows'] = $numberOfResult;
34
+    $result['num_fields'] = $field;
35
+
36
+    return $result;
37 37
 }
38 38
 
39 39
 function multiquery_num_rows(&$mq_h) {
40
-	return $mq_h['num_rows'];
40
+    return $mq_h['num_rows'];
41 41
 }
42 42
 
43 43
 function multiquery_num_fields(&$mq_h) {
44
-	return $mq_h['num_fields'];
44
+    return $mq_h['num_fields'];
45 45
 }
46 46
 
47 47
 function multiquery_field_name(&$mq_h, $id) {
48
-	return $mq_h['field'][$id]['name'];
48
+    return $mq_h['field'][$id]['name'];
49 49
 }
50 50
 
51 51
 function multiquery_fetch_row(&$mq_h) {
52
-	$result = array();
53
-	$pos = 0;
54
-	for ($i = 0; $i < $mq_h['num_queries']; $i++) {
55
-		$row = mysql_fetch_row($mq_h[$i]['mysql']);
56
-		if (!$row) return false; // last line
57
-		for ($j = 0; $j < sizeof($row); $j++) {
58
-			$result[$pos] = $row[$j];
59
-			$pos++;
60
-		}
61
-	}
62
-	return $result;
52
+    $result = array();
53
+    $pos = 0;
54
+    for ($i = 0; $i < $mq_h['num_queries']; $i++) {
55
+        $row = mysql_fetch_row($mq_h[$i]['mysql']);
56
+        if (!$row) return false; // last line
57
+        for ($j = 0; $j < sizeof($row); $j++) {
58
+            $result[$pos] = $row[$j];
59
+            $pos++;
60
+        }
61
+    }
62
+    return $result;
63 63
 }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -4,20 +4,20 @@  discard block
 block discarded – undo
4 4
 function multiquery_query($array) {
5 5
 	$result = array();
6 6
 	$field = 0;
7
-	for ($i = 0; $i <sizeof($array); $i++) {
7
+	for ($i = 0; $i < sizeof($array); $i++) {
8 8
 		// mysql handler
9 9
 		$result[$i]['mysql'] = mysql_query($array[$i]);
10 10
 
11
-		if (! $result[$i]['mysql'])
11
+		if (!$result[$i]['mysql'])
12 12
 			die("error in query $i : ".$array[$i]);
13 13
 
14 14
 		// fields
15 15
 		$result[$i]['num_fields'] = mysql_num_fields($result[$i]['mysql']);
16 16
 		for ($j = 0; $j < $result[$i]['num_fields']; $j++) {
17 17
 			$name = mysql_field_name($result[$i]['mysql'], $j);
18
-			$result['field'][$field]['query']=$i;
19
-			$result['field'][$field]['name']=$name;
20
-			$result['field'][$field]['id']=$j;
18
+			$result['field'][$field]['query'] = $i;
19
+			$result['field'][$field]['name'] = $name;
20
+			$result['field'][$field]['id'] = $j;
21 21
 			$result['field_assoc'][$name][$field];
22 22
 			$field++;
23 23
 		}
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	$result['num_queries'] = sizeof($array);
26 26
 	// rows
27 27
 	$numberOfResult = mysql_num_rows($result[0]['mysql']);
28
-	for ($i = 1; $i <$result['num_queries']; $i++) 
28
+	for ($i = 1; $i < $result['num_queries']; $i++) 
29 29
 		if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
30 30
 			die("wrong number of row: $numberOfResult vs ".
31 31
 				mysql_num_rows($result[$i]['mysql'])." on query $i");
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@  discard block
 block discarded – undo
8 8
 		// mysql handler
9 9
 		$result[$i]['mysql'] = mysql_query($array[$i]);
10 10
 
11
-		if (! $result[$i]['mysql'])
12
-			die("error in query $i : ".$array[$i]);
11
+		if (! $result[$i]['mysql']) {
12
+					die("error in query $i : ".$array[$i]);
13
+		}
13 14
 
14 15
 		// fields
15 16
 		$result[$i]['num_fields'] = mysql_num_fields($result[$i]['mysql']);
@@ -25,10 +26,11 @@  discard block
 block discarded – undo
25 26
 	$result['num_queries'] = sizeof($array);
26 27
 	// rows
27 28
 	$numberOfResult = mysql_num_rows($result[0]['mysql']);
28
-	for ($i = 1; $i <$result['num_queries']; $i++) 
29
-		if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
29
+	for ($i = 1; $i <$result['num_queries']; $i++) {
30
+			if ($numberOfResult != mysql_num_rows($result[$i]['mysql']))
30 31
 			die("wrong number of row: $numberOfResult vs ".
31 32
 				mysql_num_rows($result[$i]['mysql'])." on query $i");
33
+	}
32 34
 
33 35
 	$result['num_rows'] = $numberOfResult;
34 36
 	$result['num_fields'] = $field;
@@ -53,7 +55,10 @@  discard block
 block discarded – undo
53 55
 	$pos = 0;
54 56
 	for ($i = 0; $i < $mq_h['num_queries']; $i++) {
55 57
 		$row = mysql_fetch_row($mq_h[$i]['mysql']);
56
-		if (!$row) return false; // last line
58
+		if (!$row) {
59
+		    return false;
60
+		}
61
+		// last line
57 62
 		for ($j = 0; $j < sizeof($row); $j++) {
58 63
 			$result[$pos] = $row[$j];
59 64
 			$pos++;
Please login to merge, or discard this patch.
main/reports/modules/quiz.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -7,27 +7,27 @@
 block discarded – undo
7 7
 }
8 8
 
9 9
 function reports_modules_quiz_init_forEachCourses($course_code, $course_id, $course_db) {
10
-	global $reports_modules;
10
+    global $reports_modules;
11 11
 	
12
-	$reports_modules_quiz_toolid = reports_getToolId(TOOL_QUIZ);
12
+    $reports_modules_quiz_toolid = reports_getToolId(TOOL_QUIZ);
13 13
 
14
-	array_push($reports_modules['quiz'], 
15
-	  array('keys_query' =>  
16
-		'select '.$course_id.' as course_id, '.
17
-		$reports_modules_quiz_toolid.' as tool_id, '.
18
-		'q.id as child_id, q.title as child_name, '.
19
-		"'".$course_code."'".' as course_code from '.Database::get_course_table(TABLE_QUIZ_TEST).' q ',
20
-		'values_query_function' => 'reports_modules_quiz_quizVal'));		
14
+    array_push($reports_modules['quiz'], 
15
+        array('keys_query' =>  
16
+        'select '.$course_id.' as course_id, '.
17
+        $reports_modules_quiz_toolid.' as tool_id, '.
18
+        'q.id as child_id, q.title as child_name, '.
19
+        "'".$course_code."'".' as course_code from '.Database::get_course_table(TABLE_QUIZ_TEST).' q ',
20
+        'values_query_function' => 'reports_modules_quiz_quizVal'));		
21 21
 }
22 22
 
23 23
 function reports_modules_quiz_quizVal($quiz, $key_id) {
24
-	$courseId = api_get_course_int_id($quiz['course_code']);
25
-	return array('type'=> 'sql', 'sql' => 
26
-			'select '.$key_id.', exe_user_id as uid, '.
27
-			'session_id, -1 as attempt, exe_result as score, '.
28
-			REPORTS_PROGRESS_COMPLETED.' as progress, '.
29
-			'exe_duration as time, exe_date as ts from '.
30
-			Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).
31
-			' where c_id = ' . $courseId .
32
-			' and exe_exo_id='.$quiz['child_id']);
24
+    $courseId = api_get_course_int_id($quiz['course_code']);
25
+    return array('type'=> 'sql', 'sql' => 
26
+            'select '.$key_id.', exe_user_id as uid, '.
27
+            'session_id, -1 as attempt, exe_result as score, '.
28
+            REPORTS_PROGRESS_COMPLETED.' as progress, '.
29
+            'exe_duration as time, exe_date as ts from '.
30
+            Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).
31
+            ' where c_id = ' . $courseId .
32
+            ' and exe_exo_id='.$quiz['child_id']);
33 33
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php 
2 2
 
3
-$reports_modules['quiz'] = array ();
3
+$reports_modules['quiz'] = array();
4 4
 
5 5
 
6 6
 function reports_modules_quiz_init() {
@@ -28,6 +28,6 @@  discard block
 block discarded – undo
28 28
 			REPORTS_PROGRESS_COMPLETED.' as progress, '.
29 29
 			'exe_duration as time, exe_date as ts from '.
30 30
 			Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).
31
-			' where c_id = ' . $courseId .
31
+			' where c_id = '.$courseId.
32 32
 			' and exe_exo_id='.$quiz['child_id']);
33 33
 }
Please login to merge, or discard this patch.
main/reports/modules/scorm.php 2 patches
Indentation   +100 added lines, -100 removed lines patch added patch discarded remove patch
@@ -7,117 +7,117 @@
 block discarded – undo
7 7
 }
8 8
 
9 9
 function reports_modules_scorm_init_forEachCourses($course_code, $course_id, $course_db) {
10
-	global $reports_modules;
10
+    global $reports_modules;
11 11
 	
12
-	$reports_modules_scorm_toolid = reports_getToolId(TOOL_LEARNPATH);
12
+    $reports_modules_scorm_toolid = reports_getToolId(TOOL_LEARNPATH);
13 13
 
14
-	// package level
15
-	array_push($reports_modules['scorm'], 
16
-	  array('keys_query' =>  
17
-		'select '.$course_id.' as course_id, '.
18
-		$reports_modules_scorm_toolid.' as tool_id, '.
19
-		'lp.id as child_id, lp.name as child_name, '.
20
-		"'".$course_db."'".' as course_db from '.
21
-		Database::get_course_table(TABLE_LP_MAIN).' lp',
22
-		'values_query_function' => 'reports_modules_scorm_packageVal'));		
14
+    // package level
15
+    array_push($reports_modules['scorm'], 
16
+        array('keys_query' =>  
17
+        'select '.$course_id.' as course_id, '.
18
+        $reports_modules_scorm_toolid.' as tool_id, '.
19
+        'lp.id as child_id, lp.name as child_name, '.
20
+        "'".$course_db."'".' as course_db from '.
21
+        Database::get_course_table(TABLE_LP_MAIN).' lp',
22
+        'values_query_function' => 'reports_modules_scorm_packageVal'));		
23 23
 
24
-	// sco level
25
-	array_push($reports_modules['scorm'], 
26
-	  array('keys_query' =>  
27
-		'select '.$course_id.' as course_id, '.
28
-		$reports_modules_scorm_toolid.' as tool_id, '.
29
-		'lp.id as child_id, lp.name as child_name, '.
30
-		'lpi.id as subchild_id, lpi.title as subchild_name, '.
31
-		"'".$course_db."'".' as course_db from '.
32
-		Database::get_course_table(TABLE_LP_MAIN, $course_db).
33
-		' lp,'.
34
-		Database::get_course_table(TABLE_LP_ITEM, $course_db).
35
-		' lpi where lp.id = lpi.lp_id',
36
-		'values_query_function' => 'reports_modules_scorm_scoVal'));		
24
+    // sco level
25
+    array_push($reports_modules['scorm'], 
26
+        array('keys_query' =>  
27
+        'select '.$course_id.' as course_id, '.
28
+        $reports_modules_scorm_toolid.' as tool_id, '.
29
+        'lp.id as child_id, lp.name as child_name, '.
30
+        'lpi.id as subchild_id, lpi.title as subchild_name, '.
31
+        "'".$course_db."'".' as course_db from '.
32
+        Database::get_course_table(TABLE_LP_MAIN, $course_db).
33
+        ' lp,'.
34
+        Database::get_course_table(TABLE_LP_ITEM, $course_db).
35
+        ' lpi where lp.id = lpi.lp_id',
36
+        'values_query_function' => 'reports_modules_scorm_scoVal'));		
37 37
 
38
-	// objectives level
39
-	array_push($reports_modules['scorm'], 
40
-	  array('keys_query' =>  
41
-		'select distinct '.$course_id.' as course_id, '.
42
-		$reports_modules_scorm_toolid.' as tool_id, '.
43
-		'lp.id as child_id, lp.name as child_name, '.
44
-		'lpi.id as subchild_id, '.
45
-		'lpi.title as subchild_name, '.
46
-		'null as subsubchild_id, '.
47
-		'lpivo.objective_id as subsubchild_name, '.
48
-		"'".$course_db."'".' as course_db from '.
49
-		Database::get_course_table(TABLE_LP_MAIN, $course_db).
50
-		' lp,'.
51
-		Database::get_course_table(TABLE_LP_ITEM, $course_db).
52
-		' lpi, '.
53
-		Database::get_course_table(TABLE_LP_ITEM_VIEW, $course_db).
54
-		' lpiv, '.
55
-		Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $course_db).
56
-		' lpivo '.
57
-		'where lp.id = lpi.lp_id '.
58
-		'and lpi.id = lpiv.lp_item_id '.
59
-		'and lpiv.id = lpivo.lp_iv_id ',
60
-		'values_query_function' => 'reports_modules_scorm_objVal'));		
38
+    // objectives level
39
+    array_push($reports_modules['scorm'], 
40
+        array('keys_query' =>  
41
+        'select distinct '.$course_id.' as course_id, '.
42
+        $reports_modules_scorm_toolid.' as tool_id, '.
43
+        'lp.id as child_id, lp.name as child_name, '.
44
+        'lpi.id as subchild_id, '.
45
+        'lpi.title as subchild_name, '.
46
+        'null as subsubchild_id, '.
47
+        'lpivo.objective_id as subsubchild_name, '.
48
+        "'".$course_db."'".' as course_db from '.
49
+        Database::get_course_table(TABLE_LP_MAIN, $course_db).
50
+        ' lp,'.
51
+        Database::get_course_table(TABLE_LP_ITEM, $course_db).
52
+        ' lpi, '.
53
+        Database::get_course_table(TABLE_LP_ITEM_VIEW, $course_db).
54
+        ' lpiv, '.
55
+        Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $course_db).
56
+        ' lpivo '.
57
+        'where lp.id = lpi.lp_id '.
58
+        'and lpi.id = lpiv.lp_item_id '.
59
+        'and lpiv.id = lpivo.lp_iv_id ',
60
+        'values_query_function' => 'reports_modules_scorm_objVal'));		
61 61
 }
62 62
 
63 63
 function reports_modules_scorm_packageVal($scorm, $key_id) {
64
-	return array('type'=> 'sql', 'sql' => 
65
-			'select '.$key_id.', user_id as uid, '.
66
-			'session_id, view_count as attempt, null as score, '.
67
-			'progress as progress, '.
68
-			'null as time, null as ts from '.
69
-			Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
70
-			' where lp_id = '.$scorm['child_id']);
64
+    return array('type'=> 'sql', 'sql' => 
65
+            'select '.$key_id.', user_id as uid, '.
66
+            'session_id, view_count as attempt, null as score, '.
67
+            'progress as progress, '.
68
+            'null as time, null as ts from '.
69
+            Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
70
+            ' where lp_id = '.$scorm['child_id']);
71 71
 }
72 72
 
73 73
 function reports_modules_scorm_scoVal($scorm, $key_id) {
74
-	return array('type'=> 'sql', 'sql' => 
75
-			'select '.$key_id.', lpv.user_id as uid, '.
76
-			'lpv.session_id, lpiv.view_count as attempt, '.
77
-			'lpiv.score as score, '.
78
-			'(case lpiv.status '.
79
-				'when "incomplete" then 0 '.
80
-				'when "completed" then 1 '.
81
-				'when "passed" then 2 '.
82
-				'when "failed" then 3 '.
83
-				'when "browsed" then 4 '.
84
-				'when "not attempted" then 5 '.
85
-				'else 6 '.
86
-			'end) as progress, '.
87
-			'lpiv.total_time as time, null as ts from '.
88
-			Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
89
-			' lpv, '.
90
-			Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']).
91
-			' lpiv '.
92
-			' where lpv.lp_id = '.$scorm['child_id'].
93
-			' and lpiv.lp_item_id = '.$scorm['subchild_id'].
94
-			' and lpiv.lp_view_id = lpv.id');
74
+    return array('type'=> 'sql', 'sql' => 
75
+            'select '.$key_id.', lpv.user_id as uid, '.
76
+            'lpv.session_id, lpiv.view_count as attempt, '.
77
+            'lpiv.score as score, '.
78
+            '(case lpiv.status '.
79
+                'when "incomplete" then 0 '.
80
+                'when "completed" then 1 '.
81
+                'when "passed" then 2 '.
82
+                'when "failed" then 3 '.
83
+                'when "browsed" then 4 '.
84
+                'when "not attempted" then 5 '.
85
+                'else 6 '.
86
+            'end) as progress, '.
87
+            'lpiv.total_time as time, null as ts from '.
88
+            Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
89
+            ' lpv, '.
90
+            Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']).
91
+            ' lpiv '.
92
+            ' where lpv.lp_id = '.$scorm['child_id'].
93
+            ' and lpiv.lp_item_id = '.$scorm['subchild_id'].
94
+            ' and lpiv.lp_view_id = lpv.id');
95 95
 }
96 96
 
97 97
 function reports_modules_scorm_objVal($scorm, $key_id) {
98
-	return array('type'=> 'sql', 'sql' => 
99
-			'select '.$key_id.', lpv.user_id as uid, '.
100
-			'lpv.session_id, lpiv.view_count as attempt, '.
101
-			'lpivo.score_raw as score, '.
102
-			'(case lpivo.status '.
103
-				'when "incomplete" then 0 '.
104
-				'when "completed" then 1 '.
105
-				'when "passed" then 2 '.
106
-				'when "failed" then 3 '.
107
-				'when "browsed" then 4 '.
108
-				'when "not attempted" then 5 '.
109
-				'else 6 '.
110
-			'end) as progress, '.
111
-			'null as time, null as ts from '.
112
-			Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
113
-			' lpv, '.
114
-			Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']).
115
-			' lpiv, '.
116
-			Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $scorm['course_db']).
117
-			' lpivo '.
118
-			' where lpv.lp_id = '.$scorm['child_id'].
119
-			' and lpiv.lp_item_id = '.$scorm['subchild_id'].
120
-			' and lpivo.objective_id = "'.$scorm['subsubchild_name'].'" '.
121
-			' and lpiv.lp_view_id = lpv.id'.
122
-			' and lpivo.lp_iv_id=lpiv.id');
98
+    return array('type'=> 'sql', 'sql' => 
99
+            'select '.$key_id.', lpv.user_id as uid, '.
100
+            'lpv.session_id, lpiv.view_count as attempt, '.
101
+            'lpivo.score_raw as score, '.
102
+            '(case lpivo.status '.
103
+                'when "incomplete" then 0 '.
104
+                'when "completed" then 1 '.
105
+                'when "passed" then 2 '.
106
+                'when "failed" then 3 '.
107
+                'when "browsed" then 4 '.
108
+                'when "not attempted" then 5 '.
109
+                'else 6 '.
110
+            'end) as progress, '.
111
+            'null as time, null as ts from '.
112
+            Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']).
113
+            ' lpv, '.
114
+            Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']).
115
+            ' lpiv, '.
116
+            Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $scorm['course_db']).
117
+            ' lpivo '.
118
+            ' where lpv.lp_id = '.$scorm['child_id'].
119
+            ' and lpiv.lp_item_id = '.$scorm['subchild_id'].
120
+            ' and lpivo.objective_id = "'.$scorm['subsubchild_name'].'" '.
121
+            ' and lpiv.lp_view_id = lpv.id'.
122
+            ' and lpivo.lp_iv_id=lpiv.id');
123 123
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3
-$reports_modules['scorm'] = array ();
3
+$reports_modules['scorm'] = array();
4 4
 
5 5
 
6 6
 function reports_modules_scorm_init() {
Please login to merge, or discard this patch.
main/reports/modules/course.php 2 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -7,23 +7,23 @@
 block discarded – undo
7 7
 }
8 8
 
9 9
 function reports_modules_course_init_forEachCourses($course_code, $course_id, $course_db) {
10
-	global $reports_modules;
10
+    global $reports_modules;
11 11
 
12 12
 //	$reports_modules_course_toolid = reports_getToolId(TOOL_QUIZ);
13 13
 
14
-	array_push($reports_modules['course'],
15
-	  array('keys_query' =>
16
-		'select '.$course_id.' as course_id, "'.$course_code.'" as course_code',
17
-		'values_query_function' => 'reports_modules_course_val'));
14
+    array_push($reports_modules['course'],
15
+        array('keys_query' =>
16
+        'select '.$course_id.' as course_id, "'.$course_code.'" as course_code',
17
+        'values_query_function' => 'reports_modules_course_val'));
18 18
 }
19 19
 
20 20
 function reports_modules_course_val($course, $key_id) {
21
-	return array('type'=> 'sql', 'sql' =>
22
-			'select '.$key_id.', user_id as uid, '.
23
-			'-1 as session_id, -1 as attempt, null as score, '.
24
-			'NULL as progress, '.
25
-			'(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from '.
26
-			Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS).
27
-			' where c_id = ' . $course['real_id'] .
28
-			' group by user_id');
21
+    return array('type'=> 'sql', 'sql' =>
22
+            'select '.$key_id.', user_id as uid, '.
23
+            '-1 as session_id, -1 as attempt, null as score, '.
24
+            'NULL as progress, '.
25
+            '(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from '.
26
+            Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS).
27
+            ' where c_id = ' . $course['real_id'] .
28
+            ' group by user_id');
29 29
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-$reports_modules['course'] = array ();
3
+$reports_modules['course'] = array();
4 4
 
5 5
 
6 6
 function reports_modules_course_init() {
@@ -24,6 +24,6 @@  discard block
 block discarded – undo
24 24
 			'NULL as progress, '.
25 25
 			'(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from '.
26 26
 			Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS).
27
-			' where c_id = ' . $course['real_id'] .
27
+			' where c_id = '.$course['real_id'].
28 28
 			' group by user_id');
29 29
 }
Please login to merge, or discard this patch.
main/reports/templates/courseArticulate.reports.php 2 patches
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 $reports_template['CourseArticulate'] = array(
4
-	'description' => 'CourseArticulate',
5
-	'getSQL' => 'reports_template_CourseArticulate_getSQL',
6
-	'wizard' =>
4
+    'description' => 'CourseArticulate',
5
+    'getSQL' => 'reports_template_CourseArticulate_getSQL',
6
+    'wizard' =>
7 7
 '
8 8
 <span id="CourseArticulate" class="step">
9 9
 	<span class="font_normal_07em_black">This report does not need any particular settings</span><br />
@@ -12,113 +12,113 @@  discard block
 block discarded – undo
12 12
 ');
13 13
 
14 14
 function reports_template_CourseArticulate_getSQL() {
15
-	// settings
15
+    // settings
16 16
 
17 17
 
18
-	// Nom, prenom
19
-	$query = 'select u.lastname as "Last name", u.firstname as "First name" ';
20
-	$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
21
-	$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
22
-	$query .= ' order by u.user_id ';
23
-	$queries[0] = $query;
24
-	$extraFieldType = \Chamilo\CoreBundle\Entity\ExtraField::USER_FIELD_TYPE;
25
-	// Custom Field
26
-	foreach (array("tags" => "tags") as $k => $v) { // FIXME
27
-		$query = 'select ufv.value  as "'.$v.'" ';
28
-		$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
29
-		$query .= 'left join'.Database::get_main_table(TABLE_EXTRA_FIELD).' uf ';
30
-		$query .= ' on uf.variable ="'.$k.'" ';
31
-		$query .= 'left outer join '.Database::get_main_table(TABLE_EXTRA_FIELD_VALUES).' ufv ';
32
-		$query .= ' on ufv.item_id = u.user_id and ufv.field_id = uf.id ';
33
-		$query .= 'where ufv.extra_field_type = '.$extraFieldType.' AND u.user_id in ('.reports_getVisibilitySQL().') ';
34
-		$query .= ' order by u.user_id ';
35
-		$queries[] = $query;
36
-	}
18
+    // Nom, prenom
19
+    $query = 'select u.lastname as "Last name", u.firstname as "First name" ';
20
+    $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
21
+    $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
22
+    $query .= ' order by u.user_id ';
23
+    $queries[0] = $query;
24
+    $extraFieldType = \Chamilo\CoreBundle\Entity\ExtraField::USER_FIELD_TYPE;
25
+    // Custom Field
26
+    foreach (array("tags" => "tags") as $k => $v) { // FIXME
27
+        $query = 'select ufv.value  as "'.$v.'" ';
28
+        $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
29
+        $query .= 'left join'.Database::get_main_table(TABLE_EXTRA_FIELD).' uf ';
30
+        $query .= ' on uf.variable ="'.$k.'" ';
31
+        $query .= 'left outer join '.Database::get_main_table(TABLE_EXTRA_FIELD_VALUES).' ufv ';
32
+        $query .= ' on ufv.item_id = u.user_id and ufv.field_id = uf.id ';
33
+        $query .= 'where ufv.extra_field_type = '.$extraFieldType.' AND u.user_id in ('.reports_getVisibilitySQL().') ';
34
+        $query .= ' order by u.user_id ';
35
+        $queries[] = $query;
36
+    }
37 37
 
38 38
 
39
-	// Stored Value
40
-	$sv = array();
41
-	foreach ($sv as $k => $v) {
39
+    // Stored Value
40
+    $sv = array();
41
+    foreach ($sv as $k => $v) {
42 42
         if (!isset($v['sql']))
43 43
                 $v['sql'] = 'FIELD';
44 44
         $sqlField = str_replace('FIELD', 'sv.sv_value', $v['sql']);
45 45
         $query = 'select '.$sqlField.' as "'.$v['title'].'" ';
46 46
 //		$query = 'select sec_to_time(sv.sv_value) as "'.$v.'" ';
47
-		$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
48
-		$query .= ' left outer join '.Database::get_main_table(TABLE_TRACK_STORED_VALUES).' sv ';
49
-		$query .= 'on sv.user_id = u.user_id and sv_key = "'.$k.'" ';
50
-		$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
51
-		$query .= ' group by u.user_id ';
52
-		$query .= ' order by u.user_id ';
53
-		$queries[] = $query;
54
-	}
47
+        $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
48
+        $query .= ' left outer join '.Database::get_main_table(TABLE_TRACK_STORED_VALUES).' sv ';
49
+        $query .= 'on sv.user_id = u.user_id and sv_key = "'.$k.'" ';
50
+        $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
51
+        $query .= ' group by u.user_id ';
52
+        $query .= ' order by u.user_id ';
53
+        $queries[] = $query;
54
+    }
55 55
 
56
-	// first and last connection
57
-	$query = 'select min(tel.login_date) as "First connection", max(tel.logout_date) as "Latest connection"  ';
58
-	$query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
59
-	$query .= 'left outer join '.Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN).' tel ';
60
-	$query .= ' on tel.login_user_id = u.user_id ';
61
-	$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
62
-	$query .= ' group by u.user_id ';
63
-	$query .= ' order by u.user_id ';
64
-	$queries[] = $query;
56
+    // first and last connection
57
+    $query = 'select min(tel.login_date) as "First connection", max(tel.logout_date) as "Latest connection"  ';
58
+    $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
59
+    $query .= 'left outer join '.Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN).' tel ';
60
+    $query .= ' on tel.login_user_id = u.user_id ';
61
+    $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
62
+    $query .= ' group by u.user_id ';
63
+    $query .= ' order by u.user_id ';
64
+    $queries[] = $query;
65 65
 
66
-	// SCORM Data
67
-	$scormData = array();
66
+    // SCORM Data
67
+    $scormData = array();
68 68
     $course_list = CourseManager::get_courses_list();
69
-	foreach ($course_list as $code => $details) {
70
-		$courseId = $details['id'];
71
-		$list = Database::query('SELECT l.id as lid, l.name as lname, li.id as liid, li.title as lititle '.
72
-					' FROM '.Database::get_course_table(TABLE_LP_MAIN).' l, '.Database::get_course_table(TABLE_LP_ITEM).' li '.
73
-					' WHERE l.c_id = '.$courseId.' AND li.c_id = '.$courseId.' AND l.id = li.lp_id');
74
-		while ($lpItem = Database::fetch_assoc($list)) {
75
-			$scormData[] = array(
76
-						//'coursedb' => $details['db_name'],
77
-						'lid' => $lpItem['lid'],
78
-						'liid' => $lpItem['liid'],
79
-						'target_view_count' => 1,
80
-						'target_indicator' => 'score',
81
-						'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/1/score',
82
-						'sql' => 'FIELD');
83
-			$scormData[] = array(
84
-						//'coursedb' => $details['db_name'],
85
-						'lid' => $lpItem['lid'],
86
-						'liid' => $lpItem['liid'],
87
-						'target_view_count' => 2,
88
-						'target_indicator' => 'score',
89
-						'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/2/score',
90
-						'sql' => 'FIELD');
91
-			$scormData[] = array(
92
-						//'coursedb' => $details['db_name'],
93
-						'lid' => $lpItem['lid'],
94
-						'liid' => $lpItem['liid'],
95
-						'target_view_count' => null,
96
-						'target_indicator' => 'score',
97
-						'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/all/score',
98
-						'sql' => 'avg(FIELD)');
99
-		}
100
-	}
69
+    foreach ($course_list as $code => $details) {
70
+        $courseId = $details['id'];
71
+        $list = Database::query('SELECT l.id as lid, l.name as lname, li.id as liid, li.title as lititle '.
72
+                    ' FROM '.Database::get_course_table(TABLE_LP_MAIN).' l, '.Database::get_course_table(TABLE_LP_ITEM).' li '.
73
+                    ' WHERE l.c_id = '.$courseId.' AND li.c_id = '.$courseId.' AND l.id = li.lp_id');
74
+        while ($lpItem = Database::fetch_assoc($list)) {
75
+            $scormData[] = array(
76
+                        //'coursedb' => $details['db_name'],
77
+                        'lid' => $lpItem['lid'],
78
+                        'liid' => $lpItem['liid'],
79
+                        'target_view_count' => 1,
80
+                        'target_indicator' => 'score',
81
+                        'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/1/score',
82
+                        'sql' => 'FIELD');
83
+            $scormData[] = array(
84
+                        //'coursedb' => $details['db_name'],
85
+                        'lid' => $lpItem['lid'],
86
+                        'liid' => $lpItem['liid'],
87
+                        'target_view_count' => 2,
88
+                        'target_indicator' => 'score',
89
+                        'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/2/score',
90
+                        'sql' => 'FIELD');
91
+            $scormData[] = array(
92
+                        //'coursedb' => $details['db_name'],
93
+                        'lid' => $lpItem['lid'],
94
+                        'liid' => $lpItem['liid'],
95
+                        'target_view_count' => null,
96
+                        'target_indicator' => 'score',
97
+                        'title' => $details['title'].'/'.$lpItem['lname'].'/'.$lpItem['lititle'].'/all/score',
98
+                        'sql' => 'avg(FIELD)');
99
+        }
100
+    }
101 101
 
102
-	foreach ($scormData as $v) {
102
+    foreach ($scormData as $v) {
103 103
         if (!isset($v['sql'])) {
104 104
             $v['sql'] = 'FIELD';
105 105
         }
106 106
         $sqlField = str_replace('FIELD', $v['target_indicator'], $v['sql']);
107 107
         $query = 'select '.$sqlField.' as "'.$v['title'].'" ';
108 108
         $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u ';
109
-		$query .= 'left outer join '.Database::get_course_table(TABLE_LP_VIEW).' lv ';
110
-		$query .= ' on u.user_id = lv.user_id and lv.lp_id = '.$v['lid'];
111
-		$query .= ' left outer join '.Database::get_course_table(TABLE_LP_ITEM_VIEW).' liv ';
112
-		$query .= ' on lv.id = liv.lp_view_id ';
113
-		if ($v['target_view_count'])
114
-			$query .= ' and liv.view_count = '.$v['target_view_count'];
115
-		$query .= ' and liv.lp_item_id = '.$v['liid'].' ';
116
-		$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
117
-		$query .= ' group by u.user_id ';
118
-		$query .= ' order by u.user_id ';
119
-		$queries[] = $query;
120
-	}
109
+        $query .= 'left outer join '.Database::get_course_table(TABLE_LP_VIEW).' lv ';
110
+        $query .= ' on u.user_id = lv.user_id and lv.lp_id = '.$v['lid'];
111
+        $query .= ' left outer join '.Database::get_course_table(TABLE_LP_ITEM_VIEW).' liv ';
112
+        $query .= ' on lv.id = liv.lp_view_id ';
113
+        if ($v['target_view_count'])
114
+            $query .= ' and liv.view_count = '.$v['target_view_count'];
115
+        $query .= ' and liv.lp_item_id = '.$v['liid'].' ';
116
+        $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
117
+        $query .= ' group by u.user_id ';
118
+        $query .= ' order by u.user_id ';
119
+        $queries[] = $query;
120
+    }
121 121
 
122
-	return $queries;
122
+    return $queries;
123 123
 }
124 124
 
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@  discard block
 block discarded – undo
39 39
 	// Stored Value
40 40
 	$sv = array();
41 41
 	foreach ($sv as $k => $v) {
42
-        if (!isset($v['sql']))
43
-                $v['sql'] = 'FIELD';
42
+        if (!isset($v['sql'])) {
43
+                        $v['sql'] = 'FIELD';
44
+        }
44 45
         $sqlField = str_replace('FIELD', 'sv.sv_value', $v['sql']);
45 46
         $query = 'select '.$sqlField.' as "'.$v['title'].'" ';
46 47
 //		$query = 'select sec_to_time(sv.sv_value) as "'.$v.'" ';
@@ -110,8 +111,9 @@  discard block
 block discarded – undo
110 111
 		$query .= ' on u.user_id = lv.user_id and lv.lp_id = '.$v['lid'];
111 112
 		$query .= ' left outer join '.Database::get_course_table(TABLE_LP_ITEM_VIEW).' liv ';
112 113
 		$query .= ' on lv.id = liv.lp_view_id ';
113
-		if ($v['target_view_count'])
114
-			$query .= ' and liv.view_count = '.$v['target_view_count'];
114
+		if ($v['target_view_count']) {
115
+					$query .= ' and liv.view_count = '.$v['target_view_count'];
116
+		}
115 117
 		$query .= ' and liv.lp_item_id = '.$v['liid'].' ';
116 118
 		$query .= ' where u.user_id in ('.reports_getVisibilitySQL().') ';
117 119
 		$query .= ' group by u.user_id ';
Please login to merge, or discard this patch.