Ejemplo n.º 1
0
function groupCodeList()
{
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    $lang =& DoceboLanguage::createInstance('code');
    $code_manager = new CodeManager();
    $tot_group_code = $code_manager->getCodeGroupNumber();
    cout(getTitleArea($lang->def('_CODE')) . '<div class="std_block">');
    $result = Get::req('result', DOTY_STRING, '');
    if (isset($_GET['activation'])) {
        $query = "UPDATE " . $GLOBALS['prefix_fw'] . "_setting" . " SET param_value = 'on'" . " WHERE param_name = 'use_code_module'";
        if (sql_query($query)) {
            Util::jump_to('index.php?modname=code&amp;op=list&result=ok');
        } else {
            Util::jump_to('index.php?modname=code&amp;op=list&result=err');
        }
    }
    if (Get::cfg('use_code_module') === 'off') {
        cout(getResultUi('<a href="index.php?modname=code&amp;op=list&amp;activation=true">' . $lang->def('_MODULE_NOT_ACTIVATED') . '</a>'));
    }
    switch ($result) {
        case 'ok':
            UIFeedback::info($lang->def('_OPERATION_SUCCESSFUL'));
            break;
        case 'err':
            UIFeedback::error($lang->def('_OPERATION_FAILURE'));
            break;
    }
    if ($tot_group_code) {
        $tb = new Table('20');
        $tb->initNavBar('ini', 'link');
        $ini = $tb->getSelectedElement();
        $cont_h = array($lang->def('_TITLE'), $lang->def('_DESCRIPTION'), $lang->def('_CODE_USED_NUMBER'), Get::sprite('subs_csv', Lang::t('_CODE', 'course')), Get::sprite('subs_add', Lang::t('_GENERATE_CODE', 'course')), Get::sprite('subs_import', Lang::t('_IMPORT', 'course')), Get::sprite('subs_elem', Lang::t('_COURSES', 'course')), Get::sprite('subs_users', Lang::t('_ASSIGN_USERS', 'course')), Get::sprite('subs_mod', Lang::t('_MOD', 'course')), Get::sprite('subs_del', Lang::t('_DEL', 'course')));
        $type_h = array('', '', 'min-cell', 'image', 'image', 'image', 'image', 'image', 'image', 'image');
        $tb->setColsStyle($type_h);
        $tb->addHead($cont_h);
        $array_group_code = $code_manager->getCodeGroupsList($ini);
        foreach ($array_group_code as $group_code_info) {
            $cont = array();
            $cont[] = $group_code_info['title'];
            $cont[] = $group_code_info['description'];
            $cont[] = $group_code_info['code_used'];
            $cont[] = '<a href="index.php?modname=code&amp;op=code_list&amp;id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_csv', Lang::t('_CODE', 'course')) . '</a>';
            $cont[] = '<a href="index.php?modname=code&amp;op=generate_code&amp;id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_add', Lang::t('_GENERATE_CODE', 'course')) . '</a>';
            $cont[] = '<a href="index.php?modname=code&amp;op=import_code&amp;id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_import', Lang::t('_IMPORT', 'course')) . '</a>';
            $cont[] = '<a href="index.php?modname=code&amp;op=assign_course&amp;id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_elem' . ($group_code_info['course_associated'] ? '' : '_grey'), Lang::t('_COURSES', 'course')) . '</a>';
            $cont[] = '<a href="index.php?modname=code&amp;op=assign_tree&amp;id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_users' . ($group_code_info['folder_associated'] ? '' : '_grey'), Lang::t('_ASSIGN_USERS', 'course')) . '</a>';
            $cont[] = '<a href="index.php?modname=code&amp;op=mod_group_code&amp;id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_mod', Lang::t('_MOD', 'course')) . '</a>';
            $cont[] = '<a href="index.php?modname=code&amp;op=del_group_code&amp;id_code_group=' . $group_code_info['id_code_group'] . '">' . Get::sprite('subs_del', Lang::t('_DEL', 'course')) . '</a>';
            $tb->addBody($cont);
        }
        $tb->addActionAdd('<a href="index.php?modname=code&amp;op=add_group_code">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>');
        cout($tb->getTable() . $tb->getNavBar($ini, $tot_group_code));
        setupHrefDialogBox('a[href*=del_group_code]');
    } else {
        cout($lang->def('_NO_CONTENT') . '<br/>' . '<a href="index.php?modname=code&amp;op=add_group_code">' . '<img src="' . getPathImage() . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_ADD') . '</a>');
    }
    cout('</div>');
}
Ejemplo n.º 2
0
$languages = array('_ROOT' => Get::sett('title_kb_tree', Lang::t('_CATEGORY', 'kb')), '_YES' => Lang::t('_CONFIRM', 'organization_chart'), '_NO' => Lang::t('_UNDO', 'organization_chart'), '_LOADING' => Lang::t('_LOADING', 'standard'), '_NEW_FOLDER_NAME' => Lang::t('_ORGCHART_ADDNODE', 'organization_chart'), '_AREYOUSURE' => Lang::t('_AREYOUSURE', 'organization_chart'), '_NAME' => Lang::t('_NAME', 'standard'), '_MOD' => Lang::t('_MOD', 'standard'), '_DEL' => Lang::t('_DEL', 'standard'));
$params = array('id' => 'kbtree', 'ajaxUrl' => 'ajax.adm_server.php?r=alms/kb/gettreedata', 'treeClass' => 'KbFolderTree', 'treeFile' => Get::rel_path('lms') . '/admin/views/kb/kbfoldertree.js', 'languages' => $languages, 'initialSelectedNode' => (int) $selected_node, 'rootActions' => '', 'show' => 'tree', 'dragDrop' => true);
if ($permissions['add']) {
    $params['rel_action'] = '<a class="ico-wt-sprite subs_add" id="add_kb_folder" href="ajax.adm_server.php?r=alms/kb/addfolder_dialog&id=' . (int) $selected_node . '" ' . ' title="' . Lang::t('_ORGCHART_ADDNODE', 'organization_chart') . '">' . '<span>' . Lang::t('_ORGCHART_ADDNODE', 'organization_chart') . '</span>' . '</a>';
    /**
     * Add folder dialog
     */
    $this->widget('dialog', array('id' => 'add_folder_dialog', 'dynamicContent' => true, 'ajaxUrl' => 'function() { return YAHOO.util.Dom.get("add_kb_folder").href; }', 'dynamicAjaxUrl' => true, 'callback' => 'KbManagement.addFolderCallback', 'callEvents' => array(array('caller' => 'add_kb_folder', 'event' => 'click'))));
}
$this->widget('tree', $params);
?>
	</div>
	<div class="panel_right_big">
	<?php 
