gradebook_showlog_eval.php 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Script.
  5. *
  6. * @package chamilo.gradebook
  7. */
  8. require_once __DIR__.'/../inc/global.inc.php';
  9. api_block_anonymous_users();
  10. GradebookUtils::block_students();
  11. $selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
  12. $interbreadcrumb[] = [
  13. 'url' => Category::getUrl(),
  14. 'name' => get_lang('Gradebook'),
  15. ];
  16. $interbreadcrumb[] = [
  17. 'url' => Category::getUrl().'selectcat='.$selectCat,
  18. 'name' => get_lang('Details'),
  19. ];
  20. $interbreadcrumb[] = [
  21. 'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&amp;selectcat='.$selectCat,
  22. 'name' => get_lang('GradebookQualifyLog'),
  23. ];
  24. $this_section = SECTION_COURSES;
  25. Display::display_header('');
  26. echo Display::page_header(get_lang('GradebookQualifyLog'));
  27. $t_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  28. $t_user = Database::get_main_table(TABLE_MAIN_USER);
  29. $visible_log = Security::remove_XSS($_GET['visiblelog']);
  30. $evaledit = Evaluation :: load($visible_log);
  31. $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at, us.user_id
  32. FROM $t_linkeval_log le
  33. INNER JOIN $t_user us
  34. ON le.user_id_log = us.user_id
  35. WHERE
  36. id_linkeval_log=".$evaledit[0]->get_id()." AND
  37. type = 'evaluation'
  38. ";
  39. $result = Database::query($sql);
  40. $list_info = [];
  41. while ($row = Database::fetch_row($result)) {
  42. $list_info[] = $row;
  43. }
  44. foreach ($list_info as $key => $info_log) {
  45. $list_info[$key][5] = $info_log[5] ? api_convert_and_format_date($info_log[5]) : 'N/A';
  46. $list_info[$key][3] = $info_log[3] == 1 ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  47. $userInfo = api_get_user_info($info_log[6]);
  48. if ($userInfo) {
  49. $list_info[$key][6] = $userInfo['complete_name_with_message_link'];
  50. } else {
  51. $list_info[$key][6] = '';
  52. }
  53. }
  54. $parameters = [
  55. 'visiblelog' => $visible_log,
  56. 'selectcat' => intval($_GET['selectcat']),
  57. ];
  58. $table = new SortableTableFromArrayConfig($list_info, 1, 20, 'gradebookeval');
  59. $table->set_additional_parameters($parameters);
  60. $table->set_header(0, get_lang('GradebookNameLog'));
  61. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  62. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  63. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  64. $table->set_header(4, get_lang('ResourceType'));
  65. $table->set_header(5, get_lang('Date'));
  66. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  67. $table->display();
  68. Display :: display_footer();