Passed
Push — 1.10.x ( 6e35c8...dcb277 )
by Angel Fernando Quiroz
75:59 queued 33:56
created
main/inc/ajax/myspace.ajax.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,9 +58,9 @@
 block discarded – undo
58 58
             $db['is_empty'] = false;
59 59
             $db['result'] = convert_to_string($sql_result);
60 60
             $rst = get_stats($user_id, $course_code, $start_date, $end_date);
61
-            $foo_stats = '<strong>' . get_lang('Total') . ': </strong>' . $rst['total'] . '<br />';
62
-            $foo_stats .= '<strong>' . get_lang('Average') . ': </strong>' . $rst['avg'] . '<br />';
63
-            $foo_stats .= '<strong>' . get_lang('Quantity') . ' : </strong>' . $rst['times'] . '<br />';
61
+            $foo_stats = '<strong>'.get_lang('Total').': </strong>'.$rst['total'].'<br />';
62
+            $foo_stats .= '<strong>'.get_lang('Average').': </strong>'.$rst['avg'].'<br />';
63
+            $foo_stats .= '<strong>'.get_lang('Quantity').' : </strong>'.$rst['times'].'<br />';
64 64
             $db['stats'] = $foo_stats;
65 65
             $db['graph_result'] = grapher($sql_result, $start_date, $end_date, $type);
