Completed
Push — 1.10.x ( 320abc...039d05 )
by José
151:51 queued 109:10
created
main/session/session_category_add.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -29,29 +29,29 @@  discard block
 block discarded – undo
29 29
 $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
30 30
 
31 31
 if (isset($_POST['formSent']) && $_POST['formSent']) {
32
-	$formSent = 1;
33
-	$name = $_POST['name'];
34
-	$year_start = $_POST['year_start'];
35
-	$month_start = $_POST['month_start'];
36
-	$day_start = $_POST['day_start'];
37
-	$year_end = $_POST['year_end'];
38
-	$month_end = $_POST['month_end'];
39
-	$day_end = $_POST['day_end'];
40
-	$return = SessionManager::create_category_session(
41
-		$name,
42
-		$year_start,
43
-		$month_start,
44
-		$day_start,
45
-		$year_end,
46
-		$month_end,
47
-		$day_end
48
-	);
32
+    $formSent = 1;
33
+    $name = $_POST['name'];
34
+    $year_start = $_POST['year_start'];
35
+    $month_start = $_POST['month_start'];
36
+    $day_start = $_POST['day_start'];
37
+    $year_end = $_POST['year_end'];
38
+    $month_end = $_POST['month_end'];
39
+    $day_end = $_POST['day_end'];
40
+    $return = SessionManager::create_category_session(
41
+        $name,
42
+        $year_start,
43
+        $month_start,
44
+        $day_start,
45
+        $year_end,
46
+        $month_end,
47
+        $day_end
48
+    );
49 49
 
50
-	if ($return == strval(intval($return))) {
51
-		Display::addFlash(Display::return_message(get_lang('SessionCategoryAdded')));
52
-		header('Location: session_category_list.php');
53
-		exit();
54
-	}
50
+    if ($return == strval(intval($return))) {
51
+        Display::addFlash(Display::return_message(get_lang('SessionCategoryAdded')));
52
+        header('Location: session_category_list.php');
53
+        exit();
54
+    }
55 55
 }
56 56
 $thisYear = date('Y');
57 57
 $thisMonth = date('m');
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 //display the header
62 62
 Display::display_header($tool_name);
63 63
 if (!empty($return)) {
64
-	Display::display_error_message($return,false);
64
+    Display::display_error_message($return,false);
65 65
 }
66 66
 ?>
67 67
 <div class="row">
@@ -139,12 +139,12 @@  discard block
 block discarded – undo
139 139
                     /
140 140
                       <select name="year_start">
141 141
                       <?php
142
-                      for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) {
143
-                      ?>
142
+                        for ($i=$thisYear-5;$i <= ($thisYear+5);$i++) {
143
+                        ?>
144 144
                               <option value="<?php echo $i; ?>" <?php if((!$formSent && $thisYear == $i) || ($formSent && $year_start == $i)) echo 'selected="selected"'; ?> ><?php echo $i; ?></option>
145 145
                       <?php
146
-                      }
147
-                      ?>
146
+                        }
147
+                        ?>
148 148
                         </select>
149 149
                 </div>
150 150
                 <div class="col-md-3"></div>
Please login to merge, or discard this patch.
main/session/session_edit.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview'));
42 42
 
43 43
 if (isset($_POST['formSent']) && $_POST['formSent']) {
44
-	$formSent = 1;
44
+    $formSent = 1;
45 45
 }
46 46
 
47 47
 $order_clause = 'ORDER BY ';
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
         WHERE status='1'".$order_clause;
53 53
 
54 54
 if (api_is_multiple_url_enabled()) {
55
-	$table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
56
-	$access_url_id = api_get_current_access_url_id();
57
-	if ($access_url_id != -1) {
58
-		$sql = "SELECT DISTINCT u.user_id,lastname,firstname,username
55
+    $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
56
+    $access_url_id = api_get_current_access_url_id();
57
+    if ($access_url_id != -1) {
58
+        $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username
59 59
 		        FROM $tbl_user u
60 60
                 INNER JOIN $table_access_url_rel_user url_rel_user
61 61
                 ON (url_rel_user.user_id = u.user_id)
62 62
 			    WHERE status='1' AND access_url_id = '$access_url_id' $order_clause";
63
-	}
63
+    }
64 64
 }
65 65
 
66 66
 $result = Database::query($sql);
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
     );
171 171
 
172 172
     if ($return == strval(intval($return))) {
173
-		header('Location: resume_session.php?id_session=' . $return);
174
-		exit();
175
-	}
173
+        header('Location: resume_session.php?id_session=' . $return);
174
+        exit();
175
+    }
176 176
 }
