コード例 #1
0
ファイル: do.poll.php プロジェクト: abhinay100/forma_app
function intro($object_poll, $id_param)
{
    //-kb-play-// if(!checkPerm('view', true, 'organization') && !checkPerm('view', true, 'storage')) die("You can't access");
    require_once _base_ . '/lib/lib.form.php';
    require_once $GLOBALS['where_lms'] . '/class.module/track.poll.php';
    require_once $GLOBALS['where_lms'] . '/lib/lib.param.php';
    require_once $GLOBALS['where_lms'] . '/lib/lib.poll.php';
    $lang =& DoceboLanguage::createInstance('poll');
    $id_poll = $object_poll->getId();
    $id_reference = getLoParam($id_param, 'idReference');
    $url_coded = urlencode(serialize($object_poll->back_url));
    $id_track = retriveTrack($id_reference, $id_poll, getLogUserId());
    $poll_man = new PollManagement($id_poll);
    $play_man = new PlayPollManagement($id_poll, getLogUserId(), $id_track, $poll_man);
    $poll_info = $poll_man->getPollAllInfo();
    $page_title = array(Util::str_replace_once('&', '&', $object_poll->back_url) => $lang->def('_TITLE'), $poll_info['title']);
    $GLOBALS['page']->add(getTitleArea($page_title, 'poll') . '<div class="std_block">' . getBackUi(Util::str_replace_once('&', '&amp;', $object_poll->back_url), $lang->def('_BACK')) . '<b>' . $lang->def('_TITLE') . ' : ' . $poll_info['title'] . '</b><br /><br />' . '<span class="text_bold">' . $lang->def('_DESCRIPTION') . ' : </span>' . $poll_info['description'] . '<br /><br />', 'content');
    $GLOBALS['page']->add(Form::openForm('poll_intro', 'index.php?modname=poll&amp;op=play') . Form::getHidden('id_poll', 'id_poll', $id_poll) . Form::getHidden('id_param', 'id_param', $id_param) . Form::getHidden('id_track', 'id_track', $id_track) . Form::getHidden('back_url', 'back_url', $url_coded) . Form::getHidden('next_step', 'next_step', 'play') . '<div class="align_right">', 'content');
    // Actions
    $score_status = $play_man->getStatus();
    $quest_number = $poll_man->getTotalQuestionNumber();
    if ($quest_number == 0) {
        $GLOBALS['page']->add($lang->def('_NO_QUESTION_IN_POLL'), 'content');
    } elseif ($id_track !== false && $score_status == 'valid') {
        $GLOBALS['page']->add($lang->def('_POLL_ALREDY_VOTED'), 'content');
    } else {
        $GLOBALS['page']->add(Form::getButton('begin', 'begin', $lang->def('_POLL_BEGIN')), 'content');
    }
    $GLOBALS['page']->add('</div>' . Form::closeForm() . '</div>', 'content');
}
コード例 #2
0
ファイル: htmlfront.php プロジェクト: abhinay100/forma_app
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');
}
コード例 #3
0
 /**
  * function create()
  *
  * @param $back_url	the url where the function retutn at the end of the operation
  * @return nothing
  */
 function create($id_poll, $back_poll)
 {
     if (!sql_query("\r\n\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_pollquest \r\n\t\t( id_poll, type_quest, title_quest, sequence, page ) VALUES \r\n\t\t( \t'" . $id_poll . "', \r\n\t\t\t'" . $this->getQuestionType() . "', \r\n\t\t\t'<span class=\"text_bold\">" . Lang::t('_QUEST_BREAK_PAGE') . "</span>',\r\n\t\t\t'" . $this->_getNextSequence($id_poll) . "', \r\n\t\t\t'" . $this->_getPageNumber($id_poll) . "' ) ")) {
         errorCommunication(def('_POLL_ERR_INS_QUEST') . getBackUi(Util::str_replace_once('&', '&amp;', $back_poll), Lang::t('_BACK')));
     }
     Util::jump_to('' . $back_poll);
 }
コード例 #4
0
 /**
  * function create()
  *
  * @param $back_url	the url where the function retutn at the end of the operation
  * @return nothing
  */
 function create($idTest, $back_test)
 {
     if (!sql_query("\r\n\t\tINSERT INTO " . $GLOBALS['prefix_lms'] . "_testquest \r\n\t\t( idTest, type_quest, title_quest, sequence, page, difficult ) VALUES \r\n\t\t( \t'" . $idTest . "', \r\n\t\t\t'" . $this->getQuestionType() . "', \r\n\t\t\t'<span class=\"text_bold\">" . Lang::t('_QUEST_BREAK_PAGE') . "</span>',\r\n\t\t\t'" . $this->_getNextSequence($idTest) . "', \r\n\t\t\t'" . $this->_getPageNumber($idTest) . "',\r\n\t\t\t'0') ")) {
         errorCommunication(def('_OPERATION_FAILURE') . getBackUi(Util::str_replace_once('&', '&amp;', $back_test), Lang::t('_BACK')));
     }
     Util::jump_to('' . $back_test);
 }
コード例 #5
0
ファイル: item.php プロジェクト: abhinay100/forma_app
 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');
 }
コード例 #6
0
ファイル: do.link.php プロジェクト: abhinay100/forma_app
    function play($object_link, $id_param)
    {
        //-kb-play-// if(!checkPerm('view', true, 'organization') && !checkPerm('view', true, 'storage')) die("You can't access");
        $lang =& DoceboLanguage::createInstance('link');
        $idCategory = $object_link->getId();
        $mode = importVar('mode', false, 'link');
        $back_coded = htmlentities(urlencode($object_link->back_url));
        require_once $GLOBALS['where_lms'] . '/lib/lib.param.php';
        $idReference = getLOParam($id_param, 'idReference');
        // NOTE: Track only if $idReference is present
        if ($idReference !== FALSE) {
            require_once $GLOBALS['where_lms'] . '/class.module/track.link.php';
            list($exist, $idTrack) = Track_Link::getIdTrack($idReference, getLogUserId(), $idCategory, TRUE);
            if ($exist) {
                $ti = new Track_Link($idTrack);
                $ti->setDate(date('Y-m-d H:i:s'));
                $ti->status = 'completed';
                $ti->update();
            } else {
                $ti = new Track_Link(false);
                $ti->createTrack($idReference, $idTrack, getLogUserId(), date('Y-m-d H:i:s'), 'completed', 'link');
            }
        }
        list($title) = sql_fetch_row(sql_query("\r\n\tSELECT title \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_link_cat \r\n\tWHERE idCategory = '" . (int) $idCategory . "'"));
        $link = 'index.php?modname=link&amp;op=play&amp;idCategory=' . $idCategory . '&amp;id_param=' . $id_param . '&amp;back_url=' . $back_coded;
        /*$GLOBALS['page']->add('<div id="top" class="std_block">'
        		.'<div class="colum_container">' */
        cout('<div id="top" class="yui-navset yui-navset-top tab_block">
		<ul class="yui-nav">
			<li class="first' . ($mode != 'keyw' ? ' selected' : '') . '">
				<a href="' . $link . '&amp;mode=list">
					<em>' . Lang::t('_SWITCH_TO_LIST', 'link') . '</em>
				</a>
			</li>
			<li' . ($mode == 'keyw' ? ' class="selected"' : '') . '>
				<a href="' . $link . '&amp;mode=keyw">
					<em>' . Lang::t('_SWITCH_TO_KEYWORD', 'link') . '</em>
				</a>
			</li>
		</ul>
		<div class="yui-content">', 'content');
        cout(getBackUi(Util::str_replace_once('&', '&amp;', $object_link->back_url), $lang->def('_BACK')), 'content');
        $GLOBALS['page']->add('<b>' . $lang->def('_TITLE') . ' : ' . $title . '</b><br /><br />' . $lang->def('_LINKIUNNEWWINDOW') . '<br /><br />', 'content');
        if ($mode == 'keyw') {
            displayAsKey($idCategory, $link . '&amp;mode=keyw');
        } else {
            displayAsList($idCategory);
        }
        $GLOBALS['page']->add('<div class="align_center">' . '<a href="#top"><img src="' . getPathImage() . 'standard/up.png" title="' . $lang->def('_BACKTOTOP') . '" />' . $lang->def('_BACKTOTOP') . '</a>' . getBackUi(Util::str_replace_once('&', '&amp;', $object_link->back_url), $lang->def('_BACK')) . '</div>', 'content');
        cout('</div></div>', 'content');
    }
コード例 #7
0
ファイル: class.title.php プロジェクト: abhinay100/forma_app
 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');
 }
コード例 #8
0
 protected function _profileBackUrl()
 {
     $id_user = Get::req('id_user', DOTY_INT, 0);
     $type = Get::req('type', DOTY_STRING, 'false');
     $from = Get::req('from', DOTY_INT, 0);
     $back_my_friend = Get::req('back', DOTY_INT, 0);
     if ($type !== 'false') {
         if ($from == 0) {
             return getBackUi('index.php?modname=profile&op=profile&id_user='******'&ap=goprofile', Lang::t('_BACK', 'standard'));
         } else {
             return getBackUi('index.php?modname=myfiles&op=myfiles&working_area=' . $type, Lang::t('_BACK', 'standard'));
         }
     }
     if ($back_my_friend) {
         return getBackUi('index.php?modname=myfriends&op=myfriends', Lang::t('_BACK', 'standard'));
     }
     return false;
 }
