skills_wheel.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. $htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/jquery.fcbkcomplete.js" type="text/javascript" language="javascript"></script>';
  18. $htmlHeadXtra[] = '<link href="'.api_get_path(WEB_LIBRARY_PATH).'javascript/tag/style.css" rel="stylesheet" type="text/css" />';
  19. $tpl = new Template(null, false, false);
  20. $load_user = api_get_user_id();
  21. $userInfo = api_get_user_info();
  22. $skill = new Skill();
  23. $ranking = $skill->get_user_skill_ranking($load_user);
  24. $countSkill = count($skill->get_all());
  25. $mySkills = $skill->get_user_skills($user_id, true);
  26. $skill_condition = '';
  27. if (isset($_GET['skill_id'])) {
  28. $skill_condition = '&skill_id='.intval($_GET['skill_id']);
  29. $tpl->assign('skill_id_to_load', $_GET['skill_id']);
  30. }
  31. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
  32. $tpl->assign('wheel_url', $url);
  33. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  34. $tpl->assign('url', $url);
  35. $tpl->assign('userInfo', $userInfo);
  36. $tpl->assign('ranking', $ranking);
  37. $tpl->assign('countSkill', $countSkill);
  38. $tpl->assign('mySkills', $mySkills);
  39. $dialogForm = new FormValidator('form', 'post', null, null, ['id' => 'add_item']);
  40. $dialogForm->addLabel(
  41. get_lang('Name'),
  42. Display::tag('p', null, ['id' => 'name', 'class' => 'form-control-static'])
  43. );
  44. $dialogForm->addLabel(
  45. get_lang('ShortCode'),
  46. Display::tag('p', null, ['id' => 'short_code', 'class' => 'form-control-static'])
  47. );
  48. $dialogForm->addLabel(
  49. get_lang('Parent'),
  50. Display::tag('p', null, ['id' => 'parent', 'class' => 'form-control-static'])
  51. );
  52. $dialogForm->addLabel(
  53. [get_lang('Gradebook'), get_lang('WithCertificate')],
  54. Display::tag('ul', null, ['id' => 'gradebook', 'class' => 'form-control-static list-unstyled'])
  55. );
  56. $dialogForm->addLabel(
  57. get_lang('Description'),
  58. Display::tag('p', null, ['id' => 'description', 'class' => 'form-control-static'])
  59. );
  60. $tpl->assign('dialogForm', $dialogForm->returnForm());
  61. $content = $tpl->fetch('default/skill/skill_wheel_student.tpl');
  62. $tpl->assign('content', $content);
  63. $tpl->display_no_layout_template();