skills_wheel.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. $cidReset = true;
  7. require_once '../inc/global.inc.php';
  8. $this_section = SECTION_SOCIAL;
  9. if (api_get_setting('allow_skills_tool') != 'true') {
  10. api_not_allowed();
  11. }
  12. api_block_anonymous_users();
  13. //Adds the JS needed to use the jqgrid
  14. $htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js');
  15. $htmlHeadXtra[] = api_get_js('d3/colorbrewer.js');
  16. $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
  17. $tpl = new Template(null, false, false);
  18. $userId = api_get_user_id();
  19. $userInfo = api_get_user_info();
  20. $skill = new Skill();
  21. $ranking = $skill->get_user_skill_ranking($userId);
  22. $skills = $skill->get_user_skills($userId, true);
  23. $dialogForm = new FormValidator('form', 'post', null, null, ['id' => 'add_item']);
  24. $dialogForm->addLabel(
  25. get_lang('Name'),
  26. Display::tag('p', null, ['id' => 'name', 'class' => 'form-control-static'])
  27. );
  28. $dialogForm->addLabel(
  29. get_lang('ShortCode'),
  30. Display::tag('p', null, ['id' => 'short_code', 'class' => 'form-control-static'])
  31. );
  32. $dialogForm->addLabel(
  33. get_lang('Parent'),
  34. Display::tag('p', null, ['id' => 'parent', 'class' => 'form-control-static'])
  35. );
  36. $dialogForm->addLabel(
  37. [get_lang('Gradebook'), get_lang('WithCertificate')],
  38. Display::tag('ul', null, ['id' => 'gradebook', 'class' => 'form-control-static list-unstyled'])
  39. );
  40. $dialogForm->addLabel(
  41. get_lang('Description'),
  42. Display::tag('p', null, ['id' => 'description', 'class' => 'form-control-static'])
  43. );
  44. $tpl->assign('dialogForm', $dialogForm->returnForm());
  45. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$userId";
  46. $tpl->assign('wheel_url', $url);
  47. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  48. $tpl->assign('url', $url);
  49. $tpl->assign('user_info', $userInfo);
  50. $tpl->assign('ranking', $ranking);
  51. $tpl->assign('skills', $skills);
  52. $content = $tpl->fetch('default/skill/skill_wheel_student.tpl');
  53. $tpl->assign('content', $content);
  54. $tpl->display_no_layout_template();