gradebook_showlog_link.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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).'sortabletable.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="clear"></div>';
  25. echo '<div class="actions">';
  26. api_display_tool_title(get_lang('GradebookQualifyLog'));
  27. echo '</div>';
  28. $t_user = Database :: get_main_table(TABLE_MAIN_USER);
  29. $t_link_log = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINKEVAL_LOG);
  30. $visible_link=Security::remove_XSS($_GET['visiblelink']);
  31. $evaledit = EvalLink :: load($visible_link);
  32. $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';";
  33. $result=Database::query($sql);
  34. $list_info=array();
  35. while ($row=Database::fetch_row($result)) {
  36. $list_info[]=$row;
  37. }
  38. foreach($list_info as $key => $info_log) {
  39. $list_info[$key][5]=($info_log[5]) ? api_convert_and_format_date($info_log[5]) : 'N/A';
  40. $list_info[$key][3]=($info_log[3]==1) ? get_lang('GradebookVisible') : get_lang('GradebookInvisible');
  41. }
  42. $parameters=array('visiblelink'=>Security::remove_XSS($_GET['visiblelink']),'selectcat'=>Security::remove_XSS($_GET['selectcat']));
  43. $table = new SortableTableFromArrayConfig($list_info, 1,20,'gradebooklink');
  44. $table->set_additional_parameters($parameters);
  45. $table->set_header(0, get_lang('GradebookNameLog'));
  46. $table->set_header(1, get_lang('GradebookDescriptionLog'));
  47. $table->set_header(2, get_lang('GradebookPreviousWeight'));
  48. $table->set_header(3, get_lang('GradebookVisibilityLog'));
  49. $table->set_header(4, get_lang('ResourceType'));
  50. $table->set_header(5, get_lang('Date'));
  51. $table->set_header(6, get_lang('GradebookWhoChangedItLog'));
  52. $table->display();
  53. Display :: display_footer();