public function show_coursepathTask()
 {
     $id_path = Get::req('id_path', DOTY_INT, 0);
     if ($id_path <= 0) {
         //...
         return;
     }
     Util::get_js(Get::rel_path('base') . '/lib/lib.elem_selector.js', true, true);
     $res = Get::req('res', DOTY_STRING, "");
     $message = false;
     switch ($res) {
         case 'ok':
             $message = UIFeedback::info(Lang::t(strtoupper($_GET['res']), 'subscription'));
             break;
         case 'err':
             $message = UIFeedback::error(Lang::t(strtoupper($_GET['err']), 'subscription'));
             break;
     }
     Form::loadDatefieldScript();
     //some dialogs use date inputs
     $umodel = new UsermanagementAdm();
     $params = array('back_link' => 'index.php?modname=coursepath&op=pathlist&of_platform=lms', 'id_path' => $id_path, 'message' => $message, 'orgchart_list' => $umodel->getOrgChartDropdownList(), 'is_active_advanced_filter' => false, 'filter_text' => "", 'filter_orgchart' => 0, 'filter_descendants' => false, 'filter_date_valid' => "", 'filter_show' => 0, 'path_name' => $this->model->getCoursepathNameForSubscription($id_path));
     $this->render('show_coursepath', $params);
 }
 function _step1()
 {
     $GLOBALS['page']->add($this->form->getLineBox($this->lang->def('_NAME'), $this->post_params['name']));
     // ---- the tree selector -----
     /* $GLOBALS['page']->add($this->lang->def('_TREE_INSERT'));
     		$this->directory->show_orgchart_selector = FALSE;
     		$this->directory->show_orgchart_simple_selector = TRUE;
     		$this->directory->multi_choice = FALSE;
     		$this->directory->selector_mode = TRUE;
     		$this->directory->loadOrgChartView(); */
     $umodel = new UsermanagementAdm();
     $out = $this->form->getDropdown(Lang::t('_DIRECTORY_MEMBERTYPETREE', 'admin_directory'), $this->_get_base_name() . '_org_chart_destination', $this->_get_base_name() . '[org_chart_destination]', $umodel->getOrgChartDropdownList(), $this->post_params['org_chart_destination']);
     // ---- add a button to reset selection -----
     /* $out = $this->form->getButton(	$this->_get_base_name().'_reset',
     			$this->_get_base_name().'[reset]', 
     			$this->lang->def('_RESET')); */
     return $out;
 }
 public function showTask()
 {
     $id_course = isset($_SESSION['idCourse']) && $_SESSION['idCourse'] > 0 ? $_SESSION['idCourse'] : false;
     if ((int) $id_course <= 0) {
         //...
         return;
     }
     Util::get_js(Get::rel_path("base") . '/lib/js_utils.js', true, true);
     Util::get_js(Get::rel_path("lms") . '/views/coursestats/coursestats.js', true, true);
     $total_users = $this->model->getCourseStatsTotal($id_course, false);
     $lo_totals = $this->model->getLOsTotalCompleted($id_course);
     $_arr_js = array();
     foreach ($lo_totals as $id_lo => $total_lo) {
         $_arr_js[] = '{id:"lo_totals_' . $id_lo . '", total:"' . $total_lo . ' / ' . $total_users . '", ' . 'percent:"' . number_format($total_lo / $total_users, 2) . ' %"}';
     }
     $lo_totals_js = implode(",", $_arr_js);
     //WARNING: lo_list and lo_totals must have the same keys order
     $umodel = new UsermanagementAdm();
     $gmodel = new GroupmanagementAdm();
     $params = array('id_course' => $id_course, 'lo_list' => $this->model->getCourseLOs($id_course), 'filter_text' => "", 'filter_selection' => 0, 'filter_orgchart' => 0, 'filter_groups' => 0, 'filter_descendants' => false, 'is_active_advanced_filter' => false, 'orgchart_list' => $umodel->getOrgChartDropdownList(), 'groups_list' => $gmodel->getGroupsDropdownList(), 'total_users' => (int) $total_users, 'lo_totals_js' => $lo_totals_js, 'status_list' => $this->_getJsArrayStatus(), 'permissions' => $this->permissions);
     $this->render('show', $params);
 }