gradebook_showlog_link.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_link.php?visiblelink='.Security::remove_XSS($_GET['visiblelink']).'&selectcat='.$selectCat,
  22. 'name' => get_lang('GradebookQualifyLog'),
  23. ];
  24. $this_section = SECTION_COURSES;
  25. Display::display_header('');
  26. echo '<div class="actions">';
  27. api_display_tool_title(get_lang('GradebookQualifyLog'));
  28. echo '</div>';
  29. $t_user = Database::get_main_table(TABLE_MAIN_USER);
  30. $t_link_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  31. $visible_link = Security::remove_XSS($_GET['visiblelink']);
  32. $evaledit = EvalLink:: load($visible_link);
  33. $sql = "SELECT lk.name,lk.description,lk.weight,lk.visible,lk.type,lk.created_at,us.username
  34. FROM ".$t_link_log." lk inner join ".$t_user." us
  35. ON lk.user_id_log=us.user_id
  36. WHERE lk.id_linkeval_log=".$evaledit[0]->get_id()." AND lk.type='link';";
  37. $result = Database::query($sql);
  38. $list_info = [];
  39. while ($row = Database::fetch_row($result)) {
  40. $list_info[] = $row;
  41. }
  42. foreach ($list_info as $key => $info_log) {
  43. $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
  44. $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  45. }
  46. $parameters = [
  47. 'visiblelink' => Security::remove_XSS($_GET['visiblelink']),
  48. 'selectcat' => $selectCat,
  49. ];
  50. $table = new SortableTableFromArrayConfig($list_info, 1, 20, 'gradebooklink');
  51. $table->set_additional_parameters($parameters);
  52. $table->set_header(0, get_lang('GradebookNameLog'));
  53. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  54. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  55. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  56. $table->set_header(4, get_lang('ResourceType'));
  57. $table->set_header(5, get_lang('Date'));
  58. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  59. $table->display();
  60. Display :: display_footer();