Completed
Push — 1.10.x ( 320abc...039d05 )
by José
151:51 queued 109:10
created
main/session/add_students_to_session.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -70,13 +70,13 @@
 block discarded – undo
70 70
         <tr>
71 71
             <td align="center">
72 72
                 <?php
73
-                 echo Display::select(
74
-                     'sessions[]',
75
-                     $sessionList,
76
-                     '',
77
-                     array('style'=>'width:100%', 'multiple'=>'multiple', 'id'=>'sessions', 'size'=>'15px'),
78
-                     false
79
-                 );
73
+                    echo Display::select(
74
+                        'sessions[]',
75
+                        $sessionList,
76
+                        '',
77
+                        array('style'=>'width:100%', 'multiple'=>'multiple', 'id'=>'sessions', 'size'=>'15px'),
78
+                        false
79
+                    );
80 80
                 ?>
81 81
             </td>
82 82
             <td align="center">
Please login to merge, or discard this patch.
main/timeline/index.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
                         array('name'=>'certificate',    'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51 51
                         array('name'=>'skills',         'index'=>'skills',      'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52 52
                         array('name'=>'actions',        'index'=>'actions',     'width'=>'30', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false')
53
-                       );
53
+                        );
54 54
 //Autowidth
55 55
 $extra_params['autowidth'] = 'true';
56 56
 //height auto
Please login to merge, or discard this patch.
main/cron/lang/check_parse_lang.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -17,25 +17,25 @@
 block discarded – undo
17 17
 $list = SubLanguageManager::get_lang_folder_files_list($path);
18 18
 $langs = scandir(api_get_path(SYS_LANG_PATH));
19 19
 foreach ($langs as $lang) {
20
-  $dir = api_get_path(SYS_LANG_PATH).$lang;
21
-  if (is_dir($dir) && substr($lang,0,1) != '.' && !empty($lang)) {
20
+    $dir = api_get_path(SYS_LANG_PATH).$lang;
21
+    if (is_dir($dir) && substr($lang,0,1) != '.' && !empty($lang)) {
22 22
     echo "$lang...";
23 23
     $ok = true;
24 24
     foreach ($list as $entry) {
25
-      $file = $dir.'/'.$entry;
26
-      $out = array();
27
-      if (is_file($file)) {
25
+        $file = $dir.'/'.$entry;
26
+        $out = array();
27
+        if (is_file($file)) {
28 28
         //$terms = array_merge($terms,SubLanguageManager::get_all_language_variable_in_file($file,true));
29 29
         @exec('php5 -l '.$file,$out);
30 30
         if (substr($out[0],0,2)!='No') {
31
-          echo $out[0]."\n";
32
-          $ok = false;
31
+            echo $out[0]."\n";
32
+            $ok = false;
33
+        }
33 34
         }
34
-      }
35 35
     }
36 36
     if ($ok) {
37
-      echo "OK\n";
37
+        echo "OK\n";
38
+    }
38 39
     }
39
-  }
40 40
 }
41 41
 echo "Done\n";
Please login to merge, or discard this patch.
main/inc/lib/specific_fields_manager.lib.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -237,10 +237,10 @@
 block discarded – undo
237 237
  * @param   int     Internal ID used in specific tool table
238 238
  */
239 239
 function delete_all_values_for_item($course_id, $tool_id, $ref_id) {
240
-  $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
-  $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
-  $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
-  Database::query($sql);
240
+    $table_sf_values = Database :: get_main_table(TABLE_MAIN_SPECIFIC_FIELD_VALUES);
241
+    $sql = 'DELETE FROM %s WHERE course_code = \'%s\' AND tool_id = \'%s\' AND ref_id = %s';
242
+    $sql = sprintf($sql, $table_sf_values, $course_id, $tool_id, $ref_id);
243
+    Database::query($sql);
244 244
 }
245 245
 
246 246
 /**
Please login to merge, or discard this patch.
main/inc/lib/access_url_edit_courses_to_url_functions.lib.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -38,17 +38,17 @@
 block discarded – undo
38 38
             $needle = Database::escape_string($needle);
39 39
             // search courses where username or firstname or lastname begins likes $needle
40 40
             $sql = 'SELECT code, title FROM '.$tbl_course.' u '.
41
-                   ' WHERE (title LIKE "'.$needle.'%" '.
42
-                   ' OR code LIKE "'.$needle.'%" '.
43
-                   ' ) '.
44
-                   ' ORDER BY title, code '.
45
-                   ' LIMIT 11';
41
+                    ' WHERE (title LIKE "'.$needle.'%" '.
42
+                    ' OR code LIKE "'.$needle.'%" '.
43
+                    ' ) '.
44
+                    ' ORDER BY title, code '.
45
+                    ' LIMIT 11';
46 46
             $rs = Database::query($sql);
47 47
             $i=0;
48 48
             while ($course = Database :: fetch_array($rs)) {
49 49
                 $i++;
50 50
                 if ($i<=10) {
51
-                     $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\''.addslashes($course['code']).'\',\''.addslashes($course['title']).' ('.addslashes($course['code']).')'.'\')">'.$course['title'].' ('.$course['code'].')</a><br />';
51
+                        $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_url(\''.addslashes($course['code']).'\',\''.addslashes($course['title']).' ('.addslashes($course['code']).')'.'\')">'.$course['title'].' ('.$course['code'].')</a><br />';
52 52
                 } else {
53 53
                     $return .= '...<br />';
54 54
                 }
Please login to merge, or discard this patch.
main/inc/lib/pear/Text/Diff3.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         }
47 47
 
48 48
         $this->_edits = $this->_diff3($engine->diff($orig, $final1),
49
-                                      $engine->diff($orig, $final2));
49
+                                        $engine->diff($orig, $final2));
50 50
     }
51 51
 
52 52
     /**
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
             if ($edit->isConflict()) {
59 59
                 /* FIXME: this should probably be moved somewhere else. */
60 60
                 $lines = array_merge($lines,
61
-                                     array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')),
62
-                                     $edit->final1,
63
-                                     array("======="),
64
-                                     $edit->final2,
65
-                                     array('>>>>>>>' . ($label2 ? ' ' . $label2 : '')));
61
+                                        array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')),
62
+                                        $edit->final1,
63
+                                        array("======="),
64
+                                        $edit->final2,
65
+                                        array('>>>>>>>' . ($label2 ? ' ' . $label2 : '')));
66 66
                 $this->_conflictingBlocks++;
