Example #1
0
/**
 * @package  DoceboSCS
 * @version  $Id: functions.php 113 2006-03-08 18:08:42Z ema $
 */
function getWriteBox(&$out, &$lang)
{
    require_once _base_ . '/lib/lib.form.php';
    $res = "";
    if (isset($_POST["refreshrate"])) {
        $_SESSION["refreshrate"] = (int) $_POST["refreshrate"];
    }
    $form = new Form();
    $res .= $form->openForm('refresh_form', getPopupBaseUrl() . '&amp;op=refresh') . '<div class="refresh_form">';
    $res .= '<label for="refreshrate">' . $lang->def("_AUTOREFRESH") . '</label>' . $form->getInputTextfield('refreshtext', 'refreshrate', 'refreshrate', $_SESSION["refreshrate"], strip_tags($lang->def("_AUTOREFRESH")), 1000, '');
    $res .= $lang->def("_SECONDS") . "\n";
    $res .= $form->getButton('refresh', 'refresh', $lang->def("_REFRESH"), 'button_refresh');
    $res .= '</div>' . $form->closeForm();
    $res .= $form->openForm('msg_form', getPopupBaseUrl() . '&amp;op=send') . '<div class="msg_form">';
    $res .= '<label for="msgtxt">' . $lang->def("_MSGTXT") . '</label>' . $form->getInputTextfield('msgtext', 'msgtxt', 'msgtxt', '', strip_tags($lang->def("_MSGTXT")), 1000, '');
    $res .= $form->getButton('send', 'send', $lang->def("_SEND"), 'button_send');
    $res .= $form->getButton('savechat', 'savechat', $lang->def("_SAVE"), 'button_save');
    $res .= '</div>' . $form->closeForm();
    $res .= "<script type=\"text/javascript\">\n";
    $res .= "document.forms[1].msgtxt.focus();";
    $res .= "</script>\n";
    $res .= '<div class="emoticons_container"><b>';
    $res .= $lang->def("_EMOTICONS") . "</b>:&nbsp;\n";
    $res .= $GLOBALS["chat_emo"]->emoticonList();
    $res .= '</div>';
    if ($_SESSION["refreshrate"] > 0) {
        $ref_meta = "<meta http-equiv=refresh content=\"" . $_SESSION["refreshrate"] . "; url=";
        $ref_meta .= getPopupBaseUrl() . "&amp;op=refresh\" />\n";
        $out->add($ref_meta, "page_head");
    }
    return $res;
}
Example #2
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&amp;op=showhtml&amp;saveok=1');
        } else {
            $error = true;
        }
    }
    $lang =& DoceboLanguage::createInstance('htmlfront', 'lms');
    list($textof) = sql_fetch_row($re_htmlfront);
    $title_page = array('index.php?modname=htmlfront&amp;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');
}
Example #3
0
function showWriteForm(&$out, &$lang)
{
    require_once _base_ . '/lib/lib.form.php';
    $form = new Form();
    $res = "";
    $res .= $form->openForm('msg_form', getPopupBaseUrl() . '&amp;op=send') . '<div class="msg_form">';
    $res .= '<label for="msgtxt">' . $lang->def("_MSGTXT") . '</label>' . $form->getInputTextfield('msgtext', 'msgtxt', 'msgtxt', '', strip_tags($lang->def("_MSGTXT")), 1000, '');
    $res .= $form->getButton('send', 'send', $lang->def("_SEND"), 'button_send');
    $res .= $form->getButton('savechat', 'savechat', $lang->def("_SAVE"), 'button_save');
    $res .= '</div>' . $form->closeForm();
    $res .= "<script type=\"text/javascript\">\n";
    $res .= "document.forms[0].msgtxt.focus();";
    $res .= "</script>\n";
    $res .= $GLOBALS["chat_emo"]->emoticonList();
    $out->add($res);
}
 function adminConf()
 {
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('admin_config', 'scs');
     $out =& $GLOBALS['page'];
     $out->setWorkingZone('content');
     $out->add(getTitleArea($lang->def('_ADMIN_CONF'), 'admin_conf') . '<div class="std_block">');
     if (isset($_POST['save'])) {
         $query_update = "UPDATE " . $GLOBALS['prefix_scs'] . "_rules_admin SET ";
         if (isset($_POST['rules'])) {
             while (list($var_name, $new_value) = each($_POST['rules'])) {
                 $query_update .= " {$var_name} = '" . $new_value . "',";
             }
             $re = sql_query(substr($query_update, 0, -1));
         }
         if ($re) {
             $out->add(getResultUi($lang->def('_MOD_OK')));
         } else {
             $out->add(getErrorUi($lang->def('_MOD_ERR')));
         }
     }
     $query_rules_admin = "\r\n\tSELECT server_status, \r\n\t\tenable_recording_function, enable_advice_insert, enable_write, enable_chat_recording, \r\n\t\tenable_private_subroom, enable_public_subroom, \r\n\t\tenable_drawboard_watch, enable_drawboard_write, \r\n\t\tenable_audio, enable_webcam, enable_stream_watch, enable_strem_write, enable_remote_desktop \r\n\tFROM " . $GLOBALS['prefix_scs'] . "_rules_admin";
     $re_rules_admin = sql_query($query_rules_admin);
     $rules = mysql_fetch_array($re_rules_admin);
     $out->add(Form::openForm('rules_admin', 'index.php?modname=admin_configuration&amp;op=conf') . Form::openElementSpace() . Form::getOpenCombo($lang->def('_SERVER_STATUS')) . Form::getInputRadio('rules_server_status_yes', 'rules[server_status]', 'yes', $rules['server_status'] == 'yes', '') . '&nbsp;' . Form::getLabel('', $lang->def('_YES'), 'label_padded') . '&nbsp;' . Form::getInputRadio('rules_server_status_no', 'rules[server_status]', 'no', $rules['server_status'] == 'no', '') . '&nbsp;' . Form::getLabel('', $lang->def('_NO'), 'label_padded') . '&nbsp;' . Form::getCloseCombo() . maskMultiple('enable_recording_function', $rules['enable_recording_function']) . maskMultiple('enable_advice_insert', $rules['enable_advice_insert']) . maskMultiple('enable_write', $rules['enable_write']) . maskMultiple('enable_chat_recording', $rules['enable_chat_recording']) . maskMultiple('enable_private_subroom', $rules['enable_private_subroom']) . maskMultiple('enable_public_subroom', $rules['enable_public_subroom']) . maskMultiple('enable_drawboard_watch', $rules['enable_drawboard_watch']) . maskMultiple('enable_drawboard_write', $rules['enable_drawboard_write']) . maskMultiple('enable_audio', $rules['enable_audio']) . maskMultiple('enable_webcam', $rules['enable_webcam']) . maskMultiple('enable_stream_watch', $rules['enable_stream_watch']) . maskMultiple('enable_strem_write', $rules['enable_strem_write']) . maskMultiple('enable_remote_desktop', $rules['enable_remote_desktop']) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save', 'save', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm());
     $out->add('</div>');
 }
    public function getAddEditForm($form_url, $data)
    {
        $this->loadJs();
        $res = '';
        $e = false;
        if ($data['rule_id'] > 0) {
            $e = true;
        }
        $res .= Form::openForm('main_form', $form_url);
        $res .= Form::openElementSpace() . Form::getTextfield(Lang::t('_FROM', 'test'), 'from_score', 'from_score', 11, $e ? $data['from_score'] : '') . Form::getTextfield(Lang::t('_TO', 'test'), 'to_score', 'to_score', 11, $e ? $data['to_score'] : '') . '<br />' . '<p class="section_title">' . Lang::t('_COMPETENCES', 'test') . '</p>' . '<div id="competence_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_competence" class="floating">' . Lang::t('_NAME', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_competence" id="input_add_competence" class="textfield">
					<a href="" id="link_add_competence"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_competence"></div>
					</div>
				</div>' . '<br />' . '<p class="section_title">' . Lang::t('_COURSES', 'test') . '</p>' . '<div id="course_box"></div>' . '<div class="form_line_l">
					<p><label for="input_add_course" class="floating">' . Lang::t('_NEW_COURSE', 'test') . '</label></p>
					<div class="form_autocomplete_container">
					<input type="text" maxlength="255" value="" name="input_add_course" id="input_add_course" class="textfield">
					<a href="" id="link_add_course"><img alt="' . Lang::t('_ADD', 'test') . '" src="' . getPathImage() . 'standard/add.png" class="valing-middle"></a>
					<div id="box_autocomplete_course"></div>
					</div>
				</div>' . '<br /><br />' . Form::getTextarea(Lang::t('_FEEDBACK_TEXT', 'test'), 'feedback_txt', 'feedback_txt', $e ? $data['feedback_txt'] : '') . Form::getHidden('rule_id', 'rule_id', (int) $data['rule_id']) . Form::getHidden('competences_list', 'competences_list', '') . Form::getHidden('courses_list', 'courses_list', '') . Form::getHidden('test_id', 'test_id', (int) $data['test_id']) . Form::getHidden('category_id', 'category_id', (int) $data['category_id']) . Form::getHidden('save', 'save', '1') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('btn_save', 'btn_save', Lang::t('_SAVE', 'test')) . Form::getButton('btn_cancel', 'btn_cancel', Lang::t('_UNDO', 'test')) . Form::closeButtonSpace();
        $res .= Form::closeForm();
        $res .= '<script type="text/javascript">
			var course_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?mn=course&plf=lms&op=course_autocomplete&results=20' . '";
			var competence_ac_url="' . Get::rel_path('adm') . '/ajax.adm_server.php?r=adm/competences/competences_autocomplete' . '";
			var lang={"remove_item": "' . Lang::t('_DEL', 'test') . '"};
			var course_arr=' . ($e && !empty($data['courses_list']) ? $data['courses_list'] : '{}') . ';
			var competence_arr=' . ($e && !empty($data['competences_list']) ? $data['competences_list'] : '{}') . ';
			</script>';
        return $res;
    }
Example #6
0
 function moditem($object_item)
 {
     //checkPerm('view', false, 'storage');
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('item');
     $back_coded = htmlentities(urlencode($object_item->back_url));
     list($title, $description) = sql_fetch_row(sql_query("\r\n\tSELECT title, description \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_materials_lesson \r\n\tWHERE author = " . getLogUserId() . " AND idLesson = '" . $object_item->getId() . "'"));
     $GLOBALS['page']->add(getTitleArea($lang->def('_SECTIONNAME_ITEM'), 'item') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $object_item->back_url) . '&amp;mod_result=0', $lang->def('_BACK')) . Form::openForm('itemform', 'index.php?modname=item&amp;op=upitem', 'std_form', 'post', 'multipart/form-data') . Form::openElementSpace() . Form::getHidden('idItem', 'idItem', $object_item->getId()) . Form::getHidden('back_url', 'back_url', htmlentities(urlencode($object_item->back_url))) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 100, $title) . Form::getFilefield($lang->def('_FILE_MOD'), 'file', 'attach') . Form::getTextarea($lang->def('_DESCRIPTION'), 'description', 'description', $description) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('additem', 'additem', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
Example #7
0
function modpoll()
{
    checkPerm('view', false, 'storage');
    $lang =& DoceboLanguage::createInstance('poll');
    require_once _base_ . '/lib/lib.form.php';
    $id_poll = importVar('id_poll', true, 0);
    $back_url = urldecode(importVar('back_url'));
    $url_encode = htmlentities(urlencode($back_url));
    list($poll_title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT title, description\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_poll\r\n\tWHERE id_poll = '" . $id_poll . "'"));
    $GLOBALS['page']->add(getTitleArea($lang->def('_POLL_SECTION'), 'poll') . '<div class="std_block">' . getBackUi('index.php?modname=poll&amp;op=modpollgui&amp;id_poll=' . $id_poll . '&amp;back_url=' . $url_encode, $lang->def('_BACK')) . Form::OpenForm('addpoll_form', 'index.php?modname=poll&amp;op=uppoll') . Form::openElementSpace() . Form::getHidden('id_poll', 'id_poll', $id_poll) . Form::getHidden('back_url', 'back_url', $url_encode) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', '255', $poll_title) . Form::getTextarea($lang->def('_DESCRIPTION'), 'textof', 'textof', $textof) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('button_ins', 'button_ins', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
}
Example #8
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');
 }
Example #9
0
function config()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.tab.php';
    require_once _base_ . '/lib/lib.form.php';
    require_once _adm_ . '/class/class.conf.php';
    $lang =& DoceboLanguage::createInstance('configuration', 'framework');
    $active_tab = importVar('active_tab', false, 1);
    //instance class-------------------------------------------
    $conf = new Config_Framework();
    $groups = $conf->getRegroupUnit();
    cout(getTitleArea($lang->def('_CONFIGURATION')) . '<div class="std_block">');
    //save page if require
    if (isset($_POST['save_config'])) {
        if ($conf->saveElement($active_tab)) {
            cout(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
        } else {
            cout(getErrorUi($lang->def('_ERROR_IN_SAVE')));
        }
    }
    cout('<div id="global_conf" class="yui-navset">' . '<ul class="yui-nav">');
    while (list($id, $name) = each($groups)) {
        // print the tab list
        cout('<li' . ($id == $active_tab ? ' class="selected"' : '') . '><a href="#tab_g_' . $id . '"><em>' . $name['name'] . '</em></a></li>');
    }
    reset($groups);
    cout('</ul>' . '<div class="yui-content">');
    while (list($id, $name) = each($groups)) {
        // print the tab content
        cout('<div id="tab_g_' . $id . '">' . '<h2>' . $name['name'] . '</h2>' . '<p style="padding:4px">' . $name['descr'] . '</p>' . Form::openForm('conf_option_' . $id, 'index.php?modname=configuration&amp;op=config') . Form::openElementSpace() . Form::getHidden('active_tab_' . $id, 'active_tab', $id));
        switch ($id) {
            case SMS_GROUP:
                cout(show_sms_panel($lang) . '<br />');
                break;
            default:
                cout('<br />');
        }
        cout('' . $conf->getPageWithElement($id) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save_config_' . $id, 'save_config', $lang->def('_SAVE')) . Form::getButton('undo_' . $id, 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::CloseForm() . '<br />' . '</div>');
    }
    cout('<script type="text/javascript">
		var targets =  YAHOO.util.Selector.query("span[id^=tt_target]");
		new YAHOO.widget.Tooltip("tooltip_info",
			{ context:targets,
			effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.20}
		 });
		</script>', 'scripts');
    reset($groups);
    cout('</div>' . '<div style="clear:left">&nbsp;</div>' . '</div>' . '</div>');
    cout('<script type="text/javascript">' . "\tnew YAHOO.widget.TabView('global_conf', {orientation:'left'});" . '</script>', 'scripts');
}
Example #10
0
function mycompetences(&$url)
{
    checkPerm('view');
    $html = "";
    $html .= getTitleArea(Lang::t('_COMPETENCES'), 'competences');
    $html .= '<div class="std_block">';
    $cmodel = new CompetencesAdm();
    $fmodel = new FunctionalrolesAdm();
    $id_user = getLogUserId();
    $ucomps = $cmodel->getUserCompetences($id_user);
    $rcomps = $fmodel->getUserRequiredCompetences($id_user);
    $ucomps_info = $cmodel->getCompetencesInfo(array_keys($ucomps));
    $language = getLanguage();
    $_typologies = $cmodel->getCompetenceTypologies();
    $_types = $cmodel->getCompetenceTypes();
    $icon_actv = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_COMPETENCE_OBTAINED', 'competences') . '</span></span>';
    $icon_req = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_MANDATORY', 'competences') . '</span></span>';
    //*******************
    require_once _base_ . '/lib/lib.table.php';
    $table = new Table(Get::sett('visuItem'), Lang::t('_COMPETENCES'), Lang::t('_COMPETENCES'));
    $style_h = array('', '', 'image', 'image', 'image', 'image', 'image');
    $label_h = array(Lang::t('_NAME', 'competences'), Lang::t('_TYPOLOGY', 'competences'), Lang::t('_TYPE', 'standard'), Lang::t('_SCORE', 'competences'), Lang::t('_DATE_LAST_COMPLETE', 'subscribe'), Lang::t('_COMPETENCES_REQUIRED', 'competences'));
    $table->addHead($label_h, $style_h);
    foreach ($ucomps_info as $id_competence => $cinfo) {
        $line = array();
        $line[] = $cinfo->langs[$language]['name'];
        $line[] = $_typologies[$cinfo->typology];
        $line[] = $_types[$cinfo->type];
        $line[] = $cinfo->type == 'score' ? '<b>' . $ucomps[$id_competence]->score_got . '</b>' : $icon_actv;
        $line[] = Format::date($ucomps[$id_competence]->last_assign_date, 'datetime');
        $line[] = array_key_exists($id_competence, $rcomps) ? $icon_req : '';
        $table->addBody($line);
    }
    $html .= $table->getTable();
    $html .= '</div>';
    $html .= Form::openForm('beck_url', 'index.php');
    $html .= Form::openButtonSpace();
    $html .= Form::getButton('close', 'close', Lang::t('_CLOSE', 'standard'));
    $html .= Form::closeButtonSpace();
    $html .= Form::closeform();
    cout($html, 'content');
}
Example #11
0
function additem($object_item)
{
    //checkPerm( 'view', FALSE, 'storage' );
    $lang =& DoceboLanguage::createInstance('scorm', 'lms');
    require_once _base_ . '/lib/lib.form.php';
    $form = new Form();
    //area title
    $GLOBALS['page']->add(getTitleArea($lang->getLangText('_SCORMIMGSECTION'), 'scorm', $lang->getLangText('_SCORMSECTIONNAME')));
    $GLOBALS['page']->add('<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $object_item->back_url) . '&amp;create_result=0', $lang->getLangText('_BACK_TOLIST')));
    $GLOBALS['page']->add(Form::getFormHeader($lang->def('_SCORM_ADD_FORM')));
    $GLOBALS['page']->add($form->openForm("scormform", "index.php?modname=scorm&amp;op=insitem", false, false, 'multipart/form-data'));
    $GLOBALS['page']->add($form->openElementSpace());
    $GLOBALS['page']->add($form->getHidden("back_url", "back_url", htmlentities(urlencode($object_item->back_url))));
    $GLOBALS['page']->add($form->getFilefield($lang->getLangText('_CONTENTPACKAGE'), "attach", "attach"));
    $GLOBALS['page']->add($form->getCheckbox($lang->getLangText('_SCORMIMPORTRESOURCES'), "lesson_resources", "lesson_resources", "import"));
    $GLOBALS['page']->add($form->closeElementSpace());
    $GLOBALS['page']->add($form->openButtonSpace());
    $GLOBALS['page']->add($form->getButton("scorm_add_submit", "scorm_add_submit", $lang->getLangText('_SCORMLOAD')));
    $GLOBALS['page']->add($form->closeButtonSpace());
    $GLOBALS['page']->add($form->closeForm() . '</div>');
}
Example #12
0
 function modpage($object_page)
 {
     checkPerm('view', false, 'storage');
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('htmlpage');
     //retriving info
     list($title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT title, textof \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_htmlpage \r\n\tWHERE idPage = '" . $object_page->getId() . "'"));
     // recuper gli allegati
     $path = '/appLms/htmlpages/';
     $query = "SELECT * FROM " . $GLOBALS['prefix_lms'] . "_htmlpage_attachment WHERE idpage = " . $object_page->getId();
     $res = mysql_query($query);
     $attachments = array();
     if ($res) {
         while ($row = mysql_fetch_assoc($res)) {
             $attachments[] = array('id' => $row['id'], 'title' => $row['title'], 'file' => $GLOBALS['where_files_relative'] . $path . $row['file']);
         }
     }
     $GLOBALS['page']->add(getTitleArea($lang->def('_SECT_PAGE'), 'htmlpage') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $object_page->back_url) . '&amp;mod_result=0', $lang->def('_BACK')) . Form::openForm('pageform', 'index.php?modname=htmlpage&amp;op=uppage', false, false, 'multipart/form-data') . Form::openElementSpace() . Form::getHidden('idPage', 'idPage', $object_page->getId()) . Form::getHidden('back_url', 'back_url', htmlentities(urlencode($object_page->back_url))) . '<script>' . "\n" . 'my_n=1;' . "\n" . 'function delAttachment(id) {' . "\n" . '	document.getElementById(id).style.textDecoration="line-through";' . "\n" . '	document.getElementById(\'iddelattachment\').value = document.getElementById(\'iddelattachment\').value+\';\'+id' . "\n" . '}' . "\n" . 'function addAttachment() {' . "\n" . '	my_file = "attach"+my_n;' . "\n" . '	my_filevalue = \'\';' . "\n" . '	if (document.getElementById(my_file))' . "\n" . '		my_filevalue = document.getElementById(my_file).value;' . "\n" . '	my_html = "' . str_replace(array("\r", "\r\n", "\n"), '', addslashes(Form::getFilefield($lang->def('_UPLOAD'), 'attach%%', 'attach%%'))) . '";' . "\n" . '	if (my_filevalue != \'\') {' . "\n" . '		my_n=my_n+1;' . "\n" . '		my_html = my_html.replace(/%%/gi,my_n);' . "\n" . '		newdiv = document.createElement("div");' . "\n" . '		newdiv.innerHTML = my_html;' . "\n" . '		my_divhtml = document.getElementById(\'attachment_area\');' . "\n" . '		my_divhtml.appendChild(newdiv);' . "\n" . '	}' . "\n" . '}' . "\n" . '</script>' . "\n" . '<div class="std_block">' . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 150, $title) . Form::getTextarea($lang->def('_TEXTOF'), 'textof', 'textof', $textof), 'content');
     foreach ($attachments as $attachment) {
         $GLOBALS['page']->add("<a id=\"" . $attachment['id'] . "\" href=\"" . $attachment['file'] . "\" target=\"_blank\">" . $attachment['title'] . "</a> (<a href=\"javascript:delAttachment(" . $attachment['id'] . ");\">x</a>)<br/>", 'content');
     }
     $GLOBALS['page']->add('<div id="attachment_area">' . Form::getHidden('iddelattachment', 'iddelattachment', '') . Form::getFilefield($lang->def('_UPLOAD'), 'attach1', 'attach1') . '</div>' . '<a href="javascript:addAttachment();">(+)</a>' . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('addhtmlpage', 'addhtmlpage', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '', 'content');
 }
Example #13
0
 /**
  * Display the user/group/orgchart/fncrole selector
  * @param string $url the url of the page, used for the form
  * @param string $title the main title for the page (will be passed to a getTitleArea function
  * @param string $text extra text to display
  * @param bool $selector_mode if true the main div and page title will be drawed by the selector
  * @param string $id the id for the form that will contain the selector
  */
 public function loadSelector($url, $title = false, $text = '', $selector_mode = TRUE, $id = FALSE)
 {
     $res = '';
     $id = empty($id) ? 'main_selector' : $id;
     $us_util = new UserSelectorUtil();
     if ($selector_mode && $title != false) {
         $res .= getTitleArea($title);
         $res .= '<div class="std_block">';
     }
     $res .= Form::openForm($id . '_form', $url);
     if (is_array($this->_extra_form) && !empty($this->_extra_form)) {
         $res .= implode("\n", $this->_extra_form);
     }
     $res .= Util::widget('userselector', array('id' => $id, 'show_user_selector' => $this->show_user_selector, 'show_group_selector' => $this->show_group_selector, 'show_orgchart_selector' => $this->show_orgchart_selector, 'show_fncrole_selector' => $this->show_fncrole_selector, 'initial_selection' => $this->selection, 'admin_filter' => true, 'learning_filter' => $this->learning_filter, 'use_suspended' => $this->use_suspended, 'nFields' => $this->nFields !== FALSE ? $this->nFields : 3), true);
     $res .= Form::openButtonSpace();
     $res .= Form::getButton('okselector', 'okselector', Lang::t('_SAVE', 'standard'));
     $res .= Form::getButton('cancelselector', 'cancelselector', Lang::t('_UNDO', 'standard'));
     $res .= Form::closeButtonSpace();
     $res .= Form::closeForm();
     if ($selector_mode) {
         $res .= '</div>';
     }
     cout($res, 'content');
 }
Example #14
0
<br />

<?php 
$title = array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), 'index.php?r=' . $base_link_edition . '/show&id_course=' . $model->getIdCourse() => Lang::t('_EDITIONS', 'course'), Lang::t('_ADD', 'course'));
echo getTitleArea($title);
?>

<div class="std_block">

<?php 
echo Form::openForm('add_edition_form', 'index.php?r=' . $base_link_edition . '/add&amp;id_course=' . $model->getIdCourse()) . Form::openElementSpace() . Form::getTextfield(Lang::t('_CODE', 'course'), 'code', 'code', 255, $course_info['code']) . Form::getTextfield(Lang::t('_NAME', 'course'), 'name', 'name', 255, $course_info['name']) . Form::getTextarea(Lang::t('_DESCRIPTION', 'course'), 'description', 'description', $course_info['description']) . Form::getDropdown(Lang::t('_STATUS', 'course'), 'status', 'status', $model->getStatusForDropdown()) . Form::getTextfield(Lang::t('_MAX_NUM_SUBSCRIBE', 'course'), 'max_par', 'max_par', 255) . Form::getTextfield(Lang::t('_MIN_NUM_SUBSCRIBE', 'course'), 'min_par', 'min_par', 255) . Form::getTextfield(Lang::t('_COURSE_PRIZE', 'course'), 'price', 'price', 255) . Form::getDatefield(Lang::t('_DATE_BEGIN', 'course'), 'date_begin', 'date_begin') . Form::getDatefield(Lang::t('_DATE_END', 'course'), 'date_end', 'date_end') . '<div class="form_line_l">' . '<p><label for="overbooking" class="floating">' . Lang::t('_ALLOW_OVERBOOKING', 'course') . '</label></p>' . Form::getInputCheckbox('overbooking', 'overbooking', 1, false, false) . '</div>' . '<div class="form_line_l">' . '<p><label for="overbooking" class="floating">' . Lang::t('_SUBSCRIPTION_OPEN', 'course') . '</label></p>' . Form::getInputCheckbox('can_subscribe', 'can_subscribe', 1, false, false) . '</div>' . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_BEGIN', 'course'), 'sub_date_begin', 'sub_date_begin') . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_END', 'course'), 'sub_date_end', 'sub_date_end') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('ins', 'ins', Lang::t('_SAVE', 'course')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'course')) . Form::closeButtonSpace() . Form::closeForm();
?>

