@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | */ |
32 | 32 | |
33 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
33 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
34 | 34 | $tool_name = get_lang('SearchLDAPUsers'); |
35 | 35 | //Display :: display_header($tool_name); //cannot display now as we need to redirect |
36 | 36 | //api_display_tool_title($tool_name); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | if (isset ($_GET['action'])) |
39 | 39 | { |
40 | 40 | $check = Security::check_token('get'); |
41 | - if($check) |
|
41 | + if ($check) |
|
42 | 42 | { |
43 | 43 | switch ($_GET['action']) |
44 | 44 | { |
@@ -59,41 +59,41 @@ discard block |
||
59 | 59 | break; |
60 | 60 | case 'lock' : |
61 | 61 | Display :: display_header($tool_name); |
62 | - $message=lock_unlock_user('lock',$_GET['user_id']); |
|
62 | + $message = lock_unlock_user('lock', $_GET['user_id']); |
|
63 | 63 | Display :: display_normal_message($message); |
64 | 64 | break; |
65 | 65 | case 'unlock'; |
66 | 66 | Display :: display_header($tool_name); |
67 | - $message=lock_unlock_user('unlock',$_GET['user_id']); |
|
67 | + $message = lock_unlock_user('unlock', $_GET['user_id']); |
|
68 | 68 | Display :: display_normal_message($message); |
69 | 69 | break; |
70 | 70 | case 'add_user'; |
71 | - $id=$_GET['id']; |
|
72 | - $UserList=array(); |
|
71 | + $id = $_GET['id']; |
|
72 | + $UserList = array(); |
|
73 | 73 | $userid_match_login = array(); |
74 | 74 | foreach ($id as $user_id) { |
75 | 75 | $tmp = ldap_add_user($user_id); |
76 | - $UserList[]= $tmp; |
|
76 | + $UserList[] = $tmp; |
|
77 | 77 | $userid_match_login[$tmp] = $user_id; |
78 | 78 | } |
79 | - if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session']>0)) { |
|
79 | + if (isset($_GET['id_session']) && ($_GET['id_session'] == strval(intval($_GET['id_session']))) && ($_GET['id_session'] > 0)) { |
|
80 | 80 | ldap_add_user_to_session($UserList, $_GET['id_session']); |
81 | 81 | header('Location: resume_session.php?id_session='.intval($_GET['id_session'])); |
82 | 82 | } else { |
83 | 83 | Display :: display_header($tool_name); |
84 | - if(count($userid_match_login)>0) |
|
84 | + if (count($userid_match_login) > 0) |
|
85 | 85 | { |
86 | - $message=get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | - foreach($userid_match_login as $user_id => $login) |
|
86 | + $message = get_lang('LDAPUsersAddedOrUpdated').':<br />'; |
|
87 | + foreach ($userid_match_login as $user_id => $login) |
|
88 | 88 | { |
89 | 89 | $message .= '- '.$login.'<br />'; |
90 | 90 | } |
91 | 91 | } |
92 | 92 | else |
93 | 93 | { |
94 | - $message=get_lang('NoUserAdded'); |
|
94 | + $message = get_lang('NoUserAdded'); |
|
95 | 95 | } |
96 | - Display :: display_normal_message($message,false); |
|
96 | + Display :: display_normal_message($message, false); |
|
97 | 97 | } |
98 | 98 | break; |
99 | 99 | default : |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if (isset ($_POST['action'])) |
114 | 114 | { |
115 | 115 | $check = Security::check_token('get'); |
116 | - if($check) |
|
116 | + if ($check) |
|
117 | 117 | { |
118 | 118 | switch ($_POST['action']) |
119 | 119 | { |
@@ -122,15 +122,15 @@ discard block |
||
122 | 122 | $number_of_deleted_users = 0; |
123 | 123 | foreach ($_POST['id'] as $index => $user_id) |
124 | 124 | { |
125 | - if($user_id != $_user['user_id']) |
|
125 | + if ($user_id != $_user['user_id']) |
|
126 | 126 | { |
127 | - if(UserManager :: delete_user($user_id)) |
|
127 | + if (UserManager :: delete_user($user_id)) |
|
128 | 128 | { |
129 | 129 | $number_of_deleted_users++; |
130 | 130 | } |
131 | 131 | } |
132 | 132 | } |
133 | - if($number_of_selected_users == $number_of_deleted_users) |
|
133 | + if ($number_of_selected_users == $number_of_deleted_users) |
|
134 | 134 | { |
135 | 135 | Display :: display_normal_message(get_lang('SelectedUsersDeleted')); |
136 | 136 | } |
@@ -142,17 +142,17 @@ discard block |
||
142 | 142 | case 'add_user' : |
143 | 143 | $number_of_selected_users = count($_POST['id']); |
144 | 144 | $number_of_added_users = 0; |
145 | - $UserList=array(); |
|
145 | + $UserList = array(); |
|
146 | 146 | foreach ($_POST['id'] as $index => $user_id) |
147 | 147 | { |
148 | - if($user_id != $_user['user_id']) |
|
148 | + if ($user_id != $_user['user_id']) |
|
149 | 149 | { |
150 | 150 | $UserList[] = ldap_add_user($user_id); |
151 | 151 | } |
152 | 152 | } |
153 | - if (isset($_GET['id_session']) && (trim($_GET['id_session'])!="")) |
|
153 | + if (isset($_GET['id_session']) && (trim($_GET['id_session']) != "")) |
|
154 | 154 | addUserToSession($UserList, $_GET['id_session']); |
155 | - if(count($UserList)>0) |
|
155 | + if (count($UserList) > 0) |
|
156 | 156 | { |
157 | 157 | Display :: display_normal_message(count($UserList)." ".get_lang('LDAPUsersAdded')); |
158 | 158 | } |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | } |
168 | 168 | } |
169 | 169 | |
170 | -$form = new FormValidator('advanced_search','get'); |
|
171 | -$form->addText('keyword_username',get_lang('LoginName'),false); |
|
170 | +$form = new FormValidator('advanced_search', 'get'); |
|
171 | +$form->addText('keyword_username', get_lang('LoginName'), false); |
|
172 | 172 | if (api_is_western_name_order()) |
173 | 173 | { |
174 | 174 | $form->addText('keyword_firstname', get_lang('FirstName'), false); |
@@ -176,20 +176,20 @@ discard block |
||
176 | 176 | } |
177 | 177 | else |
178 | 178 | { |
179 | - $form->addText('keyword_lastname',get_lang('LastName'),false); |
|
180 | - $form->addText('keyword_firstname',get_lang('FirstName'),false); |
|
179 | + $form->addText('keyword_lastname', get_lang('LastName'), false); |
|
180 | + $form->addText('keyword_firstname', get_lang('FirstName'), false); |
|
181 | 181 | } |
182 | 182 | if (isset($_GET['id_session'])) |
183 | - $form->addElement('hidden','id_session',$_GET['id_session']); |
|
183 | + $form->addElement('hidden', 'id_session', $_GET['id_session']); |
|
184 | 184 | |
185 | 185 | $type = array(); |
186 | 186 | $type["all"] = get_lang('All'); |
187 | -$type["employee"] = get_lang('Teacher'); |
|
187 | +$type["employee"] = get_lang('Teacher'); |
|
188 | 188 | $type["student"] = get_lang('Student'); |
189 | 189 | |
190 | -$form->addElement('select','keyword_type',get_lang('Status'),$type); |
|
190 | +$form->addElement('select', 'keyword_type', get_lang('Status'), $type); |
|
191 | 191 | // Structure a rajouer ?? |
192 | -$form->addElement('submit','submit',get_lang('Ok')); |
|
192 | +$form->addElement('submit', 'submit', get_lang('Ok')); |
|
193 | 193 | //$defaults['keyword_active'] = 1; |
194 | 194 | //$defaults['keyword_inactive'] = 1; |
195 | 195 | //$form->setDefaults($defaults); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | //$table->set_column_filter(5, 'email_filter'); |
226 | 226 | //$table->set_column_filter(5, 'active_filter'); |
227 | 227 | $table->set_column_filter(5, 'modify_filter'); |
228 | -$table->set_form_actions(array ('add_user' => get_lang('AddLDAPUsers'))); |
|
228 | +$table->set_form_actions(array('add_user' => get_lang('AddLDAPUsers'))); |
|
229 | 229 | $table->display(); |
230 | 230 | |
231 | 231 | /* |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | require_once __DIR__.'/../inc/global.inc.php'; |
11 | 11 | |
12 | 12 | $xajax = new xajax(); |
13 | -$xajax->registerFunction ('search_sessions'); |
|
13 | +$xajax->registerFunction('search_sessions'); |
|
14 | 14 | |
15 | 15 | // setting the section (for the tabs) |
16 | 16 | $this_section = SECTION_PLATFORM_ADMIN; |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | api_protect_admin_script(true); |
20 | 20 | |
21 | 21 | // setting breadcrumbs |
22 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
23 | -$interbreadcrumb[]=array('url' => 'career_dashboard.php','name' => get_lang('CareersAndPromotions')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => 'career_dashboard.php', 'name' => get_lang('CareersAndPromotions')); |
|
24 | 24 | |
25 | 25 | // Setting the name of the tool |
26 | 26 | $tool_name = get_lang('SubscribeSessionsToPromotions'); |
27 | 27 | $add_type = 'multiple'; |
28 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ |
|
28 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
29 | 29 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
30 | 30 | } |
31 | 31 | |
@@ -67,14 +67,14 @@ discard block |
||
67 | 67 | |
68 | 68 | $form_sent = 0; |
69 | 69 | $errorMsg = ''; |
70 | -$users =$sessions=array(); |
|
70 | +$users = $sessions = array(); |
|
71 | 71 | $promotion = new Promotion(); |
72 | 72 | $id = intval($_GET['id']); |
73 | 73 | if (isset($_POST['form_sent']) && $_POST['form_sent']) { |
74 | 74 | $form_sent = $_POST['form_sent']; |
75 | 75 | $session_in_promotion_posted = $_POST['session_in_promotion_name']; |
76 | 76 | if (!is_array($session_in_promotion_posted)) { |
77 | - $session_in_promotion_posted=array(); |
|
77 | + $session_in_promotion_posted = array(); |
|
78 | 78 | } |
79 | 79 | if ($form_sent == 1) { |
80 | 80 | // Added a parameter to send emails when registering a user |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $promotion_data = $promotion->get($id); |
88 | 88 | $session_list = SessionManager::get_sessions_list(array(), array('name')); |
89 | -$session_not_in_promotion = $session_in_promotion= array(); |
|
89 | +$session_not_in_promotion = $session_in_promotion = array(); |
|
90 | 90 | |
91 | 91 | if (!empty($session_list)) { |
92 | 92 | foreach ($session_list as $session) { |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | } |
123 | 123 | } |
124 | 124 | $return .= '</select>'; |
125 | - $xajax_response -> addAssign('ajax_list_multiple','innerHTML',api_utf8_encode($return)); |
|
125 | + $xajax_response -> addAssign('ajax_list_multiple', 'innerHTML', api_utf8_encode($return)); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | return $xajax_response; |
@@ -140,14 +140,14 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | echo '<div class="actions">'; |
143 | -echo '<a href="promotions.php">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
143 | +echo '<a href="promotions.php">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
144 | 144 | echo '</div>'; |
145 | 145 | ?> |
146 | 146 | |
147 | -<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
147 | +<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?id=<?php echo $id; if (!empty($_GET['add'])) echo '&add=true'; ?>" style="margin:0px;" <?php if ($ajax_search) {echo ' onsubmit="valide();"'; }?>> |
|
148 | 148 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
149 | 149 | |
150 | -if ($add_type=='multiple') { |
|
150 | +if ($add_type == 'multiple') { |
|
151 | 151 | if (is_array($extra_field_list)) { |
152 | 152 | if (is_array($new_field_list) && count($new_field_list) > 0) { |
153 | 153 | echo '<h3>'.get_lang('FilterUsers').'</h3>'; |
@@ -157,9 +157,9 @@ discard block |
||
157 | 157 | echo ' <select name="'.$varname.'">'; |
158 | 158 | echo '<option value="0">--'.get_lang('Select').'--</option>'; |
159 | 159 | foreach ($new_field['data'] as $option) { |
160 | - $checked=''; |
|
160 | + $checked = ''; |
|
161 | 161 | if (isset($_POST[$varname])) { |
162 | - if ($_POST[$varname]==$option[1]) { |
|
162 | + if ($_POST[$varname] == $option[1]) { |
|
163 | 163 | $checked = 'selected="true"'; |
164 | 164 | } |
165 | 165 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | <td align="center"><b><?php echo get_lang('SessionsInPromotion') ?> :</b></td> |
190 | 190 | </tr> |
191 | 191 | |
192 | -<?php if ($add_type=='multiple') { ?> |
|
192 | +<?php if ($add_type == 'multiple') { ?> |
|
193 | 193 | <tr> |
194 | 194 | <td align="center"> |
195 | 195 | <?php echo get_lang('FirstLetterSessions'); ?> : |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | <td align="center"> |
208 | 208 | <div id="content_source"> |
209 | 209 | <?php |
210 | - if (!($add_type=='multiple')) { |
|
210 | + if (!($add_type == 'multiple')) { |
|
211 | 211 | ?> |
212 | 212 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
213 | 213 | <div id="ajax_list_users_single"></div> |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } else { |
216 | 216 | ?> |
217 | 217 | <div id="ajax_list_multiple"> |
218 | - <?php echo Display::select('session_not_in_promotion_name',$session_not_in_promotion, '',array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_not_in_promotion','size'=>'15px'),false); ?> |
|
218 | + <?php echo Display::select('session_not_in_promotion_name', $session_not_in_promotion, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_not_in_promotion', 'size'=>'15px'), false); ?> |
|
219 | 219 | </div> |
220 | 220 | <?php |
221 | 221 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | 'session_in_promotion_name[]', |
251 | 251 | $session_in_promotion, |
252 | 252 | '', |
253 | - array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'session_in_promotion','size'=>'15px'), |
|
253 | + array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'session_in_promotion', 'size'=>'15px'), |
|
254 | 254 | false |
255 | 255 | ); |
256 | 256 | unset($sessionUsersList); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | global $_configuration; |
26 | 26 | $content = ''; |
27 | -$currentUrl = api_get_self() . "?name=$pluginName"; |
|
27 | +$currentUrl = api_get_self()."?name=$pluginName"; |
|
28 | 28 | |
29 | 29 | if (isset($pluginInfo['settings_form'])) { |
30 | 30 | /** @var FormValidator $form */ |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $value = trim($value); |
68 | 68 | api_add_setting( |
69 | 69 | $value, |
70 | - Database::escape_string($pluginName . '_' . $key), |
|
70 | + Database::escape_string($pluginName.'_'.$key), |
|
71 | 71 | $pluginName, |
72 | 72 | 'setting', |
73 | 73 | 'Plugins', |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $interbreadcrumb[] = array( |
100 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/index.php', |
|
100 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/index.php', |
|
101 | 101 | 'name' => get_lang('PlatformAdmin') |
102 | 102 | ); |
103 | 103 | $interbreadcrumb[] = array( |
104 | - 'url' => api_get_path(WEB_CODE_PATH) . 'admin/settings.php?category=Plugins', |
|
104 | + 'url' => api_get_path(WEB_CODE_PATH).'admin/settings.php?category=Plugins', |
|
105 | 105 | 'name' => get_lang('Plugins') |
106 | 106 | ); |
107 | 107 |
@@ -87,7 +87,7 @@ |
||
87 | 87 | $from = intval($from); |
88 | 88 | $number_of_items = intval($number_of_items); |
89 | 89 | $column = intval($column); |
90 | - $direction = !in_array(strtolower(trim($direction)), ['asc','desc']) ? 'asc' : $direction; |
|
90 | + $direction = !in_array(strtolower(trim($direction)), ['asc', 'desc']) ? 'asc' : $direction; |
|
91 | 91 | |
92 | 92 | $sql = "SELECT |
93 | 93 | id AS col0, |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | $action = isset($_GET['action']) ? $_GET['action'] : 'list'; |
23 | -$skillId = isset($_GET['id']) ? intval($_GET['id']): 0; |
|
23 | +$skillId = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
24 | 24 | |
25 | 25 | $entityManager = Database::getManager(); |
26 | 26 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | ); |
56 | 56 | } |
57 | 57 | |
58 | - header('Location: ' . api_get_self()); |
|
58 | + header('Location: '.api_get_self()); |
|
59 | 59 | exit; |
60 | 60 | break; |
61 | 61 | case 'disable': |
@@ -108,38 +108,38 @@ discard block |
||
108 | 108 | ); |
109 | 109 | } |
110 | 110 | |
111 | - header('Location: ' . api_get_self()); |
|
111 | + header('Location: '.api_get_self()); |
|
112 | 112 | exit; |
113 | 113 | break; |
114 | 114 | case 'list': |
115 | 115 | //no break |
116 | 116 | default: |
117 | - $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
117 | + $interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
118 | 118 | |
119 | 119 | $toolbar = Display::toolbarButton( |
120 | 120 | get_lang('CreateSkill'), |
121 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_create.php', |
|
121 | + api_get_path(WEB_CODE_PATH).'admin/skill_create.php', |
|
122 | 122 | 'plus', |
123 | 123 | 'success', |
124 | 124 | ['title' => get_lang('CreateSkill')] |
125 | 125 | ); |
126 | 126 | $toolbar .= Display::toolbarButton( |
127 | 127 | get_lang('SkillsWheel'), |
128 | - api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php', |
|
128 | + api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php', |
|
129 | 129 | 'bullseye', |
130 | 130 | 'primary', |
131 | 131 | ['title' => get_lang('CreateSkill')] |
132 | 132 | ); |
133 | 133 | $toolbar .= Display::toolbarButton( |
134 | 134 | get_lang('BadgesManagement'), |
135 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php', |
|
135 | + api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php', |
|
136 | 136 | 'shield', |
137 | 137 | 'warning', |
138 | 138 | ['title' => get_lang('BadgesManagement')] |
139 | 139 | ); |
140 | 140 | $toolbar .= Display::toolbarButton( |
141 | 141 | get_lang('ImportSkillsListCSV'), |
142 | - api_get_path(WEB_CODE_PATH) . 'admin/skills_import.php', |
|
142 | + api_get_path(WEB_CODE_PATH).'admin/skills_import.php', |
|
143 | 143 | 'arrow-up', |
144 | 144 | 'info', |
145 | 145 | ['title' => get_lang('BadgesManagement')] |
@@ -8,11 +8,11 @@ discard block |
||
8 | 8 | |
9 | 9 | $cidReset = true; |
10 | 10 | require_once __DIR__.'/../inc/global.inc.php'; |
11 | -$this_section=SECTION_PLATFORM_ADMIN; |
|
11 | +$this_section = SECTION_PLATFORM_ADMIN; |
|
12 | 12 | |
13 | 13 | api_protect_admin_script(); |
14 | 14 | |
15 | -$interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
15 | +$interbreadcrumb[] = array("url" => 'index.php', "name" => get_lang('PlatformAdmin')); |
|
16 | 16 | $debug = 0; |
17 | 17 | |
18 | 18 | function compare_data($result_message) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | if (is_array($data)) { |
32 | 32 | foreach ($data as $id => $item) { |
33 | 33 | |
34 | - if ($table == 'TRACK_E_EXERCISES' || $table == 'TRACK_E_EXERCISES_IN_LP' ) { |
|
34 | + if ($table == 'TRACK_E_EXERCISES' || $table == 'TRACK_E_EXERCISES_IN_LP') { |
|
35 | 35 | echo "<br /><h3>".get_lang('Attempt')." #$id</h3>"; |
36 | 36 | echo '<h3>'; |
37 | 37 | echo get_lang('Exercise').' #'.$item['exe_exo_id']; |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | echo '</h3>'; |
43 | 43 | } |
44 | 44 | //Process data |
45 | - $array = array('exe_date' =>get_lang('Date'), 'exe_result' =>get_lang('Score'),'exe_weighting'=>get_lang('Weighting')); |
|
46 | - foreach($item as $key=> $value) { |
|
47 | - if (in_array($key,array_keys($array))) { |
|
45 | + $array = array('exe_date' =>get_lang('Date'), 'exe_result' =>get_lang('Score'), 'exe_weighting'=>get_lang('Weighting')); |
|
46 | + foreach ($item as $key=> $value) { |
|
47 | + if (in_array($key, array_keys($array))) { |
|
48 | 48 | $key = $array[$key]; |
49 | 49 | echo "$key = $value <br />"; |
50 | 50 | } |
51 | 51 | } |
52 | - } else { |
|
52 | + } else { |
|
53 | 53 | echo "<br /><h3>".get_lang('Id')." #$id</h3>"; |
54 | 54 | //process data |
55 | - foreach($item as $key=> $value) { |
|
55 | + foreach ($item as $key=> $value) { |
|
56 | 56 | echo "$key = $value <br />"; |
57 | 57 | } |
58 | 58 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $session = $em->find('ChamiloCoreBundle:Session', $new_session_id); |
78 | 78 | |
79 | 79 | //if (!isset($_REQUEST['view_stat'])) { |
80 | - if ($origin_session_id == $new_session_id ) { |
|
80 | + if ($origin_session_id == $new_session_id) { |
|
81 | 81 | echo get_lang('CantMoveToTheSameSession'); |
82 | 82 | exit; |
83 | 83 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $result_message_compare = array(); |
98 | 98 | |
99 | 99 | $update_database = true; |
100 | - if (isset($_REQUEST['view_stat']) && $_REQUEST['view_stat'] == 1 ) { |
|
100 | + if (isset($_REQUEST['view_stat']) && $_REQUEST['view_stat'] == 1) { |
|
101 | 101 | $update_database = false; |
102 | 102 | } |
103 | 103 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if (empty($result) || !in_array($user_id, array_keys($result))) { |
110 | 110 | if ($debug) echo 'User added to the session'; |
111 | 111 | //Registering user to the new session |
112 | - SessionManager::subscribe_users_to_session($new_session_id,array($user_id),false); |
|
112 | + SessionManager::subscribe_users_to_session($new_session_id, array($user_id), false); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | //Begin with the import process |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $TBL_LP_VIEW = Database::get_course_table(TABLE_LP_VIEW); |
125 | 125 | $TBL_NOTEBOOK = Database::get_course_table(TABLE_NOTEBOOK); |
126 | 126 | $TBL_STUDENT_PUBLICATION = Database::get_course_table(TABLE_STUDENT_PUBLICATION); |
127 | - $TBL_STUDENT_PUBLICATION_ASSIGNMENT = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); |
|
127 | + $TBL_STUDENT_PUBLICATION_ASSIGNMENT = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT); |
|
128 | 128 | $TBL_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY); |
129 | 129 | |
130 | 130 | $TBL_DROPBOX_FILE = Database::get_course_table(TABLE_DROPBOX_FILE); |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | WHERE c_id = $course_id AND session_id = $origin_session_id AND exe_user_id = $user_id "; |
139 | 139 | $res = Database::query($sql); |
140 | 140 | $list = array(); |
141 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
142 | - $list[$row['exe_id']]= $row; |
|
141 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
142 | + $list[$row['exe_id']] = $row; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | if (!empty($list)) |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $res = Database::query($sql); |
150 | 150 | $result_message[$TABLETRACK_EXERCICES]++; |
151 | 151 | } else { |
152 | - if(!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) { |
|
152 | + if (!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) { |
|
153 | 153 | $result_message['TRACK_E_EXERCISES'][$exe_id] = $data; |
154 | 154 | } else { |
155 | 155 | $result_message['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data; |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | WHERE c_id = $course_id AND session_id = $new_session_id AND exe_user_id = $user_id "; |
166 | 166 | $res = Database::query($sql); |
167 | 167 | $list = array(); |
168 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
169 | - $list[$row['exe_id']]= $row; |
|
168 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
169 | + $list[$row['exe_id']] = $row; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | if (!empty($list)) |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $res = Database::query($sql); |
177 | 177 | $result_message[$TABLETRACK_EXERCICES]++; |
178 | 178 | } else { |
179 | - if(!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) { |
|
179 | + if (!empty($data['orig_lp_id']) && !empty($data['orig_lp_item_id'])) { |
|
180 | 180 | $result_message_compare['TRACK_E_EXERCISES'][$exe_id] = $data; |
181 | 181 | } else { |
182 | 182 | $result_message_compare['TRACK_E_EXERCISES_IN_LP'][$exe_id] = $data; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | WHERE c_id = $course_id AND session_id = $origin_session_id AND user_id = $user_id "; |
194 | 194 | $res = Database::query($sql); |
195 | 195 | $list = array(); |
196 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
196 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
197 | 197 | $list[$row['course_access_id']] = $row; |
198 | 198 | } |
199 | 199 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | AND access_user_id = $user_id "; |
217 | 217 | $res = Database::query($sql); |
218 | 218 | $list = array(); |
219 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
219 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
220 | 220 | $list[] = $row['access_id']; |
221 | 221 | } |
222 | 222 | if (!empty($list)) |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $flat_list = $lp_list->get_flat_list(); |
243 | 243 | |
244 | 244 | $list = array(); |
245 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
245 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
246 | 246 | //Checking if the LP exist in the new session |
247 | 247 | if (in_array($row['lp_id'], array_keys($flat_list))) { |
248 | 248 | $list[$row['id']] = $row; |
@@ -259,8 +259,8 @@ discard block |
||
259 | 259 | $result_message[$TBL_LP_VIEW]++; |
260 | 260 | } else { |
261 | 261 | //Getting all information of that lp_item_id |
262 | - $score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id); |
|
263 | - $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']),$origin_session_id); |
|
262 | + $score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $origin_session_id); |
|
263 | + $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $origin_session_id); |
|
264 | 264 | $result_message['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress); |
265 | 265 | } |
266 | 266 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $flat_list = $lp_list->get_flat_list(); |
277 | 277 | |
278 | 278 | $list = array(); |
279 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
279 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
280 | 280 | //Checking if the LP exist in the new session |
281 | 281 | if (in_array($row['lp_id'], array_keys($flat_list))) { |
282 | 282 | $list[$row['id']] = $row; |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | if (!empty($list)) |
286 | 286 | foreach ($list as $id=>$data) { |
287 | 287 | //Getting all information of that lp_item_id |
288 | - $score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
|
289 | - $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
|
288 | + $score = Tracking::get_avg_student_score($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
|
289 | + $progress = Tracking::get_avg_student_progress($user_id, $origin_course_code, array($data['lp_id']), $new_session_id); |
|
290 | 290 | $result_message_compare['LP_VIEW'][$data['lp_id']] = array('score' => $score, 'progress' =>$progress); |
291 | 291 | } |
292 | 292 | } |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | //calendar_event_attachment no problems no session_id |
298 | 298 | $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'calendar_event' AND insert_user_id = $user_id AND c_id = $course_id "; |
299 | 299 | $res = Database::query($sql); |
300 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
300 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
301 | 301 | $id = $row['ref']; |
302 | 302 | if ($update_database) { |
303 | 303 | $sql = "UPDATE $TBL_AGENDA SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id "; |
@@ -317,24 +317,24 @@ discard block |
||
317 | 317 | $sql = "SELECT ref FROM $TBL_ITEM_PROPERTY WHERE tool = 'work' AND insert_user_id = $user_id AND c_id = $course_id"; |
318 | 318 | if ($debug) echo $sql; |
319 | 319 | $res = Database::query($sql); |
320 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
320 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
321 | 321 | $id = $row['ref']; |
322 | 322 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $id AND session_id = $origin_session_id AND c_id = $course_id"; |
323 | 323 | if ($debug) var_dump($sql); |
324 | 324 | $sub_res = Database::query($sql); |
325 | - if (Database::num_rows($sub_res) > 0 ) { |
|
326 | - $data = Database::fetch_array($sub_res,'ASSOC'); |
|
325 | + if (Database::num_rows($sub_res) > 0) { |
|
326 | + $data = Database::fetch_array($sub_res, 'ASSOC'); |
|
327 | 327 | if ($debug) var_dump($data); |
328 | 328 | $parent_id = $data['parent_id']; |
329 | 329 | if (isset($data['parent_id']) && !empty($data['parent_id'])) { |
330 | 330 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION WHERE id = $parent_id AND c_id = $course_id"; |
331 | 331 | $select_res = Database::query($sql); |
332 | - $parent_data = Database::fetch_array($select_res,'ASSOC'); |
|
332 | + $parent_data = Database::fetch_array($select_res, 'ASSOC'); |
|
333 | 333 | if ($debug) var_dump($parent_data); |
334 | 334 | |
335 | 335 | $sys_course_path = api_get_path(SYS_COURSE_PATH); |
336 | - $course_dir = $sys_course_path . $course_info['path']; |
|
337 | - $base_work_dir = $course_dir . '/work'; |
|
336 | + $course_dir = $sys_course_path.$course_info['path']; |
|
337 | + $base_work_dir = $course_dir.'/work'; |
|
338 | 338 | require_once api_get_path(SYS_CODE_PATH).'work/work.lib.php'; |
339 | 339 | |
340 | 340 | //Creating the parent folder in the session if does not exists already |
@@ -349,8 +349,8 @@ discard block |
||
349 | 349 | $sub_res = Database::query($sql); |
350 | 350 | $num_rows = Database::num_rows($sub_res); |
351 | 351 | |
352 | - if ($num_rows > 0 ) { |
|
353 | - $new_result = Database::fetch_array($sub_res,'ASSOC'); |
|
352 | + if ($num_rows > 0) { |
|
353 | + $new_result = Database::fetch_array($sub_res, 'ASSOC'); |
|
354 | 354 | $created_dir = $new_result['url']; |
355 | 355 | $new_parent_id = $new_result['id']; |
356 | 356 | } else { |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | ->setCId($course_id) |
369 | 369 | ->setTitle($parent_data['title']) |
370 | 370 | ->setDescription( |
371 | - $parent_data['description'] . "folder_moved_from_session_id_$origin_session_id" |
|
371 | + $parent_data['description']."folder_moved_from_session_id_$origin_session_id" |
|
372 | 372 | ) |
373 | 373 | ->setActive(false) |
374 | 374 | ->setAccepted(true) |
@@ -390,11 +390,11 @@ discard block |
||
390 | 390 | //Creating student_publication_assignment if exists |
391 | 391 | $sql = "SELECT * FROM $TBL_STUDENT_PUBLICATION_ASSIGNMENT WHERE publication_id = $parent_id AND c_id = $course_id"; |
392 | 392 | if ($debug) var_dump($sql); |
393 | - $rest_select = Database::query($sql); |
|
394 | - if (Database::num_rows($rest_select) > 0 ) { |
|
393 | + $rest_select = Database::query($sql); |
|
394 | + if (Database::num_rows($rest_select) > 0) { |
|
395 | 395 | if ($update_database) { |
396 | - $assignment_data = Database::fetch_array($rest_select,'ASSOC'); |
|
397 | - $sql_add_publication = "INSERT INTO " . $TBL_STUDENT_PUBLICATION_ASSIGNMENT . " SET |
|
396 | + $assignment_data = Database::fetch_array($rest_select, 'ASSOC'); |
|
397 | + $sql_add_publication = "INSERT INTO ".$TBL_STUDENT_PUBLICATION_ASSIGNMENT." SET |
|
398 | 398 | c_id = '$course_id', |
399 | 399 | expires_on = '".$assignment_data['expires_on']."', |
400 | 400 | ends_on = '".$assignment_data['ends_on']."', |
@@ -402,15 +402,15 @@ discard block |
||
402 | 402 | enable_qualification = '".$assignment_data['enable_qualification']."', |
403 | 403 | publication_id = '".$new_parent_id."'"; |
404 | 404 | if ($debug) echo $sql_add_publication; |
405 | - $rest_select = Database::query($sql_add_publication); |
|
405 | + $rest_select = Database::query($sql_add_publication); |
|
406 | 406 | $id = Database::insert_id(); |
407 | 407 | |
408 | - $sql_update = "UPDATE " . $TBL_STUDENT_PUBLICATION . " SET " . |
|
408 | + $sql_update = "UPDATE ".$TBL_STUDENT_PUBLICATION." SET ". |
|
409 | 409 | "has_properties = '".$id."', |
410 | 410 | view_properties = '1' |
411 | 411 | WHERE id = ".$new_parent_id; |
412 | 412 | if ($debug) echo $sql_update; |
413 | - $rest_update = Database::query($sql_update); |
|
413 | + $rest_update = Database::query($sql_update); |
|
414 | 414 | |
415 | 415 | |
416 | 416 | if ($debug) var_dump($sql_update); |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | ->setUrl($new_url) |
431 | 431 | ->setCId($course_id) |
432 | 432 | ->setTitle($data['title']) |
433 | - ->setDescription($data['description'] . ' file moved') |
|
433 | + ->setDescription($data['description'].' file moved') |
|
434 | 434 | ->setActive($data['active']) |
435 | 435 | ->setAccepted($data['accepted']) |
436 | 436 | ->setPostGroupId($data['post_group_id']) |
@@ -455,7 +455,7 @@ discard block |
||
455 | 455 | unlink($full_file_name); |
456 | 456 | $sql = "DELETE FROM $TBL_STUDENT_PUBLICATION WHERE id= ".$data['id']; |
457 | 457 | if ($debug) var_dump($sql); |
458 | - $result_delete = Database::query($sql); |
|
458 | + $result_delete = Database::query($sql); |
|
459 | 459 | api_item_property_update($course_info, 'work', $data['id'], 'DocumentDeleted', api_get_user_id()); |
460 | 460 | } |
461 | 461 | } |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | $sql = "SELECT id FROM $TBL_DROPBOX_FILE WHERE uploader_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id"; |
473 | 473 | if ($debug) var_dump($sql); |
474 | 474 | $res = Database::query($sql); |
475 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
475 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
476 | 476 | $id = $row['id']; |
477 | 477 | if ($update_database) { |
478 | 478 | $sql = "UPDATE $TBL_DROPBOX_FILE SET session_id = $new_session_id WHERE c_id = $course_id AND id = $id"; |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | WHERE user_id = $user_id AND session_id = $origin_session_id AND course = '$origin_course_code' AND c_id = $course_id"; |
497 | 497 | if ($debug) var_dump($sql); |
498 | 498 | $res = Database::query($sql); |
499 | - while($row = Database::fetch_array($res,'ASSOC')) { |
|
499 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
500 | 500 | $id = $row['notebook_id']; |
501 | 501 | if ($update_database) { |
502 | 502 | $sql = "UPDATE $TBL_NOTEBOOK SET session_id = $new_session_id WHERE c_id = $course_id AND notebook_id = $id"; |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | echo '<tr>'; |
521 | 521 | echo '<td width="50%" valign="top">'; |
522 | 522 | |
523 | - if ($origin_session_id == 0 ) { |
|
523 | + if ($origin_session_id == 0) { |
|
524 | 524 | echo '<h4>'.get_lang('OriginCourse').'</h4>'; |
525 | 525 | } else { |
526 | 526 | echo '<h4>'.get_lang('OriginSession').' #'.$origin_session_id.'</h4>'; |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | compare_data($result_message); |
529 | 529 | echo '</td>'; |
530 | 530 | echo '<td width="50%" valign="top">'; |
531 | - if ($new_session_id == 0 ) { |
|
531 | + if ($new_session_id == 0) { |
|
532 | 532 | echo '<h4>'.get_lang('DestinyCourse').'</h4>'; |
533 | 533 | } else { |
534 | 534 | echo '<h4>'.get_lang('DestinySession').' #'.$new_session_id.'</h4>'; |
@@ -592,8 +592,8 @@ discard block |
||
592 | 592 | |
593 | 593 | $res = Database::query($sql); |
594 | 594 | $course_list = array(); |
595 | - while ($row = Database::fetch_array($res,'ASSOC')) { |
|
596 | - $course_list []= $row; |
|
595 | + while ($row = Database::fetch_array($res, 'ASSOC')) { |
|
596 | + $course_list [] = $row; |
|
597 | 597 | } |
598 | 598 | return $course_list; |
599 | 599 | } |
@@ -601,9 +601,9 @@ discard block |
||
601 | 601 | |
602 | 602 | Display::display_header(get_lang('MoveUserStats')); |
603 | 603 | echo '<div class="actions">'; |
604 | -echo '<a href="../admin/index.php">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
604 | +echo '<a href="../admin/index.php">'.Display::return_icon('back.png', get_lang('BackTo').' '.get_lang('PlatformAdmin'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
605 | 605 | echo '</div>'; |
606 | -echo Display::display_normal_message(get_lang('CompareUserResultsBetweenCoursesAndCoursesInASession'),false); |
|
606 | +echo Display::display_normal_message(get_lang('CompareUserResultsBetweenCoursesAndCoursesInASession'), false); |
|
607 | 607 | |
608 | 608 | |
609 | 609 | // Some pagination |
@@ -613,19 +613,19 @@ discard block |
||
613 | 613 | } |
614 | 614 | $default = 20; |
615 | 615 | $count = UserManager::get_number_of_users(); |
616 | -$nro_pages = round($count/$default) + 1; |
|
617 | -$begin = $default* ($page - 1); |
|
618 | -$end = $default*$page; |
|
616 | +$nro_pages = round($count / $default) + 1; |
|
617 | +$begin = $default * ($page - 1); |
|
618 | +$end = $default * $page; |
|
619 | 619 | |
620 | 620 | $navigation = "$begin - $end / $count<br />"; |
621 | 621 | |
622 | 622 | if ($page > 1) { |
623 | - $navigation .='<a href="'.api_get_self().'?page='.($page - 1).'">'.get_lang('Previous').'</a>'; |
|
623 | + $navigation .= '<a href="'.api_get_self().'?page='.($page - 1).'">'.get_lang('Previous').'</a>'; |
|
624 | 624 | } else { |
625 | 625 | $navigation .= get_lang('Previous'); |
626 | 626 | } |
627 | 627 | $navigation .= ' '; |
628 | -$page ++; |
|
628 | +$page++; |
|
629 | 629 | if ($page < $nro_pages) |
630 | 630 | $navigation .= '<a href="'.api_get_self().'?page='.$page.'">'.get_lang('Next').'</a>'; |
631 | 631 | else |
@@ -633,11 +633,11 @@ discard block |
||
633 | 633 | |
634 | 634 | echo $navigation; |
635 | 635 | $user_list = UserManager::get_user_list(array(), array(), $begin, $default); |
636 | -$session_list = SessionManager::get_sessions_list(array(),array('name')); |
|
636 | +$session_list = SessionManager::get_sessions_list(array(), array('name')); |
|
637 | 637 | $options = ''; |
638 | 638 | $options .= '<option value="0">--'.get_lang('SelectASession').'--</option>'; |
639 | 639 | foreach ($session_list as $session_data) { |
640 | - $my_session_list[$session_data['id']] =$session_data['name']; |
|
640 | + $my_session_list[$session_data['id']] = $session_data['name']; |
|
641 | 641 | $options .= '<option value="'.$session_data['id'].'">'.$session_data['name'].'</option>'; |
642 | 642 | } |
643 | 643 | |
@@ -686,7 +686,7 @@ discard block |
||
686 | 686 | $course['name'] = $courseInfo['name']; |
687 | 687 | } |
688 | 688 | |
689 | - $course_list = $course_list_registered; |
|
689 | + $course_list = $course_list_registered; |
|
690 | 690 | |
691 | 691 | echo '<div>'; |
692 | 692 | echo '<table class="data_table">'; |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | $session_id = $course['id_session']; |
722 | 722 | } |
723 | 723 | echo '<td>'; |
724 | - echo get_lang('MoveTo'); echo '<br />'; |
|
724 | + echo get_lang('MoveTo'); echo '<br />'; |
|
725 | 725 | $unique_id = uniqid(); |
726 | 726 | $combinations[$unique_id] = array('course_code' =>$course_code, 'session_id'=>$session_id); |
727 | 727 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * Copyright (c) 2007 Mustapha Alouani (supervised by Michel Moreau-Belliard) |
7 | 7 | */ |
8 | 8 | // resetting the course id |
9 | -$cidReset=true; |
|
9 | +$cidReset = true; |
|
10 | 10 | require_once __DIR__.'/../inc/global.inc.php'; |
11 | 11 | // setting the section (for the tabs) |
12 | 12 | $this_section = SECTION_PLATFORM_ADMIN; |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | api_protect_admin_script(); |
16 | 16 | require('../auth/ldap/authldap.php'); |
17 | 17 | |
18 | -$annee_base=date('Y'); |
|
18 | +$annee_base = date('Y'); |
|
19 | 19 | |
20 | 20 | $tool_name = get_lang('LDAPImport'); |
21 | 21 | // setting breadcrumbs |
22 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | 23 | |
24 | 24 | $htmlHeadXtra[] = '<script language="JavaScript" type="text/javascript"> |
25 | 25 | var buttoncheck = 1; |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | $annee = $_GET['annee']; |
47 | 47 | $composante = $_GET['composante']; |
48 | -$etape = $_GET['etape']; |
|
48 | +$etape = $_GET['etape']; |
|
49 | 49 | $course = $_POST['course']; |
50 | 50 | |
51 | 51 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | echo '</div>'; |
196 | 196 | } |
197 | 197 | */ |
198 | -elseif(!empty($annee) && empty($course)) |
|
198 | +elseif (!empty($annee) && empty($course)) |
|
199 | 199 | { |
200 | 200 | Display::display_header($tool_name); |
201 | 201 | echo '<div style="align:center">'; |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | echo '<form method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'"><br />'; |
204 | 204 | echo '<select name="course">'; |
205 | 205 | $courses = CourseManager::get_courses_list(); |
206 | - foreach($courses as $row) |
|
206 | + foreach ($courses as $row) |
|
207 | 207 | { |
208 | 208 | echo '<option value="'.$row['code'].'">'.api_htmlentities($row['title']).'</option>'; |
209 | 209 | } |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | |
237 | 237 | $info = ldap_get_entries($ds, $sr); |
238 | 238 | |
239 | - for ($key = 0; $key < $info["count"]; $key ++) { |
|
239 | + for ($key = 0; $key < $info["count"]; $key++) { |
|
240 | 240 | $nom_form[] = $info[$key]["sn"][0]; |
241 | 241 | $prenom_form[] = $info[$key]["givenname"][0]; |
242 | 242 | $email_form[] = $info[$key]["mail"][0]; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | asort($nom_form); |
257 | 257 | reset($nom_form); |
258 | 258 | |
259 | - $statut=5; |
|
259 | + $statut = 5; |
|
260 | 260 | include ('ldap_form_add_users_group.php'); |
261 | 261 | } else { |
262 | 262 | echo '<h4>'.get_lang('UnableToConnectTo').' '.$host.'</h4>'; |
@@ -267,25 +267,25 @@ discard block |
||
267 | 267 | echo '</div>'; |
268 | 268 | |
269 | 269 | } |
270 | -elseif (!empty($annee) && !empty($course) && ($_POST['confirmed']=='yes')) |
|
270 | +elseif (!empty($annee) && !empty($course) && ($_POST['confirmed'] == 'yes')) |
|
271 | 271 | { |
272 | - $id=$_POST['username_form']; |
|
273 | - $UserList=array(); |
|
272 | + $id = $_POST['username_form']; |
|
273 | + $UserList = array(); |
|
274 | 274 | $userid_match_login = array(); |
275 | 275 | foreach ($id as $form_index=>$user_id) |
276 | 276 | { |
277 | - if(is_array($_POST['checkboxes']) && in_array($form_index,array_values($_POST['checkboxes']))) |
|
277 | + if (is_array($_POST['checkboxes']) && in_array($form_index, array_values($_POST['checkboxes']))) |
|
278 | 278 | { |
279 | 279 | $tmp = ldap_add_user($user_id); |
280 | - $UserList[]= $tmp; |
|
280 | + $UserList[] = $tmp; |
|
281 | 281 | $userid_match_login[$tmp] = $user_id; |
282 | 282 | } |
283 | 283 | } |
284 | 284 | if (!empty($_POST['course'])) |
285 | 285 | { |
286 | - foreach($UserList as $user_id) |
|
286 | + foreach ($UserList as $user_id) |
|
287 | 287 | { |
288 | - CourseManager::add_user_to_course($user_id,$_POST['course']); |
|
288 | + CourseManager::add_user_to_course($user_id, $_POST['course']); |
|
289 | 289 | } |
290 | 290 | header('Location: course_information.php?code='.Security::remove_XSS($_POST['course'])); |
291 | 291 | } |
@@ -311,8 +311,8 @@ discard block |
||
311 | 311 | else |
312 | 312 | { |
313 | 313 | Display::display_header($tool_name); |
314 | - $message=get_lang('NoUserAdded'); |
|
315 | - Display :: display_normal_message($message,false); |
|
314 | + $message = get_lang('NoUserAdded'); |
|
315 | + Display :: display_normal_message($message, false); |
|
316 | 316 | } |
317 | 317 | echo '<br /><br />'; |
318 | 318 | echo '<a href="ldap_import_students.php?annee=&composante=&etape=">'.get_lang('BackToNewSearch').'</a>'; |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | |
13 | 13 | api_protect_admin_script(); |
14 | 14 | |
15 | -$new_language = Security::remove_XSS($_REQUEST['new_language']); |
|
16 | -$language_variable = Security::remove_XSS($_REQUEST['variable_language']); |
|
17 | -$file_id = intval($_REQUEST['file_id']); |
|
15 | +$new_language = Security::remove_XSS($_REQUEST['new_language']); |
|
16 | +$language_variable = Security::remove_XSS($_REQUEST['variable_language']); |
|
17 | +$file_id = intval($_REQUEST['file_id']); |
|
18 | 18 | /** |
19 | 19 | * Code |
20 | 20 | */ |
@@ -30,10 +30,10 @@ discard block |
||
30 | 30 | |
31 | 31 | //update variable language |
32 | 32 | // Replace double quotes to avoid parse errors |
33 | - $new_language = str_replace('"', '\"',$new_language); |
|
33 | + $new_language = str_replace('"', '\"', $new_language); |
|
34 | 34 | // Replace new line signs to avoid parse errors - see #6773 |
35 | - $new_language = str_replace("\n","\\n",$new_language); |
|
36 | - $all_file_of_directory[$language_variable]="\"".$new_language."\";"; |
|
35 | + $new_language = str_replace("\n", "\\n", $new_language); |
|
36 | + $all_file_of_directory[$language_variable] = "\"".$new_language."\";"; |
|
37 | 37 | $result_array = array(); |
38 | 38 | |
39 | 39 | foreach ($all_file_of_directory as $key_value=>$value_info) { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | if (!empty($result_array)) { |
44 | 44 | foreach ($result_array as $key => $result) { |
45 | 45 | if ($result == false) { |
46 | - $variables_with_problems .=$key.' <br />'; |
|
46 | + $variables_with_problems .= $key.' <br />'; |
|
47 | 47 | } |
48 | 48 | } |
49 | 49 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | Display::return_message(get_lang('TheNewWordHasBeenAdded'), 'success') |
54 | 54 | ); |
55 | 55 | |
56 | - $redirectUrl = api_get_path(WEB_CODE_PATH) . 'admin/extra_fields.php?type='; |
|
56 | + $redirectUrl = api_get_path(WEB_CODE_PATH).'admin/extra_fields.php?type='; |
|
57 | 57 | |
58 | 58 | switch ($_REQUEST['extra_field_type']) { |
59 | 59 | case ExtraField::USER_FIELD_TYPE: |
@@ -15,13 +15,13 @@ |
||
15 | 15 | */ |
16 | 16 | function validate_courses_data($courses) |
17 | 17 | { |
18 | - $errors = array (); |
|
19 | - $coursecodes = array (); |
|
18 | + $errors = array(); |
|
19 | + $coursecodes = array(); |
|
20 | 20 | foreach ($courses as $index => $course) { |
21 | - $course['line'] = $index +1; |
|
21 | + $course['line'] = $index + 1; |
|
22 | 22 | |
23 | 23 | // 1. Check whether mandatory fields are set. |
24 | - $mandatory_fields = array ('Code', 'Title', 'CourseCategory'); |
|
24 | + $mandatory_fields = array('Code', 'Title', 'CourseCategory'); |
|
25 | 25 | foreach ($mandatory_fields as $field) { |
26 | 26 | if (empty($course[$field])) { |
27 | 27 | $course['error'] = get_lang($field.'Mandatory'); |