@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | echo "Chamilo Bulk Nodes Creation v.1.0\n"; |
20 | 20 | echo "=================================\n"; |
21 | 21 | require_once('../../../main/inc/global.inc.php'); |
22 | -require_once('clilib.php'); // cli only functions |
|
22 | +require_once('clilib.php'); // cli only functions |
|
23 | 23 | // Ensure errors are well explained |
24 | 24 | ini_set('debug_display', 1); |
25 | 25 | ini_set('debug_level', E_ALL); |
@@ -91,19 +91,19 @@ discard block |
||
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | -require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions |
|
94 | +require_once($_configuration['root_sys'].'local/classes/database.class.php'); // cli only functions |
|
95 | 95 | if ($options['verbose']) { |
96 | 96 | echo "loaded dbclass\n"; |
97 | 97 | } |
98 | -require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions |
|
98 | +require_once($_configuration['root_sys'].'local/classes/textlib.class.php'); // cli only functions |
|
99 | 99 | if ($options['verbose']) { |
100 | 100 | echo "loaded textlib\n"; |
101 | 101 | } |
102 | -require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API |
|
102 | +require_once($_configuration['root_sys'].'local/classes/mootochamlib.php'); // moodle like API |
|
103 | 103 | if ($options['verbose']) { |
104 | 104 | echo "loaded moodle wrapping\n"; |
105 | 105 | } |
106 | -require_once($_configuration['root_sys'] . '/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
|
106 | +require_once($_configuration['root_sys'].'/plugin/vchamilo/lib/vchamilo_plugin.class.php'); |
|
107 | 107 | if ($options['verbose']) { |
108 | 108 | echo "loaded vchamilo plugin\n"; |
109 | 109 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $type = isset($_REQUEST['type']) ? Security::remove_XSS($_REQUEST['type']) : ''; |
28 | 28 | $course_code = isset($_REQUEST['course']) ? Security::remove_XSS($_REQUEST['course']) : ''; |
29 | 29 | $courseInfo = api_get_course_info($course_code); |
30 | -$courseId = (!empty($courseInfo['real_id'])?$courseInfo['real_id']:null); |
|
30 | +$courseId = (!empty($courseInfo['real_id']) ? $courseInfo['real_id'] : null); |
|
31 | 31 | $connections = MySpace::get_connections_to_course($user_id, $courseId, $session_id); |
32 | 32 | $quote_simple = "'"; |
33 | 33 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | echo Display::page_header(get_lang('DetailsStudentInCourse')); |
128 | 128 | echo Display::page_subheader( |
129 | - get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$courseInfo['title'] . ' (' . $course_code . ')' |
|
129 | + get_lang('User').': '.$userInfo['complete_name'].' - '.get_lang('Course').': '.$courseInfo['title'].' ('.$course_code.')' |
|
130 | 130 | ); |
131 | 131 | |
132 | 132 | $form->setDefaults(array('from' => $from, 'to' => $to)); |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | // This request is only the preparation for the update of the home_top |
142 | 142 | $home_top = ''; |
143 | 143 | if (is_file($homep.$topf.'_'.$lang.$ext) && is_readable($homep.$topf.'_'.$lang.$ext)) { |
144 | - $home_top = @(string)file_get_contents($homep.$topf.'_'.$lang.$ext); |
|
144 | + $home_top = @(string) file_get_contents($homep.$topf.'_'.$lang.$ext); |
|
145 | 145 | } elseif (is_file($homep.$topf.$lang.$ext) && is_readable($homep.$topf.$lang.$ext)) { |
146 | - $home_top = @(string)file_get_contents($homep.$topf.$lang.$ext); |
|
146 | + $home_top = @(string) file_get_contents($homep.$topf.$lang.$ext); |
|
147 | 147 | } else { |
148 | 148 | $errorMsg = get_lang('HomePageFilesNotReadable'); |
149 | 149 | } |
@@ -184,15 +184,15 @@ discard block |
||
184 | 184 | if (api_is_western_name_order()) { |
185 | 185 | // FIRST NAME and LAST NAME |
186 | 186 | $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40, 'disabled' => 'disabled')); |
187 | - $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40, 'disabled' => 'disabled')); |
|
187 | + $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40, 'disabled' => 'disabled')); |
|
188 | 188 | } else { |
189 | 189 | // LAST NAME and FIRST NAME |
190 | - $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40, 'disabled' => 'disabled')); |
|
190 | + $form->addElement('text', 'lastname', get_lang('LastName'), array('size' => 40, 'disabled' => 'disabled')); |
|
191 | 191 | $form->addElement('text', 'firstname', get_lang('FirstName'), array('size' => 40, 'disabled' => 'disabled')); |
192 | 192 | } |
193 | 193 | $form->applyFilter('firstname', 'trim'); |
194 | 194 | $form->applyFilter('lastname', 'trim'); |
195 | - $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required'); |
|
195 | + $form->addRule('lastname', get_lang('ThisFieldIsRequired'), 'required'); |
|
196 | 196 | $form->addRule('firstname', get_lang('ThisFieldIsRequired'), 'required'); |
197 | 197 | |
198 | 198 | |
@@ -210,10 +210,10 @@ discard block |
||
210 | 210 | $form->addRule('username', get_lang('ThisFieldIsRequired'), 'required'); |
211 | 211 | $form->addRule('username', get_lang('UsernameWrong'), 'username'); |
212 | 212 | $form->addRule('username', get_lang('UserTaken'), 'username_available'); |
213 | - $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string)USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
|
213 | + $form->addRule('username', sprintf(get_lang('UsernameMaxXCharacters'), (string) USERNAME_MAX_LENGTH), 'maxlength', USERNAME_MAX_LENGTH); |
|
214 | 214 | |
215 | 215 | // PASSWORD |
216 | - $form->addElement('password', 'pass1', get_lang('Pass'), array('size' => 40, 'disabled' => 'disabled')); |
|
216 | + $form->addElement('password', 'pass1', get_lang('Pass'), array('size' => 40, 'disabled' => 'disabled')); |
|
217 | 217 | $form->addElement('password', 'pass2', get_lang('Confirmation'), array('size' => 40, 'disabled' => 'disabled')); |
218 | 218 | $form->addRule('pass1', get_lang('ThisFieldIsRequired'), 'required'); |
219 | 219 | $form->addRule('pass2', get_lang('ThisFieldIsRequired'), 'required'); |
@@ -246,25 +246,25 @@ discard block |
||
246 | 246 | |
247 | 247 | // EXTENDED FIELDS |
248 | 248 | if (api_get_setting('extended_profile') == 'true' && |
249 | - api_get_setting('extendedprofile_registration','mycomptetences') == 'true' |
|
249 | + api_get_setting('extendedprofile_registration', 'mycomptetences') == 'true' |
|
250 | 250 | ) { |
251 | 251 | $form->addHtmlEditor('competences', get_lang('MyCompetences'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130')); |
252 | 252 | } |
253 | 253 | |
254 | 254 | if (api_get_setting('extended_profile') == 'true' && |
255 | - api_get_setting('extendedprofile_registration','mydiplomas') == 'true' |
|
255 | + api_get_setting('extendedprofile_registration', 'mydiplomas') == 'true' |
|
256 | 256 | ) { |
257 | 257 | $form->addHtmlEditor('diplomas', get_lang('MyDiplomas'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130')); |
258 | 258 | } |
259 | 259 | |
260 | 260 | if (api_get_setting('extended_profile') == 'true' && |
261 | - api_get_setting('extendedprofile_registration','myteach') == 'true' |
|
261 | + api_get_setting('extendedprofile_registration', 'myteach') == 'true' |
|
262 | 262 | ) { |
263 | 263 | $form->addHtmlEditor('teach', get_lang('MyTeach'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130')); |
264 | 264 | } |
265 | 265 | |
266 | 266 | if (api_get_setting('extended_profile') == 'true' && |
267 | - api_get_setting('extendedprofile_registration','mypersonalopenarea') == 'true' |
|
267 | + api_get_setting('extendedprofile_registration', 'mypersonalopenarea') == 'true' |
|
268 | 268 | ) { |
269 | 269 | $form->addHtmlEditor('openarea', get_lang('MyPersonalOpenArea'), false, false, array('ToolbarSet' => 'Profile', 'Width' => '100%', 'Height' => '130')); |
270 | 270 | } |
@@ -354,14 +354,14 @@ discard block |
||
354 | 354 | |
355 | 355 | $form->setDefaults($defaults); |
356 | 356 | |
357 | -switch ($action){ |
|
357 | +switch ($action) { |
|
358 | 358 | case 'edit_top': |
359 | 359 | if ($action == 'edit_top') { |
360 | 360 | $name = $topf; |
361 | 361 | $open = $home_top; |
362 | 362 | } else { |
363 | 363 | $name = $newsf; |
364 | - $open = @(string)file_get_contents($homep.$newsf.'_'.$lang.$ext); |
|
364 | + $open = @(string) file_get_contents($homep.$newsf.'_'.$lang.$ext); |
|
365 | 365 | $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open))); |
366 | 366 | } |
367 | 367 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | |
372 | 372 | $default = array(); |
373 | 373 | $form = new FormValidator('configure_inscription_'.$action, 'post', api_get_self().'?action='.$action, '', array('style' => 'margin: 0px;')); |
374 | - $renderer =& $form->defaultRenderer(); |
|
374 | + $renderer = & $form->defaultRenderer(); |
|
375 | 375 | $renderer->setHeaderTemplate(''); |
376 | 376 | $renderer->setFormTemplate('<form{attributes}><table border="0" cellpadding="5" cellspacing="0" width="100%">{content}</table></form>'); |
377 | 377 | $renderer->setCustomElementTemplate('<tr><td>{element}</td></tr>'); |
@@ -390,9 +390,9 @@ discard block |
||
390 | 390 | |
391 | 391 | $open = ''; |
392 | 392 | if (file_exists($homep.$topf.'_'.$lang.$ext)) { |
393 | - $open = @(string)file_get_contents($homep.$topf.'_'.$lang.$ext); |
|
393 | + $open = @(string) file_get_contents($homep.$topf.'_'.$lang.$ext); |
|
394 | 394 | } else { |
395 | - $open = @(string)file_get_contents($homep.$topf.$ext); |
|
395 | + $open = @(string) file_get_contents($homep.$topf.$ext); |
|
396 | 396 | } |
397 | 397 | $open = api_to_system_encoding($open, api_detect_encoding(strip_tags($open))); |
398 | 398 | if (!empty($open)) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $tbl_course_rel_user = $table = Database::get_main_table(TABLE_MAIN_COURSE_USER); |
47 | 47 | $sql = "SELECT user_id |
48 | 48 | FROM $tbl_course_rel_user |
49 | - WHERE status = '1' AND c_id = '" . api_get_course_int_id() . "'"; |
|
49 | + WHERE status = '1' AND c_id = '".api_get_course_int_id()."'"; |
|
50 | 50 | $result = Database::query($sql); |
51 | 51 | while ($user = Database::fetch_assoc($result)) { |
52 | 52 | unset($blog_users[$user['user_id']]); |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | -echo "<form method=\"post\" action=\"" . str_replace('&', '&', $_SERVER['REQUEST_URI']) . "\">"; |
|
113 | +echo "<form method=\"post\" action=\"".str_replace('&', '&', $_SERVER['REQUEST_URI'])."\">"; |
|
114 | 114 | |
115 | 115 | // --------------------------------------------------- |
116 | 116 | // DISPLAYING THE ROLES LIST |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | if (api_get_setting('user_roles') == 'true') { |
120 | 120 | // the list of the roles for the user |
121 | - echo '<strong>' . get_lang('UserRoles') . '</strong><br />'; |
|
121 | + echo '<strong>'.get_lang('UserRoles').'</strong><br />'; |
|
122 | 122 | $current_user_course_roles = get_roles('user', $user_id); |
123 | 123 | $current_user_platform_roles = get_roles('user', $user_id, 'platform'); |
124 | 124 | display_role_list($current_user_course_roles, $current_user_platform_roles); |
@@ -132,24 +132,24 @@ discard block |
||
132 | 132 | |
133 | 133 | // the header |
134 | 134 | echo "\t<tr>\n"; |
135 | -echo "\t\t<th rowspan=\"2\">" . get_lang('Module') . "</th>\n"; |
|
136 | -echo "\t\t<th colspan=\"4\">" . get_lang('ArticleManager') . "</th>\n"; |
|
137 | -echo "\t\t<th colspan=\"3\">" . get_lang('CommentManager') . "</th>\n"; |
|
138 | -echo "\t\t<th colspan=\"3\">" . get_lang('BlogManager') . "</th>\n"; |
|
135 | +echo "\t\t<th rowspan=\"2\">".get_lang('Module')."</th>\n"; |
|
136 | +echo "\t\t<th colspan=\"4\">".get_lang('ArticleManager')."</th>\n"; |
|
137 | +echo "\t\t<th colspan=\"3\">".get_lang('CommentManager')."</th>\n"; |
|
138 | +echo "\t\t<th colspan=\"3\">".get_lang('BlogManager')."</th>\n"; |
|
139 | 139 | echo "\t</tr>\n"; |
140 | 140 | |
141 | 141 | // Subheader |
142 | 142 | echo "\t<tr>\n"; |
143 | -echo "\t\t<th align='center'>" . get_lang('Add') . "</th>\n"; |
|
144 | -echo "\t\t<th align='center'>" . get_lang('Delete') . "</th>\n"; |
|
145 | -echo "\t\t<th align='center'>" . get_lang('Edit') . "</th>\n"; |
|
146 | -echo "\t\t<th align='center'>" . get_lang('Rate') . "</th>\n"; |
|
147 | -echo "\t\t<th align='center'>" . get_lang('Add') . "</th>\n"; |
|
148 | -echo "\t\t<th align='center'>" . get_lang('Delete') . "</th>\n"; |
|
149 | -echo "\t\t<th align='center'>" . get_lang('Rate') . "</th>\n"; |
|
150 | -echo "\t\t<th align='center'>" . get_lang('Tasks') . "</th>\n"; |
|
151 | -echo "\t\t<th align='center'>" . get_lang('Members') . "</th>\n"; |
|
152 | -echo "\t\t<th align='center'>" . get_lang('Roles') . "</th>\n"; |
|
143 | +echo "\t\t<th align='center'>".get_lang('Add')."</th>\n"; |
|
144 | +echo "\t\t<th align='center'>".get_lang('Delete')."</th>\n"; |
|
145 | +echo "\t\t<th align='center'>".get_lang('Edit')."</th>\n"; |
|
146 | +echo "\t\t<th align='center'>".get_lang('Rate')."</th>\n"; |
|
147 | +echo "\t\t<th align='center'>".get_lang('Add')."</th>\n"; |
|
148 | +echo "\t\t<th align='center'>".get_lang('Delete')."</th>\n"; |
|
149 | +echo "\t\t<th align='center'>".get_lang('Rate')."</th>\n"; |
|
150 | +echo "\t\t<th align='center'>".get_lang('Tasks')."</th>\n"; |
|
151 | +echo "\t\t<th align='center'>".get_lang('Members')."</th>\n"; |
|
152 | +echo "\t\t<th align='center'>".get_lang('Roles')."</th>\n"; |
|
153 | 153 | echo "\t</tr>\n"; |
154 | 154 | |
155 | 155 | // the main area with the checkboxes or images |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | display_image_matrix_for_blogs( |
173 | 173 | $current_user_permissions, |
174 | 174 | $user_id, |
175 | - 'BLOG_' . $blog_id, |
|
175 | + 'BLOG_'.$blog_id, |
|
176 | 176 | $value, |
177 | 177 | (isset($inherited_permissions) ? $inherited_permissions : null), |
178 | 178 | (isset($course_admin) ? $course_admin : null) |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | echo "</form><br />"; |
192 | 192 | |
193 | 193 | // LEGEND |
194 | -echo '<strong>' . get_lang('Legend') . '</strong><br />'; |
|
195 | -echo '<img src="../img/wrong.gif" /> ' . get_lang('UserHasPermissionNot') . '<br />'; |
|
196 | -echo '<img src="../img/checkbox_on2.gif" /> ' . get_lang('UserHasPermission') . '<br />'; |
|
197 | -echo '<img src="../img/checkbox_on3.gif" /> ' . get_lang('UserHasPermissionByRoleGroup') . '<br />'; |
|
194 | +echo '<strong>'.get_lang('Legend').'</strong><br />'; |
|
195 | +echo '<img src="../img/wrong.gif" /> '.get_lang('UserHasPermissionNot').'<br />'; |
|
196 | +echo '<img src="../img/checkbox_on2.gif" /> '.get_lang('UserHasPermission').'<br />'; |
|
197 | +echo '<img src="../img/checkbox_on3.gif" /> '.get_lang('UserHasPermissionByRoleGroup').'<br />'; |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $result[$i]['mysql'] = mysql_query($array[$i]); |
11 | 11 | |
12 | 12 | if (!$result[$i]['mysql']) { |
13 | - die("error in query $i : " . $array[$i]); |
|
13 | + die("error in query $i : ".$array[$i]); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | // fields |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $numberOfResult = mysql_num_rows($result[0]['mysql']); |
30 | 30 | for ($i = 1; $i < $result['num_queries']; $i++) { |
31 | 31 | if ($numberOfResult != mysql_num_rows($result[$i]['mysql'])) { |
32 | - die("wrong number of row: $numberOfResult vs " . |
|
33 | - mysql_num_rows($result[$i]['mysql']) . " on query $i"); |
|
32 | + die("wrong number of row: $numberOfResult vs ". |
|
33 | + mysql_num_rows($result[$i]['mysql'])." on query $i"); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 |
@@ -15,32 +15,32 @@ |
||
15 | 15 | { |
16 | 16 | // fetch columns |
17 | 17 | $result = array(); |
18 | - $query = 'select r.id as kid, c.title as course ' . |
|
19 | - 'from ' . |
|
20 | - Database::get_main_table(TABLE_MAIN_REPORTS_KEYS) . ' r, ' . |
|
21 | - Database::get_main_table(TABLE_MAIN_COURSE) . ' c ' . |
|
22 | - 'where r.course_id=c.id and r.tool_id is null and r.child_id is null' . |
|
18 | + $query = 'select r.id as kid, c.title as course '. |
|
19 | + 'from '. |
|
20 | + Database::get_main_table(TABLE_MAIN_REPORTS_KEYS).' r, '. |
|
21 | + Database::get_main_table(TABLE_MAIN_COURSE).' c '. |
|
22 | + 'where r.course_id=c.id and r.tool_id is null and r.child_id is null'. |
|
23 | 23 | ' order by c.title'; |
24 | 24 | $columns = Database::query($query); |
25 | 25 | if (Database::num_rows($columns) == 0) { |
26 | - die('<b>' . get_lang('no data found: ' . $query) . '</b>'); |
|
26 | + die('<b>'.get_lang('no data found: '.$query).'</b>'); |
|
27 | 27 | } |
28 | 28 | $columns = Database::store_result($columns); |
29 | 29 | |
30 | 30 | // fetch data |
31 | 31 | $query = 'select u.lastname Name, u.firstname Firstname'; |
32 | 32 | foreach ($columns as $key => $column) { |
33 | - $query .= ', sec_to_time(k' . $key . '.report_time) as `' . |
|
34 | - $column['course'] . '` '; |
|
33 | + $query .= ', sec_to_time(k'.$key.'.report_time) as `'. |
|
34 | + $column['course'].'` '; |
|
35 | 35 | } |
36 | - $query .= ' from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u '; |
|
36 | + $query .= ' from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
|
37 | 37 | foreach ($columns as $key => $column) // fixme sessions |
38 | 38 | { |
39 | - $query .= 'left outer join ' . |
|
40 | - Database::get_main_table(TABLE_MAIN_REPORTS_VALUES) . |
|
41 | - ' k' . $key . |
|
42 | - ' on k' . $key . '.key_id = ' . $column['kid'] . |
|
43 | - ' and k' . $key . '.user_id = u.user_id '; |
|
39 | + $query .= 'left outer join '. |
|
40 | + Database::get_main_table(TABLE_MAIN_REPORTS_VALUES). |
|
41 | + ' k'.$key. |
|
42 | + ' on k'.$key.'.key_id = '.$column['kid']. |
|
43 | + ' and k'.$key.'.user_id = u.user_id '; |
|
44 | 44 | } |
45 | 45 | return $query; |
46 | 46 | } |
@@ -19,18 +19,18 @@ discard block |
||
19 | 19 | |
20 | 20 | // Nom, prenom |
21 | 21 | $query = 'select u.lastname as "Last name", u.firstname as "First name" '; |
22 | - $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u '; |
|
23 | - $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') '; |
|
22 | + $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
|
23 | + $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; |
|
24 | 24 | $query .= ' order by u.user_id '; |
25 | 25 | $queries[0] = $query; |
26 | 26 | |
27 | 27 | // Custom Field |
28 | 28 | foreach (array(10 => "description") as $k => $v) { |
29 | - $query = 'select ufv.value as "' . $v . '" '; |
|
30 | - $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u '; |
|
31 | - $query .= 'left outer join ' . Database::get_main_table(TABLE_EXTRA_FIELD_VALUES) . ' ufv '; |
|
32 | - $query .= ' on ufv.item_id = u.user_id and ufv.field_id = ' . $k; |
|
33 | - $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') '; |
|
29 | + $query = 'select ufv.value as "'.$v.'" '; |
|
30 | + $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
|
31 | + $query .= 'left outer join '.Database::get_main_table(TABLE_EXTRA_FIELD_VALUES).' ufv '; |
|
32 | + $query .= ' on ufv.item_id = u.user_id and ufv.field_id = '.$k; |
|
33 | + $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; |
|
34 | 34 | $query .= ' order by u.user_id '; |
35 | 35 | $queries[] = $query; |
36 | 36 | } |
@@ -38,21 +38,21 @@ discard block |
||
38 | 38 | // Stored Value |
39 | 39 | $sv = array(); |
40 | 40 | foreach ($sv as $k => $v) { |
41 | - $query = 'select sec_to_time(sv.sv_value) as "' . $v . '" '; |
|
42 | - $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u '; |
|
43 | - $query .= ' left outer join ' . Database::get_main_table(TABLE_TRACK_STORED_VALUES) . ' sv '; |
|
44 | - $query .= 'on sv.user_id = u.user_id and sv_key = "' . $k . '" '; |
|
45 | - $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') '; |
|
41 | + $query = 'select sec_to_time(sv.sv_value) as "'.$v.'" '; |
|
42 | + $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
|
43 | + $query .= ' left outer join '.Database::get_main_table(TABLE_TRACK_STORED_VALUES).' sv '; |
|
44 | + $query .= 'on sv.user_id = u.user_id and sv_key = "'.$k.'" '; |
|
45 | + $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; |
|
46 | 46 | $query .= ' order by u.user_id '; |
47 | 47 | $queries[] = $query; |
48 | 48 | } |
49 | 49 | |
50 | 50 | // premiere connexion |
51 | 51 | $query = 'select min(tel.login_date) as "First connection", max(tel.logout_date) as "Latest connection" '; |
52 | - $query .= 'from ' . Database::get_main_table(TABLE_MAIN_USER) . ' u '; |
|
53 | - $query .= 'left outer join ' . Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN) . ' tel '; |
|
52 | + $query .= 'from '.Database::get_main_table(TABLE_MAIN_USER).' u '; |
|
53 | + $query .= 'left outer join '.Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN).' tel '; |
|
54 | 54 | $query .= ' on tel.login_user_id = u.user_id '; |
55 | - $query .= ' where u.user_id in (' . reports_getVisibilitySQL() . ') '; |
|
55 | + $query .= ' where u.user_id in ('.reports_getVisibilitySQL().') '; |
|
56 | 56 | $query .= ' group by u.user_id '; |
57 | 57 | $query .= ' order by u.user_id '; |
58 | 58 | $queries[] = $query; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | array_push($reports_modules['course'], |
17 | 17 | array( |
18 | 18 | 'keys_query' => |
19 | - 'select ' . $course_id . ' as course_id, "' . $course_code . '" as course_code', |
|
19 | + 'select '.$course_id.' as course_id, "'.$course_code.'" as course_code', |
|
20 | 20 | 'values_query_function' => 'reports_modules_course_val' |
21 | 21 | )); |
22 | 22 | } |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | return array( |
27 | 27 | 'type' => 'sql', |
28 | 28 | 'sql' => |
29 | - 'select ' . $key_id . ', user_id as uid, ' . |
|
30 | - '-1 as session_id, -1 as attempt, null as score, ' . |
|
31 | - 'NULL as progress, ' . |
|
32 | - '(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from ' . |
|
33 | - Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS) . |
|
34 | - ' where c_id = ' . $course['real_id'] . |
|
29 | + 'select '.$key_id.', user_id as uid, '. |
|
30 | + '-1 as session_id, -1 as attempt, null as score, '. |
|
31 | + 'NULL as progress, '. |
|
32 | + '(sum(logout_course_date) - sum(login_course_date)) as time, null as ts from '. |
|
33 | + Database::get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS). |
|
34 | + ' where c_id = '.$course['real_id']. |
|
35 | 35 | ' group by user_id' |
36 | 36 | ); |
37 | 37 | } |
@@ -17,11 +17,11 @@ discard block |
||
17 | 17 | array_push($reports_modules['scorm'], |
18 | 18 | array( |
19 | 19 | 'keys_query' => |
20 | - 'select ' . $course_id . ' as course_id, ' . |
|
21 | - $reports_modules_scorm_toolid . ' as tool_id, ' . |
|
22 | - 'lp.id as child_id, lp.name as child_name, ' . |
|
23 | - "'" . $course_db . "'" . ' as course_db from ' . |
|
24 | - Database::get_course_table(TABLE_LP_MAIN) . ' lp', |
|
20 | + 'select '.$course_id.' as course_id, '. |
|
21 | + $reports_modules_scorm_toolid.' as tool_id, '. |
|
22 | + 'lp.id as child_id, lp.name as child_name, '. |
|
23 | + "'".$course_db."'".' as course_db from '. |
|
24 | + Database::get_course_table(TABLE_LP_MAIN).' lp', |
|
25 | 25 | 'values_query_function' => 'reports_modules_scorm_packageVal' |
26 | 26 | )); |
27 | 27 | |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | array_push($reports_modules['scorm'], |
30 | 30 | array( |
31 | 31 | 'keys_query' => |
32 | - 'select ' . $course_id . ' as course_id, ' . |
|
33 | - $reports_modules_scorm_toolid . ' as tool_id, ' . |
|
34 | - 'lp.id as child_id, lp.name as child_name, ' . |
|
35 | - 'lpi.id as subchild_id, lpi.title as subchild_name, ' . |
|
36 | - "'" . $course_db . "'" . ' as course_db from ' . |
|
37 | - Database::get_course_table(TABLE_LP_MAIN, $course_db) . |
|
38 | - ' lp,' . |
|
39 | - Database::get_course_table(TABLE_LP_ITEM, $course_db) . |
|
32 | + 'select '.$course_id.' as course_id, '. |
|
33 | + $reports_modules_scorm_toolid.' as tool_id, '. |
|
34 | + 'lp.id as child_id, lp.name as child_name, '. |
|
35 | + 'lpi.id as subchild_id, lpi.title as subchild_name, '. |
|
36 | + "'".$course_db."'".' as course_db from '. |
|
37 | + Database::get_course_table(TABLE_LP_MAIN, $course_db). |
|
38 | + ' lp,'. |
|
39 | + Database::get_course_table(TABLE_LP_ITEM, $course_db). |
|
40 | 40 | ' lpi where lp.id = lpi.lp_id', |
41 | 41 | 'values_query_function' => 'reports_modules_scorm_scoVal' |
42 | 42 | )); |
@@ -45,24 +45,24 @@ discard block |
||
45 | 45 | array_push($reports_modules['scorm'], |
46 | 46 | array( |
47 | 47 | 'keys_query' => |
48 | - 'select distinct ' . $course_id . ' as course_id, ' . |
|
49 | - $reports_modules_scorm_toolid . ' as tool_id, ' . |
|
50 | - 'lp.id as child_id, lp.name as child_name, ' . |
|
51 | - 'lpi.id as subchild_id, ' . |
|
52 | - 'lpi.title as subchild_name, ' . |
|
53 | - 'null as subsubchild_id, ' . |
|
54 | - 'lpivo.objective_id as subsubchild_name, ' . |
|
55 | - "'" . $course_db . "'" . ' as course_db from ' . |
|
56 | - Database::get_course_table(TABLE_LP_MAIN, $course_db) . |
|
57 | - ' lp,' . |
|
58 | - Database::get_course_table(TABLE_LP_ITEM, $course_db) . |
|
59 | - ' lpi, ' . |
|
60 | - Database::get_course_table(TABLE_LP_ITEM_VIEW, $course_db) . |
|
61 | - ' lpiv, ' . |
|
62 | - Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $course_db) . |
|
63 | - ' lpivo ' . |
|
64 | - 'where lp.id = lpi.lp_id ' . |
|
65 | - 'and lpi.id = lpiv.lp_item_id ' . |
|
48 | + 'select distinct '.$course_id.' as course_id, '. |
|
49 | + $reports_modules_scorm_toolid.' as tool_id, '. |
|
50 | + 'lp.id as child_id, lp.name as child_name, '. |
|
51 | + 'lpi.id as subchild_id, '. |
|
52 | + 'lpi.title as subchild_name, '. |
|
53 | + 'null as subsubchild_id, '. |
|
54 | + 'lpivo.objective_id as subsubchild_name, '. |
|
55 | + "'".$course_db."'".' as course_db from '. |
|
56 | + Database::get_course_table(TABLE_LP_MAIN, $course_db). |
|
57 | + ' lp,'. |
|
58 | + Database::get_course_table(TABLE_LP_ITEM, $course_db). |
|
59 | + ' lpi, '. |
|
60 | + Database::get_course_table(TABLE_LP_ITEM_VIEW, $course_db). |
|
61 | + ' lpiv, '. |
|
62 | + Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $course_db). |
|
63 | + ' lpivo '. |
|
64 | + 'where lp.id = lpi.lp_id '. |
|
65 | + 'and lpi.id = lpiv.lp_item_id '. |
|
66 | 66 | 'and lpiv.id = lpivo.lp_iv_id ', |
67 | 67 | 'values_query_function' => 'reports_modules_scorm_objVal' |
68 | 68 | )); |
@@ -73,12 +73,12 @@ discard block |
||
73 | 73 | return array( |
74 | 74 | 'type' => 'sql', |
75 | 75 | 'sql' => |
76 | - 'select ' . $key_id . ', user_id as uid, ' . |
|
77 | - 'session_id, view_count as attempt, null as score, ' . |
|
78 | - 'progress as progress, ' . |
|
79 | - 'null as time, null as ts from ' . |
|
80 | - Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']) . |
|
81 | - ' where lp_id = ' . $scorm['child_id'] |
|
76 | + 'select '.$key_id.', user_id as uid, '. |
|
77 | + 'session_id, view_count as attempt, null as score, '. |
|
78 | + 'progress as progress, '. |
|
79 | + 'null as time, null as ts from '. |
|
80 | + Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']). |
|
81 | + ' where lp_id = '.$scorm['child_id'] |
|
82 | 82 | ); |
83 | 83 | } |
84 | 84 | |
@@ -87,25 +87,25 @@ discard block |
||
87 | 87 | return array( |
88 | 88 | 'type' => 'sql', |
89 | 89 | 'sql' => |
90 | - 'select ' . $key_id . ', lpv.user_id as uid, ' . |
|
91 | - 'lpv.session_id, lpiv.view_count as attempt, ' . |
|
92 | - 'lpiv.score as score, ' . |
|
93 | - '(case lpiv.status ' . |
|
94 | - 'when "incomplete" then 0 ' . |
|
95 | - 'when "completed" then 1 ' . |
|
96 | - 'when "passed" then 2 ' . |
|
97 | - 'when "failed" then 3 ' . |
|
98 | - 'when "browsed" then 4 ' . |
|
99 | - 'when "not attempted" then 5 ' . |
|
100 | - 'else 6 ' . |
|
101 | - 'end) as progress, ' . |
|
102 | - 'lpiv.total_time as time, null as ts from ' . |
|
103 | - Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']) . |
|
104 | - ' lpv, ' . |
|
105 | - Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']) . |
|
106 | - ' lpiv ' . |
|
107 | - ' where lpv.lp_id = ' . $scorm['child_id'] . |
|
108 | - ' and lpiv.lp_item_id = ' . $scorm['subchild_id'] . |
|
90 | + 'select '.$key_id.', lpv.user_id as uid, '. |
|
91 | + 'lpv.session_id, lpiv.view_count as attempt, '. |
|
92 | + 'lpiv.score as score, '. |
|
93 | + '(case lpiv.status '. |
|
94 | + 'when "incomplete" then 0 '. |
|
95 | + 'when "completed" then 1 '. |
|
96 | + 'when "passed" then 2 '. |
|
97 | + 'when "failed" then 3 '. |
|
98 | + 'when "browsed" then 4 '. |
|
99 | + 'when "not attempted" then 5 '. |
|
100 | + 'else 6 '. |
|
101 | + 'end) as progress, '. |
|
102 | + 'lpiv.total_time as time, null as ts from '. |
|
103 | + Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']). |
|
104 | + ' lpv, '. |
|
105 | + Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']). |
|
106 | + ' lpiv '. |
|
107 | + ' where lpv.lp_id = '.$scorm['child_id']. |
|
108 | + ' and lpiv.lp_item_id = '.$scorm['subchild_id']. |
|
109 | 109 | ' and lpiv.lp_view_id = lpv.id' |
110 | 110 | ); |
111 | 111 | } |
@@ -115,29 +115,29 @@ discard block |
||
115 | 115 | return array( |
116 | 116 | 'type' => 'sql', |
117 | 117 | 'sql' => |
118 | - 'select ' . $key_id . ', lpv.user_id as uid, ' . |
|
119 | - 'lpv.session_id, lpiv.view_count as attempt, ' . |
|
120 | - 'lpivo.score_raw as score, ' . |
|
121 | - '(case lpivo.status ' . |
|
122 | - 'when "incomplete" then 0 ' . |
|
123 | - 'when "completed" then 1 ' . |
|
124 | - 'when "passed" then 2 ' . |
|
125 | - 'when "failed" then 3 ' . |
|
126 | - 'when "browsed" then 4 ' . |
|
127 | - 'when "not attempted" then 5 ' . |
|
128 | - 'else 6 ' . |
|
129 | - 'end) as progress, ' . |
|
130 | - 'null as time, null as ts from ' . |
|
131 | - Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']) . |
|
132 | - ' lpv, ' . |
|
133 | - Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']) . |
|
134 | - ' lpiv, ' . |
|
135 | - Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $scorm['course_db']) . |
|
136 | - ' lpivo ' . |
|
137 | - ' where lpv.lp_id = ' . $scorm['child_id'] . |
|
138 | - ' and lpiv.lp_item_id = ' . $scorm['subchild_id'] . |
|
139 | - ' and lpivo.objective_id = "' . $scorm['subsubchild_name'] . '" ' . |
|
140 | - ' and lpiv.lp_view_id = lpv.id' . |
|
118 | + 'select '.$key_id.', lpv.user_id as uid, '. |
|
119 | + 'lpv.session_id, lpiv.view_count as attempt, '. |
|
120 | + 'lpivo.score_raw as score, '. |
|
121 | + '(case lpivo.status '. |
|
122 | + 'when "incomplete" then 0 '. |
|
123 | + 'when "completed" then 1 '. |
|
124 | + 'when "passed" then 2 '. |
|
125 | + 'when "failed" then 3 '. |
|
126 | + 'when "browsed" then 4 '. |
|
127 | + 'when "not attempted" then 5 '. |
|
128 | + 'else 6 '. |
|
129 | + 'end) as progress, '. |
|
130 | + 'null as time, null as ts from '. |
|
131 | + Database::get_course_table(TABLE_LP_VIEW, $scorm['course_db']). |
|
132 | + ' lpv, '. |
|
133 | + Database::get_course_table(TABLE_LP_ITEM_VIEW, $scorm['course_db']). |
|
134 | + ' lpiv, '. |
|
135 | + Database::get_course_table(TABLE_LP_IV_OBJECTIVE, $scorm['course_db']). |
|
136 | + ' lpivo '. |
|
137 | + ' where lpv.lp_id = '.$scorm['child_id']. |
|
138 | + ' and lpiv.lp_item_id = '.$scorm['subchild_id']. |
|
139 | + ' and lpivo.objective_id = "'.$scorm['subsubchild_name'].'" '. |
|
140 | + ' and lpiv.lp_view_id = lpv.id'. |
|
141 | 141 | ' and lpivo.lp_iv_id=lpiv.id' |
142 | 142 | ); |
143 | 143 | } |