</div>
Example #15
0
 function loadCatalogueSelector($noprint = false)
 {
     require_once _base_ . '/lib/lib.table.php';
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('catalogue', 'lms');
     // Filter
     $this->filter['catalogue_name'] = isset($_POST['cat_filter_name']) ? $_POST['cat_filter_name'] : '';
     if ($this->show_filter === true) {
         $form = new Form();
         /*$GLOBALS['page']->add(
         			$form->getOpenFieldset($lang->def('_SEARCH'))
         			.Form::getTextfield($lang->def('_NAME'), 'cat_filter_name', 'cat_filter_name', '255',
         				( isset($_POST['cat_filter_name']) ? $_POST['cat_filter_name'] : '' ))
         			.$form->openButtonSpace()
         			.$form->getButton('catalogue_filter', 'catalogue_filter', $lang->def('_SEARCH'))
         			.$form->closeButtonSpace()
         			.$form->getCloseFieldset()
         		, 'content');
         		*/
         cout('<div class="quick_search_form">' . '<div>' . Form::getInputTextfield("search_t", "cat_filter_name", "cat_filter_name", Get::req('cat_filter_name', DOTY_MIXED, ''), '', 255, '') . Form::getButton("catalogue_filter", "catalogue_filter", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>', 'content');
     }
     // End Filter
     $tb = new Table(Get::sett('visuItem'), $lang->def('_CATALOGUE'), $lang->def('_CATALOGUE_SUMMARY'));
     $tb->initNavBar('ini_cat', 'button');
     $ini = $tb->getSelectedElement();
     $select = "\r\n\t\tSELECT c.idCatalogue, c.name, c.description";
     $query_catalogue = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue AS c\r\n\t\tWHERE 1";
     // Retriving data
     if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
         $all_courses = false;
         require_once _base_ . '/lib/lib.preference.php';
         $adminManager = new AdminPreference();
         $admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST());
         if (isset($admin_courses['course'][0])) {
             $all_courses = true;
         }
         if (isset($admin_courses['course'][-1])) {
             require_once _lms_ . '/lib/lib.catalogue.php';
             $cat_man = new Catalogue_Manager();
             $admin_courses['catalogue'] = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
             if (count($admin_courses['catalogue']) == 0 && Get::sett('on_catalogue_empty', 'off') == 'on') {
                 $all_courses = true;
             }
         }
         if (!$all_courses) {
             if (empty($admin_courses['catalogue'])) {
                 $query_catalogue .= " AND 0 ";
             } else {
                 $query_catalogue .= " AND c.idCatalogue IN (0," . implode(',', $admin_courses['catalogue']) . ") ";
             }
         }
     }
     if ($this->filter['catalogue_name'] != '') {
         $query_catalogue .= " AND c.name LIKE '%" . $this->filter['catalogue_name'] . "%'";
     }
     list($tot_catalogue) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_catalogue));
     $query_catalogue .= " ORDER BY c.name\r\n\t\t\t\t\t\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem');
     $re_catalogue = sql_query($select . $query_catalogue);
     $type_h = array('image', '', '', '');
     $cont_h = array('<span class="access-only">' . $lang->def('_CATALOGUE_SELECTION') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
     $tb->setColsStyle($type_h);
     $tb->addHead($cont_h);
     while (list($id_catalogue, $name, $descr) = sql_fetch_row($re_catalogue)) {
         $tb_content = array(Form::getInputCheckbox('new_catalogue_selected_' . $id_catalogue, 'new_catalogue_selected[' . $id_catalogue . ']', $id_catalogue, isset($this->current_selection[$id_catalogue]), ''), '<label for="new_catalogue_selected_' . $id_catalogue . '">' . $name . '</label>', '<label for="new_catalogue_selected_' . $id_catalogue . '">' . $descr . '</label>');
         $tb->addBody($tb_content);
         if (isset($this->current_selection[$id_catalogue])) {
             unset($this->current_selection[$id_catalogue]);
         }
     }
     $output = $tb->getTable() . $tb->getNavBar($ini, $tot_catalogue) . $this->stateSelection();
     if ($noprint) {
         return $output;
     } else {
         cout($output, 'content');
     }
 }
