gradebook_showlog_link.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Script
  5. * @package chamilo.gradebook
  6. */
  7. require_once __DIR__.'/../inc/global.inc.php';
  8. api_block_anonymous_users();
  9. GradebookUtils::block_students();
  10. $selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
  11. $interbreadcrumb[] = array(
  12. 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?',
  13. 'name' => get_lang('Gradebook'),
  14. );
  15. $interbreadcrumb[] = array(
  16. 'url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.$selectCat,
  17. 'name' => get_lang('Details')
  18. );
  19. $interbreadcrumb[] = array(
  20. 'url' => 'gradebook_showlog_link.php?visiblelink='.Security::remove_XSS($_GET['visiblelink']).'&selectcat='.$selectCat,
  21. 'name' => get_lang('GradebookQualifyLog')
  22. );
  23. $this_section = SECTION_COURSES;
  24. Display :: display_header('');
  25. echo '<div class="actions">';
  26. api_display_tool_title(get_lang('GradebookQualifyLog'));
  27. echo '</div>';
  28. $t_user = Database::get_main_table(TABLE_MAIN_USER);
  29. $t_link_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  30. $visible_link = Security::remove_XSS($_GET['visiblelink']);
  31. $evaledit = EvalLink:: load($visible_link);
  32. $sql = "SELECT lk.name,lk.description,lk.weight,lk.visible,lk.type,lk.created_at,us.username
  33. FROM ".$t_link_log." lk inner join ".$t_user." us
  34. ON lk.user_id_log=us.user_id
  35. WHERE lk.id_linkeval_log=".$evaledit[0]->get_id()." AND lk.type='link';";
  36. $result = Database::query($sql);
  37. $list_info = array();
  38. while ($row = Database::fetch_row($result)) {
  39. $list_info[] = $row;
  40. }
  41. foreach ($list_info as $key => $info_log) {
  42. $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
  43. $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  44. }
  45. $parameters = array(
  46. 'visiblelink' => Security::remove_XSS($_GET['visiblelink']),
  47. 'selectcat' => $selectCat,
  48. );
  49. $table = new SortableTableFromArrayConfig($list_info, 1, 20, 'gradebooklink');
  50. $table->set_additional_parameters($parameters);
  51. $table->set_header(0, get_lang('GradebookNameLog'));
  52. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  53. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  54. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  55. $table->set_header(4, get_lang('ResourceType'));
  56. $table->set_header(5, get_lang('Date'));
  57. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  58. $table->display();
  59. Display :: display_footer();