$columns = array(array('key' => 'r_name', 'label' => Lang::t('_NAME', 'kb'), 'sortable' => true), array('key' => 'r_type', 'label' => Lang::t('_TYPE', 'kb'), 'sortable' => true, 'className' => 'img-cell'), array('key' => 'r_env', 'label' => Lang::t('_ENVIRONMENT', 'kb'), 'sortable' => true), array('key' => 'r_env_parent', 'label' => Lang::t('_CONTAINED_IN', 'kb'), 'sortable' => false), array('key' => 'r_lang', 'label' => Lang::t('_LANGUAGE', 'kb'), 'sortable' => true), array('key' => 'tags', 'label' => Lang::t('_TAGS', 'kb'), 'sortable' => false));
if ($permissions['mod']) {
    $_title_categorize = Lang::t('_MOD', 'kb');
    $_title_users = Lang::t('_SET_VISIBLE_TO_EVERYONE', 'kb');
    $_sprite_categorize = Get::sprite('subs_categorize', $_title_categorize, $_title_categorize);
    $_sprite_users = Get::sprite('subs_users', $_title_users, $_title_users);
    $columns[] = array('key' => 'edit', 'label' => $_sprite_categorize, 'formatter' => 'frm_edit', 'className' => 'img-cell');
    $columns[] = array('key' => 'force_visible', 'label' => $_sprite_users, 'formatter' => 'fv_switch', 'className' => 'img-cell');
}
$_title_play = Lang::t('_PLAY', 'kb');
$_sprite_play = Get::sprite('subs_play', $_title_play, $_title_play);
$columns[] = array('key' => 'play', 'label' => $_sprite_play, 'formatter' => 'frm_play', 'className' => 'img-cell');
$this->widget('table', array('id' => 'kb_table', 'ajaxUrl' => 'ajax.adm_server.php?r=alms/kb/getlist', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'r_name', 'dir' => 'asc', 'generateRequest' => 'KbManagement.requestBuilder', 'events' => array('postRenderEvent' => 'function () { lb.init(); }'), 'columns' => $columns, 'fields' => array('res_id', 'r_name', 'r_type', 'r_env', 'r_env_parent', 'r_lang', 'tags', 'edit', 'force_visible', 'is_mobile', 'is_categorized')));
?>
	</div>
	<div class="nofloat"></div>
</div>
Ejemplo n.º 3
0
		}

		var post = "&id_user="******"&idst_profile=" + new_value + "&old_value=" + old_value;
		var url = "ajax.adm_server.php?r=adm/publicadminmanager/update_profile";
		YAHOO.util.Connect.asyncRequest("POST", url, editorCallback, post);
	}

}

