Completed
Push — 1.10.x ( f409b5...1f80a0 )
by Julito
112:29 queued 56:28
created
main/admin/user_move_stats.php 2 patches
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -8,11 +8,11 @@  discard block
 block discarded – undo
8 8
 
9 9
 $cidReset = true;
10 10
 require_once '../inc/global.inc.php';
11
-$this_section=SECTION_PLATFORM_ADMIN;
11
+$this_section = SECTION_PLATFORM_ADMIN;
12 12
 
13 13
 api_protect_admin_script();
14 14
 
15
-$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
15
+$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
16 16
 $debug = 0;
17 17
 
18 18
 function compare_data($result_message) {
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         if (is_array($data)) {
32 32
             foreach ($data as $id => $item) {
33 33
 
34
-                if ($table == 'TRACK_E_EXERCISES' || $table == 'TRACK_E_EXERCISES_IN_LP' ) {
34
+                if ($table == 'TRACK_E_EXERCISES' || $table == 'TRACK_E_EXERCISES_IN_LP') {
35 35
                     echo "<br /><h3>".get_lang('Attempt')." #$id</h3>";
36 36
                     echo '<h3>';
37 37
                     echo get_lang('Exercise').' #'.$item['exe_exo_id'];
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
                         echo '</h3>';
43 43
                     }
44 44
                     //Process data
45
-                    $array = array('exe_date' =>get_lang('Date'), 'exe_result' =>get_lang('Score'),'exe_weighting'=>get_lang('Weighting'));
46
-                    foreach($item as $key=> $value) {
47
-                        if (in_array($key,array_keys($array))) {
45
+                    $array = array('exe_date' =>get_lang('Date'), 'exe_result' =>get_lang('Score'), 'exe_weighting'=>get_lang('Weighting'));
46
+                    foreach ($item as $key=> $value) {
47
+                        if (in_array($key, array_keys($array))) {
48 48
                             $key = $array[$key];
49 49
                             echo "$key =  $value <br />";
50 50
                         }
51 51
                     }
52
-                } else  {
52
+                } else {
53 53
                     echo "<br /><h3>".get_lang('Id')." #$id</h3>";
54 54
                     //process data
55
-                    foreach($item as $key=> $value) {
55
+                    foreach ($item as $key=> $value) {
56 56
                         echo "$key =  $value <br />";
57 57
                     }
58 58
                 }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $new_session_id         = intval($_REQUEST['session_id']);
77 77
 
78 78
             //if (!isset($_REQUEST['view_stat'])) {
79
-            if ($origin_session_id == $new_session_id ) {
79
+            if ($origin_session_id == $new_session_id) {
80 80
                 echo get_lang('CantMoveToTheSameSession');
81 81
                 exit;
82 82
             }
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             $result_message_compare = array();
97 97
 
98 98
             $update_database = true;
99
-            if (isset($_REQUEST['view_stat']) && $_REQUEST['view_stat'] == 1 ) {
99
+            if (isset($_REQUEST['view_stat']) && $_REQUEST['view_stat'] == 1) {
100 100
                 $update_database = false;
101 101
             }
102 102
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 if (empty($result) || !in_array($user_id, array_keys($result))) {
109 109
                     if ($debug) echo 'User added to the session';
110 110
                     //Registering user to the new session
111
-                    SessionManager::suscribe_users_to_session($new_session_id,array($user_id),false);
111
+                    SessionManager::suscribe_users_to_session($new_session_id, array($user_id), false);
112 112
                 }
113 113
 
114 114
                 //Begin with the import process
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 $TBL_LP_VIEW                = Database::get_course_table(TABLE_LP_VIEW);
124 124
                 $TBL_NOTEBOOK               = Database::get_course_table(TABLE_NOTEBOOK);
125 125
                 $TBL_STUDENT_PUBLICATION    = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
126
-                $TBL_STUDENT_PUBLICATION_ASSIGNMENT    = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
126
+                $TBL_STUDENT_PUBLICATION_ASSIGNMENT = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
127 127
                 $TBL_ITEM_PROPERTY          = Database::get_course_table(TABLE_ITEM_PROPERTY);
128 128
 
129 129
                 $TBL_DROPBOX_FILE = Database::get_course_table(TABLE_DROPBOX_FILE);
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
                         WHERE c_id = $course_id AND  session_id = $origin_session_id AND exe_user_id = $user_id ";
138 138
                 $res = Database::query($sql);
139 139
                 $list = array();
140
-                while($row = Database::fetch_array($res,'ASSOC')) {
141
-                    $list[$row['exe_id']]= $row;
140
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
141
+                    $list[$row['exe_id']] = $row;
142 142
                 }
143 143
 
144 144
                 if (!empty($list))
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
                             $res = Database::query($sql);
149 149
                             $result_message[$TABLETRACK_EXERCICES]++;
150 150
                         } else {
151
-                            if(!empty($data['orig_lp_id']) &&  !empty($data['orig_lp_item_id'])) {
151
+                            if (!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) {
152 152
                                 $result_message['TRACK_E_EXERCISES'][$exe_id] = $data;
153 153
                             } else {
154 154
                                 $result_message['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data;
@@ -164,8 +164,8 @@  discard block
 block discarded – undo
164 164
                             WHERE c_id = $course_id AND  session_id = $new_session_id AND exe_user_id = $user_id ";
165 165
                     $res = Database::query($sql);
166 166
                     $list = array();
167
-                    while($row = Database::fetch_array($res,'ASSOC')) {
168
-                        $list[$row['exe_id']]= $row;
167
+                    while ($row = Database::fetch_array($res, 'ASSOC')) {
168
+                        $list[$row['exe_id']] = $row;
169 169
                     }
170 170
 
171 171
                     if (!empty($list))
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                                 $res = Database::query($sql);
176 176
                                 $result_message[$TABLETRACK_EXERCICES]++;
177 177
                             } else {
178
-                                if(!empty($data['orig_lp_id']) &&  !empty($data['orig_lp_item_id'])) {
178
+                                if (!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) {
179 179
                                     $result_message_compare['TRACK_E_EXERCISES'][$exe_id] = $data;
180 180
                                 } else {
181 181
                                     $result_message_compare['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data;
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
                         WHERE c_id  = $course_id AND session_id = $origin_session_id  AND user_id = $user_id ";
193 193
                 $res = Database::query($sql);
194 194
                 $list = array();
195
-                while($row = Database::fetch_array($res,'ASSOC')) {
195
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
196 196
                     $list[$row['course_access_id']] = $row;
197 197
                 }
198 198
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                         AND access_user_id = $user_id ";
215 215
                 $res = Database::query($sql);
216 216
                 $list = array();
217
-                while($row = Database::fetch_array($res,'ASSOC')) {
217
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
218 218
                     $list[] = $row['access_id'];
219 219
                 }
220 220
                 if (!empty($list))
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
                 $flat_list = $lp_list->get_flat_list();
241 241
 
242 242
                 $list = array();
243
-                while($row = Database::fetch_array($res,'ASSOC')) {
243
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
244 244
                     //Checking if the LP exist in the new session
245 245
                     if (in_array($row['lp_id'], array_keys($flat_list))) {
246 246
                         $list[$row['id']] = $row;
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
                             $result_message[$TBL_LP_VIEW]++;
258 258
                         } else {
259 259
                             //Getting all information of that lp_item_id
260
-                            $score    = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id);
261
-                            $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id);
260
+                            $score    = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $origin_session_id);
261
+                            $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $origin_session_id);
262 262
                             $result_message['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
263 263
                         }
264 264
                     }
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                     $flat_list = $lp_list->get_flat_list();
275 275
 
276 276
                     $list = array();
277
-                    while($row = Database::fetch_array($res,'ASSOC')) {
277
+                    while ($row = Database::fetch_array($res, 'ASSOC')) {
278 278
                         //Checking if the LP exist in the new session
279 279
                         if (in_array($row['lp_id'], array_keys($flat_list))) {
280 280
                             $list[$row['id']] = $row;
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
                     if (!empty($list))
284 284
                         foreach ($list as $id=>$data) {
285 285
                             //Getting all information of that lp_item_id
286
-                            $score    = Tracking::get_avg_student_score($user_id, $origin_course_code,        array($data['lp_id']), $new_session_id);
287
-                            $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code,     array($data['lp_id']), $new_session_id);
286
+                            $score    = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
287
+                            $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id);
288 288
                             $result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
289 289
                         }
290 290
                 }
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                 //calendar_event_attachment no problems no session_id
296 296
                 $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'calendar_event' AND insert_user_id = $user_id AND c_id = $course_id ";
297 297
                 $res = Database::query($sql);
298
-                while($row = Database::fetch_array($res,'ASSOC')) {
298
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
299 299
                     $id = $row['ref'];
300 300
                     if ($update_database) {
301 301
                         $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id ";
@@ -315,24 +315,24 @@  discard block
 block discarded – undo
315 315
                 $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'work' AND insert_user_id = $user_id AND c_id = $course_id";
316 316
                 if ($debug) echo $sql;
317 317
                 $res = Database::query($sql);
318
-                while($row = Database::fetch_array($res,'ASSOC')) {
318
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
319 319
                     $id = $row['ref'];
320 320
                     $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $id AND session_id = $origin_session_id AND c_id = $course_id";
321 321
                     if ($debug) var_dump($sql);
322 322
                     $sub_res = Database::query($sql);
323
-                    if (Database::num_rows($sub_res) > 0 ) {
324
-                        $data = Database::fetch_array($sub_res,'ASSOC');
323
+                    if (Database::num_rows($sub_res) > 0) {
324
+                        $data = Database::fetch_array($sub_res, 'ASSOC');
325 325
                         if ($debug) var_dump($data);
326 326
                         $parent_id = $data['parent_id'];
327 327
                         if (isset($data['parent_id']) && !empty($data['parent_id'])) {
328 328
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $parent_id AND c_id = $course_id";
329 329
                             $select_res     = Database::query($sql);
330
-                            $parent_data    = Database::fetch_array($select_res,'ASSOC');
330
+                            $parent_data    = Database::fetch_array($select_res, 'ASSOC');
331 331
                             if ($debug)     var_dump($parent_data);
332 332
 
333 333
                             $sys_course_path = api_get_path(SYS_COURSE_PATH);
334
-                            $course_dir = $sys_course_path . $course_info['path'];
335
-                            $base_work_dir = $course_dir . '/work';
334
+                            $course_dir = $sys_course_path.$course_info['path'];
335
+                            $base_work_dir = $course_dir.'/work';
336 336
                             require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php';
337 337
 
338 338
                             //Creating the parent folder in the session if does not exists already
@@ -347,8 +347,8 @@  discard block
 block discarded – undo
347 347
                             $sub_res = Database::query($sql);
348 348
                             $num_rows = Database::num_rows($sub_res);
349 349
 
350
-                            if ($num_rows > 0 ) {
351
-                                $new_result = Database::fetch_array($sub_res,'ASSOC');
350
+                            if ($num_rows > 0) {
351
+                                $new_result = Database::fetch_array($sub_res, 'ASSOC');
352 352
                                 $created_dir    = $new_result['url'];
353 353
                                 $new_parent_id  = $new_result['id'];
354 354
                             } else {
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                                     $created_dir = '/'.$created_dir;
361 361
                                     $now = api_get_utc_datetime();
362 362
                                     //Creating directory
363
-                                    $sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION . " SET
363
+                                    $sql_add_publication = "INSERT INTO ".$TBL_STUDENT_PUBLICATION." SET
364 364
                                            url         = '".$created_dir."',
365 365
 	                                       c_id        = $course_id,
366 366
 	                                       title        = '".$parent_data['title']."',
@@ -370,12 +370,12 @@  discard block
 block discarded – undo
370 370
 	                                       accepted     = '1',
371 371
 	                                       filetype     = 'folder',
372 372
 	                                       sent_date    = '".$now."',
373
-	                                       qualification    = '".$parent_data['qualification'] ."',
373
+	                                       qualification    = '".$parent_data['qualification']."',
374 374
 	                                       parent_id    = '',
375 375
 	                                       qualificator_id  = '',
376 376
 	                                       date_of_qualification    = '0000-00-00 00:00:00',
377 377
 	                                       session_id   = ".$new_session_id;
378
-                                    $rest_insert     = Database::query($sql_add_publication);
378
+                                    $rest_insert = Database::query($sql_add_publication);
379 379
                                     if ($debug) echo ($sql_add_publication);
380 380
                                     // add the directory
381 381
                                     $id = Database::insert_id();
@@ -390,11 +390,11 @@  discard block
 block discarded – undo
390 390
                             //Creating student_publication_assignment if exists
391 391
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION_ASSIGNMENT WHERE publication_id = $parent_id AND c_id = $course_id";
392 392
                             if ($debug) var_dump($sql);
393
-                            $rest_select     = Database::query($sql);
394
-                            if (Database::num_rows($rest_select) > 0 ) {
393
+                            $rest_select = Database::query($sql);
394
+                            if (Database::num_rows($rest_select) > 0) {
395 395
                                 if ($update_database) {
396
-                                    $assignment_data = Database::fetch_array($rest_select,'ASSOC');
397
-                                    $sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION_ASSIGNMENT . " SET
396
+                                    $assignment_data = Database::fetch_array($rest_select, 'ASSOC');
397
+                                    $sql_add_publication = "INSERT INTO ".$TBL_STUDENT_PUBLICATION_ASSIGNMENT." SET
398 398
                                     	c_id = '$course_id',
399 399
                                        expires_on          = '".$assignment_data['expires_on']."',
400 400
                                        ends_on              = '".$assignment_data['ends_on']."',
@@ -402,15 +402,15 @@  discard block
 block discarded – undo
402 402
                                        enable_qualification = '".$assignment_data['enable_qualification']."',
403 403
                                        publication_id       = '".$new_parent_id."'";
404 404
                                     if ($debug) echo $sql_add_publication;
405
-                                    $rest_select     = Database::query($sql_add_publication);
405
+                                    $rest_select = Database::query($sql_add_publication);
406 406
                                     $id = Database::insert_id();
407 407
 
408
-                                    $sql_update = "UPDATE " . $TBL_STUDENT_PUBLICATION . " SET " .
408
+                                    $sql_update = "UPDATE ".$TBL_STUDENT_PUBLICATION." SET ".
409 409
                                         "has_properties         = '".$id."',
410 410
                                        view_properties    = '1'
411 411
                                        WHERE id   = ".$new_parent_id;
412 412
                                     if ($debug) echo $sql_update;
413
-                                    $rest_update     = Database::query($sql_update);
413
+                                    $rest_update = Database::query($sql_update);
414 414
 
415 415
 
416 416
                                     if ($debug) var_dump($sql_update);
@@ -423,21 +423,21 @@  discard block
 block discarded – undo
423 423
 
424 424
                             if ($update_database) {
425 425
                                 //Creating a new work
426
-                                $sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION . " SET " .
427
-                                    "url         = '" . $new_url . "',
426
+                                $sql_add_publication = "INSERT INTO ".$TBL_STUDENT_PUBLICATION." SET ".
427
+                                    "url         = '".$new_url."',
428 428
                                                c_id        = $course_id,
429
-                                               title       = '" . $data['title']. "',
430
-                                               description = '" . $data['description'] . " file moved',
431
-                                               author      = '" . $data['author'] . "',
432
-                                               active       = '" . $data['active']. "',
433
-                                               accepted     = '" . $data['accepted']. "',
434
-                                               post_group_id = " . $data['post_group_id'] . ",
435
-                                               sent_date    =  '".$data['sent_date'] ."',
436
-                                               parent_id    =  ".$new_parent_id ." ,
429
+                                               title       = '".$data['title']."',
430
+                                               description = '" . $data['description']." file moved',
431
+                                               author      = '" . $data['author']."',
432
+                                               active       = '" . $data['active']."',
433
+                                               accepted     = '" . $data['accepted']."',
434
+                                               post_group_id = " . $data['post_group_id'].",
435
+                                               sent_date    =  '".$data['sent_date']."',
436
+                                               parent_id    =  ".$new_parent_id." ,
437 437
                                                session_id = ".$new_session_id;
438 438
 
439 439
                                 if ($debug) echo $sql_add_publication;
440
-                                $rest_insert     = Database::query($sql_add_publication);
440
+                                $rest_insert = Database::query($sql_add_publication);
441 441
                                 if ($debug) var_dump($rest_insert);
442 442
                                 $id = Database::insert_id();
443 443
                                 api_item_property_update($course_info, 'work', $id, 'DocumentAdded', $user_id);
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
                                         unlink($full_file_name);
454 454
                                         $sql = "DELETE FROM $TBL_STUDENT_PUBLICATION WHERE id= ".$data['id'];
455 455
                                         if ($debug) var_dump($sql);
456
-                                        $result_delete     = Database::query($sql);
456
+                                        $result_delete = Database::query($sql);
457 457
                                         api_item_property_update($course_info, 'work', $data['id'], 'DocumentDeleted', api_get_user_id());
458 458
                                     }
459 459
                                 }
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
                 $sql = "SELECT id FROM $TBL_DROPBOX_FILE WHERE uploader_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id";
471 471
                 if ($debug) var_dump($sql);
472 472
                 $res = Database::query($sql);
473
-                while($row = Database::fetch_array($res,'ASSOC')) {
473
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
474 474
                     $id = $row['id'];
475 475
                     if ($update_database) {
476 476
                         $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id";
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
                         WHERE user_id = $user_id AND session_id = $origin_session_id AND course = '$origin_course_code' AND c_id = $course_id";
495 495
                 if ($debug) var_dump($sql);
496 496
                 $res = Database::query($sql);
497
-                while($row = Database::fetch_array($res,'ASSOC')) {
497
+                while ($row = Database::fetch_array($res, 'ASSOC')) {
498 498
                     $id = $row['notebook_id'];
499 499
                     if ($update_database) {
500 500
                         $sql = "UPDATE $TBL_NOTEBOOK SET session_id = $new_session_id WHERE c_id = $course_id AND notebook_id = $id";
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
                     echo '<tr>';
519 519
                     echo '<td width="50%" valign="top">';
520 520
 
521
-                    if ($origin_session_id == 0 ) {
521
+                    if ($origin_session_id == 0) {
522 522
                         echo '<h4>'.get_lang('OriginCourse').'</h4>';
523 523
                     } else {
524 524
                         echo '<h4>'.get_lang('OriginSession').' #'.$origin_session_id.'</h4>';
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
                     compare_data($result_message);
527 527
                     echo '</td>';
528 528
                     echo '<td width="50%" valign="top">';
529
-                    if ($new_session_id == 0 ) {
529
+                    if ($new_session_id == 0) {
530 530
                         echo '<h4>'.get_lang('DestinyCourse').'</h4>';
531 531
                     } else {
532 532
                         echo '<h4>'.get_lang('DestinySession').' #'.$new_session_id.'</h4>';
@@ -591,8 +591,8 @@  discard block
 block discarded – undo
591 591
 
592 592
     $res = Database::query($sql);
593 593
     $course_list = array();
594
-    while ($row = Database::fetch_array($res,'ASSOC')) {
595
-        $course_list []= $row;
594
+    while ($row = Database::fetch_array($res, 'ASSOC')) {
595
+        $course_list [] = $row;
596 596
     }
597 597
     return $course_list;
598 598
 }
@@ -600,9 +600,9 @@  discard block
 block discarded – undo
600 600
 
601 601
 Display::display_header(get_lang('MoveUserStats'));
602 602
 echo  '<div class="actions">';
603
-echo '<a href="../admin/index.php">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>';
603
+echo '<a href="../admin/index.php">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>';
604 604
 echo '</div>';
605
-echo Display::display_normal_message(get_lang('CompareUserResultsBetweenCoursesAndCoursesInASession'),false);
605
+echo Display::display_normal_message(get_lang('CompareUserResultsBetweenCoursesAndCoursesInASession'), false);
606 606
 
607 607
 
608 608
 // Some pagination
@@ -612,19 +612,19 @@  discard block
 block discarded – undo
612 612
 }
613 613
 $default = 20;
614 614
 $count          = UserManager::get_number_of_users();
615
-$nro_pages      = round($count/$default) + 1;
616
-$begin          = $default* ($page - 1);
617
-$end            = $default*$page;
615
+$nro_pages      = round($count / $default) + 1;
616
+$begin          = $default * ($page - 1);
617
+$end            = $default * $page;
618 618
 
619 619
 $navigation     = "$begin - $end  / $count<br />";
620 620
 
621 621
 if ($page > 1) {
622
-    $navigation .='<a href="'.api_get_self().'?page='.($page - 1).'">'.get_lang('Previous').'</a>';
622
+    $navigation .= '<a href="'.api_get_self().'?page='.($page - 1).'">'.get_lang('Previous').'</a>';
623 623
 } else {
624 624
     $navigation .= get_lang('Previous');
625 625
 }
626 626
 $navigation .= '&nbsp;';
627
-$page ++;
627
+$page++;
628 628
 if ($page < $nro_pages)
629 629
     $navigation .= '<a href="'.api_get_self().'?page='.$page.'">'.get_lang('Next').'</a>';
630 630
 else
@@ -632,11 +632,11 @@  discard block
 block discarded – undo
632 632
 
633 633
 echo $navigation;
634 634
 $user_list      = UserManager::get_user_list(array(), array(), $begin, $default);
635
-$session_list   = SessionManager::get_sessions_list(array(),array('name'));
635
+$session_list   = SessionManager::get_sessions_list(array(), array('name'));
636 636
 $options = '';
637 637
 $options .= '<option value="0">--'.get_lang('SelectASession').'--</option>';
638 638
 foreach ($session_list as $session_data) {
639
-    $my_session_list[$session_data['id']] =$session_data['name'];
639
+    $my_session_list[$session_data['id']] = $session_data['name'];
640 640
     $options .= '<option value="'.$session_data['id'].'">'.$session_data['name'].'</option>';
641 641
 }
642 642
 
@@ -685,7 +685,7 @@  discard block
 block discarded – undo
685 685
             $course['name'] = $courseInfo['name'];
686 686
         }
687 687
 
688
-        $course_list  = $course_list_registered;
688
+        $course_list = $course_list_registered;
689 689
 
690 690
         echo '<div>';
691 691
         echo '<table class="data_table">';
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
                     $session_id = $course['id_session'];
721 721
                 }
722 722
                 echo '<td>';
723
-                echo get_lang('MoveTo');    echo '<br />';
723
+                echo get_lang('MoveTo'); echo '<br />';
724 724
                 $unique_id = uniqid();
725 725
                 $combinations[$unique_id] = array('course_code' =>$course_code, 'session_id'=>$session_id);
726 726
 
Please login to merge, or discard this patch.
Braces   +111 added lines, -47 removed lines patch added patch discarded remove patch
@@ -106,7 +106,9 @@  discard block
 block discarded – undo
106 106
                 //Check if the user is registered in the session otherwise we will add it
107 107
                 $result = SessionManager::get_users_by_session($new_session_id);
108 108
                 if (empty($result) || !in_array($user_id, array_keys($result))) {
109
-                    if ($debug) echo 'User added to the session';
109
+                    if ($debug) {
110
+                        echo 'User added to the session';
111
+                    }
110 112
                     //Registering user to the new session
111 113
                     SessionManager::suscribe_users_to_session($new_session_id,array($user_id),false);
112 114
                 }
@@ -141,10 +143,11 @@  discard block
 block discarded – undo
141 143
                     $list[$row['exe_id']]= $row;
142 144
                 }
143 145
 
144
-                if (!empty($list))
145
-                    foreach ($list as $exe_id =>$data) {
146
+                if (!empty($list)) {
147
+                                    foreach ($list as $exe_id =>$data) {
146 148
                         if ($update_database) {
147 149
                             $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
150
+                }
148 151
                             $res = Database::query($sql);
149 152
                             $result_message[$TABLETRACK_EXERCICES]++;
150 153
                         } else {
@@ -168,10 +171,11 @@  discard block
 block discarded – undo
168 171
                         $list[$row['exe_id']]= $row;
169 172
                     }
170 173
 
171
-                    if (!empty($list))
172
-                        foreach ($list as $exe_id =>$data) {
174
+                    if (!empty($list)) {
175
+                                            foreach ($list as $exe_id =>$data) {
173 176
                             if ($update_database) {
174 177
                                 $sql = "UPDATE $TABLETRACK_EXERCICES SET session_id = '$new_session_id' WHERE exe_id = $exe_id";
178
+                    }
175 179
                                 $res = Database::query($sql);
176 180
                                 $result_message[$TABLETRACK_EXERCICES]++;
177 181
                             } else {
@@ -196,10 +200,11 @@  discard block
 block discarded – undo
196 200
                     $list[$row['course_access_id']] = $row;
197 201
                 }
198 202
 
199
-                if (!empty($list))
200
-                    foreach ($list as $id => $data) {
203
+                if (!empty($list)) {
204
+                                    foreach ($list as $id => $data) {
201 205
                         if ($update_database) {
202 206
                             $sql = "UPDATE $TBL_TRACK_E_COURSE_ACCESS SET session_id = $new_session_id WHERE course_access_id = $id";
207
+                }
203 208
                             if ($debug) {
204 209
                                 echo $sql;
205 210
                             }
@@ -218,13 +223,18 @@  discard block
 block discarded – undo
218 223
                 while($row = Database::fetch_array($res,'ASSOC')) {
219 224
                     $list[] = $row['access_id'];
220 225
                 }
221
-                if (!empty($list))
222
-                    foreach ($list as $id) {
226
+                if (!empty($list)) {
227
+                                    foreach ($list as $id) {
223 228
                         if ($update_database) {
224 229
                             $sql = "UPDATE $TBL_TRACK_E_LAST_ACCESS SET access_session_id = $new_session_id WHERE access_id = $id";
225
-                            if ($debug) echo $sql;
230
+                }
231
+                            if ($debug) {
232
+                                echo $sql;
233
+                            }
226 234
                             $res = Database::query($sql);
227
-                            if ($debug) var_dump($res);
235
+                            if ($debug) {
236
+                                var_dump($res);
237
+                            }
228 238
                             $result_message[$TBL_TRACK_E_LAST_ACCESS]++;
229 239
                         }
230 240
                     }
@@ -248,13 +258,18 @@  discard block
 block discarded – undo
248 258
                     }
249 259
                 }
250 260
 
251
-                if (!empty($list))
252
-                    foreach ($list as $id=>$data) {
261
+                if (!empty($list)) {
262
+                                    foreach ($list as $id=>$data) {
253 263
                         if ($update_database) {
254 264
                             $sql = "UPDATE $TBL_LP_VIEW SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id ";
255
-                            if ($debug) var_dump($sql);
265
+                }
266
+                            if ($debug) {
267
+                                var_dump($sql);
268
+                            }
256 269
                             $res = Database::query($sql);
257
-                            if ($debug) var_dump($res);
270
+                            if ($debug) {
271
+                                var_dump($res);
272
+                            }
258 273
                             $result_message[$TBL_LP_VIEW]++;
259 274
                         } else {
260 275
                             //Getting all information of that lp_item_id
@@ -281,10 +296,11 @@  discard block
 block discarded – undo
281 296
                             $list[$row['id']] = $row;
282 297
                         }
283 298
                     }
284
-                    if (!empty($list))
285
-                        foreach ($list as $id=>$data) {
299
+                    if (!empty($list)) {
300
+                                            foreach ($list as $id=>$data) {
286 301
                             //Getting all information of that lp_item_id
287 302
                             $score    = Tracking::get_avg_student_score($user_id, $origin_course_code,        array($data['lp_id']), $new_session_id);
303
+                    }
288 304
                             $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code,     array($data['lp_id']), $new_session_id);
289 305
                             $result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress);
290 306
                         }
@@ -300,9 +316,13 @@  discard block
 block discarded – undo
300 316
                     $id = $row['ref'];
301 317
                     if ($update_database) {
302 318
                         $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id ";
303
-                        if ($debug) var_dump($sql);
319
+                        if ($debug) {
320
+                            var_dump($sql);
321
+                        }
304 322
                         $res_update = Database::query($sql);
305
-                        if ($debug) var_dump($res_update);
323
+                        if ($debug) {
324
+                            var_dump($res_update);
325
+                        }
306 326
                         $result_message['agenda']++;
307 327
                     }
308 328
                 }
@@ -314,22 +334,30 @@  discard block
 block discarded – undo
314 334
                 //echo '<h1>Student publication</h1>';
315 335
 
316 336
                 $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'work' AND insert_user_id = $user_id AND c_id = $course_id";
317
-                if ($debug) echo $sql;
337
+                if ($debug) {
338
+                    echo $sql;
339
+                }
318 340
                 $res = Database::query($sql);
319 341
                 while($row = Database::fetch_array($res,'ASSOC')) {
320 342
                     $id = $row['ref'];
321 343
                     $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $id AND session_id = $origin_session_id AND c_id = $course_id";
322
-                    if ($debug) var_dump($sql);
344
+                    if ($debug) {
345
+                        var_dump($sql);
346
+                    }
323 347
                     $sub_res = Database::query($sql);
324 348
                     if (Database::num_rows($sub_res) > 0 ) {
325 349
                         $data = Database::fetch_array($sub_res,'ASSOC');
326
-                        if ($debug) var_dump($data);
350
+                        if ($debug) {
351
+                            var_dump($data);
352
+                        }
327 353
                         $parent_id = $data['parent_id'];
328 354
                         if (isset($data['parent_id']) && !empty($data['parent_id'])) {
329 355
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $parent_id AND c_id = $course_id";
330 356
                             $select_res     = Database::query($sql);
331 357
                             $parent_data    = Database::fetch_array($select_res,'ASSOC');
332
-                            if ($debug)     var_dump($parent_data);
358
+                            if ($debug) {
359
+                                var_dump($parent_data);
360
+                            }
333 361
 
334 362
                             $sys_course_path = api_get_path(SYS_COURSE_PATH);
335 363
                             $course_dir = $sys_course_path . $course_info['path'];
@@ -344,7 +372,9 @@  discard block
 block discarded – undo
344 372
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION
345 373
                             		WHERE description like '%$search_this%' AND url LIKE '%$search_this2%' AND session_id = $new_session_id AND c_id = $course_id
346 374
                             		ORDER BY id desc  LIMIT 1";
347
-                            if ($debug) echo $sql;
375
+                            if ($debug) {
376
+                                echo $sql;
377
+                            }
348 378
                             $sub_res = Database::query($sql);
349 379
                             $num_rows = Database::num_rows($sub_res);
350 380
 
@@ -377,12 +407,16 @@  discard block
 block discarded – undo
377 407
 	                                       date_of_qualification    = '0000-00-00 00:00:00',
378 408
 	                                       session_id   = ".$new_session_id;
379 409
                                     $rest_insert     = Database::query($sql_add_publication);
380
-                                    if ($debug) echo ($sql_add_publication);
410
+                                    if ($debug) {
411
+                                        echo ($sql_add_publication);
412
+                                    }
381 413
                                     // add the directory
382 414
                                     $id = Database::insert_id();
383 415
                                     //Folder created
384 416
                                     api_item_property_update($course_info, 'work', $id, 'DirectoryCreated', api_get_user_id());
385
-                                    if ($debug) var_dump($rest_insert);
417
+                                    if ($debug) {
418
+                                        var_dump($rest_insert);
419
+                                    }
386 420
                                     $new_parent_id = $id;
387 421
                                     $result_message[$TBL_STUDENT_PUBLICATION.' - new folder created called: '.$created_dir]++;
388 422
                                 }
@@ -390,7 +424,9 @@  discard block
 block discarded – undo
390 424
 
391 425
                             //Creating student_publication_assignment if exists
392 426
                             $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION_ASSIGNMENT WHERE publication_id = $parent_id AND c_id = $course_id";
393
-                            if ($debug) var_dump($sql);
427
+                            if ($debug) {
428
+                                var_dump($sql);
429
+                            }
394 430
                             $rest_select     = Database::query($sql);
395 431
                             if (Database::num_rows($rest_select) > 0 ) {
396 432
                                 if ($update_database) {
@@ -402,7 +438,9 @@  discard block
 block discarded – undo
402 438
                                        add_to_calendar      = '".$assignment_data['add_to_calendar']."',
403 439
                                        enable_qualification = '".$assignment_data['enable_qualification']."',
404 440
                                        publication_id       = '".$new_parent_id."'";
405
-                                    if ($debug) echo $sql_add_publication;
441
+                                    if ($debug) {
442
+                                        echo $sql_add_publication;
443
+                                    }
406 444
                                     $rest_select     = Database::query($sql_add_publication);
407 445
                                     $id = Database::insert_id();
408 446
 
@@ -410,11 +448,15 @@  discard block
 block discarded – undo
410 448
                                         "has_properties         = '".$id."',
411 449
                                        view_properties    = '1'
412 450
                                        WHERE id   = ".$new_parent_id;
413
-                                    if ($debug) echo $sql_update;
451
+                                    if ($debug) {
452
+                                        echo $sql_update;
453
+                                    }
414 454
                                     $rest_update     = Database::query($sql_update);
415 455
 
416 456
 
417
-                                    if ($debug) var_dump($sql_update);
457
+                                    if ($debug) {
458
+                                        var_dump($sql_update);
459
+                                    }
418 460
                                     $result_message[$TBL_STUDENT_PUBLICATION_ASSIGNMENT]++;
419 461
                                 }
420 462
                             }
@@ -437,9 +479,13 @@  discard block
 block discarded – undo
437 479
                                                parent_id    =  ".$new_parent_id ." ,
438 480
                                                session_id = ".$new_session_id;
439 481
 
440
-                                if ($debug) echo $sql_add_publication;
482
+                                if ($debug) {
483
+                                    echo $sql_add_publication;
484
+                                }
441 485
                                 $rest_insert     = Database::query($sql_add_publication);
442
-                                if ($debug) var_dump($rest_insert);
486
+                                if ($debug) {
487
+                                    var_dump($rest_insert);
488
+                                }
443 489
                                 $id = Database::insert_id();
444 490
                                 api_item_property_update($course_info, 'work', $id, 'DocumentAdded', $user_id);
445 491
                                 $result_message[$TBL_STUDENT_PUBLICATION]++;
@@ -453,7 +499,9 @@  discard block
 block discarded – undo
453 499
                                     if ($result) {
454 500
                                         unlink($full_file_name);
455 501
                                         $sql = "DELETE FROM $TBL_STUDENT_PUBLICATION WHERE id= ".$data['id'];
456
-                                        if ($debug) var_dump($sql);
502
+                                        if ($debug) {
503
+                                            var_dump($sql);
504
+                                        }
457 505
                                         $result_delete     = Database::query($sql);
458 506
                                         api_item_property_update($course_info, 'work', $data['id'], 'DocumentDeleted', api_get_user_id());
459 507
                                     }
@@ -469,22 +517,30 @@  discard block
 block discarded – undo
469 517
                 //10. Dropbox - not neccesary to move categories (no presence of session_id)
470 518
 
471 519
                 $sql = "SELECT id FROM $TBL_DROPBOX_FILE WHERE uploader_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id";
472
-                if ($debug) var_dump($sql);
520
+                if ($debug) {
521
+                    var_dump($sql);
522
+                }
473 523
                 $res = Database::query($sql);
474 524
                 while($row = Database::fetch_array($res,'ASSOC')) {
475 525
                     $id = $row['id'];
476 526
                     if ($update_database) {
477 527
                         $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id";
478
-                        if ($debug) var_dump($sql);
528
+                        if ($debug) {
529
+                            var_dump($sql);
530
+                        }
479 531
                         $res = Database::query($sql);
480
-                        if ($debug) var_dump($res);
532
+                        if ($debug) {
533
+                            var_dump($res);
534
+                        }
481 535
 
482 536
                         $sql = "UPDATE $TBL_DROPBOX_POST SET session_id = $new_session_id WHERE file_id = $id";
483
-                        if ($debug)
484
-                            var_dump($sql);
537
+                        if ($debug) {
538
+                                                    var_dump($sql);
539
+                        }
485 540
                         $res = Database::query($sql);
486
-                        if ($debug)
487
-                            var_dump($res);
541
+                        if ($debug) {
542
+                                                    var_dump($res);
543
+                        }
488 544
                         $result_message[$TBL_DROPBOX_FILE]++;
489 545
                     }
490 546
                 }
@@ -493,23 +549,30 @@  discard block
 block discarded – undo
493 549
 
494 550
                 $sql = "SELECT notebook_id FROM $TBL_NOTEBOOK
495 551
                         WHERE user_id = $user_id AND session_id = $origin_session_id AND course = '$origin_course_code' AND c_id = $course_id";
496
-                if ($debug) var_dump($sql);
552
+                if ($debug) {
553
+                    var_dump($sql);
554
+                }
497 555
                 $res = Database::query($sql);
498 556
                 while($row = Database::fetch_array($res,'ASSOC')) {
499 557
                     $id = $row['notebook_id'];
500 558
                     if ($update_database) {
501 559
                         $sql = "UPDATE $TBL_NOTEBOOK SET session_id = $new_session_id WHERE c_id = $course_id AND notebook_id = $id";
502
-                        if ($debug) var_dump($sql);
560
+                        if ($debug) {
561
+                            var_dump($sql);
562
+                        }
503 563
                         $res = Database::query($sql);
504
-                        if ($debug) var_dump($res);
564
+                        if ($debug) {
565
+                            var_dump($res);
566
+                        }
505 567
                     }
506 568
                 }
507 569
 
508 570
                 if ($update_database) {
509 571
                     echo '<h2>'.get_lang('StatsMoved').'</h2>';
510
-                    if (is_array($result_message))
511
-                        foreach ($result_message as $table=>$times) {
572
+                    if (is_array($result_message)) {
573
+                                            foreach ($result_message as $table=>$times) {
512 574
                             echo 'Table '.$table.' - '.$times.' records updated <br />';
575
+                    }
513 576
                         }
514 577
                 } else {
515 578
                     echo '<h2>'.get_lang('UserInformationOfThisCourse').'</h2>';
@@ -626,10 +689,11 @@  discard block
 block discarded – undo
626 689
 }
627 690
 $navigation .= '&nbsp;';
628 691
 $page ++;
629
-if ($page < $nro_pages)
692
+if ($page < $nro_pages) {
630 693
     $navigation .= '<a href="'.api_get_self().'?page='.$page.'">'.get_lang('Next').'</a>';
631
-else
694
+} else {
632 695
     $navigation .= get_lang('Next');
696
+}
633 697
 
634 698
 echo $navigation;
635 699
 $user_list      = UserManager::get_user_list(array(), array(), $begin, $default);
Please login to merge, or discard this patch.
main/admin/skill_badge_list.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,18 +29,18 @@
 block discarded – undo
29 29
 
30 30
 $interbreadcrumb = array(
31 31
     array(
32
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php',
32
+        'url' => api_get_path(WEB_CODE_PATH).'admin/index.php',
33 33
         'name' => get_lang('Administration')
34 34
     ),
35 35
     array(
36
-        'url' => api_get_path(WEB_CODE_PATH) . 'admin/skill_badge.php',
36
+        'url' => api_get_path(WEB_CODE_PATH).'admin/skill_badge.php',
37 37
         'name' => get_lang('Badges')
38 38
     )
39 39
 );
40 40
 
41 41
 $toolbar = Display::toolbarButton(
42 42
     get_lang('ManageSkills'),
43
-    api_get_path(WEB_CODE_PATH) . 'admin/skill_list.php',
43
+    api_get_path(WEB_CODE_PATH).'admin/skill_list.php',
44 44
     'list',
45 45
     'primary',
46 46
     ['title' => get_lang('ManageSkills')]
Please login to merge, or discard this patch.
main/admin/course_edit.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         WHERE
43 43
             course_user.status='1' AND
44 44
             course_user.user_id=user.user_id AND
45
-            course_user.c_id ='" . $courseId . "'" .
45
+            course_user.c_id ='".$courseId."'".
46 46
         $order_clause;
47 47
 $res = Database::query($sql);
48 48
 $course_teachers = array();
@@ -58,18 +58,18 @@  discard block
 block discarded – undo
58 58
             INNER JOIN $access_url_rel_user_table url_rel_user
59 59
             ON (u.user_id=url_rel_user.user_id)
60 60
             WHERE
61
-                url_rel_user.access_url_id=" . api_get_current_access_url_id() . " AND
61
+                url_rel_user.access_url_id=".api_get_current_access_url_id()." AND
62 62
                 status=1" . $order_clause;
63 63
 } else {
64 64
     $sql = "SELECT user_id, lastname, firstname
65
-            FROM $table_user WHERE status='1'" . $order_clause;
65
+            FROM $table_user WHERE status='1'".$order_clause;
66 66
 }
67 67
 $courseInfo['tutor_name'] = null;
68 68
 
69 69
 $res = Database::query($sql);
70 70
 $teachers = array();
71 71
 $allTeachers = array();
72
-$platform_teachers[0] = '-- ' . get_lang('NoManager') . ' --';
72
+$platform_teachers[0] = '-- '.get_lang('NoManager').' --';
73 73
 while ($obj = Database::fetch_object($res)) {
74 74
     $allTeachers[$obj->user_id] = api_get_person_name($obj->firstname, $obj->lastname);
75 75
     if (!array_key_exists($obj->user_id, $course_teachers)) {
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
 // Case where there is no teacher in the course
89 89
 if (count($course_teachers) == 0) {
90
-    $sql = 'SELECT tutor_name FROM ' . $course_table . ' WHERE code="' . $course_code . '"';
90
+    $sql = 'SELECT tutor_name FROM '.$course_table.' WHERE code="'.$course_code.'"';
91 91
     $res = Database::query($sql);
92 92
     $tutor_name = Database::result($res, 0, 0);
93 93
     $courseInfo['tutor_name'] = array_search($tutor_name, $platform_teachers);
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
 // Build the form
97 97
 $form = new FormValidator('update_course', 'post', api_get_self().'?id='.$courseId);
98
-$form->addElement('header', get_lang('Course') . '  #' . $courseInfo['real_id'] . ' ' . $course_code);
98
+$form->addElement('header', get_lang('Course').'  #'.$courseInfo['real_id'].' '.$course_code);
99 99
 $form->addElement('hidden', 'code', $course_code);
100 100
 
101 101
 //title
@@ -151,20 +151,20 @@  discard block
 block discarded – undo
151 151
             }
152 152
         }
153 153
 
154
-        $groupName = 'session_coaches[' . $sessionId . ']';
155
-        $platformTeacherId = 'platform_teachers_by_session_' . $sessionId;
156
-        $coachId = 'coaches_by_session_' . $sessionId;
154
+        $groupName = 'session_coaches['.$sessionId.']';
155
+        $platformTeacherId = 'platform_teachers_by_session_'.$sessionId;
156
+        $coachId = 'coaches_by_session_'.$sessionId;
157 157
 
158 158
         $platformTeacherName = 'platform_teachers_by_session';
159 159
         $coachName = 'coaches_by_session';
160 160
 
161
-        $sessionUrl = api_get_path(WEB_CODE_PATH) . 'session/resume_session.php?id_session=' . $sessionId;
161
+        $sessionUrl = api_get_path(WEB_CODE_PATH).'session/resume_session.php?id_session='.$sessionId;
162 162
         $form->addElement(
163 163
             'advmultiselect',
164 164
             $groupName,
165 165
             Display::url(
166 166
                 $session['name'], $sessionUrl, array('target' => '_blank')
167
-            ) . ' - ' . get_lang('Coaches'),
167
+            ).' - '.get_lang('Coaches'),
168 168
             $allTeachers
169 169
         );
170 170
         $courseInfo[$groupName] = $sessionTeachers;
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 }
173 173
 
174 174
 // Category code
175
-$url = api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_category';
175
+$url = api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_category';
176 176
 
177 177
 $categorySelect = $form->addElement(
178 178
     'select_ajax',
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 $form->applyFilter('select_language', 'html_filter');
201 201
 
202 202
 $group = array();
203
-$group[]= $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD);
204
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM);
205
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
206
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED);
207
-$group[]= $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN);
203
+$group[] = $form->createElement('radio', 'visibility', get_lang("CourseAccess"), get_lang('OpenToTheWorld'), COURSE_VISIBILITY_OPEN_WORLD);
204
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('OpenToThePlatform'), COURSE_VISIBILITY_OPEN_PLATFORM);
205
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('Private'), COURSE_VISIBILITY_REGISTERED);
206
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityClosed'), COURSE_VISIBILITY_CLOSED);
207
+$group[] = $form->createElement('radio', 'visibility', null, get_lang('CourseVisibilityHidden'), COURSE_VISIBILITY_HIDDEN);
208 208
 $form->addGroup($group, '', get_lang('CourseAccess'), '<br />');
209 209
 
210 210
 $group = array();
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 $htmlHeadXtra[] = '
257 257
 <script>
258 258
 $(function() {
259
-    ' . $extra['jquery_ready_content'] . '
259
+    ' . $extra['jquery_ready_content'].'
260 260
 });
261 261
 </script>';
262 262
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
                 api_set_failure(get_lang('PortalActiveCoursesLimitReached'));
293 293
 
294
-                header('Location: course_list.php?action=show_msg&warn=' . urlencode(get_lang('PortalActiveCoursesLimitReached')));
294
+                header('Location: course_list.php?action=show_msg&warn='.urlencode(get_lang('PortalActiveCoursesLimitReached')));
295 295
                 exit;
296 296
             }
297 297
         }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
         foreach ($list as $course_temp) {
310 310
             if ($course_temp['code'] != $course_code) {
311 311
                 $visual_code_is_used = true;
312
-                $warn .= ' ' . $course_temp['title'] . ' (' . $course_temp['code'] . '),';
312
+                $warn .= ' '.$course_temp['title'].' ('.$course_temp['code'].'),';
313 313
             }
314 314
         }
315 315
         $warn = substr($warn, 0, -1);
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
     $course['course_code'] = $course_code;
330 330
 
331 331
     if (!stristr($department_url, 'http://')) {
332
-        $department_url = 'http://' . $department_url;
332
+        $department_url = 'http://'.$department_url;
333 333
     }
334 334
 
335 335
     Database::query($sql);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
     if (array_key_exists('add_teachers_to_sessions_courses', $courseInfo)) {
395 395
         $sql = "UPDATE $course_table SET
396 396
                 add_teachers_to_sessions_courses = '$addTeacherToSessionCourses'
397
-                WHERE id = " . $courseInfo['real_id'];
397
+                WHERE id = ".$courseInfo['real_id'];
398 398
         Database::query($sql);
399 399
     }
400 400
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
     Display::addFlash(Display::return_message(get_lang('ItemUpdated')));
404 404
 
405 405
     if ($visual_code_is_used) {
406
-        header('Location: course_list.php?action=show_msg&warn=' . urlencode($warn));
406
+        header('Location: course_list.php?action=show_msg&warn='.urlencode($warn));
407 407
     } else {
408 408
         header('Location: course_list.php');
409 409
     }
Please login to merge, or discard this patch.
main/admin/dashboard_add_courses_to_user.php 2 patches
Indentation   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -36,20 +36,20 @@  discard block
 block discarded – undo
36 36
 
37 37
 // setting the name of the tool
38 38
 if (UserManager::is_admin($user_id)) {
39
-	$tool_name= get_lang('AssignCoursesToPlatformAdministrator');
39
+    $tool_name= get_lang('AssignCoursesToPlatformAdministrator');
40 40
 } else if ($user_info['status'] == SESSIONADMIN) {
41
-	$tool_name= get_lang('AssignCoursesToSessionsAdministrator');
41
+    $tool_name= get_lang('AssignCoursesToSessionsAdministrator');
42 42
 } else {
43
-	$tool_name= get_lang('AssignCoursesToHumanResourcesManager');
43
+    $tool_name= get_lang('AssignCoursesToHumanResourcesManager');
44 44
 }
45 45
 
46 46
 $add_type = 'multiple';
47 47
 if(isset($_GET['add_type']) && $_GET['add_type']!='') {
48
-	$add_type = Security::remove_XSS($_REQUEST['add_type']);
48
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
49 49
 }
50 50
 
51 51
 if (!api_is_platform_admin()) {
52
-	api_not_allowed(true);
52
+    api_not_allowed(true);
53 53
 }
54 54
 
55 55
 function search_courses($needle, $type)
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     $return = '';
61 61
     if (!empty($needle) && !empty($type)) {
62 62
         // xajax send utf8 datas... datas in db can be non-utf8 datas
63
-		$needle = Database::escape_string($needle);
63
+        $needle = Database::escape_string($needle);
64 64
 
65 65
         $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
66 66
         $assigned_courses_code = array_keys($assigned_courses_to_hrm);
@@ -88,16 +88,16 @@  discard block
 block discarded – undo
88 88
                 		$without_assigned_courses ";
89 89
         }
90 90
 
91
-		$rs	= Database::query($sql);
91
+        $rs	= Database::query($sql);
92 92
 
93
-		$return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >';
94
-		while($course = Database :: fetch_array($rs)) {
95
-			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
96
-		}
97
-		$return .= '</select>';
98
-		$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
99
-	}
100
-	return $xajax_response;
93
+        $return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >';
94
+        while($course = Database :: fetch_array($rs)) {
95
+            $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
96
+        }
97
+        $return .= '</select>';
98
+        $xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
99
+    }
100
+    return $xajax_response;
101 101
 }
102 102
 
103 103
 $xajax->processRequests();
@@ -181,23 +181,23 @@  discard block
 block discarded – undo
181 181
 $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
182 182
 $assigned_courses_code = array_keys($assigned_courses_to_hrm);
183 183
 foreach ($assigned_courses_code as &$value) {
184
-	$value = "'".$value."'";
184
+    $value = "'".$value."'";
185 185
 }
186 186
 
187 187
 $without_assigned_courses = '';
188 188
 if (count($assigned_courses_code) > 0) {
189
-	$without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")";
189
+    $without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")";
190 190
 }
191 191
 
192 192
 $needle = '%';
193 193
 $firstLetter = null;
194 194
 if (isset($_POST['firstLetterCourse'])) {
195
-	$firstLetter = $_POST['firstLetterCourse'];
196
-	$needle = Database::escape_string($firstLetter.'%');
195
+    $firstLetter = $_POST['firstLetterCourse'];
196
+    $needle = Database::escape_string($firstLetter.'%');
197 197
 }
198 198
 
199 199
 if (api_is_multiple_url_enabled()) {
200
-	$sql = " SELECT c.code, c.title
200
+    $sql = " SELECT c.code, c.title
201 201
             FROM $tbl_course c
202 202
             LEFT JOIN $tbl_course_rel_access_url a
203 203
             ON (a.c_id = c.id)
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
             ORDER BY c.title";
208 208
 
209 209
 } else {
210
-	$sql= " SELECT c.code, c.title
210
+    $sql= " SELECT c.code, c.title
211 211
 	        FROM $tbl_course c
212 212
             WHERE  c.code LIKE '$needle' $without_assigned_courses
213 213
             ORDER BY c.title";
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 <input type="hidden" name="formSent" value="1" />
222 222
 <?php
223 223
 if(!empty($msg)) {
224
-	Display::display_normal_message($msg); //main API
224
+    Display::display_normal_message($msg); //main API
225 225
 }
226 226
 ?>
227 227
 
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
     </div>
270 270
     <div class="col-md-4">
271 271
         <h5><?php
272
-	  	if (UserManager::is_admin($user_id)) {
273
-			echo get_lang('AssignedCoursesListToPlatformAdministrator');
274
-		} else if ($user_info['status'] == SESSIONADMIN) {
275
-			echo get_lang('AssignedCoursesListToSessionsAdministrator');
276
-		} else {
277
-			echo get_lang('AssignedCoursesListToHumanResourcesManager');
278
-		}
272
+            if (UserManager::is_admin($user_id)) {
273
+            echo get_lang('AssignedCoursesListToPlatformAdministrator');
274
+        } else if ($user_info['status'] == SESSIONADMIN) {
275
+            echo get_lang('AssignedCoursesListToSessionsAdministrator');
276
+        } else {
277
+            echo get_lang('AssignedCoursesListToHumanResourcesManager');
278
+        }
279 279
             ?>: </h5>
280 280
         
281 281
         <select id='destination' name="CoursesList[]" multiple="multiple" size="20" style="width:320px;">
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 // setting breadcrumbs
23 23
 $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
24
-$interbreadcrumb[] = array('url' => 'user_list.php','name' => get_lang('UserList'));
24
+$interbreadcrumb[] = array('url' => 'user_list.php', 'name' => get_lang('UserList'));
25 25
 
26 26
 // Database Table Definitions
27 27
 $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
@@ -36,15 +36,15 @@  discard block
 block discarded – undo
36 36
 
37 37
 // setting the name of the tool
38 38
 if (UserManager::is_admin($user_id)) {
39
-	$tool_name= get_lang('AssignCoursesToPlatformAdministrator');
39
+	$tool_name = get_lang('AssignCoursesToPlatformAdministrator');
40 40
 } else if ($user_info['status'] == SESSIONADMIN) {
41
-	$tool_name= get_lang('AssignCoursesToSessionsAdministrator');
41
+	$tool_name = get_lang('AssignCoursesToSessionsAdministrator');
42 42
 } else {
43
-	$tool_name= get_lang('AssignCoursesToHumanResourcesManager');
43
+	$tool_name = get_lang('AssignCoursesToHumanResourcesManager');
44 44
 }
45 45
 
46 46
 $add_type = 'multiple';
47
-if(isset($_GET['add_type']) && $_GET['add_type']!='') {
47
+if (isset($_GET['add_type']) && $_GET['add_type'] != '') {
48 48
 	$add_type = Security::remove_XSS($_REQUEST['add_type']);
49 49
 }
50 50
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
 function search_courses($needle, $type)
56 56
 {
57
-    global $tbl_course, $tbl_course_rel_access_url,$user_id;
57
+    global $tbl_course, $tbl_course_rel_access_url, $user_id;
58 58
 
59 59
     $xajax_response = new xajaxResponse();
60 60
     $return = '';
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         }
70 70
         $without_assigned_courses = '';
71 71
         if (count($assigned_courses_code) > 0) {
72
-            $without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")";
72
+            $without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")";
73 73
         }
74 74
 
75 75
         if (api_is_multiple_url_enabled()) {
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
                 		$without_assigned_courses ";
89 89
         }
90 90
 
91
-		$rs	= Database::query($sql);
91
+		$rs = Database::query($sql);
92 92
 
93 93
 		$return .= '<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" >';
94
-		while($course = Database :: fetch_array($rs)) {
95
-			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
94
+		while ($course = Database :: fetch_array($rs)) {
95
+			$return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'], ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>';
96 96
 		}
97 97
 		$return .= '</select>';
98
-		$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
98
+		$xajax_response -> addAssign('ajax_list_courses_multiple', 'innerHTML', api_utf8_encode($return));
99 99
 	}
100 100
 	return $xajax_response;
101 101
 }
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 }
154 154
 </script>';
155 155
 
156
-$formSent=0;
156
+$formSent = 0;
157 157
 $errorMsg = $firstLetterCourse = '';
158 158
 $UserList = array();
159 159
 
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) {
162 162
     $courses_list = $_POST['CoursesList'];
163 163
     $affected_rows = CourseManager::subscribeCoursesToDrhManager($user_id, $courses_list);
164
-    if ($affected_rows)	{
164
+    if ($affected_rows) {
165 165
         $msg = get_lang('AssignedCoursesHaveBeenUpdatedSuccessfully');
166 166
     }
167 167
 }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
 $without_assigned_courses = '';
188 188
 if (count($assigned_courses_code) > 0) {
189
-	$without_assigned_courses = " AND c.code NOT IN(".implode(',',$assigned_courses_code).")";
189
+	$without_assigned_courses = " AND c.code NOT IN(".implode(',', $assigned_courses_code).")";
190 190
 }
191 191
 
192 192
 $needle = '%';
@@ -207,20 +207,20 @@  discard block
 block discarded – undo
207 207
             ORDER BY c.title";
208 208
 
209 209
 } else {
210
-	$sql= " SELECT c.code, c.title
210
+	$sql = " SELECT c.code, c.title
211 211
 	        FROM $tbl_course c
212 212
             WHERE  c.code LIKE '$needle' $without_assigned_courses
213 213
             ORDER BY c.title";
214 214
 }
215 215
 
216 216
 
217
-$result	= Database::query($sql);
217
+$result = Database::query($sql);
218 218
 
219 219
 ?>
220 220
 <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;">
221 221
 <input type="hidden" name="formSent" value="1" />
222 222
 <?php
223
-if(!empty($msg)) {
223
+if (!empty($msg)) {
224 224
 	Display::display_normal_message($msg); //main API
225 225
 }
226 226
 ?>
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         <div id="ajax_list_courses_multiple">
233 233
 	<select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" style="width:340px;">
234 234
 	<?php while ($enreg = Database::fetch_array($result)) { ?>
235
-            <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'],ENT_QUOTES).'"';?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
235
+            <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
236 236
 	<?php } ?>
237 237
 	</select>
238 238
         </div>
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
     </div>
241 241
     <div class="col-md-4">
242 242
         <div class="code-course">
243
-        <?php if($add_type == 'multiple') { ?>
244
-        <p><?php echo get_lang('FirstLetterCourse');?> :</p>
243
+        <?php if ($add_type == 'multiple') { ?>
244
+        <p><?php echo get_lang('FirstLetterCourse'); ?> :</p>
245 245
         <select name="firstLetterCourse" class="selectpicker form-control" onchange = "xajax_search_courses(this.value,'multiple')">
246 246
             <option value="%">--</option>
247 247
             <?php  echo Display :: get_alphabet_options($firstLetter); ?>
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
             if (is_array($assigned_courses_to_hrm)) {
284 284
                 foreach ($assigned_courses_to_hrm as $enreg) {
285 285
             ?>
286
-                <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="' . htmlspecialchars($enreg['title'], ENT_QUOTES) . '"'; ?>><?php echo $enreg['title'] . ' (' . $enreg['code'] . ')'; ?></option>
286
+                <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option>
287 287
             <?php
288 288
                     }
289 289
                 }
Please login to merge, or discard this patch.
main/admin/group_add.php 2 patches
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -100,9 +100,9 @@  discard block
 block discarded – undo
100 100
 
101 101
 // Validate form
102 102
 if ($form->validate()) {
103
-	$check = Security::check_token('post');
104
-	if ($check) {
105
-		$values = $form->exportValues();
103
+    $check = Security::check_token('post');
104
+    if ($check) {
105
+        $values = $form->exportValues();
106 106
 
107 107
         $picture_element = $form->getElement('picture');
108 108
         $picture = $picture_element->getValue();
@@ -114,10 +114,10 @@  discard block
 block discarded – undo
114 114
         $picture = $_FILES['picture'];
115 115
         $parent_group_id = intval($values['parent_group']);
116 116
 
117
-		$group_id = GroupPortalManager::add($name, $description, $url, $status);
117
+        $group_id = GroupPortalManager::add($name, $description, $url, $status);
118 118
         GroupPortalManager::set_parent_group($group_id,$parent_group_id);
119 119
 
120
-		if (!empty($picture['name'])) {
120
+        if (!empty($picture['name'])) {
121 121
             $picture_uri = GroupPortalManager::update_group_picture(
122 122
                 $group_id,
123 123
                 $_FILES['picture']['name'],
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
                 $status,
132 132
                 $picture_uri
133 133
             );
134
-		}
134
+        }
135 135
 
136
-		//@todo send emails
136
+        //@todo send emails
137 137
 
138 138
 /*		if (!empty($email) && $send_mail) {
139 139
 			$recipient_name = api_get_person_name($firstname, $lastname, null, PERSON_NAME_EMAIL_ADDRESS);
@@ -155,18 +155,18 @@  discard block
 block discarded – undo
155 155
 			@api_mail_html($recipient_name, $email, $emailsubject, $emailbody, $sender_name, $email_admin);
156 156
 		}*/
157 157
 
158
-		Security::clear_token();
159
-		$tok = Security::get_token();
160
-		header('Location: group_list.php?action=show_message&message='.urlencode(get_lang('GroupAdded')).'&sec_token='.$tok);
158
+        Security::clear_token();
159
+        $tok = Security::get_token();
160
+        header('Location: group_list.php?action=show_message&message='.urlencode(get_lang('GroupAdded')).'&sec_token='.$tok);
161 161
         exit ();
162
-	}
162
+    }
163 163
 } else {
164
-	if (isset($_POST['submit'])) {
165
-		Security::clear_token();
166
-	}
167
-	$token = Security::get_token();
168
-	$form->addElement('hidden', 'sec_token');
169
-	$form->setConstants(array('sec_token' => $token));
164
+    if (isset($_POST['submit'])) {
165
+        Security::clear_token();
166
+    }
167
+    $token = Security::get_token();
168
+    $form->addElement('hidden', 'sec_token');
169
+    $form->setConstants(array('sec_token' => $token));
170 170
 }
171 171
 
172 172
 // Display form
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@
 block discarded – undo
115 115
         $parent_group_id = intval($values['parent_group']);
116 116
 
117 117
 		$group_id = GroupPortalManager::add($name, $description, $url, $status);
118
-        GroupPortalManager::set_parent_group($group_id,$parent_group_id);
118
+        GroupPortalManager::set_parent_group($group_id, $parent_group_id);
119 119
 
120 120
 		if (!empty($picture['name'])) {
121 121
             $picture_uri = GroupPortalManager::update_group_picture(
Please login to merge, or discard this patch.
main/admin/extra_field_workflow.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 api_protect_admin_script();
16 16
 
17 17
 // setting breadcrumbs
18
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
18
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
19 19
 
20 20
 $tool_name = null;
21 21
 
@@ -36,35 +36,35 @@  discard block
 block discarded – undo
36 36
 $token = Security::get_token();
37 37
 
38 38
 if ($action == 'add') {
39
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
40
-    $interbreadcrumb[]=array(
39
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
40
+    $interbreadcrumb[] = array(
41 41
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
42 42
         'name' => $extraFieldInfo['display_text']
43 43
     );
44
-    $interbreadcrumb[]=array(
44
+    $interbreadcrumb[] = array(
45 45
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
46 46
         'name' => get_lang('EditExtraFieldOptions')
47 47
     );
48
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add'));
48
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add'));
49 49
 } elseif ($action == 'edit') {
50
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
51
-    $interbreadcrumb[]=array(
50
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
51
+    $interbreadcrumb[] = array(
52 52
         'url' => 'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
53 53
         'name' => $extraFieldInfo['display_text']
54 54
     );
55
-    $interbreadcrumb[]=array(
55
+    $interbreadcrumb[] = array(
56 56
         'url' => 'extra_field_options.php?type='.$extraField->type.'&field_id='.$extraFieldInfo['id'],
57 57
         'name' => get_lang('EditExtraFieldOptions')
58 58
     );
59 59
 
60
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit'));
60
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit'));
61 61
 } else {
62
-    $interbreadcrumb[]=array('url' => 'extra_fields.php?type='.$extraField->type,'name' => $extraField->pageName);
63
-    $interbreadcrumb[]=array(
62
+    $interbreadcrumb[] = array('url' => 'extra_fields.php?type='.$extraField->type, 'name' => $extraField->pageName);
63
+    $interbreadcrumb[] = array(
64 64
         'url' =>  'extra_fields.php?type='.$extraField->type.'&action=edit&id='.$extraFieldInfo['id'],
65 65
         'name' => $extraFieldInfo['display_text']
66 66
     );
67
-    $interbreadcrumb[]=array('url' => '#','name' => get_lang('EditExtraFieldOptions'));
67
+    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditExtraFieldOptions'));
68 68
 }
69 69
 
70 70
 $roleId = isset($_REQUEST['roleId']) ? $_REQUEST['roleId'] : null;
@@ -74,9 +74,9 @@  discard block
 block discarded – undo
74 74
 $paramsNoRole = 'field_id='.$field_id.'&type='.$extraField->type;
75 75
 
76 76
 //The order is important you need to check the the $column variable in the model.ajax.php file
77
-$columns = array(get_lang('Name'), get_lang('Value'),  get_lang('Order'), get_lang('Actions'));
77
+$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions'));
78 78
 
79
-$htmlHeadXtra[]='<script>
79
+$htmlHeadXtra[] = '<script>
80 80
 
81 81
     function setHidden(obj) {
82 82
         var name = $(obj).attr("name");
@@ -177,9 +177,9 @@  discard block
 block discarded – undo
177 177
 if (!empty($roleId)) {
178 178
     $form->addElement('html', $table->toHtml());
179 179
     $group = array();
180
-    $group[]= $form->createElement('button', 'submit', get_lang('Save'));
181
-    $group[]= $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
182
-    $group[]= $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
180
+    $group[] = $form->createElement('button', 'submit', get_lang('Save'));
181
+    $group[] = $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all'));
182
+    $group[] = $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all'));
183 183
     $form->addGroup($group, '', null, ' ');
184 184
 
185 185
     $form->setDefaults(array('status' => $roleId));
Please login to merge, or discard this patch.
main/admin/skills_wheel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
38 38
 $tpl->assign('wheel_url', $url);
39 39
 
40
-$url  = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
40
+$url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
41 41
 $tpl->assign('url', $url);
42 42
 $tpl->assign('isAdministration', true);
43 43
 
Please login to merge, or discard this patch.
main/admin/usergroup_import.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
             // 2. Check whether class doesn't exist yet.
24 24
             if ($usergroup->usergroup_exists($class['name'])) {
25 25
                 $class['line'] = $index + 2;
26
-                $class['error'] = get_lang('ClassNameExists') .
27
-                    ': <strong>' .$class['name'] . '</strong>';
26
+                $class['error'] = get_lang('ClassNameExists').
27
+                    ': <strong>'.$class['name'].'</strong>';
28 28
                 $errors[] = $class;
29 29
             }
30 30
         }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 $form = new FormValidator('import_classes');
99 99
 $form->addElement('file', 'import_file', get_lang('ImportCSVFileLocation'));
100 100
 $group = array();
101
-$group[] = $form->createElement('radio', 'file_type', '', 'CSV (<a href="example_class.csv" target="_blank">' . get_lang('ExampleCSVFile') . '</a>)', 'csv');
101
+$group[] = $form->createElement('radio', 'file_type', '', 'CSV (<a href="example_class.csv" target="_blank">'.get_lang('ExampleCSVFile').'</a>)', 'csv');
102 102
 $form->addGroup($group, '', get_lang('FileType'), '<br/>');
103 103
 $form->addButtonImport(get_lang('Import'));
104 104
 
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
     $errors = validate_data($classes);
108 108
     if (count($errors) == 0) {
109 109
         $number_of_added_classes = save_data($classes);
110
-        Display::display_normal_message($number_of_added_classes . ' ' . get_lang('Added'));
110
+        Display::display_normal_message($number_of_added_classes.' '.get_lang('Added'));
111 111
     } else {
112 112
         $error_message = get_lang('ErrorsWhenImportingFile');
113 113
         $error_message .= '<ul>';
114 114
         foreach ($errors as $index => $error_class) {
115
-            $error_message .= '<li>' . $error_class['error'] . ' (' . get_lang('Line') . ' ' . $error_class['line'] . ')';
115
+            $error_message .= '<li>'.$error_class['error'].' ('.get_lang('Line').' '.$error_class['line'].')';
116 116
             $error_message .= '</li>';
117 117
         }
118 118
         $error_message .= '</ul>';
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 $form->display();
125 125
 ?>
126
-<p><?php echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')'; ?> :</p>
126
+<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>
127 127
 
128 128
 <pre>
129 129
 <b>name;description;</b>users
Please login to merge, or discard this patch.
main/admin/promotions.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
 <script>
113 113
 $(function() {
114 114
 <?php
115
-     echo Display::grid_js('promotions', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
115
+        echo Display::grid_js('promotions', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
116 116
 ?>
117 117
 });
118 118
 </script>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 $htmlHeadXtra[] = api_get_jqgrid_js();
17 17
 
18 18
 // setting breadcrumbs
19
-$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
20
-$interbreadcrumb[] = array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions'));
19
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
20
+$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions'));
21 21
 
22 22
 $action = isset($_GET['action']) ? $_GET['action'] : null;
23 23
 
@@ -102,10 +102,10 @@  discard block
 block discarded – undo
102 102
 $extra_params['height'] = 'auto'; //use the width of the parent
103 103
 //With this function we can add actions to the jgrid
104 104
 $action_links = 'function action_formatter (cellvalue, options, rowObject) {
105
-    return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'">'.Display::return_icon('session_to_promotion.png',get_lang('SubscribeSessionsToPromotions'),'',ICON_SIZE_SMALL).'</a>'.
106
-    '&nbsp;<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
107
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'.
108
-    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a> \';
105
+    return \'<a href="add_sessions_to_promotion.php?id=\'+options.rowId+\'">'.Display::return_icon('session_to_promotion.png', get_lang('SubscribeSessionsToPromotions'), '', ICON_SIZE_SMALL).'</a>'.
106
+    '&nbsp;<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'.
107
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'.
108
+    '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a> \';
109 109
 }';
110 110
 
111 111
 ?>
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
             $promotion->display();
151 151
         } else {
152 152
             echo '<div class="actions">';
153
-            echo Display::url(Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM), api_get_self());
153
+            echo Display::url(Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM), api_get_self());
154 154
             echo '</div>';
155 155
             $form->addElement('hidden', 'sec_token');
156 156
             $form->setConstants(array('sec_token' => $token));
Please login to merge, or discard this patch.