@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | |
68 | 68 | //Column config |
69 | 69 | $column_model = array( |
70 | - array('name'=>'subject', 'index'=>'subject', 'width'=>'80', 'align'=>'left'), |
|
70 | + array('name'=>'subject', 'index'=>'subject', 'width'=>'80', 'align'=>'left'), |
|
71 | 71 | // array('name'=>'message', 'index'=>'message', 'width'=>'500', 'align'=>'left','sortable'=>'false'), |
72 | - array('name'=>'event_type_name', 'index'=>'event_type_name', 'width'=>'80', 'align'=>'left'), |
|
73 | - array('name'=>'language_id', 'index'=>'language_id', 'width'=>'80', 'align'=>'left'), |
|
74 | - array('name'=>'activated', 'index'=>'activated', 'width'=>'80', 'align'=>'left'), |
|
75 | - array('name'=>'actions', 'index'=>'actions', 'width'=>'100') |
|
72 | + array('name'=>'event_type_name', 'index'=>'event_type_name', 'width'=>'80', 'align'=>'left'), |
|
73 | + array('name'=>'language_id', 'index'=>'language_id', 'width'=>'80', 'align'=>'left'), |
|
74 | + array('name'=>'activated', 'index'=>'activated', 'width'=>'80', 'align'=>'left'), |
|
75 | + array('name'=>'actions', 'index'=>'actions', 'width'=>'100') |
|
76 | 76 | ); |
77 | 77 | //Autowidth |
78 | 78 | $extra_params['autowidth'] = 'true'; |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
83 | 83 | $htmlHeadXtra[] = '<script> |
84 | 84 | $(function() { |
85 | - '.Display::grid_js('event_email_template', $url,$columns,$column_model,$extra_params, array(), $action_links,true).' |
|
85 | + '.Display::grid_js('event_email_template', $url, $columns, $column_model, $extra_params, array(), $action_links, true).' |
|
86 | 86 | }); |
87 | 87 | </script>'; |
88 | 88 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | public function deleteAction($id) { |
34 | - $event_email_template = new EventEmailTemplate(); |
|
34 | + $event_email_template = new EventEmailTemplate(); |
|
35 | 35 | return $event_email_template->delete($id); |
36 | 36 | } |
37 | 37 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | array('name'=>'language_id', 'index'=>'language_id', 'width'=>'80', 'align'=>'left'), |
74 | 74 | array('name'=>'activated', 'index'=>'activated', 'width'=>'80', 'align'=>'left'), |
75 | 75 | array('name'=>'actions', 'index'=>'actions', 'width'=>'100') |
76 | - ); |
|
76 | + ); |
|
77 | 77 | //Autowidth |
78 | 78 | $extra_params['autowidth'] = 'true'; |
79 | 79 | //height auto |
@@ -90,26 +90,26 @@ |
||
90 | 90 | { |
91 | 91 | $baseDir = api_get_path(SYS_ARCHIVE_PATH); |
92 | 92 | $uploadPath = 'pdfimport/'; |
93 | - $errors = array (); |
|
93 | + $errors = array(); |
|
94 | 94 | if (!is_dir($baseDir.$uploadPath)) { |
95 | 95 | @mkdir($baseDir.$uploadPath); |
96 | 96 | } |
97 | - if (!unzip_uploaded_file($_FILES['import_file'], $uploadPath, $baseDir, 1024*1024*1024)) { |
|
97 | + if (!unzip_uploaded_file($_FILES['import_file'], $uploadPath, $baseDir, 1024 * 1024 * 1024)) { |
|
98 | 98 | error_log('Could not unzip uploaded file in '.__FILE__.', line '.__LINE__); |
99 | 99 | return $errors; |
100 | 100 | } |
101 | 101 | $list = scandir($baseDir.$uploadPath); |
102 | 102 | $i = 0; |
103 | 103 | foreach ($list as $file) { |
104 | - if (substr($file,0,1) == '.' or !is_file($baseDir.$uploadPath.$file)) { |
|
104 | + if (substr($file, 0, 1) == '.' or !is_file($baseDir.$uploadPath.$file)) { |
|
105 | 105 | continue; |
106 | 106 | } |
107 | - $parts = preg_split('/_/',$file); |
|
107 | + $parts = preg_split('/_/', $file); |
|
108 | 108 | $course = api_get_course_info($parts[0]); |
109 | 109 | if (count($course) > 0) { |
110 | 110 | // Build file info because handle_uploaded_document() needs it (name, type, size, tmp_name) |
111 | 111 | $fileSize = filesize($baseDir.$uploadPath.$file); |
112 | - $docId = add_document($course, $subDir.'/'.$file, 'file', $fileSize, $parts[1].' '.substr($parts[2],0,-4)); |
|
112 | + $docId = add_document($course, $subDir.'/'.$file, 'file', $fileSize, $parts[1].' '.substr($parts[2], 0, -4)); |
|
113 | 113 | if ($docId > 0) { |
114 | 114 | if (!is_file($baseDir.$uploadPath.$file)) { |
115 | 115 | error_log($baseDir.$uploadPath.$file.' does not exists in '.__FILE__); |
@@ -229,31 +229,31 @@ discard block |
||
229 | 229 | <td align="center"> |
230 | 230 | <div id="content_source"> |
231 | 231 | <?php |
232 | - if (!($add_type=='multiple')) { |
|
232 | + if (!($add_type=='multiple')) { |
|
233 | 233 | ?> |
234 | 234 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
235 | 235 | <div id="ajax_list_users_single"></div> |
236 | 236 | <?php |
237 | - } else { |
|
238 | - ?> |
|
237 | + } else { |
|
238 | + ?> |
|
239 | 239 | <div id="ajax_list_multiple"> |
240 | 240 | <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> |
241 | 241 | </div> |
242 | 242 | <?php |
243 | - } |
|
244 | - ?> |
|
243 | + } |
|
244 | + ?> |
|
245 | 245 | </div> |
246 | 246 | </td> |
247 | 247 | <td width="10%" valign="middle" align="center"> |
248 | 248 | <?php |
249 | - if ($ajax_search) { |
|
250 | - ?> |
|
249 | + if ($ajax_search) { |
|
250 | + ?> |
|
251 | 251 | <button class="btn bt-default" type="button" onclick="remove_item(document.getElementById('elements_in'))" > |
252 | 252 | <em class="fa fa-arrow-left"></em> |
253 | 253 | </button> |
254 | 254 | <?php |
255 | - } else { |
|
256 | - ?> |
|
255 | + } else { |
|
256 | + ?> |
|
257 | 257 | <button class="btn btn-default" type="button" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))" onclick="moveItem(document.getElementById('elements_not_in'), document.getElementById('elements_in'))"> |
258 | 258 | <em class="fa fa-arrow-right"></em> |
259 | 259 | </button> |
@@ -262,8 +262,8 @@ discard block |
||
262 | 262 | <em class="fa fa-arrow-left"></em> |
263 | 263 | </button> |
264 | 264 | <?php |
265 | - } |
|
266 | - ?> |
|
265 | + } |
|
266 | + ?> |
|
267 | 267 | <br /><br /><br /><br /><br /><br /> |
268 | 268 | </td> |
269 | 269 | <td align="center"> |
@@ -144,7 +144,10 @@ |
||
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'])) { |
|
148 | + echo '&add=true' ; |
|
149 | +} |
|
150 | +?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> |
|
148 | 151 | <?php echo '<legend>'.$tool_name.' '.$promotion_data['name'].'</legend>'; |
149 | 152 | |
150 | 153 | if ($add_type=='multiple') { |
@@ -19,14 +19,14 @@ 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' => 'usergroups.php','name' => get_lang('Classes')); |
|
22 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
23 | +$interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
|
24 | 24 | |
25 | 25 | // Setting the name of the tool. |
26 | 26 | $tool_name = get_lang('SubscribeClassToCourses'); |
27 | 27 | |
28 | 28 | $add_type = 'multiple'; |
29 | -if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!=''){ |
|
29 | +if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') { |
|
30 | 30 | $add_type = Security::remove_XSS($_REQUEST['add_type']); |
31 | 31 | } |
32 | 32 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | |
98 | 98 | $searchForm = new FormValidator('search', 'get', api_get_self().'?id='.$id); |
99 | 99 | $searchForm->addHeader(get_lang('AdvancedSearch')); |
100 | -$renderer =& $searchForm->defaultRenderer(); |
|
100 | +$renderer = & $searchForm->defaultRenderer(); |
|
101 | 101 | $searchForm->addElement('hidden', 'id', $id); |
102 | 102 | foreach ($filters as $param) { |
103 | 103 | $searchForm->addElement($param['type'], $param['name'], $param['label']); |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | //checking for extra field with filter on |
143 | 143 | |
144 | -function search($needle,$type) |
|
144 | +function search($needle, $type) |
|
145 | 145 | { |
146 | 146 | global $elements_in; |
147 | 147 | $xajax_response = new xajaxResponse(); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | echo '<div class="actions">'; |
183 | -echo '<a href="usergroups.php">'.Display::return_icon('back.png',get_lang('Back'), array(), ICON_SIZE_MEDIUM).'</a>'; |
|
183 | +echo '<a href="usergroups.php">'.Display::return_icon('back.png', get_lang('Back'), array(), ICON_SIZE_MEDIUM).'</a>'; |
|
184 | 184 | echo Display::url(get_lang('AdvancedSearch'), '#', array('class' => 'advanced_options', 'id' => 'advanced_search')); |
185 | 185 | echo '</div>'; |
186 | 186 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | |
191 | 191 | ?> |
192 | 192 | |
193 | -<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();"';}?>> |
|
193 | +<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();"'; }?>> |
|
194 | 194 | |
195 | 195 | <?php echo '<legend>'.$data['name'].': '.$tool_name.'</legend>'; |
196 | 196 | echo Display::input('hidden', 'id', $id); |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | <td align="center"><b><?php echo get_lang('CoursesInGroup') ?> :</b></td> |
210 | 210 | </tr> |
211 | 211 | |
212 | -<?php if ($add_type=='multiple') { ?> |
|
212 | +<?php if ($add_type == 'multiple') { ?> |
|
213 | 213 | <tr> |
214 | 214 | <td align="center"> |
215 | 215 | <?php echo get_lang('FirstLetterCourseTitle'); ?> : |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | <td align="center"> |
228 | 228 | <div id="content_source"> |
229 | 229 | <?php |
230 | - if (!($add_type=='multiple')) { |
|
230 | + if (!($add_type == 'multiple')) { |
|
231 | 231 | ?> |
232 | 232 | <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" /> |
233 | 233 | <div id="ajax_list_users_single"></div> |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | } else { |
236 | 236 | ?> |
237 | 237 | <div id="ajax_list_multiple"> |
238 | - <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_not_in','size'=>'15px'),false); ?> |
|
238 | + <?php echo Display::select('elements_not_in_name', $elements_not_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_not_in', 'size'=>'15px'), false); ?> |
|
239 | 239 | </div> |
240 | 240 | <?php |
241 | 241 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | </td> |
267 | 267 | <td align="center"> |
268 | 268 | <?php |
269 | - echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'elements_in','size'=>'15px'),false ); |
|
269 | + echo Display::select('elements_in_name[]', $elements_in, '', array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'elements_in', 'size'=>'15px'), false); |
|
270 | 270 | unset($sessionUsersList); |
271 | 271 | ?> |
272 | 272 | </td> |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | |
23 | 23 | set_time_limit(0); |
24 | 24 | |
25 | -$courses = array (); |
|
25 | +$courses = array(); |
|
26 | 26 | $courses[''] = '--'; |
27 | 27 | $sql = "SELECT code,visual_code,title FROM $course_table ORDER BY visual_code"; |
28 | 28 | |
29 | 29 | global $_configuration; |
30 | 30 | |
31 | 31 | if (api_is_multiple_url_enabled()) { |
32 | - $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
32 | + $tbl_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
33 | 33 | $access_url_id = api_get_current_access_url_id(); |
34 | - if ($access_url_id != -1){ |
|
34 | + if ($access_url_id != -1) { |
|
35 | 35 | $sql = "SELECT code,visual_code,title |
36 | 36 | FROM $course_table as c |
37 | 37 | INNER JOIN $tbl_course_rel_access_url as course_rel_url |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | } |
47 | 47 | $form = new FormValidator('export_users'); |
48 | 48 | $form->addElement('header', $tool_name); |
49 | -$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML','xml'); |
|
49 | +$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'XML', 'xml'); |
|
50 | 50 | $form->addElement('radio', 'file_type', null, 'CSV', 'csv'); |
51 | 51 | $form->addElement('radio', 'file_type', null, 'XLS', 'xls'); |
52 | 52 | |
53 | -$form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'),'1'); |
|
53 | +$form->addElement('checkbox', 'addcsvheader', get_lang('AddCSVHeader'), get_lang('YesAddCSVHeader'), '1'); |
|
54 | 54 | $form->addElement('select', 'course_code', get_lang('OnlyUsersFromCourse'), $courses); |
55 | 55 | $form->addButtonExport(get_lang('Export')); |
56 | 56 | $form->setDefaults(array('file_type' => 'csv')); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | u.firstname AS FirstName, |
69 | 69 | u.email AS Email, |
70 | 70 | u.username AS UserName, |
71 | - ".(($_configuration['password_encryption']!='none')?" ":"u.password AS Password, ")." |
|
71 | + ".(($_configuration['password_encryption'] != 'none') ? " " : "u.password AS Password, ")." |
|
72 | 72 | u.auth_source AS AuthSource, |
73 | 73 | u.status AS Status, |
74 | 74 | u.official_code AS OfficialCode, |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $filename = 'export_users_'.$course_code.'_'.api_get_local_time(); |
84 | 84 | } else { |
85 | 85 | if (api_is_multiple_url_enabled()) { |
86 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
86 | + $tbl_user_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
87 | 87 | $access_url_id = api_get_current_access_url_id(); |
88 | 88 | if ($access_url_id != -1) { |
89 | - $sql.= " FROM $user_table u |
|
89 | + $sql .= " FROM $user_table u |
|
90 | 90 | INNER JOIN $tbl_user_rel_access_url as user_rel_url |
91 | 91 | ON (u.user_id= user_rel_url.user_id) |
92 | 92 | WHERE access_url_id = $access_url_id |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | $filename = 'export_users_'.api_get_local_time(); |
99 | 99 | } |
100 | 100 | $data = array(); |
101 | - $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false); |
|
102 | - if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') { |
|
101 | + $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC', false); |
|
102 | + if ($export['addcsvheader'] == '1' AND $export['file_type'] == 'csv') { |
|
103 | 103 | if ($_configuration['password_encryption'] != 'none') { |
104 | 104 | $data[] = array( |
105 | 105 | 'UserId', |
@@ -127,19 +127,19 @@ discard block |
||
127 | 127 | ); |
128 | 128 | } |
129 | 129 | |
130 | - foreach($extra_fields as $extra) { |
|
131 | - $data[0][]=$extra[1]; |
|
130 | + foreach ($extra_fields as $extra) { |
|
131 | + $data[0][] = $extra[1]; |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | |
135 | 135 | $res = Database::query($sql); |
136 | - while($user = Database::fetch_array($res,'ASSOC')) { |
|
136 | + while ($user = Database::fetch_array($res, 'ASSOC')) { |
|
137 | 137 | $student_data = UserManager:: get_extra_user_data( |
138 | 138 | $user['UserId'], |
139 | 139 | true, |
140 | 140 | false |
141 | 141 | ); |
142 | - foreach($student_data as $key=>$value) { |
|
142 | + foreach ($student_data as $key=>$value) { |
|
143 | 143 | $key = substr($key, 6); |
144 | 144 | if (is_array($value)) { |
145 | 145 | $user[$key] = $value[$key]; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $user[$key] = $value; |
148 | 148 | } |
149 | 149 | } |
150 | - $data[] = $user ; |
|
150 | + $data[] = $user; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | switch ($file_type) { |
@@ -29,20 +29,20 @@ discard block |
||
29 | 29 | global $_configuration; |
30 | 30 | |
31 | 31 | if (api_is_multiple_url_enabled()) { |
32 | - $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
33 | - $access_url_id = api_get_current_access_url_id(); |
|
34 | - if ($access_url_id != -1){ |
|
35 | - $sql = "SELECT code,visual_code,title |
|
32 | + $tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE); |
|
33 | + $access_url_id = api_get_current_access_url_id(); |
|
34 | + if ($access_url_id != -1){ |
|
35 | + $sql = "SELECT code,visual_code,title |
|
36 | 36 | FROM $course_table as c |
37 | 37 | INNER JOIN $tbl_course_rel_access_url as course_rel_url |
38 | 38 | ON (c.id = course_rel_url.c_id) |
39 | 39 | WHERE access_url_id = $access_url_id |
40 | 40 | ORDER BY visual_code"; |
41 | - } |
|
41 | + } |
|
42 | 42 | } |
43 | 43 | $result = Database::query($sql); |
44 | 44 | while ($course = Database::fetch_object($result)) { |
45 | - $courses[$course->code] = $course->visual_code.' - '.$course->title; |
|
45 | + $courses[$course->code] = $course->visual_code.' - '.$course->title; |
|
46 | 46 | } |
47 | 47 | $form = new FormValidator('export_users'); |
48 | 48 | $form->addElement('header', $tool_name); |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | $form->setDefaults(array('file_type' => 'csv')); |
57 | 57 | |
58 | 58 | if ($form->validate()) { |
59 | - $export = $form->exportValues(); |
|
60 | - $file_type = $export['file_type']; |
|
61 | - $course_code = Database::escape_string($export['course_code']); |
|
62 | - $courseInfo = api_get_course_info($course_code); |
|
63 | - $courseId = $courseInfo['real_id']; |
|
59 | + $export = $form->exportValues(); |
|
60 | + $file_type = $export['file_type']; |
|
61 | + $course_code = Database::escape_string($export['course_code']); |
|
62 | + $courseInfo = api_get_course_info($course_code); |
|
63 | + $courseId = $courseInfo['real_id']; |
|
64 | 64 | |
65 | - $sql = "SELECT |
|
65 | + $sql = "SELECT |
|
66 | 66 | u.user_id AS UserId, |
67 | 67 | u.lastname AS LastName, |
68 | 68 | u.firstname AS FirstName, |
@@ -73,96 +73,96 @@ discard block |
||
73 | 73 | u.status AS Status, |
74 | 74 | u.official_code AS OfficialCode, |
75 | 75 | u.phone AS Phone"; |
76 | - if (strlen($course_code) > 0) { |
|
77 | - $sql .= " FROM $user_table u, $course_user_table cu |
|
76 | + if (strlen($course_code) > 0) { |
|
77 | + $sql .= " FROM $user_table u, $course_user_table cu |
|
78 | 78 | WHERE |
79 | 79 | u.user_id = cu.user_id AND |
80 | 80 | cu.c_id = $courseId AND |
81 | 81 | cu.relation_type<>".COURSE_RELATION_TYPE_RRHH." |
82 | 82 | ORDER BY lastname,firstname"; |
83 | - $filename = 'export_users_'.$course_code.'_'.api_get_local_time(); |
|
84 | - } else { |
|
85 | - if (api_is_multiple_url_enabled()) { |
|
86 | - $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
87 | - $access_url_id = api_get_current_access_url_id(); |
|
88 | - if ($access_url_id != -1) { |
|
89 | - $sql.= " FROM $user_table u |
|
83 | + $filename = 'export_users_'.$course_code.'_'.api_get_local_time(); |
|
84 | + } else { |
|
85 | + if (api_is_multiple_url_enabled()) { |
|
86 | + $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER); |
|
87 | + $access_url_id = api_get_current_access_url_id(); |
|
88 | + if ($access_url_id != -1) { |
|
89 | + $sql.= " FROM $user_table u |
|
90 | 90 | INNER JOIN $tbl_user_rel_access_url as user_rel_url |
91 | 91 | ON (u.user_id= user_rel_url.user_id) |
92 | 92 | WHERE access_url_id = $access_url_id |
93 | 93 | ORDER BY lastname,firstname"; |
94 | - } |
|
95 | - } else { |
|
96 | - $sql .= " FROM $user_table u ORDER BY lastname,firstname"; |
|
97 | - } |
|
98 | - $filename = 'export_users_'.api_get_local_time(); |
|
99 | - } |
|
100 | - $data = array(); |
|
101 | - $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false); |
|
102 | - if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') { |
|
103 | - if ($_configuration['password_encryption'] != 'none') { |
|
104 | - $data[] = array( |
|
105 | - 'UserId', |
|
106 | - 'LastName', |
|
107 | - 'FirstName', |
|
108 | - 'Email', |
|
109 | - 'UserName', |
|
110 | - 'AuthSource', |
|
111 | - 'Status', |
|
112 | - 'OfficialCode', |
|
113 | - 'PhoneNumber', |
|
114 | - ); |
|
115 | - } else { |
|
116 | - $data[] = array( |
|
117 | - 'UserId', |
|
118 | - 'LastName', |
|
119 | - 'FirstName', |
|
120 | - 'Email', |
|
121 | - 'UserName', |
|
122 | - 'Password', |
|
123 | - 'AuthSource', |
|
124 | - 'Status', |
|
125 | - 'OfficialCode', |
|
126 | - 'PhoneNumber', |
|
127 | - ); |
|
128 | - } |
|
129 | - |
|
130 | - foreach($extra_fields as $extra) { |
|
131 | - $data[0][]=$extra[1]; |
|
132 | - } |
|
133 | - } |
|
134 | - |
|
135 | - $res = Database::query($sql); |
|
136 | - while($user = Database::fetch_array($res,'ASSOC')) { |
|
137 | - $student_data = UserManager:: get_extra_user_data( |
|
138 | - $user['UserId'], |
|
139 | - true, |
|
140 | - false |
|
141 | - ); |
|
142 | - foreach($student_data as $key=>$value) { |
|
143 | - $key = substr($key, 6); |
|
144 | - if (is_array($value)) { |
|
145 | - $user[$key] = $value[$key]; |
|
146 | - } else { |
|
147 | - $user[$key] = $value; |
|
148 | - } |
|
149 | - } |
|
150 | - $data[] = $user ; |
|
151 | - } |
|
152 | - |
|
153 | - switch ($file_type) { |
|
154 | - case 'xml': |
|
155 | - Export::arrayToXml($data, $filename, 'Contact', 'Contacts'); |
|
156 | - exit; |
|
157 | - break; |
|
158 | - case 'csv': |
|
159 | - Export::arrayToCsv($data, $filename); |
|
160 | - exit; |
|
161 | - case 'xls': |
|
162 | - Export::arrayToXls($data, $filename); |
|
163 | - exit; |
|
164 | - break; |
|
165 | - } |
|
94 | + } |
|
95 | + } else { |
|
96 | + $sql .= " FROM $user_table u ORDER BY lastname,firstname"; |
|
97 | + } |
|
98 | + $filename = 'export_users_'.api_get_local_time(); |
|
99 | + } |
|
100 | + $data = array(); |
|
101 | + $extra_fields = UserManager::get_extra_fields(0, 0, 5, 'ASC',false); |
|
102 | + if ($export['addcsvheader']=='1' AND $export['file_type']=='csv') { |
|
103 | + if ($_configuration['password_encryption'] != 'none') { |
|
104 | + $data[] = array( |
|
105 | + 'UserId', |
|
106 | + 'LastName', |
|
107 | + 'FirstName', |
|
108 | + 'Email', |
|
109 | + 'UserName', |
|
110 | + 'AuthSource', |
|
111 | + 'Status', |
|
112 | + 'OfficialCode', |
|
113 | + 'PhoneNumber', |
|
114 | + ); |
|
115 | + } else { |
|
116 | + $data[] = array( |
|
117 | + 'UserId', |
|
118 | + 'LastName', |
|
119 | + 'FirstName', |
|
120 | + 'Email', |
|
121 | + 'UserName', |
|
122 | + 'Password', |
|
123 | + 'AuthSource', |
|
124 | + 'Status', |
|
125 | + 'OfficialCode', |
|
126 | + 'PhoneNumber', |
|
127 | + ); |
|
128 | + } |
|
129 | + |
|
130 | + foreach($extra_fields as $extra) { |
|
131 | + $data[0][]=$extra[1]; |
|
132 | + } |
|
133 | + } |
|
134 | + |
|
135 | + $res = Database::query($sql); |
|
136 | + while($user = Database::fetch_array($res,'ASSOC')) { |
|
137 | + $student_data = UserManager:: get_extra_user_data( |
|
138 | + $user['UserId'], |
|
139 | + true, |
|
140 | + false |
|
141 | + ); |
|
142 | + foreach($student_data as $key=>$value) { |
|
143 | + $key = substr($key, 6); |
|
144 | + if (is_array($value)) { |
|
145 | + $user[$key] = $value[$key]; |
|
146 | + } else { |
|
147 | + $user[$key] = $value; |
|
148 | + } |
|
149 | + } |
|
150 | + $data[] = $user ; |
|
151 | + } |
|
152 | + |
|
153 | + switch ($file_type) { |
|
154 | + case 'xml': |
|
155 | + Export::arrayToXml($data, $filename, 'Contact', 'Contacts'); |
|
156 | + exit; |
|
157 | + break; |
|
158 | + case 'csv': |
|
159 | + Export::arrayToCsv($data, $filename); |
|
160 | + exit; |
|
161 | + case 'xls': |
|
162 | + Export::arrayToXls($data, $filename); |
|
163 | + exit; |
|
164 | + break; |
|
165 | + } |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | Display :: display_header($tool_name); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $courses = $course_list; |
47 | 47 | } |
48 | 48 | |
49 | - if (!empty($courses)) { |
|
49 | + if (!empty($courses)) { |
|
50 | 50 | |
51 | 51 | $archiveFile = 'export_courses_list_'.api_get_local_time(); |
52 | 52 | |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | Export::arrayToXls($listToExport, $archiveFile); |
99 | 99 | break; |
100 | 100 | } |
101 | - } else { |
|
101 | + } else { |
|
102 | 102 | Display::addFlash( |
103 | 103 | Display::return_message( |
104 | 104 | get_lang('ThereAreNotSelectedCoursesOrCoursesListIsEmpty') |
105 | 105 | ) |
106 | 106 | ); |
107 | - } |
|
107 | + } |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -114,29 +114,29 @@ discard block |
||
114 | 114 | $form->addHeader($tool_name); |
115 | 115 | $form->addHidden('formSent', 1); |
116 | 116 | $form->addElement( |
117 | - 'radio', |
|
118 | - 'select_type', |
|
119 | - get_lang('Option'), |
|
120 | - get_lang('ExportAllCoursesList'), |
|
121 | - '1', |
|
122 | - ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"] |
|
117 | + 'radio', |
|
118 | + 'select_type', |
|
119 | + get_lang('Option'), |
|
120 | + get_lang('ExportAllCoursesList'), |
|
121 | + '1', |
|
122 | + ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='none';}"] |
|
123 | 123 | ); |
124 | 124 | |
125 | 125 | $form->addElement( |
126 | - 'radio', |
|
127 | - 'select_type', |
|
128 | - '', |
|
129 | - get_lang('ExportSelectedCoursesFromCoursesList'), |
|
130 | - '2', |
|
131 | - ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"] |
|
126 | + 'radio', |
|
127 | + 'select_type', |
|
128 | + '', |
|
129 | + get_lang('ExportSelectedCoursesFromCoursesList'), |
|
130 | + '2', |
|
131 | + ['onclick' => "javascript: if(this.checked){document.getElementById('div-course-list').style.display='block';}"] |
|
132 | 132 | ); |
133 | 133 | |
134 | 134 | if (!empty($course_list)) { |
135 | - $form->addHtml('<div id="div-course-list" style="display:none">'); |
|
136 | - $coursesInList = []; |
|
137 | - foreach ($course_list as $course) { |
|
138 | - $coursesInList[$course['code']] = $course['title'].' ('.$course['code'].')'; |
|
139 | - } |
|
135 | + $form->addHtml('<div id="div-course-list" style="display:none">'); |
|
136 | + $coursesInList = []; |
|
137 | + foreach ($course_list as $course) { |
|
138 | + $coursesInList[$course['code']] = $course['title'].' ('.$course['code'].')'; |
|
139 | + } |
|
140 | 140 | |
141 | 141 | $form->addSelect( |
142 | 142 | 'course_code', |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | ['multiple' => 'multiple'] |
146 | 146 | ); |
147 | 147 | |
148 | - $form->addHtml('</div>'); |
|
148 | + $form->addHtml('</div>'); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | $form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | api_protect_admin_script(); |
15 | 15 | |
16 | 16 | $tool_name = get_lang('ExportCourses'); |
17 | -$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
17 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
18 | 18 | |
19 | 19 | set_time_limit(0); |
20 | 20 | |
@@ -64,17 +64,17 @@ discard block |
||
64 | 64 | $dataToExport = []; |
65 | 65 | |
66 | 66 | foreach ($courses as $course) { |
67 | - $dataToExport['code'] = str_replace(';',',',$course['code']); |
|
68 | - $dataToExport['title'] = str_replace(';',',',$course['title']); |
|
69 | - $dataToExport['category_code'] = str_replace(';',',',$course['category_code']); |
|
67 | + $dataToExport['code'] = str_replace(';', ',', $course['code']); |
|
68 | + $dataToExport['title'] = str_replace(';', ',', $course['title']); |
|
69 | + $dataToExport['category_code'] = str_replace(';', ',', $course['category_code']); |
|
70 | 70 | $categoryInfo = CourseCategory::getCategory($course['category_code']); |
71 | 71 | if ($categoryInfo) { |
72 | - $dataToExport['category_name'] = str_replace(';',',',$categoryInfo['name']); |
|
72 | + $dataToExport['category_name'] = str_replace(';', ',', $categoryInfo['name']); |
|
73 | 73 | } else { |
74 | 74 | $dataToExport['category_name'] = ''; |
75 | 75 | } |
76 | - $dataToExport['tutor_name'] = str_replace(';',',',$course['tutor_name']); |
|
77 | - $dataToExport['course_language'] = str_replace(';',',',$course['course_language']); |
|
76 | + $dataToExport['tutor_name'] = str_replace(';', ',', $course['tutor_name']); |
|
77 | + $dataToExport['course_language'] = str_replace(';', ',', $course['course_language']); |
|
78 | 78 | |
79 | 79 | $dataToExport['students'] = ''; |
80 | 80 | $dataToExport['teachers'] = ''; |
@@ -156,8 +156,8 @@ discard block |
||
156 | 156 | $form->addHtml('</div>'); |
157 | 157 | } |
158 | 158 | |
159 | -$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV' , 'csv', null); |
|
160 | -$form->addElement('radio', 'file_type', '' , 'XLS' , 'xls', null); |
|
159 | +$form->addElement('radio', 'file_type', get_lang('OutputFileType'), 'CSV', 'csv', null); |
|
160 | +$form->addElement('radio', 'file_type', '', 'XLS', 'xls', null); |
|
161 | 161 | $form->addElement('radio', 'file_type', null, 'XML', 'xml', null, array('id' => 'file_type_xml')); |
162 | 162 | |
163 | 163 | $form->setDefaults(['select_type' => '1', 'file_type' => 'csv']); |
@@ -11,58 +11,58 @@ |
||
11 | 11 | */ |
12 | 12 | $nbre=0; |
13 | 13 | echo '<form name="form" method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'">'; |
14 | - if($statut==1) |
|
15 | - { |
|
16 | - echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>'; |
|
17 | - } |
|
18 | - else |
|
19 | - { |
|
20 | - echo '<input type="hidden" name="mailling" value="1">'; |
|
21 | - } |
|
14 | + if($statut==1) |
|
15 | + { |
|
16 | + echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>'; |
|
17 | + } |
|
18 | + else |
|
19 | + { |
|
20 | + echo '<input type="hidden" name="mailling" value="1">'; |
|
21 | + } |
|
22 | 22 | if(!empty($course)) |
23 | 23 | { |
24 | - echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">'; |
|
24 | + echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">'; |
|
25 | 25 | } |
26 | 26 | elseif(!empty($id_session)) |
27 | 27 | { |
28 | - echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">'; |
|
28 | + echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">'; |
|
29 | 29 | } |
30 | 30 | $is_western_name_order = api_is_western_name_order(); |
31 | 31 | echo '<input type="hidden" name="confirmed" value="yes">'; |
32 | 32 | echo '<table border="0" cellspacing="0" width="100%">'; |
33 | 33 | echo '<tr align="center" id="header3">' . |
34 | - '<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' . |
|
35 | - '<td width="40%"><b>'.get_lang('Email').'</b></td>' . |
|
36 | - ($is_western_name_order |
|
37 | - ? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' . |
|
38 | - '<td width="15%"><b>'.get_lang('Name').'</b></td>' |
|
39 | - : '<td width="15%"><b>'.get_lang('Name').'</b></td>' . |
|
40 | - '<td width="15%"><b>'.get_lang('FirstName').'</b></td>') . |
|
41 | - '<td width="15%"><b>'.get_lang('Login').'</b></td>' . |
|
42 | - '</tr>'."\n"; |
|
34 | + '<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' . |
|
35 | + '<td width="40%"><b>'.get_lang('Email').'</b></td>' . |
|
36 | + ($is_western_name_order |
|
37 | + ? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' . |
|
38 | + '<td width="15%"><b>'.get_lang('Name').'</b></td>' |
|
39 | + : '<td width="15%"><b>'.get_lang('Name').'</b></td>' . |
|
40 | + '<td width="15%"><b>'.get_lang('FirstName').'</b></td>') . |
|
41 | + '<td width="15%"><b>'.get_lang('Login').'</b></td>' . |
|
42 | + '</tr>'."\n"; |
|
43 | 43 | while (list ($key, $val) = each($nom_form)) { |
44 | - $nbre=$nbre+1; |
|
45 | - if($nbre & 1) $ndiv=2; else $ndiv=3; |
|
46 | - echo '<tr align="center" id="header'.$ndiv.'">'; |
|
47 | - echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>'; |
|
48 | - echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>'; |
|
49 | - if ($is_western_name_order) |
|
50 | - { |
|
51 | - echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
|
52 | - echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
|
53 | - } |
|
54 | - else |
|
55 | - { |
|
56 | - echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
|
57 | - echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
|
58 | - } |
|
59 | - echo '<td>'.$username_form[$key].'<input type="hidden" name="username_form['.$key.']" size="10" value="'.$username_form[$key].'">'; |
|
60 | - echo '<input type="hidden" name="tutor_form['.$key.']" value="0">'; |
|
61 | - echo '<input type="hidden" name="admin_form['.$key.']" value="1">'; |
|
62 | - echo '<input type="hidden" name="password_form['.$key.']" value="'.$password_form[$key].'">'; |
|
63 | - echo '<input type="hidden" name="statut['.$key.']" value="'.$statut.'">'; |
|
64 | - echo '</td>'; |
|
65 | - echo '</tr>'; |
|
44 | + $nbre=$nbre+1; |
|
45 | + if($nbre & 1) $ndiv=2; else $ndiv=3; |
|
46 | + echo '<tr align="center" id="header'.$ndiv.'">'; |
|
47 | + echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>'; |
|
48 | + echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>'; |
|
49 | + if ($is_western_name_order) |
|
50 | + { |
|
51 | + echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
|
52 | + echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
|
53 | + } |
|
54 | + else |
|
55 | + { |
|
56 | + echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
|
57 | + echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
|
58 | + } |
|
59 | + echo '<td>'.$username_form[$key].'<input type="hidden" name="username_form['.$key.']" size="10" value="'.$username_form[$key].'">'; |
|
60 | + echo '<input type="hidden" name="tutor_form['.$key.']" value="0">'; |
|
61 | + echo '<input type="hidden" name="admin_form['.$key.']" value="1">'; |
|
62 | + echo '<input type="hidden" name="password_form['.$key.']" value="'.$password_form[$key].'">'; |
|
63 | + echo '<input type="hidden" name="statut['.$key.']" value="'.$statut.'">'; |
|
64 | + echo '</td>'; |
|
65 | + echo '</tr>'; |
|
66 | 66 | } |
67 | 67 | echo '</table>'; |
68 | 68 | echo '<br />'; |
@@ -9,9 +9,9 @@ discard block |
||
9 | 9 | /** |
10 | 10 | * This form is included by ldap_import_students.php and ldap_import_students_to_session.php |
11 | 11 | */ |
12 | -$nbre=0; |
|
12 | +$nbre = 0; |
|
13 | 13 | echo '<form name="form" method="post" action="'.api_get_self().'?annee='.Security::remove_XSS($annee).'">'; |
14 | - if($statut==1) |
|
14 | + if ($statut == 1) |
|
15 | 15 | { |
16 | 16 | echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>'; |
17 | 17 | } |
@@ -19,30 +19,30 @@ discard block |
||
19 | 19 | { |
20 | 20 | echo '<input type="hidden" name="mailling" value="1">'; |
21 | 21 | } |
22 | -if(!empty($course)) |
|
22 | +if (!empty($course)) |
|
23 | 23 | { |
24 | 24 | echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">'; |
25 | 25 | } |
26 | -elseif(!empty($id_session)) |
|
26 | +elseif (!empty($id_session)) |
|
27 | 27 | { |
28 | 28 | echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">'; |
29 | 29 | } |
30 | 30 | $is_western_name_order = api_is_western_name_order(); |
31 | 31 | echo '<input type="hidden" name="confirmed" value="yes">'; |
32 | 32 | echo '<table border="0" cellspacing="0" width="100%">'; |
33 | -echo '<tr align="center" id="header3">' . |
|
34 | - '<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>' . |
|
35 | - '<td width="40%"><b>'.get_lang('Email').'</b></td>' . |
|
33 | +echo '<tr align="center" id="header3">'. |
|
34 | + '<td width="15%"><input type="button" value="'.get_lang('AllSlashNone').'" onClick="checkAll();"></td>'. |
|
35 | + '<td width="40%"><b>'.get_lang('Email').'</b></td>'. |
|
36 | 36 | ($is_western_name_order |
37 | - ? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>' . |
|
37 | + ? '<td width="15%"><b>'.get_lang('FirstName').'</b></td>'. |
|
38 | 38 | '<td width="15%"><b>'.get_lang('Name').'</b></td>' |
39 | - : '<td width="15%"><b>'.get_lang('Name').'</b></td>' . |
|
40 | - '<td width="15%"><b>'.get_lang('FirstName').'</b></td>') . |
|
41 | - '<td width="15%"><b>'.get_lang('Login').'</b></td>' . |
|
39 | + : '<td width="15%"><b>'.get_lang('Name').'</b></td>'. |
|
40 | + '<td width="15%"><b>'.get_lang('FirstName').'</b></td>'). |
|
41 | + '<td width="15%"><b>'.get_lang('Login').'</b></td>'. |
|
42 | 42 | '</tr>'."\n"; |
43 | 43 | while (list ($key, $val) = each($nom_form)) { |
44 | - $nbre=$nbre+1; |
|
45 | - if($nbre & 1) $ndiv=2; else $ndiv=3; |
|
44 | + $nbre = $nbre + 1; |
|
45 | + if ($nbre & 1) $ndiv = 2; else $ndiv = 3; |
|
46 | 46 | echo '<tr align="center" id="header'.$ndiv.'">'; |
47 | 47 | echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>'; |
48 | 48 | echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>'; |
@@ -14,16 +14,14 @@ discard block |
||
14 | 14 | if($statut==1) |
15 | 15 | { |
16 | 16 | echo get_lang('EmailNotifySubscription').': <input type="checkbox" name="mailling" value="1" checked="checked"><i>'.get_lang('DontUnchek').'</i>'; |
17 | - } |
|
18 | - else |
|
17 | + } else |
|
19 | 18 | { |
20 | 19 | echo '<input type="hidden" name="mailling" value="1">'; |
21 | 20 | } |
22 | 21 | if(!empty($course)) |
23 | 22 | { |
24 | 23 | echo '<input type="hidden" name="course" value="'.Security::remove_XSS($course).'">'; |
25 | -} |
|
26 | -elseif(!empty($id_session)) |
|
24 | +} elseif(!empty($id_session)) |
|
27 | 25 | { |
28 | 26 | echo '<input type="hidden" name="id_session" value="'.Security::remove_XSS($id_session).'">'; |
29 | 27 | } |
@@ -42,7 +40,11 @@ discard block |
||
42 | 40 | '</tr>'."\n"; |
43 | 41 | while (list ($key, $val) = each($nom_form)) { |
44 | 42 | $nbre=$nbre+1; |
45 | - if($nbre & 1) $ndiv=2; else $ndiv=3; |
|
43 | + if($nbre & 1) { |
|
44 | + $ndiv=2; |
|
45 | + } else { |
|
46 | + $ndiv=3; |
|
47 | + } |
|
46 | 48 | echo '<tr align="center" id="header'.$ndiv.'">'; |
47 | 49 | echo '<td><input type="checkbox" name="checkboxes[]" value="'.$key.'" checked="checked"></td>'; |
48 | 50 | echo '<td>'.$email_form[$key].'<input type="hidden" name="email_form['.$key.']" size="40" value="'.$email_form[$key].'"></td>'; |
@@ -50,8 +52,7 @@ discard block |
||
50 | 52 | { |
51 | 53 | echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
52 | 54 | echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
53 | - } |
|
54 | - else |
|
55 | + } else |
|
55 | 56 | { |
56 | 57 | echo '<td>'.$nom_form[$key].'<input type="hidden" name="nom_form['.$key.']" size="20" value="'.$nom_form[$key].'"></td>'; |
57 | 58 | echo '<td>'.$prenom_form[$key].'<input type="hidden" name="prenom_form['.$key.']" size="20" value="'.$prenom_form[$key].'"></td>'; |
@@ -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,33 +108,33 @@ 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 | $message = Session::has('message') ? Session::read('message') : null; |
120 | 120 | |
121 | 121 | $toolbar = Display::toolbarButton( |
122 | 122 | get_lang('CreateSkill'), |
123 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_create.php', |
|
123 | + api_get_path(WEB_CODE_PATH).'admin/skill_create.php', |
|
124 | 124 | 'plus', |
125 | 125 | 'success', |
126 | 126 | ['title' => get_lang('CreateSkill')] |
127 | 127 | ); |
128 | 128 | $toolbar .= Display::toolbarButton( |
129 | 129 | get_lang('SkillsWheel'), |
130 | - api_get_path(WEB_CODE_PATH) . 'admin/skills_wheel.php', |
|
130 | + api_get_path(WEB_CODE_PATH).'admin/skills_wheel.php', |
|
131 | 131 | 'bullseye', |
132 | 132 | 'primary', |
133 | 133 | ['title' => get_lang('CreateSkill')] |
134 | 134 | ); |
135 | 135 | $toolbar .= Display::toolbarButton( |
136 | 136 | get_lang('BadgesManagement'), |
137 | - api_get_path(WEB_CODE_PATH) . 'admin/skill_badge_list.php', |
|
137 | + api_get_path(WEB_CODE_PATH).'admin/skill_badge_list.php', |
|
138 | 138 | 'shield', |
139 | 139 | 'warning', |
140 | 140 | ['title' => get_lang('BadgesManagement')] |
@@ -24,10 +24,10 @@ |
||
24 | 24 | Display :: display_header($tool_name, ""); |
25 | 25 | |
26 | 26 | //On sélectionne les user élèves |
27 | -$sql = "SELECT user_id FROM ".$table_user." user WHERE user.status= '5' ORDER by lastname " ; |
|
27 | +$sql = "SELECT user_id FROM ".$table_user." user WHERE user.status= '5' ORDER by lastname "; |
|
28 | 28 | $result = Database::query($sql); |
29 | 29 | |
30 | -while($row = Database::fetch_array($result)) { |
|
30 | +while ($row = Database::fetch_array($result)) { |
|
31 | 31 | $user_id = $row['user_id']; |
32 | 32 | // pour chaque élève, on trouve la dernière connexion |
33 | 33 | //$last_connection_date = UserManager:: delete_inactive_student($user_id, 2, true); |
@@ -4,8 +4,7 @@ |
||
4 | 4 | @author Andre Boivin base code |
5 | 5 | @author Julio Montoya fixing lot of little details |
6 | 6 | @todo this script is not ready for a production use that's why I'm commenting the function delete_inactive_student |
7 | - |
|
8 | -* @package chamilo.admin |
|
7 | + * @package chamilo.admin |
|
9 | 8 | * script pour effacer les user inactif depuis x temps |
10 | 9 | */ |
11 | 10 | $cidReset = true; |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | foreach ($mandatory_fields as $field) { |
27 | 27 | if (!isset($user_class[$field]) || strlen($user_class[$field]) == 0) { |
28 | - $user_class['error'] = get_lang($field . 'Mandatory'); |
|
28 | + $user_class['error'] = get_lang($field.'Mandatory'); |
|
29 | 29 | $errors[] = $user_class; |
30 | 30 | } |
31 | 31 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | // 2.1.1 Check whether code exists in DB |
38 | 38 | $exists = $usergroup->usergroup_exists($user_class['ClassName']); |
39 | 39 | if (!$exists) { |
40 | - $user_class['error'] = get_lang('CodeDoesNotExists') . ': ' . $user_class['ClassName']; |
|
40 | + $user_class['error'] = get_lang('CodeDoesNotExists').': '.$user_class['ClassName']; |
|
41 | 41 | $errors[] = $user_class; |
42 | 42 | } else { |
43 | 43 | $classcodes[$user_class['CourseCode']] = 1; |
@@ -49,14 +49,14 @@ discard block |
||
49 | 49 | if (!UserManager::is_username_empty($user_class['UserName'])) { |
50 | 50 | // 3.1. Check whether username is too long. |
51 | 51 | if (UserManager::is_username_too_long($user_class['UserName'])) { |
52 | - $user_class['error'] = get_lang('UserNameTooLong') . ': ' . $user_class['UserName']; |
|
52 | + $user_class['error'] = get_lang('UserNameTooLong').': '.$user_class['UserName']; |
|
53 | 53 | $errors[] = $user_class; |
54 | 54 | } |
55 | 55 | |
56 | 56 | $username = UserManager::purify_username($user_class['UserName'], $purification_option_for_usernames); |
57 | 57 | // 3.2. Check whether username exists. |
58 | 58 | if (UserManager::is_username_available($username)) { |
59 | - $user_class['error'] = get_lang('UnknownUser') . ': ' . $username; |
|
59 | + $user_class['error'] = get_lang('UnknownUser').': '.$username; |
|
60 | 60 | $errors[] = $user_class; |
61 | 61 | } |
62 | 62 | } |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | $class_name = $user_data['class_name']; |
106 | 106 | $user_list_name = $user_data['user_list_name']; |
107 | 107 | $usergroup->subscribe_users_to_usergroup($class_id, $user_list, $deleteUsersNotInList); |
108 | - $message .= Display::return_message(get_lang('Class') . ': ' . $class_name . '<br />', 'normal', false); |
|
109 | - $message .= Display::return_message(get_lang('Users') . ': ' . implode(', ', $user_list_name)); |
|
108 | + $message .= Display::return_message(get_lang('Class').': '.$class_name.'<br />', 'normal', false); |
|
109 | + $message .= Display::return_message(get_lang('Users').': '.implode(', ', $user_list_name)); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | return $message; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $this_section = SECTION_PLATFORM_ADMIN; |
129 | 129 | api_protect_admin_script(true); |
130 | 130 | |
131 | -$tool_name = get_lang('AddUsersToAClass') . ' CSV'; |
|
131 | +$tool_name = get_lang('AddUsersToAClass').' CSV'; |
|
132 | 132 | |
133 | 133 | $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
134 | 134 | $interbreadcrumb[] = array('url' => 'usergroups.php', 'name' => get_lang('Classes')); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | if (count($errors) != 0) { |
165 | 165 | $error_message = "\n"; |
166 | 166 | foreach ($errors as $index => $error_class_user) { |
167 | - $error_message .= get_lang('Line') . ' ' . $error_class_user['line'] . ': ' . $error_class_user['error'] . '</b>'; |
|
167 | + $error_message .= get_lang('Line').' '.$error_class_user['line'].': '.$error_class_user['error'].'</b>'; |
|
168 | 168 | $error_message .= "<br />"; |
169 | 169 | } |
170 | 170 | $error_message .= "\n"; |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | $form->display(); |
174 | 174 | ?> |
175 | -<p><?php echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')'; ?> :</p> |
|
175 | +<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p> |
|
176 | 176 | <pre> |
177 | 177 | <b>UserName</b>;<b>ClassName</b> |
178 | 178 | jdoe;class01 |
@@ -11,6 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Validates imported data. |
14 | + * @param Ddeboer\DataImport\Reader\CsvReader $user_classes |
|
14 | 15 | */ |
15 | 16 | function validate_data($user_classes) { |
16 | 17 | global $purification_option_for_usernames; |
@@ -66,6 +67,7 @@ discard block |
||
66 | 67 | |
67 | 68 | /** |
68 | 69 | * Saves imported data. |
70 | + * @param Ddeboer\DataImport\Reader\CsvReader $users_classes |
|
69 | 71 | */ |
70 | 72 | function save_data($users_classes, $deleteUsersNotInList = false) { |
71 | 73 | |
@@ -115,7 +117,7 @@ discard block |
||
115 | 117 | /** |
116 | 118 | * Reads a CSV-file. |
117 | 119 | * @param string $file Path to the CSV-file |
118 | - * @return array All course-information read from the file |
|
120 | + * @return Ddeboer\DataImport\Reader\CsvReader All course-information read from the file |
|
119 | 121 | */ |
120 | 122 | function parse_csv_data($file) { |
121 | 123 | $courses = Import::csvToArray($file); |