Example #1
0
$mask .= Lang::t('_USERS', 'standard') . ': <b>' . (int) $users_count . '</b>';
$mask .= $_open_table;
$mask .= $_open_row . $_open_cell;
$mask .= Form::getInputCheckbox('multimod_sel_firstname', 'multimod_sel[firstname]', 1, false, "");
$mask .= $_close_cell . $_open_cell;
$mask .= Form::getTextField(Lang::t('_FIRSTNAME', 'standard'), 'firstname', 'firstname', 50, $info['firstname']) . '</div>';
$mask .= $_close_cell . $_close_row;
$mask .= $_open_row . $_open_cell;
$mask .= Form::getInputCheckbox('multimod_sel_lastname', 'multimod_sel[lastname]', 1, false, "");
$mask .= $_close_cell . $_open_cell;
$mask .= Form::getTextField(Lang::t('_LASTNAME', 'standard'), 'lastname', 'lastname', 50, $info['lastname']) . '</div>';
$mask .= $_close_cell . $_close_row;
$mask .= $_open_row . $_open_cell;
$mask .= Form::getInputCheckbox('multimod_sel_email', 'multimod_sel[email]', 1, false, "");
$mask .= $_close_cell . $_open_cell;
$mask .= Form::getTextField(Lang::t('_EMAIL', 'standard'), 'email', 'email', 50, $info['email']) . $_close_row;
$mask .= $_close_cell . $_close_row;
$mask .= $_open_row . $_open_cell;
$mask .= Form::getInputCheckbox('multimod_sel_password', 'multimod_sel[password]', 1, false, "");
$mask .= $_close_cell . $_open_cell;
$mask .= Form::getPassword(Lang::t('_NEW_PASSWORD', 'register'), 'new_password', 'new_password', 50, "");
$mask .= $_close_cell . $_close_row;
$mask .= $_open_row . $_open_cell;
$mask .= "&nbsp;";
//Form::getInputCheckbox('multimod_sel_pwd_confirm', 'multimod_sel[pwd_confirm]', 1, false, "");
$mask .= $_close_cell . $_open_cell;
$mask .= Form::getPassword(Lang::t('_RETYPE_PASSWORD', 'profile'), 'new_password_confirm', 'new_password_confirm', 50, "");
$mask .= $_close_cell . $_close_row;
//$mask .= $_open_row;
//$mask .= Form::getCheckBox(Lang::t('_FORCE_PASSWORD_CHANGE', 'admin_directory'), 'force_changepwd', 'force_changepwd', 1, $force_change);
//$mask .= $_close_cell.$_open_cell;
function create_report_name()
{
    checkPerm('mod');
    require_once $GLOBALS['where_lms'] . '/admin/modules/report/class.report.php';
    //reportbox class
    require_once $GLOBALS['where_lms'] . '/lib/lib.report.php';
    require_once _base_ . '/lib/lib.form.php';
    load_categories();
    $lang =& DoceboLanguage::createInstance('report');
    $step_index = 0;
    //$GLOBALS['page']->add( get_page_title($step_index) );
    $_SESSION['report_tempdata'] = array();
    $page_title = getTitleArea(array('index.php?modname=public_report_admin&amp;op=reportlist' => $lang->def('_REPORT'), $lang->def('_NEW')), 'report');
    $GLOBALS['page']->add($page_title . '<div class="std_block">', 'content');
    $error = Get::req('err', DOTY_STRING, false);
    switch ($error) {
        case 'noname':
            $GLOBALS['page']->add(getErrorUi($lang->def('_REPORT_NONAME')));
            break;
    }
    $temp = array();
    foreach ($GLOBALS['report_categories'] as $key => $value) {
        $temp[$key] = $lang->def($value);
    }
    $GLOBALS['page']->add(Form::openForm('repcat_form', 'index.php?modname=public_report_admin&amp;op=create_rows') . Form::getHidden('set_category', 'set_category', 1) . Form::getTextField($lang->def('_NAME'), 'report_name', 'report_name', '200') . Form::getDropDown($lang->def('_SELECT_REPORT_CATEGORY'), '', 'id_report', $temp) . Form::openButtonSpace() . Form::getButton('', 'cat_forward', $lang->def('_NEXT'), false) . Form::getButton('', 'cat_undo', $lang->def('_UNDO'), false) . Form::closeButtonSpace() . Form::closeForm(), 'content');
    /*$lang->def('_REPORT_SCHEDMAN');$lang->def('_REPORT_SCHEDMAN_DESC');*/
    $GLOBALS['page']->add('</div>', 'content');
}
Example #3
0
 function membersGroup($groupid, $simple = FALSE)
 {
     if (isset($_POST['reset_filter'])) {
         unset($_POST['user_id']);
     }
     require_once _base_ . '/lib/lib.form.php';
     if ($groupid === FALSE) {
         return;
     }
     if ($groupid != '') {
         $arrGroup = $this->aclManager->getGroup(FALSE, $groupid);
         if ($arrGroup !== FALSE) {
             $idst = $arrGroup[0];
             $description = $arrGroup[2];
         }
     }
     if ($simple === FALSE) {
         if (isset($_POST['membersgroupadd'])) {
             Util::jump_to('index.php?modname=directory&op=addtogroup&groupid=' . $groupid);
         }
         if (isset($_POST['membersgroupcancel'])) {
             Util::jump_to('index.php?modname=directory&op=listgroup');
         }
         $GLOBALS['page']->add(getTitleArea($this->lang->def('_GROUPS') . ': ' . $groupid, 'directory_group'), 'content');
         $GLOBALS['page']->add('<div class="std_block">', 'content');
         $GLOBALS['page']->add(Form::getFormHeader($this->lang->def('_DIRECTORY_MEMBERSGROUP')), 'content');
         $GLOBALS['page']->add(Form::openForm('directoryeditgroup', 'index.php?modname=directory&amp;op=membersgroup&amp;groupid=' . $groupid), 'content');
         $GLOBALS['page']->add(Form::openElementSpace(), 'content');
         $GLOBALS['page']->add(Form::getTextField($this->lang->def('_DIRECTORY_ITEMID'), 'user_id', 'user_id', '255', isset($_POST['user_id']) ? $_POST['user_id'] : ''), 'content');
         $GLOBALS['page']->add(Form::closeElementSpace(), 'content');
         $GLOBALS['page']->add(Form::openButtonSpace(), 'content');
         $GLOBALS['page']->add(Form::getButton("membersGroup", "membersGroup", $this->lang->def('_FILTER')), 'content');
         $GLOBALS['page']->add(Form::getButton("reset_filter", "reset_filter", $this->lang->def('_DEL')), 'content');
         $GLOBALS['page']->add(Form::closeButtonSpace(), 'content');
         $GLOBALS['page']->add(Form::openElementSpace(), 'content');
     }
     $data = new GroupMembersDataRetriever($idst, $GLOBALS['dbConn'], $GLOBALS['prefix_fw']);
     $rend = new Table(Get::sett('visuItem'));
     $lv = new GroupMembersListView($idst, '', $data, $rend, 'groupmembersdirectory');
     $lv->aclManager =& $this->aclManager;
     $lv->parsePositionData($_POST);
     $GLOBALS['page']->add($lv->printOut(), 'content');
     $this->selected = $lv->printedItems;
     if ($simple === FALSE) {
         $GLOBALS['page']->add(Form::closeElementSpace(), 'content');
         $GLOBALS['page']->add(Form::getCloseFieldset(), 'content');
         $GLOBALS['page']->add(Form::openButtonSpace(), 'content');
         $GLOBALS['page']->add(Form::getButton("membersgroupadd", "membersgroupadd", $this->lang->def('_ADD')), 'content');
         $GLOBALS['page']->add(Form::getButton("membersgroupcancel", "membersgroupcancel", $this->lang->def('_CLOSE')), 'content');
         $GLOBALS['page']->add(Form::closeButtonSpace(), 'content');
         $GLOBALS['page']->add(Form::closeForm(), 'content');
         $GLOBALS['page']->add('</div>', 'content');
     }
 }
