Ejemplo n.º 1
0
 public function show()
 {
     require_once _base_ . '/lib/lib.navbar.php';
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $block_list = array();
     //if($ma->currentCanAccessObj('user_details_short')) $block_list['user_details_short'] = true;
     if ($ma->currentCanAccessObj('user_details_full')) {
         $block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $block_list['news'] = true;
     }
     $query_home = "SELECT title, description FROM learning_webpages where publish=1 and in_home = 1 AND language = '" . getLanguage() . "' LIMIT 1";
     $re_home = sql_query($query_home);
     list($titolo, $descrizione) = sql_fetch_row($re_home);
     if (!empty($block_list)) {
         $this->render('_tabs_block', array('active_tab' => 'home', '_content' => "<div id=\"tabhome_title\"><h1>" . $titolo . "</h1></div><div id=\"tabhome_description\">" . $descrizione . "</div>", 'block_list' => $block_list));
     } else {
         $this->render('_tabs', array('active_tab' => 'home', '_content' => "<div id=\"tabhome_title\"><h1>" . $titolo . "</h1></div><div id=\"tabhome_description\">" . $descrizione . "</div>"));
     }
 }
Ejemplo n.º 2
0
function select_permission()
{
    checkPerm('view');
    require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php';
    require_once _base_ . '/lib/lib.userselector.php';
    require_once _base_ . '/lib/lib.form.php';
    $lang =& DoceboLanguage::createInstance('middlearea', 'lms');
    $obj_index = importVar('obj_index', false, '');
    // first step load selector
    $man_ma = new Man_MiddleArea();
    $acl_manager = new DoceboACLManager();
    $user_select = new UserSelector();
    $user_select->show_user_selector = TRUE;
    $user_select->show_group_selector = TRUE;
    $user_select->show_orgchart_selector = TRUE;
    $user_select->show_orgchart_simple_selector = false;
    //$user_select->multi_choice = TRUE;
    // try to load previous saved
    if (isset($_GET['load'])) {
        $selected = $man_ma->getObjIdstList($obj_index);
        if (is_array($selected)) {
            $user_select->resetSelection($selected);
        }
    }
    if (isset($_POST['okselector'])) {
        $selected = $user_select->getSelection($_POST);
        $re = $man_ma->setObjIdstList($obj_index, $selected);
        Util::jump_to('index.php?modname=middlearea&amp;op=view_area&amp;result=' . ($re ? 'ok' : 'err'));
    }
    cout(getTitleArea(array('index.php?modname=middlearea&amp;op=view_area' => $lang->def('_MIDDLE_AREA'), Lang::t('_VIEW_PERMISSION', 'standard')), 'middlearea') . '<div class="std_block">');
    $user_select->addFormInfo(Form::getHidden('obj_index', 'obj_index', $obj_index));
    $user_select->loadSelector('index.php?modname=middlearea&amp;op=select_permission', false, false, true);
    cout('</div>');
}
Ejemplo n.º 3
0
 public function showTask()
 {
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $block_list = array();
     //if($ma->currentCanAccessObj('user_details_short')) $block_list['user_details_short'] = true;
     if ($ma->currentCanAccessObj('user_details_full')) {
         $block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $block_list['news'] = true;
     }
     $tb_label = $ma->currentCanAccessObj('tb_label');
     if (!$tb_label) {
         $_SESSION['id_common_label'] = 0;
     } else {
         $id_common_label = Get::req('id_common_label', DOTY_INT, -1);
         if ($id_common_label >= 0) {
             $_SESSION['id_common_label'] = $id_common_label;
         } elseif ($id_common_label == -2) {
             $_SESSION['id_common_label'] = -1;
         }
         $block_list['labels'] = true;
     }
     if ($tb_label && $_SESSION['id_common_label'] == -1) {
         require_once _lms_ . '/admin/models/LabelAlms.php';
         $label_model = new LabelAlms();
         $user_label = $label_model->getLabelForUser(Docebo::user()->getId());
         $this->render('_labels', array('block_list' => $block_list, 'label' => $user_label));
     } else {
         if (!empty($block_list)) {
             $this->render('_tabs_block', array('block_list' => $block_list));
         } else {
             $this->render('_tabs', array());
         }
     }
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $this->render('pluginslist', array('pluginslist' => $pluginslist));
 }
 public function show()
 {
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $block_list = array();
     //if($ma->currentCanAccessObj('user_details_short')) $block_list['user_details_short'] = true;
     if ($ma->currentCanAccessObj('user_details_full')) {
         $block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $block_list['news'] = true;
     }
     if (!empty($block_list)) {
         $this->render('_tabs_block', array('block_list' => $block_list));
     } else {
         $this->render('_tabs', array());
     }
 }
Ejemplo n.º 5
0
<?php

