예제 #1
0
 function getOp()
 {
     $res = "main";
     $op = importVar("sel_op");
     $manual = $this->onManualSelector();
     if ($manual) {
         $res = isset($_GET["stayon"]) ? "manual" : "manual_init";
     }
     if (isset($_POST["orgchartselector"])) {
         $res = 'orgchartselector';
     }
     if (isset($_POST['okselector_org'])) {
         return 'save_org';
     }
     if (isset($_POST["okselector"]) && !$manual) {
         $res = "save";
     } else {
         if (isset($_POST["okselector"]) && $manual) {
             $res = "save_manual";
         } else {
             if (isset($_POST["cancelselector"]) && !$manual) {
                 Util::jump_to($this->getLink("back", "", true));
             } else {
                 if (isset($_POST["cancelselector"]) && $manual) {
                     Util::jump_to($this->getLink("main", "", true));
                 }
             }
         }
     }
     return $res;
 }
예제 #2
0
 function loadBody()
 {
     switch ($GLOBALS['op']) {
         case 'showresults':
             $id_course = Get::req('id_course', DOTY_INT, false);
             $_SESSION['idCourse'] = $id_course;
             Util::jump_to('index.php?modname=organization&op=showresults&idcourse=' . $id_course);
             break;
         case "mycourses":
         case "unregistercourse":
             require_once $GLOBALS['where_lms'] . '/modules/' . $this->module_name . '/course.php';
             require_once _base_ . '/lib/lib.urlmanager.php';
             $url =& UrlManager::getInstance('course');
             $url->setStdQuery('r=' . _after_login_);
             mycourses($url);
             break;
         case "donwloadmaterials":
             downloadMaterials();
             break;
         default:
             require_once $GLOBALS['where_lms'] . '/modules/' . $this->module_name . '/infocourse.php';
             infocourseDispatch($GLOBALS['op']);
             break;
     }
 }
