skills_wheel.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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_PLATFORM_ADMIN;
  9. api_protect_admin_script(false, true);
  10. if (api_get_setting('allow_skills_tool') != 'true') {
  11. api_not_allowed();
  12. }
  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 = 0;
  21. if (isset($_GET['load_user'])) {
  22. $load_user = 1;
  23. }
  24. $skill_condition = '';
  25. if (isset($_GET['skill_id'])) {
  26. $skill_condition = '&skill_id='.intval($_GET['skill_id']);
  27. $tpl->assign('skill_id_to_load', $_GET['skill_id']);
  28. }
  29. $url = api_get_path(WEB_AJAX_PATH)."skill.ajax.php?a=get_skills_tree_json&load_user=$load_user";
  30. $tpl->assign('wheel_url', $url);
  31. $url = api_get_path(WEB_AJAX_PATH).'skill.ajax.php?1=1';
  32. $tpl->assign('url', $url);
  33. $tpl->assign('isAdministration', true);
  34. $dialogForm = new FormValidator('form', 'post', null, null, ['id' => 'add_item']);
  35. $dialogForm->addLabel(
  36. get_lang('Name'),
  37. Display::tag('p', null, ['id' => 'name', 'class' => 'form-control-static'])
  38. );
  39. $dialogForm->addLabel(
  40. get_lang('ShortCode'),
  41. Display::tag('p', null, ['id' => 'short_code', 'class' => 'form-control-static'])
  42. );
  43. $dialogForm->addLabel(
  44. get_lang('Parent'),
  45. Display::tag('p', null, ['id' => 'parent', 'class' => 'form-control-static'])
  46. );
  47. $dialogForm->addLabel(
  48. [get_lang('Gradebook'), get_lang('WithCertificate')],
  49. Display::tag('ul', null, ['id' => 'gradebook', 'class' => 'form-control-static list-unstyled'])
  50. );
  51. $dialogForm->addLabel(
  52. get_lang('Description'),
  53. Display::tag('p', null, ['id' => 'description', 'class' => 'form-control-static'])
  54. );
  55. $tpl->assign('dialogForm', $dialogForm->returnForm());
  56. $saveProfileForm = new FormValidator('form', 'post', null, null, ['id' => 'dialog-form-profile']);
  57. $saveProfileForm->addHidden('profile_id', null);
  58. $saveProfileForm->addText('name', get_lang('Name'), true, ['id' => 'name_profile']);
  59. $saveProfileForm->addTextarea('description', get_lang('Description'), ['id' => 'description_profile', 'rows' => 6]);
  60. $tpl->assign('saveProfileForm', $saveProfileForm->returnForm());
  61. $content = $tpl->fetch('default/skill/skill_wheel.tpl');
  62. $tpl->assign('content', $content);
  63. $tpl->display_no_layout_template();