YuiLib::load(array('animation' => 'my_animation', 'container' => 'container-min', 'container' => 'container_core-min'));
cout(Util::get_js(Get::rel_path('lms') . '/views/catalog/catalog.js', true), 'page_head');
require_once _lms_ . '/lib/lib.middlearea.php';
$ma = new Man_MiddleArea();
?>
<script type="text/javascript">
	YAHOO.util.Event.onDOMReady(function() {
		initialize("<?php 
echo Lang::t('_UNDO', 'standard');
?>
");
	});
</script>
<div id="global_conf" class="yui-navset yui-navset-top">
	<ul class="yui-nav">
		<li class="<?php 
echo $active_tab == 'all' ? 'selected' : '';
?>
 first">
			<a href="index.php?r=catalog/allCourse">
				<em><?php 
echo Lang::t('_ALL_COURSES', 'catalogue');
?>
</em>
			</a>
		</li>
		<li class="<?php 
echo $active_tab == 'new' ? 'selected' : '';
?>
Ejemplo n.º 6
0
                         require_once $GLOBALS['where_lms'] . '/lib/lib.course.php';
                         if (logIntoCourse($vars['id_course'], false)) {
                             Util::jump_to($url);
                         }
                     }
                 }
                 //goto welcome page
                 $_SESSION['current_main_menu'] = '1';
                 $_SESSION['sel_module_id'] = '1';
                 if ($pwd_elapsed <= 0) {
                     if (Get::sett('first_catalogue') == 'on') {
                         Util::jump_to('index.php?r=lms/catalog/show');
                     }
                     // if elearning tab disabled, jump to classroom courses
                     require_once _lms_ . '/lib/lib.middlearea.php';
                     $ma = new Man_MiddleArea();
                     if (!$ma->currentCanAccessObj('tb_elearning')) {
                         Util::jump_to('index.php?r=lms/classroom/show');
                     }
                     Util::jump_to('index.php?r=' . _after_login_);
                 }
                 // end login
             }
         } else {
             Util::jump_to('../index.php');
         }
     }
     break;
 case "logout":
     require_once $GLOBALS['where_lms'] . '/lib/lib.track_user.php';
     if (!Docebo::user()->isAnonymous() && isset($_SESSION['idCourse'])) {
Ejemplo n.º 7
0
 function homeUserProfile($picture = false, $viewer = false, $intest = false)
 {
     $this->loadUserData($this->getViewer());
     $acl_man =& Docebo::user()->getAclManager();
     list($class_picture, $this->max_dim_avatar) = $this->getPhotoLimit($picture);
     $html = '<div class="up_dashboard"><div class="content">';
     $html .= '<p class="logo">' . ($this->user_info[ACL_INFO_AVATAR] != "" ? $this->getPASrc($this->user_info[ACL_INFO_AVATAR], $this->_lang->def('_AVATAR'), 'boxed') : '<img class="boxed" src="' . getPathImage() . 'standard/user.png" alt="' . $this->_lang->def('_NOAVATAR') . '" />') . '</p>';
     $html .= '' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_USERNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_USERID]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_LASTNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_LASTNAME]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_FIRSTNAME') . '</b><br/> ' . $this->acl_man->relativeId($this->user_info[ACL_INFO_FIRSTNAME]) . '</p>' . '<p class="userinfo">' . '<b>' . $this->_lang->def('_EMAIL') . '</b><br/> ' . ($this->user_info[ACL_INFO_EMAIL] !== false ? '<a href="mailto:' . $this->user_info[ACL_INFO_EMAIL] . '">' . $this->user_info[ACL_INFO_EMAIL] . '</a>' : $this->_lang->def('_HIDDEN')) . '</p>' . '<div class="nofloat"></div>';
     $social = new Social();
     if ($social->enabled()) {
         if (!$social->allConnected()) {
             $html .= '<b class="social-accounts-title">' . Lang::t('_CONNECT_YOUR_ACCOUNT_WITH', 'social') . '</b>';
             $html .= '<ul class="social-accounts">';
             if ($social->isActive('facebook') && !$social->connectedToUser('facebook')) {
                 $social = new Social();
                 $social->includeFacebookLib();
                 $client_id = Get::sett('social_fb_api');
                 $client_secret = Get::sett('social_fb_secret');
                 $redirect_uri = Get::sett('url') . 'index.php?modname=login&op=facebook_login';
                 $serviceFactory = new \OAuth\ServiceFactory();
                 $storage = new Session();
                 $credentials = new Credentials($client_id, $client_secret, $redirect_uri);
                 $facebookService = $serviceFactory->createService('facebook', $credentials, $storage, array());
                 //, 'userinfo_profile'
                 $loginUrl = $facebookService->getAuthorizationUri();
                 $html .= '<li><a href="' . $loginUrl . '" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_FACEBOOK', 'social') . '"><span>' . Get::img('social/facebook.png', Lang::t('_FACEBOOK', 'social')) . '</span></a></li>';
             }
             if ($social->isActive('twitter') && !$social->connectedToUser('twitter')) {
                 $html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&amp;op=twitter_login&amp;connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_TWITTER', 'social') . '"><span>' . Get::img('social/twitter.png', Lang::t('_TWITTER', 'social')) . '</span></a></li>';
             }
             if ($social->isActive('linkedin') && !$social->connectedToUser('linkedin')) {
                 $html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&amp;op=linkedin_login&amp;connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_LINKEDIN', 'social') . '"><span>' . Get::img('social/linkedin.png', Lang::t('_LINKEDIN', 'social')) . '</span></a></li>';
             }
             if ($social->isActive('google') && !$social->connectedToUser('google')) {
                 $html .= '<li><a href="' . Get::sett('url') . 'index.php?modname=login&amp;op=google_login&amp;connect=1" ' . 'title="' . Lang::t('_CONNECT', 'social') . ': ' . Lang::t('_GOOGLE', 'social') . '"><span>' . Get::img('social/google.png', $this->user_info[ACL_INFO_GOOGLE_ID]) . '</span></a></li>';
             }
             $html .= '</ul><br/>';
         }
         if ($social->someConnected()) {
             $html .= '<b class="social-accounts-title">' . Lang::t('_CONNECTED_ACCOUNTS', 'social') . '</b>';
             $html .= '<ul class="social-accounts">';
             if ($social->connectedToUser('facebook')) {
                 $html .= '<li><a id="disconnect_facebook" href="index.php?r=SocialConnect/disconnect&amp;network=facebook" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_FACEBOOK', 'social') . '"><span>' . Get::img('social/facebook.png', Lang::t('_FACEBOOK', 'social')) . '</span></a></li>';
             }
             if ($social->connectedToUser('twitter')) {
                 $html .= '<li><a id="disconnect_twitter" href="index.php?r=SocialConnect/disconnect&amp;network=twitter" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_TWITTER', 'social') . '"><span>' . Get::img('social/twitter.png', Lang::t('_TWITTER', 'social')) . '</span></a></li>';
             }
             if ($social->connectedToUser('linkedin')) {
                 $html .= '<li><a id="disconnect_linkedin" href="index.php?r=SocialConnect/disconnect&amp;network=linkedin" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_LINKEDIN', 'social') . '"><span>' . Get::img('social/linkedin.png', Lang::t('_LINKEDIN', 'social')) . '</span></a></li>';
             }
             if ($social->connectedToUser('google')) {
                 $html .= '<li><a id="disconnect_google" href="index.php?r=SocialConnect/disconnect&amp;network=google" ' . 'title="' . Lang::t('_DISCONNECT', 'social') . ': ' . Lang::t('_GOOGLE', 'social') . '"><span>' . Get::img('social/google.png', $this->user_info[ACL_INFO_GOOGLE_ID]) . '</span></a></li>';
             }
             $html .= '</ul>';
         }
         /* $html.=Util::widget('dialog', array(
         				'id' => 'confirm_disconnect',
         				'dynamicContent' => false,
         				'body'=>'mm',
         				'directSubmit'=>true,
         				'ajaxUrl' => '"ajax.adm_server.php?r=alms/enrollrules/add"',
         				'dynamicAjaxUrl' => true,
         				'callback' => 'function() {
         					this.destroy();
         				}',
         				'callEvents' => array(
         					array('caller' => 'disconnect_facebook', 'event' => 'click'),
         					array('caller' => 'disconnect_twitter', 'event' => 'click'),
         					array('caller' => 'disconnect_linkedin', 'event' => 'click'),
         					array('caller' => 'disconnect_google', 'event' => 'click'),
         				)
         			), true); */
     }
     $html .= '</div></div>';
     // box carriera
     require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php';
     require_once $GLOBALS['where_lms'] . '/modules/course/course.php';
     $ma = new Man_MiddleArea();
     $access_career = $ma->currentCanAccessObj('career');
     //if($this->acl_man->relativeId($this->user_info[ACL_INFO_USERID]) == 'alberto' && $access_career) {
     if ($access_career) {
         $url = $this->_url_man;
         $course_stats = userCourseList($url, false, false);
         //TODO:  review this call . use course list to compute carreer
         $base_url = 'index.php?r=' . _after_login_ . '&amp;filter=';
         $end = 0;
         if (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0) {
             $end = $course_stats['with_ustatus'][_CUS_END];
         }
         $html .= '<div class="inline_block">' . '<h2 class="heading">' . $this->_lang->def('_CAREER') . '</h2>' . '<div class="content">' . '<div class="course_stat">' . '<table summary="">' . '<tr><th scope="row">' . $this->_lang->def('_TOTAL_COURSE') . ' :</th><td>' . ($course_stats['total'] - $end) . '</td></tr>' . (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0 ? '<tr><th scope="row">' . $this->_lang->def('_COURSE_END') . ' :</th><td>' . $course_stats['with_ustatus'][_CUS_END] . '</td></tr>' : '') . (isset($course_stats['expiring']) && $course_stats['expiring'] != 0 ? '<tr><th scope="row">' . $this->_lang->def('_COURSE_EXPIRING') . ' :</th><td>' . $course_stats['expiring'] . '</td></tr>' : '');
         if (count($course_stats['with_ulevel']) > 1) {
             require_once $GLOBALS['where_lms'] . '/lib/lib.levels.php';
             $lvl = CourseLevel::getLevels();
             foreach ($course_stats['with_ulevel'] as $lvl_num => $quantity) {
                 $html .= '' . '<tr><th scope="row">' . str_replace('[level]', $lvl[$lvl_num], $this->_lang->def('_COURSE_AS')) . ' :</th><td>' . $quantity . '</td></tr>';
             }
             //end foreach
         }
         $query = "SELECT c.idMetaCertificate, m.idCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as c" . " JOIN " . $GLOBALS['prefix_lms'] . "_certificate_meta as m ON c.idMetaCertificate = m.idMetaCertificate" . " WHERE c.idUser = '******'" . " GROUP BY c.idMetaCertificate" . " ORDER BY m.title, m.description";
         $result = sql_query($query);
         $num_meta_cert = mysql_num_rows($result);
         while (list($id_meta, $id_certificate) = sql_fetch_row($result)) {
             $query_released = "SELECT on_date" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'";
             $result_released = sql_query($query_released);
             $query = "SELECT user_release" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate" . " WHERE id_certificate = '" . $id_certificate . "'";
             list($user_release) = sql_fetch_row(sql_query($query));
             if (mysql_num_rows($result_released)) {
             } elseif ($user_release == 0) {
                 $num_meta_cert--;
             } else {
                 $query = "SELECT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'";
                 $result_int = sql_query($query);
                 $control = true;
                 while (list($id_course) = sql_fetch_row($result_int)) {
                     $query = "SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE idCourse = '" . $id_course . "'" . " AND idUser = '******'" . " AND status = '" . _CUS_END . "'";
                     list($number) = sql_fetch_row(sql_query($query));
                     if (!$number) {
                         $control = false;
                     }
                 }
                 if (!$control) {
                     $num_meta_cert--;
                 }
             }
         }
         $tot_cert = $num_meta_cert + $course_stats['cert_relesable'];
         $html .= '' . (isset($course_stats['cert_relesable']) && $tot_cert != 0 ? '<tr><th scope="row">' . $this->_lang->def('_CERT_RELESABLE') . ' :</th><td><a href="index.php?modname=mycertificate&amp;op=mycertificate">' . $tot_cert . '</a></td></tr>' : '') . ($pendent != 0 ? '<tr><th scope="row">' . $this->_lang->def('_FRIEND_PENDENT') . ' :</th><td><a href="index.php?modname=myfriends&amp;op=myfriends">' . $pendent . '</a></td></tr>' : '') . '</table>' . '</div>' . '</div>' . '</div>';
     }
     /*
     		$html = '<div class="user_presentation">'."\n"
     
     			.( $intest
     				? '<div class="mini_block">'."\n\t"
     						.'<h1>'."\n\t\t"
     							.$this->_lang->def('_WELCOME').'<br/>'."\n\t\t"
     							.'<span>'.$this->resolveUsername().'</span>'."\n\t"
     						.'</h1>'."\n\t"
     						.'<div class="spacer"></div>'."\n\t"
     					.'</div>'."\n"
     
     				: '' );
     
     		if($this->_user_profile->useAvatar()) {
     			$html .= '<div class="mini_block avatar_photo">'."\n\t";
     		}
     		if($this->_user_profile->useAvatar()) {
     
     			$html .= '<p>'."\n\t"
     						.( ($this->user_info[ACL_INFO_AVATAR] != "")
     							? $this->getPASrc($this->user_info[ACL_INFO_AVATAR], $this->_lang->def('_AVATAR'), 'boxed')
     							: '<img class="boxed" src="'.getPathImage().'standard/user.png" alt="'.$this->_lang->def('_NOAVATAR').'" />' )."\n\t\t"
     						.'<br />'."\n\t\t"
     						.$this->_lang->def('_AVATAR')."\n\t\t"
     					.'</p>'."\n\t";
     		}
     		if($this->_user_profile->useAvatar()) {
     
     			$html .= '<div class="nofloat"></div>'."\n\t"
     					.'<div class="spacer"></div>'."\n"
     					.'</div>'."\n";
     		}
     
     		$html .= '<div class="mini_block">'."\n\t"
     				.'<p class="userinfo">'."\n\t\t"
     					.'<b>'.$this->_lang->def('_USERNAME').':</b> '.$this->acl_man->relativeId($this->user_info[ACL_INFO_USERID])
     				.'</p>'."\n\t"
     				.'<p class="userinfo">'."\n\t\t"
     					.'<b>'.$this->_lang->def('_EMAIL').':</b> '
     					.( $this->user_info[ACL_INFO_EMAIL] !== false
     						? '<a href="mailto:'.$this->user_info[ACL_INFO_EMAIL].'">'.$this->user_info[ACL_INFO_EMAIL].'</a>'
     						: $this->_lang->def('_HIDDEN')
     					)."\n\t"
     				.'</p>'."\n\t"
     			.'</div>'."\n"
     
     		.'</div>'."\n";
     */
     return $html;
 }