177 177
 
178 178
 // display the header
Please login to merge, or discard this patch.
main/session/session_export.php 1 patch
Indentation   +178 added lines, -178 removed lines patch added patch discarded remove patch
@@ -37,11 +37,11 @@  discard block
 block discarded – undo
37 37
 set_time_limit(0);
38 38
 
39 39
 if (isset($_POST['formSent'])) {
40
-	$formSent = $_POST['formSent'];
41
-	$file_type = isset($_POST['file_type']) ? $_POST['file_type'] : 'csv';
42
-	$session_id = $_POST['session_id'];
43
-	if (empty($session_id)) {
44
-		$sql = "SELECT
40
+    $formSent = $_POST['formSent'];
41
+    $file_type = isset($_POST['file_type']) ? $_POST['file_type'] : 'csv';
42
+    $session_id = $_POST['session_id'];
43
+    if (empty($session_id)) {
44
+        $sql = "SELECT
45 45
 					s.id,
46 46
 					name,
47 47
 					id_coach,
@@ -55,84 +55,84 @@  discard block
 block discarded – undo
55 55
 				ON $tbl_user.user_id = s.id_coach
56 56
 				ORDER BY id";
57 57
 
58
-		if (api_is_multiple_url_enabled()) {
59
-			$tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
60
-			$access_url_id = api_get_current_access_url_id();
61
-			if ($access_url_id != -1){
62
-			$sql = "SELECT s.id, name,id_coach,username,access_start_date,access_end_date,visibility,session_category_id
58
+        if (api_is_multiple_url_enabled()) {
59
+            $tbl_session_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
60
+            $access_url_id = api_get_current_access_url_id();
61
+            if ($access_url_id != -1){
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
65 65
 					ON (s.id= session_rel_url.session_id)
66 66
 					INNER JOIN $tbl_user u ON (u.user_id = s.id_coach)
67 67
 					WHERE access_url_id = $access_url_id
68 68
 					ORDER BY id";
69
-			}
70
-		}
69
+            }
70
+        }
71 71
 
72
-		$result = Database::query($sql);
73
-	} else {
74
-		$sql = "SELECT s.id,name,username,access_start_date,access_end_date,visibility,session_category_id
72
+        $result = Database::query($sql);
73
+    } else {
74
+        $sql = "SELECT s.id,name,username,access_start_date,access_end_date,visibility,session_category_id
75 75
 				FROM $tbl_session s
76 76
 				INNER JOIN $tbl_user
77 77
 					ON $tbl_user.user_id = s.id_coach
78 78
 				WHERE id='$session_id'";
79
-		$result = Database::query($sql);
80
-	}
79
+        $result = Database::query($sql);
80
+    }
81 81
 
82
-	if (Database::num_rows($result)) {
82
+    if (Database::num_rows($result)) {
83 83
 
84 84
 
85 85
 
86
-		$sessionListToExport = [];
86
+        $sessionListToExport = [];
87 87
 
88
-		if (in_array($file_type, ['csv', 'xls'])) {
88
+        if (in_array($file_type, ['csv', 'xls'])) {
89 89
 
90
-			$archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time();
90
+            $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time();
91 91
 
92
-			$cvs = true;
93
-			$sessionListToExport[] = [
94
-				'SessionName',
95
-				'Coach',
96
-				'DateStart',
97
-				'DateEnd',
98
-				'Visibility',
99
-				'SessionCategory',
100
-				'Users',
101
-				'Courses'
102
-			];
103
-		} else {
104
-			if (!file_exists($archivePath)) {
105
-				mkdir($archivePath, api_get_permissions_for_new_directories(), true);
106
-			}
92
+            $cvs = true;
93
+            $sessionListToExport[] = [
94
+                'SessionName',
95
+                'Coach',
96
+                'DateStart',
97
+                'DateEnd',
98
+                'Visibility',
99
+                'SessionCategory',
100
+                'Users',
101
+                'Courses'
102
+            ];
103
+        } else {
104
+            if (!file_exists($archivePath)) {
105
+                mkdir($archivePath, api_get_permissions_for_new_directories(), true);
106
+            }
107 107
 
108
-			if (!file_exists($archivePath.'index.html')) {
109
-				$fp = fopen($archivePath.'index.html', 'w');
110
-				fputs($fp, '<html><head></head><body></body></html>');
111
-				fclose($fp);
112
-			}
108
+            if (!file_exists($archivePath.'index.html')) {
109
+                $fp = fopen($archivePath.'index.html', 'w');
110
+                fputs($fp, '<html><head></head><body></body></html>');
111
+                fclose($fp);
112
+            }
113 113
 
114
-			$archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type;
115
-			while (file_exists($archivePath.$archiveFile)) {
116
-				$archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type;
117
-			}
114
+            $archiveFile = 'export_sessions_'.$session_id.'_'.api_get_local_time().'.'.$file_type;
115
+            while (file_exists($archivePath.$archiveFile)) {
116
+                $archiveFile ='export_users_'.$session_id.'_'.api_get_local_time().'_'.uniqid('').'.'.$file_type;
117
+            }
118 118
 
119
-			$cvs = false;
120
-			$fp = fopen($archivePath.$archiveFile, 'w');
121
-			fputs($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Sessions>\n");
122
-		}
119
+            $cvs = false;
120
+            $fp = fopen($archivePath.$archiveFile, 'w');
121
+            fputs($fp, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Sessions>\n");
122
+        }
123 123
 
124 124
 
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']);
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']);
132 132
 
133 133
 
134
-			// users
135
-			$sql = "SELECT DISTINCT $tbl_user.username
134
+            // users
135
+            $sql = "SELECT DISTINCT $tbl_user.username
136 136
 					FROM $tbl_user
137 137
 					INNER JOIN $tbl_session_user
138 138
 					ON
@@ -140,33 +140,33 @@  discard block
 block discarded – undo
140 140
 						$tbl_session_user.relation_type<>".SESSION_RELATION_TYPE_RRHH." AND
141 141
 						$tbl_session_user.session_id = '".$row['id']."'";
142 142
 
143
-			$rsUsers = Database::query($sql);
144
-			$users = '';
145
-			while ($rowUsers = Database::fetch_array($rsUsers)){
146
-				if($cvs){
147
-					$users .= str_replace(';',',',$rowUsers['username']).'|';
148
-				} else {
149
-					$users .= "\t\t<User>$rowUsers[username]</User>\n";
150
-				}
151
-			}
152
-
153
-			if (!empty($users) && $cvs) {
154
-				$users = api_substr($users, 0, api_strlen($users) - 1);
155
-			}
156
-
157
-			// Courses
158
-			$sql = "SELECT DISTINCT c.code, sc.id, c_id
143
+            $rsUsers = Database::query($sql);
144
+            $users = '';
145
+            while ($rowUsers = Database::fetch_array($rsUsers)){
146
+                if($cvs){
147
+                    $users .= str_replace(';',',',$rowUsers['username']).'|';
148
+                } else {
149
+                    $users .= "\t\t<User>$rowUsers[username]</User>\n";
150
+                }
151
+            }
152
+
153
+            if (!empty($users) && $cvs) {
154
+                $users = api_substr($users, 0, api_strlen($users) - 1);
155
+            }
156
+
157
+            // Courses
158
+            $sql = "SELECT DISTINCT c.code, sc.id, c_id
159 159
 					FROM $tbl_course c
160 160
 					INNER JOIN $tbl_session_course_user sc
161 161
 						ON c.id = sc.c_id
162 162
 						AND sc.session_id = '".$row['id']."'";
163 163
 
164
-			$rsCourses = Database::query($sql);
164
+            $rsCourses = Database::query($sql);
165 165
 
166
-			$courses = '';
167
-			while ($rowCourses = Database::fetch_array($rsCourses)) {
168
-				// get coachs from a course
169
-				$sql = "SELECT u.username
166
+            $courses = '';
167
+            while ($rowCourses = Database::fetch_array($rsCourses)) {
168
+                // get coachs from a course
169
+                $sql = "SELECT u.username
170 170
 						FROM $tbl_session_course_user scu
171 171
 						INNER JOIN $tbl_user u
172 172
 						ON u.user_id = scu.user_id
@@ -175,25 +175,25 @@  discard block
 block discarded – undo
175 175
 							scu.session_id = '".$row['id']."' AND
176 176
 							scu.status = 2 ";
177 177
 
178
-				$rs_coachs = Database::query($sql);
179
-				$coachs = array();
180
-				while ($row_coachs = Database::fetch_array($rs_coachs)) {
181
-					$coachs[] = $row_coachs['username'];
182
-				}
183
-
184
-				$coachs = implode(",", $coachs);
185
-
186
-				if ($cvs) {
187
-					$courses .= str_replace(';',',',$rowCourses['code']);
188
-					$courses .= '['.str_replace(';',',',$coachs).'][';
189
-				} else {
190
-					$courses .= "\t\t<Course>\n";
191
-					$courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n";
192
-					$courses .= "\t\t\t<Coach>$coachs</Coach>\n";
193
-				}
194
-
195
-				// rel user courses
196
-				$sql = "SELECT DISTINCT u.username
178
+                $rs_coachs = Database::query($sql);
179
+                $coachs = array();
180
+                while ($row_coachs = Database::fetch_array($rs_coachs)) {
181
+                    $coachs[] = $row_coachs['username'];
182
+                }
183
+
184
+                $coachs = implode(",", $coachs);
185
+
186
+                if ($cvs) {
187
+                    $courses .= str_replace(';',',',$rowCourses['code']);
188
+                    $courses .= '['.str_replace(';',',',$coachs).'][';
189
+                } else {
190
+                    $courses .= "\t\t<Course>\n";
191
+                    $courses .= "\t\t\t<CourseCode>$rowCourses[code]</CourseCode>\n";
192
+                    $courses .= "\t\t\t<Coach>$coachs</Coach>\n";
193
+                }
194
+
195
+                // rel user courses
196
+                $sql = "SELECT DISTINCT u.username
197 197
 						FROM $tbl_session_course_user scu
198 198
 						INNER JOIN $tbl_session_user su
199 199
 						ON
@@ -206,80 +206,80 @@  discard block
 block discarded – undo
206 206
 							scu.c_id='".$rowCourses['c_id']."' AND
207 207
 							scu.session_id='".$row['id']."'";
208 208
 
209
-				$rsUsersCourse = Database::query($sql);
210
-				$userscourse = '';
211
-				while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){
212
-					if ($cvs) {
213
-						$userscourse .= str_replace(';',',',$rowUsersCourse['username']).',';
214
-					} else {
215
-						$courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n";
216
-					}
217
-				}
218
-
219
-				if ($cvs) {
220
-					if (!empty($userscourse)) {
221
-						$userscourse = api_substr(
222
-							$userscourse,
223
-							0,
224
-							api_strlen($userscourse) - 1
225
-						);
226
-					}
227
-
228
-					$courses .= $userscourse.']|';
229
-				} else {
230
-					$courses .= "\t\t</Course>\n";
231
-				}
232
-			}
233
-
234
-			if (!empty($courses) && $cvs) {
235
-				$courses = api_substr($courses, 0, api_strlen($courses) - 1);
236
-			}
237
-			$add .= $courses;
238
-
239
-
240
-			if (in_array($file_type, ['csv', 'xls'])) {
241
-				$sessionListToExport[] = [
242
-					$row['name'],
243
-					$row['username'],
244
-					$row['access_start_date'],
245
-					$row['access_end_date'],
246
-					$row['visibility'],
247
-					$row['session_category'],
248
-					$users,
249
-					$courses
250
-				];
251
-			} else {
252
-				$add = "\t<Session>\n"
253
-						 ."\t\t<SessionName>$row[name]</SessionName>\n"
254
-						 ."\t\t<Coach>$row[username]</Coach>\n"
255
-						 ."\t\t<DateStart>$row[access_start_date]</DateStart>\n"
256
-						 ."\t\t<DateEnd>$row[access_end_date]</DateEnd>\n"
257
-						 ."\t\t<Visibility>$row[visibility]</Visibility>\n"
258
-						 ."\t\t<SessionCategory>$row[session_category]</SessionCategory>\n";
259
-			}
260
-
261
-		 	if (!$cvs) {
262
-				$add .= "\t</Session>\n";
263
-				fputs($fp, $add);
264
-			}
265
-		}
266
-
267
-		switch ($file_type) {
268
-			case 'xml':
269
-				fputs($fp, "</Sessions>\n");
270
-				fclose($fp);
271
-				$errorMsg = get_lang('UserListHasBeenExported').'<br/>
209
+                $rsUsersCourse = Database::query($sql);
210
+                $userscourse = '';
211
+                while ($rowUsersCourse = Database::fetch_array($rsUsersCourse)){
212
+                    if ($cvs) {
213
+                        $userscourse .= str_replace(';',',',$rowUsersCourse['username']).',';
214
+                    } else {
215
+                        $courses .= "\t\t\t<User>$rowUsersCourse[username]</User>\n";
216
+                    }
217
+                }
218
+
219
+                if ($cvs) {
220
+                    if (!empty($userscourse)) {
221
+                        $userscourse = api_substr(
222
+                            $userscourse,
223
+                            0,
224
+                            api_strlen($userscourse) - 1
225
+                        );
226
+                    }
227
+
228
+                    $courses .= $userscourse.']|';
229
+                } else {
230
+                    $courses .= "\t\t</Course>\n";
231
+                }
232
+            }
233
+
234
+            if (!empty($courses) && $cvs) {
235
+                $courses = api_substr($courses, 0, api_strlen($courses) - 1);
236
+            }
237
+            $add .= $courses;
238
+
239
+
240
+            if (in_array($file_type, ['csv', 'xls'])) {
241
+                $sessionListToExport[] = [
242
+                    $row['name'],
243
+                    $row['username'],
244
+                    $row['access_start_date'],
245
+                    $row['access_end_date'],
246
+                    $row['visibility'],
247
+                    $row['session_category'],
248
+                    $users,
249
+                    $courses
250
+                ];
251
+            } else {
252
+                $add = "\t<Session>\n"
253
+                            ."\t\t<SessionName>$row[name]</SessionName>\n"
254
+                            ."\t\t<Coach>$row[username]</Coach>\n"
255
+                            ."\t\t<DateStart>$row[access_start_date]</DateStart>\n"
256
+                            ."\t\t<DateEnd>$row[access_end_date]</DateEnd>\n"
257
+                            ."\t\t<Visibility>$row[visibility]</Visibility>\n"
258
+                            ."\t\t<SessionCategory>$row[session_category]</SessionCategory>\n";
259
+            }
260
+
261
+                if (!$cvs) {
262
+                $add .= "\t</Session>\n";
263
+                fputs($fp, $add);
264
+            }
265
+        }
266
+
267
+        switch ($file_type) {
268
+            case 'xml':
269
+                fputs($fp, "</Sessions>\n");
270
+                fclose($fp);
271
+                $errorMsg = get_lang('UserListHasBeenExported').'<br/>
272 272
 				<a class="btn btn-default" href="'.$archiveURL.$archiveFile.'">'.get_lang('ClickHereToDownloadTheFile').'</a>';
273
-				break;
274
-			case 'csv':
275
-				Export::arrayToCsv($sessionListToExport, $archiveFile);
276
-				exit;
277
-			case 'xls':
278
-				Export::arrayToXls($sessionListToExport, $archiveFile);
279
-				exit;
280
-				break;
281
-		}
282
-	}
273
+                break;
274
+            case 'csv':
275
+                Export::arrayToCsv($sessionListToExport, $archiveFile);
276
+                exit;
277
+            case 'xls':
278
+                Export::arrayToXls($sessionListToExport, $archiveFile);
279
+                exit;
280
+                break;
281
+        }
282
+    }
283 283
 }