67 67
             } else {
68 68
                 $lines = array_merge($lines, $edit->merged());
Please login to merge, or discard this patch.
main/newscorm/lp_edit_item.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 
36 36
 // Using the resource linker as a tool for adding resources to the learning path.
37 37
 if ($action=="add" and $type=="learnpathitem") {
38
-     $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>";
38
+        $htmlHeadXtra[] = "<script language='JavaScript' type='text/javascript'> window.location=\"../resourcelinker/resourcelinker.php?source_id=5&action=$action&learnpath_id=$learnpath_id&chapter_id=$chapter_id&originalresource=no\"; </script>";
39 39
 }
40 40
 if ((!$is_allowed_to_edit) || ($isStudentView)) {
41 41
     error_log('New LP - User not authorized in lp_build.php');
Please login to merge, or discard this patch.
plugin/dashboard/block_teacher_graph/block_teacher_graph.class.php 1 patch
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -26,32 +26,32 @@  discard block
 block discarded – undo
26 26
     private $path;
27 27
     private $permission = array(DRH);
28 28
 
29
-	/**
30
-	 * Controller
31
-	 */
29
+    /**
30
+     * Controller
31
+     */
32 32
     public function __construct ($user_id)
33 33
     {
34
-    	$this->user_id  = $user_id;
35
-    	$this->path 	= 'block_teacher_graph';
36
-    	if ($this->is_block_visible_for_user($user_id)) {
34
+        $this->user_id  = $user_id;
35
+        $this->path 	= 'block_teacher_graph';
36
+        if ($this->is_block_visible_for_user($user_id)) {
37 37
             $this->teachers = UserManager::get_users_followed_by_drh($user_id, COURSEMANAGER);
38
-    	}
38
+        }
39 39
     }
40 40
 
41 41
     /**
42
-	 * This method check if a user is allowed to see the block inside dashboard interface
43
-	 * @param	int		User id
44
-	 * @return	bool	Is block visible for user
45
-	 */
42
+     * This method check if a user is allowed to see the block inside dashboard interface
43
+     * @param	int		User id
44
+     * @return	bool	Is block visible for user
45
+     */
46 46
     public function is_block_visible_for_user($user_id)
47 47
     {
48
-    	$user_info = api_get_user_info($user_id);
49
-		$user_status = $user_info['status'];
50
-		$is_block_visible_for_user = false;
51
-    	if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {
52
-    		$is_block_visible_for_user = true;
53
-    	}
54
-    	return $is_block_visible_for_user;
48
+        $user_info = api_get_user_info($user_id);
49
+        $user_status = $user_info['status'];
50
+        $is_block_visible_for_user = false;
51
+        if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {
52
+            $is_block_visible_for_user = true;
53
+        }
54
+        return $is_block_visible_for_user;
55 55
     }
56 56
 
57 57
     /**
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function get_block()
63 63
     {
64
-    	global $charset;
65
-    	$column = 1;
66
-    	$data   = array();
67
-		$teacher_information_graph = $this->get_teachers_information_graph();
68
-		$html = '
64
+        global $charset;
65
+        $column = 1;
66
+        $data   = array();
67
+        $teacher_information_graph = $this->get_teachers_information_graph();
68
+        $html = '
69 69
                 <div class="panel panel-default" id="intro">
70 70
                     <div class="panel-heading">'.get_lang('TeachersInformationsGraph').'
71 71
                         <div class="pull-right"><a class="btn btn-danger btn-xs"  onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;" href="index.php?action=disable_block&path='.$this->path.'">
@@ -79,53 +79,53 @@  discard block
 block discarded – undo
79 79
                 </div>
80 80
 				';
81 81
 
82
-    	$data['column'] = $column;
83
-    	$data['content_html'] = $html;
82
+        $data['column'] = $column;
83
+        $data['content_html'] = $html;
84 84
 
85
-    	return $data;
85
+        return $data;
86 86
 
87 87
     }
88 88
 
89 89
     /**
90
- 	 * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
91
- 	 * @return string  content html
92
- 	 */
90
+     * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
91
+     * @return string  content html
92
+     */
93 93
     public function get_teachers_information_graph()
94 94
     {
95
-	 	$teachers = $this->teachers;
96
-		$graph = '';
97
-
98
- 		$user_ids = array_keys($teachers);
99
- 		$a_last_week = get_last_week();
100
-
101
-		if (is_array($user_ids) && count($user_ids) > 0) {
102
-			$dataSet = new pData;
103
-			foreach ($user_ids as $user_id) {
104
-				$teacher_info = api_get_user_info($user_id);
105
-				$username = $teacher_info['username'];
106
-				$time_by_days = array();
107
-				foreach ($a_last_week as $day) {
108
-					// day is received as y-m-d 12:00:00
109
-					$start_date = api_get_utc_datetime($day);
110
-					$end_date = api_get_utc_datetime($day+(3600*24-1));
111
-
112
-					$time_on_platform_by_day = Tracking::get_time_spent_on_the_platform($user_id, 'custom', $start_date, $end_date);
113
-					$hours = floor($time_on_platform_by_day / 3600);
114
-					$min = floor(($time_on_platform_by_day - ($hours * 3600)) / 60);
115
-					$time_by_days[] = $min;
116
-				}
117
-				$dataSet->addPoints($time_by_days, $username);
118
-			}
119
-
120
-			$last_week 	 = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]);
121
-			$days_on_week = array();
122
-			foreach ($a_last_week as $weekday) {
123
-				$days_on_week[] = date('d/m',$weekday);
124
-			}
125
-
126
-			$dataSet->addPoints($days_on_week, 'Days');
127
-			$dataSet->setAbscissaName($last_week);
128
-			$dataSet->setAxisName(0, get_lang('Minutes'));
95
+            $teachers = $this->teachers;
96
+        $graph = '';
97
+
98
+            $user_ids = array_keys($teachers);
99
+            $a_last_week = get_last_week();
100
+
101
+        if (is_array($user_ids) && count($user_ids) > 0) {
102
+            $dataSet = new pData;
103
+            foreach ($user_ids as $user_id) {
104
+                $teacher_info = api_get_user_info($user_id);
105
+                $username = $teacher_info['username'];
106
+                $time_by_days = array();
107
+                foreach ($a_last_week as $day) {
108
+                    // day is received as y-m-d 12:00:00
109
+                    $start_date = api_get_utc_datetime($day);
110
+                    $end_date = api_get_utc_datetime($day+(3600*24-1));
111
+
112
+                    $time_on_platform_by_day = Tracking::get_time_spent_on_the_platform($user_id, 'custom', $start_date, $end_date);
113
+                    $hours = floor($time_on_platform_by_day / 3600);
114
+                    $min = floor(($time_on_platform_by_day - ($hours * 3600)) / 60);
115
+                    $time_by_days[] = $min;
116
+                }
117
+                $dataSet->addPoints($time_by_days, $username);
118
+            }
119
+
120
+            $last_week 	 = date('Y-m-d',$a_last_week[0]).' '.get_lang('To').' '.date('Y-m-d', $a_last_week[6]);
121
+            $days_on_week = array();
122
+            foreach ($a_last_week as $weekday) {
123
+                $days_on_week[] = date('d/m',$weekday);
124
+            }
125
+
126
+            $dataSet->addPoints($days_on_week, 'Days');
127
+            $dataSet->setAbscissaName($last_week);
128
+            $dataSet->setAxisName(0, get_lang('Minutes'));
129 129
             $dataSet->setAbscissa('Days');
130 130
             $dataSet->loadPalette(api_get_path(SYS_CODE_PATH) . 'palettes/pchart/default.color', true);
131 131
 
@@ -194,20 +194,20 @@  discard block
 block discarded – undo
194 194
                 $imgPath = api_get_path(WEB_ARCHIVE_PATH) . $chartHash;
195 195
             }
196 196
             $graph = '<img src="' . $imgPath . '" >';
197
-		} else {
198
-			$graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>';
199
-		}
197
+        } else {
198
+            $graph = '<p>'.api_convert_encoding(get_lang('GraphicNotAvailable'), 'UTF-8').'</p>';
199
+        }
200 200
 
