Completed
Push — 1.11.x ( aa92c0...4d731b )
by José
53:47 queued 27:36
created
main/group/group_creation.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
 if (isset($_POST['number_of_groups'])) {
80 80
     if (!is_numeric($_POST['number_of_groups']) || intval($_POST['number_of_groups']) < 1) {
81 81
         Display :: display_error_message(
82
-			get_lang('PleaseEnterValidNumber').'<br /><br />
82
+            get_lang('PleaseEnterValidNumber').'<br /><br />
83 83
 			<a href="group_creation.php?'.api_get_cidreq().'">&laquo; '.get_lang('Back').'</a>',
84
-			false
85
-		);
84
+            false
85
+        );
86 86
     } else {
87 87
         $number_of_groups = intval($_POST['number_of_groups']);
88 88
         if ($number_of_groups > 1) {
@@ -120,20 +120,20 @@  discard block
 block discarded – undo
120 120
     }
121 121
     </script>
122 122
     <?php
123
-		}
124
-		$group_categories = GroupManager::get_categories();
125
-		$group_id = GroupManager :: get_number_of_groups() + 1;
126
-		$cat_options = [];
127
-		foreach ($group_categories as $index => $category) {
128
-			$cat_options[$category['id']] = $category['title'];
129
-		}
123
+        }
124
+        $group_categories = GroupManager::get_categories();
125
+        $group_id = GroupManager :: get_number_of_groups() + 1;
126
+        $cat_options = [];
127
+        foreach ($group_categories as $index => $category) {
128
+            $cat_options[$category['id']] = $category['title'];
129
+        }
130 130
         $form = new FormValidator('create_groups_step2', 'POST', api_get_self().'?'.api_get_cidreq());
131 131
 
132
-		// Modify the default templates
133
-		$renderer = $form->defaultRenderer();
134
-		$form_template = "<form {attributes}>\n<div class='create-groups'>\n<table>\n{content}\n</table>\n</div>\n</form>";
135
-		$renderer->setFormTemplate($form_template);
136
-		$element_template = <<<EOT
132
+        // Modify the default templates
133
+        $renderer = $form->defaultRenderer();
134
+        $form_template = "<form {attributes}>\n<div class='create-groups'>\n<table>\n{content}\n</table>\n</div>\n</form>";
135
+        $renderer->setFormTemplate($form_template);
136
+        $element_template = <<<EOT
137 137
         <tr class="separate">
138 138
 		<td>
139 139
 			<!-- BEGIN required -->
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
         $form->setDefaults($defaults);
226 226
         $form->addButtonCreate(get_lang('CreateGroup'), 'submit');
227 227
         $form->display();