예제 #3
0
function edithtml()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $query = "\r\n\tSELECT textof\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "'";
    $re_htmlfront = sql_query($query);
    $error = false;
    if (isset($_POST['save'])) {
        if (mysql_num_rows($re_htmlfront) > 0) {
            $upd_query = "\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\t\t\tSET textof = '" . $_POST['description'] . "'\r\n\t\t\tWHERE id_course = '" . $_SESSION['idCourse'] . "'";
            $re = sql_query($upd_query);
        } else {
            $ins_query = "\r\n\t\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_htmlfront \r\n\t\t\t( id_course, textof) VALUES \r\n\t\t\t( \t'" . $_SESSION['idCourse'] . "',\r\n\t\t\t\t'" . $_POST['description'] . "' )";
            $re = sql_query($ins_query);
        }
        if ($re) {
            Util::jump_to('index.php?modname=htmlfront&op=showhtml&saveok=1');
        } else {
            $error = true;
        }
    }
    $lang =& DoceboLanguage::createInstance('htmlfront', 'lms');
    list($textof) = sql_fetch_row($re_htmlfront);
    $title_page = array('index.php?modname=htmlfront&op=showhtml' => $lang->def('_HTMLFRONT'), $lang->def('_MOD'));
    $GLOBALS['page']->add(getTitleArea($title_page, 'htmlfront') . '<div class="std_block">' . getBackUi('index.php?modname=htmlfront&amp;op=showhtml', $lang->def('_BACK')) . ($error ? getErrorUi($lang->def('_ERROR_IN_SAVE')) : '') . Form::openForm('formnotes', 'index.php?modname=htmlfront&amp;op=edithtml') . Form::openElementSpace() . Form::getTextarea($lang->def('_TEXTOF'), 'description', 'description', importVar('description', false, $textof)) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
}
 public function mod()
 {
     $id_trans = Get::req('id_trans', DOTY_INT, 0);
     if (isset($_POST['undo'])) {
         Util::jump_to('index.php?r=alms/transaction/show');
     }
     if (isset($_POST['save']) || isset($_POST['not_paid'])) {
         $product_to_activate = Get::req('product', DOTY_MIXED, array());
         $id_user = Get::req('id_user', DOTY_MIXED, 0);
         if ($this->model->saveTransaction($product_to_activate, $id_trans, $id_user)) {
             $this->model->controlActivation($id_trans, isset($_POST['not_paid']));
             Util::jump_to('index.php?r=alms/transaction/show&res=ok');
         }
         Util::jump_to('index.php?r=alms/transaction/show&res=err');
     }
     $transaction_info = $this->model->getTransactionInfo($id_trans);
     $user_info = $this->acl_man->getUser($transaction_info['id_user'], false);
     $user_info[ACL_INFO_USERID] = $this->acl_man->relativeId($user_info[ACL_INFO_USERID]);
     require_once _base_ . '/lib/lib.table.php';
     $tb = new Table(false, Lang::t('_DETAILS', 'transaction'), Lang::t('_DETAILS', 'transaction'));
     $ts = array('', '', 'min-cell', 'image');
     $th = array(Lang::t('_CODE', 'transaction'), Lang::t('_NAME', 'transaction'), Lang::t('_PRICE', 'transaction'), Lang::t('_MARK_AS_PAID', 'transaction'));
     $tb->setColsStyle($ts);
     $tb->addHead($th);
     foreach ($transaction_info['product'] as $product_info) {
         $tb->addBody(array($product_info['code'], $product_info['name'], $product_info['price'], Form::getInputCheckbox('product_' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'], 'product[' . $product_info['id_course'] . '_' . $product_info['id_date'] . '_' . $product_info['id_edition'] . ']', 1, $product_info['activated'], $product_info['activated'] ? ' disabled="disabled"' : '')));
     }
     $this->render('mod', array('transaction_info' => $transaction_info, 'user_info' => $user_info, 'tb' => $tb, 'id_trans' => $id_trans));
 }
예제 #5
0
 function edit($back_test)
 {
     $lang =& DoceboLanguage::createInstance('test');
     require_once _base_ . '/lib/lib.form.php';
     $url_encode = htmlentities(urlencode($back_test));
     if (isset($_POST['add_question'])) {
         if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_testquest \r\n\t\t\tSET idCategory = '" . (int) $_POST['idCategory'] . "', \r\n\t\t\t\ttitle_quest = '" . $_POST['title_quest'] . "', \r\n\t\t\t\tdifficult = '" . (int) $_POST['difficult'] . "', \r\n\t\t\t\ttime_assigned = '" . (int) $_POST['time_assigned'] . "' \r\n\t\t\tWHERE idQuest = '" . $this->id . "'")) {
             errorCommunication($lang->def('_ERR_INS_QUEST') . getBackUi('index.php?modname=question&amp;op=edit&amp;type_quest=' . $this->getQuestionType() . '&amp;idQuest=' . $this->id . '&amp;back_test=' . $url_encode, $lang->def('_BACK')));
         }
         if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_testquestanswer \r\n\t\t\tSET score_correct = '" . $this->_checkScore($_POST['max_score']) . "'\r\n\t\t\tWHERE idQuest = '" . $this->id . "'")) {
             errorCommunication($lang->def('_ERR_INS_QUEST') . getBackUi('index.php?modname=question&amp;op=edit&amp;type_quest=' . $this->getQuestionType() . '&amp;idQuest=' . $this->id . '&amp;back_test=' . $url_encode, $lang->def('_BACK')));
         }
         Util::jump_to('' . $back_test);
     }
     //finding categories
     require_once $GLOBALS['where_lms'] . '/lib/lib.questcategory.php';
     $categories = Questcategory::getCategory();
     //create array of difficult
     $arr_dufficult = array(5 => '5 - ' . $lang->def('_VERY_HARD'), 4 => '4 - ' . $lang->def('_HARD'), 3 => '3 - ' . $lang->def('_DIFFICULT_MEDIUM'), 2 => '2 - ' . $lang->def('_DIFFICULT_EASY'), 1 => '1 - ' . $lang->def('_DIFFICULT_VERYEASY'));
     list($title_quest, $cat_sel, $diff_sel, $sel_time) = sql_fetch_row(sql_query("\r\n\t\tSELECT title_quest, idCategory, difficult, time_assigned \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_testquest \r\n\t\tWHERE idQuest = '" . $this->id . "'"));
     list($max_score) = sql_fetch_row(sql_query("\r\n\t\tSELECT score_correct\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_testquestanswer \r\n\t\tWHERE idQuest = '" . $this->id . "'"));
     $GLOBALS['page']->add(getTitleArea($lang->def('_TEST_SECTION'), 'test') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $back_test), $lang->def('_BACK')) . '<div class="title_big">' . $lang->def('_QUEST_ACRN_' . strtoupper($this->getQuestionType())) . ' - ' . $lang->def('_QUEST_' . strtoupper($this->getQuestionType())) . '</div><br />' . Form::openForm('form_mod_quest', 'index.php?modname=question&amp;op=edit') . Form::openElementSpace() . Form::getHidden('type_quest', 'type_quest', $this->getQuestionType()) . Form::getHidden('idQuest', 'idQuest', $this->id) . Form::getHidden('back_test', 'back_test', $url_encode) . Form::getTextarea($lang->def('_QUESTION'), 'title_quest', 'title_quest', $title_quest), 'content');
     if (count($categories) > 1) {
         $GLOBALS['page']->add(Form::getDropdown($lang->def('_TEST_QUEST_CATEGORY'), 'idCategory', 'idCategory', $categories, isset($_POST['idCategory']) ? $_POST['idCategory'] : $cat_sel), 'content');
     }
     $GLOBALS['page']->add(Form::getDropdown($lang->def('_DIFFICULTY'), 'difficult', 'difficult', $arr_dufficult, $diff_sel) . Form::getTextfield($lang->def('_TEST_QUEST_TIMEASS'), 'time_assigned', 'time_assigned', 5, isset($_POST['time_assigned']) ? $_POST['time_assigned'] : $sel_time, $lang->def('_TEST_QUEST_TIMEASS'), $lang->def('_SECONDS')) . Form::getBreakRow() . Form::getTextfield($lang->def('_MAX_SCORE'), 'max_score', 'max_score', 255, isset($_POST['max_score']) ? $_POST['max_score'] : $max_score, $lang->def('_MAX_SCORE')) . Form::getBreakRow() . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('add_question', 'add_question', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
예제 #6
0
function organization_jump_select_sco(&$treeView, $idItem, $folder = false, $data = false, $type = false)
{
    $idResource = $data[REPOFIELDIDRESOURCE];
    $url = 'index.php?modname=storage&op=org_select_sco&idResource=' . $idResource;
    $url .= '&scormorg_title=' . urlencode($data[REPOFIELDTITLE]) . '&amp;idItem=' . $idItem;
    Util::jump_to($url);
    die;
}
예제 #7
0
function loginDispatch($op)
{
    switch ($op) {
        case "login":
            Util::jump_to(Get::rel_path('base') . '/index.php?modname=login&amp;op=login');
            //login();
            break;
    }
}
예제 #8
0
 public function saveTask()
 {
     $model = new SettingAdm();
     $active_tab = importVar('active_tab', false, 1);
     if ($model->saveElement($active_tab)) {
         Util::jump_to('index.php?r=adm/setting/show&active_tab=' . $active_tab . '&result=ok');
     } else {
         Util::jump_to('index.php?r=adm/setting/show&active_tab=' . $active_tab . '&result=err');
     }
 }
 public function show()
 {
     $model = new ClassroomLms();
     if (Get::sett('on_usercourse_empty') === 'on') {
         $conditions_t = array('cu.iduser = :id_user');
         $params_t = array(':id_user' => (int) Docebo::user()->getId());
         $cp_courses = $model->getUserCoursePathCourses(Docebo::user()->getIdst());
         if (!empty($cp_courses)) {
             $conditions_t[] = "cu.idCourse NOT IN (" . implode(",", $cp_courses) . ")";
         }
         $courselist_t = $model->findAll($conditions_t, $params_t);
         if (empty($courselist_t)) {
             Util::jump_to('index.php?r=lms/catalog/show&sop=unregistercourse');
         }
     }
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $block_list = array();
     if ($ma->currentCanAccessObj('user_details_short')) {
         $block_list['user_details_short'] = true;
     }
     if ($ma->currentCanAccessObj('user_details_full')) {
         $block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $block_list['news'] = true;
     }
     $tb_label = $ma->currentCanAccessObj('tb_label');
     if (!$tb_label) {
         $_SESSION['id_common_label'] = 0;
     } else {
         $id_common_label = Get::req('id_common_label', DOTY_INT, -1);
         if ($id_common_label >= 0) {
             $_SESSION['id_common_label'] = $id_common_label;
         } elseif ($id_common_label == -2) {
             $_SESSION['id_common_label'] = -1;
         }
         $block_list['labels'] = true;
     }
     if ($tb_label && $_SESSION['id_common_label'] == -1) {
         require_once _lms_ . '/admin/models/LabelAlms.php';
         $label_model = new LabelAlms();
         $user_label = $label_model->getLabelForUser(Docebo::user()->getId());
         $this->render('_labels', array('block_list' => $block_list, 'label' => $user_label));
     } else {
         if (!empty($block_list)) {
             $this->render('_tabs_block', array('block_list' => $block_list));
         } else {
             $this->render('_tabs', array());
         }
     }
 }
예제 #10
0
 function edit($back_poll)
 {
     $lang =& DoceboLanguage::createInstance('poll');
     require_once _base_ . '/lib/lib.form.php';
     $url_encode = htmlentities(urlencode($back_poll));
     if (isset($_POST['add_question'])) {
         if (!sql_query("\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\t\tSET title_quest = '" . $_POST['title_quest'] . "' \r\n\t\t\tWHERE id_quest = '" . $this->id . "'")) {
             errorCommunication($lang->def('_ERR_INS_QUEST') . getBackUi('index.php?modname=question_poll&amp;op=edit&amp;type_quest=' . $this->getQuestionType() . '&amp;id_quest=' . $this->id . '&amp;back_poll=' . $url_encode, $lang->def('_BACK')));
         }
         Util::jump_to('' . $back_poll);
     }
     list($title_quest) = sql_fetch_row(sql_query("\r\n\t\tSELECT title_quest \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\tWHERE id_quest = '" . $this->id . "'"));
     $GLOBALS['page']->add(getTitleArea($lang->def('_POLL_SECTION'), 'poll') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $back_poll), $lang->def('_BACK')) . '<div class="title_big">' . $lang->def('_QUEST_ACRN_' . strtoupper($this->getQuestionType())) . ' - ' . $lang->def('_QUEST_' . strtoupper($this->getQuestionType())) . '</div><br />' . Form::openForm('form_mod_quest', 'index.php?modname=question_poll&amp;op=edit') . Form::openElementSpace() . Form::getHidden('type_quest', 'type_quest', $this->getQuestionType()) . Form::getHidden('id_quest', 'id_quest', $this->id) . Form::getHidden('back_poll', 'back_poll', $url_encode) . Form::getTextarea($lang->def('_POLL_QUEST_TITLE'), 'title_quest', 'title_quest', $title_quest) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('add_question', 'add_question', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
예제 #11
0
function env_play($lobj, $options)
{
    list($file) = sql_fetch_row(sql_query("SELECT path" . " FROM %lms_materials_lesson" . " WHERE idLesson = " . (int) $lobj->id . ""));
    if (!$file) {
        Util::jump_to($lobj->back_url);
    }
    $id_param = $lobj->getIdParam();
    if ($lobj->id_reference != false) {
        require_once _lms_ . '/class.module/track.item.php';
        $ti = new Track_Item($lobj, Docebo::user()->getIdSt());
        // need id_resource, id_reference, type and environment
        $ti->setDate(date('Y-m-d H:i:s'));
        $ti->status = 'completed';
        $ti->update();
    }
    Util::download('/appLms/' . Get::sett('pathlesson'), $file);
}
 /**
  * Set the new fields and policy acceptance, than jump to the proper page
  */
 public function set()
 {
     $id_user = Docebo::user()->getIdst();
     require_once _adm_ . '/lib/lib.field.php';
     $fl = new FieldList();
     $fl->storeFieldsForUser($id_user);
     $accept_policy = Get::req('accept_policy', DOTY_INT, 0) > 0;
     $this->model->setAcceptingPolicy($id_user, $accept_policy);
     $policy_checked = $this->model->getAcceptingPolicy($id_user);
     $fields_checked = $fl->checkUserMandatoryFields($id_user);
     if ($fields_checked && $policy_checked) {
         //send alert
         Util::jump_to($this->jump_url);
     } else {
         //send alert
         Util::jump_to('index.php?r=precompile/show&res=err');
     }
 }
예제 #13
0
 public function edit()
 {
     //Course info
     $id_course = Get::req('id_course', DOTY_INT, 0);
     $id_edition = Get::req('id_edition', DOTY_INT, 0);
     $model = new EditionLms($id_course, $id_edition);
     $edition_info = $model->getEditionInfo($id_edition);
     if (isset($_POST['undo'])) {
         Util::jump_to('index.php?r=edition/show&id_course=' . $model->getIdCourse());
     } elseif (isset($_POST['mod'])) {
         if ($model->modEdition()) {
             Util::jump_to('index.php?r=edition/show&id_course=' . $model->getIdCourse() . '&result=ok');
         }
         Util::jump_to('index.php?r=edition/show&id_course=' . $model->getIdCourse() . '&result=err_mod');
     } else {
         $this->render('edit', array('model' => $model, 'edition_info' => $edition_info));
     }
 }
예제 #14
0
function renewalpwd()
{
    require_once _base_ . '/lib/lib.usermanager.php';
    $user_manager = new UserManager();
    $lang =& DoceboLanguage::createInstance('profile', 'framework');
    if ($user_manager->clickSaveElapsed()) {
        $error = $user_manager->saveElapsedPassword();
        if ($error['error'] != true) {
            unset($_SESSION['must_renew_pwd']);
            Util::jump_to('index.php?r=elearning/show&sop=unregistercourse');
        }
    }
    $_SESSION['must_renew_pwd'] = 1;
    $res = Docebo::user()->isPasswordElapsed();
    if ($res == 2) {
        $GLOBALS['page']->add(getTitleArea($lang->def('_CHANGEPASSWORD')), 'content');
    } else {
        $GLOBALS['page']->add(getTitleArea($lang->def('_TITLE_CHANGE')), 'content');
    }
    $GLOBALS['page']->add('<div class="std_block">' . $user_manager->getElapsedPassword('index.php?modname=profile&amp;op=renewalpwd') . '</div>', 'content');
}
예제 #15
0
function transactionDispatch($op)
{
    checkPerm('view');
    require_once _lms_ . '/lib/lib.transaction.php';
    if (isset($_POST['back_mod'])) {
        Util::jump_to('index.php?modname=transaction&amp;op=transaction');
    }
    switch ($op) {
        case 'mod':
            modTransaction();
            break;
        case 'del':
            delTransaction();
            break;
        default:
        case 'transaction':
            transaction();
            break;
    }
}
예제 #16
0
            unset($_SESSION['direct_play']);
        }
        if (isset($_SESSION['cp_assessment_effect'])) {
            unset($_SESSION['cp_assessment_effect']);
        }
        $_SESSION['current_main_menu'] = '1';
        $_SESSION['sel_module_id'] = '1';
        $_SESSION['is_ghost'] = false;
        $GLOBALS['modname'] = 'middlearea';
        $GLOBALS['op'] = 'show';
        break;
    case "selectMain":
        $_SESSION['current_main_menu'] = (int) $_GET['idMain'];
        $first_page = firstPage($_SESSION['current_main_menu']);
        if ($first_page['modulename'] != '') {
            Util::jump_to('index.php?modname=' . $first_page['modulename'] . '&op=' . $first_page['op'] . '&sel_module=' . $first_page['idModule']);
        }
        break;
        //change language for register user
    //change language for register user
    case "registerconfirm":
        setLanguage($_POST['language']);
        break;
    case "registerme":
        list($language_reg) = sql_fetch_row(sql_query("\r\n\t\tSELECT language\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_user_temp \r\n\t\tWHERE random_code = '" . $_GET['random_code'] . "'"));
        if ($language_reg != '') {
            setLanguage($language_reg);
        }
        break;
}
// special operation
예제 #17
0
 function modcatalogueassoc()
 {
     checkPerm('mod');
     $lang =& DoceboLanguage::createInstance('catalogue', 'lms');
     $acl_man =& Docebo::user()->getAclManager();
     require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
     require_once _base_ . '/lib/lib.form.php';
     require_once _base_ . '/lib/lib.userselector.php';
     $id_catalogue = importVar('id_catalogue', true, 0);
     $out =& $GLOBALS['page'];
     $user_select = new UserSelector();
     $user_select->show_user_selector = FALSE;
     $user_select->show_group_selector = TRUE;
     $user_select->show_orgchart_selector = TRUE;
     $user_select->show_orgchart_simple_selector = TRUE;
     $user_select->multi_choice = TRUE;
     if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
         require_once _base_ . '/lib/lib.preference.php';
         $adminManager = new AdminPreference();
         $admin_tree = $adminManager->getAdminTree(Docebo::user()->getIdST());
         $admin_users = $acl_man->getAllUsersFromIdst($admin_tree);
         $user_select->setUserFilter('user', $admin_users);
         $user_select->setUserFilter('group', $admin_tree);
     }
     if (isset($_POST['okselector'])) {
         $old_members = array();
         $re_members = sql_query("\r\n\t\tSELECT idst_member\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue_member\r\n\t\tWHERE idCatalogue = '" . $id_catalogue . "'");
         while (list($id_members) = sql_fetch_row($re_members)) {
             $old_members[$id_members] = $id_members;
         }
         $new_members = $user_select->getSelection($_POST);
         $to_add = array_diff($new_members, $old_members);
         $to_del = array_diff($old_members, $new_members);
         $re = true;
         $re &= addToCatologue($to_add, $id_catalogue);
         $re &= removeFromCatologue($to_del, $id_catalogue);
         Util::jump_to('index.php?modname=catalogue&op=catlist&result=' . ($re ? 'ok' : 'err'));
     }
     if (isset($_GET['load'])) {
         $members = array();
         $re_members = sql_query("\r\n\t\tSELECT idst_member\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue_member\r\n\t\tWHERE idCatalogue = '" . $id_catalogue . "'");
         while (list($id_members) = sql_fetch_row($re_members)) {
             $members[$id_members] = $id_members;
         }
         $user_select->resetSelection($members);
     }
     $title_area = getTitleArea(array('index.php?modname=catalogue&amp;op=catlist' => $lang->def('_CATALOGUE'), getCatalogueName($id_catalogue)), 'catalogue');
     $user_select->setPageTitle($title_area);
     $user_select->loadSelector('index.php?modname=catalogue&amp;op=modcatalogueassoc&amp;id_catalogue=' . $id_catalogue, $lang->def('_CATALOGUE'), $lang->def('_ASSIGN_USERS'), true);
 }
