Completed
Push — master ( 5da9ea...eef579 )
by Angel Fernando Quiroz
50:18 queued 17:36
created
main/gradebook/lib/GradebookUtils.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@
 block discarded – undo
251 251
                     }
252 252
                 }
253 253
 
254
-               $modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&' . $courseParams.'">' .
254
+                $modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&' . $courseParams.'">' .
255 255
                     Display::return_icon(
256 256
                         'percentage.png',
257 257
                         get_lang('EditAllWeights'),
Please login to merge, or discard this patch.
Spacing   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
         $courseId = (int) $courseId;
79 79
         if (!empty($link_id)) {
80 80
             $link_id = intval($link_id);
81
-            $sql = 'UPDATE ' . Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK) . '
82
-                    SET weight = ' . "'" . Database::escape_string((float) $weight) . "'" . '
83
-                    WHERE c_id = "' . $courseId . '" AND id = ' . $link_id;
81
+            $sql = 'UPDATE '.Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK).'
82
+                    SET weight = ' . "'".Database::escape_string((float) $weight)."'".'
83
+                    WHERE c_id = "' . $courseId.'" AND id = '.$link_id;
84 84
             Database::query($sql);
85 85
         }
86 86
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
         // TODO find the corresponding category (the first one for this course, ordered by ID)
102 102
         $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
103
-        $sql = "DELETE FROM $l WHERE id = ".(int)$link_id;
103
+        $sql = "DELETE FROM $l WHERE id = ".(int) $link_id;
104 104
         Database::query($sql);
105 105
 
106 106
         return true;
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
             $visibility_icon = ($cat->is_visible() == 0) ? 'invisible' : 'visible';
196 196
             $visibility_command = ($cat->is_visible() == 0) ? 'set_visible' : 'set_invisible';
197 197
 
198
-            $modify_icons .= '<a class="view_children" data-cat-id="' . $cat->get_id() . '" href="javascript:void(0);">' .
199
-                Display::return_icon('view_more_stats.gif', get_lang('Show'), '', ICON_SIZE_SMALL) . '</a>';
198
+            $modify_icons .= '<a class="view_children" data-cat-id="'.$cat->get_id().'" href="javascript:void(0);">'.
199
+                Display::return_icon('view_more_stats.gif', get_lang('Show'), '', ICON_SIZE_SMALL).'</a>';
200 200
 
201 201
             if (!api_is_allowed_to_edit(null, true)) {
202 202
                 $modify_icons .= Display::url(
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
                         '',
207 207
                         ICON_SIZE_SMALL
208 208
                     ),
209
-                    'personal_stats.php?' . http_build_query([
209
+                    'personal_stats.php?'.http_build_query([
210 210
                         'selectcat' => $cat->get_id()
211
-                    ]) . '&' . api_get_cidreq(),
211
+                    ]).'&'.api_get_cidreq(),
212 212
                     [
213 213
                         'class' => 'ajax',
214 214
                         'data-title' => get_lang('FlatView')
@@ -223,16 +223,16 @@  discard block
 block discarded – undo
223 223
                 if (api_get_setting('gradebook_locking_enabled') == 'true') {
224 224
                     if ($cat->is_locked()) {
225 225
                         if (api_is_platform_admin()) {
226
-                            $modify_icons .= '&nbsp;<a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToUnlockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=unlock">' .
227
-                                Display::return_icon('lock.png', get_lang('UnLockEvaluation'), '', ICON_SIZE_SMALL) . '</a>';
226
+                            $modify_icons .= '&nbsp;<a onclick="javascript:if (!confirm(\''.addslashes(get_lang('ConfirmToUnlockElement')).'\')) return false;" href="'.api_get_self().'?'.api_get_cidreq().'&category_id='.$cat->get_id().'&action=unlock">'.
227
+                                Display::return_icon('lock.png', get_lang('UnLockEvaluation'), '', ICON_SIZE_SMALL).'</a>';
228 228
                         } else {
229
-                            $modify_icons .= '&nbsp;<a href="#">' . Display::return_icon('lock_na.png', get_lang('GradebookLockedAlert'), '', ICON_SIZE_SMALL) . '</a>';
229
+                            $modify_icons .= '&nbsp;<a href="#">'.Display::return_icon('lock_na.png', get_lang('GradebookLockedAlert'), '', ICON_SIZE_SMALL).'</a>';
230 230
                         }
231
-                        $modify_icons .= '&nbsp;<a href="gradebook_flatview.php?export_pdf=category&selectcat=' . $cat->get_id() . '" >' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL) . '</a>';
231
+                        $modify_icons .= '&nbsp;<a href="gradebook_flatview.php?export_pdf=category&selectcat='.$cat->get_id().'" >'.Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>';
232 232
                     } else {
233
-                        $modify_icons .= '&nbsp;<a onclick="javascript:if (!confirm(\'' . addslashes(get_lang('ConfirmToLockElement')) . '\')) return false;" href="' . api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $cat->get_id() . '&action=lock">' .
234
-                            Display::return_icon('unlock.png', get_lang('LockEvaluation'), '', ICON_SIZE_SMALL) . '</a>';
235
-                        $modify_icons .= '&nbsp;<a href="#" >' . Display::return_icon('pdf_na.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL) . '</a>';
233
+                        $modify_icons .= '&nbsp;<a onclick="javascript:if (!confirm(\''.addslashes(get_lang('ConfirmToLockElement')).'\')) return false;" href="'.api_get_self().'?'.api_get_cidreq().'&category_id='.$cat->get_id().'&action=lock">'.
234
+                            Display::return_icon('unlock.png', get_lang('LockEvaluation'), '', ICON_SIZE_SMALL).'</a>';
235
+                        $modify_icons .= '&nbsp;<a href="#" >'.Display::return_icon('pdf_na.png', get_lang('ExportToPDF'), '', ICON_SIZE_SMALL).'</a>';
236 236
                     }
237 237
                 }
238 238
 
@@ -240,44 +240,44 @@  discard block
 block discarded – undo
240 240
                     if ($cat->is_locked() && !api_is_platform_admin()) {
241 241
                         $modify_icons .= Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
242 242
                     } else {
243
-                        $modify_icons .= '<a href="gradebook_edit_cat.php?editcat=' . $cat->get_id() . '&'.$courseParams.'">' .
243
+                        $modify_icons .= '<a href="gradebook_edit_cat.php?editcat='.$cat->get_id().'&'.$courseParams.'">'.
244 244
                             Display::return_icon(
245 245
                                 'edit.png',
246 246
                                 get_lang('Modify'),
247 247
                                 '',
248 248
                                 ICON_SIZE_SMALL
249
-                            ) . '</a>';
249
+                            ).'</a>';
250 250
                     }
251 251
                 }