コード例 #9
0
ファイル: profile.php プロジェクト: abhinay100/forma_app
function profileBackUrl()
{
    $lang =& DoceboLanguage::createInstance('profile', 'framework');
    $id_user = importVar('id_user', true, 0);
    $type = importVar('type', false, 'false');
    $from = importVar('from', true, 0);
    $back_my_friend = importVar('back', true, 0);
    if ($type !== 'false') {
        if ($from == 0) {
            return getBackUi('index.php?modname=profile&op=profile&id_user='******'&ap=goprofile', '<< ' . $lang->def('_BACK') . '');
        } else {
            return getBackUi('index.php?modname=myfiles&op=myfiles&working_area=' . $type, '<< ' . $lang->def('_BACK') . '');
        }
    }
    if ($back_my_friend) {
        return getBackUi('index.php?modname=myfriends&op=myfriends', '<< ' . $lang->def('_BACK'));
    }
    return false;
}
コード例 #10
0
ファイル: htmlpage.php プロジェクト: abhinay100/forma_app
 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');
 }
コード例 #11
0
ファイル: conference.php プロジェクト: abhinay100/forma_app
function showLog()
{
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    $lang =& DoceboLanguage::createInstance('conference', 'lms');
    $id = Get::req('id', DOTY_INT, 0);
    $conference = new Conference_Manager();
    $room_info = $conference->roomInfo($id);
    $acl_man =& Docebo::user()->getAclManager();
    cout(getTitleArea('') . '<div class="std_block">', 'content');
    $room_log = array();
    switch ($room_info['room_type']) {
        case 'teleskill':
            require_once $GLOBALS['where_scs'] . '/lib/lib.teleskill.php';
            $teleskill = new Teleskill_Management();
            $roomid = $teleskill->getRoomId($id);
            if (isset($_POST['update_log'])) {
                $teleskill->updateRoomLog($roomid);
            }
            $room_log = $teleskill->getRoomLog($roomid);
            break;
    }
    $tb = new Table(0, $lang->def('_ROOM_LOG'), $lang->def('_ROOM_LOG'));
    $cont_h = array($lang->def('_FULLNAME'), $lang->def('_ROLE'), $lang->def('_DATE'), $lang->def('_TOTAL_TIME'), $lang->def('_NUMBER_OF_ACCESS'));
    $type_h = array('', '', '', '', '');
    $tb->setColsStyle($type_h);
    $tb->addHead($cont_h);
    foreach ($room_log as $log_row) {
        $user_info = $acl_man->getUser($log_row['idUser'], false);
        $cont = array();
        if ($user_info[ACL_INFO_FIRSTNAME] !== '' && $user_info[ACL_INFO_LASTNAME]) {
            $cont[] = $user_info[ACL_INFO_FIRSTNAME] . ' ' . $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')';
        } elseif ($user_info[ACL_INFO_FIRSTNAME] !== '') {
            $cont[] = $user_info[ACL_INFO_FIRSTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')';
        } elseif ($user_info[ACL_INFO_LASTNAME] !== '') {
            $cont[] = $user_info[ACL_INFO_LASTNAME] . ' (' . $acl_man->relativeId($user_info[ACL_INFO_USERID]) . ')';
        } else {
            $cont[] = $acl_man->relativeId($user_info[ACL_INFO_USERID]);
        }
        $cont[] = $log_row['role'] == 1 ? $lang->def('_USER_ROLE') : $lang->def('_TUTOR_ROLE');
        $cont[] = Format::date($log_row['date'], 'datetime');
        $duration_s = 0;
        $duration_m = 0;
        $duration_h = 0;
        $duration = $log_row['duration'];
        $duration_s = $duration % 60;
        $duration -= $duration_s;
        if ($duration) {
            $duration_m = $duration % 3600 / 60;
            $duration -= $duration_m * 60;
            if ($duration) {
                $duration_h = $duration / 3600;
            }
        }
        $cont[] = $duration_h . ' ' . $lang->def('_HOURS') . ' ' . $duration_m . ' ' . $lang->def('_MINUTS') . ' ' . $duration_s . ' ' . $lang->def('_SECONDS');
        $cont[] = $log_row['access'];
        $tb->addBody($cont);
    }
    $tb->addActionAdd(Form::getButton('update_log', 'update_log', $lang->def('_UPDATE_LOG')));
    cout(Form::openForm('log_table', 'index.php?modname=conference&amp;op=log&amp;id=' . $id) . $tb->getTable() . Form::closeForm() . '<br/>' . getBackUi('index.php?modname=conference&amp;op=history', $lang->def('_BACK')), 'content');
    cout('</div>', 'content');
}
コード例 #12
0
 function LOSelector($module, $back_url)
 {
     $query = "SELECT objectType FROM " . $GLOBALS['prefix_lms'] . "_lo_types";
     $rs = sql_query($query) or die('Table _lo_types not present');
     $out = '<div class="std_block">';
     $out .= '<div class="title">' . Lang::t('_SELECTLO', 'storage', 'lms') . '</div><br />';
     $out .= getBackUi(Util::str_replace_once('&', '&amp;', $back_url), Lang::t('_BACK'));
     $out .= '<form id="LOSelector" method="post" action="index.php?modname=' . $module . '&amp;op=display&amp;' . $this->_getOpCreateLOSel() . '=1" >' . '<input type="hidden" id="authentic_request_lo" name="authentic_request" value="' . Util::getSignature() . '" />';
     $first = TRUE;
     while (list($objectType) = sql_fetch_row($rs)) {
         $out .= '<label for="' . $objectType . '"><img src="' . getPathImage() . 'lobject/' . $objectType . '.gif" alt="' . $objectType . '" ' . 'title="' . $objectType . '" /></label>';
         if ($first) {
             $out .= '<input type="radio" name="radiolo" value="' . $objectType . '" id="' . $objectType . '" checked="true"/>';
         } else {
             $out .= '<input type="radio" name="radiolo" value="' . $objectType . '" id="' . $objectType . '"/>';
         }
         $out .= '<label for="' . $objectType . '">' . Lang::t('_LONAME_' . $objectType) . '</label>' . '<br />';
         $first = FALSE;
     }
     $out .= $this->printState();
     $out .= '<br /><input type="submit" class="button" value="' . Lang::t('_REPOCREATELO') . '" name="' . $this->_getOpCreateLOSel() . '"/>';
     $out .= '</form>';
     $out .= '</div>';
     return $out;
 }
コード例 #13
0
ファイル: notes.php プロジェクト: abhinay100/forma_app
 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');
 }
コード例 #14
0
 /**
  * this function modify a question
  *
  * @param  string	$back_poll	indicates the return url
  * @return nothing
  *
  * @access public
  * @author Fabio Pirovano (fabio@docebo.com)
  */
 function edit($back_poll)
 {
     $lang =& DoceboLanguage::createInstance('poll');
     require_once _base_ . '/lib/lib.form.php';
     $url_encode = htmlentities(urlencode($back_poll));
     //manage number of answer
     if (isset($_POST['save_question'])) {
         //update question
         $ins_query = "\r\n\t\t\tUPDATE " . $GLOBALS['prefix_lms'] . "_pollquest\r\n\t\t\tSET id_category = '" . (int) $_POST['id_category'] . "',\r\n\t\t\t\ttype_quest = '" . $this->getQuestionType() . "',\r\n\t\t\t\ttitle_quest = '" . $_POST['title_quest'] . "'\r\n\t\t\tWHERE id_quest = '" . (int) $this->id . "'";
         if (!sql_query($ins_query)) {
             getErrorUi($lang->def('_POLL_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')));
         }
         //update answer
         if (!isset($_POST['is_correct'])) {
             $_POST['is_correct'] = -1;
         }
         $min_value = Get::req('min_value', DOTY_INT, 0);
         $max_value = Get::req('max_value', DOTY_INT, 0);
         $step_value = (double) str_replace(',', '.', $_POST['step_value']);
         if ($min_value >= $max_value || $step_value == 0) {
             $GLOBALS['page']->add(getErrorUi($lang->def('_POLL_ERR_INS_ANSWER') . getBackUi(str_replace('&', '&amp;', $back_poll), $lang->def('_BACK'))), 'content');
         } else {
             $del_answer_query = "DELETE FROM " . $GLOBALS['prefix_lms'] . "_pollquestanswer\r\n\t\t\t\t\t\t\t\t\tWHERE id_quest = '" . (int) $this->id . "'";
             if (!sql_query($del_answer_query)) {
                 getErrorUi($lang->def('_POLL_ERR_INS_ANSWER') . getBackUi(str_replace('&', '&amp;', $back_poll), $lang->def('_BACK')));
             } else {
                 $query = "INSERT INTO " . $GLOBALS['prefix_lms'] . "_pollquestanswer" . " (id_quest, answer, sequence)" . " VALUES ('" . $this->id . "', '" . $min_value . "', '0')," . " ('" . $this->id . "', '" . $max_value . "', '1')," . " ('" . $this->id . "', '" . $step_value . "', '2');";
                 if (!sql_query($query)) {
                     getErrorUi($lang->def('_POLL_ERR_INS_ANSWER') . getBackUi(str_replace('&', '&amp;', $back_poll), $lang->def('_BACK')));
                 } else {
                     Util::jump_to($back_poll);
                 }
             }
         }
     }
     //insert form
     require_once _lms_ . '/lib/lib.questcategory.php';
     $categories = Questcategory::getCategory();
     //writing difficult
     //load data
     list($sel_cat, $quest) = sql_fetch_row(sql_query("\r\n\t\tSELECT id_category, title_quest\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquest\r\n\t\tWHERE id_quest = '" . (int) $this->id . "'"));
     $re_answer = sql_query("\r\n\t\tSELECT id_answer, answer\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_pollquestanswer\r\n\t\tWHERE id_quest = '" . (int) $this->id . "'\r\n\t\tORDER BY sequence");
     $array_answer = array();
     while (list($id_answer, $answer) = sql_fetch_row($re_answer)) {
         $array_answer[] = $answer;
     }
     if (!empty($array_answer)) {
         $min_value = $array_answer[0];
         $max_value = $array_answer[1];
         $step_value = $array_answer[2];
     } else {
         $min_value = '';
         $max_value = '';
         $step_value = '1';
     }
     $GLOBALS['page']->add(getTitleArea($lang->def('_POLL_SECTION'), 'poll') . '<div class="std_block">' . getBackUi(str_replace('&', '&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_add_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', isset($_POST['title_quest']) ? stripslashes($_POST['title_quest']) : $quest) . Form::getDropdown($lang->def('_CATEGORY'), 'id_category', 'id_category', $categories, isset($_POST['id_category']) ? $_POST['id_category'] : $sel_cat) . '<div class="no_float"></div><br />' . Form::getTextfield($lang->def('_MIN_VALUE'), 'min_value', 'min_value', 255, $min_value) . Form::getTextfield($lang->def('_MAX_VALUE'), 'max_value', 'max_value', 255, $max_value) . Form::getTextfield($lang->def('_STEP_VALUE'), 'step_value', 'step_value', 255, $step_value), 'content');
     $GLOBALS['page']->add(Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('save_question', 'save_question', $lang->def('_SAVE')) . Form::closeButtonSpace() . Form::closeForm() . '</div>', 'content');
 }