284 284
 
285 285
 // display the header
@@ -289,26 +289,26 @@  discard block
 block discarded – undo
289 289
 $sql = "SELECT id, name FROM $tbl_session ORDER BY name";
290 290
 
291 291
 if (api_is_multiple_url_enabled()) {
292
-	$tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
293
-	$access_url_id = api_get_current_access_url_id();
294
-	if ($access_url_id != -1){
295
-	$sql = "SELECT s.id, name FROM $tbl_session s
292
+    $tbl_session_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION);
293
+    $access_url_id = api_get_current_access_url_id();
294
+    if ($access_url_id != -1){
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)
298 298
 			WHERE access_url_id = $access_url_id
299 299
 			ORDER BY name";
300
-	}
300
+    }
301 301
 }
302 302
 $result = Database::query($sql);
303 303
 $Sessions = Database::store_result($result);
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)) {
311
-	Display::display_normal_message($errorMsg, false); //main API
311
+    Display::display_normal_message($errorMsg, false); //main API
312 312
 }
313 313
 
314 314
 $form = new FormValidator('session_export', 'post', api_get_self());
Please login to merge, or discard this patch.
main/messages/index.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 */
6 6
 require_once '../inc/global.inc.php';
7 7
 if (api_get_setting('allow_social_tool')=='true' &&  api_get_setting('allow_message_tool')=='true') {
8
-	header('Location:inbox.php?f=social');
8
+    header('Location:inbox.php?f=social');
9 9
 } elseif ( api_get_setting('allow_message_tool')=='true') {
10
-	header('Location:inbox.php');
10
+    header('Location:inbox.php');
11 11
 }
