gradebook_showlog_link.php 2.4 KB

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