コード例 #15
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');
 }
コード例 #16
0
 /**
  * this function manage a field
  *
  * @param  string	$back	indicates the return url
  * @return nothing
  *
  * @access public
  */
 function edit($back)
 {
     $back_coded = htmlentities(urlencode($back));
     $array_lang = array();
     $std_lang =& DoceboLanguage::createInstance('standard');
     $lang =& DoceboLanguage::createInstance('field');
     $array_lang = Docebo::langManager()->getAllLangCode();
     $out =& $GLOBALS['page'];
     if (isset($_POST['undo'])) {
         //undo action
         Util::jump_to($back . '&result=undo');
     }
     if (isset($_POST['save_field_' . $this->getFieldType()])) {
         //insert mandatory translation
         $mand_lang = getLanguage();
         $show_on = '';
         if (isset($_POST['show_on_platform'])) {
             while (list($code, ) = each($_POST['show_on_platform'])) {
                 $show_on .= $code . ',';
             }
         }
         //control if all is ok
         if (!isset($_POST['new_freetext'][$mand_lang])) {
             $out->add(getErrorUi($lang->def('_ERR_MUST_DEF_MANADATORY_TRANSLATION')) . getBackUi($this->getUrl() . '&amp;type_field=' . $this->getFieldType() . '&amp;back=' . $back_coded, $std_lang->def('_BACK')), 'content');
             return;
         }
         if ($_POST['new_freetext'][$mand_lang] == $lang->def('_FIELD_NAME') || trim($_POST['new_freetext'][$mand_lang]) == '') {
             $out->add(getErrorUi($lang->def('_ERR_MUST_DEF_MANADATORY_TRANSLATION')) . getBackUi($this->getUrl() . '&amp;type_field=' . $this->getFieldType() . '&amp;back=' . $back_coded, $std_lang->def('_BACK')), 'content');
             return;
         }
         $existsing_translation = array();
         $re_trans = sql_query("\r\n\t\t\tSELECT lang_code\r\n\t\t\tFROM " . $this->_getMainTable() . "\r\n\t\t\tWHERE id_common = '" . $this->id_common . "'");
         while (list($l_code) = sql_fetch_row($re_trans)) {
             $existsing_translation[$l_code] = 1;
         }
         $use_multilang = isset($_POST['use_multi_lang']) ? 1 : 0;
         $re = true;
         //insert other field
         foreach ($_POST['new_freetext'] as $lang_code => $translation) {
             if (isset($existsing_translation[$lang_code])) {
                 if (!sql_query("\r\n\t\t\t\t\tUPDATE " . $this->_getMainTable() . "\r\n\t\t\t\t\tSET translation = '" . $translation . "',\r\n\t\t\t\t\t\tshow_on_platform = '" . $show_on . "',\r\n\t\t\t\t\t\tuse_multilang = '" . $use_multilang . "'\r\n\t\t\t\t\tWHERE id_common = '" . (int) $this->id_common . "' AND lang_code = '" . $lang_code . "'")) {
                     $re = false;
                 }
             } else {
                 if (!sql_query("\r\n\t\t\t\t\tINSERT INTO " . $this->_getMainTable() . "\r\n\t\t\t\t\t(type_field, id_common, lang_code, translation, show_on_platform, use_multilang) VALUES\r\n\t\t\t\t\t('" . $this->getFieldType() . "', '" . (int) $this->id_common . "', '" . $lang_code . "', '" . $translation . "', '" . $show_on . "', '" . $use_multilang . "') ")) {
                     $re = false;
                 }
             }
         }
         Util::jump_to($back . '&result=' . ($re ? 'success' : 'fail'));
     }
     //load value form database
     $re_trans = sql_query("\r\n\t\tSELECT lang_code, translation, show_on_platform, use_multilang\r\n\t\tFROM " . $this->_getMainTable() . "\r\n\t\tWHERE id_common = '" . $this->id_common . "'");
     while (list($l_code, $trans, $show_on, $db_use_multilang) = sql_fetch_row($re_trans)) {
         $translation[$l_code] = $trans;
         if (!isset($show_on_platform)) {
             $show_on_platform = array_flip(explode(',', $show_on));
         }
         if (!isset($use_multilang)) {
             $use_multilang = $db_use_multilang;
         }
     }
     require_once _base_ . '/lib/lib.form.php';
     $form = new Form();
     $out->setWorkingZone('content');
     $out->add('<div class="std_block">');
     $out->add($form->openForm('create_' . $this->getFieldType(), $this->getUrl()) . $form->openElementSpace() . $form->getHidden('type_field', 'type_field', $this->getFieldType()) . $form->getHidden('id_common', 'id_common', $this->id_common) . $form->getHidden('back', 'back', $back_coded));
     $mand_lang = getLanguage();
     foreach ($array_lang as $k => $lang_code) {
         $out->add($form->getTextfield(($mand_lang == $lang_code ? '<span class="mandatory">*</span>' : '') . $lang_code, 'new_freetext_' . $lang_code, 'new_freetext[' . $lang_code . ']', 255, isset($translation[$lang_code]) ? $translation[$lang_code] : '', $lang_code . ' ' . $lang->def('_FIELD_NAME')));
     }
     $GLOBALS['page']->add($this->getMultiLangCheck($use_multilang), 'content');
     $GLOBALS['page']->add($this->getShowOnPlatformFieldset($show_on_platform), 'content');
     $out->add($form->closeElementSpace() . $form->openButtonSpace() . $form->getButton('save_field', 'save_field_' . $this->getFieldType(), $std_lang->def('_SAVE', 'standard')) . $form->getButton('undo', 'undo', $std_lang->def('_UNDO', 'standard')) . $form->closeButtonSpace() . $form->closeForm());
     $out->add('</div>');
 }
