gradebook_showlog_link.php 2.4 KB

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