252 252
 
253
-               $modify_icons .= '<a href="gradebook_edit_all.php?selectcat=' .$cat->get_id() . '&' . $courseParams.'">' .
253
+               $modify_icons .= '<a href="gradebook_edit_all.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'.
254 254
                     Display::return_icon(
255 255
                         'percentage.png',
256 256
                         get_lang('EditAllWeights'),
257 257
                         '',
258 258
                         ICON_SIZE_SMALL
259
-                    ) . '</a>';
259
+                    ).'</a>';
260 260
 
261
-                $modify_icons .= '<a href="gradebook_flatview.php?selectcat=' .$cat->get_id() . '&' . $courseParams. '">' .
261
+                $modify_icons .= '<a href="gradebook_flatview.php?selectcat='.$cat->get_id().'&'.$courseParams.'">'.
262 262
                     Display::return_icon(
263 263
                         'stats.png',
264 264
                         get_lang('FlatView'),
265 265
                         '',
266 266
                         ICON_SIZE_SMALL
267
-                    ) . '</a>';
268
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() .'?visiblecat=' . $cat->get_id() . '&' .$visibility_command . '=&selectcat=' . $selectcat .'&' . $courseParams. '">' .
267
+                    ).'</a>';
268
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?visiblecat='.$cat->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.'">'.
269 269
                     Display::return_icon(
270
-                        $visibility_icon . '.png',
270
+                        $visibility_icon.'.png',
271 271
                         get_lang('Visible'),
272 272
                         '',
273 273
                         ICON_SIZE_SMALL
274
-                    ) . '</a>';
274
+                    ).'</a>';
275 275
 
276 276
                 if ($cat->is_locked() && !api_is_platform_admin()) {
277 277
                     $modify_icons .= Display::return_icon('delete_na.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL);
278 278
                 } else {
279
-                    $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?deletecat=' . $cat->get_id() . '&selectcat=' . $selectcat . '&' . $courseParams. '" onclick="return confirmation();">' .
280
-                        Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL) . '</a>';
279
+                    $modify_icons .= '&nbsp;<a href="'.api_get_self().'?deletecat='.$cat->get_id().'&selectcat='.$selectcat.'&'.$courseParams.'" onclick="return confirmation();">'.
280
+                        Display::return_icon('delete.png', get_lang('DeleteAll'), '', ICON_SIZE_SMALL).'</a>';
281 281
                 }
282 282
             }
283 283
 
@@ -304,22 +304,22 @@  discard block
 block discarded – undo
304 304
             if ($is_locked && !api_is_platform_admin()) {
305 305
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
306 306
             } else {
307
-                $modify_icons = '<a href="gradebook_edit_eval.php?editeval=' . $eval->get_id() . '&' . $courseParams. '">' .
308
-                    Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
307
+                $modify_icons = '<a href="gradebook_edit_eval.php?editeval='.$eval->get_id().'&'.$courseParams.'">'.
308
+                    Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
309 309
             }
310 310
 
