function mod_report_name()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    //require_once($GLOBALS['where_framework'].'/lib/lib.json.php');
    require_once $GLOBALS['where_lms'] . '/admin/modules/report/class.report.php';
    //reportbox class
    require_once $GLOBALS['where_lms'] . '/lib/lib.report.php';
    //require_once('report_categories.php');
    load_categories();
    $lang =& DoceboLanguage::createInstance('report');
    $idrep = Get::req('modid', DOTY_INT, false);
    //if (!idrep) Util::jump_to(initial page ... )
    $page_title = getTitleArea(array('index.php?modname=public_report_admin&op=reportlist' => $lang->def('_REPORT'), $lang->def('_REPORT_MOD_NAME')), 'report');
    $GLOBALS['page']->add($page_title . '<div class="std_block">', 'content');
    $info = get_update_info();
    if ($info) {
        $GLOBALS['page']->add(getInfoUi($info), 'content');
    }
    $box = new ReportBox('report_modify_name');
    $box->title = $lang->def('_REPORT_MOD_NAME');
    $box->description = $lang->def('_REPORT_MODNAME_DESC');
    $box->body = Form::openForm('repcat_form', 'index.php?modname=public_report_admin&amp;op=modify_rows&amp;modid=' . $idrep) . Form::getHidden('mod_name', 'mod_name', 1);
    //$json = new Services_JSON();
    //$rdata =& getFilterData($idrep);
    //Form::getHidden('report_filter_data', 'report_filter_data', $json->encode($rdata));
    $box->body .= Form::getTextField($lang->def('_MOD_REPORT_NAME'), 'report_name', 'report_name', '200', getReportNameById($idrep));
    $box->body .= Form::openButtonSpace() . Form::getButton('', '', $lang->def('_FORWARD'), false) . Form::closeButtonSpace() . Form::closeForm();
    $GLOBALS['page']->add($box->get(), 'content');
    /*$lang->def('_REPORT_SCHEDMAN');$lang->def('_REPORT_SCHEDMAN_DESC');*/
    $GLOBALS['page']->add('</div>', 'content');
}
Esempio n. 2
0
function report_modify_name()
{
    checkPerm('mod');
    require_once _lms_ . '/admin/modules/report/class.report.php';
    //reportbox class
    require_once _lms_ . '/lib/lib.report.php';
    //require_once('report_categories.php');
    load_categories();
    $lang =& DoceboLanguage::createInstance('report');
    $idrep = Get::req('modid', DOTY_INT, false);
    //if (!idrep) Util::jump_to(initial page ... )
    $page_title = getTitleArea(array('index.php?modname=report&amp;op=reportlist' => $lang->def('_REPORT'), $lang->def('_MOD')), 'report');
    cout($page_title . '<div class="std_block">');
    $info = get_update_info();
    //if($info) cout( getInfoUi($info) );
    $box = new ReportBox('report_modify_name');
    $box->title = $lang->def('_MOD');
    $box->description = false;
    $box->body = Form::openForm('repcat_form', 'index.php?modname=report&op=modify_rows&modid=' . $idrep) . Form::getHidden('mod_name', 'mod_name', 1);
    $box->body .= Form::getTextField($lang->def('_NAME'), 'report_name', 'report_name', '200', getReportNameById($idrep));
    $box->body .= Form::openButtonSpace() . Form::getButton('', '', $lang->def('_NEXT')) . Form::closeButtonSpace() . Form::closeForm();
    cout($box->get());
    cout('</div>', 'content');
}
Esempio n. 3
0
 function get_games_filter()
 {
     $back_url = $this->back_url;
     $jump_url = $this->jump_url;
     $next_url = $this->next_url;
     //preliminary checks
     if (isset($_POST['undo_filter'])) {
         Util::jump_to($back_url);
     }
     if (!isset($_SESSION['report_tempdata']['columns_filter'])) {
         $_SESSION['report_tempdata']['columns_filter'] = array('comp_selection' => array(), 'all_games' => false, 'comp_start_date' => '', 'comp_end_date' => '');
     }
     $ref =& $_SESSION['report_tempdata']['columns_filter'];
     if (isset($_POST['update_tempdata'])) {
         $ref['all_games'] = Get::req('all_games', DOTY_INT, 0) > 0;
         $ref['comp_selection'] = Get::req('comp_selection', DOTY_MIXED, array());
         $ref['comp_start_date'] = Format::dateDb(Get::req('comp_start_date', DOTY_STRING, ''), 'date');
         $ref['comp_end_date'] = Format::datedb(Get::req('comp_end_date', DOTY_STRING, ''), 'date');
     } else {
         //...
     }
     //filter setting done, go to next step
     if (isset($_POST['import_filter']) || isset($_POST['show_filter']) || isset($_POST['pre_filter'])) {
         $temp_url = $next_url;
         if (isset($_POST['pre_filter'])) {
             $temp_url .= '&show=1&nosave=1';
         }
         if (isset($_POST['show_filter'])) {
             $temp_url .= '&show=1';
         }
         Util::jump_to($temp_url);
     }
     //draw filter boxes
     $html = '';
     //time period
     $box = new ReportBox('comm_selector');
     $box->title = Lang::t('_TIME_PERIOD_FILTER', 'report');
     $box->description = false;
     $box->body .= Form::getDatefield(Lang::t('_FROM', 'standard'), 'comp_start_date', 'comp_start_date', $ref['comp_start_date']);
     $box->body .= Form::getDatefield(Lang::t('_TO', 'standard'), 'comp_end_date', 'comp_end_date', $ref['comp_end_date']);
     $html .= $box->get();
     //draw games selector
     $box = new ReportBox('comp_selector');
     $box->title = Lang::t('_CONTEST');
     $box->description = false;
     require_once _lms_ . '/lib/lib.report.php';
     //the comm. table function
     $box->body .= Form::getCheckbox(Lang::t('_ALL', 'report'), 'all_games', 'all_games', 1, $ref['all_games']);
     $box->body .= '<br />';
     $box->body .= getGamesTable($ref['comp_selection']);
     $box->body .= Form::getHidden('update_tempdata', 'update_tempdata', 1);
     $html .= $box->get();
     cout($html);
 }
    function get_user_filter()
    {
        $back_url = $this->back_url;
        $jump_url = $this->jump_url;
        $next_url = $this->next_url;
        require_once _base_ . '/lib/lib.form.php';
        require_once _adm_ . '/lib/lib.directory.php';
        require_once _adm_ . '/class.module/class.directory.php';
        require_once _lms_ . '/lib/lib.course.php';
        $lang =& DoceboLanguage::createInstance('report', 'framework');
        $org_chart_subdivision = importVar('org_chart_subdivision', true, 0);
        //detect the step in which we are
        $substep = _SUBSTEP_USERS;
        //first substep
        switch (Get::req('substep', DOTY_STRING, 'no_step')) {
            case 'users_selection':
                $substep = _SUBSTEP_USERS;
                break;
            case 'columns_selection':
                $substep = _SUBSTEP_COLUMNS;
                break;
        }
        //draw page depending on the $substep variable
        if (!isset($_SESSION['report_tempdata']['columns_filter'])) {
            $_SESSION['report_tempdata']['columns_filter'] = array('time_belt' => array('time_range' => '', 'start_date' => '', 'end_date' => ''), 'org_chart_subdivision' => 0, 'show_classrooms_editions' => false, 'showed_cols' => array(), 'show_percent' => true, 'show_suspended' => false, 'only_students' => false, 'show_assessment' => false);
        }
        $ref =& $_SESSION['report_tempdata']['columns_filter'];
        switch ($substep) {
            case _SUBSTEP_COLUMNS:
                //set session data
                if (Get::req('is_updating', DOTY_INT, 0) > 0) {
                    $ref['showed_cols'] = Get::req('cols', DOTY_MIXED, array());
                    $ref['show_percent'] = Get::req('show_percent', DOTY_INT, 0) > 0 ? true : false;
                    $ref['time_belt'] = array('time_range' => $_POST['time_belt'], 'start_date' => Format::dateDb($_POST['start_time'], 'date'), 'end_date' => Format::dateDb($_POST['end_time'], 'date'));
                    $ref['org_chart_subdivision'] = isset($_POST['org_chart_subdivision']) ? 1 : 0;
                    $ref['show_classrooms_editions'] = isset($_POST['show_classrooms_editions']) ? true : false;
                    $ref['show_suspended'] = Get::req('show_suspended', DOTY_INT, 0) > 0;
                    $ref['only_students'] = Get::req('only_students', DOTY_INT, 0) > 0;
                    $ref['show_assessment'] = Get::req('show_assessment', DOTY_INT, 0) > 0;
                } else {
                    //...
                }
                //check action
                if (isset($_POST['cancelselector'])) {
                    Util::jump_to($jump_url . '&substep=users_selection');
                }
                if (isset($_POST['import_filter']) || isset($_POST['show_filter']) || isset($_POST['pre_filter'])) {
                    $temp_url = $next_url;
                    if (isset($_POST['pre_filter'])) {
                        $temp_url .= '&show=1&nosave=1';
                    }
                    if (isset($_POST['show_filter'])) {
                        $temp_url .= '&show=1';
                    }
                    Util::jump_to($temp_url);
                }
                cout($this->page_title, 'content');
                function is_showed($which, &$arr)
                {
                    if (isset($arr['showed_cols'])) {
                        return in_array($which, $arr['showed_cols']);
                    } else {
                        return false;
                    }
                }
                /*$go_to_second_step = (isset($_POST['go_to_second_step']) ? true : false);
                		$we_are_in_second_step = Get::req('second_step', DOTY_INT, false);*/
                $time_belt = array(0 => $lang->def('_CUSTOM_BELT'), 7 => $lang->def('_LAST_WEEK'), 31 => $lang->def('_LAST_MONTH'), 93 => $lang->def('_LAST_THREE_MONTH'), 186 => $lang->def('_LAST_SIX_MONTH'), 365 => $lang->def('_LAST_YEAR'));
                cout(Form::openForm('user_report_rows_courses', $jump_url) . Form::getHidden('update_tempdata', 'update_tempdata', 1) . Form::getHidden('is_updating', 'is_updating', 1) . Form::getHidden('substep', 'substep', 'columns_selection'), 'content');
                //box for time belt
                $box = new ReportBox('timebelt_box');
                $box->title = $lang->def('_REPORT_USER_TITLE_TIMEBELT');
                $box->description = Lang::t('_TIME_PERIOD_FILTER', 'report');
                $box->body = Form::getDropdown($lang->def('_TIME_BELT'), 'time_belt_' . $this->id_report, 'time_belt', $time_belt, isset($ref['time_belt']['time_range']) ? $ref['time_belt']['time_range'] : '', '', '', ' onchange="report_disableCustom( \'time_belt_' . $this->id_report . '\', \'start_time_' . $this->id_report . '\', \'end_time_' . $this->id_report . '\' )"') . Form::getOpenFieldset($lang->def('_CUSTOM_BELT'), 'fieldset_' . $this->id_report) . Form::getDatefield($lang->def('_START_TIME'), 'start_time_' . $this->id_report, 'start_time', Format::date($ref['time_belt']['start_date'], 'date')) . Form::getDatefield($lang->def('_TO'), 'end_time_' . $this->id_report, 'end_time', Format::date($ref['time_belt']['end_date'], 'date')) . Form::getCloseFieldset();
                cout($box->get() . Form::getBreakRow(), 'content');
                $box = new ReportBox('other_options');
                $box->title = Lang::t('_OTHER_OPTION', 'course');
                $box->description = false;
                $box->body = Form::getCheckbox($lang->def('ORG_CHART_SUBDIVISION'), 'org_chart_subdivision_' . $this->id_report, 'org_chart_subdivision', 1, $ref['org_chart_subdivision'] == 1 ? true : false) . Form::getCheckbox(Lang::t('_SHOW_SUSPENDED', 'organization_chart'), 'show_suspended', 'show_suspended', 1, (bool) $ref['show_suspended']) . Form::getCheckbox(Lang::t('_SHOW_ONLY', 'subscribe') . ': ' . Lang::t('_STUDENTS', 'coursereport'), 'only_students', 'only_students', 1, (bool) $ref['only_students']) . Form::getCheckbox(Lang::t('_SHOW', 'standard') . ': ' . Lang::t('_ASSESSMENT', 'standard'), 'show_assessment', 'show_assessment', 1, (bool) $ref['show_assessment']);
                cout($box->get() . Form::getBreakRow(), 'content');
                $glang =& DoceboLanguage::createInstance('course', 'lms');
                $show_classrooms_editions = $ref['show_classrooms_editions'];
                cout('<script type="text/javascript">
						function activateClassrooms() {
							var Y = YAHOO.util.Dom;
							var b1 = Y.get("not_classrooms"), b2 = Y.get("use_classrooms");
							var action = b1.style.display == "none" ? "hide" : "show";
							switch (action) {
								case "hide": {
									b1.style.display = "block";
									b2.style.display = "none";
								} break;
								case "show": {
									b1.style.display = "none";
									b2.style.display = "block";
								} break;
							}
						}
					</script>', 'page_head');
                $box = new ReportBox('columns_sel_box');
                $box->title = $lang->def('_SELECT_THE_DATA_COL_NEEDED');
                $box->description = false;
                $box->body = Form::getHidden('is_updating', 'is_updating', 2) . Form::getOpenFieldset($lang->def('_COURSE_FIELDS'), 'fieldset_course_fields') . Form::getCheckBox($lang->def('_COURSE_CODE'), 'col_sel_coursecode', 'cols[]', '_CODE_COURSE', is_showed('_CODE_COURSE', $ref)) . Form::getCheckBox($glang->def('_COURSE_NAME'), 'col_sel_coursename', 'cols[]', '_NAME_COURSE', is_showed('_NAME_COURSE', $ref)) . Form::getCheckBox($glang->def('_CATEGORY'), 'col_sel_category', 'cols[]', '_COURSE_CATEGORY', is_showed('_COURSE_CATEGORY', $ref)) . Form::getCheckBox($glang->def('_STATUS'), 'col_sel_status', 'cols[]', '_COURSESTATUS', is_showed('_COURSESTATUS', $ref)) . Form::getCheckBox($glang->def('_CATALOGUE'), 'col_sel_catalogue', 'cols[]', '_COURSECATALOGUE', is_showed('_COURSECATALOGUE', $ref)) . Form::getCheckBox($glang->def('_CREATION_DATE'), 'col_sel_publication', 'cols[]', '_PUBLICATION_DATE', is_showed('_PUBLICATION_DATE', $ref)) . Form::getCloseFieldset() . Form::getOpenFieldset(Form::getInputCheckbox('show_classrooms_editions', 'show_classrooms_editions', 1, $show_classrooms_editions, "onclick=activateClassrooms();") . "&nbsp;&nbsp;" . Lang::t('_CLASSROOM_FIELDS', 'report'), 'fieldset_classroom_fields') . '<div id="not_classrooms" style="display:' . ($show_classrooms_editions ? "none" : "block") . '">' . Lang::t('_ACTIVATE_CLASSROOM_FIELDS', 'report') . '</div>' . '<div id="use_classrooms" style="display:' . ($show_classrooms_editions ? "block" : "none") . '">' . Form::getCheckBox(Lang::t('_NAME', 'standard'), 'col_sel_classroomname', 'cols[]', '_TH_CLASSROOM_CODE', is_showed('_TH_CLASSROOM_CODE', $ref)) . Form::getCheckBox(Lang::t('_CODE', 'standard'), 'col_sel_classroomcode', 'cols[]', '_TH_CLASSROOM_NAME', is_showed('_TH_CLASSROOM_NAME', $ref)) . Form::getCheckBox(Lang::t('_DATE_BEGIN', 'standard'), 'col_sel_classroomdatebegin', 'cols[]', '_TH_CLASSROOM_MIN_DATE', is_showed('_TH_CLASSROOM_MIN_DATE', $ref)) . Form::getCheckBox(Lang::t('_DATE_END', 'standard'), 'col_sel_classroomdateend', 'cols[]', '_TH_CLASSROOM_MAX_DATE', is_showed('_TH_CLASSROOM_MAX_DATE', $ref)) . '</div>' . Form::getCloseFieldset() . Form::getOpenFieldset($lang->def('_COURSE_FIELDS_INFO'), 'fieldset_course_fields') . Form::getCheckBox($glang->def('_COURSE_LANG_METHOD'), 'col_course_lang_method', 'cols[]', '_LANGUAGE', is_showed('_LANGUAGE', $ref)) . Form::getCheckBox($glang->def('_DIFFICULTY'), 'col_course_difficult', 'cols[]', '_DIFFICULT', is_showed('_DIFFICULT', $ref)) . Form::getCheckBox($glang->def('_DATE_BEGIN'), 'col_date_begin', 'cols[]', '_DATE_BEGIN', is_showed('_DATE_BEGIN', $ref)) . Form::getCheckBox($glang->def('_DATE_END'), 'col_date_end', 'cols[]', '_DATE_END', is_showed('_DATE_END', $ref)) . Form::getCheckBox($glang->def('_HOUR_BEGIN'), 'col_time_begin', 'cols[]', '_TIME_BEGIN', is_showed('_TIME_BEGIN', $ref)) . Form::getCheckBox($glang->def('_HOUR_END'), 'col_time_end', 'cols[]', '_TIME_END', is_showed('_TIME_END', $ref)) . Form::getCheckBox($glang->def('_MAX_NUM_SUBSCRIBE'), 'col_max_num_subscribe', 'cols[]', '_MAX_NUM_SUBSCRIBED', is_showed('_MAX_NUM_SUBSCRIBED', $ref)) . Form::getCheckBox($glang->def('_MIN_NUM_SUBSCRIBE'), 'col_min_num_subscribe', 'cols[]', '_MIN_NUM_SUBSCRIBED', is_showed('_MIN_NUM_SUBSCRIBED', $ref)) . Form::getCheckBox(Lang::t('_CREDITS', 'standard'), 'col_credits', 'cols[]', '_CREDITS', is_showed('_CREDITS', $ref)) . Form::getCheckBox($glang->def('_COURSE_PRIZE'), 'col_course_price', 'cols[]', '_PRICE', is_showed('_PRICE', $ref)) . Form::getCheckBox($glang->def('_COURSE_ADVANCE'), 'col_course_advance', 'cols[]', '_ADVANCE', is_showed('_ADVANCE', $ref)) . Form::getCheckBox($glang->def('_COURSE_TYPE'), 'col_course_type', 'cols[]', '_COURSE_TYPE', is_showed('_COURSE_TYPE', $ref)) . Form::getCheckBox($glang->def('_COURSE_AUTOREGISTRATION_CODE'), 'col_autoregistration_code', 'cols[]', '_AUTOREGISTRATION_CODE', is_showed('_AUTOREGISTRATION_CODE', $ref)) . Form::getCloseFieldset() . Form::getOpenFieldset($lang->def('_STATS_FIELDS_INFO'), 'fieldset_course_fields') . Form::getCheckBox($lang->def('_USER_STATUS_SUBS'), 'col_inscr', 'cols[]', '_INSCR', is_showed('_INSCR', $ref)) . Form::getCheckBox($lang->def('_MUSTBEGIN'), 'col_mustbegin', 'cols[]', '_MUSTBEGIN', is_showed('_MUSTBEGIN', $ref)) . Form::getCheckBox($lang->def('_USER_STATUS_BEGIN'), 'col_user_status_begin', 'cols[]', '_USER_STATUS_BEGIN', is_showed('_USER_STATUS_BEGIN', $ref)) . Form::getCheckBox($lang->def('_COMPLETED'), 'col_completecourse', 'cols[]', '_COMPLETECOURSE', is_showed('_COMPLETECOURSE', $ref)) . Form::getCheckBox($lang->def('_TOTAL_SESSION'), 'col_total_session', 'cols[]', '_TOTAL_SESSION', is_showed('_TOTAL_SESSION', $ref)) . Form::getBreakRow() . Form::getCheckBox($lang->def('_PERCENTAGE'), 'show_percent', 'show_percent', '1', $ref['show_percent']) . Form::getCloseFieldset();
                cout($box->get(), 'content');
                cout(Form::openButtonSpace() . Form::getBreakRow() . Form::getButton('pre_filter', 'pre_filter', $lang->def('_SHOW_NOSAVE', 'report')) . Form::getButton('ok_filter', 'import_filter', $lang->def('_SAVE_BACK')) . Form::getButton('show_filter', 'show_filter', $lang->def('_SAVE_SHOW')) . Form::getButton('undo_filter', 'undo_filter', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm(), 'content');
                cout('</div>', 'content');
                //stdblock div
                break;
            case _SUBSTEP_USERS:
                //$aclManager = new DoceboACLManager();
                $user_select = new UserSelector();
                $user_select->use_suspended = true;
                if (Get::req('is_updating', DOTY_INT, 0) > 0) {
                    $ref['all_users'] = Get::req('all_users', DOTY_INT, 0) > 0 ? true : false;
                } else {
                    //maybe redoundant
                    if (!isset($ref['all_users'])) {
                        $ref['all_users'] = false;
                    }
                    if (!isset($ref['users'])) {
                        $ref['users'] = array();
                    }
                    $user_select->requested_tab = PEOPLEVIEW_TAB;
                    $user_select->resetSelection($ref['users']);
                    //$ref['users'] = array(); it should already have been set to void array, if non existent
                }
                if (isset($_POST['cancelselector'])) {
                    Util::jump_to($back_url);
                } elseif (isset($_POST['okselector'])) {
                    $elem_selected = $user_select->getSelection($_POST);
                    $ref['all_users'] = Get::req('all_users', DOTY_INT, 0) > 0 ? true : false;
                    $ref['users'] = $elem_selected;
                    Util::jump_to($jump_url . '&substep=columns_selection');
                }
                //set page
                if ($org_chart_subdivision == 0) {
                    $user_select->show_user_selector = TRUE;
                    $user_select->show_group_selector = TRUE;
                } else {
                    $user_select->show_user_selector = FALSE;
                    $user_select->show_group_selector = FALSE;
                }
                $user_select->show_orgchart_selector = TRUE;
                //$user_select->show_orgchart_simple_selector = FALSE;
                //$user_select->multi_choice = TRUE;
                $user_select->addFormInfo(Form::getCheckbox($lang->def('_REPORT_FOR_ALL'), 'all_users', 'all_users', 1, $ref['all_users'] ? 1 : 0) . Form::getBreakRow() . Form::getHidden('org_chart_subdivision', 'org_chart_subdivision', $org_chart_subdivision) . Form::getHidden('is_updating', 'is_updating', 1) . Form::getHidden('substep', 'substep', 'user_selection') . Form::getHidden('second_step', 'second_step', 1));
                cout($this->page_title, 'content');
                $user_select->loadSelector(Util::str_replace_once('&', '&amp;', $jump_url), false, $this->lang->def('_CHOOSE_USER_FOR_REPORT'), true);
                break;
        }
    }