skills_wheel.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * @package chamilo.admin
  5. */
  6. $cidReset = true;
  7. require_once __DIR__.'/../inc/global.inc.php';
  8. $this_section = SECTION_SOCIAL;
  9. api_block_anonymous_users();
  10. Skill::isAllowed(api_get_user_id());
  11. //Adds the JS needed to use the jqgrid
  12. $htmlHeadXtra[] = api_get_js('d3/d3.v3.5.4.min.js');
  13. $htmlHeadXtra[] = api_get_js('d3/colorbrewer.js');
  14. $htmlHeadXtra[] = api_get_js('d3/jquery.xcolor.js');
  15. $htmlHeadXtra[] = api_get_js('jquery.jsPlumb.all.js');
  16. $htmlHeadXtra[] = api_get_js('jqueryui-touch-punch/jquery.ui.touch-punch.min.js');
  17. $htmlHeadXtra[] = api_get_js('skills.js');
  18. $tpl = new Template(null, false, false);
  19. $userId = api_get_user_id();
  20. $userInfo = api_get_user_info();
  21. $skill = new Skill();
  22. $ranking = $skill->getUserSkillRanking($userId);
  23. $skills = $skill->getUserSkills($userId, true);
  24. $dialogForm = new FormValidator('form', 'post', null, null, ['id' => 'add_item']);
  25. $dialogForm->addLabel(
  26. get_lang('Name'),
  27. Display::tag('p', null, ['id' => 'name', 'class' => 'form-control-static'])
  28. );
  29. $dialogForm->addLabel(
  30. get_lang('Short code'),
  31. Display::tag('p', null, ['id' => 'short_code', 'class' => 'form-control-static'])
  32. );
  33. $dialogForm->addLabel(
  34. get_lang('Parent'),
  35. Display::tag('p', null, ['id' => 'parent', 'class' => 'form-control-static'])
  36. );
  37. $dialogForm->addLabel(
  38. [
  39. get_lang('Assessments'),
  40. get_lang('With Certificate'),
  41. ],
  42. Display::tag(
  43. 'ul',
  44. null,
  45. ['id' => 'gradebook', 'class' => 'form-control-static list-unstyled']
  46. )
  47. );
  48. $dialogForm->addLabel(
  49. get_lang('Description'),
  50. Display::tag('p', null, ['id' => 'description', 'class' => 'form-control-static'])
  51. );
  52. $type = 'read';
  53. $tree = $skill->getSkillsTree($userId, null, true);
  54. $skill_visualizer = new SkillVisualizer($tree, $type);
  55. $tpl->assign('skill_visualizer', $skill_visualizer);
  56. $tpl->assign('dialogForm', $dialogForm->returnForm());
  57. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$userId";
  58. $tpl->assign('wheel_url', $url);
  59. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  60. $tpl->assign('url', $url);
  61. $tpl->assign('user_info', $userInfo);
  62. $tpl->assign('ranking', $ranking);
  63. $tpl->assign('skills', $skills);
  64. $template = $tpl->get_template('skill/skill_wheel_student.tpl');
  65. $content = $tpl->fetch($template);
  66. $tpl->assign('content', $content);
  67. $tpl->display_no_layout_template();