Ejemplo n.º 8
0
function mycourses(&$url)
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.user_profile.php';
    $lang =& DoceboLanguage::createInstance('catalogue');
    require_once $GLOBALS['where_lms'] . '/lib/lib.middlearea.php';
    $ma = new Man_MiddleArea();
    $course_stats = userCourseList($url, $ma->currentCanAccessObj('lo_tab'));
    $access_career = $ma->currentCanAccessObj('career');
    $access_news = $ma->currentCanAccessObj('news');
    $access_search_form = $ma->currentCanAccessObj('search_form');
    $access_user_details_full = $ma->currentCanAccessObj('user_details_full');
    $access_user_details_short = $ma->currentCanAccessObj('user_details_short');
    $onecol = !$access_career && !$access_news && !$access_user_details_full && !$access_user_details_short;
    require_once $GLOBALS['where_framework'] . '/lib/lib.myfriends.php';
    $friends = new MyFriends(getLogUserId());
    $pendent = count($friends->getPendentRequest());
    $GLOBALS['page']->addStart('' . '<div id="mycourse_top">' . ($onecol ? '' : '<div class="mycourse_left">'), 'content');
    // user_details_short ------------------------------------------------------------------------
    if ($access_user_details_short) {
        $profile = new UserProfile(getLogUserId());
        $profile->init('profile', 'framework', 'index.php?r=' . _after_login_, 'ap');
        $GLOBALS['page']->addStart($profile->userIdMailProfile('normal', false, false), 'content');
    }
    // user_details_full ------------------------------------------------------------------------
    if ($access_user_details_full) {
        $profile = new UserProfile(getLogUserId());
        $profile->init('profile', 'framework', 'index.php?r=' . _after_login_, 'ap');
        $GLOBALS['page']->addStart($profile->homeUserProfile('normal', false, false), 'content');
    }
    // career ------------------------------------------------------------------------
    if ($access_career) {
        $base_url = 'index.php?r=' . _after_login_ . '&amp;filter=';
        $end = 0;
        if (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0) {
            $end = $course_stats['with_ustatus'][_CUS_END];
        }
        $GLOBALS['page']->addStart('' . '<div class="course_stat">' . '<table summary="">' . '<caption>' . $lang->def('_CAREER') . '</caption>' . '<tr><th scope="row">' . $lang->def('_TOTAL_COURSE') . ' :</th><td><a href="' . $base_url . 'nothing">' . ($course_stats['total'] - $end) . '</a></td></tr>' . (isset($course_stats['with_ustatus'][_CUS_END]) && $course_stats['with_ustatus'][_CUS_END] != 0 ? '<tr><th scope="row">' . $lang->def('_COURSE_END') . ' :</th><td><a href="' . $base_url . 'end">' . $course_stats['with_ustatus'][_CUS_END] . '</a></td></tr>' : '') . (isset($course_stats['expiring']) && $course_stats['expiring'] != 0 ? '<tr><th scope="row">' . $lang->def('_COURSE_EXPIRING') . ' :</th><td><a href="' . $base_url . 'expiring">' . $course_stats['expiring'] . '</a></td></tr>' : ''), 'content');
        if (count($course_stats['with_ulevel']) > 1) {
            require_once $GLOBALS['where_lms'] . '/lib/lib.levels.php';
            $lvl = CourseLevel::getLevels();
            foreach ($course_stats['with_ulevel'] as $lvl_num => $quantity) {
                $GLOBALS['page']->addStart('' . '<tr><th scope="row">' . str_replace('[level]', $lvl[$lvl_num], $lang->def('_COURSE_AS')) . ' :</th><td><a href="' . $base_url . 'level&amp;filter_on=' . $lvl_num . '">' . $quantity . '</a></td></tr>', 'content');
            }
            //end foreach
        }
        $query = "SELECT c.idMetaCertificate, m.idCertificate" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course as c" . " JOIN " . $GLOBALS['prefix_lms'] . "_certificate_meta as m ON c.idMetaCertificate = m.idMetaCertificate" . " WHERE c.idUser = '******'" . " GROUP BY c.idMetaCertificate" . " ORDER BY m.title, m.description";
        $result = sql_query($query);
        $num_meta_cert = mysql_num_rows($result);
        while (list($id_meta, $id_certificate) = sql_fetch_row($result)) {
            $query_released = "SELECT on_date" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_assign" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'";
            $result_released = sql_query($query_released);
            $query = "SELECT user_release" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate" . " WHERE id_certificate = '" . $id_certificate . "'";
            list($user_release) = sql_fetch_row(sql_query($query));
            if (mysql_num_rows($result_released)) {
            } elseif ($user_release == 0) {
                $num_meta_cert--;
            } else {
                $query = "SELECT idCourse" . " FROM " . $GLOBALS['prefix_lms'] . "_certificate_meta_course" . " WHERE idUser = '******'" . " AND idMetaCertificate = '" . $id_meta . "'";
                $result_int = sql_query($query);
                $control = true;
                while (list($id_course) = sql_fetch_row($result_int)) {
                    $query = "SELECT COUNT(*)" . " FROM " . $GLOBALS['prefix_lms'] . "_courseuser" . " WHERE idCourse = '" . $id_course . "'" . " AND idUser = '******'" . " AND status = '" . _CUS_END . "'";
                    list($number) = sql_fetch_row(sql_query($query));
                    if (!$number) {
                        $control = false;
                    }
                }
                if (!$control) {
                    $num_meta_cert--;
                }
            }
        }
        $tot_cert = $num_meta_cert + $course_stats['cert_relesable'];
        $GLOBALS['page']->addStart('' . (isset($course_stats['cert_relesable']) && $tot_cert != 0 ? '<tr><th scope="row">' . $lang->def('_CERT_RELESABLE') . ' :</th><td><a href="index.php?modname=mycertificate&amp;op=mycertificate">' . $tot_cert . '</a></td></tr>' : '') . ($pendent != 0 ? '<tr><th scope="row">' . $lang->def('_FRIEND_PENDENT') . ' :</th><td><a href="index.php?modname=myfriends&amp;op=myfriends">' . $pendent . '</a></td></tr>' : '') . '</table>' . '</div>', 'content');
    }
    // career ------------------------------------------------------------------------
    if ($access_search_form) {
        $year_array = array(0 => $lang->def('_ALL_YEAR'));
        $query_year = "SELECT DISTINCT create_date" . " FROM " . $GLOBALS['prefix_lms'] . "_course";
        $result = sql_query($query_year);
        while (list($year) = sql_fetch_row($result)) {
            $year_array[$year[0] . $year[1] . $year[2] . $year[3]] = $year[0] . $year[1] . $year[2] . $year[3];
        }
        if (isset($year_array['0000'])) {
            unset($year_array['0000']);
        }
        $GLOBALS['page']->addStart('' . '<div class="course_search">' . '<h2>' . $lang->def('_SEARCH') . '</h2>' . Form::openForm('course_filter', 'index.php?modname=course&amp;op=mycourses') . '<p>' . Form::getLabel('search', $lang->def('_WORD')) . '</p>' . Form::getInputTextfield('textfield_nowh', 'search', 'search', importVar('search'), $lang->def('_WORD'), '255', '') . '<br/>' . '<p>' . Form::getLabel('year', $lang->def('_YEAR')) . '</p>' . Form::getInputDropdown('dropdown_nowh', 'year', 'year', $year_array, importVar('year'), '') . Form::getButton('apply_filter', 'apply_filter', $lang->def('_SEARCH')) . Form::closeForm() . '</div>', 'content');
    }
    // news ------------------------------------------------------------------------
    if ($access_news) {
        $GLOBALS['page']->addStart('' . '<div class="course_news">' . '<h2>' . $lang->def('_NEWS') . '</h2>', 'content');
        $user_level = Docebo::user()->getUserLevelId();
        $user_assigned = Docebo::user()->getArrSt();
        $query_news = "\r\n\t\tSELECT idNews, publish_date, title, short_desc, important, viewer\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_news_internal\r\n\t\tWHERE language = '" . getLanguage() . "'\r\n\t\tORDER BY important DESC, publish_date DESC ";
        $re_news = sql_query($query_news);
        $displayed = 0;
        while (list($id_news, $publish_date, $title, $short_desc, $impo, $viewer) = sql_fetch_row($re_news)) {
            $viewer = is_string($viewer) && $viewer != false ? unserialize($viewer) : array();
            $intersect = array_intersect($user_assigned, $viewer);
            if (!empty($intersect) || empty($viewer)) {
                $GLOBALS['page']->addStart('<h3>' . $title . '</h3>' . '<div class="news_textof">' . '<span class="news_data">' . Format::date($publish_date, 'date') . ' - </span>' . $short_desc . '</div>', 'content');
                $displayed++;
            }
        }
        // end news display
        if (!$displayed) {
            $GLOBALS['page']->addStart($lang->def('_NO_CONTENT'), 'content');
        }
        $GLOBALS['page']->addStart('' . '</div>', 'content');
    }
    if (!$onecol) {
        $GLOBALS['page']->addStart('' . '</div>', 'content');
        $GLOBALS['page']->addStart('' . '<div id="mycourse_right">', 'content');
    }
    // ------------------------------------------------------------------------
    if (!$onecol) {
        $GLOBALS['page']->addEnd('' . '</div>' . '<div class="nofloat"></div>', 'content');
    }
    $GLOBALS['page']->addEnd('' . '</div>', 'content');
    if ($ma->currentCanAccessObj('lo_tab')) {
        $current_tab = importVar('current_tab', false, 'lo_plan');
        $GLOBALS['page']->addStart('<div class="lo_tab">' . '<h1>' . $lang->def('_WELCOME') . ': ' . '<span>' . Docebo::user()->getUserName() . '</span>' . '</h1>' . '<ul class="flat_tab">' . ($course_stats['with_ustatus'][_CUS_END] != $course_stats['total'] ? '<li ' . ($current_tab == 'lo_plan' ? 'class="now_selected"' : '') . '>' . '<a href="index.php?modname=course&amp;op=mycourses&amp;current_tab=lo_plan"><span>' . $lang->def('_COURSE') . '</span></a></li>' : '') . ($course_stats['with_ustatus'][_CUS_END] != 0 ? '<li ' . ($current_tab == 'lo_history' ? 'class="now_selected"' : '') . '>' . '<a href="index.php?modname=course&amp;op=mycourses&amp;current_tab=lo_history"><span>' . $lang->def('_COMPLETED') . '</span></a></li>' : '') . ($course_stats['with_wstatus'][_CUS_RESERVED] != 0 || $course_stats['with_wstatus'][_CUS_WAITING_LIST] != 0 ? '<li ' . ($current_tab == 'lo_waiting' ? 'class="now_selected"' : '') . '>' . '<a href="index.php?modname=course&amp;op=mycourses&amp;current_tab=lo_waiting"><span>' . $lang->def('_LO_WAITING') . '</span></a></li>' : '') . '</ul>' . '</div>', 'content');
    } else {
        $GLOBALS['page']->addStart('<div class="lo_tab">' . '<h1 class="no_tab">' . $lang->def('_WELCOME') . ': ' . '<span>' . Docebo::user()->getUserName() . '</span>' . '</h1>' . '</div>', 'content');
    }
}
 public function completedTask()
 {
     $model = new ClassroomLms();
     $filter_text = Get::req('filter_text', DOTY_STRING, "");
     $filter_year = Get::req('filter_year', DOTY_INT, 0);
     $conditions = array('cu.iduser = :id_user', 'cu.status = :status');
     $params = array(':id_user' => (int) Docebo::user()->getId(), ':status' => _CUS_END);
     if (!empty($filter_text)) {
         $conditions[] = "(c.code LIKE '%:keyword%' OR c.name LIKE '%:keyword%')";
         $params[':keyword'] = $filter_text;
     }
     if (!empty($filter_year)) {
         $clist = $model->getUserCoursesByYear(Docebo::user()->getId(), $filter_year);
         if ($clist !== false) {
             $conditions[] = "cu.idCourse IN (" . implode(",", $clist) . ")";
         }
     }
     $courselist = $model->findAll($conditions, $params);
     //check courses accessibility
     $keys = array_keys($courselist);
     for ($i = 0; $i < count($keys); $i++) {
         $courselist[$keys[$i]]['can_enter'] = Man_Course::canEnterCourse($courselist[$keys[$i]]);
     }
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $this->render('courselist', array('path_course' => $this->path_course, 'courselist' => $courselist, 'use_label' => $ma->currentCanAccessObj('tb_label'), 'display_info' => $this->_getClassDisplayInfo($keys), 'dm' => new DateManager(), 'keyword' => $filter_text));
 }