228
-	}
228
+    }
229 229
 } else {
230 230
     /*
231 231
      * Show form to generate new groups
Please login to merge, or discard this patch.
main/inc/ajax/course.ajax.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -267,11 +267,11 @@
 block discarded – undo
267 267
                 $coachName = api_get_person_name($userResult['firstname'], $userResult['lastname']);
268 268
             }
269 269
 
270
-           $courses[] = array(
271
-               'id' => $courseId,
272
-               'name' => $course['title'],
273
-               'coachName' => $coachName,
274
-           );
270
+            $courses[] = array(
271
+                'id' => $courseId,
272
+                'name' => $course['title'],
273
+                'coachName' => $coachName,
274
+            );
275 275
         }
276 276
 
277 277
         echo json_encode($courses);
Please login to merge, or discard this patch.
main/inc/ajax/thematic.ajax.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 $thematic = new Thematic();
12 12
 
13 13
 switch ($action) {
14
-	case 'save_thematic_plan':
15
-		/*$title_list         = $_REQUEST['title'];
14
+    case 'save_thematic_plan':
15
+        /*$title_list         = $_REQUEST['title'];
16 16
 		$description_list   = $_REQUEST['desc'];
17 17
 		//$description_list   = $_REQUEST['description'];
18 18
 		$description_type   = $_REQUEST['description_type'];
@@ -25,13 +25,13 @@  discard block
 block discarded – undo
25 25
 		$thematic_plan_data = $thematic->get_thematic_plan_data();
26 26
 		$return = $thematic->get_thematic_plan_div($thematic_plan_data);
27 27
 		echo $return[$_REQUEST['thematic_id']];*/
28
-		break;
29
-	case 'save_thematic_advance':
30
-		if (!api_is_allowed_to_edit(null, true)) {
31
-			echo '';
32
-			exit;
33
-		}
34
-		/*
28
+        break;
29
+    case 'save_thematic_advance':
30
+        if (!api_is_allowed_to_edit(null, true)) {
31
+            echo '';
32
+            exit;
33
+        }
34
+        /*
35 35
         if (($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) || (!empty($_REQUEST['duration_in_hours']) && !is_numeric($_REQUEST['duration_in_hours'])) ) {
36 36
             if ($_REQUEST['start_date_type'] == 1 && empty($_REQUEST['start_date_by_attendance'])) {
37 37
                 $start_date_error = true;
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
         $thematic_advance_data = $thematic->get_thematic_advance_list(null, null, true);
80 80
         $return = $thematic->get_thematic_advance_div($thematic_advance_data);
81 81
         echo $return[$_REQUEST['thematic_id']][$_REQUEST['thematic_advance_id']];*/
82
-		break;
82
+        break;
83 83
     case 'get_datetime_by_attendance':
84 84
         $attendance_id       = intval($_REQUEST['attendance_id']);
85 85
         $thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
Please login to merge, or discard this patch.
main/inc/ajax/course_home.ajax.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -445,7 +445,7 @@
 block discarded – undo
445 445
                     $date = '-';
446 446
                 }
447 447
 
