skills_wheel.php 2.4 KB

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