Ejemplo n.º 10
0
defined("IN_FORMA") or die('Direct access is forbidden.');
/* ======================================================================== \
|   FORMA - The E-Learning Suite                                            |
|                                                                           |
|   Copyright (c) 2013 (Forma)                                              |
|   http://www.formalms.org                                                 |
|   License  http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt           |
|                                                                           |
|   from docebo 4.0.5 CE 2008-2012 (c) docebo                               |
|   License http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt            |
\ ======================================================================== */
if (!Docebo::user()->isAnonymous()) {
    YuiLib::load('base,menu');
    require_once _lms_ . '/lib/lib.middlearea.php';
    $ma = new Man_MiddleArea();
    $user_level = Docebo::user()->getUserLevelId();
    $query_menu = "\r\n\tSELECT mo.idModule, mo.module_name, mo.default_op, mo.mvc_path, mo.default_name, mo.token_associated, mo.module_info\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_module AS mo\r\n\t\tJOIN " . $GLOBALS['prefix_lms'] . "_menucourse_under AS under\r\n\t\t\tON ( mo.idModule = under.idModule)\r\n\tWHERE module_info IN ('all', 'user', 'public_admin')\r\n\tORDER BY module_info, under.sequence ";
    $menu = array();
    $re_menu_voice = sql_query($query_menu);
    while (list($id_m, $module_name, $def_op, $mvc_path, $default_name, $token, $m_info) = sql_fetch_row($re_menu_voice)) {
        if ($ma->currentCanAccessObj('mo_' . $id_m) && checkPerm($token, true, $module_name, true)) {
            // if e-learning tab disabled, show classroom courses
            if ($module_name === 'course' && !$ma->currentCanAccessObj('tb_elearning')) {
                $mvc_path = 'lms/classroom/show';
            }
            $menu[$m_info][$id_m] = array('index.php?' . ($mvc_path ? 'r=' . $mvc_path : 'modname=' . $module_name . '&amp;op=' . $def_op) . '&amp;sop=unregistercourse', Lang::t($default_name, 'menu_over'), false);
        }
    }
    if (isset($menu['all'])) {
        $menu_i = count($menu['all']) - 1;
Ejemplo n.º 11
0
 public function run()
 {
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $this->block_list = array();
     if ($ma->currentCanAccessObj('user_details_short')) {
         $this->block_list['user_details_short'] = true;
     }
     if ($ma->currentCanAccessObj('user_details_full')) {
         $this->block_list['user_details_full'] = true;
     }
     if ($ma->currentCanAccessObj('credits')) {
         $this->block_list['credits'] = true;
     }
     if ($ma->currentCanAccessObj('news')) {
         $this->block_list['news'] = true;
     }
     if ($ma->currentCanAccessObj('career')) {
         $this->block_list['career'] = true;
     }
     if ($ma->currentCanAccessObj('course')) {
         $this->block_list['course'] = true;
     }
     if (isset($this->block_list['user_details_full'])) {
         /*
          * echo '<div class="inline_block">' .'<div class="content">';
          */
         $this->user_details_full($this->link);
         /*
          * echo '</div>' .'</div>';
          */
     }
     if (isset($this->block_list['labels'])) {
         echo '<div class="inline_block">';
         $this->label($this->link);
         echo '</div>';
     }
     if (isset($this->block_list['credits'])) {
         echo '<div class="inline_block">';
         $this->credits($this->link);
         echo '</div>';
     }
     if (isset($this->block_list['news'])) {
         echo '<div class="inline_block">';
         $this->news($this->link);
         echo '</div>';
     }
     // modifica box carriera
     if (isset($this->block_list['career'])) {
         echo '<div class="inline_block">';
         $this->career();
         echo '</div>';
     }
     // modifica box iscrizione corso
     if (isset($this->block_list['course'])) {
         echo '<div class="inline_block">';
         $this->subscribe_course();
         echo '</div>';
     }
     // END
 }
Ejemplo n.º 12
0
 public function allTask()
 {
     $model = new ElearningLms();
     $filter_text = Get::req('filter_text', DOTY_STRING, "");
     $filter_year = Get::req('filter_year', DOTY_INT, 0);
     $conditions = array('cu.iduser = :id_user', 'cu.status <> :status');
     $params = array(':id_user' => (int) Docebo::user()->getId(), ':status' => _CUS_END);
     if (!empty($filter_text)) {
         $conditions[] = "(c.code LIKE '%:keyword%' OR c.name LIKE '%:keyword%')";
         $params[':keyword'] = $filter_text;
     }
     if (!empty($filter_year)) {
         $conditions[] = "(cu.date_inscr >= ':year-00-00 00:00:00' AND cu.date_inscr <= ':year-12-31 23:59:59')";
         $params[':year'] = $filter_year;
     }
     //		$cp_courses = $model->getUserCoursePathCourses( Docebo::user()->getIdst() );
     //		if (!empty($cp_courses)) {
     //			$conditions[] = "cu.idCourse NOT IN (".implode(",", $cp_courses).")";
     //		}
     $courselist = $model->findAll($conditions, $params);
     //check courses accessibility
     $keys = array_keys($courselist);
     for ($i = 0; $i < count($keys); $i++) {
         $courselist[$keys[$i]]['can_enter'] = Man_Course::canEnterCourse($courselist[$keys[$i]]);
     }
     require_once _lms_ . '/lib/lib.middlearea.php';
     $ma = new Man_MiddleArea();
     $this->render('courselist', array('path_course' => $this->path_course, 'courselist' => $courselist, 'use_label' => $ma->currentCanAccessObj('tb_label'), 'keyword' => $filter_text));
 }