gradebook_showlog_eval.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Script
  5. * @package chamilo.gradebook
  6. */
  7. require_once __DIR__.'/../inc/global.inc.php';
  8. api_block_anonymous_users();
  9. GradebookUtils::block_students();
  10. $selectCat = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
  11. $interbreadcrumb[] = array(
  12. 'url' => Category::getUrl(),
  13. 'name' => get_lang('Gradebook')
  14. );
  15. $interbreadcrumb[] = array(
  16. 'url' => Category::getUrl().'selectcat='.$selectCat,
  17. 'name' => get_lang('Details')
  18. );
  19. $interbreadcrumb[] = array(
  20. 'url' => 'gradebook_showlog_eval.php?visiblelog='.Security::remove_XSS($_GET['visiblelog']).'&amp;selectcat='.$selectCat,
  21. 'name' => get_lang('GradebookQualifyLog')
  22. );
  23. $this_section = SECTION_COURSES;
  24. Display::display_header('');
  25. echo Display::page_header(get_lang('GradebookQualifyLog'));
  26. $t_linkeval_log = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  27. $t_user = Database::get_main_table(TABLE_MAIN_USER);
  28. $visible_log = Security::remove_XSS($_GET['visiblelog']);
  29. $evaledit = Evaluation :: load($visible_log);
  30. $sql = "SELECT le.name,le.description,le.weight,le.visible,le.type,le.created_at,us.username
  31. FROM ".$t_linkeval_log." le
  32. INNER JOIN ".$t_user." us
  33. ON le.user_id_log=us.user_id
  34. WHERE id_linkeval_log=".$evaledit[0]->get_id()." AND type='evaluation';";
  35. $result = Database::query($sql);
  36. $list_info = array();
  37. while ($row = Database::fetch_row($result)) {
  38. $list_info[] = $row;
  39. }
  40. foreach ($list_info as $key => $info_log) {
  41. $list_info[$key][5] = ($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
  42. $list_info[$key][3] = ($info_log[3] == 1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  43. }
  44. $parameters = array(
  45. 'visiblelog' => $visible_log,
  46. 'selectcat' => intval($_GET['selectcat']),
  47. );
  48. $table = new SortableTableFromArrayConfig($list_info, 1, 20, 'gradebookeval');
  49. $table->set_additional_parameters($parameters);
  50. $table->set_header(0, get_lang('GradebookNameLog'));
  51. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  52. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  53. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  54. $table->set_header(4, get_lang('ResourceType'));
  55. $table->set_header(5, get_lang('Date'));
  56. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  57. $table->display();
  58. Display :: display_footer();