PublicAdminManagement.init({
	filterText: "<?php 
echo $filter_text;
?>
",
	noProfileIcon: '<?php 
echo addslashes(Get::sprite('fd_notice', Lang::t('_NONE', 'adminrules')));
?>
',
	langs: {
		_NONE: "<?php 
echo Lang::t('_NONE', 'adminrules');
?>
",
		_USERS_ASSOCIATION: "<?php 
echo Lang::t('_ASSIGN_USERS', 'adminmanager');
?>
",
		_COURSES: "<?php 
echo Lang::t('_COURSES', 'adminmanager');
?>
",
Ejemplo n.º 4
0
 /**
  * @version  $Id: catalogue.php 573 2006-08-23 09:38:54Z fabio $
  * @category Course managment
  * @author	 Fabio Pirovano <fabio [at] docebo [dot] com>
  */
 function catlist()
 {
     checkPerm('view');
     require_once _base_ . '/lib/lib.table.php';
     $lang =& DoceboLanguage::createInstance('catalogue', 'lms');
     $out =& $GLOBALS['page'];
     $mod_perm = checkPerm('mod', true);
     $title_area = array($lang->def('_CATALOGUE'));
     // Retriving data
     if (Docebo::user()->getUserLevelId() != ADMIN_GROUP_GODADMIN) {
         $all_courses = false;
         require_once _base_ . '/lib/lib.preference.php';
         $adminManager = new AdminPreference();
         $admin_courses = $adminManager->getAdminCourse(Docebo::user()->getIdST());
         if (isset($admin_courses['course'][0])) {
             $all_courses = true;
         }
         if (isset($admin_courses['course'][-1])) {
             require_once _lms_ . '/lib/lib.catalogue.php';
             $cat_man = new Catalogue_Manager();
             $admin_courses['catalogue'] = $cat_man->getUserAllCatalogueId(Docebo::user()->getIdSt());
         }
         if ($all_courses) {
             $query_catalogue = "\r\n\t\t\tSELECT idCatalogue, name, description\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue\r\n\t\t\tWHERE 1\r\n\t\t\tORDER BY name";
         } elseif (empty($admin_courses['catalogue'])) {
             $query_catalogue = "\r\n\t\t\tSELECT idCatalogue, name, description\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue\r\n\t\t\tWHERE 0\r\n\t\t\tORDER BY name";
         } else {
             $query_catalogue = "\r\n\t\t\tSELECT idCatalogue, name, description\r\n\t\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue\r\n\t\t\tWHERE idCatalogue IN (" . implode(',', $admin_courses['catalogue']) . ")\r\n\t\t\tORDER BY name";
         }
     } else {
         $query_catalogue = "\r\n\t\tSELECT idCatalogue, name, description\r\n\t\tFROM " . $GLOBALS['prefix_lms'] . "_catalogue\r\n\t\tORDER BY name";
     }
     $re_catalogue = sql_query($query_catalogue);
     // Table
     $tb_catalogue = new Table(0, false, $lang->def('_CATALOGUE_SUMMARY'));
     // Table intestation
     $type_h = array('', '', 'image');
     $cont_h = array($lang->def('_NAME'), $lang->def('_DESCRIPTION'), '<img src="' . getPathImage('fw') . 'standard/modelem.png" alt="' . $lang->def('_MOD') . '" />');
     if ($mod_perm) {
         $type_h[] = 'image';
         $cont_h[] = '<img src="' . getPathImage('fw') . 'standard/moduser.png" alt="' . $lang->def('_ASSIGN_USERS') . '" />';
         //--- new: subscription action ---------------------------------------------
         $type_h[] = 'image';
         $cont_h[] = '<span class="ico-sprite subs_plus"><span>' . $lang->def('_SUBSCRIBE') . '</span></span>';
         //--------------------------------------------------------------------------
         $type_h[] = 'image';
         $type_h[] = 'image';
         $cont_h[] = '<img src="' . getPathImage('fw') . 'standard/edit.png" alt="' . $lang->def('_MOD') . '" />';
         if (!Get::cfg('demo_mode')) {
             $cont_h[] = '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . '" />';
         }
     }
     $tb_catalogue->setColsStyle($type_h);
     $tb_catalogue->addHead($cont_h);
     // Table content
     while (list($id, $name, $description) = sql_fetch_row($re_catalogue)) {
         $length = 100;
         $description = Util::purge($description);
         //strip html tags
         $description = stripslashes($description);
         $description = html_entity_decode($description, ENT_QUOTES, "UTF-8");
         if (strlen($description) > $length) {
             $description = substr($description, 0, $length);
         }
         $description = htmlentities($description, ENT_QUOTES, "UTF-8");
         if (courses_count($id) != '0') {
             $cont = array($name, $description, '<a href="index.php?modname=catalogue&amp;op=entrylist&amp;id=' . $id . '" ' . 'title="' . $lang->def('_MOD_ENTRY_CATALOGUE') . ' : ' . strip_tags($name) . '">' . '<img src="' . getPathImage('fw') . 'standard/modelem.png" alt="' . $lang->def('_MOD') . ' : ' . strip_tags($name) . '" /></a>');
         } else {
             $cont = array($name, $description, '<a href="index.php?modname=catalogue&amp;op=entrylist&amp;id=' . $id . '">' . Get::sprite('fd_notice', Lang::t('_MOD_ENTRY_CATALOGUE', 'catalogue') . ' : ' . strip_tags($name)) . '</a>');
         }
         if ($mod_perm) {
             $cont[] = '<a href="index.php?modname=catalogue&amp;op=modcatalogueassoc&amp;load=1&amp;id_catalogue=' . $id . '" ' . 'title="' . $lang->def('_ASSIGN_USERS') . ' : ' . strip_tags($name) . '">' . '<img src="' . getPathImage('fw') . 'standard/moduser.png" alt="' . $lang->def('_ASSIGN_USERS') . ' : ' . strip_tags($name) . '" /></a>';
             //--- new: subscription action -------------------------------------------
             $cont[] = '<a class="ico-sprite subs_plus" href="index.php?r=alms/subscription/cataloguesubscribeusers&amp;id_catalogue=' . $id . '" ' . 'title="' . $lang->def('_SUBSCRIBE') . ' : ' . strip_tags($name) . '">' . '<span>' . $lang->def('_SUBSCRIBE') . '</span></a>';
             //------------------------------------------------------------------------
             $cont[] = '<a href="index.php?modname=catalogue&amp;op=modcatalogue&amp;id=' . $id . '" ' . 'title="' . $lang->def('_MOD') . ' : ' . strip_tags($name) . '">' . '<img src="' . getPathImage('fw') . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . strip_tags($name) . '" /></a>';
             if (!Get::cfg('demo_mode')) {
                 $cont[] = '<a href="index.php?modname=catalogue&amp;op=delcatalogue&amp;id=' . $id . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . strip_tags($name) . '">' . '<img src="' . getPathImage('fw') . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . strip_tags($name) . '" /></a>';
             }
         }
         $tb_catalogue->addBody($cont);
     }
     require_once _base_ . '/lib/lib.dialog.php';
     setupHrefDialogBox('a[href*=delcatalogue]');
     // Action for new catalogue
     if ($mod_perm) {
         $tb_catalogue->addActionAdd('<a href="index.php?modname=catalogue&amp;op=newcatalogue" title="' . $lang->def('_NEW_CATALOGUE') . '">' . '<img src="' . getPathImage('fw') . 'standard/add.png" alt="' . $lang->def('_ADD') . '" />' . $lang->def('_NEW_CATALOGUE') . '</a>');
     }
     $out->add(getTitleArea($title_area, 'catalogue') . '<div class="std_block">', 'content');
     /*if(isset($_POST['result']))
     	switch($_POST['result']) {
     		case "ok" : 	$out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')), 'content');	break;
     		case "err" :	$out->add(getErrorUi($lang->def('_OPERATION_ERROR')), 'content');	break;
     	}*/
     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;
     }
     //result of catalogue subscribe operation
     $res = Get::req('res', DOTY_INT, -2);
     if ($res != -2) {
         if ($res >= 0) {
             UIFeedback::info(Lang::t('_OPERATION_SUCCESSFUL', 'standard'));
         }
         if ($res < 0) {
             UIFeedback::error(Lang::t('_OPERATION_FAILURE', 'standard'));
         }
     }
     $out->add($tb_catalogue->getTable() . '</div>', 'content');
 }
Ejemplo n.º 5
0
<?php

echo getTitleArea(Lang::t('_LABELS', 'label'));
?>
<div class="std_block">
<?php 
$_columns = array(array('key' => 'title', 'label' => Lang::t('_TITLE', 'label')), array('key' => 'description', 'label' => Lang::t('_DESCRIPTION', 'label')));
if ($permissions['mod']) {
    $_columns[] = array('key' => 'move_up', 'label' => '<span class="ico-sprite subs_up" title="' . Lang::t('_MOVE_UP', 'label') . '"><span>' . Lang::t('_MOVE_UP', 'label') . '</span></span>', 'className' => 'img-cell', 'formatter' => 'Labels.upFormatter');
    $_columns[] = array('key' => 'move_down', 'label' => '<span class="ico-sprite subs_down" title="' . Lang::t('_MOVE_DOWN', 'label') . '"><span>' . Lang::t('_MOVE_DOWN', 'label') . '</span></span>', 'className' => 'img-cell', 'formatter' => 'Labels.downFormatter');
    $_columns[] = array('key' => 'mod', 'label' => '<span class="ico-sprite subs_mod" title="' . Lang::t('_MOD', 'label') . '"><span>' . Lang::t('_MOD', 'label') . '</span></span>', 'className' => 'img-cell');
}
if ($permissions['del']) {
    $_columns[] = array('key' => 'del', 'label' => Get::sprite('subs_del', Lang::t('_DEL', 'label')), 'formatter' => 'doceboDelete', 'className' => 'img-cell');
}
$_params = array('id' => 'label_table', 'ajaxUrl' => 'ajax.adm_server.php?r=alms/label/getLabels', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => '', 'columns' => $_columns, 'fields' => array('id_common_label', 'title', 'description', 'position', 'sequence', 'mod', 'del'), 'delDisplayField' => 'title', 'events' => array('beforeRenderEvent' => 'function() {
			var rlist = YAHOO.util.Selector.query("a[id^=move_]");
			for (var i=0; i<rlist.length; i++) YAHOO.util.Event.purgeElement(rlist[i]);
		}', 'postRenderEvent' => 'function() {
			var rlist = YAHOO.util.Selector.query("a[id^=move_]");
			YAHOO.util.Event.addListener(rlist, "click", Labels.move_label);
		}'));
if ($permissions['add']) {
    $_params['rel_actions'] = '<a class="ico-wt-sprite subs_add" href="index.php?r=alms/label/add"><span>' . Lang::t('_ADD', 'standard') . '</span></a>';
}
$this->widget('table', $_params);
?>
</div>
<script type="text/javascript">
var Labels = {
	move_label: function(e) {
Ejemplo n.º 6
0
<?php

Get::title(array('index.php?r=' . $base_link_course . '/show' => Lang::t('_COURSE', 'course'), Lang::t('_CLASSROOM', 'course') . ' : ' . $course_name));
?>
<div class="std_block">
<?php 
echo getBackUi('index.php?r=' . $base_link_course . '/show', Lang::t('_BACK', 'course'));
$_columns = array(array('key' => 'code', 'label' => Lang::t('_CODE', 'course'), 'sortable' => true), array('key' => 'name', 'label' => Lang::t('_NAME', 'course'), 'sortable' => true), array('key' => 'status', 'label' => Lang::t('_STATUS', 'course'), 'sortable' => true, 'formatter' => 'statusFormatter'), array('key' => 'date_begin', 'label' => Lang::t('_DATE_BEGIN', 'course'), 'sortable' => true), array('key' => 'date_end', 'label' => Lang::t('_DATE_END', 'course'), 'sortable' => true), array('key' => 'classroom', 'label' => Lang::t('_CLASSROOM', 'course')), array('key' => 'students', 'label' => Lang::t('_STUDENTS', 'coursereport'), 'className' => 'img-cell'));
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();
Ejemplo n.º 7
0
				close: true,
				visible: false,
				fixedcenter: false,
				constraintoviewport: false,
				draggable: true,
				hideaftersubmit: false,
				isDynamic: true,
				ajaxUrl: this.href,
				confirmOnly: false,
				renderEvent: function() { this.center(); },
				destroyEvent: function() {},
				callback: function() {
					this.destroy();
				}
			});
			oDialog.call(this, e);
		});
	}
}
</script>
<?php 
echo getTitleArea(Lang::t('_ADMIN_RULES', 'adminrules'));
?>
<div class="std_block">
<?php 
echo $result_message;
$add_url = 'ajax.adm_server.php?r=adm/adminrules/addGroup';
$rel_action = '<a class="ico-wt-sprite subs_add" href="' . $add_url . '" title="' . Lang::t('_ADD', 'standard') . '"><span>' . Lang::t('_ADD', 'standard') . '</span></a>';
$this->widget('table', array('id' => 'admin_rules_table', 'ajaxUrl' => 'ajax.adm_server.php?r=adm/adminrules/getGroups&', 'rowsPerPage' => Get::sett('visuItem', 25), 'startIndex' => 0, 'results' => Get::sett('visuItem', 25), 'sort' => 'groupid', 'dir' => 'asc', 'columns' => array(array('key' => 'groupid', 'label' => Lang::t('_NAME', 'adminrules'), 'sortable' => true, 'editor' => 'new YAHOO.widget.TextboxCellEditor({asyncSubmitter: saveData})'), array('key' => 'special', 'label' => Get::sprite('subs_conf', Lang::t('_SPECIAL_SETTING', 'adminrules')), 'className' => 'img-cell'), array('key' => 'menu', 'label' => Get::sprite('subs_elem', Lang::t('_EDIT_SETTINGS', 'adminrules')), 'className' => 'img-cell'), array('key' => 'lang', 'label' => Get::sprite('subs_lang', Lang::t('_LANG_SETTING', 'adminrules')), 'className' => 'img-cell'), array('key' => 'admin_manage', 'label' => Get::sprite('subs_users', Lang::t('_MANAGE_SUBSCRIPTION', 'adminrules')), 'className' => 'img-cell'), array('key' => 'del', 'label' => Get::sprite('subs_del', Lang::t('_DEL', 'standard')), 'formatter' => 'doceboDelete', 'className' => 'img-cell')), 'fields' => array('id', 'idst', 'groupid', 'special', 'menu', 'lang', 'admin_manage', 'del'), 'stdSelection' => false, 'rel_actions' => $rel_action, 'delDisplayField' => 'groupid', 'events' => array('beforeRenderEvent' => 'AdminProfile.beforeRenderEvent', 'postRenderEvent' => 'AdminProfile.postRenderEvent'), 'delDisplayField' => 'groupid'));
?>
</div>
Ejemplo n.º 8
0
/**
 * @package  DoceboLms
 * @version  $Id: meta_certificate.php,v 1
 * @author	 Marco Valloni <marco [at] docebo [dot] com>
 */
