Completed
Pull Request — 1.11.x (#1296)
by José
132:18 queued 93:54
created
main/messages/download.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
 
49 49
 // get message user id for inbox/outbox
50 50
 $message_uid = '';
51
-$message_type = array('inbox','outbox');
52
-if (in_array($_GET['type'],$message_type)) {
51
+$message_type = array('inbox', 'outbox');
52
+if (in_array($_GET['type'], $message_type)) {
53 53
 	if ($_GET['type'] == 'inbox') {
54 54
 		$message_uid = $row_users['user_receiver_id'];
55 55
 	} else {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
 if (!empty($row_users['group_id'])) {
65 65
 	$users_group = $userGroup->get_all_users_by_group($row_users['group_id']);
66
-	if (!in_array($current_uid,array_keys($users_group))) {
66
+	if (!in_array($current_uid, array_keys($users_group))) {
67 67
 		$not_allowed_to_edit = true;
68 68
 	}
69 69
 } else {
@@ -93,6 +93,6 @@  discard block
 block discarded – undo
93 93
 if (Security::check_abs_path($full_file_name, $path_user_info['dir'].'message_attachments/')) {
94 94
     // launch event
95 95
 	Event::event_download($file_url);
96
-    DocumentManager::file_send_for_download($full_file_name,TRUE, $title);
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/attendance/attendance_controller.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
                     $attendance->set_attendance_qualify_title($_POST['attendance_qualify_title']);
61 61
                     $attendance->set_attendance_weight($_POST['attendance_weight']);
62 62
                     $link_to_gradebook = false;
63
-                    if ( isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1 ) {
63
+                    if (isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1) {
64 64
                         $link_to_gradebook = true;
65 65
                     }
66 66
                     $attendance->category_id = $_POST['category_id'];
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
                     ) {
113 113
                         $link_to_gradebook = true;
114 114
                     }
115
-                    $attendance->attendance_edit($attendance_id,$link_to_gradebook);
115
+                    $attendance->attendance_edit($attendance_id, $link_to_gradebook);
116 116
                     Security::clear_token();
117 117
                     header('location:index.php?action=attendance_list&'.api_get_cidreq());
118 118
                     exit;
@@ -543,17 +543,17 @@  discard block
 block discarded – undo
543 543
             }
544 544
         }
545 545
         $max_cols_per_page = 12; //10 dates + 2 name and number
546
-        $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2;//10
546
+        $max_dates_per_page = $max_dates_per_page_original = $max_cols_per_page - 2; //10
547 547
         $rows = count($data_table);
548 548
 
549 549
         if ($cols > $max_cols_per_page) {
550
-            $number_tables = round(($cols-2)/$max_dates_per_page);
550
+            $number_tables = round(($cols - 2) / $max_dates_per_page);
551 551
             $headers = $data_table[0];
552 552
             $all = array();
553 553
             $tables = array();
554 554
             $changed = 1;
555 555
 
556
-            for ($i= 0; $i <= $rows; $i++) {
556
+            for ($i = 0; $i <= $rows; $i++) {
557 557
                 $row = isset($data_table[$i]) ? $data_table[$i] : null;
558 558
                 $key = 1;
559 559
                 $max_dates_per_page = 10;
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
                     foreach ($item as $value) {
565 565
                         if ($count_j >= $max_dates_per_page) {
566 566
                             $key++;
567
-                            $max_dates_per_page = $max_dates_per_page_original*$key;
567
+                            $max_dates_per_page = $max_dates_per_page_original * $key;
568 568
                             //magic hack
569 569
                             $tables[$key][$i][] = $tables[1][$i][0];
570 570
                             $tables[$key][$i][] = $tables[1][$i][1];
@@ -622,8 +622,8 @@  discard block
 block discarded – undo
622 622
             $form = new FormValidator(
623 623
                 'search',
624 624
                 'post',
625
-                api_get_self() . '?' . api_get_cidreq(
626
-                ) . '&action=calendar_logins'
625
+                api_get_self().'?'.api_get_cidreq(
626
+                ).'&action=calendar_logins'
627 627
             );
628 628
             $form->addDateRangePicker('range', get_lang('DateRange'));
629 629
             $form->addButton('submit', get_lang('Submit'));
Please login to merge, or discard this patch.
main/attendance/attendance_list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 if (api_is_allowed_to_edit(null, true)) {
14 14
     echo '<div class="actions">';
15 15
     echo '<a href="index.php?'.api_get_cidreq().'&action=attendance_add">'.
16
-        Display::return_icon('new_attendance_list.png', get_lang('CreateANewAttendance'),'',ICON_SIZE_MEDIUM).'</a>';
16
+        Display::return_icon('new_attendance_list.png', get_lang('CreateANewAttendance'), '', ICON_SIZE_MEDIUM).'</a>';
17 17
     echo '</div>';
18 18
 }
19 19
 $attendance = new Attendance();
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/attendance/attendance_add.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 // error messages
14 14
 if (isset($error)) {
15
-    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
15
+    Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
16 16
 }
17 17
 
18 18
 if (!isset($error)) {
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 $form->addElement('hidden', 'sec_token', $token);
29 29
 
30 30
 $form->addText('title', get_lang('Title'), true);
31
-$form->applyFilter('title','html_filter');
31
+$form->applyFilter('title', 'html_filter');
32 32
 $form->addHtmlEditor(
33 33
     'description',
34 34
     get_lang('Description'),
@@ -41,21 +41,21 @@  discard block
 block discarded – undo
41 41
 if ((api_get_session_id() != 0 && Gradebook::is_active()) || api_get_session_id() == 0) {
42 42
     $form->addButtonAdvancedSettings('id_qualify');
43 43
 
44
-    $form->addElement('html','<div id="id_qualify_options" style="display:none">');
44
+    $form->addElement('html', '<div id="id_qualify_options" style="display:none">');
45 45
 
46 46
     // Qualify Attendance for gradebook option
47
-    $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
48
-    $form->addElement('html','<div id="options_field" style="display:none">');
47
+    $form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'), 'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
48
+    $form->addElement('html', '<div id="options_field" style="display:none">');
49 49
 
50 50
     GradebookUtils::load_gradebook_select_in_tool($form);
51 51
 
52 52
     $form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));
53 53
     $form->applyFilter('attendance_qualify_title', 'html_filter');
54
-    $form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"');
54
+    $form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'), 'value="0.00" Style="width:40px" onfocus="javascript: this.select();"');
55 55
     $form->applyFilter('attendance_weight', 'html_filter');
56
-    $form->addElement('html','</div>');
56
+    $form->addElement('html', '</div>');
57 57
 
58
-    $form->addElement('html','</div>');
58
+    $form->addElement('html', '</div>');
59 59
 }
60 60
 $form->addButtonCreate(get_lang('Save'));
61 61
 $form->display();
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.