Example #16
0
function modTransaction()
{
    require_once _base_ . '/lib/lib.table.php';
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.dialog.php';
    require_once _lms_ . '/lib/lib.course.php';
    require_once _lms_ . '/lib/lib.date.php';
    $lang =& DoceboLanguage::createInstance('transaction');
    $acl_man = Docebo::user()->getAclManager();
    $man_transaction = new Man_Transaction();
    $course_man = new Man_Course();
    $date_man = new DateManager();
    $id_transaction = Get::req('id', DOTY_INT, 0);
    $transaction_info = $man_transaction->getTransactionInfo($id_transaction);
    if (isset($_POST['update'])) {
        $payment_status = Get::req('payment_status', DOTY_INT, 0);
        $course_status = Get::req('course_status', DOTY_INT, 0);
        $note = Get::req('note', DOTY_MIXED, '');
        if ($man_transaction->updateTransaction($id_transaction, $payment_status, $course_status, $note)) {
            if (isset($_POST['confirm'])) {
                $activations = array();
                foreach ($_POST['confirm'] as $id => $n) {
                    list($id_course, $id_date) = explode('_', $id);
                    if ($id_date != 0) {
                        $activations[$id_course]['dates'][$id_date] = $id_date;
                    } else {
                        $activations[$id_course] = $id_course;
                    }
                }
                if ($man_transaction->activateCourses($id_transaction, $transaction_info['id_user'], $activations)) {
                    Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
                }
            } else {
                Util::jump_to('index.php?modname=transaction&op=transaction&res=ok');
            }
        }
        Util::jump_to('index.php?modname=transaction&op=transaction&res=err_up');
    }
    $array_title = array('index.php?modname=transaction&amp;op=transaction' => $lang->def('_TRANSACTION'), $lang->def('_MOD_TRANSACTION'));
    //Status info & note
    $array_payment_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_WAITING_PAYMENT'), '1' => $lang->def('_PARTIAL_PAID'), '2' => $lang->def('_PAID'));
    $array_course_status = array('-1' => $lang->def('_CANCELLED'), '0' => $lang->def('_NO_COURSE_ACTIVATED'), '1' => $lang->def('_SOME_COURSE_ACTIVATED'), '2' => $lang->def('_ALL_COURSE_ACTIVATED'));
    cout(getTitleArea($array_title) . '<div class="std_block">' . Form::openForm('transaction_info', 'index.php?modname=transaction&amp;op=mod&amp;id=' . $id_transaction) . Form::openElementSpace() . Form::getDropdown($lang->def('_PAYMENT_STATUS_FILTER'), 'payment_status', 'payment_status', $array_payment_status, $transaction_info['payment_status']) . Form::getDropdown($lang->def('_COURSE_STATUS_FILTER'), 'course_status', 'course_status', $array_course_status, $transaction_info['course_status']) . Form::getSimpleTextarea($lang->def('_NOTES'), 'note', 'note', $transaction_info['note']) . Form::closeElementSpace());
    //User info
    $user_info = $acl_man->getUser($transaction_info['id_user'], false);
    $tb_user = new Table(0, $lang->def('_USER_INFO'), $lang->def('_USER_INFO'));
    $cont_h = array($lang->def('_USERNAME'), $lang->def('_FIRSTNAME'), $lang->def('_LASTNAME'), $lang->def('_EMAIL'));
    $type_h = array('', '', '', '');
    $tb_user->setColsStyle($type_h);
    $tb_user->addHead($cont_h);
    $tb_user->addBody(array($acl_man->relativeId($user_info[ACL_INFO_USERID]), $user_info[ACL_INFO_FIRSTNAME], $user_info[ACL_INFO_LASTNAME], $user_info[ACL_INFO_EMAIL]));
    cout('<br />' . $tb_user->getTable());
    //Payment info if we need it
    //Product info
    $tb_product = new Table(0, $lang->def('_PRODUCT_INFO'), $lang->def('_PRODUCT_INFO'));
    $cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_DATE_BEGIN'), $lang->def('_DATE_END'), $lang->def('_COURSE_PRIZE'), $lang->def('_CONFIRM_COURSE'));
    $type_h = array('', '', '', '', '', '');
    $tb_product->setColsStyle($type_h);
    $tb_product->addHead($cont_h);
    $transaction_course = $man_transaction->getTransactionCourses($id_transaction);
    foreach ($transaction_course as $id_course => $details) {
        if (is_array($details)) {
            foreach ($details['dates'] as $id_date) {
                $date_info = $date_man->getDateInfo($id_date);
                $checked = false;
                $other = '';
                if ($man_transaction->controlActivation($id_transaction, $id_course, $id_date)) {
                    $checked = true;
                    $other = 'disabled="disabled"';
                }
                $tb_product->addBody(array($date_info['code'], $date_info['name'], Format::date($date_info['date_begin']), Format::date($date_info['date_end']), $date_info['price'], Form::getInputCheckbox($id_course . '_' . $id_date, 'confirm[' . $id_course . '_' . $id_date . ']', 1, $checked, $other)));
            }
        } else {
            $course_info = $course_man->getCourseInfo($id_course);
            $checked = false;
            $other = '';
            if ($man_transaction->controlActivation($id_transaction, $id_course)) {
                $checked = true;
                $other = 'disabled="disabled"';
            }
            $tb_product->addBody(array($course_info['code'], $course_info['name'], $course_info['date_begin'] !== '0000-00-00' ? Format::date($course_info['date_begin'], 'date') . ($course_info['hour_begin'] !== '-1' ? $course_info['hour_begin'] : '') : '', $course_info['date_end'] !== '0000-00-00' ? Format::date($course_info['date_end'], 'date') . ($course_info['hour_end'] !== '-1' ? $course_info['hour_end'] : '') : '', $course_info['prize'] == '' ? '0' : $course_info['prize'], Form::getInputCheckbox($id_course . '_0', 'confirm[' . $id_course . '_0]', 1, $checked, $other)));
        }
    }
    cout('<br />' . $tb_product->getTable() . Form::openButtonSpace() . Form::getButton('update', 'update', $lang->def('_UPDATE')) . Form::getButton('back_mod', 'back_mod', $lang->def('_BACK')) . Form::closeButtonSpace() . Form::closeForm());
    cout('</div>');
}
<?php