예제 #18
0
function delfriend(&$url)
{
    checkPerm('view');
    require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php';
    $lang =& DoceboLanguage::createInstance('myfriends', 'lms');
    $my_fr = new MyFriends(getLogUserId());
    $id_friend = importVar('id_friend', true, 0);
    $GLOBALS['page']->add(getTitleArea(array($url->getUrl() => $lang->def('_MY_FRIENDS'), $lang->def('_REMOVE_FRIEND')), 'myfriends') . '<div class="std_block">', 'content');
    if (isset($_GET['confirm'])) {
        if ($my_fr->delFriend($id_friend)) {
            Util::jump_to($url->getUrl('result=ok_del'));
        }
        $GLOBALS['page']->add(getErrorUi($lang->def('_ERR_REMOVE_FRIEND')));
    }
    $ui = $my_fr->getFriendsInfo(array($id_friend));
    if ($ui == false) {
        $GLOBALS['page']->add(getErrorUi($lang->def('_INVALID_FRIEND')));
    } else {
        $acl_man =& Docebo::user()->getAclManager();
        $ui = current($ui);
        $GLOBALS['page']->add(getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_USERNAME') . ' : </span>' . $acl_man->relativeId($ui[ACL_INFO_USERID]) . '<br />' . '<span>' . $lang->def('_USERCOMPLETENAME') . ' : </span>' . $ui[ACL_INFO_LASTNAME] . ($ui[ACL_INFO_LASTNAME] != '' ? ' ' : '') . $ui[ACL_INFO_FIRSTNAME], true, $url->getUrl('op=delfriend&id_friend=' . $id_friend . '&confirm=1'), $url->getUrl()), 'content');
    }
    $GLOBALS['page']->add('</div>', 'content');
}
예제 #19
0
function delete_public_report()
{
    require_once $GLOBALS['where_lms'] . '/lib/lib.report.php';
    $id_filter = Get::req('idrep', DOTY_INT, -1);
    if ($id_filter <= 0) {
        $result = false;
    } else {
        $result = report_delete_filter($id_filter);
    }
    Util::jump_to('index.php?modname=public_report_admin&op=reportlist');
}
예제 #20
0
function ioTask_UITaskDelete(&$module, $action)
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    $connMgr =& $module->get_connMgr();
    $lang =& $module->get_lang();
    $out =& $module->get_out();
    $form = new Form();
    if (is_array($action)) {
        if (key($action) == '--confirm--') {
            if ($connMgr->delete_task_byname($_POST['task_name'])) {
                Util::jump_to('index.php?modname=iotask&op=display&deletetaskok&gotab=tasks');
            } else {
                Util::jump_to('index.php?modname=iotask&op=display&deletetaskerror&gotab=tasks');
            }
        }
    }
    $params = $connMgr->get_task_byname(key($action));
    $task_name = $params[CONNMGR_TASK_NAME];
    $out->setWorkingZone('content');
    $out->add(getTitleArea($lang->def('_TASKS'), 'iotask'));
    $out->add('<div class="std_block">');
    $out->add($form->getFormHeader($lang->def('_TASK_DEL')));
    $out->add($form->openForm('task_delete', 'index.php?modname=iotask&op=display&gotab=tasks'));
    $out->add($form->getHidden('task_name', 'task_name', $task_name));
    $out->add(getDeleteUi($lang->def('_CONFIRM_DELETION'), str_replace('%name%', $task_name, $lang->def('_AREYOUSURE')), FALSE, 'action[delete_task][--confirm--]', 'cancel'));
    $out->add($form->closeForm());
    $out->add('</div>');
}
예제 #21
0
 public function playTask()
 {
     $id_game = Get::req('id_game', DOTY_INT, 0);
     $model = new GamesAlms();
     $game = $model->findByPk($id_game, Docebo::user()->getArrSt());
     if ($game != false) {
         switch ($game['type_of']) {
             case "scorm":
                 $lo = createLO('scormorg', $game['id_resource'], 'games');
                 if ($game['id_resource'] != 0 && $lo) {
                     $lo->env_play($id_game, 'index.php?r=games/show');
                 }
                 break;
         }
     }
     //endif
     Util::jump_to('index.php?r=games/show');
 }