12 12
 exit;
Please login to merge, or discard this patch.
main/messages/download.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 $message_uid = '';
51 51
 $message_type = array('inbox','outbox');
52 52
 if (in_array($_GET['type'],$message_type)) {
53
-	if ($_GET['type'] == 'inbox') {
54
-		$message_uid = $row_users['user_receiver_id'];
55
-	} else {
56
-		$message_uid = $row_users['user_sender_id'];
57
-	}
53
+    if ($_GET['type'] == 'inbox') {
54
+        $message_uid = $row_users['user_receiver_id'];
55
+    } else {
56
+        $message_uid = $row_users['user_sender_id'];
57
+    }
58 58
 }
59 59
 
60 60
 // allow to the correct user for download this file
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
 $userGroup = new UserGroup();
63 63
 
64 64
 if (!empty($row_users['group_id'])) {
65
-	$users_group = $userGroup->get_all_users_by_group($row_users['group_id']);
66
-	if (!in_array($current_uid,array_keys($users_group))) {
67
-		$not_allowed_to_edit = true;
68
-	}
65
+    $users_group = $userGroup->get_all_users_by_group($row_users['group_id']);
66
+    if (!in_array($current_uid,array_keys($users_group))) {
67
+        $not_allowed_to_edit = true;
68
+    }
69 69
 } else {
70
-	if ($current_uid != $message_uid) {
71
-		$not_allowed_to_edit = true;
72
-	}
70
+    if ($current_uid != $message_uid) {
71
+        $not_allowed_to_edit = true;
72
+    }
73 73
 }