Example #4
0
/**
 * Print statistic on one item
 *
 **/
function statitem()
{
    require_once _lms_ . '/class.module/track.object.php';
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    require_once _lms_ . '/lib/lib.subscribe.php';
    $cs = new CourseSubscribe_Manager();
    $lang =& DoceboLanguage::createInstance('stats', 'lms');
    $out =& $GLOBALS['page'];
    $form = new Form();
    $aclManager =& Docebo::user()->getACLManager();
    $acl =& Docebo::user()->getACL();
    $idItem = (int) $_GET['idItem'];
    $group_filter = Get::req('group_filter', DOTY_INT, -1);
    $status_filter = Get::req('status_filter', DOTY_INT, -1);
    $user_filter = Get::req('user_filter', DOTY_MIXED, '');
    $tabStat = new Table(Get::sett('visuItem'), $lang->def('_STATSITEM') . $titleLO, $lang->def('_STATSITEM') . $titleLO);
    $tabStat->initNavBar('ini', 'button');
    $limit = $tabStat->getSelectedElement();
    list($titleLO, $objectType) = sql_fetch_row(sql_query("SELECT title, objectType FROM " . $GLOBALS['prefix_lms'] . "_organization" . " WHERE idOrg='" . $idItem . "'"));
    $lev = false;
    $group_all_members = false;
    if ($group_filter != '-1') {
        $group_all_members = $aclManager->getGroupAllUser($group_filter);
    }
    $students = getSubscribedInfo((int) $_SESSION['idCourse'], false, $lev, true, $status_filter != -1 ? $status_filter : false, $editions_filter != -1 ? $editions_filter : false, true, $user_filter, $group_all_members, $limit);
    $query = "SELECT COUNT(*)" . " FROM %lms_courseuser AS cu" . ($user_filter !== '' ? " JOIN " . $GLOBALS['prefix_fw'] . "_user AS u ON u.idst = cu.idUser" : '') . " WHERE cu.idCourse = " . (int) $_SESSION['idCourse'] . ($status_filter != -1 ? " AND cu.status = '" . $status_filter . "'" : '') . ($user_filter !== '' ? " AND (u.firstname LIKE '%" . $user_filter . "%' OR u.lastname LIKE '%" . $user_filter . "%' OR u.userid LIKE '%" . $user_filter . "%')" : '') . ($group_all_members !== false ? " AND c.idUser IN (" . implode(',', $group_all_members) . ")" : '');
    list($total_user) = sql_fetch_row(sql_query($query));
    // get idst of the access in item
    $query = "SELECT value FROM " . $GLOBALS['prefix_lms'] . "_organization_access" . " WHERE idOrgAccess = '" . $idItem . "'";
    if (($rs = sql_query($query)) === FALSE) {
        UiFeedback::error("Error on query to load item access");
        return;
    }
    $arr_access = array();
    while (list($value) = sql_fetch_row($rs)) {
        $arr_access[] = $value;
    }
    $out->setWorkingZone('content');
    $out->add(getTitleArea($lang->def('_STATSITEM') . $titleLO, 'stats'));
    $out->add('<div class="std_block">' . getBackUi('index.php?modname=stats&amp;op=statcourse', $lang->def('_BACK')));
    $out->add($form->openForm('orgshow', 'index.php?modname=stats&amp;op=statitem&amp;idItem=' . $idItem));
    if (isset($_POST['view_open_quest'])) {
        $query_resource = "SELECT idResource" . " FROM " . $GLOBALS['prefix_lms'] . "_organization" . " WHERE idOrg = '" . $idItem . "'";
        list($id_poll) = sql_fetch_row(sql_query($query_resource));
        $query_quest = "SELECT id_quest, title_quest" . " FROM " . $GLOBALS['prefix_lms'] . "_pollquest" . " WHERE id_poll = '" . $id_poll . "'" . " AND type_quest = 'extended_text'";
        $result_quest = sql_query($query_quest);
        $type_h = array('');
        $cont_h = array($lang->def('_ANSWER'));
        while (list($id_quest, $title_quest) = sql_fetch_row($result_quest)) {
            $tb = new Table(400, $title_quest);
            $tb->setColsStyle($type_h);
            $tb->addHead($cont_h);
            $query_answer = "SELECT more_info" . " FROM " . $GLOBALS['prefix_lms'] . "_polltrack_answer" . " WHERE id_quest = '" . $id_quest . "'";
            $result_answer = sql_query($query_answer);
            while (list($answer) = sql_fetch_row($result_answer)) {
                $cont = array();
                $cont[] = $answer;
                $tb->addBody($cont);
            }
            $out->add($tb->getTable() . '<br/>');
        }
        $out->add($form->openButtonSpace() . $form->getButton('back', 'back', $lang->def('_BACK')) . $form->closeButtonSpace());
    } else {
        $arr_idst = $aclManager->getBasePathGroupST('/lms/course/' . (int) $_SESSION['idCourse'] . '/group');
        $arr_result_groups = $aclManager->getGroups($arr_idst);
        $std_content = $aclManager->getContext();
        $aclManager->setContext('/lms/course/' . (int) $_SESSION['idCourse'] . '/group');
        $arr_groups = array(-1 => $lang->def('_ALL'));
        foreach ($arr_result_groups as $idst_group => $info_group) {
            if (!$info_group[ACL_INFO_GROUPHIDDEN]) {
                $arr_groups[$idst_group] = $aclManager->relativeId($info_group[ACL_INFO_GROUPID]);
            }
        }
        $aclManager->setContext($std_content);
        $out->add(Form::getTextField(Lang::t('_FULLNAME', 'standard'), 'user_filter', 'user_filter', 255, $user_filter));
        $out->add($form->getDropdown($lang->def('_GROUPS'), 'group_filter', 'group_filter', $arr_groups, $group_filter));
        // ------ Filter on status
        $arr_status = array(-1 => $lang->def('_FILTERSTATUSSELECTONEOPTION'), _CUS_SUBSCRIBED => $lang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $lang->def('_USER_STATUS_BEGIN'), _CUS_END => $lang->def('_END'), _CUS_SUSPEND => $lang->def('_SUSPENDED'));
        $out->add($form->getDropdown($lang->def('_STATUS'), 'status_filter', 'status_filter', $arr_status, $status_filter));
        $out->add($form->getButton('gofilter', 'gofilter', $lang->def('_SEARCH')));
        //-----------------------------------------
        $content_h = array($lang->def('_USERNAME'), $lang->def('_STATS_FULLNAME'), $lang->def('_STATUS'), $lang->def('_PROGRESS'));
        $type_h = array('', '', 'image', 'image', '');
        $tabStat->setColsStyle($type_h);
        $tabStat->addHead($content_h);
        //-----------------------------------------
        foreach ($students as $idst => $user_course_info) {
            $user_info = $aclManager->getUser($idst, FALSE);
            if ($user_info != false) {
                $arr_allst = $acl->getUserAllST($user_info[ACL_INFO_USERID]);
                if (count($arr_access) === 0 || count(array_intersect($arr_access, $arr_allst)) > 0) {
                    $status = Track_Object::getStatusFromId($idItem, $idst);
                    // NOTE: How to get stat_status for users?
                    $stat_status = $cs->getUserStatusTr($user_course_info['status']);
                    $tabStat->addBody(array('<a href="index.php?modname=stats&amp;op=statoneuseroneitem&amp;idUser='******'&amp;idItem=' . $idItem . '" >' . $aclManager->relativeId($user_info[ACL_INFO_USERID]) . '</a>', $user_info[ACL_INFO_LASTNAME] . '&nbsp;' . $user_info[ACL_INFO_FIRSTNAME], $stat_status, printReport($status, TRUE)));
                }
            }
        }
        $out->add($tabStat->getTable());
        $out->add($tabStat->getNavBar($limit, $total_user));
        $query = "SELECT idResource" . " FROM " . $GLOBALS['prefix_lms'] . "_organization" . " WHERE idOrg = '" . $idItem . "'";
        list($id_poll) = sql_fetch_row(sql_query($query));
        $query = "SELECT id_quest" . " FROM " . $GLOBALS['prefix_lms'] . "_pollquest" . " WHERE id_poll = '" . $id_poll . "'" . " AND type_quest = 'extended_text'";
        $result = sql_query($query);
        if (sql_num_rows($result) && $objectType == 'poll') {
            $out->add($form->openButtonSpace() . '<br/>' . $form->getButton('view_open_quest', 'view_open_quest', $lang->def('_VIEW_OPEN_QUEST')) . $form->closeButtonSpace());
        }
    }
    $out->add($form->closeForm());
    $out->add('</div>' . "\n");
}
Example #5
0
function modCode()
{
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('code');
    $code_manager = new CodeManager();
    $id_code_group = Get::req('id_code_group', DOTY_INT, '0');
    $code = stripslashes(Get::req('code', DOTY_MIXED, ''));
    $is_unlimited = $code_manager->codeIsUnlimited($code);
    cout(getTitleArea(array('index.php?modname=code&amp;op=list' => $lang->def('_CODE'), 'index.php?modname=code&amp;op=code_list&amp;id_code_group=' . $id_code_group => $lang->def('_CODE_LIST'), $lang->def('_MOD'))) . '<div class="std_block">');
    if (Get::req('confirm', DOTY_MIXED, '')) {
        $code = addslashes(Get::req('code', DOTY_MIXED, ''));
        $old_code = addslashes(Get::req('old_code', DOTY_MIXED, ''));
        $unlimited_use = Get::req('unlimited_use', DOTY_BOOL, false);
        $result = $code_manager->modCode($code, $old_code, $unlimited_use);
        if ($result && $result !== 'dup') {
            Util::jump_to('index.php?modname=code&amp;op=code_list&id_code_group=' . $id_code_group . '&result=ok');
        } elseif ($result === 'dup') {
            Util::jump_to('index.php?modname=code&amp;op=code_list&id_code_group=' . $id_code_group . '&result=err_dup');
        }
        Util::jump_to('index.php?modname=code&amp;op=code_list&id_code_group=' . $id_code_group . '&result=err');
    }
    cout(Form::openForm('add_group_code_form', 'index.php?modname=code&amp;op=mod_code') . Form::openElementSpace() . Form::getTextField($lang->def('_CODE'), 'code', 'code', '255', $code) . Form::getCheckbox($lang->def('_UNLIMITED_USE'), 'unlimited_use', 'unlimited_use', true, $is_unlimited) . Form::getHidden('old_code', 'old_code', $code) . Form::getHidden('id_code_group', 'id_code_group', $id_code_group) . Form::closeElementSPace() . Form::openButtonSpace() . Form::getButton('confirm', 'confirm', $lang->def('_MOD')) . Form::getButton('undo_code', 'undo_code', $lang->def('_UNDO')) . Form::closeButtonSpace() . '</div>');
}
Example #6
0
echo Form::openForm($form_id, $form_url, false, false, 'multipart/form-data');
echo $is_editing ? Form::getHidden('idst', 'idst', $idst) : '';
echo '<div id="create_user_main_container">';
if (!$is_editing) {
    echo '<div id="create_user_tabview" class="yui-navset">';
    echo '<ul class="yui-nav">';
    echo '<li class="selected"><a href="#create_user_tab1"><em>' . Lang::t('_DETAILS', 'profile') . '</em></a></li>';
    echo '<li><a href="#create_user_tab2"><em>' . Lang::t('_ORG_CHART', 'organization_chart') . '</em></a></li>';
    echo '</ul>';
    echo '<div class="yui-content">';
    echo '<div id="create_user_tab1">';
}
echo Form::getTextField(Lang::t('_USERNAME', 'standard'), 'username', 'username', 255, $info->userid);
echo Form::getTextField(Lang::t('_FIRSTNAME', 'standard'), 'firstname', 'firstname', 255, $info->firstname);
echo Form::getTextField(Lang::t('_LASTNAME', 'standard'), 'lastname', 'lastname', 255, $info->lastname);
echo Form::getTextField(Lang::t('_EMAIL', 'standard'), 'email', 'email', 255, $info->email);
if ($is_editing) {
    echo Form::getPassword(Lang::t('_NEW_PASSWORD', 'register'), 'new_password', 'new_password', 255, "");
    echo Form::getPassword(Lang::t('_RETYPE_PASSWORD', 'register'), 'new_password_confirm', 'new_password_confirm', 255, "");
    echo Form::getCheckBox(Lang::t('_FORCE_PASSWORD_CHANGE', 'admin_directory'), 'force_changepwd', 'force_changepwd', 1, $info->force_change > 0);
} else {
    echo Form::getPassword(Lang::t('_PASSWORD', 'standard'), 'password', 'password', 255, "");
    echo Form::getPassword(Lang::t('_RETYPE_PASSWORD', 'register'), 'password_confirm', 'password_confirm', 255, "");
    echo Form::getCheckBox(Lang::t('_FORCE_PASSWORD_CHANGE', 'admin_directory'), 'force_changepwd', 'force_changepwd', 1, false);
}
if (Docebo::user()->user_level == ADMIN_GROUP_GODADMIN) {
    echo Form::getDropdown(Lang::t('_LEVEL', 'admin_directory'), 'level', 'level', $levels, $info->level);
}
echo $modify_mask;
echo $fields_mask;
/* $social =new Social();
Example #7
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');
}