gradebook_showlog_link.php 2.4 KB

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