Completed
Push — 1.10.x ( 51aeba...107530 )
by Yannick
123:47 queued 78:53
created
main/admin/archive_cleanup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 api_protect_admin_script(true);
17 17
 
18 18
 // setting breadcrumbs
19
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
19
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
20 20
 
21 21
 $form = new FormValidator('archive_cleanup_form', 'post', '', '', array(), FormValidator::LAYOUT_BOX);
22 22
 $form->addButtonSend(get_lang('ArchiveDirCleanupProceedButton'));
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 
51 51
 if (isset($_GET['msg']) && isset($_GET['type'])) {
52 52
 	if (in_array($_GET['msg'], array('ArchiveDirCleanupSucceeded', 'ArchiveDirCleanupFailed')))
53
-	switch($_GET['type']) {
53
+	switch ($_GET['type']) {
54 54
 		case 'error':
55 55
 			$message = Display::return_message(get_lang($_GET['msg']), 'error');
56 56
 			break;
Please login to merge, or discard this patch.
main/admin/course_import.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@
 block discarded – undo
12 12
  */
13 13
 function validate_data($courses)
14 14
 {
15
-    $errors = array ();
16
-    $coursecodes = array ();
15
+    $errors = array();
16
+    $coursecodes = array();
17 17
     foreach ($courses as $index => $course) {
18
-        $course['line'] = $index +1;
18
+        $course['line'] = $index + 1;
19 19
 
20 20
         // 1. Check whether mandatory fields are set.
21
-        $mandatory_fields = array ('Code', 'Title', 'CourseCategory');
21
+        $mandatory_fields = array('Code', 'Title', 'CourseCategory');
22 22
         foreach ($mandatory_fields as $field) {
23 23
             if (!isset($course[$field]) || strlen($course[$field]) == 0) {
24 24
                 $course['error'] = get_lang($field.'Mandatory');
Please login to merge, or discard this patch.
main/admin/subscribe_user2class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
32 32
 $result = Database::query($sql);
33 33
 
34 34
 if (!list ($class_name) = Database::fetch_row($result)) {
35
-    header('Location: class_list.php?filtreCours=' . urlencode($course));
35
+    header('Location: class_list.php?filtreCours='.urlencode($course));
36 36
     exit();
37 37
 }
38 38
 
39 39
 $noPHP_SELF = true;
40 40
 
41
-$tool_name = get_lang('AddUsersToAClass') . ' (' . $class_name . ')';
41
+$tool_name = get_lang('AddUsersToAClass').' ('.$class_name.')';
42 42
 
43 43
 $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
44
-$interbreadcrumb[] = array("url" => "class_list.php?filtreCours=" . urlencode($course), "name" => get_lang('AdminClasses'));
44
+$interbreadcrumb[] = array("url" => "class_list.php?filtreCours=".urlencode($course), "name" => get_lang('AdminClasses'));
45 45
 
46 46
 if ($_POST['formSent']) {
47 47
     $form_sent = $_POST['formSent'];
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                 foreach ($left_user_list as $user_id) {
60 60
                     ClassManager :: add_user($user_id, $class_id);
61 61
                 }
62
-                header('Location: class_list.php?filtreCours=' . urlencode($course));
62
+                header('Location: class_list.php?filtreCours='.urlencode($course));
63 63
                 exit();
64 64
             }
65 65
         } elseif ($remove_from_class) {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
                 foreach ($right_user_list as $index => $user_id) {
70 70
                     ClassManager :: unsubscribe_user($user_id, $class_id);
71 71
                 }
72
-                header('Location: class_list.php?filtreCours=' . urlencode($course));
72
+                header('Location: class_list.php?filtreCours='.urlencode($course));
73 73
                 exit();
74 74
             }
75 75
         }
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 Display :: display_header($tool_name);
79 79
 //api_display_tool_title($tool_name);
80 80
 $target_name = api_sort_by_first_name() ? 'firstname' : 'lastname';
81
-$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u LEFT JOIN $tbl_class_user cu ON u.user_id=cu.user_id AND class_id='$class_id' WHERE " . $target_name . " LIKE '" . $first_letter_left . "%' AND class_id IS NULL ORDER BY " . (count($left_user_list) > 0 ? "(user_id IN(" . implode(',', $left_user_list) . ")) DESC," : "") . " " . $target_name;
81
+$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u LEFT JOIN $tbl_class_user cu ON u.user_id=cu.user_id AND class_id='$class_id' WHERE ".$target_name." LIKE '".$first_letter_left."%' AND class_id IS NULL ORDER BY ".(count($left_user_list) > 0 ? "(user_id IN(".implode(',', $left_user_list).")) DESC," : "")." ".$target_name;
82 82
 $result = Database::query($sql);
83 83
 $left_users = Database::store_result($result);
84
-$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u,$tbl_class_user cu WHERE cu.user_id=u.user_id AND class_id='$class_id' AND " . $target_name . " LIKE '" . $first_letter_right . "%' ORDER BY " . (count($right_user_list) > 0 ? "(user_id IN(" . implode(',', $right_user_list) . ")) DESC," : "") . " " . $target_name;
84
+$sql = "SELECT u.user_id,lastname,firstname,username FROM $tbl_user u,$tbl_class_user cu WHERE cu.user_id=u.user_id AND class_id='$class_id' AND ".$target_name." LIKE '".$first_letter_right."%' ORDER BY ".(count($right_user_list) > 0 ? "(user_id IN(".implode(',', $right_user_list).")) DESC," : "")." ".$target_name;
85 85
 $result = Database::query($sql);
86 86
 $right_users = Database::store_result($result);
87 87
 if (!empty($error_message)) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
                 <?php
123 123
                 foreach ($left_users as $user) {
124 124
                     ?>
125
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
125
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $left_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?></option>
126 126
                         <?php
127 127
                     }
128 128
                     ?>
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     <?php
139 139
                     foreach ($right_users as $user) {
140 140
                         ?>
141
-                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']) . ' (' . $user['username'] . ')'; ?></option>
141
+                        <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $right_user_list)) echo 'selected="selected"'; ?>><?php echo api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')'; ?></option>
142 142
     <?php
143 143
 }
144 144
 ?>
Please login to merge, or discard this patch.
main/admin/subscribe_user2course.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 $form_sent = 0;
24 24
 $first_letter_user = '';
25 25
 $first_letter_course = '';
26
-$courses = array ();
26
+$courses = array();
27 27
 $users = array();
28 28
 
29 29
 $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 /* Header */
33 33
 $tool_name = get_lang('AddUsersToACourse');
34
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
34
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
35 35
 
36 36
 $htmlHeadXtra[] = '
37 37
 <script type="text/javascript">
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 // displaying the header
45 45
 Display :: display_header($tool_name);
46 46
 
47
-$link_add_group = '<a href="usergroups.php">'.Display::return_icon('multiple.gif',get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups').'</a>';
47
+$link_add_group = '<a href="usergroups.php">'.Display::return_icon('multiple.gif', get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups').'</a>';
48 48
 echo '<div class="actions">'.$link_add_group.'</div>';
49 49
 
50 50
 $form = new FormValidator('subscribe_user2course');
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 $form->display();
53 53
 
54 54
 //checking for extra field with filter on
55
-$extra_field_list= UserManager::get_extra_fields();
55
+$extra_field_list = UserManager::get_extra_fields();
56 56
 $new_field_list = array();
57 57
 if (is_array($extra_field_list)) {
58 58
     foreach ($extra_field_list as $extra_field) {
59 59
         //if is enabled to filter and is a "<select>" field type
60
-        if ($extra_field[8]==1 && $extra_field[2]==4 ) {
60
+        if ($extra_field[8] == 1 && $extra_field[2] == 4) {
61 61
             $new_field_list[] = array('name'=> $extra_field[3], 'variable'=>$extra_field[1], 'data'=> $extra_field[9]);
62 62
         }
63 63
     }
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 /* React on POSTed request */
67 67
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
68 68
     $form_sent = $_POST['form_sent'];
69
-    $users = isset($_POST['UserList']) && is_array($_POST['UserList']) ? $_POST['UserList'] : array() ;
70
-    $courses = isset($_POST['CourseList']) && is_array($_POST['CourseList']) ? $_POST['CourseList'] : array() ;
69
+    $users = isset($_POST['UserList']) && is_array($_POST['UserList']) ? $_POST['UserList'] : array();
70
+    $courses = isset($_POST['CourseList']) && is_array($_POST['CourseList']) ? $_POST['CourseList'] : array();
71 71
     $first_letter_user = $_POST['firstLetterUser'];
72 72
     $first_letter_course = $_POST['firstLetterCourse'];
73 73
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
     $sql = "SELECT count(*) as nb_users FROM $tbl_user";
106 106
     $result = Database::query($sql);
107 107
     $num_row = Database::fetch_array($result);
108
-    if  ($num_row['nb_users']>1000) {
108
+    if ($num_row['nb_users'] > 1000) {
109 109
         //if there are too much users to gracefully handle with the HTML select list,
110 110
         // assign a default filter on users names
111 111
         $first_letter_user = 'A';
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
 //Filter by Extra Fields
120 120
 $use_extra_fields = false;
121 121
 if (is_array($extra_field_list)) {
122
-    if (is_array($new_field_list) && count($new_field_list)>0 ) {
123
-        $result_list=array();
122
+    if (is_array($new_field_list) && count($new_field_list) > 0) {
123
+        $result_list = array();
124 124
         foreach ($new_field_list as $new_field) {
125 125
             $varname = 'field_'.$new_field['variable'];
126 126
             if (UserManager::is_extra_field_available($new_field['variable'])) {
127
-                if (isset($_POST[$varname]) && $_POST[$varname]!='0') {
127
+                if (isset($_POST[$varname]) && $_POST[$varname] != '0') {
128 128
                     $use_extra_fields = true;
129
-                    $extra_field_result[]= UserManager::get_extra_user_data_by_value(
129
+                    $extra_field_result[] = UserManager::get_extra_user_data_by_value(
130 130
                         $new_field['variable'],
131 131
                         $_POST[$varname]
132 132
                     );
@@ -138,10 +138,10 @@  discard block
 block discarded – undo
138 138
 
139 139
 if ($use_extra_fields) {
140 140
     $final_result = array();
141
-    if (count($extra_field_result)>1) {
142
-        for($i=0;$i<count($extra_field_result)-1;$i++) {
143
-            if (is_array($extra_field_result[$i+1])) {
144
-                $final_result  = array_intersect($extra_field_result[$i],$extra_field_result[$i+1]);
141
+    if (count($extra_field_result) > 1) {
142
+        for ($i = 0; $i < count($extra_field_result) - 1; $i++) {
143
+            if (is_array($extra_field_result[$i + 1])) {
144
+                $final_result = array_intersect($extra_field_result[$i], $extra_field_result[$i + 1]);
145 145
             }
146 146
         }
147 147
     } else {
@@ -149,15 +149,15 @@  discard block
 block discarded – undo
149 149
     }
150 150
 
151 151
     if (api_is_multiple_url_enabled()) {
152
-        if (is_array($final_result) && count($final_result)>0) {
153
-            $where_filter = " AND u.user_id IN  ('".implode("','",$final_result)."') ";
152
+        if (is_array($final_result) && count($final_result) > 0) {
153
+            $where_filter = " AND u.user_id IN  ('".implode("','", $final_result)."') ";
154 154
         } else {
155 155
             //no results
156 156
             $where_filter = " AND u.user_id  = -1";
157 157
         }
158 158
     } else {
159
-        if (is_array($final_result) && count($final_result)>0) {
160
-            $where_filter = " AND user_id IN  ('".implode("','",$final_result)."') ";
159
+        if (is_array($final_result) && count($final_result) > 0) {
160
+            $where_filter = " AND user_id IN  ('".implode("','", $final_result)."') ";
161 161
         } else {
162 162
             //no results
163 163
             $where_filter = " AND user_id  = -1";
@@ -177,14 +177,14 @@  discard block
 block discarded – undo
177 177
 $sql = "SELECT user_id, lastname, firstname, username, official_code
178 178
         FROM $tbl_user
179 179
         WHERE user_id<>2 AND ".$target_name." LIKE '".$first_letter_user."%' $where_filter
180
-        ORDER BY ". (count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
180
+        ORDER BY ".(count($users) > 0 ? "(user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
181 181
 
182 182
 if (api_is_multiple_url_enabled()) {
183
-    $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
183
+    $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
184 184
     $access_url_id = api_get_current_access_url_id();
185
-    if ($access_url_id != -1){
185
+    if ($access_url_id != -1) {
186 186
         $sql = "SELECT u.user_id,lastname,firstname,username, official_code
187
-                FROM ".$tbl_user ." u
187
+                FROM ".$tbl_user." u
188 188
                 INNER JOIN $tbl_user_rel_access_url user_rel_url
189 189
                 ON (user_rel_url.user_id = u.user_id)
190 190
                 WHERE
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                     access_url_id =  $access_url_id AND
193 193
                     (".$target_name." LIKE '".$first_letter_user."%' )
194 194
                     $where_filter
195
-                ORDER BY ". (count($users) > 0 ? "(u.user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
195
+                ORDER BY ".(count($users) > 0 ? "(u.user_id IN(".implode(',', $users).")) DESC," : "")." ".$orderBy;
196 196
     }
197 197
 }
198 198
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 if (api_is_multiple_url_enabled()) {
209 209
     $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
210 210
     $access_url_id = api_get_current_access_url_id();
211
-    if ($access_url_id != -1){
211
+    if ($access_url_id != -1) {
212 212
         $sql = "SELECT code, visual_code, title
213 213
                 FROM $tbl_course as course
214 214
                 INNER JOIN $tbl_course_rel_access_url course_rel_url
@@ -228,17 +228,17 @@  discard block
 block discarded – undo
228 228
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;">
229 229
 <?php
230 230
 if (is_array($extra_field_list)) {
231
-    if (is_array($new_field_list) && count($new_field_list)>0 ) {
231
+    if (is_array($new_field_list) && count($new_field_list) > 0) {
232 232
         echo '<h3>'.get_lang('FilterUsers').'</h3>';
233 233
         foreach ($new_field_list as $new_field) {
234 234
             echo $new_field['name'];
235 235
             $varname = 'field_'.$new_field['variable'];
236 236
             echo '&nbsp;<select name="'.$varname.'">';
237 237
             echo '<option value="0">--'.get_lang('Select').'--</option>';
238
-            foreach	($new_field['data'] as $option) {
239
-                $checked='';
238
+            foreach ($new_field['data'] as $option) {
239
+                $checked = '';
240 240
                 if (isset($_POST[$varname])) {
241
-                    if ($_POST[$varname]==$option[1]) {
241
+                    if ($_POST[$varname] == $option[1]) {
242 242
                         $checked = 'selected="true"';
243 243
                     }
244 244
                 }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 <?php
286 286
     foreach ($db_users as $user) {
287 287
 ?>
288
-      <option value="<?php echo $user['user_id']; ?>" <?php if(in_array($user['user_id'],$users)) echo 'selected="selected"'; ?>>
288
+      <option value="<?php echo $user['user_id']; ?>" <?php if (in_array($user['user_id'], $users)) echo 'selected="selected"'; ?>>
289 289
       <?php
290 290
         $userName = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].')';
291 291
         if ($showOfficialCode) {
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 <?php
313 313
     foreach ($db_courses as $course) {
314 314
 ?>
315
-     <option value="<?php echo $course['code']; ?>" <?php if(in_array($course['code'],$courses)) echo 'selected="selected"'; ?>>
315
+     <option value="<?php echo $course['code']; ?>" <?php if (in_array($course['code'], $courses)) echo 'selected="selected"'; ?>>
316 316
          <?php echo '('.$course['visual_code'].') '.$course['title']; ?>
317 317
      </option>
318 318
 <?php
Please login to merge, or discard this patch.
main/admin/legal_list.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 require_once '../inc/global.inc.php';
12 12
 $this_section = SECTION_PLATFORM_ADMIN;
13 13
 api_protect_admin_script();
14
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
14
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
15 15
 $tool_name = get_lang('TermsAndConditions');
16 16
 Display :: display_header($tool_name);
17 17
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 
20 20
 // action menu
21 21
 echo '<div class="actions">';
22
-echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/legal_add.php">'.Display::return_icon('edit.gif',get_lang('EditTermsAndConditions'),'').get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
22
+echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/legal_add.php">'.Display::return_icon('edit.gif', get_lang('EditTermsAndConditions'), '').get_lang('EditTermsAndConditions').'</a>&nbsp;&nbsp;';
23 23
 echo '</div>';
24 24
 
25 25
 // Actions
@@ -40,18 +40,18 @@  discard block
 block discarded – undo
40 40
 //if ($legal_count < )
41 41
 
42 42
 
43
-$table = new SortableTable('conditions', 'count_mask', 'get_legal_data_mask',2);
43
+$table = new SortableTable('conditions', 'count_mask', 'get_legal_data_mask', 2);
44 44
 $table->set_additional_parameters($parameters);
45 45
 $table->set_header(0, get_lang('Version'), false, 'width="15px"');
46 46
 $table->set_header(1, get_lang('Language'), false, 'width="30px"');
47
-$table->set_header(2, get_lang('Content'),false);
47
+$table->set_header(2, get_lang('Content'), false);
48 48
 $table->set_header(3, get_lang('Changes'), false, 'width="60px"');
49 49
 $table->set_header(4, get_lang('Type'), false, 'width="60px"');
50 50
 $table->set_header(5, get_lang('Date'), false, 'width="50px"');
51 51
 $table->display();
52 52
 
53 53
 // this 2 "mask" function are here just because the SortableTable
54
-function get_legal_data_mask($id, $params=null, $row=null) {
54
+function get_legal_data_mask($id, $params = null, $row = null) {
55 55
 	return LegalManager::get_legal_data($id, $params, $row);
56 56
 }
57 57
 function count_mask() {
Please login to merge, or discard this patch.
main/admin/teacher_time_report.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@
 block discarded – undo
295 295
 if (isset($_GET['export'])) {
296 296
     $dataToExport = $timeReport->prepareDataToExport($withFilter);
297 297
 
298
-    $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time();
298
+    $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time();
299 299
 
300 300
     switch ($_GET['export']) {
301 301
         case 'pdf':
Please login to merge, or discard this patch.
main/admin/skills_gradebook.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
 // setting breadcrumbs
26 26
 
27 27
 $tool_name = get_lang('SkillsAndGradebooks');
28
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
28
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
29 29
 if ($action == 'add_skill') {
30
-    $interbreadcrumb[]=array('url' => 'skills_gradebook.php','name' => get_lang('SkillsAndGradebooks'));
30
+    $interbreadcrumb[] = array('url' => 'skills_gradebook.php', 'name' => get_lang('SkillsAndGradebooks'));
31 31
     $tool_name = get_lang('Add');
32 32
 }
33 33
 
@@ -46,10 +46,10 @@  discard block
 block discarded – undo
46 46
 
47 47
 //Column config
48 48
 $column_model   = array(
49
-                        array('name'=>'name',           'index'=>'name',        'width'=>'150', 'align'=>'left'),
50
-                        array('name'=>'certificate',    'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51
-                        array('name'=>'skills',         'index'=>'skills',      'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52
-                        array('name'=>'actions',        'index'=>'actions',     'width'=>'30', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false')
49
+                        array('name'=>'name', 'index'=>'name', 'width'=>'150', 'align'=>'left'),
50
+                        array('name'=>'certificate', 'index'=>'certificate', 'width'=>'25', 'align'=>'left', 'sortable'=>'false'),
51
+                        array('name'=>'skills', 'index'=>'skills', 'width'=>'300', 'align'=>'left', 'sortable'=>'false'),
52
+                        array('name'=>'actions', 'index'=>'actions', 'width'=>'30', 'align'=>'left', 'formatter'=>'action_formatter', 'sortable'=>'false')
53 53
                        );
54 54
 //Autowidth
55 55
 $extra_params['autowidth'] = 'true';
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 $action_links = 'function action_formatter(cellvalue, options, rowObject) {
61 61
                         //certificates
62 62
                         if (rowObject[4] == 1) {
63
-                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'),'',ICON_SIZE_SMALL).'</a>'.'\';
63
+                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">'.Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL).'</a>'.'\';
64 64
                         } else {
65
-                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'),'',ICON_SIZE_SMALL).''.'\';
65
+                            return \''.Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL).''.'\';
66 66
                         }
67 67
                  }';
68 68
 ?>
@@ -70,14 +70,14 @@  discard block
 block discarded – undo
70 70
 $(function() {
71 71
 <?php
72 72
     // grid definition see the $career->display() function
73
-    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links,true);
73
+    echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
74 74
 ?>
75 75
 });
76 76
 </script>
77 77
 <?php
78 78
 $gradebook = new Gradebook();
79 79
 
80
-switch($action) {
80
+switch ($action) {
81 81
     case 'display':
82 82
         $gradebook->display();
83 83
         break;
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
         $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
86 86
         $gradebook_info = $gradebook->get($id);
87 87
         $url  = api_get_self().'?action='.$action.'&id='.$id;
88
-        $form =  $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
88
+        $form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
89 89
         if ($form->validate()) {
90 90
             $values = $form->exportValues();
91 91
             $res    = $gradebook->update_skills_to_gradebook($values['id'], $values['skill']);
Please login to merge, or discard this patch.
main/admin/access_url_edit_users_to_url.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 function send() {
63 63
 	if (document.formulaire.access_url_id.value!=0) {
64 64
 		document.formulaire.form_sent.value=0;
65
-		document.formulaire.add_type.value=\'' . $add_type . '\';
65
+		document.formulaire.add_type.value=\'' . $add_type.'\';
66 66
 		document.formulaire.submit();
67 67
 	}
68 68
 }
@@ -92,23 +92,23 @@  discard block
 block discarded – undo
92 92
     }
93 93
     if ($form_sent == 1) {
94 94
         if ($access_url_id == 0) {
95
-            header('Location: access_url_edit_users_to_url.php?action=show_message&message=' . get_lang('SelectURL'));
95
+            header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
96 96
             exit;
97 97
         } elseif (is_array($UserList)) {
98 98
             $result = UrlManager::update_urls_rel_user($UserList, $access_url_id);
99 99
             $url_info = UrlManager::get_url_data_from_id($access_url_id);
100 100
             if (!empty($result)) {
101
-                $message .= 'URL: ' . $url_info['url'] . '<br />';
101
+                $message .= 'URL: '.$url_info['url'].'<br />';
102 102
             }
103 103
 
104 104
             if (!empty($result['users_added'])) {
105
-                $message .= '<h4>' . get_lang('UsersAdded') . ':</h4>';
105
+                $message .= '<h4>'.get_lang('UsersAdded').':</h4>';
106 106
                 $i = 1;
107 107
                 $user_added_list = array();
108 108
                 foreach ($result['users_added'] as $user) {
109 109
                     $user_info = api_get_user_info($user);
110 110
                     if (!empty($user_info)) {
111
-                        $user_added_list[] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']);
111
+                        $user_added_list[] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname'], null, null, null, null, $user_info['username']);
112 112
                         $i++;
113 113
                     }
114 114
                 }
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
             }
119 119
 
120 120
             if (!empty($result['users_deleted'])) {
121
-                $message .= '<br /><h4>' . get_lang('UsersDeleted') . ': </h4>';
121
+                $message .= '<br /><h4>'.get_lang('UsersDeleted').': </h4>';
122 122
                 $user_deleted_list = array();
123 123
                 $i = 1;
124 124
                 foreach ($result['users_deleted'] as $user) {
125 125
                     $user_info = api_get_user_info($user);
126 126
                     if (!empty($user_info)) {
127
-                        $user_deleted_list [] = $i . '. ' . api_get_person_name($user_info['firstname'], $user_info['lastname']);
127
+                        $user_deleted_list [] = $i.'. '.api_get_person_name($user_info['firstname'], $user_info['lastname']);
128 128
                         $i++;
129 129
                     }
130 130
                 }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 }
144 144
 
145 145
 echo '<div class="actions">';
146
-echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH) . 'admin/access_url_add_users_to_url.php');
146
+echo Display::url(Display::return_icon('view_more_stats.gif', get_lang('AddUserToURL'), ''), api_get_path(WEB_CODE_PATH).'admin/access_url_add_users_to_url.php');
147 147
 echo '</div>';
148 148
 
149 149
 api_display_tool_title($tool_name);
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     }
172 172
 
173 173
     $sql = "SELECT u.user_id, lastname, firstname, username
174
-	  	  	FROM $tbl_user u WHERE status <> " . ANONYMOUS . " " .
174
+	  	  	FROM $tbl_user u WHERE status <> ".ANONYMOUS." ".
175 175
             $order_clause;
176 176
     $result = Database::query($sql);
177 177
     $Users = Database::store_result($result);
@@ -184,11 +184,11 @@  discard block
 block discarded – undo
184 184
 }
185 185
 
186 186
 if ($add_type == 'multiple') {
187
-    $link_add_type_unique = '<a href="' . api_get_self() . '?add_type=unique&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeUnique') . '</a>';
187
+    $link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
188 188
     $link_add_type_multiple = get_lang('SessionAddTypeMultiple');
189 189
 } else {
190 190
     $link_add_type_unique = get_lang('SessionAddTypeUnique');
191
-    $link_add_type_multiple = '<a href="' . api_get_self() . '?add_type=multiple&access_url_id=' . $access_url_id . '">' . get_lang('SessionAddTypeMultiple') . '</a>';
191
+    $link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
192 192
 }
193 193
 $url_list = UrlManager::get_url_data();
194 194
 ?>
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" <?php if ($ajax_search) {
201 201
     echo ' onsubmit="valide();"';
202 202
 } ?> >
203
-    <?php echo get_lang('SelectUrl') . ' : '; ?>
203
+    <?php echo get_lang('SelectUrl').' : '; ?>
204 204
 <select name="access_url_id" onchange="javascript:send();">
205 205
 <option value="0"> <?php echo get_lang('SelectUrl') ?></option>
206 206
         <?php
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
     <td>
237 237
     <h3>
238 238
     <?php
239
-        $total_users = count($nosessionUsersList) +  count($sessionUsersList);
239
+        $total_users = count($nosessionUsersList) + count($sessionUsersList);
240 240
         echo get_lang('TotalAvailableUsers').' '.$total_users;
241 241
     ?>
242 242
     </h3>
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
   <td align="center"><b><?php echo get_lang('UserListInPlatform') ?> : <?php echo count($nosessionUsersList); ?></b>
247 247
   </td>
248 248
   <td></td>
249
-  <td align="center"><b><?php echo get_lang('UserListIn') . ' ' . $url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td>
249
+  <td align="center"><b><?php echo get_lang('UserListIn').' '.$url_selected; ?> : <?php echo count($sessionUsersList); ?></b></td>
250 250
 </tr>
251 251
 <tr>
252 252
   <td align="center">
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 		<br />
307 307
         <?php
308 308
         if (isset($_GET['add'])) {
309
-            echo '<button class="save" type="button" onclick="valide()" >' . get_lang('AddUsersToURL') . '</button>';
309
+            echo '<button class="save" type="button" onclick="valide()" >'.get_lang('AddUsersToURL').'</button>';
310 310
         } else {
311
-            echo '<button class="save" type="button" onclick="valide()" >' . get_lang('EditUsersToURL') . '</button>';
311
+            echo '<button class="save" type="button" onclick="valide()" >'.get_lang('EditUsersToURL').'</button>';
312 312
         }
313 313
         ?>
314 314
 	</td>
Please login to merge, or discard this patch.
main/admin/add_sessions_to_promotion.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 require_once '../inc/global.inc.php';
11 11
 
12 12
 $xajax = new xajax();
13
-$xajax->registerFunction ('search_sessions');
13
+$xajax->registerFunction('search_sessions');
14 14
 
15 15
 // setting the section (for the tabs)
16 16
 $this_section = SECTION_PLATFORM_ADMIN;
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
 api_protect_admin_script(true);
20 20
 
21 21
 // setting breadcrumbs
22
-$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
23
-$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
22
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
23
+$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
24 24
 
25 25
 // Setting the name of the tool
26 26
 $tool_name = get_lang('SubscribeSessionsToPromotions');
27 27
 $add_type = 'multiple';
28
-if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){
28
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
29 29
     $add_type = Security::remove_XSS($_REQUEST['add_type']);
30 30
 }
31 31
 
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
 
68 68
 $form_sent  = 0;
69 69
 $errorMsg   = '';
70
-$users      =$sessions=array();
70
+$users      = $sessions = array();
71 71
 $promotion = new Promotion();
72 72
 $id = intval($_GET['id']);
73 73
 if (isset($_POST['form_sent']) && $_POST['form_sent']) {
74 74
     $form_sent = $_POST['form_sent'];
75 75
     $session_in_promotion_posted = $_POST['session_in_promotion_name'];
76 76
     if (!is_array($session_in_promotion_posted)) {
77
-        $session_in_promotion_posted=array();
77
+        $session_in_promotion_posted = array();
78 78
     }
79 79
     if ($form_sent == 1) {
80 80
         // Added a parameter to send emails when registering a user
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
 $promotion_data = $promotion->get($id);
88 88
 $session_list = SessionManager::get_sessions_list(array(), array('name'));
89
-$session_not_in_promotion = $session_in_promotion= array();
89
+$session_not_in_promotion = $session_in_promotion = array();
90 90
 
91 91
 if (!empty($session_list)) {
92 92
     foreach ($session_list as $session) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             }
123 123
         }
124 124
         $return .= '</select>';
125
-        $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return));
125
+        $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return));
126 126
     }
127 127
 
128 128
     return $xajax_response;
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 }
141 141
 
142 142
 echo '<div class="actions">';
143
-echo '<a href="promotions.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>';
143
+echo '<a href="promotions.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>';
144 144
 echo '</div>';
145 145
 ?>
146 146
 
147
-<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
147
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>>
148 148
 <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>';
149 149
 
150
-if ($add_type=='multiple') {
150
+if ($add_type == 'multiple') {
151 151
     if (is_array($extra_field_list)) {
152 152
         if (is_array($new_field_list) && count($new_field_list) > 0) {
153 153
             echo '<h3>'.get_lang('FilterUsers').'</h3>';
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
                 echo '&nbsp;<select name="'.$varname.'">';
158 158
                 echo '<option value="0">--'.get_lang('Select').'--</option>';
159 159
                 foreach ($new_field['data'] as $option) {
160
-                    $checked='';
160
+                    $checked = '';
161 161
                     if (isset($_POST[$varname])) {
162
-                        if ($_POST[$varname]==$option[1]) {
162
+                        if ($_POST[$varname] == $option[1]) {
163 163
                             $checked = 'selected="true"';
164 164
                         }
165 165
                     }
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
   <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td>
190 190
 </tr>
191 191
 
192
-<?php if ($add_type=='multiple') { ?>
192
+<?php if ($add_type == 'multiple') { ?>
193 193
 <tr>
194 194
 <td align="center">
195 195
 <?php echo get_lang('FirstLetterSessions'); ?> :
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
   <td align="center">
208 208
   <div id="content_source">
209 209
       <?php
210
-      if (!($add_type=='multiple')) {
210
+      if (!($add_type == 'multiple')) {
211 211
         ?>
212 212
         <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
213 213
         <div id="ajax_list_users_single"></div>
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
       } else {
216 216
       ?>
217 217
       <div id="ajax_list_multiple">
218
-        <?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?>
218
+        <?php echo Display::select('session_not_in_promotion_name', $session_not_in_promotion, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_not_in_promotion', 'size'=>'15px'), false); ?>
219 219
       </div>
220 220
     <?php
221 221
       }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
         'session_in_promotion_name[]',
251 251
         $session_in_promotion,
252 252
         '',
253
-        array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'),
253
+        array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'),
254 254
         false
255 255
     );
256 256
     unset($sessionUsersList);
Please login to merge, or discard this patch.