コード例 #17
0
echo Form::openForm('classlocations_selection_form', 'index.php?r=adm/adminmanager/classlocations_set');
echo Form::getHidden('selection', 'selection', implode(",", $selection));
echo Form::getHidden('id_user', 'id_user', $id_user);
//--- SEARCH FILTER -------
$this->widget('tablefilter', array('id' => 'classlocations_filter', 'filter_text' => isset($filter_text) ? $filter_text : "", 'js_callback_set' => 'ClassLocations.setFilter', 'js_callback_reset' => 'ClassLocations.resetFilter'));
//--- TABLE -------
$rel_action_over = '<span class="ma_selected_users">' . '<b id="num_users_selected_top">' . (int) (isset($num_selected) ? $num_selected : '0') . '</b> ' . Lang::t('_SELECTED', 'admin_directory') . '</span>';
$rel_action_bottom = '<span class="ma_selected_users">' . '<b id="num_users_selected_bottom">' . (int) (isset($num_selected) ? $num_selected : '0') . '</b> ' . Lang::t('_SELECTED', 'admin_directory') . '</span>';
$_params = array('id' => 'classlocations_table', 'ajaxUrl' => 'ajax.adm_server.php?r=adm/adminmanager/getclasslocationstabledata', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'location', 'dir' => 'asc', 'generateRequest' => 'ClassLocations.requestBuilder', 'columns' => array(array('key' => 'location', 'label' => Lang::t('_LOCATION', 'lms'), 'sortable' => true, 'formatter' => 'ClassLocations.labelFormatter')), 'fields' => array('id', 'location'), 'stdSelection' => true, 'initialSelection' => $selection, 'rel_actions' => array($rel_action_over, $rel_action_bottom), 'events' => array('initEvent' => 'ClassLocations.initEvent'));
$this->widget('table', $_params);
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();
echo getBackUi('index.php?r=adm/adminmanager/show', Lang::t('_BACK', 'standard'));
?>
</div>
<script type="text/javascript">
var ClassLocations = {

	filterText: "",

	init: function(oConfig) {
		this.filterText = oConfig.filterText;

		YAHOO.util.Event.addListener("classlocations_selection_form", "submit", function() {
			YAHOO.util.Dom.get("selection").value = DataTableSelector_classlocations_table.toString();
		});
	},
コード例 #18
0
ファイル: catalogue.php プロジェクト: abhinay100/forma_app
 function entrylist()
 {
     checkPerm('view');
     require_once _base_ . '/lib/lib.table.php';
     require_once _base_ . '/lib/lib.form.php';
     require_once $GLOBALS['where_lms'] . '/lib/lib.coursepath.php';
     require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
     $lang =& DoceboLanguage::createInstance('catalogue', 'lms');
     $out =& $GLOBALS['page'];
     $id_cat = Get::req('id', DOTY_INT, 0);
     $cat_name = getCatalogueName($id_cat);
     $mod_perm = checkPerm('mod', true);
     $title_area = array('index.php?modname=catalogue&amp;op=catlist' => $lang->def('_CATALOGUE'), $cat_name);
     $tb_entry = new Table();
     $query_entry = "\r\n\tSELECT idEntry, type_of_entry\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue_entry\r\n\tWHERE idCatalogue = '" . $id_cat . "'";
     $re_entry = sql_query($query_entry);
     $courses = array();
     $coursepath = array();
     while (list($id, $t_o_entry) = sql_fetch_row($re_entry)) {
         if ($t_o_entry == 'course') {
             $courses[$id] = $id;
         } else {
             $coursepath[$id] = $id;
         }
     }
     $coursepath_man = new CoursePath_Manager();
     $coursespath_name =& $coursepath_man->getNames($coursepath);
     $course_name =& getCoursesInfo($courses);
     $cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_TYPE'));
     $type_h = array('', '', '');
     if ($mod_perm) {
         $type_h[] = 'image';
         $cont_h[] = '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
     }
     $tb_entry->setColsStyle($type_h);
     $tb_entry->addHead($cont_h);
     $all_courses = true;
     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;
         } elseif (isset($admin_courses['course'][-1])) {
             require_once _lms_ . '/lib/lib.catalogue.php';
             $cat_man = new Catalogue_Manager();
             $user_catalogue = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
             if (count($user_catalogue) > 0) {
                 $courses = array(0);
                 foreach ($user_catalogue as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
                     $courses = array_merge($courses, $catalogue_course);
                 }
                 foreach ($courses as $id_course) {
                     if ($id_course != 0) {
                         $admin_courses['course'][$id_course] = $id_course;
                     }
                 }
             } elseif (Get::sett('on_catalogue_empty', 'off') == 'on') {
                 $all_courses = true;
             }
         } else {
             $array_courses = array();
             $array_courses = array_merge($array_courses, $admin_courses['course']);
             if (!empty($admin_courses['coursepath'])) {
                 require_once _lms_ . '/lib/lib.coursepath.php';
                 $path_man = new Catalogue_Manager();
                 $coursepath_course =& $path_man->getAllCourses($admin_courses['coursepath']);
                 $array_courses = array_merge($array_courses, $coursepath_course);
             }
             if (!empty($admin_courses['catalogue'])) {
                 require_once _lms_ . '/lib/lib.catalogue.php';
                 $cat_man = new Catalogue_Manager();
                 foreach ($admin_courses['catalogue'] as $id_cat) {
                     $catalogue_course =& $cat_man->getCatalogueCourse($id_cat, true);
                     $array_courses = array_merge($array_courses, $catalogue_course);
                 }
             }
             $admin_courses['course'] = array_merge($admin_courses['course'], $array_courses);
         }
     }
     if (is_array($course_name)) {
         foreach ($course_name as $course) {
             $cont = array($course['code'], $course['name'], $lang->def('_COURSE'));
             if ($mod_perm) {
                 if (isset($admin_courses['course'][$course['id']]) || $all_courses) {
                     $cont[] = '<a href="index.php?modname=catalogue&amp;op=delentry&amp;id_cat=' . $id_cat . '&amp;type=course&amp;id_entry=' . $course['id'] . '" ' . 'title="' . $lang->def('_REMOVE_ENTRY') . ' : ' . strip_tags($course['name']) . '">' . '<img src="' . getPathImage('fw') . 'standard/delete.png" ' . 'alt="' . $lang->def('_DEL') . ' : ' . strip_tags($course['name']) . '" /></a>';
                 } else {
                     $cont[] = '';
                 }
             }
             $tb_entry->addBody($cont);
         }
     }
     if (is_array($coursespath_name)) {
         while (list($id, $coursepath) = each($coursespath_name)) {
             $cont = array($coursepath, $lang->def('_COURSEPATH'));
             // #bugfix 1141
             $tmp_code = $coursepath_man->getCoursepathInfo($id);
             $path_code = $tmp_code['path_code'];
             array_unshift($cont, $path_code);
             // end bugfix
             if ($mod_perm) {
                 if (isset($admin_courses['coursepath'][$id]) || $all_courses) {
                     $cont[] = '<a href="index.php?modname=catalogue&amp;op=delentry&amp;id_cat=' . $id_cat . '&amp;type=coursepath&amp;id_entry=' . $id . '" ' . 'title="' . $lang->def('_REMOVE_ENTRY') . ' : ' . strip_tags($coursepath) . '">' . '<img src="' . getPathImage('fw') . 'standard/delete.png" ' . 'alt="' . $lang->def('_DEL') . ' : ' . strip_tags($coursepath) . '" /></a>';
                 } else {
                     $cont[] = '';
                 }
             }
             $tb_entry->addBody($cont);
         }
     }
     $select_entry = array('course' => $lang->def('_COURSE'), 'coursepath' => $lang->def('_COURSEPATH'));
     if ($mod_perm) {
         $tb_entry->addActionAdd('<a href="index.php?modname=catalogue&amp;op=import&amp;id_cat=' . $id_cat . '&amp;load=1" class="ico-wt-sprite subs_import" ' . ' title="' . Lang::t('_IMPORT', 'catalogue') . '"><span>' . Lang::t('_IMPORT', 'catalogue') . '</span></a>');
     }
     switch (Get::req('result', DOTY_ALPHANUM, '')) {
         case "ok":
             UIFeedback::info(Lang::t('_OPERATION_SUCCESSFUL', 'standard'));
             break;
         case "err":
             UIFeedback::error(Lang::t('_OPERATION_ERROR', 'standard'));
             break;
     }
     $out->add(getTitleArea($title_area, 'catalogue') . '<div class="std_block">' . getBackUi('index.php?modname=catalogue&amp;op=catlist', $lang->def('_BACK')) . $tb_entry->getTable() . getBackUi('index.php?modname=catalogue&amp;op=catlist', $lang->def('_BACK')) . '</div>', 'content');
     if ($mod_perm) {
         require_once _base_ . '/lib/lib.dialog.php';
         setupHrefDialogBox('a[href*=delentry]');
     }
 }