예제 #22
0
 public function InsertClassroomMod($name, $description, $id_location, $room, $street, $city, $state, $zip_code, $phone, $fax, $capacity, $disposition, $instrument, $available_instrument, $note, $responsable)
 {
     $query_insert = "\n\t\tINSERT INTO %lms_classroom\n\t\t(name, description , location_id , room , street, city, state , zip_code,\n\t\tphone,fax, capacity, disposition, instrument, available_instrument,note,responsable) VALUES\n\t\t( \t'" . $name . "' ,\n\t\t\t'" . $description . "',\n\t\t\t" . $id_location . ",\n\t\t\t'" . $room . "',\n\t\t\t'" . $street . "',\n\t\t\t'" . $city . "',\n\t\t\t'" . $state . "',\n\t\t\t'" . $zip_code . "',\n\t\t\t'" . $phone . "',\n\t\t\t'" . $fax . "',\n\t\t\t'" . $capacity . "',\n\t\t\t'" . $disposition . "',\n\t\t\t'" . $instrument . "',\n\t\t\t'" . $available_instrument . "',\n\t\t\t'" . $note . "',\n\t\t\t'" . $responsable . "'\n\t\t\t)";
     if (!sql_query($query_insert)) {
         return false;
     }
     Util::jump_to('index.php?r=alms/location/show_classroom&amp;id_location=' . $id_location . '');
 }