66 66
         } else {
Please login to merge, or discard this patch.
main/inc/ajax/user_manager.ajax.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 <div class="row">
59 59
                     <div class="col-sm-10 col-sm-offset-2">
60 60
                         <a class="btn btn-primary" id="send_message_link">
61
-                            <em class="fa fa-envelope"></em> ' . get_lang('Send') . '
61
+                            <em class="fa fa-envelope"></em> ' . get_lang('Send').'
62 62
                         </a>
63 63
                     </div>
64 64
                 </div>
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
             if (!empty($user_id)) {
114 114
                 $user_table = Database :: get_main_table(TABLE_MAIN_USER);
115
-                $sql="UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
115
+                $sql = "UPDATE $user_table SET active='".$status."' WHERE user_id='".$user_id."'";
116 116
                 $result = Database::query($sql);
117 117
 
118 118
                 //Send and email if account is active
@@ -122,13 +122,13 @@  discard block
 block discarded – undo
122 122
                     $emailsubject = '['.api_get_setting('siteName').'] '.get_lang('YourReg').' '.api_get_setting('siteName');
123 123
                     $email_admin = api_get_setting('emailAdministrator');
124 124
                     $sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
125
-                    $emailbody=get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
125
+                    $emailbody = get_lang('Dear')." ".stripslashes($recipient_name).",\n\n";
126 126
 
127
-                    $emailbody.=sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
-                    $emailbody.=sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
-                    $emailbody.=get_lang('HaveFun')."\n\n";
127
+                    $emailbody .= sprintf(get_lang('YourAccountOnXHasJustBeenApprovedByOneOfOurAdministrators'), api_get_setting('siteName'))."\n";
128
+                    $emailbody .= sprintf(get_lang('YouCanNowLoginAtXUsingTheLoginAndThePasswordYouHaveProvided'), api_get_path(WEB_PATH)).",\n\n";
129
+                    $emailbody .= get_lang('HaveFun')."\n\n";
130 130
                     //$emailbody.=get_lang('Problem'). "\n\n". get_lang('SignatureFormula');
131
-                    $emailbody.=api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
131
+                    $emailbody .= api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n".get_lang('Manager')." ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n".get_lang('Email')." : ".api_get_setting('emailAdministrator');
132 132
 
133 133
                     $additionalParameters = array(
134 134
                         'smsType' => SmsPlugin::ACCOUNT_APPROVED_CONNECT,
Please login to merge, or discard this patch.
main/inc/ajax/thematic.ajax.php 2 patches
Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $thematic = new Thematic();
12 12
 
13 13
 switch ($action) {
14
-	case 'save_thematic_plan':
15
-		/*$title_list         = $_REQUEST['title'];
14
+    case 'save_thematic_plan':
15
+        /*$title_list         = $_REQUEST['title'];
16 16
 		$description_list   = $_REQUEST['desc'];
17 17
 		//$description_list   = $_REQUEST['description'];
18 18
 		$description_type   = $_REQUEST['description_type'];
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 		$thematic_plan_data = $thematic->get_thematic_plan_data();
26 26
 		$return = $thematic->get_thematic_plan_div($thematic_plan_data);
27 27
 		echo $return[$_REQUEST['thematic_id']];*/
28
-		break;
29
-	case 'save_thematic_advance':
30
-		if (!api_is_allowed_to_edit(null, true)) {
31
-			echo '';
32
-			exit;
33
-		}
34
-		/*
28
+        break;
29
+    case 'save_thematic_advance':
30
+        if (!api_is_allowed_to_edit(null, true)) {
31
+            echo '';
32
+            exit;
33
+        }
34
+        /*
35 35
         if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) {
36 36
             if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) {
37 37
                 $start_date_error = true;
@@ -79,80 +79,80 @@  discard block
 block discarded – undo
79 79
         $thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
80 80
         $return = $thematic->get_thematic_advance_div($thematic_advance_data);
81 81
         echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/
82
-		break;
83
-	case 'get_datetime_by_attendance':
84
-		$attendance_id       = intval($_REQUEST['attendance_id']);
85
-		$thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
82
+        break;
83
+    case 'get_datetime_by_attendance':
84
+        $attendance_id       = intval($_REQUEST['attendance_id']);
85
+        $thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
86 86
 
87
-		$label = '';
88
-		$input_select = '';
89
-		if (!empty($attendance_id)) {
90
-			$attendance = new Attendance();
91
-			$thematic   = new Thematic();
92
-			$thematic_list = $thematic->get_thematic_list();
87
+        $label = '';
88
+        $input_select = '';
89
+        if (!empty($attendance_id)) {
90
+            $attendance = new Attendance();
91
+            $thematic   = new Thematic();
92
+            $thematic_list = $thematic->get_thematic_list();
93 93
 
94
-			$my_list = $thematic_list_temp = array();
95
-			foreach ($thematic_list as $item) {
96
-				$my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']);
97
-				$thematic_list_temp = array_merge($my_list, $thematic_list_temp);
98
-			}
99
-			$new_thematic_list = array();
94
+            $my_list = $thematic_list_temp = array();
95
+            foreach ($thematic_list as $item) {
96
+                $my_list = $thematic->get_thematic_advance_by_thematic_id($item['id']);
97
+                $thematic_list_temp = array_merge($my_list, $thematic_list_temp);
98
+            }
99
+            $new_thematic_list = array();
100 100
 
101
-			foreach($thematic_list_temp as $item) {
102
-				if (!empty($item['attendance_id']) ) {
103
-					$new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']);
104
-				}
105
-			}
101
+            foreach($thematic_list_temp as $item) {
102
+                if (!empty($item['attendance_id']) ) {
103
+                    $new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']);
104
+                }
105
+            }
106 106
 
107
-			$attendance_calendar = $attendance->get_attendance_calendar($attendance_id);
107
+            $attendance_calendar = $attendance->get_attendance_calendar($attendance_id);
108 108
 
109
-			$label = get_lang('StartDate');
110
-			if (!empty($attendance_calendar)) {
111
-				$input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">';
112
-				foreach ($attendance_calendar as $calendar) {
113
-					$selected = null;
114
-					$insert = true;
115
-					//checking if was already taken
116
-					foreach ($new_thematic_list as $key => $thematic_item) {
117
-						//if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) {
118
-						if ($calendar['db_date_time'] == $thematic_item['start_date'] ) {
119
-							$insert = false;
120
-							if ($thematic_advance_id == $key) {
121
-								$insert = true;
122
-								$selected = 'selected';
123
-							}
124
-							break;
125
-						}
126
-					}
127
-					if ($insert == true) {
128
-						$input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>';
129
-					}
130
-				}
131
-				$input_select .= '</select>';
132
-			} else {
133
-				$input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>';
134
-			}
135
-		}
136
-		?>
109
+            $label = get_lang('StartDate');
110
+            if (!empty($attendance_calendar)) {
111
+                $input_select .= '<select id="start_date_select_calendar" name="start_date_by_attendance" size="5">';
112
+                foreach ($attendance_calendar as $calendar) {
113
+                    $selected = null;
114
+                    $insert = true;
115
+                    //checking if was already taken
116
+                    foreach ($new_thematic_list as $key => $thematic_item) {
117
+                        //if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) {
118
+                        if ($calendar['db_date_time'] == $thematic_item['start_date'] ) {
119
+                            $insert = false;
120
+                            if ($thematic_advance_id == $key) {
121
+                                $insert = true;
122
+                                $selected = 'selected';
123
+                            }
124
+                            break;
125
+                        }
126
+                    }
127
+                    if ($insert == true) {
128
+                        $input_select .= '<option '.$selected.' value="'.$calendar['date_time'].'">'.$calendar['date_time'].'</option>';
129
+                    }
130
+                }
131
+                $input_select .= '</select>';
132
+            } else {
133
+                $input_select .= '<em>'.get_lang('ThereAreNoRegisteredDatetimeYet').'</em>';
134
+            }
135
+        }
136
+        ?>
137 137
 		<div class="form-group">
138 138
 			<label class="col-sm-2 control-label"><?php echo $label ?></label>
139 139
 			<div class="col-sm-10"><?php echo $input_select ?></div>
140 140
 		</div>
141 141
 		<?php
142
-		break;
143
-	case 'update_done_thematic_advance':
144
-		$thematic_advance_id = intval($_GET['thematic_advance_id']);
145
-		$total_average = 0;
146
-		if (!empty($thematic_advance_id)) {
147
-			$thematic = new Thematic();
148
-			$affected_rows  = $thematic->update_done_thematic_advances($thematic_advance_id);
149
-			//if ($affected_rows) {
150
-			$total_average  = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id());
151
-			//}
152
-		}
153
-		echo $total_average;
154
-		break;
155
-	default:
156
-		echo '';
142
+        break;
143
+    case 'update_done_thematic_advance':
144
+        $thematic_advance_id = intval($_GET['thematic_advance_id']);
145
+        $total_average = 0;
146
+        if (!empty($thematic_advance_id)) {
147
+            $thematic = new Thematic();
148
+            $affected_rows  = $thematic->update_done_thematic_advances($thematic_advance_id);
149
+            //if ($affected_rows) {
150
+            $total_average  = $thematic->get_total_average_of_thematic_advances(api_get_course_id(), api_get_session_id());
151
+            //}
152
+        }
153
+        echo $total_average;
154
+        break;
155
+    default:
156
+        echo '';
157 157
 }
158 158
 exit;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 			}
99 99
 			$new_thematic_list = array();
100 100
 
101
-			foreach($thematic_list_temp as $item) {
102
-				if (!empty($item['attendance_id']) ) {
101
+			foreach ($thematic_list_temp as $item) {
102
+				if (!empty($item['attendance_id'])) {
103 103
 					$new_thematic_list[$item['id']] = array('attendance_id' =>$item['attendance_id'], 'start_date'=>$item['start_date']);
104 104
 				}
105 105
 			}
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 					//checking if was already taken
116 116
 					foreach ($new_thematic_list as $key => $thematic_item) {
117 117
 						//if ($calendar['db_date_time'] == $thematic_item['start_date'] && $calendar['attendance_id'] == $thematic_item['attendance_id'] ) {
118
-						if ($calendar['db_date_time'] == $thematic_item['start_date'] ) {
118
+						if ($calendar['db_date_time'] == $thematic_item['start_date']) {
119 119
 							$insert = false;
120 120
 							if ($thematic_advance_id == $key) {
121 121
 								$insert = true;
Please login to merge, or discard this patch.
main/inc/ajax/model.ajax.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
         }
732 732
 
733 733
         break;
734
-	case 'get_user_skill_ranking':
734
+    case 'get_user_skill_ranking':
735 735
         $columns = array('photo', 'firstname', 'lastname', 'skills_acquired', 'currently_learning', 'rank');
736 736
         $result = $skill->get_user_list_skill_ranking($start, $limit, $sidx, $sord, $whereCondition);
737 737
         $result = msort($result, 'skills_acquired', 'asc');
@@ -1281,7 +1281,7 @@  discard block
 block discarded – undo
1281 1281
 
1282 1282
             if (!empty($item['certif_min_score']) && !empty($item['document_id'])) {
1283 1283
                 $item['certificates'] = Display::return_icon('accept.png', get_lang('WithCertificate'), array(), ICON_SIZE_SMALL);
1284
-                 $item['has_certificates'] = '1';
1284
+                    $item['has_certificates'] = '1';
1285 1285
             } else {
1286 1286
                 $item['certificates'] = Display::return_icon('warning.png', get_lang('NoCertificate'), array(), ICON_SIZE_SMALL);
1287 1287
                 $item['has_certificates'] = '0';
Please login to merge, or discard this patch.
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $action = $_GET['a'];
12 12
 $page = intval($_REQUEST['page']); //page
13 13
 $limit = intval($_REQUEST['rows']); //quantity of rows
14
-$sidx = $_REQUEST['sidx'];         //index (field) to filter
15
-$sord = $_REQUEST['sord'];         //asc or desc
14
+$sidx = $_REQUEST['sidx']; //index (field) to filter
15
+$sord = $_REQUEST['sord']; //asc or desc
16 16
 
17 17
 if (strpos(strtolower($sidx), 'asc') !== false) {
18 18
     $sidx = str_replace(array('asc', ','), '', $sidx);
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     $sord = 'desc';
25 25
 }
26 26
 
27
-if (!in_array($sord, array('asc','desc'))) {
27
+if (!in_array($sord, array('asc', 'desc'))) {
28 28
     $sord = 'desc';
29 29
 }
30 30
 
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
 function getWhereClause($col, $oper, $val)
65 65
 {
66 66
     $ops = array(
67
-        'eq' => '=',        //equal
68
-        'ne' => '<>',       //not equal
69
-        'lt' => '<',        //less than
70
-        'le' => '<=',       //less than or equal
71
-        'gt' => '>',        //greater than
72
-        'ge' => '>=',       //greater than or equal
73
-        'bw' => 'LIKE',     //begins with
67
+        'eq' => '=', //equal
68
+        'ne' => '<>', //not equal
69
+        'lt' => '<', //less than
70
+        'le' => '<=', //less than or equal
71
+        'gt' => '>', //greater than
72
+        'ge' => '>=', //greater than or equal
73
+        'bw' => 'LIKE', //begins with
74 74
         'bn' => 'NOT LIKE', //doesn't begin with
75
-        'in' => 'LIKE',     //is in
75
+        'in' => 'LIKE', //is in
76 76
         'ni' => 'NOT LIKE', //is not in
77
-        'ew' => 'LIKE',     //ends with
77
+        'ew' => 'LIKE', //ends with
78 78
         'en' => 'NOT LIKE', //doesn't end with
79
-        'cn' => 'LIKE',     //contains
79
+        'cn' => 'LIKE', //contains
80 80
         'nc' => 'NOT LIKE'  //doesn't contain
81 81
     );
82 82
 
@@ -100,10 +100,10 @@  discard block
 block discarded – undo
100 100
 
101 101
 // If there is no search request sent by jqgrid, $where should be empty
102 102
 $whereCondition = null;
103
-$operation = isset($_REQUEST['oper'])  ? $_REQUEST['oper']  : false;
104
-$exportFormat = isset($_REQUEST['export_format'])  ? $_REQUEST['export_format']  : 'csv';
105
-$searchField = isset($_REQUEST['searchField'])  ? $_REQUEST['searchField']  : false;
106
-$searchOperator = isset($_REQUEST['searchOper'])   ? $_REQUEST['searchOper']   : false;
103
+$operation = isset($_REQUEST['oper']) ? $_REQUEST['oper'] : false;
104
+$exportFormat = isset($_REQUEST['export_format']) ? $_REQUEST['export_format'] : 'csv';
105
+$searchField = isset($_REQUEST['searchField']) ? $_REQUEST['searchField'] : false;
106
+$searchOperator = isset($_REQUEST['searchOper']) ? $_REQUEST['searchOper'] : false;
107 107
 $searchString = isset($_REQUEST['searchString']) ? $_REQUEST['searchString'] : false;
108 108
 $search = isset($_REQUEST['_search']) ? $_REQUEST['_search'] : false;
109 109
 $forceSearch = isset($_REQUEST['_force_search']) ? $_REQUEST['_force_search'] : false;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             foreach ($filters->rules as $key => $rule) {
168 168
                 $whereCondition .= getWhereClause($rule->field, $rule->op, $rule->data);
169 169
 
170
-                if ($counter < count($filters->rules) -1) {
170
+                if ($counter < count($filters->rules) - 1) {
171 171
                     $whereCondition .= $filters->groupOp;
172 172
                 }
173 173
                 $counter++;
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         $sessionId = isset($_GET['session_id']) ? intval($_GET['session_id']) : 0;
203 203
         $courseCodeList = array();
204
-        $userIdList  = array();
204
+        $userIdList = array();
205 205
         $sessionIdList = [];
206 206
         $searchByGroups = false;
207 207
         if (api_is_drh()) {
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 $total_pages = 0;
555 555
 if ($count > 0) {
556 556
     if (!empty($limit)) {
557
-        $total_pages = ceil((float)$count/(float)$limit);
557
+        $total_pages = ceil((float) $count / (float) $limit);
558 558
     }
559 559
 }
560 560
 if ($page > $total_pages) {
@@ -806,7 +806,7 @@  discard block
 block discarded – undo
806 806
         $result = getWorkListStudent($start, $limit, $sidx, $sord, $whereCondition);
807 807
         break;
808 808
     case 'get_work_user_list_all':
809
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
809
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
810 810
             $columns = array(
811 811
                 //'type',
812 812
                 'firstname',
@@ -833,18 +833,18 @@  discard block
 block discarded – undo
833 833
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
834 834
         break;
835 835
     case 'get_work_user_list_others':
836
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
836
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
837 837
             $columns = array(
838
-                'type', 'firstname', 'lastname',  'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
838
+                'type', 'firstname', 'lastname', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
839 839
             );
840 840
         } else {
841
-            $columns = array('type', 'firstname', 'lastname',  'title', 'sent_date', 'actions');
841
+            $columns = array('type', 'firstname', 'lastname', 'title', 'sent_date', 'actions');
842 842
         }
843 843
         $whereCondition .= " AND u.user_id <> ".api_get_user_id();
844 844
         $result = get_work_user_list($start, $limit, $sidx, $sord, $work_id, $whereCondition);
845 845
         break;
846 846
     case 'get_work_user_list':
847
-        if (isset($_GET['type'])  && $_GET['type'] == 'simple') {
847
+        if (isset($_GET['type']) && $_GET['type'] == 'simple') {
848 848
             $columns = array(
849 849
                 'type', 'title', 'qualification', 'sent_date', 'qualificator_id', 'actions'
850 850
             );
@@ -872,10 +872,10 @@  discard block
 block discarded – undo
872 872
     case 'get_exercise_results':
873 873
         $course = api_get_course_info();
874 874
         // Used inside ExerciseLib::get_exam_results_data()
875
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
875
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
876 876
         if ($is_allowedToEdit || api_is_student_boss()) {
877 877
             $columns = array(
878
-                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score',  'user_ip', 'status', 'lp', 'actions'
878
+                'firstname', 'lastname', 'username', 'group_name', 'exe_duration', 'start_date', 'exe_date', 'score', 'user_ip', 'status', 'lp', 'actions'
879 879
             );
880 880
             $officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
881 881
             if ($officialCodeInList === 'true') {
@@ -886,11 +886,11 @@  discard block
 block discarded – undo
886 886
         break;
887 887
     case 'get_hotpotatoes_exercise_results':
888 888
         $course = api_get_course_info();
889
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
889
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
890 890
         if (api_is_allowed_to_edit()) {
891
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
891
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
892 892
         } else {
893
-            $columns = array('exe_date',  'score', 'actions');
893
+            $columns = array('exe_date', 'score', 'actions');
894 894
         }
895 895
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
896 896
         break;
@@ -916,12 +916,12 @@  discard block
 block discarded – undo
916 916
         break;
917 917
     case 'get_hotpotatoes_exercise_results':
918 918
         $course = api_get_course_info();
919
-        $documentPath = api_get_path(SYS_COURSE_PATH) . $course['path'] . "/document";
919
+        $documentPath = api_get_path(SYS_COURSE_PATH).$course['path']."/document";
920 920
 
921 921
         if (api_is_allowed_to_edit(null, true) || api_is_drh()) {
922
-            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date',  'score', 'actions');
922
+            $columns = array('firstname', 'lastname', 'username', 'group_name', 'exe_date', 'score', 'actions');
923 923
         } else {
924
-            $columns = array('exe_date',  'score', 'actions');
924
+            $columns = array('exe_date', 'score', 'actions');
925 925
         }
926 926
         $result = ExerciseLib::get_exam_results_hotpotatoes_data($start, $limit, $sidx, $sord, $hotpot_path, $whereCondition);
927 927
         break;
@@ -950,7 +950,7 @@  discard block
 block discarded – undo
950 950
             );
951 951
         }
952 952
 
953
-        $columns =  array(
953
+        $columns = array(
954 954
             'name',
955 955
             'date',
956 956
             'course_per_session',
@@ -986,11 +986,11 @@  discard block
 block discarded – undo
986 986
                 $detailButtons = [];
987 987
                 $detailButtons[] = Display::url(
988 988
                     Display::return_icon('works.png', get_lang('WorksReport')),
989
-                    api_get_path(WEB_CODE_PATH) . 'mySpace/works_in_session_report.php?session=' . $session['id']
989
+                    api_get_path(WEB_CODE_PATH).'mySpace/works_in_session_report.php?session='.$session['id']
990 990
                 );
991 991
                 $detailButtons[] = Display::url(
992 992
                     Display::return_icon('2rightarrow.png'),
993
-                    api_get_path(WEB_CODE_PATH) . 'mySpace/course.php?session_id=' . $session['id']
993
+                    api_get_path(WEB_CODE_PATH).'mySpace/course.php?session_id='.$session['id']
994 994
                 );
995 995
 
996 996
                 $result[] = array(
@@ -1306,7 +1306,7 @@  discard block
 block discarded – undo
1306 1306
         $result = $new_result;
1307 1307
         break;
1308 1308
     case 'get_gradebooks':
1309
-        $columns = array('name', 'certificates','skills', 'actions', 'has_certificates');
1309
+        $columns = array('name', 'certificates', 'skills', 'actions', 'has_certificates');
1310 1310
         if (!in_array($sidx, $columns)) {
1311 1311
             $sidx = 'name';
1312 1312
         }
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
                     if (!empty($exercises[$cnt - 4]['title'])) {
1477 1477
                         $title = ucwords(strtolower(trim($exercises[$cnt - 4]['title'])));
1478 1478
                     }
1479
-                    $columns[] = 'exer' . $i;
1479
+                    $columns[] = 'exer'.$i;
1480 1480
                     $column_names[] = $title;
1481 1481
                     $i++;
1482 1482
                     break;
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
             $sessionInfo = SessionManager::fetch($listUserSess[$user['user_id']]['id_session']);
1510 1510
             $result[$i]['session'] = $sessionInfo['name'];
1511 1511
             $result[$i]['username'] = $user['username'];
1512
-            $result[$i]['name'] = $user['lastname'] . " " . $user['firstname'];
1512
+            $result[$i]['name'] = $user['lastname']." ".$user['firstname'];
1513 1513
             $j = 1;
1514 1514
             $finalScore = 0;
1515 1515
             foreach ($quizIds as $quizID) {
@@ -1517,7 +1517,7 @@  discard block
 block discarded – undo
1517 1517
                 if (!empty($arrGrade [$user['user_id']][$quizID]) || $arrGrade [$user['user_id']][$quizID] == 0) {
1518 1518
                     $finalScore += $grade = $arrGrade [$user['user_id']][$quizID];
1519 1519
                 }
1520
-                $result[$i]['exer' . $j] = $grade;
1520
+                $result[$i]['exer'.$j] = $grade;
1521 1521
                 $j++;
1522 1522
             }
1523 1523
 
@@ -1689,9 +1689,9 @@  discard block
 block discarded – undo
1689 1689
         foreach ($result as $row) {
1690 1690
             // if results tab give not id, set id to $i otherwise id="null" for all <tr> of the jqgrid - ref #4235
1691 1691
             if (!isset($row['id']) || isset($row['id']) && $row['id'] == '') {
1692
-                $response->rows[$i]['id']= $i;
1692
+                $response->rows[$i]['id'] = $i;
1693 1693
             } else {
1694
-                $response->rows[$i]['id']= $row['id'];
1694
+                $response->rows[$i]['id'] = $row['id'];
1695 1695
             }
1696 1696
             $array = array();
1697 1697
             foreach ($columns as $col) {
@@ -1701,7 +1701,7 @@  discard block
 block discarded – undo
1701 1701
                     $array[] = isset($row[$col]) ? Security::remove_XSS($row[$col]) : '';
1702 1702
                 }
1703 1703
             }
1704
-            $response->rows[$i]['cell']=$array;
1704
+            $response->rows[$i]['cell'] = $array;
1705 1705
             $i++;
1706 1706
         }
1707 1707
     }
Please login to merge, or discard this patch.
main/inc/local.inc.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -758,7 +758,7 @@
 block discarded – undo
758 758
     //    $gidReset = true;
759 759
 } // end else
760 760
 
761
- // Now check for anonymous user mode
761
+    // Now check for anonymous user mode
762 762
 if (isset($use_anonymous) && $use_anonymous) {
763 763
     //if anonymous mode is set, then try to set the current user as anonymous
764 764
     //if he doesn't have a login yet
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     $_user['status']  = $uData['status'];
131 131
     Session::write('_user', $_user);
132 132
     Session::erase('conditional_login');
133
-    $uidReset=true;
133
+    $uidReset = true;
134 134
     Event::event_login($_user['user_id']);
135 135
 }
136 136
 
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
             //is necessary verify check
214 214
             if ($legal_type == 1) {
215
-                if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) {
215
+                if ((isset($_POST['legal_accept']) && $_POST['legal_accept'] == '1')) {
216 216
                     $legal_option = true;
217 217
                 } else {
218 218
                     $legal_option = false;
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
             //no is check option
223 223
             if ($legal_type == 0) {
224
-                $legal_option=true;
224
+                $legal_option = true;
225 225
             }
226 226
 
227 227
             if (isset($_POST['legal_accept_type']) && $legal_option === true) {
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
                  * Process external authentication
515 515
                  * on the basis of the given login name
516 516
                  */
517
-                $loginFailed = true;  // Default initialisation. It could
517
+                $loginFailed = true; // Default initialisation. It could
518 518
                 // change after the external authentication
519 519
                 $key = $uData['auth_source']; //'ldap','shibboleth'...
520 520
                 /* >>>>>>>> External authentication modules <<<<<<<<< */
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
             }
534 534
         } else {
535 535
             // login failed, Database::num_rows($result) <= 0
536
-            $loginFailed = true;  // Default initialisation. It could
536
+            $loginFailed = true; // Default initialisation. It could
537 537
             // change after the external authentication
538 538
 
539 539
             /*
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
                         include_once($thisAuthSource['newUser']);
560 560
                     } else {
561 561
                         error_log(
562
-                            'Chamilo Authentication external file' .
562
+                            'Chamilo Authentication external file'.
563 563
                             ' could not be found - this might prevent your system from using'.
564 564
                             ' the authentication process in the user creation process',
565 565
                             0
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
             online_logout(null, false);
669 669
             $osso->logout(); //redirects and exits
670 670
         }
671
-    } elseif (api_get_setting('openid_authentication')=='true') {
671
+    } elseif (api_get_setting('openid_authentication') == 'true') {
672 672
         if (!empty($_POST['openid_url'])) {
673 673
             include api_get_path(SYS_CODE_PATH).'auth/openid/login.php';
674 674
             openid_begin(trim($_POST['openid_url']), api_get_path(WEB_PATH).'index.php');
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
             if ($res['status'] == 'success') {
682 682
                 $id1 = Database::escape_string($res['openid.identity']);
683 683
                 //have another id with or without the final '/'
684
-                $id2 = (substr($id1, -1, 1)=='/'?substr($id1, 0, -1):$id1.'/');
684
+                $id2 = (substr($id1, -1, 1) == '/' ? substr($id1, 0, -1) : $id1.'/');
685 685
                 //lookup the user in the main database
686 686
                 $user_table = Database::get_main_table(TABLE_MAIN_USER);
687 687
                 $sql = "SELECT user_id, username, password, auth_source, active, expiration_date
@@ -690,14 +690,14 @@  discard block
 block discarded – undo
690 690
                         OR openid = '$id2' ";
691 691
                 $result = Database::query($sql);
692 692
                 if ($result !== false) {
693
-                    if (Database::num_rows($result)>0) {
693
+                    if (Database::num_rows($result) > 0) {
694 694
                         $uData = Database::fetch_array($result);
695 695
 
696 696
                         if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {
697 697
                             //the authentification of this user is managed by Chamilo itself
698 698
 
699 699
                             // check if the account is active (not locked)
700
-                            if ($uData['active']=='1') {
700
+                            if ($uData['active'] == '1') {
701 701
                                 // check if the expiration date has not been reached
702 702
                                 if ($uData['expiration_date'] > date('Y-m-d H:i:s')
703 703
                                     || empty($uData['expiration_date'])
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
     (isset($_SESSION['_cid']) && $cidReq != $_SESSION['_cid']))
776 776
 ) {
777 777
     $cidReset = true;
778
-    $gidReset = true;    // As groups depend from courses, group id is reset
778
+    $gidReset = true; // As groups depend from courses, group id is reset
779 779
 }
780 780
 
781 781
 /* USER INIT */
@@ -925,8 +925,8 @@  discard block
 block discarded – undo
925 925
             $tbl_session_course_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
926 926
 
927 927
             if (!empty($_GET['id_session'])) {
928
-                $sql = 'SELECT name FROM '.$tbl_session . '
929
-                        WHERE id="'.intval($_GET['id_session']) . '"';
928
+                $sql = 'SELECT name FROM '.$tbl_session.'
929
+                        WHERE id="'.intval($_GET['id_session']).'"';
930 930
                 $rs = Database::query($sql);
931 931
                 if (Database::num_rows($rs)) {
932 932
                     list($_SESSION['session_name']) = Database::fetch_array(
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
         // Moreover, if we want to track a course with another session it can be usefull
1017 1017
         if (!empty($_GET['id_session']) && is_numeric($_GET['id_session'])) {
1018 1018
             $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
1019
-            $sql = 'SELECT name FROM '.$tbl_session . ' WHERE id="'.intval($_GET['id_session']). '"';
1019
+            $sql = 'SELECT name FROM '.$tbl_session.' WHERE id="'.intval($_GET['id_session']).'"';
1020 1020
             $rs = Database::query($sql);
1021 1021
             if (Database::num_rows($rs)) {
1022 1022
                 list($_SESSION['session_name']) = Database::fetch_array($rs);
@@ -1097,8 +1097,8 @@  discard block
 block discarded – undo
1097 1097
         if (Database::num_rows($result) > 0) { // this  user have a recorded state for this course
1098 1098
             $cuData = Database::fetch_array($result, 'ASSOC');
1099 1099
 
1100
-            $is_courseAdmin = (bool)($cuData['status'] == 1);
1101
-            $is_courseTutor = (bool)($cuData['is_tutor'] == 1);
1100
+            $is_courseAdmin = (bool) ($cuData['status'] == 1);
1101
+            $is_courseTutor = (bool) ($cuData['is_tutor'] == 1);
1102 1102
             $is_courseMember = true;
1103 1103
         }
1104 1104
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
                 // This user has no status related to this course
1110 1110
                 // The user is subscribed in a session? The user is a Session coach a Session admin ?
1111 1111
 
1112
-                $tbl_session  = Database :: get_main_table(TABLE_MAIN_SESSION);
1112
+                $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
1113 1113
                 $tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
1114 1114
                 $tbl_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
1115 1115
 
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
 
1223 1223
             //If I'm the admin platform i'm a teacher of the course
1224 1224
             if ($is_platformAdmin) {
1225
-                $is_courseAdmin     = true;
1225
+                $is_courseAdmin = true;
1226 1226
             }
1227 1227
         }
1228 1228
     } else { // keys missing => not anymore in the course - user relation
@@ -1380,12 +1380,12 @@  discard block
 block discarded – undo
1380 1380
     ($logging_in && exist_firstpage_parameter())
1381 1381
 ) {
1382 1382
     $redirectCourseDir = api_get_firstpage_parameter();
1383
-    api_delete_firstpage_parameter();    // delete the cookie
1383
+    api_delete_firstpage_parameter(); // delete the cookie
1384 1384
 
1385 1385
     if (!isset($_SESSION['request_uri'])) {
1386 1386
         if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1387 1387
             $_SESSION['noredirection'] = false;
1388
-            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1388
+            $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1389 1389
         }
1390 1390
     }
1391 1391
 } elseif (api_user_is_login() && exist_firstpage_parameter()) {
@@ -1393,7 +1393,7 @@  discard block
 block discarded – undo
1393 1393
     api_delete_firstpage_parameter(); // delete the cookie
1394 1394
     if (CourseManager::get_course_id_from_path($redirectCourseDir)) {
1395 1395
         $_SESSION['noredirection'] = false;
1396
-        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH) . $redirectCourseDir . '/';
1396
+        $_SESSION['request_uri'] = api_get_path(WEB_COURSE_PATH).$redirectCourseDir.'/';
1397 1397
     }
1398 1398
 }
1399 1399
 
Please login to merge, or discard this patch.
main/inc/lib/AnnouncementEmail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
      *
197 197
      * @return array
198 198
      */
199
-    public function sender($key = '',  $userId = '')
199
+    public function sender($key = '', $userId = '')
200 200
     {
201 201
         $_user = api_get_user_info($userId);
202 202
 
Please login to merge, or discard this patch.
main/inc/lib/custom_pages.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
      */
36 36
     public static function path($name = '')
37 37
     {
38
-        return api_get_path(SYS_PATH) . 'custompages/' . $name;
38
+        return api_get_path(SYS_PATH).'custompages/'.$name;
39 39
     }
40 40
 
41 41
     /**
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
             return false;
51 51
         }
52 52
 
53
-        $file = self::path($page_name . '.php');
53
+        $file = self::path($page_name.'.php');
54 54
         if (file_exists($file)) {
55 55
             include($file);
56 56
             exit;
57 57
         } else {
58
-            error_log('CustomPages::displayPage : could not read file ' . $file);
58
+            error_log('CustomPages::displayPage : could not read file '.$file);
59 59
         }
60 60
     }
61 61
 
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
     public static function getURLImages($url_id = null)
70 70
     {
71 71
         if (is_null($url_id)) {
72
-            $url = 'http://' . $_SERVER['HTTP_HOST'] . '/';
72
+            $url = 'http://'.$_SERVER['HTTP_HOST'].'/';
73 73
             $url_id = UrlManager::get_url_id($url);
74 74
         }
75
-        $url_images_dir = api_get_path(SYS_PATH) . 'custompages/url-images/';
75
+        $url_images_dir = api_get_path(SYS_PATH).'custompages/url-images/';
76 76
         $images = array();
77 77
         for ($img_id = 1; $img_id <= 3; $img_id++) {
78
-            if (file_exists($url_images_dir . $url_id . '_url_image_' . $img_id . '.png')) {
79
-                $images[] = api_get_path(WEB_PATH) . 'custompages/url-images/' . $url_id . '_url_image_' . $img_id . '.png';
78
+            if (file_exists($url_images_dir.$url_id.'_url_image_'.$img_id.'.png')) {
79
+                $images[] = api_get_path(WEB_PATH).'custompages/url-images/'.$url_id.'_url_image_'.$img_id.'.png';
80 80
             }
81 81
         }
82 82
 
Please login to merge, or discard this patch.
main/inc/lib/redirect.class.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             self::navigate($url);
35 35
         }
36 36
 
37
-        $url = self::www() . $url;
37
+        $url = self::www().$url;
38 38
         self::navigate($url);
39 39
     }
40 40
 
@@ -67,25 +67,25 @@  discard block
 block discarded – undo
67 67
                     case COURSEMANAGER:
68 68
                         $redir = api_get_setting('teacher_page_after_login');
69 69
                         if (!empty($redir)) {
70
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
70
+                            self::navigate(api_get_path(WEB_PATH).$redir);
71 71
                         }
72 72
                         break;
73 73
                     case STUDENT:
74 74
                         $redir = api_get_setting('student_page_after_login');
75 75
                         if (!empty($redir)) {
76
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
76
+                            self::navigate(api_get_path(WEB_PATH).$redir);
77 77
                         }
78 78
                         break;
79 79
                     case DRH:
80 80
                         $redir = api_get_setting('drh_page_after_login');
81 81
                         if (!empty($redir)) {
82
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
82
+                            self::navigate(api_get_path(WEB_PATH).$redir);
83 83
                         }
84 84
                         break;
85 85
                     case SESSIONADMIN:
86 86
                         $redir = api_get_setting('sessionadmin_page_after_login');
87 87
                         if (!empty($redir)) {
88
-                            self::navigate(api_get_path(WEB_PATH) . $redir);
88
+                            self::navigate(api_get_path(WEB_PATH).$redir);
89 89
                         }
90 90
                         break;
91 91
                     default:
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             }
112 112
             $page_after_login = api_get_setting('page_after_login');
113 113
             if (!empty($page_after_login)) {
114
-                self::navigate(api_get_path(WEB_PATH) . $page_after_login);
114
+                self::navigate(api_get_path(WEB_PATH).$page_after_login);
115 115
             }
116 116
         }
117 117
     }
Please login to merge, or discard this patch.
main/inc/lib/gradebook.lib.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         }
57 57
 
58 58
         $c_id = $c_id ? intval($c_id) : api_get_course_int_id();
59
-        $table  = Database::get_course_table(TABLE_TOOL_LIST);
59
+        $table = Database::get_course_table(TABLE_TOOL_LIST);
60 60
         $sql = "SELECT * from $table
61 61
                 WHERE c_id = $c_id and name='$name'
62 62
                 LIMIT 1";
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         $clean_gradebook = array();
114 114
 
115 115
         if (!empty($skill_gradebooks_source)) {
116
-            foreach($skill_gradebooks_source as $source) {
116
+            foreach ($skill_gradebooks_source as $source) {
117 117
                 $clean_gradebook[] = $source['skill_id'];
118 118
             }
119 119
         }
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         $selected_skills = self::get_skills_by_gradebook($gradebook_id);
193 193
         $clean_selected_skills = array();
194 194
         if (!empty($selected_skills)) {
195
-            foreach($selected_skills as $skill) {
195
+            foreach ($selected_skills as $skill) {
196 196
                 $clean_selected_skills[] = $skill['id'];
197 197
             }
198 198
         }
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
      * @todo the form should be auto generated
74 74
      * @param   string  url
75 75
      * @param   string  action add, edit
76
-     * @return  obj     form validator obj
76
+     * @return  FormValidator     form validator obj
77 77
      */
78 78
     public function return_form($url, $action)
79 79
     {
Please login to merge, or discard this patch.