448
-                 //Checking LP publicated and expired_on dates
448
+                    //Checking LP publicated and expired_on dates
449 449
                 if (!empty($lp_item['publicated_on']) && $lp_item['publicated_on'] != '0000-00-00 00:00:00') {
450 450
                     if ($now < api_strtotime($lp_item['publicated_on'], 'UTC')) {
451 451
                         continue;
Please login to merge, or discard this patch.
main/session/add_users_to_session.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 $add_type = 'unique';
39 39
 
40 40
 if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
41
-	$add_type = Security::remove_XSS($_REQUEST['add_type']);
41
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
42 42
 }
43 43
 
44 44
 $page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null;
@@ -426,8 +426,8 @@  discard block
 block discarded – undo
426 426
 
427 427
     if ($use_extra_fields) {
428 428
         $final_result = array();
429
-       	if (count($extra_field_result)>1) {
430
-	    for($i=0;$i<count($extra_field_result)-1;$i++) {
429
+            if (count($extra_field_result)>1) {
430
+        for($i=0;$i<count($extra_field_result)-1;$i++) {
431 431
                 if (is_array($extra_field_result[$i+1])) {
432 432
                     $final_result  = array_intersect($extra_field_result[$i],$extra_field_result[$i+1]);
433 433
                 }
@@ -547,12 +547,12 @@  discard block
 block discarded – undo
547 547
 }
548 548
 
549 549
 if ($add_type == 'multiple') {
550
-	$link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=unique">'.
550
+    $link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=unique">'.
551 551
         Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>';
552
-	$link_add_type_multiple = Display::url(Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'), '');
552
+    $link_add_type_multiple = Display::url(Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'), '');
553 553
 } else {
554
-	$link_add_type_unique = Display::url(Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'), '');
555
-	$link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&amp;add='.$addProcess.'&amp;add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
554
+    $link_add_type_unique = Display::url(Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'), '');
555
+    $link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&amp;add='.$addProcess.'&amp;add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
556 556
 }
557 557
 $link_add_group = Display::url(
558 558
     Display::return_icon('multiple.gif',get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups'),
@@ -580,17 +580,17 @@  discard block
 block discarded – undo
580 580
 <?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?>
581 581
 <?php
582 582
 if ($add_type=='multiple') {
583
-	if (is_array($extra_field_list)) {
584
-		if (is_array($new_field_list) && count($new_field_list)>0 ) {
585
-			echo '<h3>'.get_lang('FilterUsers').'</h3>';
586
-			foreach ($new_field_list as $new_field) {
587
-				echo $new_field['name'];
588
-				$varname = 'field_'.$new_field['variable'];
583
+    if (is_array($extra_field_list)) {
584
+        if (is_array($new_field_list) && count($new_field_list)>0 ) {
585
+            echo '<h3>'.get_lang('FilterUsers').'</h3>';
586
+            foreach ($new_field_list as $new_field) {
587
+                echo $new_field['name'];
588
+                $varname = 'field_'.$new_field['variable'];
589 589
                 $fieldtype = $new_field['type'];
590
-				echo '&nbsp;<select name="'.$varname.'">';
591
-				echo '<option value="0">--'.get_lang('Select').'--</option>';
592
-				foreach	($new_field['data'] as $option) {
593
-					$checked='';
590
+                echo '&nbsp;<select name="'.$varname.'">';
591
+                echo '<option value="0">--'.get_lang('Select').'--</option>';
592
+                foreach	($new_field['data'] as $option) {
593
+                    $checked='';
594 594
                     if ($fieldtype == ExtraField::FIELD_TYPE_TAG) {
595 595
                         if (isset($_POST[$varname])) {
596 596
                             if ($_POST[$varname] == $option['tag']) {
@@ -611,11 +611,11 @@  discard block
 block discarded – undo
611 611
                 $extraHidden = $fieldtype == ExtraField::FIELD_TYPE_TAG ? '<input type="hidden" name="field_id" value="'.$option['field_id'].'" />' : '';
612 612
                 echo $extraHidden;
613 613
                 echo '&nbsp;&nbsp;';
614
-			}
615
-			echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />';
616
-			echo '<br /><br />';
617
-		}
618
-	}
614
+            }
615
+            echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />';
616
+            echo '<br /><br />';
617
+        }
618
+    }
619 619
 }
620 620
 ?>
621 621
 <input type="hidden" name="form_sent" value="1" />
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 
624 624
 <?php
625 625
 if (!empty($errorMsg)) {
626
-	Display::display_normal_message($errorMsg); //main API
626
+    Display::display_normal_message($errorMsg); //main API
627 627
 }
628 628
 ?>
629 629
 <div id="multiple-add-session" class="row">
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
             <label><?php echo get_lang('UserListInPlatform') ?> </label>
633 633
             <?php
634 634
             if (!($add_type=='multiple')) {
635
-              ?>
635
+                ?>
636 636
               <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" class="form-control" />
637 637
               <div id="ajax_list_users_single" class="select-list-ajax"></div>
638 638
               <?php
@@ -641,21 +641,21 @@  discard block
 block discarded – undo
641 641
             <div id="ajax_list_users_multiple">
642 642
             <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" class="form-control">
643 643
               <?php
644
-              foreach ($nosessionUsersList as $uid => $enreg) {
645
-              ?>
644
+                foreach ($nosessionUsersList as $uid => $enreg) {
645
+                ?>
646 646
                   <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>>
647 647
                       <?php
648
-                      $personName = api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].') '.$enreg['official_code'];
649
-                      if ($showOfficialCode) {
650
-                          $officialCode = !empty($enreg['official_code']) ? $enreg['official_code'].' - ' : '? - ';
651
-                          $personName = $officialCode.api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')';
652
-                      }
653
-                      echo $personName;
654
-                      ?>
648
+                        $personName = api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].') '.$enreg['official_code'];
649
+                        if ($showOfficialCode) {
650
+                            $officialCode = !empty($enreg['official_code']) ? $enreg['official_code'].' - ' : '? - ';
651
+                            $personName = $officialCode.api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].')';
652
+                        }
653
+                        echo $personName;
654
+                        ?>
655 655
                   </option>
656 656
               <?php
657
-              }
658
-              ?>
657
+                }
658
+                ?>
659 659
             </select>
660 660
             </div>
661 661
                 <input type="checkbox" onchange="checked_in_no_session(this.checked);" name="user_with_any_session" id="user_with_any_session_id">
@@ -663,7 +663,7 @@  discard block
 block discarded – undo
663 663
             <?php
664 664
             }
665 665
             unset($nosessionUsersList);
666
-           ?>
666
+            ?>
667 667
         </div>
668 668
     </div>
669 669
 
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
               <?php
708 708
             }
709 709
             if (!empty($addProcess)) {
710
-		echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>';
710
+        echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>';
711 711
             } else {
712 712
                 echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToSession').'</button>';
713 713
             }
Please login to merge, or discard this patch.
main/exercise/exercise_result.class.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 */
10 10
 class ExerciseResult
11 11
 {
12
-	private $results = array();
12
+    private $results = array();
13 13
     public $includeAllUsers = false;
14 14
     public $onlyBestAttempts = false;
15 15
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         $exercise_id = 0,
47 47
         $hotpotato_name = null
48 48
     ) {
49
-		$return = array();
49
+        $return = array();
50 50
 
51 51
         $TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
52 52
         $TBL_TABLE_LP_MAIN = Database::get_course_table(TABLE_LP_MAIN);
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
         return true;
270 270
     }
271 271
 
272
-	/**
273
-	 * Exports the complete report as a CSV file
274
-	 * @param	string		Document path inside the document tool
275
-	 * @param	integer		Optional user ID
276
-	 * @param	boolean		Whether to include user fields or not
277
-	 * @return	boolean		False on error
278
-	 */
272
+    /**
273
+     * Exports the complete report as a CSV file
274
+     * @param	string		Document path inside the document tool
275
+     * @param	integer		Optional user ID
276
+     * @param	boolean		Whether to include user fields or not
277
+     * @return	boolean		False on error
278
+     */
279 279
     public function exportCompleteReportCSV(
280 280
         $document_path = '',
281 281
         $user_id = null,
Please login to merge, or discard this patch.
main/admin/dashboard_add_users_to_user.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 $add_type = 'multiple';
57 57
 if (isset($_GET['add_type']) && $_GET['add_type']!='') {
58
-	$add_type = Security::remove_XSS($_REQUEST['add_type']);
58
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
59 59
 }
60 60
 
61 61
 if (!api_is_platform_admin()) {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                     $return .= '...<br />';
161 161
                 }
162 162
             }
163
-           $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
163
+            $xajax_response->addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
164 164
         } else {
165 165
             $return .= '<select id="origin" class="form-control" name="NoAssignedUsersList[]" multiple="multiple" size="15" ">';
166 166
             while($user = Database :: fetch_array($rs)) {
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         }
173 173
     }
174 174
 
175
-	return $xajax_response;
175
+    return $xajax_response;
176 176
 }
177 177
 
178 178
 $xajax->processRequests();
@@ -359,13 +359,13 @@  discard block
 block discarded – undo
359 359
 $assigned_users_id = array_keys($assigned_users_to_hrm);
360 360
 $without_assigned_users = '';
361 361
 if (count($assigned_users_id) > 0) {
362
-	$without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
362
+    $without_assigned_users = " user.user_id NOT IN(".implode(',',$assigned_users_id).") AND ";
363 363
 }
364 364
 
365 365
 $search_user = '';
366 366
 if (!empty($firstLetterUser)) {
367
-	$needle = Database::escape_string($firstLetterUser);
368
-	$search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
367
+    $needle = Database::escape_string($firstLetterUser);
368
+    $search_user ="AND ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%'";
369 369
 }
370 370
 
371 371
 $sqlConditions = null;
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
 }
386 386
 
387 387
 if (api_is_multiple_url_enabled()) {
388
-	$sql = "SELECT user.user_id, username, lastname, firstname
388
+    $sql = "SELECT user.user_id, username, lastname, firstname
389 389
 	        FROM $tbl_user user  LEFT JOIN $tbl_access_url_rel_user au 
390 390
 	        ON (au.user_id = user.user_id)
391 391
 			WHERE
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                 $sqlConditions
397 397
             ORDER BY firstname";
398 398
 } else {
399
-	$sql = "SELECT user_id, username, lastname, firstname
399
+    $sql = "SELECT user_id, username, lastname, firstname
400 400
 	        FROM $tbl_user user
401 401
 			WHERE
402 402
 			    $without_assigned_users
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 <input type="hidden" name="formSent" value="1" />
413 413
 <?php
414 414
 if(!empty($msg)) {
415
-	Display::display_normal_message($msg); //main API
415
+    Display::display_normal_message($msg); //main API
416 416
 }
417 417
 ?>
418 418
 
@@ -465,26 +465,26 @@  discard block
 block discarded – undo
465 465
                 </button>
466 466
             </div>
467 467
           <?php
468
-          }
469
-          ?>
468
+            }
469
+            ?>
470 470
             <div class="separate-action">
471 471
                 <?php
472
-		echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
472
+        echo '<button class="btn btn-success" type="button" value="" onclick="valide()" >'.$tool_name.'</button>';
473 473
             ?>
474 474
             </div>
475 475
         </div>
476 476
     </div>
477 477
     <div class="col-md-4">
478 478
         <?php
479
-	if (UserManager::is_admin($user_id)) {
480
-		echo get_lang('AssignedUsersListToPlatformAdministrator');
479
+    if (UserManager::is_admin($user_id)) {
480
+        echo get_lang('AssignedUsersListToPlatformAdministrator');
481 481
             } else if ($user_info['status'] == SESSIONADMIN) {
482 482
                     echo get_lang('AssignedUsersListToSessionsAdministrator');
483 483
             } else if ($user_info['status'] == STUDENT_BOSS) {
484 484
                     echo get_lang('AssignedUsersListToStudentBoss');
485 485
             } else {
486 486
                     echo get_lang('AssignedUsersListToHumanResourcesManager');
487
-	}
487
+    }
488 488
         ?>
489 489
         <div class="form-group">
490 490
             <div class="col-sm-12">
Please login to merge, or discard this patch.
main/session/session_edit.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 $interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id,"name" => get_lang('SessionOverview'));
61 61
 
62 62
 if (isset($_POST['formSent']) && $_POST['formSent']) {
63
-	$formSent = 1;
63
+    $formSent = 1;
64 64
 }
65 65
 
66 66
 $order_clause = 'ORDER BY ';
@@ -71,15 +71,15 @@  discard block
 block discarded – undo
71 71
         WHERE status='1'".$order_clause;
72 72
 
73 73
 if (api_is_multiple_url_enabled()) {
74
-	$table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
75
-	$access_url_id = api_get_current_access_url_id();
76
-	if ($access_url_id != -1) {
77
-		$sql = "SELECT DISTINCT u.user_id,lastname,firstname,username
74
+    $table_access_url_rel_user= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
75
+    $access_url_id = api_get_current_access_url_id();
76
+    if ($access_url_id != -1) {
77
+        $sql = "SELECT DISTINCT u.user_id,lastname,firstname,username
78 78
 		        FROM $tbl_user u
79 79
                 INNER JOIN $table_access_url_rel_user url_rel_user
80 80
                 ON (url_rel_user.user_id = u.user_id)
81 81
 			    WHERE status='1' AND access_url_id = '$access_url_id' $order_clause";
82
-	}
82
+    }
83 83
 }
84 84
 
85 85
 $result = Database::query($sql);
Please login to merge, or discard this patch.
plugin/dashboard/block_session/block_session.class.php 1 patch
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -15,36 +15,36 @@  discard block
 block discarded – undo
15 15
 class BlockSession extends Block
16 16
 {
17 17
     private $user_id;
18
-	private $sessions;
19
-	private $path;
20
-	private $permission = array(DRH, SESSIONADMIN);
18
+    private $sessions;
19
+    private $path;
20
+    private $permission = array(DRH, SESSIONADMIN);
21 21
 
22
-	/**
23
-	 * Constructor
24
-	 */
22
+    /**
23
+     * Constructor
24
+     */
25 25
     public function __construct ($user_id)
26 26
     {
27
-    	$this->user_id 	= $user_id;
28
-    	$this->path = 'block_session';
29
-    	if ($this->is_block_visible_for_user($user_id)) {
27
+        $this->user_id 	= $user_id;
28
+        $this->path = 'block_session';
29
+        if ($this->is_block_visible_for_user($user_id)) {
30 30
             $this->sessions = SessionManager::get_sessions_followed_by_drh($user_id);
31
-    	}
31
+        }
32 32
     }
33 33
 
34
-	/**
35
-	 * This method check if a user is allowed to see the block inside dashboard interface
36
-	 * @param	int		User id
37
-	 * @return	bool	Is block visible for user
38
-	 */
34
+    /**
35
+     * This method check if a user is allowed to see the block inside dashboard interface
36
+     * @param	int		User id
37
+     * @return	bool	Is block visible for user
38
+     */
39 39
     public function is_block_visible_for_user($user_id)
40 40
     {
41
-    	$user_info = api_get_user_info($user_id);
42
-		$user_status = $user_info['status'];
43
-		$is_block_visible_for_user = false;
44
-    	if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {
45
-    		$is_block_visible_for_user = true;
46
-    	}
47
-    	return $is_block_visible_for_user;
41
+        $user_info = api_get_user_info($user_id);
42
+        $user_status = $user_info['status'];
43
+        $is_block_visible_for_user = false;
44
+        if (UserManager::is_admin($user_id) || in_array($user_status, $this->permission)) {
45
+            $is_block_visible_for_user = true;
46
+        }
47
+        return $is_block_visible_for_user;
48 48
     }
49 49
 
50 50
     /**
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
     public function get_block()
56 56
     {
57 57
 
58
-		global $charset;
58
+        global $charset;
59 59
 
60
-    	$column = 2;
61
-    	$data   = array();
60
+        $column = 2;
61
+        $data   = array();
62 62
 
63
-		$content = $this->get_content_html();
63
+        $content = $this->get_content_html();
64 64
 
65
-		$content_html = '
65
+        $content_html = '
66 66
 			            <div class="panel panel-default" id="intro">
67 67
 			                <div class="panel-heading">
68 68
 			                    '.get_lang('SessionsInformation').'
@@ -76,40 +76,40 @@  discard block
 block discarded – undo
76 76
 			            </div>
77 77
 				';
78 78
 
79
-    	$data['column'] = $column;
80
-    	$data['content_html'] = $content_html;
79
+        $data['column'] = $column;
80
+        $data['content_html'] = $content_html;
81 81
 
82
-    	return $data;
82
+        return $data;
83 83
     }
84 84
 
85 85
     /**
86
- 	 * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
87
- 	 * @return string  content html
88
- 	 */
86
+     * This method return a content html, it's used inside get_block method for showing it inside dashboard interface
87
+     * @return string  content html
88
+     */
89 89
     public function get_content_html()
90 90
     {
91 91
 
92
- 		$content = '';
93
-		$sessions = $this->sessions;
92
+            $content = '';
93
+        $sessions = $this->sessions;
94 94
 
95
-		//$content = '<div style="margin:10px;">';
96
-		$content .= '<h4>'.get_lang('YourSessionsList').'</h4>';
95
+        //$content = '<div style="margin:10px;">';
96
+        $content .= '<h4>'.get_lang('YourSessionsList').'</h4>';
97 97
 
98
-		if (count($sessions) > 0) {
99
-			$sessions_table = '<table class="data_table" width:"95%">';
100
- 			$sessions_table .= '<tr>
98
+        if (count($sessions) > 0) {
99
+            $sessions_table = '<table class="data_table" width:"95%">';
100
+                $sessions_table .= '<tr>
101 101
 									<th >'.get_lang('Title').'</th>
102 102
 									<th >'.get_lang('Date').'</th>
103 103
 									<th width="100px">'.get_lang('NbCoursesPerSession').'</th>
104 104
 								</tr>';
105
-			$i = 1;
106
-			foreach ($sessions as $session) {
105
+            $i = 1;
106
+            foreach ($sessions as $session) {
107 107
 
108
-				$session_id = intval($session['id']);
109
-				$title = $session['name'];
108
+                $session_id = intval($session['id']);
109
+                $title = $session['name'];
110 110
 
111
-				if (!empty($session['access_start_date'])) {
112
-				    $dateFrom = api_convert_and_format_date(
111
+                if (!empty($session['access_start_date'])) {
112
+                    $dateFrom = api_convert_and_format_date(
113 113
                         $session['access_start_date'],
114 114
                         DATE_FORMAT_SHORT,
115 115
                         date_default_timezone_get()
@@ -121,44 +121,44 @@  discard block
 block discarded – undo
121 121
                     );
122 122
 
123 123
                     $date = vsprintf(get_lang('FromDateXToDateY'), [$dateFrom, $dateUntil]);
124
-				} else {
125
-					$date = ' - ';
126
-				}
124
+                } else {
125
+                    $date = ' - ';
126
+                }
127 127
 
128
-	 			$count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id));
128
+                    $count_courses_in_session = count(Tracking::get_courses_list_from_session($session_id));
129 129
 
130
-				if ($i%2 == 0) $class_tr = 'row_odd';
131
-	    		else $class_tr = 'row_even';
130
+                if ($i%2 == 0) $class_tr = 'row_odd';
131
+                else $class_tr = 'row_even';
132 132
 
133
-				$sessions_table .= '<tr class="'.$class_tr.'">
133
+                $sessions_table .= '<tr class="'.$class_tr.'">
134 134
 										<td>'.$title.'</td>
135 135
 										<td align="center">'.$date.'</td>
136 136
 										<td align="center">'.$count_courses_in_session.'</td>
137 137
 								   </tr>';
138
-				$i++;
139
-			}
140
-			$sessions_table .= '</table>';
141
-			$content .= $sessions_table;
142
-		} else {
143
-			$content .= get_lang('ThereIsNoInformationAboutYourSessions');
144
-		}
138
+                $i++;
139
+            }
140
+            $sessions_table .= '</table>';
141
+            $content .= $sessions_table;
142
+        } else {
143
+            $content .= get_lang('ThereIsNoInformationAboutYourSessions');
144
+        }
145 145
 
146
-		if (count($sessions) > 0) {
147
-			$content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/session.php">'.get_lang('SeeMore').'</a></div>';
148
-		}
146
+        if (count($sessions) > 0) {
147
+            $content .= '<div style="text-align:right;margin-top:10px;"><a href="'.api_get_path(WEB_CODE_PATH).'mySpace/session.php">'.get_lang('SeeMore').'</a></div>';
148
+        }
149 149
 
150
-		//$content .= '</div>';
150
+        //$content .= '</div>';
151 151
 
152
- 		return $content;
153
- 	}
152
+            return $content;
153
+        }
154 154
 
155 155
     /**
156
-	 * Get number of sessions
157
-	 * @return int
158
-	 */
159
-	function get_number_of_sessions()
156
+     * Get number of sessions
157
+     * @return int
158
+     */
159
+    function get_number_of_sessions()
160 160
     {
161
-		return count($this->sessions);
162
-	}
161
+        return count($this->sessions);
162
+    }
163 163
 
164 164
 }
Please login to merge, or discard this patch.