201
- 		return $graph;
202
-	}
201
+            return $graph;
202
+    }
203 203
 
204 204
     /**
205
-	 * Get number of teachers
206
-	 * @return int
207
-	 */
208
-	function get_number_of_teachers()
205
+     * Get number of teachers
206
+     * @return int
207
+     */
208
+    function get_number_of_teachers()
209 209
     {
210
-		return count($this->teachers);
211
-	}
210
+        return count($this->teachers);
211
+    }
212 212
 
213 213
 }
Please login to merge, or discard this patch.
main/cron/document/finddoc.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -8,19 +8,19 @@
 block discarded – undo
8 8
 die();
9 9
 require '../../inc/global.inc.php';
10 10
 if (empty($_GET['doc'])) {
11
-  echo "To add a document name to search, add ?doc=abc to the URL";
11
+    echo "To add a document name to search, add ?doc=abc to the URL";
12 12
 } else {
13
-  echo "Received param ".Security::remove_XSS($_GET['doc'])."<br />";
13
+    echo "Received param ".Security::remove_XSS($_GET['doc'])."<br />";
14 14
 }
15 15
 $courses_list =  CourseManager::get_courses_list();
16 16
 foreach ($courses_list as $course) {
17
-  $title = Database::escape_string($_GET['doc']);
18
-  $td = Database::get_course_table(TABLE_DOCUMENT);
19
-  $sql = "SELECT id, path FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' OR title LIKE '%$title%'";
20
-  $res = Database::query($sql);
21
-  if (Database::num_rows($res)>0) {
17
+    $title = Database::escape_string($_GET['doc']);
18
+    $td = Database::get_course_table(TABLE_DOCUMENT);
19
+    $sql = "SELECT id, path FROM $td WHERE c_id = ".$course['id']." AND path LIKE '%$title%' OR title LIKE '%$title%'";
20
+    $res = Database::query($sql);
21
+    if (Database::num_rows($res)>0) {
22 22
     while ($row = Database::fetch_array($res)) {
23
-      echo "Found doc ".$row['id']."-> ".$row['path']." in course ".$course['code']."<br />";
23
+        echo "Found doc ".$row['id']."-> ".$row['path']." in course ".$course['code']."<br />";
24
+    }
24 25
     }
25
-  }
26 26
 }
Please login to merge, or discard this patch.