gradebook_showlog_link.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php // $Id: $
  2. /* For licensing terms, see /license.txt */
  3. $language_file = 'gradebook';
  4. //$cidReset = true;
  5. require_once '../inc/global.inc.php';
  6. require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
  7. require_once 'lib/be.inc.php';
  8. require_once 'lib/gradebook_functions.inc.php';
  9. require_once 'lib/fe/evalform.class.php';
  10. api_block_anonymous_users();
  11. block_students();
  12. $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?','name' => get_lang('Gradebook'));
  13. $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details'));
  14. $interbreadcrumb[] = array ('url' => 'gradebook_showlog_link.php?visiblelink='.Security::remove_XSS($_GET['visiblelink']).'&amp;selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('GradebookQualifyLog'));
  15. $this_section = SECTION_COURSES;
  16. Display :: display_header('');
  17. echo '<div class="clear"></div>';
  18. echo '<div class="actions">';
  19. api_display_tool_title(get_lang('GradebookQualifyLog'));
  20. echo '</div>';
  21. $t_user = Database :: get_main_table(TABLE_MAIN_USER);
  22. $t_link_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  23. $visible_link=Security::remove_XSS($_GET['visiblelink']);
  24. $evaledit = EvalLink :: load($visible_link);
  25. $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';";
  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('visiblelink'=>Security::remove_XSS($_GET['visiblelink']),'selectcat'=>Security::remove_XSS($_GET['selectcat']));
  36. $table = new SortableTableFromArrayConfig($list_info, 1,20,'gradebooklink');
  37. $table->set_additional_parameters($parameters);
  38. $table->set_header(0, get_lang('GradebookNameLog'));
  39. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  40. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  41. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  42. $table->set_header(4, get_lang('ResourceType'));
  43. $table->set_header(5, get_lang('Date'));
  44. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  45. $table->display();
  46. Display :: display_footer();