gradebook_showlog_link.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php // $Id: $
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Script
  5. * @package chamilo.gradebook
  6. */
  7. /**
  8. * Init
  9. */
  10. $language_file = 'gradebook';
  11. //$cidReset = true;
  12. require_once '../inc/global.inc.php';
  13. require_once api_get_path(LIBRARY_PATH).'sortable_table.class.php';
  14. require_once 'lib/be.inc.php';
  15. require_once 'lib/gradebook_functions.inc.php';
  16. require_once 'lib/fe/evalform.class.php';
  17. api_block_anonymous_users();
  18. block_students();
  19. $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?','name' => get_lang('Gradebook'));
  20. $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details'));
  21. $interbreadcrumb[] = array ('url' => 'gradebook_showlog_link.php?visiblelink='.Security::remove_XSS($_GET['visiblelink']).'&amp;selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('GradebookQualifyLog'));
  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 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';";
  32. $result=Database::query($sql);
  33. $list_info=array();
  34. while ($row=Database::fetch_row($result)) {
  35. $list_info[]=$row;
  36. }
  37. foreach($list_info as $key => $info_log) {
  38. $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
  39. $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  40. }
  41. $parameters=array('visiblelink'=>Security::remove_XSS($_GET['visiblelink']),'selectcat'=>Security::remove_XSS($_GET['selectcat']));
  42. $table = new SortableTableFromArrayConfig($list_info, 1,20,'gradebooklink');
  43. $table->set_additional_parameters($parameters);
  44. $table->set_header(0, get_lang('GradebookNameLog'));
  45. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  46. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  47. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  48. $table->set_header(4, get_lang('ResourceType'));
  49. $table->set_header(5, get_lang('Date'));
  50. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  51. $table->display();
  52. Display :: display_footer();