function metaCertificate()
{
    checkPerm('view');
    require_once _base_ . '/lib/lib.form.php';
    require_once _base_ . '/lib/lib.table.php';
    $mod_perm = checkPerm('mod', true);
    $lang =& DoceboLanguage::createInstance('certificate', 'lms');
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $tb = new Table(Get::sett('visuItem'), $lang->def('_META_CERTIFICATE_CAPTION'), $lang->def('_META_CERTIFICATE_SUMMARY'));
    $tb->initNavBar('ini', 'link');
    $tb->setLink("index.php?modname=meta_certificate&amp;op=meta_certificate");
    $ini = $tb->getSelectedElement();
    $form = new Form();
    if (isset($_POST['toggle_filter'])) {
        unset($_POST['filter_text']);
    }
    //search query of certificates
    $query_certificate = "\r\n\tSELECT id_certificate, code, name, description\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate" . " WHERE meta = 1";
    if (isset($_POST['filter'])) {
        if ($_POST['filter_text'] !== '') {
            $query_certificate .= " AND ( name LIKE '%" . $_POST['filter_text'] . "%'" . " OR code LIKE '%" . $_POST['filter_text'] . "%' )";
        }
    }
    $query_certificate .= " ORDER BY id_certificate\r\n\tLIMIT {$ini}," . Get::sett('visuItem');
    $query_certificate_tot = "\r\n\tSELECT COUNT(*)\r\n\tFROM " . $GLOBALS['prefix_lms'] . "_certificate";
    $re_certificate = sql_query($query_certificate);
    list($tot_certificate) = sql_fetch_row(sql_query($query_certificate_tot));
    $type_h = array('', '', '', 'image', 'image');
    $cont_h = array($lang->def('_CODE'), $lang->def('_NAME'), $lang->def('_DESCRIPTION'));
    if ($mod_perm) {
        $cont_h[] = Lang::t('_TEMPLATE', 'certificate');
    }
    $cont_h[] = '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('_PREVIEW') . '" />';
    if ($mod_perm) {
        $cont_h[] = Get::img('standard/moduser.png', Lang::t('_TITLE_ASSIGN_META_CERTIFICATE', 'certificate'));
        $type_h[] = 'image';
        $cont_h[] = Get::sprite('subs_print', Lang::t('_TITLE_CREATE_META_CERTIFICATE', 'certificate'));
        $type_h[] = 'image';
        $cont_h[] = '<img src="' . getPathImage() . 'standard/edit.png" title="' . $lang->def('_MOD') . '" ' . 'alt="' . $lang->def('_MOD') . '" />';
        $type_h[] = 'image';
        $cont_h[] = '<img src="' . getPathImage() . 'standard/delete.png" title="' . $lang->def('_DEL') . '" ' . 'alt="' . $lang->def('_DEL') . '"" />';
        $type_h[] = 'image';
    }
    $tb->setColsStyle($type_h);
    $tb->addHead($cont_h);
    while (list($id_certificate, $code, $name, $descr) = sql_fetch_row($re_certificate)) {
        $title = strip_tags($name);
        $cont = array($code, $name, Util::cut($descr));
        if ($mod_perm) {
            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=elemmetacertificate&amp;id_certificate=' . $id_certificate . '" ' . 'title="' . Lang::t('_TEMPLATE', 'certificate') . '">' . Lang::t('_TEMPLATE', 'certificate') . '</a>';
        }
        $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=preview&amp;id_certificate=' . $id_certificate . '">' . '<img src="' . getPathImage() . 'standard/view.png" alt="' . $lang->def('_PREVIEW') . ' : ' . $title . '" /></a>';
        if ($mod_perm) {
            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=assign&amp;id_certificate=' . $id_certificate . '" ' . 'title="' . $lang->def('_TITLE_ASSIGN_META_CERTIFICATE') . ' : ' . $name . '">' . Get::img('standard/moduser.png', Lang::t('_TITLE_ASSIGN_META_CERTIFICATE', 'certificate')) . '</a>';
            /*
            			$cont[] =	'<a href="index.php?modname=meta_certificate&amp;op=create&amp;id_certificate='.$id_certificate.'" '
            						.'title="'.$lang->def('_TITLE_CREATE_META_CERTIFICATE').' : '.$name.'">'
            						.Get::img('course/certificate.png', Lang::t('_TITLE_CREATE_META_CERTIFICATE', 'certificate'))
            						.'</a>';*/
            $cont[] = Get::sprite_link('subs_print', 'index.php?modname=meta_certificate&amp;op=create&amp;id_certificate=' . $id_certificate, Lang::t('_TITLE_CREATE_META_CERTIFICATE', 'certificate'));
            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=modmetacertificate&amp;id_certificate=' . $id_certificate . '" ' . 'title="' . $lang->def('_MOD') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/edit.png" alt="' . $lang->def('_MOD') . ' : ' . $title . '" /></a>';
            $cont[] = '<a href="index.php?modname=meta_certificate&amp;op=delmetacertificate&amp;id_certificate=' . $id_certificate . '" ' . 'title="' . $lang->def('_DEL') . ' : ' . $name . '">' . '<img src="' . getPathImage() . 'standard/delete.png" alt="' . $lang->def('_DEL') . ' : ' . $title . '" /></a>';
        }
        $tb->addBody($cont);
    }
    require_once _base_ . '/lib/lib.dialog.php';
    setupHrefDialogBox('a[href*=delmetacertificate]');
    if ($mod_perm) {
        $tb->addActionAdd('<a class="ico-wt-sprite subs_add" href="index.php?modname=meta_certificate&amp;op=addmetacertificate" title="' . $lang->def('_NEW_CERTIFICATE') . '"><span>' . $lang->def('_NEW_CERTIFICATE') . '</span></a>');
    }
    $out->add(getTitleArea($lang->def('_TITLE_META_CERTIFICATE'), 'certificate') . '<div class="std_block">');
    $out->add($form->openForm('certificate_filter', 'index.php?modname=meta_certificate&amp;op=meta_certificate') . '<div class="quick_search_form">
			<div>
				<div class="simple_search_box">' . Form::getInputTextfield("search_t", "filter_text", "filter_text", Get::req('filter_text', DOTY_MIXED, ''), '', 255, '') . Form::getButton("filter", "filter", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("toggle_filter", "toggle_filter", Lang::t('_RESET', 'standard'), "reset_b") . '</div>
			</div>
		</div>' . $form->closeForm());
    if (isset($_GET['result'])) {
        switch ($_GET['result']) {
            case "ok":
                $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
                break;
            case "err":
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
            case "err_del":
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
        }
    }
    $out->add($tb->getTable() . $tb->getNavBar($ini, $tot_certificate) . '</div>');
}
Ejemplo n.º 9
0
function feedbackman()
{
    checkPerm('view', false, 'storage');
    $res = '';
    require_once _lms_ . '/lib/lib.questcategory.php';
    require_once _lms_ . '/lib/lib.assessment_rule.php';
    $id_test = Get::gReq('idTest', DOTY_INT, 0);
    $back_url = urldecode(Get::gReq('back_url', DOTY_STRING));
    $url_encode = htmlentities(urlencode($back_url));
    $back_link_url = 'index.php?modname=test&amp;op=modtestgui&amp;idTest=' . $id_test . '&amp;back_url=' . $url_encode;
    $url_base = 'index.php?modname=test&idTest=' . $id_test . '&back_url=' . $url_encode . '&op=';
    $categories = Questcategory::getTestQuestionsCategories($id_test);
    unset($categories[0]);
    $categories[0] = Lang::t('_TEST_TOTAL_SCORE', 'test');
    $res .= getTitleArea(array($back_link_url => Lang::t('_TEST_SECTION', 'test'), Lang::t('_FEEDBACK_MANAGEMENT', 'test')), 'test') . '<div class="std_block">' . getBackUi($back_link_url, Lang::t('_BACK'));
    if (empty($categories)) {
        $res .= Lang::t('_NO_CATEGORIES_AVAILABLE');
    } else {
        $asrule = new AssessmentRuleManager($id_test);
        $data = $asrule->getRules();
        $first = TRUE;
        foreach ($categories as $cat_id => $category) {
            if ($first) {
                $first = FALSE;
            } else {
                $res .= '<br /><br />';
            }
            $res .= '<p>' . ($cat_id > 0 ? Lang::t('_TEST_QUEST_CATEGORY', 'test') . ': ' : '') . '<b>' . $category . '</b></p>';
            if (isset($data[$cat_id])) {
                $tb = new Table(0, false);
                $tb->addHead(array(Lang::t('_SCORE', 'test'), Lang::t('_FEEDBACK_TEXT', 'test'), Get::sprite('subs_mod', Lang::t('_MOD', 'standard'), Lang::t('_MOD', 'standard')), Get::sprite('subs_del', Lang::t('_DEL', 'standard'), Lang::t('_DEL', 'standard'))), array('', '', 'image', 'image'));
                foreach ($data[$cat_id] as $row) {
                    $row_ln = array();
                    $row_ln[] = $row['from_score'] . ' - ' . $row['to_score'];
                    $row_ln[] = $row['feedback_txt'];
                    $row_ln[] = '<a class="ico-sprite subs_mod" href="' . $url_base . 'editfbkrule&item_id=' . $row['rule_id'] . '"><span></span></a>';
                    $row_ln[] = '<a id="del_rule_' . $row['rule_id'] . '" class="ico-sprite subs_del" href="' . $url_base . 'delfbkrule&item_id=' . $row['rule_id'] . '"><span></span></a>';
                    $tb->addBody($row_ln);
                }
                //$tb->addActionAdd('<a href="'.$url_base.'addfbkrule&cat_id='.$cat_id.'" class="ico-wt-sprite subs_add"><span>'.Lang::t('_ADD', 'test').'</span></a>');
                $res .= $tb->getTable();
            }
            $res .= '<div class="table-container-below">' . '<a href="' . $url_base . 'addfbkrule&cat_id=' . $cat_id . '" class="ico-wt-sprite subs_add"><span>' . Lang::t('_ADD', 'test') . '</span></a>' . '</div>';
        }
    }
    $res .= getBackUi($back_link_url, Lang::t('_BACK')) . '</div>';
    require_once _base_ . '/lib/lib.dialog.php';
    setupHrefDialogBox('a[id^=del_rule_]');
    $GLOBALS['page']->add($res, 'content');
}
Ejemplo n.º 10
0
function view_report_certificate()
{
    checkPerm('view');
    require_once _lms_ . '/lib/lib.certificate.php';
    require_once _lms_ . '/lib/lib.course.php';
    $out =& $GLOBALS['page'];
    $out->setWorkingZone('content');
    $lang =& DoceboLanguage::createInstance('certificate', 'lms');
    $deletion = importVar('deletion', true, 0);
    if ($deletion) {
        switch ($deletion) {
            case 1:
                $out->add(getResultUi($lang->def('_OPERATION_SUCCESSFUL')));
                break;
            case 2:
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
            case 3:
                $out->add(getErrorUi($lang->def('_OPERATION_FAILURE')));
                break;
        }
    }
    $certificate = new Certificate();
    $id_certificate = importVar('id_certificate', true, 0);
    $id_course = importVar('id_course', true, 0);
    $selection = importVar('selection', false, array());
    //all possible selected values
    $selected = importVar('selected', false, array());
    //effectively selected values with checkbox
    $sel = importVar('old_selection', false, '');
    //selected values from previous table pages
    if ($sel != '') {
        $total_selection = explode(',', $sel);
    } else {
        $total_selection = array();
    }
    //update total selection
    foreach ($selection as $key => $val) {
        if (in_array($val, $selected)) {
            if (!in_array($val, $total_selection)) {
                $total_selection[] = $val;
            }
        } else {
            $index = array_search($val, $total_selection);
            if ($index !== false) {
                array_splice($total_selection, $index, 1);
            }
        }
    }
    $search_filter = importVar('filter', false, '');
    $only_released = importVar('only_released', true, 0);
    //which command?
    if (importVar('search_button', false, false) !== false) {
    }
    if (importVar('reset_button', false, false) !== false) {
        $search_filter = '';
        $only_released = 0;
    }
    if (importVar('print_button', false, false) !== false) {
    }
    $numtablerows = Get::sett('visuItem', 25);
    $tb = new Table($numtablerows, $lang->def('_CERTIFICATE_VIEW_CAPTION'), $lang->def('_CERTIFICATE_VIEW_CAPTION'));
    $tb->initNavBar('ini', 'button');
    $ini = $tb->getSelectedElement();
    $ini_param = Get::req('ini', DOTY_MIXED, array());
    //floor($ini / Get::sett('visuItem', 25));
    if (empty($ini_param)) {
        $ini_param = 1;
    } else {
        list($ini_param) = each($ini_param);
    }
    $tca = $GLOBALS['prefix_lms'] . "_certificate_assign as ca";
    $tcc = $GLOBALS['prefix_lms'] . "_certificate_course as cc";
    $tcu = $GLOBALS['prefix_lms'] . "_courseuser as cu";
    $tu = $GLOBALS['prefix_fw'] . "_user as u";
    $where = "";
    if ($search_filter != '') {
        $where .= " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') ";
    }
    if ($only_released > 0) {
        $where = " AND ca.on_date " . ($only_released == 1 ? "IS NOT" : "IS") . " NULL ";
    }
    //$where .= " AND ".$aval_status." ".($only_released==1 ? "<" : ">=")." cu.status ";
    list($aval_status) = sql_fetch_row(sql_query("SELECT available_for_status FROM " . $tcc . " " . " WHERE id_certificate='" . (int) $id_certificate . "' AND id_course='" . (int) $id_course . "'"));
    switch ($aval_status) {
        case AVS_ASSIGN_FOR_ALL_STATUS:
            $aval_status = " 1 ";
            break;
        case AVS_ASSIGN_FOR_STATUS_INCOURSE:
            $aval_status = " cu.status = " . _CUS_BEGIN . " ";
            break;
        case AVS_ASSIGN_FOR_STATUS_COMPLETED:
            $aval_status = " cu.status = " . _CUS_END . " ";
            break;
    }
    list($totalrows) = sql_fetch_row(sql_query("SELECT COUNT(*) " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where));
    $query = "SELECT u.userid, u.firstname, u.lastname, cu.date_complete, ca.on_date, cu.idUser as id_user, cu.status " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . $where . " ORDER BY u.userid LIMIT " . $ini . ", " . $numtablerows;
    //cout('<pre>'.print_r($_POST, true).'</pre>');
    //cout($query);
    $res = sql_query($query);
    $from = Get::req('from', DOTY_MIXED, '');
    if ($from === 'course') {
        $back_ui = getBackUi('index.php?r=alms/course/certificate&amp;id_course=' . (int) $id_course, $lang->def('_BACK'));
        $out->add(getTitleArea(array('index.php?r=alms/course/certificate&amp;id_course=' . (int) $id_course => $lang->def('_CERTIFICATE_ASSIGN_STATUS', 'course'), $lang->def('_COURSES')), 'certificate'));
    } else {
        $back_ui = getBackUi('index.php?modname=certificate&amp;op=report_certificate&amp;id_certificate=' . (int) $id_certificate, $lang->def('_BACK'));
        $out->add(getTitleArea(array('index.php?modname=certificate&amp;op=certificate' => $lang->def('_TITLE_CERTIFICATE'), 'index.php?modname=certificate&amp;op=report_certificate&amp;id_certificate=' . (int) $id_certificate => $lang->def('_COURSES'), $lang->def('_CERTIFICATE_VIEW_CAPTION')), 'certificate'));
    }
    $out->add('<div class="std_block">' . $back_ui);
    $numrows = sql_num_rows($res);
    $downloadables = array();
    if ($numrows > 0) {
        $clang =& DoceboLanguage::CreateInstance('course', 'lms');
        $type_h = array('image', '', '', '', '', '', '', 'image', 'image');
        $cont_h = array('', $lang->def('_USERNAME'), $lang->def('_LASTNAME'), $lang->def('_FIRSTNAME'), $clang->def('_STATUS'), $lang->def('_DATE'), $lang->def('_RELASE_DATE'), Get::sprite('subs_pdf', Lang::t('_TITLE_VIEW_CERT', 'certificate')), Get::sprite('subs_del', Lang::t('_DEL', 'certificate')));
        $tb->setColsStyle($type_h);
        $tb->addHead($cont_h);
        $acl_man =& $GLOBALS['current_user']->getAclManager();
        $arr_status = array(_CUS_CONFIRMED => $clang->def('_USER_STATUS_CONFIRMED'), _CUS_SUBSCRIBED => $clang->def('_USER_STATUS_SUBS'), _CUS_BEGIN => $clang->def('_USER_STATUS_BEGIN'), _CUS_END => $clang->def('_USER_STATUS_END'), _CUS_SUSPEND => $clang->def('_USER_STATUS_SUSPEND'));
        //foreach($report_info as $info_report)
        while ($info = sql_fetch_assoc($res)) {
            $cont = array();
            $can_assign = (bool) ($info['on_date'] == '');
            $input_id = $info['id_user'];
            $sel_cell_content = '';
            $label_open = '';
            $label_close = '';
            if ($can_assign) {
                $input = '<input type="hidden" id="selection_' . $input_id . '" name="selection[' . $input_id . ']" value="' . $input_id . '"/> ';
                if (in_array($input_id, $total_selection)) {
                    $checked = ' checked="checked"';
                } else {
                    $checked = '';
                }
                $sel_cell_content .= $input . '<input type="checkbox" id="selected_' . $input_id . '" name="selected[' . $input_id . ']" value="' . $input_id . '"' . $checked . '/>';
                $label_open = '<label for="selected_' . $input_id . '">';
                $label_close = '</label>';
            }
            $userid = $acl_man->relativeId($info['userid']);
            $cont[] = $sel_cell_content;
            $cont[] = $label_open . ($search_filter != '' ? highlightText($userid, $search_filter) : $userid) . $label_close;
            $cont[] = $label_open . ($search_filter != '' ? highlightText($info['lastname'], $search_filter) : $info['lastname']) . $label_close;
            $cont[] = $label_open . ($search_filter != '' ? highlightText($info['firstname'], $search_filter) : $info['firstname']) . $label_close;
            $cont[] = $arr_status[$info['status']];
            $cont[] = $info['date_complete'];
            $cont[] = $info['on_date'];
            $url = 'index.php?modname=certificate&amp;certificate_id=' . $id_certificate . '&amp;course_id=' . $id_course . '&amp;user_id=' . $info['id_user'];
            $dl_url = $url . "&amp;op=send_certificate";
            if ($can_assign) {
                $downloadables[] = 'dl_single_' . $input_id;
            }
            $cont[] = $can_assign ? '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="javascript:;" title="' . $lang->def('_GENERATE') . '"><span>' . $lang->def('_GENERATE') . '</span></a>' : '<a id="dl_single_' . $input_id . '" class="ico-wt-sprite subs_pdf" href="' . $dl_url . '" title="' . $lang->def('_DOWNLOAD') . '"><span>' . $lang->def('_DOWNLOAD') . '</span></a>';
            $cont[] = $can_assign ? '' : Get::sprite_link('subs_del', $url . '&amp;op=del_report_certificate', Lang::t('_DEL', 'certificate'));
            $tb->addBody($cont);
        }
        require_once _base_ . '/lib/lib.dialog.php';
        setupHrefDialogBox('a[href*=del_report_certificate]');
        //search filter ...
        $release_options = array($lang->def('_ALL') => 0, $lang->def('_RELEASED') => 1, $lang->def('_TO_RELEASE') => 2);
        //search and store all non-available certificates
        $all_selection = array();
        $query = "SELECT cu.idUser as id_user " . " FROM ( " . $tu . " JOIN " . $tcu . " ON (u.idst = cu.idUser) ) LEFT JOIN " . $tca . " " . " ON ( ca.id_course = cu.idCourse AND ca.id_user=cu.idUser ) " . " WHERE (ca.id_certificate='" . (int) $id_certificate . "' OR ca.id_certificate IS NULL) AND " . $aval_status . " " . " AND cu.idCourse='" . (int) $id_course . "' " . ($search_filter != '' ? " AND (u.userid LIKE '%" . $search_filter . "%' OR u.lastname LIKE '%" . $search_filter . "%' OR u.firstname LIKE '%" . $search_filter . "%') " : "") . " AND ca.on_date IS NULL ";
        $res = sql_query($query);
        while (list($id_user) = sql_fetch_row($res)) {
            $all_selection[] = $id_user;
        }
        //---
        $form = new Form();
        $submit_url = "index.php?modname=certificate&amp;op=view_report_certificate&amp;id_certificate=" . (int) $id_certificate . "&amp;id_course=" . (int) $id_course;
        $out->add($form->openForm("certificates_emission", $submit_url) . $form->getHidden('old_selection', 'old_selection', implode(',', $total_selection)) . $form->getHidden('all_selection', 'all_selection', implode(',', $all_selection)) . $form->getHidden('active_text_filter', 'active_text_filter', $search_filter) . $form->getHidden('active_only_released', 'active_only_released', $only_released) . $form->getHidden('active_ini', 'active_ini', $ini_param) . '<div class="quick_search_form">' . '<div class="simple_search_box">' . Form::getInputTextfield("search_t", "filter", "filter", $search_filter, '', 255, '') . Form::getButton("search_button", "search_button", Lang::t('_SEARCH', 'standard'), "search_b") . Form::getButton("reset_button", "reset_button", Lang::t('_RESET', 'standard'), "reset_b") . '</div>' . '<a id="advanced_search" class="advanced_search" href="javascript:;">' . Lang::t("_ADVANCED_SEARCH", 'standard') . '</a>' . '<div id="certificate_release_as" class="advanced_search_options" style="display: ' . ($only_released != 0 ? 'block' : 'none') . '">' . Form::getRadioHoriz(Lang::t('_FILTER', 'certificate'), 'only_released', 'only_released', $release_options, $only_released) . '</div>' . '</div>' . '<script type="text/javascript">' . 'YAHOO.util.Event.addListener("advanced_search", "click", function(e){
				var el = YAHOO.util.Dom.get("certificate_release_as");
				if (el.style.display != \'block\') el.style.display = \'block\';
				else el.style.display = \'none\';
			});' . '</script>', 'content');
        $delgen_url = 'index.php?modname=certificate&amp;op=del_gen_certificate' . '&amp;id_certificate=' . (int) $id_certificate . '&amp;id_course=' . (int) $id_course;
        $delgen_txt = Lang::t('_DELETE_ALL_GENERATED', 'certificate');
        $print_button_1 = '<div>' . '<a id="print_selected_button_1" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>';
        $print_button_2 = '<div><a id="print_selected_button_2" href="javascript:;">' . Get::img('course/certificate.png', Lang::t('_GENERATE_ALL_SELECTED', 'certificate')) . Lang::t('_GENERATE_ALL_SELECTED', 'certificate') . '</a>' . '</div>';
        $print_button_1 .= Lang::t('_SELECT', 'directory') . ': ';
        $print_button_2 .= Lang::t('_SELECT', 'directory') . ': ';
        /*	
        		$print_button_1 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="select_page_1">'.Lang::t('_SELECT_PAGE', 'standard').'</a>';
        		$print_button_2 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="select_page_2">'.Lang::t('_SELECT_PAGE', 'standard').'</a>';
        		$print_button_1 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="unselect_page_1">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>';
        		$print_button_2 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="unselect_page_2">'.Lang::t('_UNSELECT_PAGE', 'standard').'</a>';
        */
        $print_button_1 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="select_all_1">' . Lang::t('_ALL_PAGES', 'directory') . '</a>';
        $print_button_2 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="select_all_2">' . Lang::t('_ALL_PAGES', 'directory') . '</a>';
        $print_button_1 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="unselect_all_1">' . Lang::t('_NONE', 'directory') . '</a>';
        $print_button_2 .= '&nbsp;&nbsp;&nbsp;<a href="javascript:;" id="unselect_all_2">' . Lang::t('_NONE', 'directory') . '</a>';
        $navbar = $tb->getNavBar($ini, $totalrows);
        $out->add($print_button_1 . '<br />' . $navbar . $tb->getTable() . $navbar . '<br />' . $print_button_2);
        $out->add($form->closeForm());
    } else {
        $out->add($lang->def('_NO_CONTENT'));
    }
    $out->add($back_ui . '</div>');
    addCss('style_menu', 'lms');
    Util::get_js(Get::rel_path('base') . '/widget/dialog/dialog.js', true, true);
    Util::get_js(Get::rel_path('lms') . '/admin/modules/certificate/certificate.js?rnd=' . time(), true, true);
    //addJs($GLOBALS['where_lms_relative'].'/admin/modules/certificate/', 'certificate.js');
    $script = 'var ajax_url="ajax.adm_server.php?plf=lms&mn=certificate"; var _STOP="' . $lang->def('_STOP') . '"; ' . 'var glob_id_certificate = ' . (int) $id_certificate . ', glob_id_course = ' . (int) $id_course . ';' . 'var single_list = [' . (count($downloadables) ? '"' . implode('","', $downloadables) . '"' : '') . ']; ' . 'var reload_url = "' . str_replace('&amp;', '&', isset($submit_url) ? $submit_url : '') . '", ' . '_ERROR_PARSE = "' . $lang->def('_OPERATION_FAILURE') . '", _SUCCESS = "' . $lang->def('_OPERATION_SUCCESSFUL') . '", ' . '_AREYOUSURE="' . Lang::t('_AREYOUSURE', 'standard') . '";';
    $out->add('<script type="text/javascript">' . $script . '</script>', 'page_head');
}
Ejemplo n.º 11
0
 public function getcourselist()
 {
     //Datatable info
     $start_index = Get::req('startIndex', DOTY_INT, 0);
     $results = Get::req('results', DOTY_MIXED, Get::sett('visuItem', 25));
     $sort = Get::req('sort', DOTY_MIXED, 'userid');
     $dir = Get::req('dir', DOTY_MIXED, 'asc');
     $id_category = Get::req('node_id', DOTY_INT, (int) $this->_getSessionTreeData('id_category', 0));
     $filter_text = $_SESSION['course_filter']['text'];
     $classroom = $_SESSION['course_filter']['classroom'];
     $descendants = $_SESSION['course_filter']['descendants'];
     $waiting = $_SESSION['course_filter']['waiting'];
     $filter_open = false;
     if ($descendants || $waiting) {
         $filter_open = true;
     }
     $filter = array('id_category' => $id_category, 'classroom' => $classroom, 'descendants' => $descendants, 'waiting' => $waiting, 'text' => $filter_text, 'open' => $filter_open);
     $total_course = $this->model->getCourseNumber($filter);
     if ($start_index >= $total_course) {
         if ($total_course < $results) {
             $start_index = 0;
         } else {
             $start_index = $total_course - $results;
         }
     }
     $course_res = $this->model->loadCourse($start_index, $results, $sort, $dir, $filter);
     $course_with_cert = $this->model->getCourseWithCertificate();
     $course_with_competence = $this->model->getCourseWithCompetence();
     $list = array();
     while ($row = sql_fetch_assoc($course_res)) {
         $course_type = 'elearning';
         switch ($row['course_type']) {
             case 'classroom':
                 $course_type = 'classroom';
             case 'elearning':
                 if ($row['course_edition'] > 0) {
                     $course_type = 'edition';
                 }
         }
         $num_subscribed = $row['subscriptions'] - $row['pending'];
         $list[$row['idCourse']] = array('id' => $row['idCourse'], 'code' => $row['code'], 'name' => $row['name'], 'type' => Lang::t('_' . strtoupper($row['course_type'])), 'type_id' => $course_type, 'wait' => $row['course_edition'] != 1 && $row['pending'] != 0 ? '<a href="index.php?r=' . $this->base_link_subscription . '/waitinguser&id_course=' . $row['idCourse'] . '" title="' . Lang::t('_WAITING', 'course') . '">' . $row['pending'] . '</a>' : '', 'user' => $row['course_type'] !== 'classroom' && $row['course_edition'] != 1 ? '<a class="nounder" href="index.php?r=' . $this->base_link_subscription . '/show&amp;id_course=' . $row['idCourse'] . '" title="' . Lang::t('_SUBSCRIPTION', 'course') . '">' . $num_subscribed . ' ' . Get::img('standard/moduser.png', Lang::t('_SUBSCRIPTION', 'course')) . '</a>' : '', 'edition' => $row['course_type'] === 'classroom' ? '<a href="index.php?r=' . $this->base_link_classroom . '/classroom&amp;id_course=' . $row['idCourse'] . '" title="' . Lang::t('_CLASSROOM_EDITION', 'course') . '">' . $this->model->classroom_man->getDateNumber($row['idCourse'], true) . '</a>' : ($row['course_edition'] == 1 ? '<a href="index.php?r=' . $this->base_link_edition . '/show&amp;id_course=' . $row['idCourse'] . '" title="' . Lang::t('_EDITIONS', 'course') . '">' . $this->model->edition_man->getEditionNumber($row['idCourse']) . '</a>' : ''), 'certificate' => '<a href="index.php?r=' . $this->base_link_course . '/certificate&amp;id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_pdf' . (!isset($course_with_cert[$row['idCourse']]) ? '_grey' : ''), Lang::t('_CERTIFICATE_ASSIGN_STATUS', 'course')) . '</a>', 'competences' => '<a href="index.php?r=' . $this->base_link_competence . '/man_course&amp;id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_competence' . (!isset($course_with_competence[$row['idCourse']]) ? '_grey' : ''), Lang::t('_COMPETENCES', 'course')) . '</a>', 'menu' => '<a href="index.php?r=' . $this->base_link_course . '/menu&amp;id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_menu', Lang::t('_ASSIGN_MENU', 'course')) . '</a>', 'dup' => 'ajax.adm_server.php?r=' . $this->base_link_course . '/dupcourse&id_course=' . $row['idCourse'], 'mod' => '<a href="index.php?r=' . $this->base_link_course . '/modcourse&amp;id_course=' . $row['idCourse'] . '">' . Get::sprite('subs_mod', Lang::t('_MOD', 'standard')) . '</a>', 'del' => 'ajax.adm_server.php?r=' . $this->base_link_course . '/delcourse&id_course=' . $row['idCourse'] . '&confirm=1');
     }
     if (!empty($list)) {
         $id_list = array_keys($list);
         $count_students = $this->model->getCoursesStudentsNumber($id_list);
         foreach ($list as $id_course => $cinfo) {
             $list[$id_course]['students'] = isset($count_students[$id_course]) ? $count_students[$id_course] : '';
         }
     }
     $result = array('totalRecords' => $total_course, 'startIndex' => $start_index, 'sort' => $sort, 'dir' => $dir, 'rowsPerPage' => $results, 'results' => count($list), 'records' => array_values($list));
     echo $this->json->encode($result);
 }