$title = array('index.php?r=' . $this->link_course . '/show' => Lang::t('_COURSE', 'course'), Lang::t('_MULTIPLE_SUBSCRIPTION', 'course'));
echo getTitleArea($title) . '<div class="std_block">' . Form::openForm('course_selection_form', 'index.php?r=' . $this->link . '/multiplesubscription') . Form::getHidden('id_cat', 'id_cat', $id_cat) . Form::getHidden('step', 'step', '2') . Form::getHidden('user_selection', 'user_selection', $user_selection) . $course_selector->loadCourseSelector(true) . Form::openButtonSpace() . Form::getButton('back', 'back', Lang::t('_PREV', 'course')) . Form::getButton('next', 'next', Lang::t('_NEXT', 'course')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'standard')) . Form::closeButtonSpace() . Form::closeForm() . '</div>';
Example #18
0
 function loadCoursepathSelector($noprint = false)
 {
     require_once _base_ . '/lib/lib.table.php';
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('coursepath', 'lms');
     $output = '';
     // Filter
     $this->filter['coursepath_name'] = isset($_POST['coursepath_filter_name']) ? $_POST['coursepath_filter_name'] : '';
     if ($this->show_filter === true) {
         /*
         			$form = new Form();
         			$output .= $form->getOpenFieldset($lang->def('_COURSEPATH_FILTER'))
         				.Form::getTextfield($lang->def('_NAME'), 'coursepath_filter_name', 'coursepath_filter_name', '255',
         					( isset($_POST['coursepath_filter_name']) ? $_POST['coursepath_filter_name'] : '' ))
         				.$form->openButtonSpace()
         				.$form->getButton('coursepath_filter', 'coursepath_filter', $lang->def('_SEARCH'))
         				.$form->closeButtonSpace()
         				.$form->getCloseFieldset();*/
         $output .= '<div class="quick_search_form">' . '<div>' . Form::getInputTextfield("search_t", "coursepath_filter_name", "coursepath_filter_name", Get::req('coursepath_filter_name', DOTY_MIXED, ''), '', 255, '') . Form::getButton("coursepath_filter", "coursepath_filter", Lang::t('_SEARCH', 'standard'), "search_b") . '</div>' . '</div>';
     }
     // End Filter
     $tb = new Table(Get::sett('visuItem'), $lang->def('_COURSE_PATH_CAPTION'), $lang->def('_COURSE_PATH_SUMMARY'));
     $tb->initNavBar('ini_cpath', 'button');
     $ini = $tb->getSelectedElement();
     $select = "\r\n\t\tSELECT id_path, path_name, path_descr ";
     $query_coursepath = "\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_coursepath\r\n\t\tWHERE 1 ";
     if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
         $all_courses = false;
         require_once _base_ . '/lib/lib.preference.php';
         $adminManager = new AdminPreference();
         $admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST());
         if (isset($admin_courses['course'][0])) {
             $all_courses = true;
         }
         if (isset($admin_courses['course'][-1])) {
             $query = "SELECT id_path" . " FROM %lms_coursepath_user" . " WHERE idUser = '******'";
             $result = sql_query($query);
             $admin_courses['coursepath'] = array();
             while (list($id_path) = sql_fetch_row($result)) {
                 $admin_courses['coursepath'][$id_path] = $id_path;
             }
             if (!empty($admin_courses['coursepath']) && Get::sett('on_catalogue_empty', 'off') == 'on') {
                 $all_courses = true;
             }
         }
         if (!$all_courses) {
             if (empty($admin_courses['coursepath'])) {
                 $query_coursepath .= " AND 0 ";
             } else {
                 $query_coursepath .= " AND id_path IN (" . implode(',', $admin_courses['coursepath']) . ") ";
             }
         }
     }
     if ($this->filter['coursepath_name'] != '') {
         $query_coursepath .= " AND path_name LIKE '%" . $this->filter['coursepath_name'] . "%'";
     }
     list($tot_coursepath) = sql_fetch_row(sql_query("SELECT COUNT(*) " . $query_coursepath));
     $query_coursepath .= "\r\n\t\tORDER BY path_name\r\n\t\tLIMIT " . $ini . "," . (int) Get::sett('visuItem');
     $re_coursepath = sql_query($select . $query_coursepath);
     $type_h = array('image', '', '', '');
     $cont_h = array('<span class="access-only">' . $lang->def('_SELECT') . '</span>', $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
     $tb->setColsStyle($type_h);
     $tb->addHead($cont_h);
     while (list($id_path, $name, $descr) = sql_fetch_row($re_coursepath)) {
         $tb_content = array(Form::getInputCheckbox('new_coursepath_selected_' . $id_path, 'new_coursepath_selected[' . $id_path . ']', $id_path, isset($this->current_selection[$id_path]), ''), '<label for="new_coursepath_selected_' . $id_path . '">' . $name . '</label>', '<label for="new_coursepath_selected_' . $id_path . '">' . $descr . '</label>');
         $tb->addBody($tb_content);
         if (isset($this->current_selection[$id_path])) {
             unset($this->current_selection[$id_path]);
         }
     }
     $output .= $tb->getTable() . $tb->getNavBar($ini, $tot_coursepath) . $this->stateSelection();
     if ($noprint) {
         return $output;
     } else {
         cout($output, 'content');
     }
 }
