gradebook_showlog_link.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 'lib/be.inc.php';
  14. require_once 'lib/gradebook_functions.inc.php';
  15. require_once 'lib/fe/evalform.class.php';
  16. api_block_anonymous_users();
  17. block_students();
  18. $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?','name' => get_lang('Gradebook'));
  19. $interbreadcrumb[] = array ('url' => Security::remove_XSS($_SESSION['gradebook_dest']).'?selectcat='.Security::remove_XSS($_GET['selectcat']),'name' => get_lang('Details'));
  20. $interbreadcrumb[] = array ('url' => 'gradebook_showlog_link.php?visiblelink='.Security::remove_XSS($_GET['visiblelink']).'&amp;selectcat='.Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('GradebookQualifyLog'));
  21. $this_section = SECTION_COURSES;
  22. Display :: display_header('');
  23. echo '<div class="actions">';
  24. api_display_tool_title(get_lang('GradebookQualifyLog'));
  25. echo '</div>';
  26. $t_user = Database :: get_main_table(TABLE_MAIN_USER);
  27. $t_link_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  28. $visible_link=Security::remove_XSS($_GET['visiblelink']);
  29. $evaledit = EvalLink :: load($visible_link);
  30. $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';";
  31. $result=Database::query($sql);
  32. $list_info=array();
  33. while ($row=Database::fetch_row($result)) {
  34. $list_info[]=$row;
  35. }
  36. foreach($list_info as $key => $info_log) {
  37. $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
  38. $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  39. }
  40. $parameters=array('visiblelink'=>Security::remove_XSS($_GET['visiblelink']),'selectcat'=>Security::remove_XSS($_GET['selectcat']));
  41. $table = new SortableTableFromArrayConfig($list_info, 1,20,'gradebooklink');
  42. $table->set_additional_parameters($parameters);
  43. $table->set_header(0, get_lang('GradebookNameLog'));
  44. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  45. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  46. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  47. $table->set_header(4, get_lang('ResourceType'));
  48. $table->set_header(5, get_lang('Date'));
  49. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  50. $table->display();
  51. Display :: display_footer();