74 74
 
75 75
 if ($not_allowed_to_edit) {
76
-	api_not_allowed();
77
-	exit;
76
+    api_not_allowed();
77
+    exit;
78 78
 }
79 79
 
80 80
 // set the path directory file
@@ -85,14 +85,14 @@  discard block
 block discarded – undo
85 85
         true
86 86
     );
87 87
 } else {
88
-	$path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system');
88
+    $path_user_info['dir'] = UserManager::getUserPathById($message_uid, 'system');
89 89
 }
90 90
 
91 91
 $full_file_name = $path_user_info['dir'].'message_attachments/'.$file_url;
92 92
 
93 93
 if (Security::check_abs_path($full_file_name, $path_user_info['dir'].'message_attachments/')) {
94 94
     // launch event
95
-	Event::event_download($file_url);
95
+    Event::event_download($file_url);
96 96
     DocumentManager::file_send_for_download($full_file_name,TRUE, $title);
97 97
 }
98 98
 exit;
Please login to merge, or discard this patch.
main/messages/outbox.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -9,20 +9,20 @@  discard block
 block discarded – undo
9 9
 api_block_anonymous_users();
10 10
 
11 11
 if (isset($_GET['messages_page_nr'])) {
12
-	if (api_get_setting('allow_social_tool')=='true' &&
12
+    if (api_get_setting('allow_social_tool')=='true' &&
13 13
         api_get_setting('allow_message_tool')=='true'
14 14
     ) {
15
-		$social_link = '';
16
-		if ($_REQUEST['f']=='social') {
17
-			$social_link = '&f=social';
18
-		}
19
-		header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.'');
20
-		exit;
21
-	}
15
+        $social_link = '';
16
+        if ($_REQUEST['f']=='social') {
17
+            $social_link = '&f=social';
18
+        }
19
+        header('Location:outbox.php?pager='.Security::remove_XSS($_GET['messages_page_nr']).$social_link.'');
20
+        exit;
21
+    }
22 22
 }