コード例 #19
0
ファイル: do.test.php プロジェクト: abhinay100/forma_app
function review($object_test, $id_param)
{
    $lang =& DoceboLanguage::createInstance('test');
    require_once $GLOBALS['where_lms'] . '/lib/lib.param.php';
    require_once $GLOBALS['where_lms'] . '/class.module/track.test.php';
    $idTest = $object_test->getId();
    $idTrack = importVar('idTrack', true, 0);
    $idReference = getLOParam($id_param, 'idReference');
    //test info---------------------------------------------------------
    list($title, $show_solution, $question_random_number, $order_type) = sql_fetch_row(sql_query("\r\n\tSELECT  title, show_solution, question_random_number, order_type\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_test \r\n\tWHERE idTest = '" . (int) $idTest . "'"));
    list($score, $bonus_score, $date_attempt, $date_attempt_mod) = sql_fetch_row(sql_query("\r\n\tSELECT score, bonus_score, date_attempt, date_attempt_mod \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_testtrack \r\n\tWHERE idTrack = '" . (int) $idTrack . "'"));
    //questions------------------------------------------------------
    if ($order_type >= 2) {
        $re_visu_quest = sql_query("SELECT idQuest \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_testtrack_quest \r\n\t\tWHERE idTrack = '" . (int) $idTrack . "' ");
        while (list($id_q) = sql_fetch_row($re_visu_quest)) {
            $quest_see[] = $id_q;
        }
        $query_question = "\r\n\t\tSELECT q.idQuest, q.type_quest, t.type_file, t.type_class  \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_testquest AS q JOIN " . $GLOBALS['prefix_lms'] . "_quest_type AS t \r\n\t\tWHERE q.idTest = '" . $idTest . "' AND q.type_quest = t.type_quest AND q.idQuest IN (" . implode($quest_see, ',') . ") \r\n\t\t\t AND q.type_quest <> 'break_page' AND q.type_quest <> 'title' \r\n\t\tORDER BY q.sequence";
    } else {
        $query_question = "\r\n\t\tSELECT q.idQuest, q.type_quest, t.type_file, t.type_class \r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_testquest AS q JOIN " . $GLOBALS['prefix_lms'] . "_quest_type AS t \r\n\t\tWHERE q.idTest = '" . $idTest . "' AND q.type_quest = t.type_quest \r\n\t\t\t AND q.type_quest <> 'break_page' \r\n\t\tORDER BY q.sequence";
    }
    $reQuest = sql_query($query_question);
    //display-----------------------------------------------------------
    $GLOBALS['page']->add('<div class="std_block">' . '<div class="test_title_play">' . $lang->def('_TITLE') . ' : ' . $title . '</div>' . getBackUi(Util::str_replace_once('&', '&amp;', $object_test->back_url), $lang->def('_BACK')) . '<br />', 'content');
    //page display---------------------------------------------------
    $GLOBALS['page']->add('<div class="test_answer_space">', 'content');
    $quest_sequence_number = 1;
    while (list($idQuest, $type_quest, $type_file, $type_class) = sql_fetch_row($reQuest)) {
        require_once $GLOBALS['where_lms'] . '/modules/question/' . $type_file;
        $quest_obj = eval("return new {$type_class}( {$idQuest} );");
        $review = $quest_obj->displayUserResult($idTrack, $type_quest != 'title' ? $quest_sequence_number++ : $quest_sequence_number, $show_solution);
        $GLOBALS['page']->add('<div class="test_quest_review_container">' . $review['quest'], 'content');
        if ($review['score'] !== false) {
            $GLOBALS['page']->add('<div class="test_answer_comment">' . '<div class="test_score_note">' . $lang->def('_SCORE') . ' : ', 'content');
            if ($quest_obj->getScoreSetType() == 'manual' && !$review['manual_assigned']) {
                $GLOBALS['page']->add($lang->def('_NOT_ASSIGNED'), 'content');
            } else {
                if ($review['score'] > 0) {
                    $GLOBALS['page']->add('<span class="test_score_positive">' . $review['score'] . '</span>', 'content');
                } else {
                    $GLOBALS['page']->add('<span class="test_score_negative">' . $review['score'] . '</span>', 'content');
                }
            }
            $GLOBALS['page']->add('</div>' . ($review['comment'] != '' ? $review['comment'] : '') . '</div>', 'content');
        }
        $GLOBALS['page']->add('</div>', 'content');
    }
    $GLOBALS['page']->add('</div>', 'content');
    $GLOBALS['page']->add(getBackUi(Util::str_replace_once('&', '&amp;', $object_test->back_url), $lang->def('_BACK')) . '</div>', 'content');
}
コード例 #20
0
            $line = array();
            if ($first) {
                $line[] = array('rowspan' => count($courses), 'value' => $cinfo_content_1, 'style' => 'yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
                $line[] = array('rowspan' => count($courses), 'value' => $cinfo_content_2, 'style' => 'img-cell yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
                $line[] = array('rowspan' => count($courses), 'value' => $cinfo_content_3, 'style' => 'img-cell yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
                $line[] = array('rowspan' => count($courses), 'value' => $cinfo_content_4, 'style' => 'img-cell yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
                $rs_counter++;
            }
            $line[] = $course['name'];
            $line[] = array('style' => 'img-cell', 'value' => $cinfo->type == 'score' ? '<b>' . (int) $course['score'] . '</b>' : '-');
            $table->addBody($line, $first ? 'borded-top' : false);
            $first = false;
        }
    } else {
        $line = array();
        $line[] = array('rowspan' => 1, 'value' => $cinfo_content_1, 'style' => 'yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
        $line[] = array('rowspan' => 1, 'value' => $cinfo_content_2, 'style' => 'img-cell yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
        $line[] = array('rowspan' => 1, 'value' => $cinfo_content_3, 'style' => 'img-cell yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
        $line[] = array('rowspan' => 1, 'value' => $cinfo_content_4, 'style' => 'img-cell yui-dt-rs-' . ($rs_counter % 2 > 0 ? 'odd' : 'even'));
        $line[] = '<i>(' . Lang::t('_NO_COURSES_FOR_COMPETENCE', 'fncroles') . ')</i>';
        $line[] = array('style' => 'img-cell', 'value' => '<span class="ico-sprite fd_notice"><span></span></span>');
        $table->addBody($line, 'borded-top');
        $rs_counter++;
    }
}
echo '<br />';
echo $table->getTable();
echo '<br />';
echo getBackUi('index.php?r=adm/functionalroles/show', Lang::t('_BACK', 'standard'));
?>
</div>
コード例 #21
0
ファイル: statistic.php プロジェクト: abhinay100/forma_app
function sessiondetails()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.table.php';
    $idst_user = importVar('id', true, 0);
    $id_enter = importVar('id_enter', true, 0);
    $p_ini = importVar('p_ini');
    $link = 'index.php?modname=statistic&amp;op=sessiondetails&amp;id=' . $idst_user . '&amp;id_enter=' . $id_enter;
    $nav_bar = new NavBar('ini', Get::sett('visuItem'), 0, 'link');
    $nav_bar->setLink($link . '&amp;p_ini=' . $p_ini);
    $ini = $nav_bar->getSelectedElement();
    $lang =& DoceboLanguage::createInstance('statistic', 'lms');
    $acl_man = Docebo::user()->getAclManager();
    $user_info =& $acl_man->getUser($idst_user, false);
    $query_track = "\r\n\tSELECT g.function, g.type, g.timeof, UNIX_TIMESTAMP(g.timeof) AS unix_time \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_trackingeneral AS g\r\n\tWHERE g.idCourse = '" . (int) $_SESSION['idCourse'] . "' AND g.idUser = '******' AND " . " ( g.idEnter = '" . $id_enter . "' OR (  g.idEnter = 0 AND g.session_id = '" . importVar('sid') . "' ) ) " . " ORDER BY g.timeof \r\n\tLIMIT " . $ini . ", " . Get::sett('visuItem');
    $re_tracks = sql_query($query_track);
    $query_tot_track = "\r\n\tSELECT COUNT(*) \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_trackingeneral \r\n\tWHERE idCourse = '" . (int) $_SESSION['idCourse'] . "' AND idUser = '******' AND idEnter = '" . $id_enter . "'";
    list($tot_elem) = sql_fetch_row(sql_query($query_tot_track));
    $nav_bar->setElementTotal($tot_elem);
    // Find modulename -> name int his course
    require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
    $course_man = new Man_Course();
    $mods_names =& $course_man->getModulesName($_SESSION['idCourse']);
    $page_title = array('index.php?modname=statistic&amp;op=statistic' => $lang->def('_STATISTICS'), 'index.php?modname=statistic&amp;op=userdetails&amp;id=' . $idst_user . '&amp;p_ini=' . $p_ini => $user_info[ACL_INFO_LASTNAME] . $user_info[ACL_INFO_FIRSTNAME] ? $user_info[ACL_INFO_LASTNAME] . ' ' . $user_info[ACL_INFO_FIRSTNAME] : $acl_man->relativeId($user_info[ACL_INFO_USERID]), $lang->def('_VIEW_SESSION_DETAILS'));
    $GLOBALS['page']->add(getTitleArea($page_title, 'statistic') . '<div class="std_block">' . getBackUi('index.php?modname=statistic&amp;op=userdetails&amp;id=' . $idst_user . '&amp;p_ini=' . $p_ini, $lang->def('_BACK')), 'content');
    $tb = new Table(0, $lang->def('_VIEW_SESSION_DETAILS'), $lang->def('_VIEW_SESSION_DETAILS'));
    $type_h = array('', '', '');
    $cont_h = array($lang->def('_DATE'), $lang->def('_TYPE_OF_OPERATION'), $lang->def('_TIME_IN'));
    $tb->setColsStyle($type_h);
    $tb->addHead($cont_h);
    $type_h[2] = 'align_right';
    $tb->setColsStyle($type_h);
    $total_sec = 0;
    $read_previous = false;
    while ($read = mysql_fetch_assoc($re_tracks)) {
        if ($read_previous !== false) {
            $time_in = $read['unix_time'] - $read_previous['unix_time'];
            $hours = (int) ($time_in / 3600);
            $minutes = (int) ($time_in % 3600 / 60);
            $seconds = (int) ($time_in % 60);
            if ($minutes < 10) {
                $minutes = '0' . $minutes;
            }
            if ($seconds < 10) {
                $seconds = '0' . $seconds;
            }
            $readable = $hours . 'h ' . $minutes . 'm ' . $seconds . 's ';
            $cont = array(Format::date($read_previous['timeof'], false, true), '<span class="text_bold">' . (isset($mods_names[$read_previous['function']]) ? $mods_names[$read_previous['function']] : $read_previous['function']) . '</span> [' . $read_previous['type'] . ']', $readable);
            $tb->addBody($cont);
        }
        $read_previous = $read;
    }
    $query_last_track = "\r\n\tSELECT g.function, g.type, g.timeof, UNIX_TIMESTAMP(g.timeof) AS unix_time \r\n\tFROM " . $GLOBALS['prefix_lms'] . "_trackingeneral AS g\r\n\tWHERE g.idCourse = '" . (int) $_SESSION['idCourse'] . "' AND g.idUser = '******' AND g.idEnter = '" . $id_enter . "' \r\n\tLIMIT " . ($ini + Get::sett('visuItem')) . ", 1";
    $re_track = sql_query($query_last_track);
    if (mysql_num_rows($re_track) > 0) {
        $read = mysql_fetch_assoc($re_track);
        $time_in = $read['unix_time'] - $read_previous['unix_time'];
        $hours = (int) ($time_in / 3600);
        $minutes = (int) ($time_in % 3600 / 60);
        $seconds = (int) ($time_in % 60);
        if ($minutes < 10) {
            $minutes = '0' . $minutes;
        }
        if ($seconds < 10) {
            $seconds = '0' . $seconds;
        }
        $readable = $hours . 'h ' . $minutes . 'm ' . $seconds . 's ';
    } else {
        $readable = '';
    }
    $cont = array(Format::date($read_previous['timeof']), '<span class="text_bold">' . (isset($mods_names[$read_previous['function']]) ? $mods_names[$read_previous['function']] : $read_previous['function']) . '</span> [' . $read_previous['type'] . ']', $readable);
    $tb->addBody($cont);
    $GLOBALS['page']->add($tb->getTable() . $nav_bar->getNavBar() . getBackUi('index.php?modname=statistic&amp;op=userdetails&amp;id=' . $idst_user . '&amp;p_ini=' . $p_ini, $lang->def('_BACK')) . '</div>', 'content');
}
コード例 #22
0
ファイル: show_waiting.php プロジェクト: abhinay100/forma_app
echo getTitleArea(array('index.php?r=' . $this->link . '/show' => Lang::t('_ORGCHART', 'directory'), Lang::t('_WAITING_USERS', 'admin_directory')));
?>
<div class="std_block">
<?php 
echo getBackUi('index.php?r=' . $this->link . '/show', Lang::t('_BACK', 'standard'));
?>
<div class="quick_search_form">
	<div>
		<div class="simple_search_box" id="waitingusers_simple_filter_options">
			<?php 
echo Form::getInputTextfield("search_t", "filter_text", "filter_text", $filter_text, '', 255, '');
echo Form::getButton("filter_set", "filter_set", Lang::t('_SEARCH', 'standard'), "search_b");
echo Form::getButton("filter_reset", "filter_reset", Lang::t('_RESET', 'standard'), "reset_b");
?>
		</div>
	</div>
</div>
<?php 
/*$this->widget('dialog', array(

));*/
$icon_details = '<span class="ico-sprite subs_view"><span>' . Lang::t('_DETAILS', 'standard') . '</span></span>';
$icon_confirm = '<span class="ico-sprite subs_actv"><span>' . Lang::t('_CONFIRM', 'standard') . '</span></span>';
$icon_delete = '<span class="ico-sprite subs_del"><span>' . Lang::t('_DEL', 'standard') . '</span></span>';
$rel_action_over = '<a class="ico-wt-sprite subs_actv" id="confirm_multi_over" href="ajax.adm_server.php?r=' . $this->link . '/confirm_waiting">' . '<span>' . Lang::t('_CONFIRM', 'admin_directory') . '</span>' . '</a>' . '<a class="ico-wt-sprite subs_del" id="delete_multi_over" href="ajax.adm_server.php?r=' . $this->link . '/delete_waiting">' . '<span>' . Lang::t('_DEL_SELECTED', 'admin_directory') . '</span>' . '</a>' . '<span class="ma_selected_users">' . '<b id="num_users_selected_top">' . (int) (isset($num_users_selected) ? $num_users_selected : '0') . '</b> ' . Lang::t('_SELECTED', 'admin_directory') . '</span>';
$rel_action_bottom = '<a class="ico-wt-sprite subs_actv" id="confirm_multi_bottom" href="ajax.adm_server.php?r=' . $this->link . '/confirm_waiting">' . '<span>' . Lang::t('_CONFIRM', 'admin_directory') . '</span>' . '</a>' . '<a class="ico-wt-sprite subs_del" id="delete_multi_bottom" href="ajax.adm_server.php?r=' . $this->link . '/delete_waiting">' . '<span>' . Lang::t('_DEL_SELECTED', 'admin_directory') . '</span>' . '</a>' . '<span class="ma_selected_users">' . '<b id="num_users_selected_bottom">' . (int) (isset($num_users_selected) ? $num_users_selected : '0') . '</b> ' . Lang::t('_SELECTED', 'admin_directory') . '</span>';
$params = array('id' => 'waitingtable', 'ajaxUrl' => 'ajax.adm_server.php?r=' . $this->link . '/getwaitinguserstabledata', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'userid', 'dir' => 'desc', 'columns' => array(array('key' => 'userid', 'label' => Lang::t('_USERNAME', 'standard'), 'sortable' => true, 'formatter' => 'WaitingManagement.labelFormatter'), array('key' => 'firstname', 'label' => Lang::t('_FIRSTNAME', 'standard'), 'sortable' => true, 'formatter' => 'WaitingManagement.labelFormatter'), array('key' => 'lastname', 'label' => Lang::t('_LASTNAME', 'standard'), 'sortable' => true, 'formatter' => 'WaitingManagement.labelFormatter'), array('key' => 'email', 'label' => Lang::t('_EMAIL', 'standard'), 'sortable' => true, 'formatter' => 'WaitingManagement.labelFormatter'), array('key' => 'insert_date', 'label' => Lang::t('_DATE', 'admin_directory'), 'sortable' => true), array('key' => 'inserted_by', 'label' => Lang::t('_BY', 'admin_directory'), 'sortable' => true), array('key' => 'details', 'label' => $icon_details, 'formatter' => 'WaitingManagement.detailsFormatter', 'className' => 'img-cell'), array('key' => 'confirm', 'label' => $icon_confirm, 'formatter' => 'WaitingManagement.confirmFormatter', 'className' => 'img-cell'), array('key' => 'del', 'label' => $icon_delete, 'formatter' => 'doceboDelete', 'className' => 'img-cell')), 'fields' => array('id', 'userid', 'firstname', 'lastname', 'email', 'insert_date', 'inserted_by', 'del'), 'generateRequest' => 'WaitingManagement.requestBuilder', 'rel_actions' => array($rel_action_over, $rel_action_bottom), 'stdSelection' => true, 'delDisplayField' => 'userid', 'selectAllAdditionalFilter' => 'WaitingManagement.selectAllAdditionalFilter()', 'events' => array('initEvent' => 'WaitingManagement.initEvent', 'beforeRenderEvent' => 'WaitingManagement.beforeRenderEvent', 'postRenderEvent' => 'WaitingManagement.postRenderEvent'));
$this->widget('table', $params);
echo getBackUi('index.php?r=' . $this->link . '/show', Lang::t('_BACK', 'standard'));
?>
</div>
コード例 #23
0
:</td>
		<td><?php 
echo $info['inserted'];
?>
</td>
	</tr>
	<tr>
		<td><?php 
echo Lang::t('_DUPLICATED', 'standard');
?>
:</td>
		<td><?php 
echo $info['duplicated'];
?>
</td>
	</tr>
	<tr>
		<td><?php 
echo Lang::t('_NOT_INSERTED', 'standard');
?>
:</td>
		<td><?php 
echo $info['not_inserted'];
?>
</td>
	</tr>
</table>

<?php 
echo getBackUi('index.php?r=' . $this->link . '/show_users&id=' . $id_group, Lang::t('_BACK', 'standard'));
echo '</div>';
コード例 #24
0
ファイル: gradebook.php プロジェクト: abhinay100/forma_app
function coursereport()
{
    global $nquest;
    global $course_score, $course_score_max;
    global $test_title;
    checkPerm('view');
    require_once $GLOBALS['where_lms'] . '/lib/lib.test.php';
    require_once $GLOBALS['where_lms'] . '/lib/lib.coursereport.php';
    require_once _base_ . '/lib/lib.table.php';
    $lang =& DoceboLanguage::createInstance('gradebook', 'lms');
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $test_man = new GroupTestManagement();
    $report_man = new CourseReportManager();
    // XXX: update if needed
    $org_tests =& $report_man->getTest();
    $tests_info =& $test_man->getTestInfo($org_tests);
    $i_test = array();
    $i_test_report_id = array();
    // XXX: Info for updates
    $query_tot_report = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_coursereport\r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "'";
    list($tot_report) = sql_fetch_row(sql_query($query_tot_report));
    $query_tests = "\r\n\tSELECT id_report, id_source\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_coursereport\r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "' AND source_of = 'test'";
    $re_tests = sql_query($query_tests);
    while (list($id_r, $id_t) = sql_fetch_row($re_tests)) {
        $i_test[$id_t] = $id_t;
        $i_test_report_id[$id_r] = $id_r;
    }
    // XXX: Update if needed
    if ($tot_report == 0) {
        $report_man->initializeCourseReport($org_tests);
    } else {
        if (is_array($i_test)) {
            $test_to_add = array_diff($org_tests, $i_test);
        } else {
            $test_to_add = $org_tests;
        }
        if (is_array($i_test)) {
            $test_to_del = array_diff($i_test, $org_tests);
        } else {
            $test_to_del = $org_tests;
        }
        if (!empty($test_to_add) || !empty($test_to_del)) {
            $report_man->addTestToReport($test_to_add, 1);
            $report_man->delTestToReport($test_to_del);
            $included_test = $org_tests;
        }
    }
    $report_man->updateTestReport($org_tests);
    $reports = array();
    $id_test = array();
    $id_report = array();
    $tests = array();
    // XXX: retrive all report info
    $query_report = "\r\n\tSELECT id_report, title, max_score, required_score, weight, show_to_user, use_for_final, source_of, id_source\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_coursereport\r\n\tWHERE id_course = '" . $_SESSION['idCourse'] . "' AND show_to_user = '******'\r\n\tORDER BY sequence ";
    $re_report = sql_query($query_report);
    while ($info_report = mysql_fetch_assoc($re_report)) {
        switch ($info_report['source_of']) {
            case "test":
                $id_test[] = $info_report['id_source'];
                break;
        }
    }
    $id_user = getLogUserId();
    if (count($id_test)) {
        $title = $GLOBALS['course_descriptor']->getValue('name');
        $username = Docebo::user()->getUserName();
        $GLOBALS['page']->add(getTitleArea($lang->def('_GRADEBOOK_AREATITLE'), 'gradebook') . '<div class="std_block">' . '<div class="print">' . '<a href="#" onclick="window.print(); return false;">' . '<img src="' . getPathImage() . 'standard/print.gif" alt="' . $lang->def('_PRINT') . '" /> ' . $lang->def('_PRINT') . '</a>' . '</div>' . getBackUi('index.php?modname=gradebook&amp;op=showgrade', $lang->def('_BACK')) . '<div class="title coursereport-title">' . $username . '</div><div class="title coursereport-title">' . $title . '</div>', 'content');
        $GLOBALS['page']->add('<div class="coursereport-div"><table class="coursereport-table">' . '<tr><td><strong>' . $lang->def('_TEST_N') . '</strong></td><td><strong>' . $lang->def('_QUESTION') . '</strong></td><td align="right"><strong>' . $lang->def('_SCORE') . '</strong></td></tr>', 'content');
        $nquest = 0;
        $course_score = 0;
        $course_score_max = 0;
        $j = 0;
        for ($i = 0; $i < count($id_test); $i++) {
            $test_title = $tests_info[$id_test[$i]]['title'];
            $GLOBALS['page']->add('<tr><td colspan="3"><br /><strong>' . $test_title . '</strong></td></tr>', 'content');
            $query_track = "SELECT idTrack FROM " . $GLOBALS['prefix_lms'] . "_testtrack " . "WHERE idTest =" . $id_test[$i] . " AND idUser="******"3" align="right"><strong>' . $lang->def('_TOTAL') . ':&nbsp;' . $course_score . ' ' . $lang->def('_ON') . ' ' . $course_score_max . ' (' . $perc_course_score . '%)</strong> </td></tr>', 'content');
        $GLOBALS['page']->add('</table>', 'content');
        /*
        if ($perc_course_score<75) {
        	$msg_feedback=$lang->def('_COURSE_NOT_OK').' '.$lang->def('_COURSE_CHECK_GRAPH');
        } else {
        	$msg_feedback=$lang->def('_COURSE_OK');
        }
        
        $GLOBALS['page']->add('<p><strong>'.$msg_feedback.'</strong>', 'content');
        */
        $GLOBALS['page']->add('</div>', 'content');
        draw_bar($tests);
        $GLOBALS['page']->add('</div>', 'content');
    }
}
コード例 #25
0
ファイル: invalid.php プロジェクト: abhinay100/forma_app
<?php

//just print an error message with back urls
$back_ui = getBackUi($back_url, Lang::t('_BACK', 'standard'));
echo $back_ui . '<br><p>' . $message . '</p></br>' . $back_ui;
コード例 #26
0
 function getViewUserFileDetail()
 {
     require_once _base_ . '/lib/lib.navbar.php';
     $viewer = $this->getViewer();
     $type = Get::req('type', DOTY_MIXED, '');
     $id_file = Get::req('id_file', DOTY_MIXED, '');
     $this->loadUserData($viewer);
     // main container ---------------------------------------------------------------------
     $html = '<h1>' . $this->_lang->def('_PROFILE') . ': ' . $this->resolveUsername() . '</h1>';
     $html .= '<div id="up_user_info" class="up_user_info">';
     $html .= $this->getUserRelatedAction($type);
     require_once $GLOBALS['where_framework'] . '/lib/lib.myfiles.php';
     $user_file = new MyFilesPolicy($this->_user_profile->getIdUser(), $this->getViewer(), $this->_up_data_man->isFriend($this->_user_profile->getIdUser(), $this->getViewer()), $this->_up_data_man->isTeacher($this->getViewer()));
     $file = $user_file->getFileInfo($id_file);
     if ($file == false) {
         $html .= $this->_lang->def('_THE_FILE_DOESNT_EXIST') . '</div>';
         return $html;
     }
     $html .= '<h2 class="up_type1">' . $file[MYFILE_TITLE] . '</h2>';
     if ($file[MYFILE_DESCRIPTION] != '') {
         $html .= '<div class="up_description">' . '<b>' . $this->_lang->def('_DESCRIPTION') . ': </b>' . $file[MYFILE_DESCRIPTION] . '</div>';
     }
     $id_thread = Get::req('idThread', DOTY_INT, 0);
     $html .= getBackUi($this->_url_man->getUrl('id_user='******'&' . $this->_varname_action . '=view_files&type=' . $type . '&idThread=' . $id_thread . ''), $this->_lang->def('_BACK'));
     $html .= '<div class="up_box_details">';
     $type = $file[MYFILE_AREA];
     switch ($type) {
         case "image":
             $html .= '<img src="' . $GLOBALS['where_files_relative'] . $user_file->getFileAddress($file[MYFILE_FILE_NAME]) . '" ' . 'title="' . strip_tags($file[MYFILE_DESCRIPTION]) . '" alt="' . strip_tags($file[MYFILE_TITLE]) . '" />';
             break;
         case "video":
             require_once _base_ . '/lib/lib.multimedia.php';
             $html .= getEmbedPlay($GLOBALS['where_files_relative'] . $user_file->getFilePath(), $file[MYFILE_FILE_NAME]);
             break;
         case "audio":
             require_once _base_ . '/lib/lib.multimedia.php';
             $html .= getEmbedPlay($GLOBALS['where_files_relative'] . $user_file->getFilePath(), $file[MYFILE_FILE_NAME]);
             break;
         case "other":
             require_once _base_ . '/lib/lib.multimedia.php';
             $html .= getEmbedPlay($user_file->getFilePath(), $file[MYFILE_FILE_NAME]);
             break;
     }
     $html .= '</div>';
     $id_thread = Get::req('idThread', DOTY_INT, 0);
     $html .= getBackUi($this->_url_man->getUrl('id_user='******'&' . $this->_varname_action . '=view_files&type=' . $type . '&idThread=' . $id_thread . ''), $this->_lang->def('_BACK'));
     $html .= '</div>';
     return $html;
 }
コード例 #27
0
function viewReport()
{
    checkPerm('view');
    $idrep = Get::req('idrep', DOTY_INT, 0);
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    load_filter($idrep, true);
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.download.php';
    $lang =& DoceboLanguage::createInstance('report', 'framework');
    //$obj_report = openreport($idrep);
    if ($idrep != false && $idrep > 0) {
        $id_report = $idrep;
    } else {
        $id_report = $_SESSION['report_tempdata']['id_report'];
        if ($id_report != false && $idrep > 0) {
            load_filter($idrep, true, false);
        }
    }
    $query_report = "\r\n\tSELECT r.class_name, r.file_name, r.report_name, f.filter_name, f.filter_data, f.author\r\n\tFROM %lms_report AS r\r\n\t\tJOIN %lms_report_filter AS f\r\n\t\tON ( r.id_report = f.id_report )\r\n\tWHERE f.id_filter = '" . $idrep . "'";
    $re_report = sql_query($query_report);
    list($class_name, $file_name, $report_name, $filter_name, $report_data) = sql_fetch_row($re_report);
    if (sql_num_rows($re_report) == 0) {
        reportlist();
        return;
    }
    $report_data = unserialize($report_data);
    require_once _lms_ . '/admin/modules/report/' . $file_name;
    $obj_report = new $class_name($id_report);
    $obj_report->back_url = 'index.php?modname=public_report_admin&op=reportlist';
    $obj_report->jump_url = 'index.php?modname=public_report_admin&op=view_report&idrep=' . $idrep;
    $start_url = 'index.php?modname=public_report_admin&op=reportlist';
    $temp = Get::req('dl', DOTY_STRING, false);
    if ($temp) {
        list($filter_name) = mysql_fetch_row(mysql_query("SELECT filter_name FROM " . $GLOBALS['prefix_lms'] . "_report_filter WHERE id_filter = '" . $idrep . "'"));
        $filename = 'report_' . $filter_name . '_' . date("d_m_Y");
        switch ($temp) {
            case 'htm':
                sendStrAsFile($obj_report->getHTML(false, NULL), $filename . '.html');
                break;
            case 'csv':
                sendStrAsFile($obj_report->getCSV(false, NULL), $filename . '.csv');
                break;
            case 'xls':
                sendStrAsFile($obj_report->getXLS(false, NULL), $filename . '.xls');
                break;
        }
    }
    $report_info = $lang->def('_SHOW_REPORT_INFO', 'report', 'framework') . getReportNameById($idrep);
    $GLOBALS['page']->add(getTitleArea($lang->def('REPORT_SHOW_RESULTS', 'report', 'framework'), 'report', $lang->def('_REPORT_PRINTTABLE', 'report', 'framework')) . '<div class="std_block">', 'content');
    if (Get::req('no_show_repdownload', DOTY_INT, 0) <= 0) {
        $GLOBALS['page']->add(getBackUi($obj_report->back_url, $lang->def('_BACK', 'report', 'framework'), 'content') . getInfoUi($report_info), 'content');
        $export_url = 'index.php?modname=public_report_admin&amp;op=view_report&amp;idrep=' . $idrep;
        $GLOBALS['page']->add('<p class="export_list">' . '<a class="export_htm" href="' . $export_url . '&amp;dl=htm">' . $lang->def('_EXPORT_HTML', 'report', 'framework') . '</a>&nbsp;' . '<a class="export_csv" href="' . $export_url . '&amp;dl=csv">' . $lang->def('_EXPORT_CSV', 'report', 'framework') . '</a>&nbsp;' . '<a class="export_xls" href="' . $export_url . '&amp;dl=xls">' . $lang->def('_EXPORT_XLS', 'report', 'framework') . '</a>' . '</p><br />', 'content');
    }
    $GLOBALS['page']->add(Form::openForm('report_form', $obj_report->jump_url), 'content');
    // css -----------------------------------------------------------
    $GLOBALS['page']->add("\n" . '<link href="' . getPathTemplate('lms') . 'style/report/style_report_user.css" rel="stylesheet" type="text/css" />' . "\n", 'page_head');
    $obj_report->show_results($report_data['columns_filter_category'], $report_data);
    $out->add(Form::closeForm(), 'content');
    $out->add('</div>', 'content');
}
コード例 #28
0
ファイル: edition.php プロジェクト: abhinay100/forma_app
if ($permissions['subscribe']) {
    $_columns[] = array('key' => 'subscription', 'label' => Get::sprite('subs_users', Lang::t('_SUBSCRIPTION', 'course')), 'className' => 'img-cell');
    Docebo::user()->preference->getAdminPreference('admin_rules.course_presence_admin') === 'on' && Docebo::user()->getUserLevelId() !== ADMIN_GROUP_GODADMIN || Docebo::user()->getUserLevelId() === ADMIN_GROUP_GODADMIN ? $_columns[] = array('key' => 'presence', 'label' => Lang::t('_ATTENDANCE', 'course'), 'className' => 'img-cell') : '';
}
if ($permissions['mod']) {
    $_columns[] = array('key' => 'mod', 'label' => Get::img('standard/edit.png', Lang::t('_MOD', 'course')), 'className' => 'img-cell');
}
if ($permissions['del'] && !Get::cfg('demo_mode')) {
    $_columns[] = array('key' => 'del', 'label' => Get::img('standard/delete.png', Lang::t('_DEL', 'course')), 'formatter' => 'doceboDelete', 'className' => 'img-cell');
}
$_params = array('id' => 'classroom_edition_table', 'ajaxUrl' => 'ajax.adm_server.php?r=' . $base_link_classroom . '/getclassroomedition&id_course=' . $model->getIdCourse() . '&', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'name', 'dir' => 'asc', 'columns' => $_columns, 'fields' => array('id_date', 'code', 'name', 'status', 'date_begin', 'date_end', 'classroom', 'students', 'num_subscribe', 'subscription', 'presence', 'mod', 'del'), 'show' => 'table', 'editorSaveEvent' => '');
if ($permissions['add']) {
    $_params['rel_actions'] = '<a class="ico-wt-sprite subs_add" href="index.php?r=' . $base_link_classroom . '/addclassroom&amp;id_course=' . $model->getIdCourse() . '"><span>' . Lang::t('_ADD', 'subscribe') . '</span></a>';
}
$this->widget('table', $_params);
echo getBackUi('index.php?r=' . $base_link_course . '/show', Lang::t('_BACK', 'course'));
?>
</div>
<script type="text/javascript">
var StatusList = {
<?php 
$conds = array();
$list = $this->model->getStatusForDropdown();
foreach ($list as $id_status => $name_status) {
    $conds[] = 'status_' . $id_status . ': "' . str_replace('"', '\\' . '"', $name_status) . '"';
}
if (!empty($conds)) {
    echo implode(',' . "\n", $conds);
}
?>
};
コード例 #29
0
<?php

Get::title(array('index.php?r=alms/location/show' => Lang::t('_LOCATION', 'classroom'), 'index.php?r=alms/location/show_classroom&amp;id_location=' . ($_is_editing ? $info->location_id : $id_location) => Lang::t('_CLASSROOM', 'classroom'), Lang::t($_is_editing ? '_MOD' : '_ADD', 'standard')));
?>
<div class="std_block">
<?php 
echo getBackUi('index.php?r=alms/location/show_classroom&amp;id_location=' . ($_is_editing ? $info->location_id : $id_location), Lang::t('_BACK'));
echo Form::openForm('classroom_form', $_is_editing ? 'index.php?r=alms/location/saveclassroom' : 'index.php?r=alms/location/insertclassroom');
echo Form::getTextfield(Lang::t('_NAME', 'classroom'), 'name', 'name', 255, $_is_editing ? $info->name : "");
echo Form::getTextarea(Lang::t('_DESCRIPTION', 'classroom'), 'description', 'description', $_is_editing ? $info->description : "");
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 : "");
コード例 #30
0
ファイル: login.php プロジェクト: abhinay100/forma_app
function socialConnectLogin($uid = false, $network_code = false)
{
    require_once _base_ . '/lib/lib.usermanager.php';
    $res = '';
    $lang = DoceboLanguage::createInstance('login');
    $user_manager = new UserManager();
    if (!empty($uid) && !empty($network_code)) {
        session_regenerate_id();
        $_SESSION['connect_social']['uid'] = $uid;
        $_SESSION['connect_social']['network_code'] = $network_code;
    }
    $can_connect = false;
    if (isset($_SESSION['connect_social']) && isset($_SESSION['connect_social']['uid']) && !empty($_SESSION['connect_social']['uid'])) {
        // read data from session, in case we are on the second step (login attempt)
        $uid = $_SESSION['connect_social']['uid'];
        $network_code = $_SESSION['connect_social']['network_code'];
        $can_connect = true;
    }
    // check form submission:
    if (isset($_POST['undo'])) {
        // go back to index
        Util::jump_to('index.php');
    } else {
        if (isset($_POST['login']) && !$can_connect) {
            // we don't have the social uid to be connected with user account..
            Util::jump_to('index.php?modname=login&amp;op=social_connect_login&amp;err=2');
        } else {
            if (isset($_POST['login'])) {
                // login and connect account
                $user = DoceboUser::createDoceboUserFromLogin(Get::pReq('login_userid', DOTY_STRING), Get::pReq('login_pwd', DOTY_STRING), 'public_area');
                if ($user) {
                    DoceboUser::setupUser($user);
                    $social = new Social();
                    $social->connectAccount($network_code, $uid);
                    unset($_SESSION['connect_social']);
                    Util::jump_to('index.php?r=lms/elearning/show');
                } else {
                    Util::jump_to('index.php?modname=login&amp;op=social_connect_login&amp;err=1');
                }
            }
        }
    }
    switch (Get::gReq('err', DOTY_INT, 0)) {
        case 1:
            $res .= UIFeedback::error(Lang::t('_NOACCESS', 'login'), true);
            break;
        case 2:
            $res .= UIFeedback::error(Lang::t('_NO_SOCIAL_ACCOUNT_TO_CONNECT', 'login') . '&nbsp;<a href="index.php">' . Lang::t('_TRY_AGAIN', 'login') . '</a>', true);
            break;
    }
    $GLOBALS['page']->add(getTitleArea($lang->def('_LOGIN'), 'login') . '<div class="std_block">' . getBackUi('index.php', $lang->def('_BACK')), 'content');
    if ($can_connect) {
        $res .= Get::img('social/' . $network_code . '-24.png') . '&nbsp;';
        $res .= str_replace('[network_code]', Lang::t($network_code, 'social'), Lang::t('_YOU_ARE_CONNECTING_SOCIAL_ACCOUNT', 'social')) . " <b>" . $uid . "</b>";
    }
    $res .= Form::openForm('scl_form', 'index.php?modname=login&amp;op=social_connect_login') . Form::openElementSpace() . Form::getTextfield(Lang::t('_USERNAME', 'login'), 'login_userid', 'login_userid', 255) . Form::getPassword(Lang::t('_PASSWORD', 'login'), 'login_pwd', 'login_pwd', 255) . Form::closeElementSpace() . Form::openButtonSpace() . Form::getButton('login', 'login', Lang::t('_LOGIN', 'login')) . Form::getButton('undo', 'undo', Lang::t('_UNDO', 'login')) . Form::closeButtonSpace() . Form::closeForm();
    $GLOBALS['page']->add($res, 'content');
    // std_block
    $GLOBALS['page']->add('</div>', 'content');
    // std_block
}