@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $cidReset = true; |
14 | 14 | |
15 | 15 | require_once __DIR__.'/../inc/global.inc.php'; |
16 | -require_once api_get_path(SYS_CODE_PATH) . 'work/work.lib.php'; |
|
16 | +require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php'; |
|
17 | 17 | |
18 | 18 | if (!api_is_platform_admin(true) && !api_is_teacher()) { |
19 | 19 | api_not_allowed(true); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | foreach ($sessionCourses as $sessionCourse) { |
50 | 50 | $course = $sessionCourse->getCourse(); |
51 | - $coursesInfo[$course->getId()] = $course->getCode(); |
|
51 | + $coursesInfo[$course->getId()] = $course->getCode(); |
|
52 | 52 | $criteria = Criteria::create()->where( |
53 | 53 | Criteria::expr()->eq("status", Session::COACH) |
54 | 54 | ); |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | ]; |
72 | 72 | } |
73 | 73 | |
74 | - $usersInfo[$user->getId()][$course->getId() . '_number_of_students'] = null; |
|
75 | - $usersInfo[$user->getId()][$course->getId() . '_number_of_works'] = null; |
|
76 | - $usersInfo[$user->getId()][$course->getId() . '_last_work'] = null; |
|
77 | - $usersInfo[$user->getId()][$course->getId() . '_time_spent_of_course'] = null; |
|
74 | + $usersInfo[$user->getId()][$course->getId().'_number_of_students'] = null; |
|
75 | + $usersInfo[$user->getId()][$course->getId().'_number_of_works'] = null; |
|
76 | + $usersInfo[$user->getId()][$course->getId().'_last_work'] = null; |
|
77 | + $usersInfo[$user->getId()][$course->getId().'_time_spent_of_course'] = null; |
|
78 | 78 | |
79 | 79 | if (!$session->hasCoachInCourseWithStatus($user, $course)) { |
80 | 80 | continue; |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $studentPubRepo = $em->getRepository('ChamiloCourseBundle:CStudentPublication'); |
85 | 85 | $works = $studentPubRepo->findWorksByTeacher($user, $course, $session); |
86 | 86 | |
87 | - $usersInfo[$user->getId()][$course->getId() . '_number_of_students'] = $sessionCourse->getNbrUsers(); |
|
88 | - $usersInfo[$user->getId()][$course->getId() . '_number_of_works'] = count($works); |
|
89 | - $usersInfo[$user->getId()][$course->getId() . '_time_spent_of_course'] = api_time_to_hms( |
|
87 | + $usersInfo[$user->getId()][$course->getId().'_number_of_students'] = $sessionCourse->getNbrUsers(); |
|
88 | + $usersInfo[$user->getId()][$course->getId().'_number_of_works'] = count($works); |
|
89 | + $usersInfo[$user->getId()][$course->getId().'_time_spent_of_course'] = api_time_to_hms( |
|
90 | 90 | Tracking::get_time_spent_on_the_course($user->getId(), $course->getId(), $session->getId()) |
91 | 91 | ); |
92 | 92 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | $lastFormattedDate = api_format_date($lastWork->getSentDate()->getTimestamp(), DATE_TIME_FORMAT_SHORT); |
100 | 100 | |
101 | - $usersInfo[$user->getId()][$course->getId() . '_last_work'] = api_format_date( |
|
101 | + $usersInfo[$user->getId()][$course->getId().'_last_work'] = api_format_date( |
|
102 | 102 | $lastWork->getSentDate()->getTimestamp(), |
103 | 103 | DATE_TIME_FORMAT_SHORT |
104 | 104 | ); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | } |
108 | 108 | |
109 | 109 | if (isset($_GET['export']) && $session && ($coursesInfo && $usersInfo)) { |
110 | - $fileName = get_lang('TeacherTimeReport') . ' ' . api_get_local_time(); |
|
110 | + $fileName = get_lang('TeacherTimeReport').' '.api_get_local_time(); |
|
111 | 111 | |
112 | 112 | $dataToExport = []; |
113 | 113 | $dataToExport[] = [$toolName, $session->getName()]; |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | } |
169 | 169 | |
170 | 170 | $this_section = SECTION_PLATFORM_ADMIN; |
171 | -$interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH) . 'mySpace/', 'name' => get_lang('Reporting')]; |
|
171 | +$interbreadcrumb[] = ['url' => api_get_path(WEB_CODE_PATH).'mySpace/', 'name' => get_lang('Reporting')]; |
|
172 | 172 | $interbreadcrumb[] = [ |
173 | - 'url' => api_get_path(WEB_CODE_PATH) . 'mySpace/session.php', |
|
173 | + 'url' => api_get_path(WEB_CODE_PATH).'mySpace/session.php', |
|
174 | 174 | 'name' => get_lang('FollowedSessions') |
175 | 175 | ]; |
176 | 176 | |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | $actions = [ |
181 | 181 | Display::url( |
182 | 182 | Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), [], ICON_SIZE_MEDIUM), |
183 | - api_get_self() . '?' . http_build_query(['export' => 'csv', 'session' => $session->getId()]) |
|
183 | + api_get_self().'?'.http_build_query(['export' => 'csv', 'session' => $session->getId()]) |
|
184 | 184 | ), |
185 | 185 | Display::url( |
186 | 186 | Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), [], ICON_SIZE_MEDIUM), |
187 | - api_get_self() . '?' . http_build_query(['export' => 'xls', 'session' => $session->getId()]) |
|
187 | + api_get_self().'?'.http_build_query(['export' => 'xls', 'session' => $session->getId()]) |
|
188 | 188 | ) |
189 | 189 | ]; |
190 | 190 | } |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | require_once __DIR__.'/../inc/global.inc.php'; |
11 | 11 | $this_section = SECTION_PLATFORM_ADMIN; |
12 | 12 | api_protect_admin_script(); |
13 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
13 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
14 | 14 | $tool_name = get_lang('TermsAndConditions'); |
15 | 15 | Display :: display_header($tool_name); |
16 | 16 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | // action menu |
20 | 20 | echo '<div class="actions">'; |
21 | 21 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'admin/legal_add.php">'. |
22 | - Display::return_icon('edit.gif',get_lang('EditTermsAndConditions'), '').get_lang('EditTermsAndConditions').'</a> '; |
|
22 | + Display::return_icon('edit.gif', get_lang('EditTermsAndConditions'), '').get_lang('EditTermsAndConditions').'</a> '; |
|
23 | 23 | echo '</div>'; |
24 | 24 | |
25 | 25 | $legal_count = LegalManager::count(); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
21 | 21 | |
22 | 22 | // setting breadcrumbs |
23 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
24 | 24 | |
25 | 25 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
26 | 26 | |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | $token = Security::get_token(); |
29 | 29 | |
30 | 30 | if ($action === 'add') { |
31 | - $interbreadcrumb[]=array('url' => 'grade_models.php','name' => get_lang('GradeModel')); |
|
32 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add')); |
|
31 | + $interbreadcrumb[] = array('url' => 'grade_models.php', 'name' => get_lang('GradeModel')); |
|
32 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add')); |
|
33 | 33 | } elseif ($action == 'edit') { |
34 | - $interbreadcrumb[]=array('url' => 'grade_models.php','name' => get_lang('GradeModel')); |
|
35 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit')); |
|
34 | + $interbreadcrumb[] = array('url' => 'grade_models.php', 'name' => get_lang('GradeModel')); |
|
35 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); |
|
36 | 36 | } else { |
37 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('GradeModel')); |
|
37 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradeModel')); |
|
38 | 38 | } |
39 | 39 | |
40 | -$htmlHeadXtra[]= '<script> |
|
40 | +$htmlHeadXtra[] = '<script> |
|
41 | 41 | function plusItem(item) { |
42 | 42 | if (item != 1) { |
43 | 43 | document.getElementById(item).style.display = "inline"; |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | |
112 | 112 | //With this function we can add actions to the jgrid (edit, delete, etc) |
113 | 113 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
114 | - return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
|
115 | - ' <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>'. |
|
114 | + return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'. |
|
115 | + ' <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>'. |
|
116 | 116 | '\'; |
117 | 117 | }'; |
118 | 118 | ?> |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $obj->display(); |
158 | 158 | } else { |
159 | 159 | echo '<div class="actions">'; |
160 | - echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
160 | + echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
161 | 161 | echo '</div>'; |
162 | 162 | $form->addElement('hidden', 'sec_token'); |
163 | 163 | $form->setConstants(array('sec_token' => $token)); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $obj->display(); |
180 | 180 | } else { |
181 | 181 | echo '<div class="actions">'; |
182 | - echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
182 | + echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
183 | 183 | echo '</div>'; |
184 | 184 | $form->addElement('hidden', 'sec_token'); |
185 | 185 | $form->setConstants(array('sec_token' => $token)); |
@@ -5,13 +5,13 @@ |
||
5 | 5 | * @package chamilo.admin |
6 | 6 | */ |
7 | 7 | |
8 | -$cidReset=true; |
|
8 | +$cidReset = true; |
|
9 | 9 | require_once __DIR__.'/../inc/global.inc.php'; |
10 | 10 | $this_section = SECTION_PLATFORM_ADMIN; |
11 | 11 | |
12 | 12 | api_protect_admin_script(); |
13 | 13 | |
14 | -$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
|
14 | +$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
15 | 15 | $tool_name = get_lang('Statistics'); |
16 | 16 | Display::display_header($tool_name); |
17 | 17 | Display::display_footer(); |
@@ -8,47 +8,47 @@ discard block |
||
8 | 8 | */ |
9 | 9 | exit(); //not yet functional, needs to be revised |
10 | 10 | |
11 | -$cidReset=true; |
|
11 | +$cidReset = true; |
|
12 | 12 | |
13 | 13 | require_once __DIR__.'/../inc/global.inc.php'; |
14 | 14 | $libpath = api_get_path(LIBRARY_PATH); |
15 | 15 | require_once('../auth/ldap/authldap.php'); |
16 | -$annee_base=date('Y'); |
|
16 | +$annee_base = date('Y'); |
|
17 | 17 | // setting the section (for the tabs) |
18 | 18 | $this_section = SECTION_PLATFORM_ADMIN; |
19 | 19 | //api_protect_admin_script(); // on vire la secu... qui n'a pas lieu d'etre ici (script de synchro) |
20 | 20 | |
21 | 21 | // setting breadcrumbs |
22 | -$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
|
23 | -$interbreadcrumb[]=array('url' => api_get_self(),"name" => "Liste des sessions"); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => api_get_self(), "name" => "Liste des sessions"); |
|
24 | 24 | |
25 | 25 | // Database Table Definitions |
26 | 26 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
27 | -$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS); |
|
28 | -$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
29 | -$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
30 | -$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
31 | -$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
32 | -$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
33 | -$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS); |
|
34 | -$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER); |
|
27 | +$tbl_session_rel_class = Database::get_main_table(TABLE_MAIN_SESSION_CLASS); |
|
28 | +$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
29 | +$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
30 | +$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
|
31 | +$tbl_user = Database::get_main_table(TABLE_MAIN_USER); |
|
32 | +$tbl_session_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_USER); |
|
33 | +$tbl_class = Database::get_main_table(TABLE_MAIN_CLASS); |
|
34 | +$tbl_class_user = Database::get_main_table(TABLE_MAIN_CLASS_USER); |
|
35 | 35 | |
36 | -$tbl_session_rel_etape = "session_rel_etape"; |
|
36 | +$tbl_session_rel_etape = "session_rel_etape"; |
|
37 | 37 | |
38 | -$message=""; |
|
38 | +$message = ""; |
|
39 | 39 | |
40 | -$result=Database::query("SELECT id, name FROM $tbl_session"); |
|
41 | -$Sessions=Database::store_result($result); |
|
40 | +$result = Database::query("SELECT id, name FROM $tbl_session"); |
|
41 | +$Sessions = Database::store_result($result); |
|
42 | 42 | |
43 | -$result=Database::query($sql); |
|
44 | -$users=Database::store_result($result); |
|
43 | +$result = Database::query($sql); |
|
44 | +$users = Database::store_result($result); |
|
45 | 45 | |
46 | -foreach($Sessions as $session){ |
|
46 | +foreach ($Sessions as $session) { |
|
47 | 47 | $id_session = $session['id']; |
48 | 48 | $name_session = $session['name']; |
49 | - $UserList=array(); |
|
50 | - $UserUpdate=array(); |
|
51 | - $UserAdd=array(); |
|
49 | + $UserList = array(); |
|
50 | + $UserUpdate = array(); |
|
51 | + $UserAdd = array(); |
|
52 | 52 | |
53 | 53 | // Parse des code etape de la session |
54 | 54 | /* |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | { |
66 | 66 | $r = false; |
67 | 67 | $res = ldap_handle_bind($ds, $r); |
68 | - $UserList=array(); |
|
69 | - if($result !== false) |
|
68 | + $UserList = array(); |
|
69 | + if ($result !== false) |
|
70 | 70 | { |
71 | 71 | //while($row = Database::fetch_array($result)) |
72 | 72 | //{ |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | //$sr = @ ldap_search($ds, "ou=people,$LDAPbasedn", "edupersonorgunitdn=ou=$etape,ou=$annee,ou=diploma,$LDAPbasedn"); |
82 | 82 | $sr = @ ldap_search($ds, $ldap_basedn, '(uid=*)'); |
83 | 83 | $info = ldap_get_entries($ds, $sr); |
84 | - for ($key = 0; $key < $info["count"]; $key ++) |
|
84 | + for ($key = 0; $key < $info["count"]; $key++) |
|
85 | 85 | { |
86 | 86 | echo "<pre>"; |
87 | 87 | print_r($info[$key]); |
@@ -90,28 +90,28 @@ discard block |
||
90 | 90 | $firstname = api_utf8_decode($info[$key]["givenname"][0]); |
91 | 91 | $email = $info[$key]["mail"][0]; |
92 | 92 | // Get uid from dn |
93 | - $dn_array=ldap_explode_dn($info[$key]["dn"],1); |
|
93 | + $dn_array = ldap_explode_dn($info[$key]["dn"], 1); |
|
94 | 94 | $username = $dn_array[0]; // uid is first key |
95 | 95 | $outab[] = $info[$key]["edupersonprimaryaffiliation"][0]; // Ici "student" |
96 | 96 | $val = ldap_get_values_len($ds, $sr, "userPassword"); |
97 | 97 | $password = $val[0]; |
98 | 98 | // Pour faciliter la gestion on ajoute le code "etape-annee" |
99 | - $official_code=$etape."-".$annee; |
|
100 | - $auth_source="ldap"; |
|
99 | + $official_code = $etape."-".$annee; |
|
100 | + $auth_source = "ldap"; |
|
101 | 101 | // Pas de date d'expiration d'etudiant (a recuperer par rapport au shadow expire LDAP) |
102 | - $expiration_date=''; |
|
103 | - $active=1; |
|
102 | + $expiration_date = ''; |
|
103 | + $active = 1; |
|
104 | 104 | // Ajout de l'utilisateur |
105 | 105 | if (UserManager::is_username_available($username)) { |
106 | - $user_id = UserManager::create_user($firstname,$lastname,$status,$email,$username,$password,$official_code,api_get_setting('platformLanguage'),$phone,$picture_uri,$auth_source,$expiration_date,$active); |
|
107 | - $UserAdd[]=$user_id; |
|
106 | + $user_id = UserManager::create_user($firstname, $lastname, $status, $email, $username, $password, $official_code, api_get_setting('platformLanguage'), $phone, $picture_uri, $auth_source, $expiration_date, $active); |
|
107 | + $UserAdd[] = $user_id; |
|
108 | 108 | } else { |
109 | 109 | $user = api_get_user_info_from_username($username); |
110 | - $user_id=$user['user_id']; |
|
110 | + $user_id = $user['user_id']; |
|
111 | 111 | UserManager::update_user($user_id, $firstname, $lastname, $username, null, null, $email, $status, $official_code, $phone, $picture_uri, $expiration_date, $active); |
112 | - $UserUpdate[]=$user_id; |
|
112 | + $UserUpdate[] = $user_id; |
|
113 | 113 | } |
114 | - $UserList[]=$user_id; |
|
114 | + $UserList[] = $user_id; |
|
115 | 115 | } |
116 | 116 | //} |
117 | 117 | } |
@@ -125,10 +125,10 @@ discard block |
||
125 | 125 | } |
126 | 126 | |
127 | 127 | // Une fois les utilisateurs importer dans la base des utilisateurs, on peux les affecter la session |
128 | - $result=Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'"); |
|
129 | - $CourseList=array(); |
|
130 | - while($row=Database::fetch_array($result)) { |
|
131 | - $CourseList[]= $row['c_id']; |
|
128 | + $result = Database::query("SELECT c_id FROM $tbl_session_rel_course WHERE session_id='$id_session'"); |
|
129 | + $CourseList = array(); |
|
130 | + while ($row = Database::fetch_array($result)) { |
|
131 | + $CourseList[] = $row['c_id']; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | foreach ($CourseList as $enreg_course) { |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | VALUES('$id_session','$enreg_course','$enreg_user')"; |
139 | 139 | Database::query($sql); |
140 | 140 | } |
141 | - $sql = "SELECT COUNT(user_id) as nbUsers " . |
|
142 | - "FROM $tbl_session_rel_course_rel_user " . |
|
141 | + $sql = "SELECT COUNT(user_id) as nbUsers ". |
|
142 | + "FROM $tbl_session_rel_course_rel_user ". |
|
143 | 143 | "WHERE session_id='$id_session' AND c_id='$enreg_course'"; |
144 | 144 | $rs = Database::query($sql); |
145 | 145 | list($nbr_users) = Database::fetch_array($rs); |
@@ -148,13 +148,13 @@ discard block |
||
148 | 148 | Database::query($sql); |
149 | 149 | } |
150 | 150 | // On ajoute la relation entre l'utilisateur et la session |
151 | - foreach($UserList as $enreg_user){ |
|
152 | - $sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) " . |
|
153 | - "VALUES('$id_session','$enreg_user', '" . api_get_utc_datetime() . "')"; |
|
151 | + foreach ($UserList as $enreg_user) { |
|
152 | + $sql = "INSERT IGNORE INTO $tbl_session_rel_user(session_id, user_id, registered_at) ". |
|
153 | + "VALUES('$id_session','$enreg_user', '".api_get_utc_datetime()."')"; |
|
154 | 154 | Database::query($sql); |
155 | 155 | } |
156 | - $sql = "SELECT COUNT(user_id) as nbUsers " . |
|
157 | - "FROM $tbl_session_rel_user " . |
|
156 | + $sql = "SELECT COUNT(user_id) as nbUsers ". |
|
157 | + "FROM $tbl_session_rel_user ". |
|
158 | 158 | "WHERE session_id='$id_session' AND relation_type<>".SESSION_RELATION_TYPE_RRHH.""; |
159 | 159 | $rs = Database::query($sql); |
160 | 160 | list($nbr_users) = Database::fetch_array($rs); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | exit(); |
41 | 41 | } |
42 | 42 | |
43 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
43 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
44 | 44 | |
45 | 45 | if (isset($_GET['search']) && $_GET['search'] == 'advanced') { |
46 | 46 | $interbreadcrumb[] = array("url" => 'session_category_list.php', "name" => get_lang('ListSessionCategory')); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | $where .= " AND access_url_id = ".api_get_current_access_url_id()." "; |
74 | 74 | } |
75 | 75 | |
76 | - $table_access_url_rel_session= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
76 | + $table_access_url_rel_session = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_SESSION); |
|
77 | 77 | $query = "SELECT sc.*, ( |
78 | 78 | SELECT count(id) FROM $tbl_session s |
79 | 79 | INNER JOIN $table_access_url_rel_session us |
@@ -13,12 +13,12 @@ |
||
13 | 13 | $this_section = SECTION_PLATFORM_ADMIN; |
14 | 14 | |
15 | 15 | // setting breadcrumbs |
16 | -$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList')); |
|
16 | +$interbreadcrumb[] = array('url' => 'session_list.php', 'name' => get_lang('SessionList')); |
|
17 | 17 | |
18 | 18 | // Setting the name of the tool |
19 | 19 | $tool_name = get_lang('SubscribeStudentsToSession'); |
20 | 20 | $add_type = 'multiple'; |
21 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') { |
|
21 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
22 | 22 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
23 | 23 | } |
24 | 24 | $form_sent = 0; |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | 'course_name', |
56 | 56 | get_lang('SearchCourse'), |
57 | 57 | null, |
58 | - array('url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?a=search_course') |
|
58 | + array('url' => api_get_path(WEB_AJAX_PATH).'course.ajax.php?a=search_course') |
|
59 | 59 | ); |
60 | 60 | |
61 | 61 | if (!empty($courseId)) { |
62 | 62 | $courseInfo = api_get_course_info_by_id($courseId); |
63 | 63 | $parents = CourseCategory::getParentsToString($courseInfo['categoryCode']); |
64 | 64 | |
65 | - $courseSelect->addOption($parents . $courseInfo['title'], $courseInfo['code'], ['selected' => 'selected']); |
|
65 | + $courseSelect->addOption($parents.$courseInfo['title'], $courseInfo['code'], ['selected' => 'selected']); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $url = api_get_self(); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | // height auto |
115 | 115 | $extra_params['height'] = 'auto'; |
116 | 116 | |
117 | -$extra_params['postData'] =array( |
|
117 | +$extra_params['postData'] = array( |
|
118 | 118 | 'filters' => array( |
119 | 119 | "groupOp" => "AND", |
120 | 120 | "rules" => $result['rules'], |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | |
129 | 129 | //With this function we can add actions to the jgrid (edit, delete, etc) |
130 | 130 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
131 | - return \'<a href="session_edit.php?page=resume_session.php&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
|
132 | - ' <a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png',get_lang('SubscribeUsersToSession'),'',ICON_SIZE_SMALL).'</a>'. |
|
133 | - ' <a href="add_courses_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('courses_to_session.png',get_lang('SubscribeCoursesToSession'),'',ICON_SIZE_SMALL).'</a>'. |
|
134 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="session_list.php?action=copy&idChecked=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'. |
|
135 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="session_list.php?action=delete&idChecked=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
131 | + return \'<a href="session_edit.php?page=resume_session.php&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'. |
|
132 | + ' <a href="add_users_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('user_subscribe_session.png', get_lang('SubscribeUsersToSession'), '', ICON_SIZE_SMALL).'</a>'. |
|
133 | + ' <a href="add_courses_to_session.php?page=session_list.php&id_session=\'+options.rowId+\'">'.Display::return_icon('courses_to_session.png', get_lang('SubscribeCoursesToSession'), '', ICON_SIZE_SMALL).'</a>'. |
|
134 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="session_list.php?action=copy&idChecked=\'+options.rowId+\'">'.Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL).'</a>'. |
|
135 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="session_list.php?action=delete&idChecked=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'. |
|
136 | 136 | '\'; |
137 | 137 | }'; |
138 | 138 | |
@@ -301,18 +301,18 @@ discard block |
||
301 | 301 | <?php |
302 | 302 | |
303 | 303 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_add.php">'. |
304 | - Display::return_icon('new_session.png',get_lang('AddSession'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
304 | + Display::return_icon('new_session.png', get_lang('AddSession'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
305 | 305 | if (api_is_platform_admin()) { |
306 | 306 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/add_many_session_to_category.php">'. |
307 | - Display::return_icon('session_to_category.png',get_lang('AddSessionsInCategories'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
307 | + Display::return_icon('session_to_category.png', get_lang('AddSessionsInCategories'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
308 | 308 | echo '<a href="'.api_get_path(WEB_CODE_PATH).'session/session_category_list.php">'. |
309 | - Display::return_icon('folder.png',get_lang('ListSessionCategory'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
309 | + Display::return_icon('folder.png', get_lang('ListSessionCategory'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | if ($list_type == 'complete') { |
313 | - echo '<a href="'.api_get_self().'?list_type=simple">'.Display::return_icon('view_remove.png',get_lang('Simple'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
313 | + echo '<a href="'.api_get_self().'?list_type=simple">'.Display::return_icon('view_remove.png', get_lang('Simple'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
314 | 314 | } else { |
315 | - echo '<a href="'.api_get_self().'?list_type=complete">'.Display::return_icon('view_text.png',get_lang('Complete'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
315 | + echo '<a href="'.api_get_self().'?list_type=complete">'.Display::return_icon('view_text.png', get_lang('Complete'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | echo $actions; |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | require_once __DIR__.'/../inc/global.inc.php'; |
9 | 9 | |
10 | 10 | // setting the section (for the tabs) |
11 | -$this_section=SECTION_PLATFORM_ADMIN; |
|
11 | +$this_section = SECTION_PLATFORM_ADMIN; |
|
12 | 12 | |
13 | 13 | $id_session = intval($_GET['id_session']); |
14 | 14 | SessionManager::protectSession($id_session); |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | // Database Table Definitions |
17 | 17 | $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); |
18 | 18 | $tbl_session = Database::get_main_table(TABLE_MAIN_SESSION); |
19 | -$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
20 | -$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
19 | +$tbl_session_rel_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE); |
|
20 | +$tbl_session_rel_course_rel_user = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); |
|
21 | 21 | |
22 | 22 | if (empty($id_session)) { |
23 | 23 | api_not_allowed(); |
@@ -25,26 +25,26 @@ discard block |
||
25 | 25 | |
26 | 26 | $page = intval($_GET['page']); |
27 | 27 | $action = $_REQUEST['action']; |
28 | -$sort = in_array($_GET['sort'],array('title','nbr_users'))?$_GET['sort']:'title'; |
|
28 | +$sort = in_array($_GET['sort'], array('title', 'nbr_users')) ? $_GET['sort'] : 'title'; |
|
29 | 29 | |
30 | 30 | $result = Database::query("SELECT name FROM $tbl_session WHERE id='$id_session'"); |
31 | 31 | |
32 | -if (!list($session_name)=Database::fetch_row($result)) { |
|
32 | +if (!list($session_name) = Database::fetch_row($result)) { |
|
33 | 33 | header('Location: session_list.php'); |
34 | 34 | exit; |
35 | 35 | } |
36 | 36 | |
37 | 37 | if ($action == 'delete') { |
38 | 38 | $idChecked = $_REQUEST['idChecked']; |
39 | - if (is_array($idChecked) && count($idChecked)>0) { |
|
39 | + if (is_array($idChecked) && count($idChecked) > 0) { |
|
40 | 40 | $my_temp = array(); |
41 | - foreach ($idChecked as $id){ |
|
42 | - $my_temp[]= Database::escape_string($id);// forcing the escape_string |
|
41 | + foreach ($idChecked as $id) { |
|
42 | + $my_temp[] = Database::escape_string($id); // forcing the escape_string |
|
43 | 43 | } |
44 | 44 | $idChecked = $my_temp; |
45 | - $idChecked="'".implode("','", $idChecked)."'"; |
|
45 | + $idChecked = "'".implode("','", $idChecked)."'"; |
|
46 | 46 | $result = Database::query("DELETE FROM $tbl_session_rel_course WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
47 | - $nbr_affected_rows=Database::affected_rows($result); |
|
47 | + $nbr_affected_rows = Database::affected_rows($result); |
|
48 | 48 | Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE session_id='$id_session' AND c_id IN($idChecked)"); |
49 | 49 | Database::query("UPDATE $tbl_session SET nbr_courses=nbr_courses-$nbr_affected_rows WHERE id='$id_session'"); |
50 | 50 | } |
@@ -59,14 +59,14 @@ discard block |
||
59 | 59 | FROM $tbl_session_rel_course, $tbl_course c |
60 | 60 | WHERE c_id = c.id AND session_id='$id_session' |
61 | 61 | ORDER BY $sort |
62 | - LIMIT $from,".($limit+1); |
|
63 | -$result=Database::query($sql); |
|
64 | -$Courses=Database::store_result($result); |
|
65 | -$tool_name = api_htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession'); |
|
62 | + LIMIT $from,".($limit + 1); |
|
63 | +$result = Database::query($sql); |
|
64 | +$Courses = Database::store_result($result); |
|
65 | +$tool_name = api_htmlentities($session_name, ENT_QUOTES, $charset).' : '.get_lang('CourseListInSession'); |
|
66 | 66 | |
67 | 67 | //$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin')); |
68 | -$interbreadcrumb[] = array('url' => "session_list.php","name" => get_lang('SessionList')); |
|
69 | -$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']),"name" => get_lang('SessionOverview')); |
|
68 | +$interbreadcrumb[] = array('url' => "session_list.php", "name" => get_lang('SessionList')); |
|
69 | +$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']), "name" => get_lang('SessionOverview')); |
|
70 | 70 | |
71 | 71 | Display::display_header($tool_name); |
72 | 72 | echo Display::page_header($tool_name); |
@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | foreach ($Courses as $key=>$enreg) { |
85 | 85 | $course = array(); |
86 | 86 | $course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['id'].'">'; |
87 | - $course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset); |
|
87 | + $course[] = api_htmlentities($enreg['title'], ENT_QUOTES, $charset); |
|
88 | 88 | $course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>'; |
89 | 89 | $course[] = '<a href="'.api_get_path(WEB_COURSE_PATH).$enreg['code'].'/?id_session='.$id_session.'">'. |
90 | 90 | Display::return_icon('course_home.gif', get_lang('Course')).'</a> |
91 | 91 | <a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'. |
92 | 92 | Display::return_icon('edit.png', get_lang('Edit')).'</a> |
93 | - <a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'. |
|
93 | + <a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset)).'\')) return false;">'. |
|
94 | 94 | Display::return_icon('delete.png', get_lang('Delete')).'</a>'; |
95 | 95 | $tableCourses[] = $course; |
96 | 96 | } |
97 | 97 | echo '<form method="post" action="'.api_get_self().'">'; |
98 | -Display :: display_sortable_table($tableHeader, $tableCourses, array (), array ()); |
|
98 | +Display :: display_sortable_table($tableHeader, $tableCourses, array(), array()); |
|
99 | 99 | echo '<select name="action"> |
100 | 100 | <option value="delete">'.get_lang('UnsubscribeCoursesFromSession').'</option> |
101 | 101 | </select> |