gradebook_showlog_eval.php 2.5 KB

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