Completed
Pull Request — 1.11.x (#1339)
by José
73:57 queued 34:43
created
main/session/session_category_edit.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 $sql = "SELECT * FROM $tbl_session_category WHERE id='".$id."' ORDER BY name";
30 30
 $result = Database::query($sql);
31 31
 if (!$infos = Database::fetch_array($result)) {
32
-	header('Location: session_list.php');
33
-	exit();
32
+    header('Location: session_list.php');
33
+    exit();
34 34
 }
35 35
 
36 36
 list($year_start,$month_start,$day_start)=explode('-',$infos['date_start']);
37 37
 list($year_end,$month_end,$day_end)=explode('-',$infos['date_end']);
38 38
 
39 39
 if (!api_is_platform_admin() && $infos['session_admin_id']!=$_user['user_id'] && !api_is_session_admin()) {
40
-	api_not_allowed(true);
40
+    api_not_allowed(true);
41 41
 }
42 42
 
43 43
 if (isset($_POST['formSent']) && $_POST['formSent']) {
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $day_end
61 61
     );
62 62
     if ($return == strval(intval($return))) {
63
-		Display::addFlash(Display::return_message(get_lang('SessionCategoryUpdate')));
63
+        Display::addFlash(Display::return_message(get_lang('SessionCategoryUpdate')));
64 64
         header('Location: session_category_list.php');
65 65
         exit();
66 66
     }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 // display the header
74 74
 Display::display_header($tool_name);
75 75
 if (!empty($return)) {
76
-	Display::display_error_message($return,false);
76
+    Display::display_error_message($return,false);
77 77
 }
78 78
 ?>
79 79
 <div class="row">
Please login to merge, or discard this patch.
main/session/session_course_edit.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
 $result = Database::query($sql);
38 38
 
39 39
 if (!list($session_name,$course_title) = Database::fetch_row($result)) {
40
-	header('Location: session_course_list.php?id_session='.$id_session);
41
-	exit();
40
+    header('Location: session_course_list.php?id_session='.$id_session);
41
+    exit();
42 42
 }
43 43
 
44 44
 //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
@@ -48,63 +48,63 @@  discard block
 block discarded – undo
48 48
 
49 49
 $arr_infos = array();
50 50
 if (isset($_POST['formSent']) && $_POST['formSent']) {
51
-	$formSent = 1;
51
+    $formSent = 1;
52 52
 
53
-	// get all tutor by course_code in the session
54
-	$sql = "SELECT user_id
53
+    // get all tutor by course_code in the session
54
+    $sql = "SELECT user_id
55 55
 	        FROM $tbl_session_rel_course_rel_user
56 56
 	        WHERE session_id = '$id_session' AND c_id = '".$courseId."' AND status = 2";
57
-	$rs_coaches = Database::query($sql);
57
+    $rs_coaches = Database::query($sql);
58 58
 
59
-	$coaches_course_session = array();
60
-	if (Database::num_rows($rs_coaches) > 0){
61
-		while ($row_coaches = Database::fetch_row($rs_coaches)) {
62
-			$coaches_course_session[] = $row_coaches[0];
63
-		}
64
-	}
59
+    $coaches_course_session = array();
60
+    if (Database::num_rows($rs_coaches) > 0){
61
+        while ($row_coaches = Database::fetch_row($rs_coaches)) {
62
+            $coaches_course_session[] = $row_coaches[0];
63
+        }
64
+    }
65 65
 
66
-	$id_coaches= $_POST['id_coach'];
66
+    $id_coaches= $_POST['id_coach'];
67 67
 
68
-	if (is_array($id_coaches) && count($id_coaches) > 0) {
68
+    if (is_array($id_coaches) && count($id_coaches) > 0) {
69 69
 
70
-		foreach ($id_coaches as $id_coach) {
71
-			$id_coach = intval($id_coach);
70
+        foreach ($id_coaches as $id_coach) {
71
+            $id_coach = intval($id_coach);
72 72
             $rs1 = SessionManager::set_coach_to_course_session(
73 73
                 $id_coach,
74 74
                 $id_session,
75 75
                 $courseId
76 76
             );
77
-		}
77
+        }
78 78
 
79
-		// set status to 0 other tutors from multiple list
80
-		$array_intersect = array_diff($coaches_course_session,$id_coaches);
79
+        // set status to 0 other tutors from multiple list
80
+        $array_intersect = array_diff($coaches_course_session,$id_coaches);
81 81
 
82
-		foreach ($array_intersect as $no_coach_user_id) {
83
-			$rs2 = SessionManager::set_coach_to_course_session(
84
-				$no_coach_user_id,
85
-				$id_session,
82
+        foreach ($array_intersect as $no_coach_user_id) {
83
+            $rs2 = SessionManager::set_coach_to_course_session(
84
+                $no_coach_user_id,
85
+                $id_session,
86 86
                 $courseId,
87
-				true
88
-			);
89
-		}
87
+                true
88
+            );
89
+        }
90 90
 
91
-		header('Location: '.Security::remove_XSS($_GET['page']).'?id_session='.$id_session);
92
-		exit();
93
-	}
91
+        header('Location: '.Security::remove_XSS($_GET['page']).'?id_session='.$id_session);
92
+        exit();
93
+    }
94 94
 } else {
95
-	$sql = "SELECT user_id
95
+    $sql = "SELECT user_id
96 96
 	        FROM $tbl_session_rel_course_rel_user
97 97
 	        WHERE
98 98
                 session_id = '$id_session' AND
99 99
                 c_id = '".$courseId."' AND
100 100
                 status = 2 ";
101
-	$rs = Database::query($sql);
101
+    $rs = Database::query($sql);
102 102
 
103
-	if (Database::num_rows($rs) > 0) {
104
-		while ($infos = Database::fetch_array($rs)) {
105
-			$arr_infos[] = $infos['user_id'];
106
-		}
107
-	}
103
+    if (Database::num_rows($rs) > 0) {
104
+        while ($infos = Database::fetch_array($rs)) {
105
+            $arr_infos[] = $infos['user_id'];
106
+        }
107
+    }
108 108
 }
109 109
 
110 110
 $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
Please login to merge, or discard this patch.
main/session/add_many_session_to_category.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -197,12 +197,12 @@
 block discarded – undo
197 197
         if (!empty($rows_session_category)) {
198 198
             foreach($rows_session_category as $category) {
199 199
                 if($category['id'] == $categoryId)
200
-                      echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>';
201
-                  else
202
-                      echo '<option value="'.$category['id'].'">'.$category['name'].'</option>';
200
+                        echo '<option value="'.$category['id'].'" selected>'.$category['name'].'</option>';
201
+                    else
202
+                        echo '<option value="'.$category['id'].'">'.$category['name'].'</option>';
203 203
             }
204 204
         }
205
-          ?>
205
+            ?>
206 206
       </select>
207 207
     </td>
208 208
 </tr>
Please login to merge, or discard this patch.
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/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/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.