311
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?visibleeval=' . $eval->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . '&'.$courseParams. ' ">' .
312
-                Display::return_icon($visibility_icon . '.png', get_lang('Visible'), '', ICON_SIZE_SMALL) . '</a>';
311
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?visibleeval='.$eval->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.' ">'.
312
+                Display::return_icon($visibility_icon.'.png', get_lang('Visible'), '', ICON_SIZE_SMALL).'</a>';
313 313
             if (api_is_allowed_to_edit(null, true)) {
314
-                $modify_icons .= '&nbsp;<a href="gradebook_showlog_eval.php?visiblelog=' . $eval->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '">' .
315
-                    Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL) . '</a>';
314
+                $modify_icons .= '&nbsp;<a href="gradebook_showlog_eval.php?visiblelog='.$eval->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'">'.
315
+                    Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL).'</a>';
316 316
             }
317 317
 
318 318
             if ($is_locked && !api_is_platform_admin()) {
319
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL);
319
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL);
320 320
             } else {
321
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?deleteeval=' . $eval->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '" onclick="return confirmation();">' .
322
-                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
321
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?deleteeval='.$eval->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'" onclick="return confirmation();">'.
322
+                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
323 323
             }
324 324
             return $modify_icons;
325 325
         }
@@ -351,21 +351,21 @@  discard block
 block discarded – undo
351 351
             if ($is_locked && !api_is_platform_admin()) {
352 352
                 $modify_icons = Display::return_icon('edit_na.png', get_lang('Modify'), '', ICON_SIZE_SMALL);
353 353
             } else {
354
-                $modify_icons = '<a href="gradebook_edit_link.php?editlink=' . $link->get_id() . '&' . $courseParams.'">' .
355
-                    Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL) . '</a>';
354
+                $modify_icons = '<a href="gradebook_edit_link.php?editlink='.$link->get_id().'&'.$courseParams.'">'.
355
+                    Display::return_icon('edit.png', get_lang('Modify'), '', ICON_SIZE_SMALL).'</a>';
356 356
             }
357
-            $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?visiblelink=' . $link->get_id() . '&' . $visibility_command . '=&selectcat=' . $selectcat . '&'.$courseParams. ' ">' .
358
-                Display::return_icon($visibility_icon . '.png', get_lang('Visible'), '', ICON_SIZE_SMALL) . '</a>';
359
-            $modify_icons .= '&nbsp;<a href="gradebook_showlog_link.php?visiblelink=' . $link->get_id() . '&selectcat=' . $selectcat . '&' . $courseParams. '">' .
360
-                Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL) . '</a>';
357
+            $modify_icons .= '&nbsp;<a href="'.api_get_self().'?visiblelink='.$link->get_id().'&'.$visibility_command.'=&selectcat='.$selectcat.'&'.$courseParams.' ">'.
358
+                Display::return_icon($visibility_icon.'.png', get_lang('Visible'), '', ICON_SIZE_SMALL).'</a>';
359
+            $modify_icons .= '&nbsp;<a href="gradebook_showlog_link.php?visiblelink='.$link->get_id().'&selectcat='.$selectcat.'&'.$courseParams.'">'.
360
+                Display::return_icon('history.png', get_lang('GradebookQualifyLog'), '', ICON_SIZE_SMALL).'</a>';
361 361
 
362 362
             //If a work is added in a gradebook you can only delete the link in the work tool
363 363
 
364 364
             if ($is_locked && !api_is_platform_admin()) {
365
-                $modify_icons .= '&nbsp;' . Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL);
365
+                $modify_icons .= '&nbsp;'.Display::return_icon('delete_na.png', get_lang('Delete'), '', ICON_SIZE_SMALL);
366 366
             } else {
367
-                $modify_icons .= '&nbsp;<a href="' . api_get_self() . '?deletelink=' . $link->get_id() . '&selectcat=' . $selectcat . ' &' . $courseParams. '" onclick="return confirmation();">' .
368
-                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>';
367
+                $modify_icons .= '&nbsp;<a href="'.api_get_self().'?deletelink='.$link->get_id().'&selectcat='.$selectcat.' &'.$courseParams.'" onclick="return confirmation();">'.
368
+                    Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>';
369 369
             }
370 370
 
371 371
             return $modify_icons;
@@ -384,12 +384,12 @@  discard block
 block discarded – undo
384 384
     public static function isResourceInCourseGradebook($courseId, $resource_type, $resource_id, $session_id = 0)