23 23
 
24 24
 if (api_get_setting('allow_message_tool')!='true'){
25
-	api_not_allowed();
25
+    api_not_allowed();
26 26
 }
27 27
 //jquery thickbox already called from main/inc/header.inc.php
28 28
 
@@ -54,13 +54,13 @@  discard block
 block discarded – undo
54 54
 		MAIN CODE
55 55
 */
56 56
 if (isset($_GET['f']) && $_GET['f']=='social') {
57
-	$this_section = SECTION_SOCIAL;
58
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
59
-	$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
57
+    $this_section = SECTION_SOCIAL;
58
+    $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
59
+    $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
60 60
 } else {
61
-	$this_section = SECTION_MYPROFILE;
62
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
63
-	$interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
61
+    $this_section = SECTION_MYPROFILE;
62
+    $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
63
+    $interbreadcrumb[]= array ('url' => '#','name' => get_lang('Outbox'));
64 64
 }
65 65
 
66 66
 $actions = '';
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 
84 84
 if (isset($info_delete_outbox[0]) && trim($info_delete_outbox[0])=='delete') {
85 85
     for ($i = 1; $i <= $count_delete_outbox; $i++) {
86
-		MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]);
87
-	}
86
+        MessageManager::delete_message_by_user_sender(api_get_user_id(),$info_delete_outbox[$i]);
87
+    }
88 88
     $message_box=get_lang('SelectedMessagesDeleted').
89 89
         '&nbsp
