@@ -34,8 +34,8 @@ |
||
34 | 34 | $idUserLocal = api_get_user_id(); |
35 | 35 | $userLocal = api_get_user_info($idUserLocal, true); |
36 | 36 | $htmlHeadXtra[] = '<script type="text/javascript" src="' |
37 | - . api_get_path(WEB_PATH) . 'web/assets/simpleWebRTC/latest.js' |
|
38 | - . '"></script>' . "\n"; |
|
37 | + . api_get_path(WEB_PATH).'web/assets/simpleWebRTC/latest.js' |
|
38 | + . '"></script>'."\n"; |
|
39 | 39 | |
40 | 40 | $template = new Template(); |
41 | 41 | $template->assign('room_name', $chatVideo->getRoomName()); |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | global $current_tag; |
281 | 281 | switch ($data) { |
282 | 282 | case 'Contact': |
283 | - $user = array (); |
|
283 | + $user = array(); |
|
284 | 284 | break; |
285 | 285 | default: |
286 | 286 | $current_tag = $data; |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | $allowed_file_mimetype = array('csv', 'xml'); |
374 | 374 | $error_kind_file = false; |
375 | 375 | |
376 | - $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] :null; |
|
376 | + $checkUniqueEmail = isset($_POST['check_unique_email']) ? $_POST['check_unique_email'] : null; |
|
377 | 377 | |
378 | 378 | $uploadInfo = pathinfo($_FILES['import_file']['name']); |
379 | 379 | $ext_import_file = $uploadInfo['extension']; |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | if (strcmp($file_type, 'csv') === 0 && |
383 | 383 | $ext_import_file == $allowed_file_mimetype[0] |
384 | 384 | ) { |
385 | - $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
385 | + $users = parse_csv_data($_FILES['import_file']['tmp_name']); |
|
386 | 386 | $errors = validate_data($users, $checkUniqueEmail); |
387 | 387 | $error_kind_file = false; |
388 | 388 | } elseif (strcmp($file_type, 'xml') === 0 && $ext_import_file == $allowed_file_mimetype[1]) { |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $from = intval($from); |
75 | 75 | $number_of_items = intval($number_of_items); |
76 | 76 | |
77 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
77 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
78 | 78 | $direction = 'ASC'; |
79 | 79 | } |
80 | 80 | |
@@ -97,24 +97,24 @@ discard block |
||
97 | 97 | $thematic[1] = '<a href="index.php?'.api_get_cidreq().'&action=thematic_details&thematic_id='.$thematic[0].'">'. |
98 | 98 | Security::remove_XSS($thematic[1], STUDENT).$session_star.'</a>'; |
99 | 99 | if (api_is_allowed_to_edit(null, true)) { |
100 | - $actions = ''; |
|
100 | + $actions = ''; |
|
101 | 101 | |
102 | 102 | if (api_get_session_id()) { |
103 | 103 | if (api_get_session_id() == $thematic[3]) { |
104 | 104 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'. |
105 | - Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a> '; |
|
105 | + Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a> '; |
|
106 | 106 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'. |
107 | - Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a> '; |
|
107 | + Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a> '; |
|
108 | 108 | |
109 | 109 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'. |
110 | - Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
110 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
111 | 111 | $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'. |
112 | - Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
112 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
113 | 113 | } else { |
114 | - $actions .= Display::return_icon('lesson_plan_na.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).' '; |
|
115 | - $actions .= Display::return_icon('lesson_plan_calendar_na.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).' '; |
|
116 | - $actions .= Display::return_icon('edit_na.png',get_lang('Edit'),'',ICON_SIZE_SMALL); |
|
117 | - $actions .= Display::return_icon('delete_na.png',get_lang('Delete'),'',ICON_SIZE_SMALL).' '; |
|
114 | + $actions .= Display::return_icon('lesson_plan_na.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).' '; |
|
115 | + $actions .= Display::return_icon('lesson_plan_calendar_na.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).' '; |
|
116 | + $actions .= Display::return_icon('edit_na.png', get_lang('Edit'), '', ICON_SIZE_SMALL); |
|
117 | + $actions .= Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL).' '; |
|
118 | 118 | $actions .= Display::url( |
119 | 119 | Display::return_icon('cd.gif', get_lang('Copy')), |
120 | 120 | 'index.php?'.api_get_cidreq().'&action=thematic_copy&thematic_id='.$thematic[0] |
@@ -122,26 +122,26 @@ discard block |
||
122 | 122 | } |
123 | 123 | } else { |
124 | 124 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_plan_list&thematic_id='.$thematic[0].'">'. |
125 | - Display::return_icon('lesson_plan.png',get_lang('ThematicPlan'),'',ICON_SIZE_SMALL).'</a> '; |
|
125 | + Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), '', ICON_SIZE_SMALL).'</a> '; |
|
126 | 126 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_list&thematic_id='.$thematic[0].'">'. |
127 | - Display::return_icon('lesson_plan_calendar.png',get_lang('ThematicAdvance'),'',ICON_SIZE_SMALL).'</a> '; |
|
127 | + Display::return_icon('lesson_plan_calendar.png', get_lang('ThematicAdvance'), '', ICON_SIZE_SMALL).'</a> '; |
|
128 | 128 | |
129 | 129 | if ($thematic[2] > 1) { |
130 | 130 | $actions .= '<a href="'.api_get_self().'?action=moveup&'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'. |
131 | - Display::return_icon('up.png', get_lang('Up'),'',ICON_SIZE_SMALL).'</a>'; |
|
131 | + Display::return_icon('up.png', get_lang('Up'), '', ICON_SIZE_SMALL).'</a>'; |
|
132 | 132 | } else { |
133 | - $actions .= Display::return_icon('up_na.png',' ','',ICON_SIZE_SMALL); |
|
133 | + $actions .= Display::return_icon('up_na.png', ' ', '', ICON_SIZE_SMALL); |
|
134 | 134 | } |
135 | 135 | if ($thematic[2] < self::get_max_thematic_item()) { |
136 | 136 | $actions .= '<a href="'.api_get_self().'?action=movedown&a'.api_get_cidreq().'&thematic_id='.$thematic[0].'">'. |
137 | - Display::return_icon('down.png',get_lang('Down'),'',ICON_SIZE_SMALL).'</a>'; |
|
137 | + Display::return_icon('down.png', get_lang('Down'), '', ICON_SIZE_SMALL).'</a>'; |
|
138 | 138 | } else { |
139 | - $actions .= Display::return_icon('down_na.png',' ','',ICON_SIZE_SMALL); |
|
139 | + $actions .= Display::return_icon('down_na.png', ' ', '', ICON_SIZE_SMALL); |
|
140 | 140 | } |
141 | 141 | $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_edit&thematic_id='.$thematic[0].'">'. |
142 | - Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'; |
|
142 | + Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'; |
|
143 | 143 | $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_delete&thematic_id='.$thematic[0].'">'. |
144 | - Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'; |
|
144 | + Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'; |
|
145 | 145 | } |
146 | 146 | $thematics[] = array($thematic[0], $thematic[1], $actions); |
147 | 147 | } |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | |
376 | 376 | if (is_array($thematic_id)) { |
377 | 377 | foreach ($thematic_id as $id) { |
378 | - $id = intval($id); |
|
378 | + $id = intval($id); |
|
379 | 379 | $sql = "UPDATE $tbl_thematic SET active = 0 |
380 | 380 | WHERE c_id = $course_id AND id = $id"; |
381 | 381 | $result = Database::query($sql); |
@@ -391,8 +391,8 @@ discard block |
||
391 | 391 | ); |
392 | 392 | } |
393 | 393 | } |
394 | - } else { |
|
395 | - $thematic_id = intval($thematic_id); |
|
394 | + } else { |
|
395 | + $thematic_id = intval($thematic_id); |
|
396 | 396 | $sql = "UPDATE $tbl_thematic SET active = 0 |
397 | 397 | WHERE c_id = $course_id AND id = $thematic_id"; |
398 | 398 | $result = Database::query($sql); |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | $new_thematic_id = $thematic_copy->thematic_save(); |
430 | 430 | if (!empty($new_thematic_id)) { |
431 | 431 | $thematic_advanced = self::get_thematic_advance_by_thematic_id($thematic_id); |
432 | - if(!empty($thematic_advanced)) { |
|
433 | - foreach($thematic_advanced as $item) { |
|
432 | + if (!empty($thematic_advanced)) { |
|
433 | + foreach ($thematic_advanced as $item) { |
|
434 | 434 | $thematic = new Thematic(); |
435 | 435 | $thematic->set_thematic_advance_attributes( |
436 | 436 | 0, |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | $column = intval($column); |
495 | 495 | $from = intval($from); |
496 | 496 | $number_of_items = intval($number_of_items); |
497 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
497 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
498 | 498 | $direction = 'ASC'; |
499 | 499 | } |
500 | 500 | $data = array(); |
@@ -527,8 +527,8 @@ discard block |
||
527 | 527 | $thematic_advance[1] = api_get_local_time($thematic_advance[1]); |
528 | 528 | $thematic_advance[1] = api_format_date($thematic_advance[1], DATE_TIME_FORMAT_LONG); |
529 | 529 | $actions = ''; |
530 | - $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png',get_lang('Edit'),'',22).'</a>'; |
|
531 | - $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png',get_lang('Delete'),'',22).'</a></center>'; |
|
530 | + $actions .= '<a href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('edit.png', get_lang('Edit'), '', 22).'</a>'; |
|
531 | + $actions .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic_id.'&thematic_advance_id='.$thematic_advance[0].'">'.Display::return_icon('delete.png', get_lang('Delete'), '', 22).'</a></center>'; |
|
532 | 532 | $data[] = array($i, $thematic_advance[1], $thematic_advance[2], $thematic_advance[3], $actions); |
533 | 533 | $i++; |
534 | 534 | } |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | |
593 | 593 | $session_star = ''; |
594 | 594 | if (api_is_allowed_to_edit(null, true)) { |
595 | - if ($thematic_advance['session_id'] !=0) { |
|
595 | + if ($thematic_advance['session_id'] != 0) { |
|
596 | 596 | $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']); |
597 | 597 | } |
598 | 598 | } |
@@ -618,13 +618,13 @@ discard block |
||
618 | 618 | |
619 | 619 | foreach ($data as $thematic_id => $thematic_plan_data) { |
620 | 620 | $new_thematic_plan_data = array(); |
621 | - foreach($thematic_plan_data as $thematic_item) { |
|
621 | + foreach ($thematic_plan_data as $thematic_item) { |
|
622 | 622 | $thematic_simple_list[] = $thematic_item['description_type']; |
623 | 623 | $new_thematic_plan_data[$thematic_item['description_type']] = $thematic_item; |
624 | 624 | } |
625 | 625 | |
626 | 626 | if (!empty($thematic_simple_list)) { |
627 | - foreach($thematic_simple_list as $item) { |
|
627 | + foreach ($thematic_simple_list as $item) { |
|
628 | 628 | $default_thematic_plan_title[$item] = $new_thematic_plan_data[$item]['title']; |
629 | 629 | } |
630 | 630 | } |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | } |
641 | 641 | if (!empty($data[$thematic_id][$id]['title']) && !empty($data[$thematic_id][$id]['description'])) { |
642 | 642 | if (api_is_allowed_to_edit(null, true)) { |
643 | - if ($data[$thematic_id][$id]['session_id'] !=0) { |
|
643 | + if ($data[$thematic_id][$id]['session_id'] != 0) { |
|
644 | 644 | $session_star = api_get_session_image(api_get_session_id(), $uinfo['status']); |
645 | 645 | } |
646 | 646 | } |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | if ($no_data) { |
654 | 654 | $return .= '<div><em>'.get_lang('StillDoNotHaveAThematicPlan').'</em></div>'; |
655 | 655 | } |
656 | - $return .= '</div>'; |
|
656 | + $return .= '</div>'; |
|
657 | 657 | $final_return[$thematic_id] = $return; |
658 | 658 | } |
659 | 659 | |
@@ -866,18 +866,18 @@ discard block |
||
866 | 866 | api_get_session_id() |
867 | 867 | ); |
868 | 868 | |
869 | - $thematic_plan_complete_list = array(); |
|
869 | + $thematic_plan_complete_list = array(); |
|
870 | 870 | $thematic_plan_id_list = array(); |
871 | 871 | |
872 | 872 | if (!empty($items_from_course)) { |
873 | - foreach($items_from_course as $item) { |
|
873 | + foreach ($items_from_course as $item) { |
|
874 | 874 | $thematic_plan_id_list[] = $item['ref']; |
875 | 875 | $thematic_plan_complete_list[$item['ref']] = $item; |
876 | 876 | } |
877 | 877 | } |
878 | 878 | |
879 | 879 | if (!empty($items_from_session)) { |
880 | - foreach($items_from_session as $item) { |
|
880 | + foreach ($items_from_session as $item) { |
|
881 | 881 | $thematic_plan_id_list[] = $item['ref']; |
882 | 882 | $thematic_plan_complete_list[$item['ref']] = $item; |
883 | 883 | } |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | if (!isset($thematic_id) && !isset($description_type)) { |
901 | 901 | // group all data group by thematic id |
902 | 902 | $tmp = array(); |
903 | - while ($row = Database::fetch_array($rs,'ASSOC')) { |
|
903 | + while ($row = Database::fetch_array($rs, 'ASSOC')) { |
|
904 | 904 | $tmp[] = $row['thematic_id']; |
905 | 905 | if (in_array($row['thematic_id'], $tmp)) { |
906 | 906 | $row['session_id'] = $thematic_plan_complete_list[$row['id']]; |
@@ -908,7 +908,7 @@ discard block |
||
908 | 908 | } |
909 | 909 | } |
910 | 910 | } else { |
911 | - while ($row = Database::fetch_array($rs,'ASSOC')) { |
|
911 | + while ($row = Database::fetch_array($rs, 'ASSOC')) { |
|
912 | 912 | $row['session_id'] = $thematic_plan_complete_list[$row['id']]; |
913 | 913 | $data[] = $row; |
914 | 914 | } |
@@ -943,8 +943,8 @@ discard block |
||
943 | 943 | ); |
944 | 944 | |
945 | 945 | $elements_to_show = array(); |
946 | - foreach($list as $value) { |
|
947 | - $elements_to_show[]= $value['ref']; |
|
946 | + foreach ($list as $value) { |
|
947 | + $elements_to_show[] = $value['ref']; |
|
948 | 948 | } |
949 | 949 | $condition = ''; |
950 | 950 | if (!empty($elements_to_show)) { |
@@ -956,7 +956,7 @@ discard block |
||
956 | 956 | c_id = $course_id AND |
957 | 957 | thematic_id = $thematic_id AND |
958 | 958 | description_type = '$description_type'"; |
959 | - $rs = Database::query($sql); |
|
959 | + $rs = Database::query($sql); |
|
960 | 960 | |
961 | 961 | $affected_rows = 0; |
962 | 962 | if (Database::num_rows($rs) > 0) { |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | $diff = array_diff($all, $a_thematic_advance_ids); |
1191 | 1191 | if (!empty($diff)) { |
1192 | 1192 | $upd = "UPDATE $tbl_thematic_advance SET done_advance = 0 |
1193 | - WHERE c_id = $course_id AND id IN(".implode(',',$diff).") "; |
|
1193 | + WHERE c_id = $course_id AND id IN(".implode(',', $diff).") "; |
|
1194 | 1194 | Database::query($upd); |
1195 | 1195 | } |
1196 | 1196 | |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | $course_code = api_get_course_id(); |
1306 | 1306 | } |
1307 | 1307 | if (api_get_session_id()) { |
1308 | - $thematic_data = $this->get_thematic_list(null, $course_code ); |
|
1308 | + $thematic_data = $this->get_thematic_list(null, $course_code); |
|
1309 | 1309 | } else { |
1310 | 1310 | $thematic_data = $this->get_thematic_list(null, $course_code, 0); |
1311 | 1311 | } |
@@ -1361,7 +1361,7 @@ discard block |
||
1361 | 1361 | } |
1362 | 1362 | // calculate average by thematic |
1363 | 1363 | $count_total_advances = count($advances); |
1364 | - $average = round(($count_done_advances*100)/$count_total_advances); |
|
1364 | + $average = round(($count_done_advances * 100) / $count_total_advances); |
|
1365 | 1365 | } |
1366 | 1366 | |
1367 | 1367 | return $average; |
@@ -1451,12 +1451,12 @@ discard block |
||
1451 | 1451 | public function get_default_thematic_plan_title() |
1452 | 1452 | { |
1453 | 1453 | $default_thematic_plan_titles = array(); |
1454 | - $default_thematic_plan_titles[1]= get_lang('Objectives'); |
|
1455 | - $default_thematic_plan_titles[2]= get_lang('SkillToAcquire'); |
|
1456 | - $default_thematic_plan_titles[3]= get_lang('Methodology'); |
|
1457 | - $default_thematic_plan_titles[4]= get_lang('Infrastructure'); |
|
1458 | - $default_thematic_plan_titles[5]= get_lang('Assessment'); |
|
1459 | - $default_thematic_plan_titles[6]= get_lang('Others'); |
|
1454 | + $default_thematic_plan_titles[1] = get_lang('Objectives'); |
|
1455 | + $default_thematic_plan_titles[2] = get_lang('SkillToAcquire'); |
|
1456 | + $default_thematic_plan_titles[3] = get_lang('Methodology'); |
|
1457 | + $default_thematic_plan_titles[4] = get_lang('Infrastructure'); |
|
1458 | + $default_thematic_plan_titles[5] = get_lang('Assessment'); |
|
1459 | + $default_thematic_plan_titles[6] = get_lang('Others'); |
|
1460 | 1460 | |
1461 | 1461 | return $default_thematic_plan_titles; |
1462 | 1462 | } |
@@ -1468,12 +1468,12 @@ discard block |
||
1468 | 1468 | public function get_default_thematic_plan_icon() |
1469 | 1469 | { |
1470 | 1470 | $default_thematic_plan_icon = array(); |
1471 | - $default_thematic_plan_icon[1]= 'icons/32/objective.png'; |
|
1472 | - $default_thematic_plan_icon[2]= 'icons/32/skills.png'; |
|
1473 | - $default_thematic_plan_icon[3]= 'icons/32/strategy.png'; |
|
1474 | - $default_thematic_plan_icon[4]= 'icons/32/laptop.png'; |
|
1475 | - $default_thematic_plan_icon[5]= 'icons/32/assessment.png'; |
|
1476 | - $default_thematic_plan_icon[6]= 'icons/32/wizard.png'; |
|
1471 | + $default_thematic_plan_icon[1] = 'icons/32/objective.png'; |
|
1472 | + $default_thematic_plan_icon[2] = 'icons/32/skills.png'; |
|
1473 | + $default_thematic_plan_icon[3] = 'icons/32/strategy.png'; |
|
1474 | + $default_thematic_plan_icon[4] = 'icons/32/laptop.png'; |
|
1475 | + $default_thematic_plan_icon[5] = 'icons/32/assessment.png'; |
|
1476 | + $default_thematic_plan_icon[6] = 'icons/32/wizard.png'; |
|
1477 | 1477 | |
1478 | 1478 | return $default_thematic_plan_icon; |
1479 | 1479 | } |
@@ -1485,11 +1485,11 @@ discard block |
||
1485 | 1485 | public function get_default_question() |
1486 | 1486 | { |
1487 | 1487 | $question = array(); |
1488 | - $question[1]= get_lang('ObjectivesQuestions'); |
|
1489 | - $question[2]= get_lang('SkillToAcquireQuestions'); |
|
1490 | - $question[3]= get_lang('MethodologyQuestions'); |
|
1491 | - $question[4]= get_lang('InfrastructureQuestions'); |
|
1492 | - $question[5]= get_lang('AssessmentQuestions'); |
|
1488 | + $question[1] = get_lang('ObjectivesQuestions'); |
|
1489 | + $question[2] = get_lang('SkillToAcquireQuestions'); |
|
1490 | + $question[3] = get_lang('MethodologyQuestions'); |
|
1491 | + $question[4] = get_lang('InfrastructureQuestions'); |
|
1492 | + $question[5] = get_lang('AssessmentQuestions'); |
|
1493 | 1493 | |
1494 | 1494 | return $question; |
1495 | 1495 | } |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | "; |
83 | 83 | $result = Database::query($sql); |
84 | 84 | if (Database::num_rows($result)) { |
85 | - $row = Database::fetch_array($result); |
|
85 | + $row = Database::fetch_array($result); |
|
86 | 86 | |
87 | 87 | return $row['count']; |
88 | 88 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | "; |
103 | 103 | $result = Database::query($sql); |
104 | 104 | if (Database::num_rows($result)) { |
105 | - $row = Database::fetch_array($result); |
|
105 | + $row = Database::fetch_array($result); |
|
106 | 106 | return $row['count']; |
107 | 107 | } |
108 | 108 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | "; |
128 | 128 | $result = Database::query($sql); |
129 | 129 | if (Database::num_rows($result)) { |
130 | - $row = Database::fetch_array($result); |
|
130 | + $row = Database::fetch_array($result); |
|
131 | 131 | return $row['count']; |
132 | 132 | } |
133 | 133 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | "; |
149 | 149 | $result = Database::query($sql); |
150 | 150 | if (Database::num_rows($result)) { |
151 | - $row = Database::fetch_array($result); |
|
151 | + $row = Database::fetch_array($result); |
|
152 | 152 | return $row['count']; |
153 | 153 | } |
154 | 154 | |
@@ -529,13 +529,13 @@ discard block |
||
529 | 529 | INNER JOIN {$this->table} g |
530 | 530 | ON (u.usergroup_id = g.id) |
531 | 531 | "; |
532 | - $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
532 | + $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
533 | 533 | } else { |
534 | 534 | $from = $this->usergroup_rel_user_table." u |
535 | 535 | INNER JOIN {$this->table} g |
536 | 536 | ON (u.usergroup_id = g.id) |
537 | 537 | "; |
538 | - $where = array('where' => array('user_id = ?' => $userId)); |
|
538 | + $where = array('where' => array('user_id = ?' => $userId)); |
|
539 | 539 | } |
540 | 540 | |
541 | 541 | if ($filterByType !== null) { |
@@ -568,10 +568,10 @@ discard block |
||
568 | 568 | $urlId = api_get_current_access_url_id(); |
569 | 569 | $from = $this->usergroup_rel_user_table." u |
570 | 570 | INNER JOIN {$this->access_url_rel_usergroup} a ON (a.usergroup_id AND u.usergroup_id)"; |
571 | - $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
571 | + $where = array('where' => array('user_id = ? AND access_url_id = ? ' => array($userId, $urlId))); |
|
572 | 572 | } else { |
573 | 573 | $from = $this->usergroup_rel_user_table." u "; |
574 | - $where = array('where' => array('user_id = ?' => $userId)); |
|
574 | + $where = array('where' => array('user_id = ?' => $userId)); |
|
575 | 575 | } |
576 | 576 | |
577 | 577 | $results = Database::select( |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | } |
859 | 859 | $result = $new_result; |
860 | 860 | } |
861 | - $columns = array('name', 'users', 'courses','sessions', 'group_type'); |
|
861 | + $columns = array('name', 'users', 'courses', 'sessions', 'group_type'); |
|
862 | 862 | |
863 | 863 | if (!in_array($sidx, $columns)) { |
864 | 864 | $sidx = 'name'; |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | } |
1264 | 1264 | } |
1265 | 1265 | } |
1266 | - $response->addAssign('ajax_list_courses','innerHTML', api_utf8_encode($return)); |
|
1266 | + $response->addAssign('ajax_list_courses', 'innerHTML', api_utf8_encode($return)); |
|
1267 | 1267 | |
1268 | 1268 | return $response; |
1269 | 1269 | } |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | * @param string style css |
1372 | 1372 | * @return array with the file and the style of an image i.e $array['file'] $array['style'] |
1373 | 1373 | */ |
1374 | - public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM , $style = '') |
|
1374 | + public function get_picture_group($id, $picture_file, $height, $size_picture = GROUP_IMAGE_SIZE_MEDIUM, $style = '') |
|
1375 | 1375 | { |
1376 | 1376 | $picture = array(); |
1377 | 1377 | //$picture['style'] = $style; |
@@ -1414,7 +1414,7 @@ discard block |
||
1414 | 1414 | if (file_exists($file) && !is_dir($file)) { |
1415 | 1415 | $picture['file'] = $image_array['dir'].$picture_file; |
1416 | 1416 | } else { |
1417 | - $picture['file'] = Display::returnIconPath('group_na.png',64); |
|
1417 | + $picture['file'] = Display::returnIconPath('group_na.png', 64); |
|
1418 | 1418 | } |
1419 | 1419 | } |
1420 | 1420 | return $picture; |
@@ -1518,7 +1518,7 @@ discard block |
||
1518 | 1518 | if (empty($user_id)) { |
1519 | 1519 | $user_id = api_get_user_id(); |
1520 | 1520 | } |
1521 | - $user_role = $this->get_user_group_role($user_id, $group_id); |
|
1521 | + $user_role = $this->get_user_group_role($user_id, $group_id); |
|
1522 | 1522 | if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN))) { |
1523 | 1523 | return true; |
1524 | 1524 | } else { |
@@ -1536,7 +1536,7 @@ discard block |
||
1536 | 1536 | if (empty($user_id)) { |
1537 | 1537 | $user_id = api_get_user_id(); |
1538 | 1538 | } |
1539 | - $user_role = $this->get_user_group_role($user_id, $group_id); |
|
1539 | + $user_role = $this->get_user_group_role($user_id, $group_id); |
|
1540 | 1540 | if (in_array($user_role, array(GROUP_USER_PERMISSION_ADMIN, GROUP_USER_PERMISSION_MODERATOR))) { |
1541 | 1541 | return true; |
1542 | 1542 | } else { |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | GROUP_USER_PERMISSION_READER, |
1564 | 1564 | GROUP_USER_PERMISSION_HRM, |
1565 | 1565 | ); |
1566 | - $user_role = self::get_user_group_role($user_id, $group_id); |
|
1566 | + $user_role = self::get_user_group_role($user_id, $group_id); |
|
1567 | 1567 | if (in_array($user_role, $roles)) { |
1568 | 1568 | return true; |
1569 | 1569 | } else { |
@@ -1580,7 +1580,7 @@ discard block |
||
1580 | 1580 | * */ |
1581 | 1581 | public function get_user_group_role($user_id, $group_id) |
1582 | 1582 | { |
1583 | - $table_group_rel_user= $this->usergroup_rel_user_table; |
|
1583 | + $table_group_rel_user = $this->usergroup_rel_user_table; |
|
1584 | 1584 | $return_value = 0; |
1585 | 1585 | if (!empty($user_id) && !empty($group_id)) { |
1586 | 1586 | $sql = "SELECT relation_type FROM $table_group_rel_user |
@@ -1588,8 +1588,8 @@ discard block |
||
1588 | 1588 | usergroup_id = ".intval($group_id)." AND |
1589 | 1589 | user_id = ".intval($user_id)." "; |
1590 | 1590 | $result = Database::query($sql); |
1591 | - if (Database::num_rows($result)>0) { |
|
1592 | - $row = Database::fetch_array($result,'ASSOC'); |
|
1591 | + if (Database::num_rows($result) > 0) { |
|
1592 | + $row = Database::fetch_array($result, 'ASSOC'); |
|
1593 | 1593 | $return_value = $row['relation_type']; |
1594 | 1594 | } |
1595 | 1595 | } |
@@ -1644,7 +1644,7 @@ discard block |
||
1644 | 1644 | if (is_array($user_list) && is_array($group_list)) { |
1645 | 1645 | foreach ($group_list as $group_id) { |
1646 | 1646 | foreach ($user_list as $user_id) { |
1647 | - $role = self::get_user_group_role($user_id,$group_id); |
|
1647 | + $role = self::get_user_group_role($user_id, $group_id); |
|
1648 | 1648 | if ($role == 0) { |
1649 | 1649 | $sql = "INSERT INTO $table_url_rel_group |
1650 | 1650 | SET |
@@ -1675,7 +1675,7 @@ discard block |
||
1675 | 1675 | public function delete_user_rel_group($user_id, $group_id) |
1676 | 1676 | { |
1677 | 1677 | $table = $this->usergroup_rel_user_table; |
1678 | - $sql= "DELETE FROM $table |
|
1678 | + $sql = "DELETE FROM $table |
|
1679 | 1679 | WHERE |
1680 | 1680 | user_id = ".intval($user_id)." AND |
1681 | 1681 | usergroup_id = ".intval($group_id)." "; |
@@ -1731,7 +1731,7 @@ discard block |
||
1731 | 1731 | |
1732 | 1732 | $sql = "UPDATE $table_group_rel_user |
1733 | 1733 | SET relation_type = ".intval($relation_type)." |
1734 | - WHERE user_id = $user_id AND usergroup_id = $group_id" ; |
|
1734 | + WHERE user_id = $user_id AND usergroup_id = $group_id"; |
|
1735 | 1735 | Database::query($sql); |
1736 | 1736 | } |
1737 | 1737 | |
@@ -1773,7 +1773,7 @@ discard block |
||
1773 | 1773 | if (Database::num_rows($result) > 0) { |
1774 | 1774 | while ($row = Database::fetch_array($result, 'ASSOC')) { |
1775 | 1775 | if ($with_image) { |
1776 | - $picture = self::get_picture_group($row['id'], $row['picture'],80); |
|
1776 | + $picture = self::get_picture_group($row['id'], $row['picture'], 80); |
|
1777 | 1777 | $img = '<img src="'.$picture['file'].'" />'; |
1778 | 1778 | $row['picture'] = $img; |
1779 | 1779 | } |
@@ -1809,11 +1809,11 @@ discard block |
||
1809 | 1809 | ORDER BY count DESC |
1810 | 1810 | LIMIT $num"; |
1811 | 1811 | |
1812 | - $result=Database::query($sql); |
|
1812 | + $result = Database::query($sql); |
|
1813 | 1813 | $array = array(); |
1814 | 1814 | while ($row = Database::fetch_array($result, 'ASSOC')) { |
1815 | 1815 | if ($with_image) { |
1816 | - $picture = self::get_picture_group($row['id'], $row['picture'],80); |
|
1816 | + $picture = self::get_picture_group($row['id'], $row['picture'], 80); |
|
1817 | 1817 | $img = '<img src="'.$picture['file'].'" />'; |
1818 | 1818 | $row['picture'] = $img; |
1819 | 1819 | } |
@@ -1858,11 +1858,11 @@ discard block |
||
1858 | 1858 | ORDER BY created_at DESC |
1859 | 1859 | LIMIT $num "; |
1860 | 1860 | |
1861 | - $result=Database::query($sql); |
|
1861 | + $result = Database::query($sql); |
|
1862 | 1862 | $array = array(); |
1863 | 1863 | while ($row = Database::fetch_array($result, 'ASSOC')) { |
1864 | 1864 | if ($with_image) { |
1865 | - $picture = self::get_picture_group($row['id'], $row['picture'],80); |
|
1865 | + $picture = self::get_picture_group($row['id'], $row['picture'], 80); |
|
1866 | 1866 | $img = '<img src="'.$picture['file'].'" />'; |
1867 | 1867 | $row['picture'] = $img; |
1868 | 1868 | } |
@@ -1896,7 +1896,7 @@ discard block |
||
1896 | 1896 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
1897 | 1897 | $group_id = intval($group_id); |
1898 | 1898 | |
1899 | - if (empty($group_id)){ |
|
1899 | + if (empty($group_id)) { |
|
1900 | 1900 | return array(); |
1901 | 1901 | } |
1902 | 1902 | |
@@ -1911,9 +1911,9 @@ discard block |
||
1911 | 1911 | $where_relation_condition = ''; |
1912 | 1912 | } else { |
1913 | 1913 | $new_relation_type = array(); |
1914 | - foreach($relation_type as $rel) { |
|
1914 | + foreach ($relation_type as $rel) { |
|
1915 | 1915 | $rel = intval($rel); |
1916 | - $new_relation_type[] ="'$rel'"; |
|
1916 | + $new_relation_type[] = "'$rel'"; |
|
1917 | 1917 | } |
1918 | 1918 | $relation_type = implode(',', $new_relation_type); |
1919 | 1919 | if (!empty($relation_type)) |
@@ -1957,7 +1957,7 @@ discard block |
||
1957 | 1957 | $tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
1958 | 1958 | $group_id = intval($group_id); |
1959 | 1959 | |
1960 | - if (empty($group_id)){ |
|
1960 | + if (empty($group_id)) { |
|
1961 | 1961 | return array(); |
1962 | 1962 | } |
1963 | 1963 | |
@@ -1968,7 +1968,7 @@ discard block |
||
1968 | 1968 | WHERE gu.usergroup_id= $group_id |
1969 | 1969 | ORDER BY relation_type, firstname"; |
1970 | 1970 | |
1971 | - $result=Database::query($sql); |
|
1971 | + $result = Database::query($sql); |
|
1972 | 1972 | $array = array(); |
1973 | 1973 | while ($row = Database::fetch_array($result, 'ASSOC')) { |
1974 | 1974 | $array[$row['id']] = $row; |
@@ -1996,33 +1996,33 @@ discard block |
||
1996 | 1996 | case GROUP_USER_PERMISSION_READER: |
1997 | 1997 | // I'm just a reader |
1998 | 1998 | $relation_group_title = get_lang('IAmAReader'); |
1999 | - $links .= '<li class="'. ($show == 'invite_friends' ? 'active' : '') .'"><a href="group_invitation.php?id='.$group_id.'">'. |
|
2000 | - Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>'; |
|
2001 | - $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2002 | - Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>'; |
|
1999 | + $links .= '<li class="'.($show == 'invite_friends' ? 'active' : '').'"><a href="group_invitation.php?id='.$group_id.'">'. |
|
2000 | + Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>'; |
|
2001 | + $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2002 | + Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>'; |
|
2003 | 2003 | if (UserGroup::canLeave($group_info)) { |
2004 | - $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2005 | - Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>'; |
|
2004 | + $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2005 | + Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>'; |
|
2006 | 2006 | } |
2007 | 2007 | break; |
2008 | 2008 | case GROUP_USER_PERMISSION_ADMIN: |
2009 | 2009 | $relation_group_title = get_lang('IAmAnAdmin'); |
2010 | - $links .= '<li class="'. ($show == 'group_edit' ? 'active' : '') .'"><a href="group_edit.php?id='.$group_id.'">'. |
|
2011 | - Display::return_icon('group_edit.png', get_lang('EditGroup')) . get_lang('EditGroup') . '</a></li>'; |
|
2012 | - $links .= '<li class="'. ($show == 'member_list' ? 'active' : '') .'"><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
2013 | - Display::return_icon('waiting_list.png', get_lang('WaitingList')) . get_lang('WaitingList') . '</a></li>'; |
|
2014 | - $links .= '<li class="'. ($show == 'invite_friends' ? 'active' : '') .'"><a href="group_invitation.php?id='.$group_id.'">'. |
|
2015 | - Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>'; |
|
2010 | + $links .= '<li class="'.($show == 'group_edit' ? 'active' : '').'"><a href="group_edit.php?id='.$group_id.'">'. |
|
2011 | + Display::return_icon('group_edit.png', get_lang('EditGroup')).get_lang('EditGroup').'</a></li>'; |
|
2012 | + $links .= '<li class="'.($show == 'member_list' ? 'active' : '').'"><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
2013 | + Display::return_icon('waiting_list.png', get_lang('WaitingList')).get_lang('WaitingList').'</a></li>'; |
|
2014 | + $links .= '<li class="'.($show == 'invite_friends' ? 'active' : '').'"><a href="group_invitation.php?id='.$group_id.'">'. |
|
2015 | + Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>'; |
|
2016 | 2016 | if (UserGroup::canLeave($group_info)) { |
2017 | 2017 | $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
2018 | - Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>'; |
|
2018 | + Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>'; |
|
2019 | 2019 | } |
2020 | 2020 | break; |
2021 | 2021 | case GROUP_USER_PERMISSION_PENDING_INVITATION: |
2022 | 2022 | // $links .= '<li><a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('addd.gif', get_lang('YouHaveBeenInvitedJoinNow'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('YouHaveBeenInvitedJoinNow').'</span></a></li>'; |
2023 | 2023 | break; |
2024 | 2024 | case GROUP_USER_PERMISSION_PENDING_INVITATION_SENT_BY_USER: |
2025 | - $relation_group_title = get_lang('WaitingForAdminResponse'); |
|
2025 | + $relation_group_title = get_lang('WaitingForAdminResponse'); |
|
2026 | 2026 | break; |
2027 | 2027 | case GROUP_USER_PERMISSION_MODERATOR: |
2028 | 2028 | $relation_group_title = get_lang('IAmAModerator'); |
@@ -2030,28 +2030,28 @@ discard block |
||
2030 | 2030 | //$links .= '<li><a href="groups.php?id='.$group_id.'">'. Display::return_icon('message_list.png', get_lang('MessageList'), array('hspace'=>'6')).'<span class="'.($show=='messages_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MessageList').'</span></a></li>'; |
2031 | 2031 | //$links .= '<li><a href="group_members.php?id='.$group_id.'">'. Display::return_icon('member_list.png', get_lang('MemberList'), array('hspace'=>'6')).'<span class="'.($show=='member_list'?'social-menu-text-active':'social-menu-text4').'" >'.get_lang('MemberList').'</span></a></li>'; |
2032 | 2032 | if ($group_info['visibility'] == GROUP_PERMISSION_CLOSED) { |
2033 | - $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
2034 | - Display::return_icon('waiting_list.png', get_lang('WaitingList')) . get_lang('WaitingList') . '</a></li>'; |
|
2033 | + $links .= '<li><a href="group_waiting_list.php?id='.$group_id.'">'. |
|
2034 | + Display::return_icon('waiting_list.png', get_lang('WaitingList')).get_lang('WaitingList').'</a></li>'; |
|
2035 | 2035 | } |
2036 | - $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
2037 | - Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>'; |
|
2036 | + $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
2037 | + Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>'; |
|
2038 | 2038 | if (UserGroup::canLeave($group_info)) { |
2039 | - $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2040 | - Display::return_icon('group_leave.png', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>'; |
|
2039 | + $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2040 | + Display::return_icon('group_leave.png', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>'; |
|
2041 | 2041 | } |
2042 | 2042 | break; |
2043 | 2043 | case GROUP_USER_PERMISSION_HRM: |
2044 | 2044 | $relation_group_title = get_lang('IAmAHRM'); |
2045 | 2045 | $links .= '<li><a href="'.api_get_path(WEB_CODE_PATH).'social/message_for_group_form.inc.php?view_panel=1&height=400&width=610&&user_friend='.api_get_user_id().'&group_id='.$group_id.'&action=add_message_group" class="ajax" title="'.get_lang('ComposeMessage').'" data-size="lg" data-title="'.get_lang('ComposeMessage').'">'. |
2046 | - Display::return_icon('new-message.png', get_lang('NewTopic')) . get_lang('NewTopic') . '</a></li>'; |
|
2047 | - $links .= '<li><a href="group_view.php?id='.$group_id.'">'. |
|
2048 | - Display::return_icon('message_list.png', get_lang('MessageList')) . get_lang('MessageList') . '</a></li>'; |
|
2049 | - $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
2050 | - Display::return_icon('invitation_friend.png', get_lang('InviteFriends')) . get_lang('InviteFriends') . '</a></li>'; |
|
2051 | - $links .= '<li><a href="group_members.php?id='.$group_id.'">'. |
|
2052 | - Display::return_icon('member_list.png', get_lang('MemberList')) . get_lang('MemberList') . '</a></li>'; |
|
2053 | - $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2054 | - Display::return_icon('delete_data.gif', get_lang('LeaveGroup')) . get_lang('LeaveGroup') . '</a></li>'; |
|
2046 | + Display::return_icon('new-message.png', get_lang('NewTopic')).get_lang('NewTopic').'</a></li>'; |
|
2047 | + $links .= '<li><a href="group_view.php?id='.$group_id.'">'. |
|
2048 | + Display::return_icon('message_list.png', get_lang('MessageList')).get_lang('MessageList').'</a></li>'; |
|
2049 | + $links .= '<li><a href="group_invitation.php?id='.$group_id.'">'. |
|
2050 | + Display::return_icon('invitation_friend.png', get_lang('InviteFriends')).get_lang('InviteFriends').'</a></li>'; |
|
2051 | + $links .= '<li><a href="group_members.php?id='.$group_id.'">'. |
|
2052 | + Display::return_icon('member_list.png', get_lang('MemberList')).get_lang('MemberList').'</a></li>'; |
|
2053 | + $links .= '<li><a href="group_view.php?id='.$group_id.'&action=leave&u='.api_get_user_id().'">'. |
|
2054 | + Display::return_icon('delete_data.gif', get_lang('LeaveGroup')).get_lang('LeaveGroup').'</a></li>'; |
|
2055 | 2055 | break; |
2056 | 2056 | default: |
2057 | 2057 | //$links .= '<li><a href="groups.php?id='.$group_id.'&action=join&u='.api_get_user_id().'">'.Display::return_icon('addd.gif', get_lang('JoinGroup'), array('hspace'=>'6')).'<span class="social-menu-text4" >'.get_lang('JoinGroup').'</a></span></li>'; |
@@ -2143,7 +2143,7 @@ discard block |
||
2143 | 2143 | } |
2144 | 2144 | |
2145 | 2145 | $direction = 'ASC'; |
2146 | - if (!in_array($direction, array('ASC','DESC'))) { |
|
2146 | + if (!in_array($direction, array('ASC', 'DESC'))) { |
|
2147 | 2147 | $direction = 'ASC'; |
2148 | 2148 | } |
2149 | 2149 | |
@@ -2154,8 +2154,8 @@ discard block |
||
2154 | 2154 | $sql .= " LIMIT $from,$number_of_items"; |
2155 | 2155 | |
2156 | 2156 | $res = Database::query($sql); |
2157 | - if (Database::num_rows($res)> 0) { |
|
2158 | - while ($row = Database::fetch_array($res,'ASSOC')) { |
|
2157 | + if (Database::num_rows($res) > 0) { |
|
2158 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
2159 | 2159 | if (!in_array($row['id'], $return)) { |
2160 | 2160 | $return[$row['id']] = $row; |
2161 | 2161 | } |
@@ -2180,7 +2180,7 @@ discard block |
||
2180 | 2180 | if ($i == $max_level) { |
2181 | 2181 | $select_part .= "rg$rg_number.group_id as id_$rg_number "; |
2182 | 2182 | } else { |
2183 | - $select_part .="rg$rg_number.group_id as id_$rg_number, "; |
|
2183 | + $select_part .= "rg$rg_number.group_id as id_$rg_number, "; |
|
2184 | 2184 | } |
2185 | 2185 | if ($i == 1) { |
2186 | 2186 | $cond_part .= "FROM $t_rel_group rg0 LEFT JOIN $t_rel_group rg$i on rg$rg_number.group_id = rg$i.subgroup_id "; |
@@ -2365,7 +2365,7 @@ discard block |
||
2365 | 2365 | $nameList = '<ul class="list-unstyled">'; |
2366 | 2366 | |
2367 | 2367 | foreach ($groupsNameListParsed as $name) { |
2368 | - $nameList .= '<li>' . Display::span($name, ['class' => 'label label-info']) . '</li>'; |
|
2368 | + $nameList .= '<li>'.Display::span($name, ['class' => 'label label-info']).'</li>'; |
|
2369 | 2369 | } |
2370 | 2370 | |
2371 | 2371 | $nameList .= '</ul>'; |
@@ -249,7 +249,7 @@ |
||
249 | 249 | 'props.session_id' |
250 | 250 | ); |
251 | 251 | |
252 | - $visibility_rule = ' props.visibility ' . ($can_see_invisible ? '<> 2' : '= 1'); |
|
252 | + $visibility_rule = ' props.visibility '.($can_see_invisible ? '<> 2' : '= 1'); |
|
253 | 253 | |
254 | 254 | $sql = "SELECT SUM(table1.size) FROM ( |
255 | 255 | SELECT props.ref, size |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | case 'updated_at': |
64 | 64 | break; |
65 | 65 | case 'name': |
66 | - $val .= ' ' . get_lang('CopyLabelSuffix'); |
|
66 | + $val .= ' '.get_lang('CopyLabelSuffix'); |
|
67 | 67 | $new[$key] = $val; |
68 | 68 | break; |
69 | 69 | case 'created_at': |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | break; |
73 | 73 | case 'career_id': |
74 | 74 | if (!empty($career_id)) { |
75 | - $val = (int)$career_id; |
|
75 | + $val = (int) $career_id; |
|
76 | 76 | } |
77 | 77 | $new[$key] = $val; |
78 | 78 | break; |
@@ -160,22 +160,22 @@ discard block |
||
160 | 160 | { |
161 | 161 | // Action links |
162 | 162 | echo '<div class="actions" style="margin-bottom:20px">'; |
163 | - echo '<a href="career_dashboard.php">' . Display::return_icon('back.png', |
|
164 | - get_lang('Back'), '', '32') . '</a>'; |
|
165 | - echo '<a href="' . api_get_self() . '?action=add">' . |
|
163 | + echo '<a href="career_dashboard.php">'.Display::return_icon('back.png', |
|
164 | + get_lang('Back'), '', '32').'</a>'; |
|
165 | + echo '<a href="'.api_get_self().'?action=add">'. |
|
166 | 166 | Display::return_icon( |
167 | 167 | 'new_promotion.png', |
168 | 168 | get_lang('Add'), |
169 | 169 | '', |
170 | 170 | '32' |
171 | - ) . '</a>'; |
|
172 | - echo '<a href="' . api_get_path(WEB_CODE_PATH) . 'session/session_add.php">' . |
|
171 | + ).'</a>'; |
|
172 | + echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'. |
|
173 | 173 | Display::return_icon( |
174 | 174 | 'new_session.png', |
175 | 175 | get_lang('AddSession'), |
176 | 176 | '', |
177 | 177 | '32' |
178 | - ) . '</a>'; |
|
178 | + ).'</a>'; |
|
179 | 179 | echo '</div>'; |
180 | 180 | echo Display::grid_html('promotions'); |
181 | 181 | } |
@@ -15,7 +15,7 @@ discard block |
||
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,16 +36,16 @@ discard block |
||
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 | 50 | $interbreadcrumb[] = array( |
51 | 51 | 'url' => 'extra_fields.php?type='.$extraField->type, |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | $paramsNoRole = 'field_id='.$field_id.'&type='.$extraField->type; |
84 | 84 | |
85 | 85 | //The order is important you need to check the the $column variable in the model.ajax.php file |
86 | -$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions')); |
|
86 | +$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions')); |
|
87 | 87 | |
88 | -$htmlHeadXtra[]='<script> |
|
88 | +$htmlHeadXtra[] = '<script> |
|
89 | 89 | |
90 | 90 | function setHidden(obj) { |
91 | 91 | var name = $(obj).attr("name"); |
@@ -186,9 +186,9 @@ discard block |
||
186 | 186 | if (!empty($roleId)) { |
187 | 187 | $form->addElement('html', $table->toHtml()); |
188 | 188 | $group = array(); |
189 | - $group[]= $form->createElement('button', 'submit', get_lang('Save')); |
|
190 | - $group[]= $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all')); |
|
191 | - $group[]= $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all')); |
|
189 | + $group[] = $form->createElement('button', 'submit', get_lang('Save')); |
|
190 | + $group[] = $form->createElement('button', 'select_all', get_lang('SelectAll'), array('class' => 'btn select_all')); |
|
191 | + $group[] = $form->createElement('button', 'unselect_all', get_lang('UnSelectAll'), array('class' => 'btn unselect_all')); |
|
192 | 192 | $form->addGroup($group, '', null, ' '); |
193 | 193 | |
194 | 194 | $form->setDefaults(array('status' => $roleId)); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } else { |
48 | 48 | $changes = ''; |
49 | 49 | } |
50 | - $submit = $values['send']; |
|
50 | + $submit = $values['send']; |
|
51 | 51 | |
52 | 52 | $default['content'] = $content; |
53 | 53 | if (isset($values['language'])) { |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | Display::addFlash(Display::return_message($message)); |
67 | 67 | header('Location: legal_list.php?sec_token='.$tok); |
68 | 68 | exit(); |
69 | - } elseif ($submit=='preview') { |
|
69 | + } elseif ($submit == 'preview') { |
|
70 | 70 | $defaults['type'] = $type; |
71 | 71 | $defaults['content'] = $content; |
72 | 72 | $defaults['changes'] = $changes; |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | $form->addElement('html', $buttons); |
138 | 138 | |
139 | 139 | } else { |
140 | - $form->addElement('select_language', 'language', get_lang('Language'),null,array()); |
|
140 | + $form->addElement('select_language', 'language', get_lang('Language'), null, array()); |
|
141 | 141 | $form->addButtonSearch(get_lang('Load'), 'send'); |
142 | 142 | |
143 | 143 | } |
144 | 144 | |
145 | 145 | $tool_name = get_lang('AddTermsAndConditions'); |
146 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
146 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
147 | 147 | Display :: display_header($tool_name); |
148 | 148 | |
149 | 149 | echo '<script> |
@@ -21,7 +21,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | 94 | while ($course = Database :: fetch_array($rs)) { |
95 | - $return .= '<option value="'.$course['code'].'" title="'.htmlspecialchars($course['title'],ENT_QUOTES).'">'.$course['title'].' ('.$course['code'].')</option>'; |
|
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 |
||
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 |
||
161 | 161 | if (isset($_POST['formSent']) && intval($_POST['formSent']) == 1) { |
162 | 162 | $courses_list = isset($_POST['CoursesList']) ? $_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 | } |
@@ -213,20 +213,20 @@ discard block |
||
213 | 213 | ORDER BY c.title"; |
214 | 214 | |
215 | 215 | } else { |
216 | - $sql= " SELECT c.code, c.title |
|
216 | + $sql = " SELECT c.code, c.title |
|
217 | 217 | FROM $tbl_course c |
218 | 218 | WHERE c.code LIKE '$needle' $without_assigned_courses |
219 | 219 | ORDER BY c.title"; |
220 | 220 | } |
221 | 221 | |
222 | 222 | |
223 | -$result = Database::query($sql); |
|
223 | +$result = Database::query($sql); |
|
224 | 224 | |
225 | 225 | ?> |
226 | 226 | <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;"> |
227 | 227 | <input type="hidden" name="formSent" value="1" /> |
228 | 228 | <?php |
229 | -if(!empty($msg)) { |
|
229 | +if (!empty($msg)) { |
|
230 | 230 | Display::display_normal_message($msg); //main API |
231 | 231 | } |
232 | 232 | ?> |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | <div id="ajax_list_courses_multiple"> |
239 | 239 | <select id="origin" name="NoAssignedCoursesList[]" multiple="multiple" size="20" style="width:340px;"> |
240 | 240 | <?php while ($enreg = Database::fetch_array($result)) { ?> |
241 | - <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'],ENT_QUOTES).'"';?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option> |
|
241 | + <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option> |
|
242 | 242 | <?php } ?> |
243 | 243 | </select> |
244 | 244 | </div> |
@@ -246,8 +246,8 @@ discard block |
||
246 | 246 | </div> |
247 | 247 | <div class="col-md-4"> |
248 | 248 | <div class="code-course"> |
249 | - <?php if($add_type == 'multiple') { ?> |
|
250 | - <p><?php echo get_lang('FirstLetterCourse');?> :</p> |
|
249 | + <?php if ($add_type == 'multiple') { ?> |
|
250 | + <p><?php echo get_lang('FirstLetterCourse'); ?> :</p> |
|
251 | 251 | <select name="firstLetterCourse" class="selectpicker form-control" onchange = "xajax_search_courses(this.value,'multiple')"> |
252 | 252 | <option value="%">--</option> |
253 | 253 | <?php echo Display :: get_alphabet_options($firstLetter); ?> |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | if (is_array($assigned_courses_to_hrm)) { |
287 | 287 | foreach ($assigned_courses_to_hrm as $enreg) { |
288 | 288 | ?> |
289 | - <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="' . htmlspecialchars($enreg['title'], ENT_QUOTES) . '"'; ?>><?php echo $enreg['title'] . ' (' . $enreg['code'] . ')'; ?></option> |
|
289 | + <option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'], ENT_QUOTES).'"'; ?>><?php echo $enreg['title'].' ('.$enreg['code'].')'; ?></option> |
|
290 | 290 | <?php |
291 | 291 | } |
292 | 292 | } |