385 385
     {
386 386
         $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
387
-        $courseId = (int)$courseId;
387
+        $courseId = (int) $courseId;
388 388
         $sql = "SELECT * FROM $table l
389 389
                 WHERE
390 390
                     c_id = '$courseId' AND
391
-                    type = ".(int)$resource_type . " AND
392
-                    ref_id = " . (int)$resource_id;
391
+                    type = ".(int) $resource_type." AND
392
+                    ref_id = " . (int) $resource_id;
393 393
         $res = Database::query($sql);
394 394
 
395 395
         if (Database::num_rows($res) < 1) {
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
         }
413 413
         // TODO find the corresponding category (the first one for this course, ordered by ID)
414 414
         $l = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
415
-        $sql = "SELECT * FROM $l WHERE id = " . (int) $link_id;
415
+        $sql = "SELECT * FROM $l WHERE id = ".(int) $link_id;
416 416
         $res = Database::query($sql);
417 417
         $row = array();
418 418
         if (Database::num_rows($res) > 0) {
@@ -430,10 +430,10 @@  discard block
 block discarded – undo
430 430
     {
431 431
         $course_table = Database::get_main_table(TABLE_MAIN_COURSE);
432 432
         $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
433
-        $sql = 'SELECT c.id FROM ' . $course_table . ' c
434
-                INNER JOIN ' . $tbl_grade_links . ' l
433
+        $sql = 'SELECT c.id FROM '.$course_table.' c
434
+                INNER JOIN ' . $tbl_grade_links.' l
435 435
                 ON c.id = l.c_id
436
-                WHERE l.id=' . intval($id_link) . ' OR l.category_id=' . intval($id_link);
436
+                WHERE l.id=' . intval($id_link).' OR l.category_id='.intval($id_link);
437 437
         $res = Database::query($sql);
438 438
         $array = Database::fetch_array($res, 'ASSOC');
439 439
         return $array['id'];
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
     {
592 592
         $result = Result::load($resid);
593 593
         if ($importscore > $eval_max) {
594
-            header('Location: gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '&overwritemax=');
594
+            header('Location: gradebook_view_result.php?selecteval='.Security::remove_XSS($_GET['selecteval']).'&overwritemax=');
595 595
             exit;
596 596
         }
597 597
         $result[0]->set_score($importscore);
@@ -637,8 +637,8 @@  discard block
 block discarded – undo
637 637
     ) {
638 638
         $table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
639 639
         $sql = 'SELECT COUNT(id) as count
640
-                FROM ' . $table . ' gc
641
-                WHERE gc.cat_id="' . intval($cat_id) . '" AND user_id="' . intval($user_id) . '" ';
640
+                FROM ' . $table.' gc
641
+                WHERE gc.cat_id="' . intval($cat_id).'" AND user_id="'.intval($user_id).'" ';
642 642
         $rs_exist = Database::query($sql);
643 643
         $row = Database::fetch_array($rs_exist);
644 644
         if ($row['count'] == 0) {
@@ -661,8 +661,8 @@  discard block
 block discarded – undo
661 661
     public static function get_certificate_by_user_id($cat_id, $user_id)
662 662
     {
663 663
         $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
664
-        $sql = 'SELECT * FROM ' . $table_certificate . '
665
-                WHERE cat_id="' . intval($cat_id) . '" AND user_id="' . intval($user_id) . '"';
664
+        $sql = 'SELECT * FROM '.$table_certificate.'
665
+                WHERE cat_id="' . intval($cat_id).'" AND user_id="'.intval($user_id).'"';
666 666
 
667 667
         $result = Database::query($sql);
668 668
         $row = Database::fetch_array($result, 'ASSOC');
@@ -681,18 +681,18 @@  discard block
 block discarded – undo
681 681
         $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
682 682
         $table_user = Database::get_main_table(TABLE_MAIN_USER);
683 683
         $sql = 'SELECT DISTINCT u.user_id, u.lastname, u.firstname, u.username
684
-                FROM ' . $table_user . ' u
685
-                INNER JOIN ' . $table_certificate . ' gc
684
+                FROM ' . $table_user.' u
685
+                INNER JOIN ' . $table_certificate.' gc
686 686
                 ON u.user_id=gc.user_id ';
687 687
         if (!is_null($cat_id) && $cat_id > 0) {
688
-            $sql.=' WHERE cat_id=' . intval($cat_id);
688
+            $sql .= ' WHERE cat_id='.intval($cat_id);
689 689
         }
690 690
         if (!empty($userList)) {
691 691
             $userList = array_map('intval', $userList);
692 692
             $userListCondition = implode("','", $userList);
693 693
             $sql .= " AND u.user_id IN ('$userListCondition')";
694 694
         }
695
-        $sql.=' ORDER BY u.firstname';
695
+        $sql .= ' ORDER BY u.firstname';
696 696
         $rs = Database::query($sql);
697 697
 
698 698
         $list_users = array();
@@ -713,10 +713,10 @@  discard block
 block discarded – undo
713 713
     {
714 714
         $table_certificate = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CERTIFICATE);
715 715
         $sql = 'SELECT gc.score_certificate, gc.created_at, gc.path_certificate, gc.cat_id, gc.user_id, gc.id
716
-                FROM  ' . $table_certificate . ' gc
717
-                WHERE gc.user_id="' . intval($user_id) . '" ';
716
+                FROM  ' . $table_certificate.' gc
717
+                WHERE gc.user_id="' . intval($user_id).'" ';
718 718
         if (!is_null($cat_id) && $cat_id > 0) {
719
-            $sql.=' AND cat_id=' . intval($cat_id);
719
+            $sql .= ' AND cat_id='.intval($cat_id);
720 720
         }
721 721
 
722 722
         $rs = Database::query($sql);
@@ -753,12 +753,12 @@  discard block
 block discarded – undo
753 753
 
754 754
         $new_content_html = isset($content_html['content']) ? $content_html['content'] : null;
755 755
         $variables = isset($content_html['variables']) ? $content_html['variables'] : null;
756
-        $path_image = api_get_path(WEB_COURSE_PATH) . api_get_course_path($course_code) . '/document/images/gallery';
756
+        $path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path($course_code).'/document/images/gallery';
757 757
         $new_content_html = str_replace('../images/gallery', $path_image, $new_content_html);
758 758
 
759
-        $path_image_in_default_course = api_get_path(WEB_CODE_PATH) . 'default_course_document';
759
+        $path_image_in_default_course = api_get_path(WEB_CODE_PATH).'default_course_document';
760 760
         $new_content_html = str_replace('/main/default_course_document', $path_image_in_default_course, $new_content_html);
761
-        $new_content_html = str_replace(SYS_CODE_PATH . 'img/', api_get_path(WEB_IMG_PATH), $new_content_html);
761
+        $new_content_html = str_replace(SYS_CODE_PATH.'img/', api_get_path(WEB_IMG_PATH), $new_content_html);
762 762
 
763 763
         //add print header
764 764
         if (!$hide_print_button) {
@@ -806,9 +806,9 @@  discard block
 block discarded – undo
806 806
             $session_id = api_get_session_id();
807 807
 
808 808
             $t = Database::get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
809
-            $sql = "SELECT * FROM $t WHERE c_id = '" . Database::escape_string($courseId) . "' ";
809
+            $sql = "SELECT * FROM $t WHERE c_id = '".Database::escape_string($courseId)."' ";
810 810
             if (!empty($session_id)) {
811
-                $sql .= " AND session_id = " . (int) $session_id;
811
+                $sql .= " AND session_id = ".(int) $session_id;
812 812
             } else {
813 813
                 $sql .= " AND (session_id IS NULL OR session_id = 0) ";
814 814
             }
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
                 if (!empty($session_id)) {
822 822
                     $my_session_id = api_get_session_id();
823 823
                     $s_name = api_get_session_name($my_session_id);
824
-                    $cat->set_name($course_code . ' - ' . get_lang('Session') . ' ' . $s_name);
824
+                    $cat->set_name($course_code.' - '.get_lang('Session').' '.$s_name);
825 825
                     $cat->set_session_id($session_id);
826 826
                 } else {
827 827
                     $cat->set_name($course_code);
@@ -946,13 +946,13 @@  discard block
 block discarded – undo
946 946
 
947 947
         if ($use_grade_model) {
948 948
             if ($parent_id == 0) {
949
-                $title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed');
949
+                $title = api_strtoupper(get_lang('Average')).'<br />'.get_lang('Detailed');
950 950
             } else {
951
-                $title = api_strtoupper(get_lang('Average')) . '<br />' . $cat[0]->get_description() . ' - (' . $cat[0]->get_name() . ')';
951
+                $title = api_strtoupper(get_lang('Average')).'<br />'.$cat[0]->get_description().' - ('.$cat[0]->get_name().')';
952 952
             }
953 953
         } else {
954 954
             if ($parent_id == 0) {
955
-                $title = api_strtoupper(get_lang('Average')) . '<br />' . get_lang('Detailed');
955
+                $title = api_strtoupper(get_lang('Average')).'<br />'.get_lang('Detailed');
956 956
             } else {
957 957
                 $title = api_strtoupper(get_lang('Average'));
958 958
             }
@@ -1006,11 +1006,11 @@  discard block
 block discarded – undo
1006 1006
         } else {
1007 1007
             $column = 0;
1008 1008
             $table->setCellContents($row, $column, get_lang('NoResults'));
1009
-            $table->updateCellAttributes($row, $column, 'colspan="' . $columns . '" align="center" class="row_odd"');
1009
+            $table->updateCellAttributes($row, $column, 'colspan="'.$columns.'" align="center" class="row_odd"');
1010 1010
         }
1011 1011
 
1012 1012
         $pdfParams = array(
1013
-            'filename' => get_lang('FlatView') . '_' . api_get_utc_datetime(),
1013
+            'filename' => get_lang('FlatView').'_'.api_get_utc_datetime(),
1014 1014
             'pdf_title' => $title,
1015 1015
             'course_code' => $course_code,
1016 1016
             'add_signatures' => ['Drh', 'Teacher', 'Date']
@@ -1095,7 +1095,7 @@  discard block
 block discarded – undo
1095 1095
         $a_students = array();
1096 1096
         while ($user = Database::fetch_array($result)) {
1097 1097
             if (!array_key_exists($user['user_id'], $a_students)) {
1098
-                $a_current_student = array ();
1098
+                $a_current_student = array();
1099 1099
                 $a_current_student[] = $user['user_id'];
1100 1100
                 $a_current_student[] = $user['username'];
1101 1101
                 $a_current_student[] = $user['lastname'];
@@ -1152,7 +1152,7 @@  discard block
 block discarded – undo
1152 1152
         foreach ($links as $link) {
1153 1153
             // links are always in a course
1154 1154
             $coursecode = $link->get_course_code();
1155
-            if (!array_key_exists($coursecode,$coursecodes)) {
1155
+            if (!array_key_exists($coursecode, $coursecodes)) {
1156 1156
                 $coursecodes[$coursecode] = '1';
1157 1157
                 $users = array_merge($users, self::get_users_in_course($coursecode));
1158 1158
             }
@@ -1165,7 +1165,7 @@  discard block
 block discarded – undo
1165 1165
      * Search students matching a given last name and/or first name
1166 1166
      * @author Bert Steppé
1167 1167
      */
1168
-    public static function find_students($mask= '')
1168
+    public static function find_students($mask = '')
1169 1169
     {
1170 1170
         // students shouldn't be here // don't search if mask empty
1171 1171
         if (!api_is_allowed_to_edit() || empty ($mask)) {
@@ -1176,23 +1176,23 @@  discard block
 block discarded – undo
1176 1176
         $tbl_user = Database::get_main_table(TABLE_MAIN_USER);
1177 1177
         $tbl_cru = Database::get_main_table(TABLE_MAIN_COURSE_USER);
1178 1178
         $sql = 'SELECT DISTINCT user.user_id, user.lastname, user.firstname, user.email, user.official_code
1179
-                FROM ' . $tbl_user . ' user';
1179
+                FROM ' . $tbl_user.' user';
1180 1180
         if (!api_is_platform_admin()) {
1181
-            $sql .= ', ' . $tbl_cru . ' cru';
1181
+            $sql .= ', '.$tbl_cru.' cru';
1182 1182
         }
1183 1183
 
1184
-        $sql .= ' WHERE user.status = ' . STUDENT;
1185
-        $sql .= ' AND (user.lastname LIKE '."'%" . $mask . "%'";
1186
-        $sql .= ' OR user.firstname LIKE '."'%" . $mask . "%')";
1184
+        $sql .= ' WHERE user.status = '.STUDENT;
1185
+        $sql .= ' AND (user.lastname LIKE '."'%".$mask."%'";
1186
+        $sql .= ' OR user.firstname LIKE '."'%".$mask."%')";
1187 1187
 
1188 1188
         if (!api_is_platform_admin()) {
1189 1189
             $sql .= ' AND user.user_id = cru.user_id AND
1190 1190
                       cru.relation_type <> '.COURSE_RELATION_TYPE_RRHH.' AND
1191 1191
                       cru.c_id in (
1192
-                            SELECT c_id FROM '.$tbl_cru . '
1192
+                            SELECT c_id FROM '.$tbl_cru.'
1193 1193
                             WHERE
1194
-                                user_id = ' . api_get_user_id() . ' AND
1195
-                                status = ' . COURSEMANAGER . '
1194
+                                user_id = ' . api_get_user_id().' AND
1195
+                                status = ' . COURSEMANAGER.'
1196 1196
                         )
1197 1197
                     ';
1198 1198
         }
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
         $sql = 'SELECT ref_id FROM '.$table_link.'
1235 1235
                 WHERE id = '.$linkId.' AND type='.LINK_ATTENDANCE;
1236 1236
 
1237
-        $rs_attendance  = Database::query($sql);
1237
+        $rs_attendance = Database::query($sql);
1238 1238
         if (Database::num_rows($rs_attendance) > 0) {
1239 1239
             $row_attendance = Database::fetch_array($rs_attendance);
1240 1240
             $sql = 'UPDATE '.$tbl_attendance.' SET 
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
                 'course' => $courseInfo['title'],
1332 1332
                 'score' => $certificateInfo['score_certificate'],
1333 1333
                 'date' => api_format_date($certificateInfo['created_at'], DATE_FORMAT_SHORT),
1334
-                'link' => api_get_path(WEB_PATH) . "certificates/index.php?id={$certificateInfo['id']}"
1334
+                'link' => api_get_path(WEB_PATH)."certificates/index.php?id={$certificateInfo['id']}"
1335 1335
             ];
1336 1336
         }
1337 1337
 
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
                     'course' => $course['title'],
1396 1396
                     'score' => $certificateInfo['score_certificate'],
1397 1397
                     'date' => api_format_date($certificateInfo['created_at'], DATE_FORMAT_SHORT),
1398
-                    'link' => api_get_path(WEB_PATH) . "certificates/index.php?id={$certificateInfo['id']}"
1398
+                    'link' => api_get_path(WEB_PATH)."certificates/index.php?id={$certificateInfo['id']}"
1399 1399
                 ];
1400 1400
             }
1401 1401
         }
Please login to merge, or discard this patch.
main/gradebook/lib/be/evallink.class.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -117,6 +117,9 @@  discard block
 block discarded – undo
117 117
         }
118 118
     }
119 119
 
120
+    /**
121
+     * @param string $name
122
+     */
120 123
     public function set_name($name)
121 124
     {
122 125
         if ($this->is_valid_link()) {
@@ -124,6 +127,9 @@  discard block
 block discarded – undo
124 127
         }
125 128
     }
126 129
 
130
+    /**
131
+     * @param string $description
132
+     */
127 133
     public function set_description($description)
128 134
     {
129 135
         if ($this->is_valid_link()) {
@@ -131,6 +137,9 @@  discard block
 block discarded – undo
131 137
         }
132 138
     }
133 139
 
140
+    /**
141
+     * @param integer $max
142
+     */
134 143
     public function set_max($max)
135 144
     {
136 145
         if ($this->is_valid_link()) {
Please login to merge, or discard this patch.
main/gradebook/lib/be/linkfactory.class.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
 
94 94
     /**
95 95
      * Return an array of all known link types
96
-     * @return array
96
+     * @return integer[]
97 97
      */
98 98
     public static function get_all_types()
99 99
     {
Please login to merge, or discard this patch.
main/inc/lib/hook/interfaces/HookResubscribeObserverInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 interface HookResubscribeObserverInterface extends HookObserverInterface
13 13
 {
14 14
     /**
15
-     * @param HookResubscribeObserverInterface $hook
15
+     * @param HookResubscribeEventInterface $hook
16 16
      *
17 17
      * @return int
18 18
      */
Please login to merge, or discard this patch.
main/inc/lib/hook/interfaces/HookSkypeObserverInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 interface HookSkypeObserverInterface extends HookObserverInterface
13 13
 {
14 14
     /**
15
-     * @param HookSkypeObserverInterface $hook
15
+     * @param HookSkypeEventInterface $hook
16 16
      *
17 17
      * @return int
18 18
      */
Please login to merge, or discard this patch.
main/inc/lib/search/xapian/XapianQuery.php 4 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -239,6 +239,7 @@
 block discarded – undo
239 239
 /**
240 240
  * @author Isaac flores paz <[email protected]>
241 241
  * @param String The xapian error message
242
+ * @param string $xapian_error_message
242 243
  * @return String The chamilo error message
243 244
  */
244 245
 function display_xapian_error($xapian_error_message) {
Please login to merge, or discard this patch.
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -30,7 +30,8 @@  discard block
 block discarded – undo
30 30
  * @param   int             $count_type     Number of items to retrieve
31 31
  * @return  array                           An array of nids corresponding to the results.
32 32
  */
33
-function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0) {
33
+function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0)
34
+{
34 35
 
35 36
     try {
36 37
         if (!is_object($db)) {
@@ -129,7 +130,8 @@  discard block
 block discarded – undo
129 130
 /**
130 131
  * build a boolean query
131 132
  */
132
-function xapian_get_boolean_query($term) {
133
+function xapian_get_boolean_query($term)
134
+{
133 135
     return new XapianQuery($term);
134 136
 }
135 137
 
@@ -141,7 +143,8 @@  discard block
 block discarded – undo
141 143
  * @param   XapianDatabase  $db     Xapian database to connect
142 144
  * @return  array
143 145
  */
144
-function xapian_get_all_terms($count = 0, $prefix, $db = NULL) {
146
+function xapian_get_all_terms($count = 0, $prefix, $db = NULL)
147
+{
145 148
     try {
146 149
         if (!is_object($db)) {
147 150
             $db = new XapianDatabase(XAPIAN_DB);
@@ -175,7 +178,8 @@  discard block
 block discarded – undo
175 178
  * @param   XapianDocument  document searched
176 179
  * @return  array
177 180
  */
178
-function xapian_get_doc_terms($doc = NULL, $prefix) {
181
+function xapian_get_doc_terms($doc = NULL, $prefix)
182
+{
179 183
     try {
180 184
         if (!is_a($doc, 'XapianDocument')) {
181 185
             return;
@@ -210,7 +214,8 @@  discard block
 block discarded – undo
210 214
  * @param string $op
211 215
  * @return XapianQuery query joined
212 216
  */
213
-function xapian_join_queries($query1, $query2 = NULL, $op = 'or') {
217
+function xapian_join_queries($query1, $query2 = NULL, $op = 'or')
218
+{
214 219
     // let decide how to join, avoiding include xapian.php outside
215 220
     switch ($op) {
216 221
         case 'or':
@@ -244,7 +249,8 @@  discard block
 block discarded – undo
244 249
  * @param String The xapian error message
245 250
  * @return String The chamilo error message
246 251
  */
247
-function display_xapian_error($xapian_error_message) {
252
+function display_xapian_error($xapian_error_message)
253
+{
248 254
     $message = explode(':', $xapian_error_message);
249 255
     $type_error_message = $message[0];
250 256
     if ($type_error_message == 'DatabaseOpeningError') {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
  * @param   int             $count_type     Number of items to retrieve
31 31
  * @return  array                           An array of nids corresponding to the results.
32 32
  */
33
-function xapian_query($query_string, $db = NULL, $start = 0, $length = 10, $extra = array(), $count_type = 0) {
33
+function xapian_query($query_string, $db = null, $start = 0, $length = 10, $extra = array(), $count_type = 0) {
34 34
 
35 35
     try {
36 36
         if (!is_object($db)) {
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         }
47 47
 
48 48
 
49
-        $query = NULL;
49
+        $query = null;
50 50
         $enquire = new XapianEnquire($db);
51 51
 
52 52
         if (!empty($query_string)) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         return array($count, $results);
123 123
     } catch (Exception $e) {
124 124
         display_xapian_error($e->getMessage());
125
-        return NULL;
125
+        return null;
126 126
     }
127 127
 }
128 128
 
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
  * @param   XapianDatabase  $db     Xapian database to connect
142 142
  * @return  array
143 143
  */
144
-function xapian_get_all_terms($count = 0, $prefix, $db = NULL) {
144
+function xapian_get_all_terms($count = 0, $prefix, $db = null) {
145 145
     try {
146 146
         if (!is_object($db)) {
147 147
             $db = new XapianDatabase(XAPIAN_DB);
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         return $terms;
166 166
     } catch (Exception $e) {
167 167
         display_xapian_error($e->getMessage());
168
-        return NULL;
168
+        return null;
169 169
     }
170 170
 }
171 171
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
  * @param   XapianDocument  document searched
176 176
  * @return  array
177 177
  */
178
-function xapian_get_doc_terms($doc = NULL, $prefix) {
178
+function xapian_get_doc_terms($doc = null, $prefix) {
179 179
     try {
180 180
         if (!is_a($doc, 'XapianDocument')) {
181 181
             return;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         return $terms;
199 199
     } catch (Exception $e) {
200 200
         display_xapian_error($e->getMessage());
201
-        return NULL;
201
+        return null;
202 202
     }
203 203
 }
204 204
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
  * @param string $op
211 211
  * @return XapianQuery query joined
212 212
  */
213
-function xapian_join_queries($query1, $query2 = NULL, $op = 'or') {
213
+function xapian_join_queries($query1, $query2 = null, $op = 'or') {
214 214
     // let decide how to join, avoiding include xapian.php outside
215 215
     switch ($op) {
216 216
         case 'or':
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
                 // process each specific field prefix
97 97
                 foreach ($specific_fields as $specific_field) {
98
-                    $results[$count]['sf-' . $specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']);
98
+                    $results[$count]['sf-'.$specific_field['code']] = xapian_get_doc_terms($document, $specific_field['code']);
99 99
                 }
100 100
 
101 101
                 // rest of data
@@ -264,6 +264,6 @@  discard block
 block discarded – undo
264 264
     } else {
265 265
         $message_error = get_lang('SearchOtherXapianError');
266 266
     }
267
-    $display_message = get_lang('Error') . ' : ' . $message_error;
267
+    $display_message = get_lang('Error').' : '.$message_error;
268 268
     Display::display_error_message($display_message);
269 269
 }
Please login to merge, or discard this patch.
main/inc/lib/SmsPluginLibraryInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     /**
22 22
      * @param array $additionalParameters
23 23
      *
24
-     * @return mixed
24
+     * @return void
25 25
      */
26 26
     public function send($additionalParameters);
27 27
 
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/AccessUrlRelCourseCategory.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
      * Set accessUrlId
41 41
      *
42 42
      * @param integer $accessUrlId
43
-     * @return AccessUrlRelSession
43
+     * @return AccessUrlRelCourseCategory
44 44
      */
45 45
     public function setAccessUrlId($accessUrlId)
46 46
     {
Please login to merge, or discard this patch.
src/Chamilo/CoreBundle/Entity/ClassItem.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      * Set code
40 40
      *
41 41
      * @param string $code
42
-     * @return Class
42
+     * @return ClassItem
43 43
      */
44 44
     public function setCode($code)
45 45
     {
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      * Set name
63 63
      *
64 64
      * @param string $name
65
-     * @return Class
65
+     * @return ClassItem
66 66
      */
67 67
     public function setName($name)
68 68
     {
Please login to merge, or discard this patch.