Completed
Push — 1.11.x ( 78f130...f6f5c2 )
by José
50:40 queued 24:26
created
main/session/session_export.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 
33 33
 $tool_name = get_lang('ExportSessionListXMLCSV');
34 34
 
35
-$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
35
+$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList'));
36 36
 
37 37
 set_time_limit(0);
38 38
 
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 				ORDER BY id";
57 57
 
58 58
 		if (api_is_multiple_url_enabled()) {
59
-			$tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
59
+			$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
60 60
 			$access_url_id = api_get_current_access_url_id();
61
-			if ($access_url_id != -1){
61
+			if ($access_url_id != -1) {
62 62
 			$sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id
63 63
 					FROM $tbl_session s
64 64
 					INNER JOIN $tbl_session_rel_access_url as session_rel_url
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 
114 114
 			$archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type;
115 115
 			while (file_exists($archivePath.$archiveFile)) {
116
-				$archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type;
116
+				$archiveFile = 'export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type;
117 117
 			}
118 118
 
119 119
 			$cvs = false;
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
 
124 124
 
125 125
 		while ($row = Database::fetch_array($result)) {
126
-			$row['name'] = str_replace(';',',',$row['name']);
127
-			$row['username'] = str_replace(';',',',$row['username']);
128
-			$row['access_start_date'] = str_replace(';',',',$row['access_start_date']);
129
-			$row['access_end_date'] = str_replace(';',',',$row['access_end_date']);
130
-			$row['visibility'] = str_replace(';',',',$row['visibility']);
131
-			$row['session_category'] = str_replace(';',',',$row['session_category_id']);
126
+			$row['name'] = str_replace(';', ',', $row['name']);
127
+			$row['username'] = str_replace(';', ',', $row['username']);
128
+			$row['access_start_date'] = str_replace(';', ',', $row['access_start_date']);
129
+			$row['access_end_date'] = str_replace(';', ',', $row['access_end_date']);
130
+			$row['visibility'] = str_replace(';', ',', $row['visibility']);
131
+			$row['session_category'] = str_replace(';', ',', $row['session_category_id']);
132 132
 
133 133
 
134 134
 			// users
@@ -142,9 +142,9 @@  discard block
 block discarded – undo
142 142
 
143 143
 			$rsUsers = Database::query($sql);
144 144
 			$users = '';
145
-			while ($rowUsers = Database::fetch_array($rsUsers)){
146
-				if($cvs){
147
-					$users .= str_replace(';',',',$rowUsers['username']).'|';
145
+			while ($rowUsers = Database::fetch_array($rsUsers)) {
146
+				if ($cvs) {
147
+					$users .= str_replace(';', ',', $rowUsers['username']).'|';
148 148
 				} else {
149 149
 					$users .= "\t\t<User>$rowUsers[username]</User>\n";
150 150
 				}
@@ -184,8 +184,8 @@  discard block
 block discarded – undo
184 184
 				$coachs = implode(",", $coachs);
185 185
 
186 186
 				if ($cvs) {
187
-					$courses .= str_replace(';',',',$rowCourses['code']);
188
-					$courses .= '['.str_replace(';',',',$coachs).'][';
187
+					$courses .= str_replace(';', ',', $rowCourses['code']);
188
+					$courses .= '['.str_replace(';', ',', $coachs).'][';
189 189
 				} else {
190 190
 					$courses .= "\t\t<Course>\n";
191 191
 					$courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n";
@@ -208,9 +208,9 @@  discard block
 block discarded – undo
208 208
 
209 209
 				$rsUsersCourse = Database::query($sql);
210 210
 				$userscourse = '';
211
-				while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){
211
+				while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)) {
212 212
 					if ($cvs) {
213
-						$userscourse .= str_replace(';',',',$rowUsersCourse['username']).',';
213
+						$userscourse .= str_replace(';', ',', $rowUsersCourse['username']).',';
214 214
 					} else {
215 215
 						$courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n";
216 216
 					}
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 if (api_is_multiple_url_enabled()) {
292 292
 	$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
293 293
 	$access_url_id = api_get_current_access_url_id();
294
-	if ($access_url_id != -1){
294
+	if ($access_url_id != -1) {
295 295
 	$sql = "SELECT s.id, name FROM $tbl_session s
296 296
 			INNER JOIN $tbl_session_rel_access_url as session_rel_url
297 297
 			ON (s.id = session_rel_url.session_id)
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
 
305 305
 echo '<div class="actions">';
306 306
 echo '<a href="../session/session_list.php">'.
307
-		Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'),'',ICON_SIZE_MEDIUM).'</a>';
307
+		Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('SessionList'), '', ICON_SIZE_MEDIUM).'</a>';
308 308
 echo '</div>';
309 309
 
310 310
 if (!empty($errorMsg)) {
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
 
314 314
 $form = new FormValidator('session_export', 'post', api_get_self());
315 315
 $form->addElement('hidden', 'formSent', 1);
316
-$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null);
317
-$form->addElement('radio', 'file_type', '', 'XLS' , 'xls', null);
316
+$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null);
317
+$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null);
318 318
 $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml'));
319 319
 
320 320
 $options = array();
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
     $options[$enreg['id']] = $enreg['name'];
324 324
 }
325 325
 
326
-$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'),  $options);
326
+$form->addElement('select', 'session_id', get_lang('WhichSessionToExport'), $options);
327 327
 $form->addButtonExport(get_lang('ExportSession'));
328 328
 
329 329
 $defaults = array();
Please login to merge, or discard this patch.
main/messages/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,9 +4,9 @@
 block discarded – undo
4 4
 *	@package chamilo.messages
5 5
 */
6 6
 require_once '../inc/global.inc.php';
7
-if (api_get_setting('allow_social_tool')=='true' &&  api_get_setting('allow_message_tool')=='true') {
7
+if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
8 8
 	header('Location:inbox.php?f=social');
9
-} elseif ( api_get_setting('allow_message_tool')=='true') {
9
+} elseif (api_get_setting('allow_message_tool') == 'true') {
10 10
 	header('Location:inbox.php');
11 11
 }
12 12
 exit;
Please login to merge, or discard this patch.
main/attendance/calendar_logins.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 // See AttendanceController::calendarLogins function
5 5
 echo '<div class="actions">';
6 6
 echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list">'.
7
-    Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
7
+    Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
8 8
 echo '</div>';
9 9
 
10 10
 echo $form;
Please login to merge, or discard this patch.
main/attendance/attendance_calendar.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -14,15 +14,15 @@  discard block
 block discarded – undo
14 14
     echo '<div class="actions">';
15 15
     if ($action == 'calendar_add') {
16 16
         echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.'">'.
17
-            Display::return_icon('back.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
17
+            Display::return_icon('back.png', get_lang('AttendanceCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
18 18
     } else {
19 19
         echo '<a href="index.php?'.api_get_cidreq().'&action=attendance_sheet_list&attendance_id='.$attendance_id.'">'.
20
-            Display::return_icon('back.png',get_lang('AttendanceSheet'),'',ICON_SIZE_MEDIUM).'</a>';
20
+            Display::return_icon('back.png', get_lang('AttendanceSheet'), '', ICON_SIZE_MEDIUM).'</a>';
21 21
         if (api_is_allowed_to_edit()) {
22 22
             echo '<a href="index.php?'.api_get_cidreq().'&action=calendar_add&attendance_id='.$attendance_id.'">'.
23
-                Display::return_icon('add.png',get_lang('AddDateAndTime'),'',ICON_SIZE_MEDIUM).'</a>';
23
+                Display::return_icon('add.png', get_lang('AddDateAndTime'), '', ICON_SIZE_MEDIUM).'</a>';
24 24
             echo '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDeleteAllDates').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=calendar_all_delete&attendance_id='.$attendance_id.'">'.
25
-                Display::return_icon('clean.png',get_lang('CleanCalendar'),'',ICON_SIZE_MEDIUM).'</a>';
25
+                Display::return_icon('clean.png', get_lang('CleanCalendar'), '', ICON_SIZE_MEDIUM).'</a>';
26 26
         }
27 27
     }
28 28
     echo '</div>';
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     $form = new FormValidator(
59 59
         'attendance_calendar_add',
60 60
         'POST',
61
-        'index.php?action=calendar_add&attendance_id='.$attendance_id.'&' . api_get_cidreq(),
61
+        'index.php?action=calendar_add&attendance_id='.$attendance_id.'&'.api_get_cidreq(),
62 62
         ''
63 63
     );
64 64
     $form->addElement('header', get_lang('AddADateTime'));
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         'weekly' => get_lang('RepeatWeekly'),
96 96
         'monthlyByDate' => get_lang('RepeatMonthlyByDate')
97 97
     );
98
-    $form->addElement('select', 'repeat_type', get_lang('RepeatType') , $a_repeat_type);
98
+    $form->addElement('select', 'repeat_type', get_lang('RepeatType'), $a_repeat_type);
99 99
 
100 100
     $form->addElement('date_picker', 'end_date_time', get_lang('RepeatEnd'), array('form_name'=>'attendance_calendar_add'));
101 101
     $defaults['end_date_time'] = date('Y-m-d');
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
                 $form = new FormValidator(
132 132
                     'attendance_calendar_edit',
133 133
                     'POST',
134
-                    'index.php?action=calendar_edit&attendance_id=' . $attendance_id . '&calendar_id=' . $calendar_id . '&' . api_get_cidreq(),
134
+                    'index.php?action=calendar_edit&attendance_id='.$attendance_id.'&calendar_id='.$calendar_id.'&'.api_get_cidreq(),
135 135
                     ''
136 136
                 );
137 137
                 $form->addDateTimePicker('date_time', array(get_lang('Date')), array('form_name'=>'attendance_calendar_edit'), 5);
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                     get_lang('DateTime'),
148 148
                         null,
149 149
                         ICON_SIZE_MEDIUM
150
-                ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time'])- 3) .'&nbsp;';
150
+                ).' '.substr($calendar['date_time'], 0, strlen($calendar['date_time']) - 3).'&nbsp;';
151 151
 
152 152
                 if (isset($calendar['groups']) && !empty($calendar['groups'])) {
153 153
                     foreach ($calendar['groups'] as $group) {
Please login to merge, or discard this patch.
main/inc/ajax/skill.ajax.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         $return_skills = array();
40 40
         foreach ($skills as $skill) {
41 41
             $skill['caption'] = $skill['name'];
42
-            $skill['value'] =  $skill['id'];
42
+            $skill['value'] = $skill['id'];
43 43
             $return_skills[] = $skill;
44 44
         }
45 45
         echo json_encode($return_skills);
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         if (!empty($gradebooks)) {
52 52
             foreach ($gradebooks as $gradebook) {
53 53
                 if ($gradebook['parent_id'] == 0 && !empty($gradebook['certif_min_score']) && !empty($gradebook['document_id'])) {
54
-                    $gradebook_list[]  = $gradebook;
54
+                    $gradebook_list[] = $gradebook;
55 55
                     //$gradebook['name'] = $gradebook['name'];
56 56
                     //$gradebook_list[]  = $gradebook;
57 57
                 } else {
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $return = array();
68 68
         foreach ($gradebooks as $item) {
69 69
             $item['caption'] = $item['name'];
70
-            $item['value'] =  $item['id'];
70
+            $item['value'] = $item['id'];
71 71
             $return[] = $item;
72 72
         }
73 73
         echo json_encode($return);
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
         }
93 93
         break;
94 94
     case 'get_skills_by_profile':
95
-        $skill_rel_profile   = new SkillRelProfile();
95
+        $skill_rel_profile = new SkillRelProfile();
96 96
         $profile_id = isset($_REQUEST['profile_id']) ? $_REQUEST['profile_id'] : null;
97 97
         $skills = $skill_rel_profile->get_skills_by_profile($profile_id);
98 98
         echo json_encode($skills);
99 99
         break;
100 100
     case 'get_saved_profiles':
101
-        $skill_profile   = new SkillProfile();
101
+        $skill_profile = new SkillProfile();
102 102
         $profiles = $skill_profile->get_all();
103 103
         Display::display_no_header();
104 104
         Display::$global_template->assign('profiles', $profiles);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             $success = false;
188 188
         }
189 189
 
190
-        $result = array (
190
+        $result = array(
191 191
             'success' => $success,
192 192
             'data' => $return
193 193
         );
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         $skills = $skill->get_direct_parents($id);
199 199
         $return = array();
200 200
         foreach ($skills as $skill) {
201
-            $return [$skill['data']['id']] = array (
201
+            $return [$skill['data']['id']] = array(
202 202
                 'id'        => $skill['data']['id'],
203 203
                 'parent_id' => $skill['data']['parent_id'],
204 204
                 'name'      => $skill['data']['name']
@@ -207,8 +207,8 @@  discard block
 block discarded – undo
207 207
         echo json_encode($return);
208 208
         break;
209 209
     case 'profile_matches':
210
-        $skill_rel_user  = new SkillRelUser();
211
-        $skills = (!empty($_REQUEST['skill_id'])?$_REQUEST['skill_id']:array());
210
+        $skill_rel_user = new SkillRelUser();
211
+        $skills = (!empty($_REQUEST['skill_id']) ? $_REQUEST['skill_id'] : array());
212 212
 
213 213
         $total_skills_to_search = $skills;
214 214
         $users  = $skill_rel_user->get_user_by_skills($skills);
Please login to merge, or discard this patch.
main/inc/ajax/forum.ajax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 require_once '../global.inc.php';
11
-require_once api_get_path(SYS_CODE_PATH) . 'forum/forumfunction.inc.php';
11
+require_once api_get_path(SYS_CODE_PATH).'forum/forumfunction.inc.php';
12 12
 
13 13
 // First, protect this script
14 14
 api_protect_course_script(false);
@@ -63,13 +63,13 @@  discard block
 block discarded – undo
63 63
                     break;
64 64
                 }
65 65
                 // If pass all previous control, user can edit post
66
-                $courseId = isset($_REQUEST['c_id'])? intval($_REQUEST['c_id']) : api_get_course_int_id();
66
+                $courseId = isset($_REQUEST['c_id']) ? intval($_REQUEST['c_id']) : api_get_course_int_id();
67 67
                 $json['courseId'] = $courseId;
68
-                $forumId = isset($_REQUEST['forum'])? intval($_REQUEST['forum']) : null;
68
+                $forumId = isset($_REQUEST['forum']) ? intval($_REQUEST['forum']) : null;
69 69
                 $json['forum'] = $forumId;
70
-                $threadId = isset($_REQUEST['thread'])? intval($_REQUEST['thread']) : null;
70
+                $threadId = isset($_REQUEST['thread']) ? intval($_REQUEST['thread']) : null;
71 71
                 $json['thread'] = $threadId;
72
-                $postId = isset($_REQUEST['postId'])? intval($_REQUEST['postId']) : null;
72
+                $postId = isset($_REQUEST['postId']) ? intval($_REQUEST['postId']) : null;
73 73
                 $json['postId'] = $postId;
74 74
 
75 75
                 if (!empty($courseId) &&
Please login to merge, or discard this patch.
main/inc/ajax/link.ajax.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
             // set URL and other appropriate options
24 24
             $defaults = array(
25 25
                 CURLOPT_URL => $url,
26
-                CURLOPT_FOLLOWLOCATION => true,         // follow redirects accept youtube.com
26
+                CURLOPT_FOLLOWLOCATION => true, // follow redirects accept youtube.com
27 27
                 CURLOPT_HEADER => 0,
28 28
                 CURLOPT_RETURNTRANSFER => true,
29 29
                 CURLOPT_TIMEOUT => 4
Please login to merge, or discard this patch.
main/inc/ajax/session.ajax.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
             $list_sessions = SessionManager::get_sessions_by_user($user_id, true);
16 16
             if (!empty($list_sessions)) {
17 17
                 foreach ($list_sessions as $session_item) {
18
-                    echo $session_item['session_name'] . '<br />';
18
+                    echo $session_item['session_name'].'<br />';
19 19
                 }
20 20
             } else {
21 21
                 echo get_lang('NoSessionsForThisUser');
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
                 [
30 30
                     's.name' => [
31 31
                         'operator' => 'LIKE',
32
-                        'value' => "%" . $_REQUEST['q'] . "%"
32
+                        'value' => "%".$_REQUEST['q']."%"
33 33
                     ]
34 34
                 ]
35 35
             );
Please login to merge, or discard this patch.
main/inc/ajax/chat.ajax.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
5 5
  * Responses to AJAX calls
6 6
  */
7 7
 
8
-$_dont_save_user_course_access  = true;
8
+$_dont_save_user_course_access = true;
9 9
 
10 10
 require_once '../global.inc.php';
11 11
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 }
35 35
 
36 36
 $to_user_id = isset($_REQUEST['to']) ? $_REQUEST['to'] : null;
37
-$message	= isset($_REQUEST['message']) ? $_REQUEST['message'] : null;
37
+$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : null;
38 38
 
39 39
 if (!isset($_SESSION['chatHistory'])) {
40 40
     $_SESSION['chatHistory'] = array();
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 }
46 46
 
47 47
 $chat = new Chat();
48
-if (chat::disableChat()){
48
+if (chat::disableChat()) {
49 49
     exit;
50 50
 }
51 51
 if ($chat->is_chat_blocked_by_exercises()) {
@@ -85,9 +85,9 @@  discard block
 block discarded – undo
85 85
             $room = VideoChat::getChatRoomByUsers(api_get_user_id(), $to_user_id);
86 86
         }
87 87
 
88
-        $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH) . "chat/video.php?room={$room['id']}";
88
+        $videoChatUrl = api_get_path(WEB_LIBRARY_JS_PATH)."chat/video.php?room={$room['id']}";
89 89
         $videoChatLink = Display::url(
90
-            Display::returnFontAwesomeIcon('video-camera') . get_lang('StartVideoChat'),
90
+            Display::returnFontAwesomeIcon('video-camera').get_lang('StartVideoChat'),
91 91
             $videoChatUrl
92 92
         );
93 93
 
Please login to merge, or discard this patch.