예제 #23
0
function adminManager_saveCmsContent($admin_idst)
{
    require_once $GLOBALS["where_cms"] . "/lib/lib.tree_perm.php";
    $ctp = new CmsTreePermissions("content");
    $ctp->saveNodePerm($admin_idst, $_POST["sel_type"]);
    Util::jump_to("index.php?modname=admin_manager&op=view");
}
예제 #24
0
function publicAdminManager_edit_course()
{
    checkPerm('view');
    require_once $GLOBALS['where_lms'] . '/lib/lib.course_managment.php';
    $lang =& DoceboLanguage::createInstance('public_admin_manager', 'framework');
    $adminidst = importVar('adminidst', true, 0);
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $sel = new Course_Manager();
    $sel->setLink('index.php?modname=public_admin_manager&amp;op=edit_course');
    if (isset($_GET['load']) || isset($_POST['save_selection'])) {
        $course_initial_sel = array();
        $coursepath_initial_sel = array();
        $catalogue_initial_sel = array();
        $query = "\r\n\t\tSELECT id_entry, type_of_entry\r\n\t\tFROM " . $GLOBALS['prefix_fw'] . "_admin_course\r\n\t\tWHERE idst_user = '******'";
        $re_entry = sql_query($query);
        while (list($id, $type) = sql_fetch_row($re_entry)) {
            switch ($type) {
                case "course":
                    $course_initial_sel[$id] = $id;
                    break;
                case "coursepath":
                    $coursepath_initial_sel[$id] = $id;
                    break;
                case "catalogue":
                    $catalogue_initial_sel[$id] = $id;
                    break;
            }
        }
        if (isset($_GET['load'])) {
            $sel->resetCourseSelection($course_initial_sel);
            $sel->resetCoursePathSelection($coursepath_initial_sel);
            $sel->resetCatalogueSelection($catalogue_initial_sel);
        }
    }
    if (isset($_POST['save_selection'])) {
        $re = true;
        $course = $sel->getCourseSelection($_POST);
        $re &= publicUpdateEntry($course, $course_initial_sel, 'course', $adminidst);
        $coursepath = $sel->getCoursePathSelection($_POST);
        $re &= publicUpdateEntry($coursepath, $coursepath_initial_sel, 'coursepath', $adminidst);
        $catalogue = $sel->getCatalogueSelection($_POST);
        $re &= publicUpdateEntry($catalogue, $catalogue_initial_sel, 'catalogue', $adminidst);
        Util::jump_to('index.php?modname=public_admin_manager&amp;op=view&amp;result=' . ($re ? 'ok' : 'err'));
    }
    if (isset($_POST['undo_pref'])) {
        Util::jump_to('index.php?modname=public_admin_manager&amp;op=view');
    }
    $out->addStart(getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT')) . '<div class="std_block">' . Form::openForm('admin_menu_editing', 'index.php?modname=public_admin_manager&amp;op=edit_course') . Form::getHidden('adminidst', 'adminidst', $adminidst), 'content');
    $out->addEnd(Form::openButtonSpace() . Form::getButton('save_selection', 'save_selection', $lang->def('_SAVE')) . Form::getButton('undo_pref', 'undo_pref', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
    $sel->loadSelector();
}
예제 #25
0
 public function mod()
 {
     if (!$this->permissions['mod']) {
         $this->render('invalid', array('message' => $this->_getMessage('no permission'), 'back_url' => 'index.php?r=alms/label/show'));
         return;
     }
     $id_common_label = Get::req('id_common_label', DOTY_INT, 0);
     if (isset($_POST['undo'])) {
         Util::jump_to('index.php?r=alms/label/show');
     }
     $all_languages = Docebo::langManager()->getAllLangCode();
     $res = true;
     if (isset($_POST['update'])) {
         require_once _base_ . '/lib/lib.upload.php';
         $path = '/appLms/label/';
         if (isset($_POST['del_label_image'])) {
             $file_name = $this->model->getLabelFile($id_common_label);
             if ($file_name !== '' && sl_file_exists($path . $file_name)) {
                 sl_open_fileoperations();
                 sl_unlink($path . $file_name);
                 sl_close_fileoperations();
             }
             $file_name = '';
         } else {
             $file_name = $this->model->getLabelFile($id_common_label);
         }
         if ($_FILES['label_image']['error'] == 0) {
             $extension = end(explode('.', $_FILES['label_image']['name']));
             $file_name = 'label_image_' . $id_common_label . '.' . $extension;
             sl_open_fileoperations();
             $file_name_del = $this->model->getLabelFile($id_common_label);
             if ($file_name_del !== '' && sl_file_exists($path . $file_name_del)) {
                 sl_unlink($path . $file_name_del);
             }
             sl_upload($_FILES['label_image']['tmp_name'], $path . $file_name);
             sl_close_fileoperations();
         }
         foreach ($all_languages as $lang_code) {
             $title = Get::req($lang_code . '_title', DOTY_MIXED, '');
             $description = Get::req($lang_code . '_description', DOTY_MIXED, '');
             $tmp_res = $this->model->updateLabel($id_common_label, $lang_code, $title, $description, $file_name);
             if (!$tmp_res) {
                 $res = false;
             }
         }
         if ($res) {
             Util::jump_to('index.php?r=alms/label/show&res=_ok_mod');
         }
         Util::jump_to('index.php?r=alms/label/show&err=_err_mod');
     }
     $label_info = $this->model->getLabelInfo($id_common_label);
     $params = array('model' => $this->model, 'all_languages' => $all_languages, 'label_info' => $label_info, 'id_common_label' => $id_common_label);
     $this->render('mod', $params);
 }
예제 #26
0
 function delnotes()
 {
     checkPerm('view');
     $lang =& DoceboLanguage::createInstance('notes', 'lms');
     if (isset($_GET['confirm'])) {
         $query = "\r\n\t\tDELETE FROM " . $GLOBALS['prefix_lms'] . "_notes\r\n\t\tWHERE idNotes='" . $_GET['idNotes'] . "' AND owner='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "'";
         if (!sql_query($query)) {
             Util::jump_to('index.php?modname=notes&op=notes&amp;result=err');
         }
         Util::jump_to('index.php?modname=notes&op=notes&amp;result=ok');
     } else {
         list($title) = sql_fetch_row(sql_query("\r\n\t\tSELECT title\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\t\tWHERE owner = '" . getLogUserId() . "' AND idNotes = '" . (int) $_GET['idNotes'] . "'"));
         $title_page = array('index.php?modname=notes&amp;op=notes' => $lang->def('_NOTES'), $lang->def('_DEL'));
         $GLOBALS['page']->add(getTitleArea($title_page, 'notes') . '<div class="std_block">' . getDeleteUi($lang->def('_AREYOUSURE'), '<span>' . $lang->def('_TITLE') . ' : </span>' . $title, true, 'index.php?modname=notes&amp;op=delnotes&amp;idNotes=' . $_GET['idNotes'] . '&amp;confirm=1', 'index.php?modname=notes&amp;op=notes') . '</div>', 'content');
     }
 }
예제 #27
0
/**
 * This function can be called from LO insert/edit operation
 * to set position in pubrepo and other metadata.
 * @param $lo instance of the learning object to edit
 * @param $withForm print form tag
 * @param $withContents display the Items in folders
 **/
function manPubRepoSave(&$lo, $withForm = FALSE, $withContents = TRUE)
{
    $treeView = manPubrepo_CreateTreeView($withContents, FALSE);
    // print a form that submit to the same url
    if ($withForm) {
        echo '<form name="manPubrepo" method="post"' . ' action="index.php?' . $_SERVER['QUERY_STRING'] . '"' . ' >' . "\n" . '<input type="hidden" id="authentic_request_pr" name="authentic_request" value="' . Util::getSignature() . '" />';
    }
    // handle operations
    switch ($treeView->op) {
        case 'newfolder':
            manPubrepo_addfolder($treeView);
            break;
        case 'save':
            manPurepo_save($treeView->getSelectedFolderId(), $lo, $_POST);
            Util::jump_to('' . $lo->getBackUrl());
        case 'display':
        default:
            manPubrepo_display($treeView, $withContents);
            loadFields($_POST, $lo);
            break;
    }
    // add save button
    echo '<img src="' . getPathImage() . 'standard/save.gif" alt="' . _SAVE . '" /> ' . '<input type="submit" value="' . _SAVE . '"' . ' name="' . $treeView->_getOpSaveFile() . '" />';
    if ($withForm) {
        echo '</form>' . "\n";
    }
}
 public function playTask()
 {
     $id_comm = Get::req('id_comm', DOTY_INT, 0);
     $model = new CommunicationAlms();
     $comm = $model->findByPk($id_comm, Docebo::user()->getArrSt());
     if ($comm != false) {
         switch ($comm['type_of']) {
             case "none":
                 //
                 $model->markAsRead($id_comm, Docebo::user()->getId());
                 break;
             case "file":
                 $lo = createLO('item', $comm['id_resource'], 'communication');
                 if ($lo) {
                     $lo->env_play($id_comm, 'index.php?r=communication/show');
                 }
                 return;
                 break;
             case "scorm":
                 $lo = createLO('scormorg', $comm['id_resource'], 'communication');
                 if ($comm['id_resource'] != 0 && $lo) {
                     $lo->env_play($id_comm, 'index.php?r=communication/show');
                 }
                 break;
         }
     }
     //endif
     UpdatesLms::resetCache();
     Util::jump_to('index.php?r=communication/show');
 }
예제 #29
0
/**
 * This function can be called from LO insert/edit operation
 * to set position in homerepo and other metadata.
 * @param $lo instance of the learning object to edit
 * @param $withForm print form tag
 * @param $withContents display the Items in folders
 * @param $idLO id of learning object to change. If this parameter is not NULL
 *			$lo is ignored
 **/
function manHomeRepoSave(&$lo, $withForm = FALSE, $withContents = TRUE, $treeView = NULL, $idLO = NULL)
{
    if ($treeView === NULL) {
        $treeView = manHomerepo_CreateTreeView($withContents, FALSE);
    }
    // print a form that submit to the same url
    if ($withForm) {
        echo '<form name="manHomerepo" method="post"' . ' action="index.php?' . $_SERVER['QUERY_STRING'] . '"' . ' >' . "\n" . '<input type="hidden" id="authentic_request_hr" name="authentic_request" value="' . Util::getSignature() . '" />';
    }
    if ($treeView->cancel) {
        if (isset($_POST['idLO'])) {
            Util::jump_to('index.php?modname=homerepo&op=homerepo');
        } else {
            Util::jump_to('' . $lo->getBackUrl());
        }
    }
    // handle operations
    switch ($treeView->op) {
        case 'newfolder':
            manHomerepo_addfolder($treeView);
            break;
        case 'save':
            if (isset($_POST['idLO'])) {
                manHomerepo_update($treeView->getSelectedFolderId(), $_POST['idLO'], $_POST);
                Util::jump_to('index.php?modname=homerepo&op=homerepo');
            } else {
                manHomerepo_save($treeView->getSelectedFolderId(), $lo, $_POST);
                Util::jump_to('' . $lo->getBackUrl());
            }
            break;
        case 'display':
        default:
            echo '<div class="std_block">';
            manHomerepo_display($treeView, $withContents);
            loadFields($_POST, $lo, $idLO);
            // add save button
            echo '<img src="' . $treeView->_getSaveImage() . '" alt="' . _SAVE . '" /> ' . '<input type="submit" value="' . _SAVE . '" class="LVAction"' . ' name="' . $treeView->_getOpSaveFile() . '" />';
            echo ' <img src="' . $treeView->_getCancelImage() . '" alt="' . $treeView->_getCancelAlt() . '" />' . '<input type="submit" class="LVAction" value="' . $treeView->_getCancelLabel() . '"' . ' name="' . $treeView->_getCancelId() . '" id="' . $treeView->_getCancelId() . '" />';
            echo '</div>';
            break;
    }
    if ($withForm) {
        echo '</form>' . "\n";
    }
}
예제 #30
0
 function edit($back_poll)
 {
     Util::jump_to('' . $back_poll);
 }