90 90
         <br><a href="../social/index.php?#remote-tab-3">'.
Please login to merge, or discard this patch.
main/messages/view_message.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -7,40 +7,40 @@
 block discarded – undo
7 7
 require_once '../inc/global.inc.php';
8 8
 api_block_anonymous_users();
9 9
 if (api_get_setting('allow_message_tool')!='true') {
10
-	api_not_allowed();
10
+    api_not_allowed();
11 11
 }
12 12
 
13 13
 if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') {
14
-	$this_section = SECTION_SOCIAL;
15
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
16
-	$interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
14
+    $this_section = SECTION_SOCIAL;
15
+    $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/social/home.php','name' => get_lang('Social'));
16
+    $interbreadcrumb[]= array ('url' => 'inbox.php?f=social','name' => get_lang('Inbox'));
17 17
 } else {
18
-	$this_section = SECTION_MYPROFILE;
19
-	$interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
18
+    $this_section = SECTION_MYPROFILE;
19
+    $interbreadcrumb[]= array ('url' => api_get_path(WEB_PATH).'main/auth/profile.php','name' => get_lang('Profile'));
20 20
 }
21 21
 
22 22
 $social_right_content = null;
23 23
 
24 24
 if (isset($_GET['f']) && $_GET['f']=='social') {
25
-	$social_parameter = '?f=social';
25
+    $social_parameter = '?f=social';
26 26
 } else {
27
-	if (api_get_setting('extended_profile') == 'true') {
28
-		$social_right_content .= '<div class="actions">';
27
+    if (api_get_setting('extended_profile') == 'true') {
28
+        $social_right_content .= '<div class="actions">';
29 29
 
30
-		if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
31
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
30
+        if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
31
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
32 32
                 Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
33
-		}
34
-		if (api_get_setting('allow_message_tool') == 'true') {
35
-		    $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
33
+        }
34
+        if (api_get_setting('allow_message_tool') == 'true') {
35
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
36 36
                 Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
37 37
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
38 38
                 Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
39 39
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
40 40
                 Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
41
-		}
42
-		$social_right_content .= '</div>';
43
-	}
41
+        }
42
+        $social_right_content .= '</div>';
43
+    }
44 44
 }
45 45
 