Example #19
0
 function import()
 {
     checkPerm('mod');
     require_once $GLOBALS['where_lms'] . '/lib/lib.course_managment.php';
     $lang =& DoceboLanguage::createInstance('catalogue', 'lms');
     $id_cat = importVar('id_cat', true, 0);
     $out =& $GLOBALS['page'];
     $out->setWorkingZone('content');
     $sel = new Course_Manager();
     $sel->show_catalogue_selector = false;
     $sel->setLink('index.php?modname=catalogue&amp;op=import');
     if (isset($_POST['undo'])) {
         Util::jump_to('index.php?modname=catalogue&amp;op=entrylist&amp;id=' . $id_cat);
     }
     if (isset($_GET['load']) || isset($_POST['save_selection'])) {
         $course_initial_sel = array();
         $coursepath_initial_sel = array();
         $query = "\r\n\t\tSELECT idEntry, type_of_entry\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue_entry\r\n\t\tWHERE idCatalogue = '" . $id_cat . "'";
         $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;
             }
         }
         if (isset($_GET['load'])) {
             $sel->resetCourseSelection($course_initial_sel);
             $sel->resetCoursePathSelection($coursepath_initial_sel);
         }
     }
     if (isset($_POST['save_selection'])) {
         $re = true;
         $course = $sel->getCourseSelection($_POST);
         $re &= updateCatalogueEntry($course, $course_initial_sel, 'course', $id_cat);
         $coursepath = $sel->getCoursePathSelection($_POST);
         $re &= updateCatalogueEntry($coursepath, $coursepath_initial_sel, 'coursepath', $id_cat);
         Util::jump_to('index.php?modname=catalogue&amp;op=entrylist&amp;id=' . $id_cat . '&amp;result=' . ($re ? 'ok' : 'err'));
     }
     $title_area = array('index.php?modname=catalogue&amp;op=catlist' => $lang->def('_CATALOGUE'), 'index.php?modname=catalogue&amp;op=entrylist&amp;id=' . $id_cat => getCatalogueName($id_cat), $lang->def('_IMPORT_NEW_ENTRY') . ' ' . $lang->def('_COURSE'));
     $out->add(getTitleArea($title_area, 'catalogue') . '<div class="std_block">' . Form::openForm('mancoursepath', 'index.php?modname=catalogue&amp;op=import') . Form::getHidden('id_cat', 'id_cat', $id_cat) . $sel->loadSelector(true, true) . Form::openButtonSpace() . Form::getButton('save_selection', 'save_selection', $lang->def('_SAVE')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
if (!$_is_editing) {
    echo Form::getHidden('id_location', 'id_location', (int) $id_location);
}
if ($_is_editing) {
    echo Form::getHidden('id_classroom', 'id_classroom', $info->idClassroom);
}
if ($_is_editing) {
    echo Form::getHidden('id_location', 'id_location', $info->location_id);
}
echo Form::getTextfield(Lang::t('_BUILDING_ROOM', 'classroom'), 'room', 'room', 255, $_is_editing ? $info->room : "");
echo Form::getTextfield(Lang::t('_CAPACITY', 'classroom'), 'capacity', 'capacity', 255, $_is_editing ? $info->capacity : "");
echo Form::getTextfield(Lang::t('_RESPONSABLE', 'classroom'), 'responsable', 'responsable', 255, $_is_editing ? $info->responsable : "");
echo Form::getTextfield(Lang::t('_STREET', 'classroom'), 'street', 'street', 255, $_is_editing ? $info->street : "");
echo Form::getTextfield(Lang::t('_CITY', 'classroom'), 'city', 'city', 255, $_is_editing ? $info->city : "");
echo Form::getTextfield(Lang::t('_STATE', 'classroom'), 'state', 'state', 255, $_is_editing ? $info->state : "");
echo Form::getTextfield(Lang::t('_ZIP_CODE', 'classroom'), 'zip_code', 'zip_code', 255, $_is_editing ? $info->zip_code : "");
echo Form::getTextfield(Lang::t('_PHONE', 'classroom'), 'phone', 'phone', 255, $_is_editing ? $info->phone : "");
echo Form::getTextfield(Lang::t('_FAX', 'classroom'), 'fax', 'fax', 255, $_is_editing ? $info->fax : "");
echo Form::getTextarea(Lang::t('_DISPOSITION', 'classroom'), 'disposition', 'disposition', $_is_editing ? $info->disposition : "");
echo Form::getTextarea(Lang::t('_INSTRUMENT', 'classroom'), 'instrument', 'instrument', $_is_editing ? $info->instrument : "");
echo Form::getTextarea(Lang::t('_AVAILABLE_INSTRUMENT', 'classroom'), 'available_instrument', 'available_instrument', $_is_editing ? $info->available_instrument : "");
echo Form::getTextarea(Lang::t('_NOTES', 'classroom'), 'note', 'note', $_is_editing ? $info->note : "");
echo Form::openButtonSpace();
echo $_is_editing ? Form::getButton('save', 'save', Lang::t('_SAVE', 'classroom')) : Form::getButton('save', 'save', Lang::t('_SAVE', 'classroom'));
echo Form::getButton('undo', 'undo', Lang::t('_UNDO', 'classroom'));
echo Form::closeButtonSpace();
echo Form::closeForm();
?>
</div>

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();
}
Example #22
0
<?php

echo getTitleArea(Lang::t('_PRECOMPILE', 'standard'));
?>
<div class="std_block">
<?php 
echo $result_message;
echo Form::openForm('precompile_form', 'index.php?r=precompile/set');
if (!$fields_checked) {
    foreach ($fieldlist->getUserMandatoryFields(Docebo::user()->getIdSt()) as $id_field => $m_field) {
        echo $fieldlist->playFieldForUser(Docebo::user()->getIdSt(), $id_field, false, true);
    }
}
echo Form::getBreakRow();
echo '<div class="boxed">';
echo '<p class="privacy_policy">';
echo $policy_text;
echo '</p>';
echo Form::getBreakRow();
echo '<div class="align-center">';
echo Form::getCheckbox(Lang::t('_ACCEPT', 'register'), 'accept_policy', 'accept_policy', 1, FALSE);
echo '</div>';
echo '</div>';
echo Form::openButtonSpace();
echo Form::getButton('save', 'save', Lang::t('_SAVE', 'standard'));
echo Form::getButton('undo', 'undo', Lang::t('_UNDO', 'standard'));
echo Form::closeButtonSpace();
echo Form::closeForm();
?>
</div>
Example #23
0
<?php

echo getTitleArea(Lang::t('_MYCOURSES_FIELDMASK_TITLE', 'catalogue'));
?>
<div class="std_block">
<?php 
$m_fields = $field_manager->getUserMandatoryFields($user_idst);
echo '<p>' . Lang::t('_MYCOURSES_FIELDMASK_INTEST', 'catalogue') . '</p>' . Form::openForm('request_compile', 'index.php?r=elearning/fields');
foreach ($m_fields as $id_field => $m_field) {
    echo $field_manager->playFieldForUser($user_idst, $id_field, false, true);
}
echo Form::openButtonSpace() . Form::getButton('save', 'save', Lang::t('_SAVE')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
Example #24
0
 function modnotes()
 {
     checkPerm('view');
     list($title, $textof) = sql_fetch_row(sql_query("\r\n\tSELECT title, textof \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_notes \r\n\tWHERE  idNotes = '" . $_GET['idNotes'] . "'  AND owner ='" . getLogUserId() . "' AND idCourse='" . $_SESSION['idCourse'] . "'"));
     require_once _base_ . '/lib/lib.form.php';
     $lang =& DoceboLanguage::createInstance('notes', 'lms');
     $page_title = array('index.php?modname=notes&amp;op=notes' => $lang->def('_NOTES'), $lang->def('_MOD_NOTES'));
     $GLOBALS['page']->add(getTitleArea(array(), 'notes') . '<div class="std_block">' . getBackUi('index.php?modname=notes&amp;op=notes', $lang->def('_BACK')) . Form::openForm('formnotes', 'index.php?modname=notes&amp;op=upnotes') . Form::openElementSpace() . Form::getHidden('idNotes', 'idNotes', $_GET['idNotes']) . Form::getTextfield($lang->def('_TITLE'), 'title', 'title', 255, $title) . Form::getTextarea($lang->def('_TEXTOF'), 'description', 'description', $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');
 }
Example #25
0
echo Form::openForm('maskcourse_form', 'index.php?r=' . $base_link_course . '/' . ($id_course === false ? 'newcourse' : 'modcourse'), false, 'post', 'multipart/form-data') . Form::getHidden('id_course', 'id_course', $id_course) . Form::openElementSpace() . ($id_course === false ? Form::getLineBox(Lang::t('_CATEGORY_SELECTED', 'course'), $name_category) . Form::getHidden('idCategory', 'idCategory', $_SESSION['course_category']['filter_status']['id_category']) : Form::getDropdown(Lang::t('_CATEGORY_SELECTED', 'course'), 'idCategory', 'idCategory', $model->getCategoryForDropdown(), $course['idCategory'])) . Form::getTextfield(Lang::t('_CODE', 'course'), 'course_code', 'course_code', '50', $course['code']) . Form::getTextfield(Lang::t('_COURSE_NAME', 'course'), 'course_name', 'course_name', '255', $course['name']);
if ($course['course_type'] == 'classroom' && $has_editions_or_classrooms) {
    //this is a classroom course with editions
    echo Form::getLineBox(Lang::t('_COURSE_TYPE', 'course'), $course_type['classroom']) . Form::getHidden('course_type', 'course_type', 'classroom');
} elseif ($course['course_edition'] > 0 && $has_editions_or_classrooms) {
    //this is a classroom course with editions
    echo Form::getLineBox(Lang::t('_COURSE_TYPE', 'course'), $course_type['edition']) . Form::getHidden('course_type', 'course_type', 'edition');
} else {
    //echo Form::getDropdown(Lang::t('_COURSE_TYPE', 'course'), 'course_type', 'course_type', $course_type, $course['course_type']);
    echo Form::getDropdown(Lang::t('_COURSE_TYPE', 'course'), 'course_type', 'course_type', $course_type, $id_course === false ? 'elearning' : $course['course_type']);
}
echo Form::getDropdown(Lang::t('_STATUS', 'course'), 'course_status', 'course_status', $status, $course['status']) . Form::getCheckbox(Lang::t('_DIRECT_PLAY', 'course'), 'direct_play', 'direct_play', '1', $course['direct_play'] == 1) . Form::getTextarea(Lang::t('_DESCRIPTION', 'course'), 'course_descr', 'course_descr', $course['description']) . ($id_course !== false && $course['course_type'] != 'elearning' ? Form::getCheckbox(Lang::t('_CASCADE_MOD_ON_EDITION', 'course'), 'cascade_on_ed', 'cascade_on_ed', 1) : '') . Form::closeElementSpace() . Form::openElementSpace() . Form::openCollasableFieldset(Lang::t('_DETAILS', 'course')) . ($id_course === false ? Form::getDropdown(Lang::t('_COURSE_MENU_TO_ASSIGN', 'course'), 'selected_menu', 'selected_menu', $menu_custom, $sel_custom) : '') . Form::getDropdown(Lang::t('_COURSE_LANG_METHOD', 'course'), 'course_lang', 'course_lang', $array_lang, array_search($course['lang_code'], $array_lang)) . Form::getDropdown(Lang::t('_DIFFICULTY', 'course'), 'course_difficult', 'course_difficult', $difficult_lang, $course['difficult']) . Form::getTextfield(Lang::t('_CREDITS', 'course'), 'credits', 'credits', '50', $course['credits']) . Form::getDropdown(Lang::t('_LABELS', 'label'), 'label', 'label', $label_model->getLabelFromDropdown(true), $id_course === false ? false : $label_model->getCourseLabel($course['idCourse'])) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_SUBSCRIPTION', 'course')) . Form::getOpenCombo(Lang::t('_COURSE_SUBSRIBE', 'course')) . Form::getRadio(Lang::t('_COURSE_S_GODADMIN', 'course'), 'course_subs_godadmin', 'course_subs', '0', $course['subscribe_method'] == 0) . Form::getRadio(Lang::t('_COURSE_S_MODERATE', 'course'), 'course_subs_moderate', 'course_subs', '1', $course['subscribe_method'] == 1) . Form::getRadio(Lang::t('_COURSE_S_FREE', 'course'), 'course_subs_free', 'course_subs', '2', $course['subscribe_method'] == 2) . Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_USER_CAN_SUBSCRIBE', 'course')) . Form::getRadio(Lang::t('_SUBSCRIPTION_CLOSED', 'course'), 'subscription_closed', 'can_subscribe', '0', $course['can_subscribe'] == 0) . Form::getRadio(Lang::t('_SUBSCRIPTION_OPEN', 'course'), 'subscription_open', 'can_subscribe', '1', $course['can_subscribe'] == 1) . Form::getRadio(Lang::t('_SUBSCRIPTION_IN_PERIOD', 'course') . ":", 'subscription_period', 'can_subscribe', '2', $course['can_subscribe'] == 2) . Form::getCloseCombo() . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_BEGIN', 'course') . ":", 'sub_start_date', 'sub_start_date', $course['sub_start_date']) . Form::getDatefield(Lang::t('_SUBSCRIPTION_DATE_END', 'course') . ":", 'sub_end_date', 'sub_end_date', $course['sub_end_date']) . Form::getBreakRow() . Form::getOpenCombo(Lang::t('_USER_CAN_UNSUBSCRIBE', 'course')) . Form::getRadio(Lang::t('_COURSE_S_GODADMIN', 'course'), 'no_user_unsubscription', 'auto_unsubscribe', '0', $course['auto_unsubscribe'] == 0) . Form::getRadio(Lang::t('_COURSE_S_MODERATE', 'course'), 'moderated_user_unsubscription', 'auto_unsubscribe', '1', $course['auto_unsubscribe'] == 1) . Form::getRadio(Lang::t('_COURSE_S_FREE', 'course'), 'yes_user_unsubscription', 'auto_unsubscribe', '2', $course['auto_unsubscribe'] == 2) . Form::getCloseCombo() . Form::getDatefield(Lang::t('_UNSUBSCRIBE_DATE_LIMIT', 'course'), 'unsubscribe_date_limit', 'unsubscribe_date_limit', $unsubscribe_date_limit, FALSE, FALSE, '', '', Form::getInputCheckbox('use_unsubscribe_date_limit', 'use_unsubscribe_date_limit', 1, $use_unsubscribe_date_limit, '') . ' ') . Form::getBreakRow() . Form::getTextfield(Lang::t('_COURSE_AUTOREGISTRATION_CODE', 'course'), 'course_autoregistration_code', 'course_autoregistration_code', '255', $course['autoregistration_code']) . Form::getCheckbox(Lang::t('_RANDOM_COURSE_AUTOREGISTRATION_CODE', 'course'), 'random_course_autoregistration_code', 'random_course_autoregistration_code', 0) . Form::getBreakRow() . Form::getCheckbox(Lang::t('_COURSE_SELL', 'course'), 'course_sell', 'course_sell', '1', $course['selling'] == 1) . Form::getTextfield(Lang::t('_COURSE_PRIZE', 'course'), 'course_prize', 'course_prize', '11', $course['prize']) . Form::getTextfield(Lang::t('_COURSE_ADVANCE', 'course'), 'advance', 'advance', '11', $course['advance']) . Form::getHidden('course_em', 'course_em', '0') . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_DISPLAY_MODE', 'course')) . Form::getOpenCombo(Lang::t('_WHERE_SHOW_COURSE', 'course')) . Form::getRadio(Lang::t('_SC_EVERYWHERE', 'course'), 'course_show_rules_every', 'course_show_rules', '0', $course['show_rules'] == 0) . Form::getRadio(Lang::t('_SC_ONLY_IN', 'course'), 'course_show_rules_only_in', 'course_show_rules', '1', $course['show_rules'] == 1) . Form::getRadio(Lang::t('_SC_ONLYINSC_USER', 'course'), 'course_show_rules_onlyinsc_user', 'course_show_rules', '2', $course['show_rules'] == 2) . Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_WHAT_SHOW', 'course')) . Form::getCheckbox(Lang::t('_SHOW_PROGRESS', 'course'), 'course_progress', 'course_progress', '1', $course['show_progress'] == 1) . Form::getCheckbox(Lang::t('_SHOW_TIME', 'course'), 'course_time', 'course_time', '1', $course['show_time'] == 1) . Form::getCheckbox(Lang::t('_SHOW_ADVANCED_INFO', 'course'), 'course_advanced', 'course_advanced', '1', $course['show_extra_info'] == 1) . Form::getCloseCombo() . Form::getDropdown(Lang::t('_SHOW_WHOISONLINE', 'course'), 'show_who_online', 'show_who_online', $show_who_online, $course['show_who_online']) . Form::getOpenCombo(Lang::t('_SHOW_USER_OF_LEVEL', 'course'));
while (list($level, $level_name) = each($levels)) {
    echo Form::getCheckbox($level_name, 'course_show_level_' . $level, 'course_show_level[' . $level . ']', $level, $course['level_show_user'] & 1 << $level);
}
echo Form::getCloseCombo() . Form::getOpenCombo(Lang::t('_COURSE_STATUS_CANNOT_ENTER', 'course')) . Form::getCheckbox(Lang::t('_USER_STATUS_SUBS', 'course'), 'user_status_' . _CUS_SUBSCRIBED, 'user_status[' . _CUS_SUBSCRIBED . ']', _CUS_SUBSCRIBED, $course['userStatusOp'] & 1 << _CUS_SUBSCRIBED) . Form::getCheckbox(Lang::t('_USER_STATUS_BEGIN', 'course'), 'user_status_' . _CUS_BEGIN, 'user_status[' . _CUS_BEGIN . ']', _CUS_BEGIN, $course['userStatusOp'] & 1 << _CUS_BEGIN) . Form::getCheckbox(Lang::t('_USER_STATUS_END', 'course'), 'user_status_' . _CUS_END, 'user_status[' . _CUS_END . ']', _CUS_END, $course['userStatusOp'] & 1 << _CUS_END) . Form::getCheckbox(Lang::t('_USER_STATUS_SUSPEND', 'course'), 'user_status_' . _CUS_SUSPEND, 'user_status[' . _CUS_SUSPEND . ']', _CUS_SUSPEND, $course['userStatusOp'] & 1 << _CUS_SUSPEND) . Form::getCloseCombo() . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_TIME_OPTION', 'course')) . Form::getDatefield(Lang::t('_DATE_BEGIN', 'course'), 'course_date_begin', 'course_date_begin', $course['date_begin']) . Form::getDatefield(Lang::t('_DATE_END', 'course'), 'course_date_end', 'course_date_end', $course['date_end']) . Form::getLineBox('<label for="hour_begin_hour">' . Lang::t('_HOUR_BEGIN', 'course') . '</label>', Form::getInputDropdown('dropdown_nw', 'hour_begin_hour', 'hour_begin[hour]', $hours, $hb_sel, '') . ' : ' . Form::getInputDropdown('dropdown_nw', 'hour_begin_quarter', 'hour_begin[quarter]', $quarter, $qe_sel, '')) . Form::getLineBox('<label for="hour_end_hour">' . Lang::t('_HOUR_END', 'course') . '</label>', Form::getInputDropdown('dropdown_nw', 'hour_end_hour', 'hour_end[hour]', $hours, $he_sel, '') . ' : ' . Form::getInputDropdown('dropdown_nw', 'hour_end_quarter', 'hour_end[quarter]', $quarter, $qe_sel, '')) . Form::getTextfield(Lang::t('_DAY_OF_VALIDITY', 'course'), 'course_day_of', 'course_day_of', '10', $course['valid_time']) . Form::getTextfield(Lang::t('_MEDIUM_TIME', 'course'), 'course_medium_time', 'course_medium_time', '10', $course['mediumTime']) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_COURSE_SPECIAL_OPTION', 'course')) . Form::getTextfield(Lang::t('_MIN_NUM_SUBSCRIBE', 'course'), 'min_num_subscribe', 'min_num_subscribe', '11', $course['min_num_subscribe']) . Form::getTextfield(Lang::t('_MAX_NUM_SUBSCRIBE', 'course'), 'max_num_subscribe', 'max_num_subscribe', '11', $course['max_num_subscribe']) . Form::getCheckbox(Lang::t('_ALLOW_OVERBOOKING', 'course'), 'allow_overbooking', 'allow_overbooking', '1', $course['allow_overbooking'] == 1) . Form::getTextfield(Lang::t('_COURSE_QUOTA', 'course'), 'course_quota', 'course_quota', '11', $course['course_quota'] != COURSE_QUOTA_INHERIT ? $course['course_quota'] : 0) . Form::getCheckbox(Lang::t('_INHERIT_QUOTA', 'course'), 'inherit_quota', 'inherit_quota', '1', $course['course_quota'] == COURSE_QUOTA_INHERIT) . Form::getCloseFieldset() . Form::openCollasableFieldset(Lang::t('_DOCUMENT_UPLOAD', 'course')) . Form::getTextfield(Lang::t('_SPONSOR_LINK', 'course'), 'course_sponsor_link', 'course_sponsor_link', '255', $course['linkSponsor']) . Form::getExtendedFilefield(Lang::t('_PATHSPONSOR', 'configuration'), 'course_sponsor_logo', 'course_sponsor_logo', $course["imgSponsor"]) . Form::getExtendedFilefield(Lang::t('_COURSE_LOGO', 'course'), 'course_logo', 'course_logo', $course["img_course"]) . Form::getExtendedFilefield(Lang::t('_COURSE_DEMO', 'course'), 'course_demo', 'course_demo', $course["course_demo"]) . Form::getCheckbox(Lang::t('_USE_LOGO_IN_COURSELIST', 'course'), 'use_logo_in_courselist', 'use_logo_in_courselist', 1, $course["use_logo_in_courselist"]) . Form::getCloseFieldset() . Form::closeElementSpace() . Form::openButtonSpace() . ($_REQUEST['r'] == 'alms/course/newcourse' || $_REQUEST['r'] == 'alms/course/modcourse' && $row[0] == 0 ? Form::getCheckbox(Lang::t('_AUTO_SUBSCRIPTION'), 'auto_subscription', 'auto_subscription', '1', true) : '') . Form::getButton('save', 'save', Lang::t('_SAVE')) . Form::getButton('undo', 'undo', Lang::t('_UNDO')) . Form::closeButtonSpace() . Form::closeForm();
?>
</div>
<script type="text/javascript">
var D = YAHOO.util.Dom, E = YAHOO.util.Event;
E.onDOMReady(function() {
	var c = D.get("use_unsubscribe_date_limit"), d = D.get("unsubscribe_date_limit");
	E.addListener("no_user_unsubscription", "click", function(e) {
		var checked = this.checked;
		c.disabled = checked;
		d.disabled = checked;
	});
	E.addListener("moderated_user_unsubscription", "click", function(e) {
		var checked = this.checked;
		c.disabled = !checked;
		d.disabled = !checked;
function create_report_cols()
{
    checkPerm('mod');
    require_once _base_ . '/lib/lib.form.php';
    $ref =& $_SESSION['report_tempdata']['columns_filter_category'];
    if (isset($_POST['columns_filter'])) {
        $ref = $_POST['columns_filter'];
    }
    $lang =& DoceboLanguage::createInstance('report');
    $obj_report = openreport();
    $obj_report->back_url = 'index.php?modname=public_report_admin&op=create_type';
    $obj_report->jump_url = 'index.php?modname=public_report_admin&op=create_cols';
    $obj_report->next_url = 'index.php?modname=public_report_admin&op=create_save';
    //page title
    $page_title = getTitleArea(array('index.php?modname=public_report_admin&amp;op=reportlist' => $lang->def('_REPORT'), 'index.php?modname=public_report_admin&amp;op=create_name' => $lang->def('_NEW'), 'index.php?modname=public_report_admin&amp;op=create_rows' => $lang->def('_REPORT_SEL_ROWS'), 'index.php?modname=public_report_admin&amp;op=create_type' => $lang->def('_REPORT_SEL_COLUMNS'), $lang->def('_REPORT_COLUMNS'))) . '<div class="std_block">';
    //.  	getBackUi($obj_report->back_url, $lang->def('_BACK'), 'content');
    if ($obj_report->useStandardTitle_Columns()) {
        $GLOBALS['page']->add($page_title, 'content');
        $GLOBALS['page']->add(Form::openForm('report_columns_form', str_replace('&', '&amp;', $obj_report->jump_url)), 'content');
    } else {
        //this is used just to pass std title string to object functions, who may use it
        $obj_report->page_title = $page_title;
    }
    $output = $obj_report->get_columns_filter($_SESSION['report_tempdata']['columns_filter_category']);
    $GLOBALS['page']->add($output, 'content');
    if ($obj_report->useStandardTitle_Columns()) {
        $GLOBALS['page']->add(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', 'report')) . Form::getButton('show_filter', 'show_filter', $lang->def('_SAVE_SHOW', 'report')) . Form::getButton('undo_filter', 'undo_filter', $lang->def('_UNDO', 'report')) . Form::closeButtonSpace() . Form::closeForm(), 'content');
        $GLOBALS['page']->add('</div>', 'content');
        //close std_block div
    }
}
Example #27
0
function adminManager_assignCmsContent($admin_idst)
{
    checkPerm('view');
    if ($admin_idst < 1) {
        return FALSE;
    }
    if (isset($_POST["save"])) {
        adminManager_saveCmsContent($admin_idst);
        die;
    }
    require_once _base_ . '/lib/lib.form.php';
    require_once $GLOBALS["where_cms"] . "/lib/lib.tree_perm.php";
    require_once $GLOBALS["where_cms"] . "/admin/modules/content/class.content_selector.php";
    $res = "";
    $out =& $GLOBALS["page"];
    $out->setWorkingZone("content");
    $lang =& DoceboLanguage::createInstance("admin_manager", "framework");
    $form = new Form();
    $ctp = new CmsTreePermissions("content");
    addCss("base-old-treeview", "cms");
    $res .= getTitleArea($lang->def('_ADMIN_MANAGMENT'), 'admin_managmer', $lang->def('_ADMIN_MANAGMENT'));
    $res .= "<div class=\"std_block\">\n";
    $tree = new contentDb();
    $content_sel = new Selector_Content_TreeView($tree, FALSE);
    $content_sel->parsePositionData($_POST, $_POST, $_POST);
    $content_sel->setNodePerm($ctp->loadAllNodePerm($admin_idst));
    $url = "index.php?modname=admin_manager&amp;op=assign_cmscontent&amp;adminidst=" . $admin_idst;
    $res .= $form->openForm("main_form", $url);
    $res .= $content_sel->load();
    $res .= $form->openButtonSpace();
    $res .= $form->getButton('save', 'save', $lang->def('_SAVE'));
    $res .= $form->getButton('undo_pref', 'undo_pref', $lang->def('_UNDO'));
    $res .= $form->closeButtonSpace();
    $res .= $form->closeForm();
    $res .= "</div>\n";
    $out->add($res);
}
Example #28
0
function searchUser(&$url)
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php';
    $lang =& DoceboLanguage::createInstance('myfriends', 'lms');
    $my_fr = new MyFriends(getLogUserId());
    $acl_man =& Docebo::user()->getAclManager();
    $GLOBALS['page']->add(getTitleArea(array($url->getUrl() => $lang->def('_MY_FRIENDS'), $lang->def('_SEARCH_USER')), 'myfriends') . '<div class="std_block">', 'content');
    if (isset($_POST['send'])) {
        if ($my_fr->addFriend($_POST['id_friend'], MF_WAITING, $_POST['request'])) {
            Util::jump_to($url->getUrl('result=ok_del'));
        }
        $GLOBALS['page']->add(getErrorUi($lang->def('_ERR_REMOVE_FRIEND')));
    } elseif (isset($_GET['id_friend'])) {
        $GLOBALS['page']->add(Form::openForm('send_request', $url->getUrl('op=searchuser')) . Form::getHidden('id_friend', 'id_friend', $_GET['id_friend']) . Form::openElementSpace() . Form::getTextarea($lang->def('_REQUEST_MESSAGE'), 'request', 'request') . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('send', 'send', $lang->def('_SEND_REQUEST')) . Form::getButton('back_search', 'back_search', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
        return;
    }
    $GLOBALS['page']->add(Form::openForm('', $url->getUrl('op=searchuser')) . Form::getOpenFieldset($lang->def('_SEARCH_USER')) . Form::getTextfield($lang->def('_SEARCH_USERNAME'), 'username', 'username', 255, importVar('username', false, '')) . Form::openButtonSpace() . Form::getButton('search', 'search', $lang->def('_SEARCH')) . Form::getButton('undo', 'undo', $lang->def('_UNDO')) . Form::closeButtonSpace() . Form::getCloseFieldset() . Form::closeForm(), 'content');
    if (isset($_POST['username'])) {
        $finded_user = $acl_man->getUser(false, $acl_man->absoluteId($_POST['username']));
        if ($finded_user === false) {
            $GLOBALS['page']->add($lang->def('_NO_USER_FINDED'), 'content');
        } else {
            require_once _base_ . '/lib/lib.user_profile.php';
            if (getLogUserId() != $finded_user[ACL_INFO_IDST]) {
                $GLOBALS['page']->add('<p class="confirm_friend">' . '<a href="' . $url->getUrl('op=searchuser&id_friend=' . $finded_user[ACL_INFO_IDST] . '') . '">' . $lang->def('_ADD_TO_MY_FIREND') . '</a>' . '</p>', 'content');
            }
            $profile = new UserProfile($finded_user[ACL_INFO_IDST]);
            $profile->init('profile', 'framework', 'modname=myfriends&op=searchuser', 'ap');
            $GLOBALS['page']->add($profile->getUserInfo(), 'content');
        }
    }
    $GLOBALS['page']->add('</div>', 'content');
}
echo $id;
?>
").value = <?php 
echo $_varname;
?>
.filterText;
}
</script>
<?php 
if ($use_form_input && $separate_input) {
    echo '<input type="hidden" id="userselector_input_' . $id . '_fncrole" name="userselector_input[' . $id . '][fncrole]" value="" />';
}
?>
<div class="quick_search_form">
	<div>
		<div class="simple_search_box" id="fncroleselector_simple_filter_options">
			<?php 
echo Form::getInputTextfield("search_t", "fncrole_filter_text_" . $id, "filter_text", $filter_text, '', 255, '');
echo Form::getButton("fncrole_filter_set_" . $id, "filter_set", Lang::t('_SEARCH', 'standard'), "search_b");
echo Form::getButton("fncrole_filter_reset_" . $id, "filter_reset", Lang::t('_RESET', 'standard'), "reset_b");
echo '<div id="fncrole_filter_text_' . $id . '_container"></div>';
?>
		</div>
	</div>
</div>
<?php 
$rel_action_over = '<span>' . '<b id="num_fncroles_selected_top_' . $id . '">' . (int) (isset($num_fncroles_selected) ? $num_fncroles_selected : '0') . '</b> ' . Lang::t('_SELECTED', 'fncroles') . '</span>';
$rel_action_bottom = '<span>' . '<b id="num_fncroles_selected_bottom_' . $id . '">' . (int) (isset($num_fncroles_selected) ? $num_fncroles_selected : '0') . '</b> ' . Lang::t('_SELECTED', 'fncroles') . '</span>';
$columns = array(array('key' => 'name', 'label' => Lang::t('_NAME', 'fncroles'), 'sortable' => true, 'formatter' => $_varname . '.labelFormatter'), array('key' => 'group', 'label' => Lang::t('_GROUPS', 'standard'), 'sortable' => true, 'formatter' => $_varname . '.labelFormatter'), array('key' => 'description', 'label' => Lang::t('_DESCRIPTION', 'standard'), 'sortable' => true, 'formatter' => $_varname . '.labelFormatter'), array('key' => 'users', 'label' => Lang::t('_USERS', 'standard'), 'className' => 'img-cell'));
$params = array('id' => 'fncrole_selector_table_' . $id, 'ajaxUrl' => 'ajax.adm_server.php?r=widget/userselector/getfncroletabledata', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'name', 'dir' => 'asc', 'columns' => $columns, 'fields' => array('id', 'name', 'description', 'group', 'users'), 'generateRequest' => $_varname . '.requestBuilder', 'stdSelection' => true, 'stdSelectionField' => '_checked', 'selectAllAdditionalFilter' => $_varname . '.selectAllAdditionalFilter', 'rel_actions' => array($rel_action_over, $rel_action_bottom), 'events' => array('initEvent' => '_fncroleSelectorInitEvent'), 'initialSelection' => isset($initial_selection) && is_array($initial_selection) ? $initial_selection : array());
$this->widget('table', $params);
Example #30
0
function ioTask_UITaskRun(&$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();
    $dimport = new DoceboImport();
    $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_RUNNED')));
    $out->add($form->openForm('task_delete', 'index.php?modname=iotask&op=display&gotab=tasks'));
    $out->add($form->openElementSpace());
    $out->add($form->getHidden('task_name', 'task_name', $task_name));
    $report = $dimport->execute_task($task_name);
    if (!is_array($report)) {
        $out->add($report);
    } else {
        $out->add($form->getLineBox($lang->def('_TASK_INSERTED'), $report[0]['inserted']));
        $out->add($form->getLineBox($lang->def('_OPERATION_SUCCESSFUL'), $report[0]['removed']));
        $out->add($form->getLineBox($lang->def('_OPERATION_FAILURE'), count($report) - 1));
        foreach ($report as $index => $elem_report) {
            if ($index !== 0) {
                $out->add($index . ' - ' . '(' . implode(', ', $report[$index][0]) . ')' . ' - ' . $report[$index][1]);
            }
        }
    }
    $out->add($form->closeElementSpace());
    $out->add($form->openButtonSpace());
    $out->add($form->getButton('close', 'close', $lang->def('_CLOSE')));
    $out->add($form->closeButtonSpace());
    $out->add($form->closeForm());
    $out->add('</div>');
}