46 46
 if (empty($_GET['id'])) {
Please login to merge, or discard this patch.
main/messages/new_message.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -74,37 +74,37 @@  discard block
 block discarded – undo
74 74
 * Shows the compose area + a list of users to select from.
75 75
 */
76 76
 function show_compose_to_any($user_id) {
77
-	$online_user_list = MessageManager::get_online_user_list($user_id);
78
-	$default['user_list'] = 0;
79
-	$online_user_list=null;
80
-	$html = manage_form($default, $online_user_list);
77
+    $online_user_list = MessageManager::get_online_user_list($user_id);
78
+    $default['user_list'] = 0;
79
+    $online_user_list=null;
80
+    $html = manage_form($default, $online_user_list);
81 81
     return $html;
82 82
 }
83 83
 
84 84
 function show_compose_reply_to_message($message_id, $receiver_id)
85 85
 {
86
-	$table_message = Database::get_main_table(TABLE_MESSAGE);
87
-	$query = "SELECT user_sender_id FROM $table_message
86
+    $table_message = Database::get_main_table(TABLE_MESSAGE);
87
+    $query = "SELECT user_sender_id FROM $table_message
88 88
 			  WHERE user_receiver_id=".intval($receiver_id)." AND id='".intval($message_id)."';";
89
-	$result = Database::query($query);
90
-	$row = Database::fetch_array($result,'ASSOC');
91
-	if (!isset($row['user_sender_id'])) {
92
-		$html = get_lang('InvalidMessageId');
89
+    $result = Database::query($query);
90
+    $row = Database::fetch_array($result,'ASSOC');
91
+    if (!isset($row['user_sender_id'])) {
92
+        $html = get_lang('InvalidMessageId');
93 93
 
94
-		return $html;
95
-	}
96
-	$userInfo = api_get_user_info($row['user_sender_id']);
97
-	$default['users'] = array($row['user_sender_id']);
98
-	$html = manage_form($default, null, $userInfo['complete_name']);
94
+        return $html;
95
+    }
96
+    $userInfo = api_get_user_info($row['user_sender_id']);
97
+    $default['users'] = array($row['user_sender_id']);
98
+    $html = manage_form($default, null, $userInfo['complete_name']);
99 99
 
100 100
     return $html;
101 101
 }
102 102
 
103 103
 function show_compose_to_user ($receiver_id) {
104
-	$html = get_lang('To').':&nbsp;<strong>'.GetFullUserName($receiver_id).'</strong>';
105
-	$default['title'] = api_xml_http_response_encode(get_lang('EnterTitle'));
106
-	$default['users'] = array($receiver_id);
107
-	$html .= manage_form($default);
104
+    $html = get_lang('To').':&nbsp;<strong>'.GetFullUserName($receiver_id).'</strong>';
105
+    $default['title'] = api_xml_http_response_encode(get_lang('EnterTitle'));
106
+    $default['users'] = array($receiver_id);
107
+    $html .= manage_form($default);
108 108
     return $html;
109 109
 }
110 110
 
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
 
252 252
 /* MAIN SECTION */
253 253
 if ($socialToolIsActive) {
254
-	$this_section = SECTION_SOCIAL;
254
+    $this_section = SECTION_SOCIAL;
255 255
     $interbreadcrumb[] = array(
256 256
         'url' => api_get_path(WEB_PATH).'main/social/home.php',
257 257
         'name' => get_lang('SocialNetwork'),
258 258
     );
259 259
 } else {
260
-	$this_section = SECTION_MYPROFILE;
260
+    $this_section = SECTION_MYPROFILE;
261 261
     $interbreadcrumb[] = array(
262 262
         'url' => api_get_path(WEB_PATH).'main/auth/profile.php',
263 263
         'name' => get_lang('Profile'),
@@ -267,30 +267,30 @@  discard block
 block discarded – undo
267 267
 $group_id = isset($_REQUEST['group_id']) ? intval($_REQUEST['group_id']) : null;
268 268
 $social_right_content = null;
269 269
 if ($group_id != 0) {
270
-	$social_right_content .= '<div class=actions>';
271
-	$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'.
272
-		Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
273
-	$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'.
274
-		Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
275
-	$social_right_content .= '</div>';
270
+    $social_right_content .= '<div class=actions>';
271
+    $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/group_view.php?id='.$group_id.'">'.
272
+        Display::return_icon('back.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
273
+    $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php?group_id='.$group_id.'">'.
274
+        Display::return_icon('message_new.png',api_xml_http_response_encode(get_lang('ComposeMessage'))).'</a>';
275
+    $social_right_content .= '</div>';
276 276
 } else {
277
-	if ($socialToolIsActive) {
278
-	} else {
279
-		$social_right_content .= '<div class=actions>';
280
-		if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
281
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
277
+    if ($socialToolIsActive) {
278
+    } else {
279
+        $social_right_content .= '<div class=actions>';
280
+        if (api_get_setting('allow_social_tool') == 'true' && api_get_setting('allow_message_tool') == 'true') {
281
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/social/profile.php">'.
282 282
                 Display::return_icon('shared_profile.png', get_lang('ViewSharedProfile')).'</a>';
283
-		}
284
-		if (api_get_setting('allow_message_tool') == 'true') {
285
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
283
+        }
284
+        if (api_get_setting('allow_message_tool') == 'true') {
285
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/new_message.php">'.
286 286
                 Display::return_icon('message_new.png',get_lang('ComposeMessage')).'</a>';
287
-			$social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
287
+            $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/inbox.php">'.
288 288
                 Display::return_icon('inbox.png',get_lang('Inbox')).'</a>';
289 289
             $social_right_content .= '<a href="'.api_get_path(WEB_PATH).'main/messages/outbox.php">'.
290 290
                 Display::return_icon('outbox.png',get_lang('Outbox')).'</a>';
291
-		}
292
-		$social_right_content .= '</div>';
293
-	}
291
+        }
292
+        $social_right_content .= '</div>';
293
+    }
294 294
 }
295 295
 
296 296
 // LEFT COLUMN
Please login to merge, or discard this patch.
main/attendance/attendance_controller.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -636,11 +636,11 @@
 block discarded – undo
636 636
             }
637 637
             $formToDisplay = $form->returnForm();
638 638
         } else {
639
-           if (!empty($sessionId)) {
640
-               $sessionInfo = api_get_session_info($sessionId);
641
-               $startDate = $sessionInfo['access_start_date'];
642
-               $endDate = $sessionInfo['access_end_date'];
643
-           }
639
+            if (!empty($sessionId)) {
640
+                $sessionInfo = api_get_session_info($sessionId);
641
+                $startDate = $sessionInfo['access_start_date'];
642
+                $endDate = $sessionInfo['access_end_date'];
643
+            }
644 644
         }
645 645
 
646 646
         $attendance = new Attendance();
Please login to merge, or discard this patch.