Exemplo n.º 1
0
$columns = array(get_lang('Name'), get_lang('Value'), get_lang('Order'), get_lang('Actions'));
//Column config
$column_model = array(array('name' => 'option_display_text', 'index' => 'option_display_text', 'width' => '180', 'align' => 'left'), array('name' => 'option_value', 'index' => 'option_value', 'width' => '', 'align' => 'left', 'sortable' => 'false'), array('name' => 'option_order', 'index' => 'option_order', 'width' => '', 'align' => 'left', 'sortable' => 'false'), array('name' => 'actions', 'index' => 'actions', 'width' => '100', 'align' => 'left', 'formatter' => 'action_formatter', 'sortable' => 'false'));
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
//With this function we can add actions to the jgrid (edit, delete, etc)
$action_links = 'function action_formatter(cellvalue, options, rowObject) {
         return \'<a href="?action=edit&' . $params . '&id=\'+options.rowId+\'">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>' . '&nbsp;<a onclick="javascript:if(!confirm(' . "\\'" . addslashes(get_lang("ConfirmYourChoice")) . "\\'" . ')) return false;"  href="?sec_token=' . $token . '&action=delete&' . $params . '&id=\'+options.rowId+\'">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>' . '\';
 }';
$htmlHeadXtra[] = '
<script>
$(function() {
    // grid definition see the $obj->display() function
    ' . Display::grid_js('extra_field_options', $url, $columns, $column_model, $extra_params, array(), $action_links, true) . '

});
</script>';
// The header.
Display::display_header($tool_name);
echo Display::page_header($extra_field_info['field_display_text']);
$obj = new ExtraFieldOption($extra_field->type);
$obj->field_id = $field_id;
// Action handling: Add
switch ($action) {
    case 'add':
        if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
            api_not_allowed();
        }
        $url = api_get_self() . '?action=' . Security::remove_XSS($_GET['action']) . '&' . $params;
Exemplo n.º 2
0
        $column_model = array(
            array('name'=>'type',      'index'=>'file',      'width'=>'5',  'align'=>'left', 'search' => 'false', 'sortable' => 'false'),
            array('name'=>'title',     'index'=>'title',     'width'=>'60', 'align'=>'left', 'search' => 'false', 'wrap_cell' => "true"),
            array('name'=>'qualification',	'index'=>'qualification', 'width'=>'10',   'align'=>'left', 'search' => 'true'),
            array('name'=>'sent_date', 'index'=>'sent_date', 'width'=>'30', 'align'=>'left', 'search' => 'true', 'wrap_cell' => 'true', 'sortable'=>'false'),
            array('name'=>'actions',   'index'=>'actions',   'width'=>'20', 'align'=>'left', 'search' => 'false', 'sortable'=>'false')
        );
    }
}

$extra_params = array(
    'autowidth' =>  'true',
    'height' =>  'auto',
    'sortname' => 'firstname'
);

$url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_user_list&work_id='.$workId.'&type='.$type;
?>
    <script>
        $(function() {
            <?php
            echo Display::grid_js('results', $url, $columns, $column_model, $extra_params);
        ?>
        });
    </script>
<?php
echo Display::grid_html('results');

Display :: display_footer();
Exemplo n.º 3
0
    /**
     * Display a sortable table that contains an overview off all the access to a session
     * @author César Perales <*****@*****.**>, Beeznest Team
     * @version Chamilo 1.9.6
     */
    static function display_tracking_access_overview($sessionId = 0, $courseId = 0, $studentId = '', $profile = '', $date_from, $date_to) {
        //The order is important you need to check the the $column variable in the model.ajax.php file
        $columns = array(
            get_lang('LoginDate'),
            get_lang('UserName'),
            get_lang('LastName'),
            get_lang('FirstName'),
            get_lang('Clicks'),
            get_lang('IP'),
            get_lang('TimeLoggedIn'),
            get_lang('Section'),
        );

        $column_model   = array(
            array('name'=>'logindate',      'index'=>'loginDate',      'align'=>'left', 'search' => 'true'),
            array('name'=>'username',       'index'=>'username',       'align'=>'left', 'search' => 'true'),
            array('name'=>'firstname',      'index'=>'firstname',      'align'=>'left', 'search' => 'true'),
            array('name'=>'lastname',       'index'=>'lastname',       'align'=>'left', 'search' => 'true'),
            array('name'=>'clicks',         'index'=>'clicks',         'align'=>'left', 'search' => 'true'),
            array('name'=>'ip',             'index'=>'ip',             'align'=>'left', 'search' => 'true'),
            array('name'=>'timeloggedin',   'index'=>'timeLoggedIn',   'align'=>'left', 'search' => 'true'),
            array('name'=>'session',   'index'=>'session',   'align'=>'left')
        );

        $action_links = '';
        // jqgrid will use this URL to do the selects
        $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_session_access_overview&session_id=' . $sessionId . '&course_id=' . $courseId . '&student_id=' . $studentId . '&profile=' . $profile . '&date_to=' . $date_to . '&date_from=' . $date_from;

        //Table Id
        $tableId = 'accessOverview';

        //Autowidth
        $extra_params['autowidth'] = 'true';

        //height auto
        $extra_params['height'] = 'auto';

        $table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);

        $return = '<script>$(function() {'. $table .
            'jQuery("#'.$tableId.'").jqGrid("navGrid","#'.$tableId.'_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
                jQuery("#'.$tableId.'").jqGrid("navButtonAdd","#'.$tableId.'_pager",{
                       caption:"",
                       title:"' . get_lang('ExportExcel') . '",
                       onClickButton : function () {
                           jQuery("#'.$tableId.'").jqGrid("excelExport",{"url":"'.$url.'&export_format=xls"});
                       }
                });
            });</script>';
        $return .= Display::grid_html($tableId);
        return $return;
    }
Exemplo n.º 4
0
     $count_courses_in_session = count(Tracking::get_courses_followed_by_coach($user_id, $session['id']));
     $count_users_in_session = count(SessionManager::get_users_by_session($session['id'], 0));
     $row = array();
     $row['name'] = $session['name'];
     $row['display_start_date'] = api_get_local_time($session['display_start_date'], null, null, true);
     $row['display_end_date'] = api_get_local_time($session['display_end_date'], null, null, true);
     $row['number_student_per_session'] = $count_courses_in_session;
     $row['courses_per_session'] = $count_users_in_session;
     if ($visibility == SESSION_INVISIBLE) {
         $row['details'] = '<img src="' . api_get_path(WEB_IMG_PATH) . '2rightarrow_na.gif" />';
     } else {
         $row['details'] = '<a href="' . api_get_self() . '?session_id=' . $session['id'] . '"><img src="' . api_get_path(WEB_IMG_PATH) . '2rightarrow.gif" border="0" /></a>';
     }
     $all_data[] = $row;
 }
 echo "<script>\n            \$(function() {\n                " . Display::grid_js('sessions', null, $columns, $column_model, $extra_params, $all_data) . "\n            });\n            </script>";
 $nb_sessions_past = $nb_sessions_current = 0;
 $courses = array();
 foreach ($sessions as $session) {
     $visibility = api_get_session_visibility($session['id']);
     if ($visibility == SESSION_AVAILABLE) {
         $nb_sessions_current++;
     } else {
         $nb_sessions_past++;
     }
     $courses = array_merge($courses, Tracking::get_courses_list_from_session($session['id']));
 }
 $nb_courses_per_session = null;
 $nb_students_per_session = null;
 if ($count_sessions > 0) {
     $nb_courses_per_session = round(count($courses) / $count_sessions, 2);
Exemplo n.º 5
0
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_extra_fields&type=' . $extraFieldType;
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = $obj->getJqgridColumnNames();
//Column config
$column_model = $obj->getJqgridColumnModel();
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$extra_params['sortname'] = 'field_order';
$action_links = $obj->getJqgridActionLinks($token);
$htmlHeadXtra[] = '<script>
$(function() {
    // grid definition see the $obj->display() function
    ' . Display::grid_js($obj->type . '_fields', $url, $columns, $column_model, $extra_params, array(), $action_links, true) . '

    $("#field_type").on("change", function() {
        id = $(this).val();
        switch(id) {
            case "1":
                $("#example").html("' . addslashes(Display::return_icon('userfield_text.png')) . '");
                break;
            case "2":
                $("#example").html("' . addslashes(Display::return_icon('userfield_text_area.png')) . '");
                break;
            case "3":
                $("#example").html("' . addslashes(Display::return_icon('add_user_field_howto.png')) . '");
                break;
            case "4":
                $("#example").html("' . addslashes(Display::return_icon('userfield_drop_down.png')) . '");
Exemplo n.º 6
0
$action_links = 'function action_formatter(cellvalue, options, rowObject) {
     return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
     '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'.
     '&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;"  href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'.
     '\';
 }';*/
$action_links = null;
$room = UserManager::get_extra_user_data_by_field(api_get_user_id(), 'exam_room');
$room = $room['exam_room'];
$schedule = UserManager::get_extra_user_data_by_field(api_get_user_id(), 'exam_schedule');
$schedule = $schedule['exam_schedule'];
echo Display::page_subheader(get_lang('UserList') . ": " . $room . " - " . $schedule);
?>
<script>
$(function() {
<?php 
echo Display::grid_js('user_list', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
?>
    jQuery("#user_list").jqGrid("navGrid","#user_list_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
    jQuery("#user_list").jqGrid("navButtonAdd","#user_list_pager",{
       caption:"",
       onClickButton : function () {
           jQuery("#user_list").jqGrid("excelExport",{"url": "<? echo $url?>&export_format=xls"});
    }
});

});
</script>
<?php 
echo Display::grid_html('user_list');
Display::display_footer();
Exemplo n.º 7
0
    $sortable_data = '';
    $table_footer = get_lang('NoDocsInFolder');
}
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Type'), get_lang('Name'), get_lang('Size'));
//Column config
$column_model = array(array('name' => 'type', 'index' => 'type', 'width' => '28', 'align' => 'center', 'sortable' => 'false'), array('name' => 'name', 'index' => 'name', 'width' => '500', 'align' => 'left'), array('name' => 'size', 'index' => 'size', 'width' => '35', 'align' => 'right', 'sortable' => 'true'));
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
//With this function we can add actions to the jgrid (edit, delete, etc)
$action_links = 'function action_formatter(cellvalue, options, rowObject) {
                         return \'<a href="?action=edit&id=\'+options.rowId+\'">' . Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>' . '&nbsp;<a onclick="javascript:if(!confirm(' . "\\'" . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES)) . "\\'" . ')) return false;"  href="?action=copy&id=\'+options.rowId+\'">' . Display::return_icon('copy.png', get_lang('Copy'), '', ICON_SIZE_SMALL) . '</a>' . '&nbsp;<a onclick="javascript:if(!confirm(' . "\\'" . addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES)) . "\\'" . ')) return false;"  href="?action=delete&id=\'+options.rowId+\'">' . Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL) . '</a>' . '\';
                 }';
$js_content = Display::grid_js('documents', '', $columns, $column_model, $extra_params, $sortable_data, $action_links, true);
$htmlHeadXtra[] = '<script>
$(function() {
    // grid definition see the $career->display() function
    ' . $js_content . '
});
</script>';
require_once 'controller.php';
$controller = new DocumentController();
$tpl = $controller->tpl->get_template('layout/layout_2_col.tpl');
$content = Display::grid_html('documents');
if (!is_null($docs_and_folders)) {
    // Show download zipped folder icon
    global $total_size;
    if (!$is_certificate_mode && $total_size != 0 && (api_get_setting('students_download_folders') == 'true' || api_is_allowed_to_edit() || api_is_platform_admin())) {
        //for student does not show icon into other shared folder, and does not show into main path (root)
Exemplo n.º 8
0
 if (api_is_allowed_to_edit()) {
     $extra_params['multiselect'] = true;
     $editOptions = '
     $("#announcements").jqGrid(
         "navGrid",
         "#announcements_pager",
         { edit: false, add: false, del: true },
         { height:280, reloadAfterSubmit:false }, // edit options
         { height:280, reloadAfterSubmit:false }, // add options
         { reloadAfterSubmit:false, url: "' . $deleteUrl . '" }, // del options
         { width:500 } // search options
     );
     ';
 }
 $content = '<script>
 $(function() {' . Display::grid_js('announcements', $url, $columns, $columnModel, $extra_params, array(), '', true) . $editOptions . '
 });
 </script>';
 $count = AnnouncementManager::getAnnouncements($stok, $announcement_number, true);
 if (empty($count)) {
     $html = '';
     if ((api_is_allowed_to_edit(false, true) || api_get_course_setting('allow_user_edit_announcement') && !api_is_anonymous()) && (empty($_GET['origin']) || $_GET['origin'] !== 'learnpath')) {
         $html .= '<div id="no-data-view">';
         $html .= '<h3>' . get_lang('Announcements') . '</h3>';
         $html .= Display::return_icon('valves.png', '', array(), 64);
         $html .= '<div class="controls">';
         $html .= Display::url(get_lang('AddAnnouncement'), api_get_self() . "?" . api_get_cidreq() . "&action=add", array('class' => 'btn btn-primary'));
         $html .= '</div>';
         $html .= '</div>';
     } else {
         $html = Display::return_message(get_lang('NoAnnouncements'), 'warning');
Exemplo n.º 9
0
/**
 * @param int $workId
 * @return string
 */
function showStudentList($workId)
{
    $columnModel = array(
        array('name'=>'student', 'index'=>'student', 'width'=>'150', 'align'=>'left', 'sortable' => 'false'),
        array('name'=>'works', 'index'=>'works',  'width'=>'50', 'align'=>'left', 'sortable' => 'false')
    );
    $token = null;

    $url = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_work_student_list_overview&work_id='.$workId.'&'.api_get_cidreq();

    $columns = array(
        get_lang('Students'),
        get_lang('Works')
    );

    $order = api_is_western_name_order() ? 'firstname' : 'lastname';
    $params = array(
        'autowidth' => 'true',
        'height' => 'auto',
        'rowNum' => 10,
        'sortname' => $order,
        'sortorder' => 'asc'
    );

    $html = '<script>
    $(function() {
        '.Display::grid_js('studentList', $url, $columns, $columnModel, $params, array(), null, true).'
        $("#workList").jqGrid(
            "navGrid",
            "#studentList_pager",
            { edit: false, add: false, del: false },
            { height:280, reloadAfterSubmit:false }, // edit options
            { height:280, reloadAfterSubmit:false }, // add options
            { width:500 } // search options
        );
    });
    </script>';
    $html .= Display::grid_html('studentList');
    return $html;
}
Exemplo n.º 10
0
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_timelines';
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Name'), get_lang('Actions'));
//Column config
$column_model = array(array('name' => 'name', 'index' => 'name', 'width' => '120', 'align' => 'left'), array('name' => 'actions', 'index' => 'actions', 'width' => '100', 'align' => 'left', 'sortable' => 'false'));
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
//With this function we can add actions to the jgrid (edit, delete, etc)
$htmlHeadXtra[] = '
<script>
$(function() {
    // grid definition see the $timeline->display() function
    ' . Display::grid_js('timelines', $url, $columns, $column_model, $extra_params, array(), null, true) . '
});
</script>';
$timeline = new Timeline();
// Action handling: Add
switch ($action) {
    case 'add':
        if (api_get_session_id() != 0 && !api_is_allowed_to_session_edit(false, true)) {
            api_not_allowed();
        }
        $url = api_get_self() . '?action=' . Security::remove_XSS($_GET['action']);
        $form = $timeline->return_form($url, 'add');
        // The validation or display
        if ($form->validate()) {
            if ($check) {
                $values = $form->exportValues();
Exemplo n.º 11
0
if ($table->get_total_number_of_items() > 0) {
	$table->display();
}*/
//jqgrid will use this URL to do the selects
//$url            = api_get_path(WEB_AJAX_PATH).'model.ajax.php?a=get_careers';
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Name'), get_lang('Description'), get_lang('CountDoneAttendance'));
//Column config
$column_model = array(array('name' => 'name', 'index' => 'name', 'width' => '300', 'align' => 'left'), array('name' => 'description', 'index' => 'description', 'width' => '200', 'align' => 'left', 'sortable' => 'false'), array('name' => 'attendance_qualify_max', 'index' => 'attendance_qualify_max', 'width' => '80', 'align' => 'left', 'sortable' => 'false'));
if (api_is_allowed_to_edit(null, true)) {
    $columns[] = get_lang('Actions');
    $column_model[] = array('name' => 'actions', 'index' => 'actions', 'width' => '100', 'align' => 'left', 'sortable' => 'false');
}
$extra_params = array();
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$data = Attendance::get_attendance_data();
?>
<script>
$(function() {
<?php 
// grid definition see the $career->display() function
echo Display::grid_js('attendance', 'false', $columns, $column_model, $extra_params, $data, null, true);
?>
 
});
</script>
<?php 
echo Display::grid_html('attendance');
Exemplo n.º 12
0
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_group_reporting&course_id=' . $course_id;
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Name'), get_lang('Time'), get_lang('Progress'), get_lang('Score'), get_lang('Works'), get_lang('Messages'), get_lang('Actions'));
//Column config
$column_model = array(array('name' => 'name', 'index' => 'name', 'width' => '200', 'align' => 'left'), array('name' => 'time', 'index' => 'time', 'width' => '50', 'align' => 'left', 'sortable' => 'false'), array('name' => 'progress', 'index' => 'progress', 'width' => '50', 'align' => 'left', 'sortable' => 'false'), array('name' => 'score', 'index' => 'score', 'width' => '50', 'align' => 'left', 'sortable' => 'false'), array('name' => 'works', 'index' => 'works', 'width' => '50', 'align' => 'left', 'sortable' => 'false'), array('name' => 'messages', 'index' => 'messages', 'width' => '50', 'align' => 'left', 'sortable' => 'false'), array('name' => 'actions', 'index' => 'actions', 'width' => '50', 'align' => 'left', 'formatter' => 'action_formatter', 'sortable' => 'false'));
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$action_links = '
function action_formatter(cellvalue, options, rowObject) {
    return \'<a href="course_log_tools.php?id_session=0&cidReq=' . $course_code . '&gidReq=\'+options.rowId+\'">' . Display::return_icon('2rightarrow.gif', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>' . '\';
}';
//Add the JS needed to use the jqgrid
$htmlHeadXtra[] = api_get_jqgrid_js();
$htmlHeadXtra[] = '
<script>
$(function() {
    ' . Display::grid_js('group_users', $url, $columns, $column_model, $extra_params, array(), $action_links, true) . '
});
</script>';
Display::display_header();
echo '<div class="actions">';
echo Display::url(Display::return_icon('user.png', get_lang('StudentsTracking'), array(), 32), 'courseLog.php?' . api_get_cidreq(true, false));
echo Display::url(Display::return_icon('group_na.png', get_lang('GroupReporting'), array(), 32), '#');
echo Display::url(Display::return_icon('course.png', get_lang('CourseTracking'), array(), 32), 'course_log_tools.php?' . api_get_cidreq(true, false));
echo Display::url(Display::return_icon('tools.png', get_lang('ResourcesTracking'), array(), 32), 'course_log_resources.php?' . api_get_cidreq(true, false));
echo '</div>';
echo Display::grid_html('group_users');
Display::display_footer();
Exemplo n.º 13
0
        $( big_image ).dialog("open");
        return false;
    });

    /* Binds a tab id in the url */
    $("#tabs").bind('tabsselect', function(event, ui) {
		window.location.href=ui.tab;
    });
<?php 
//Displays js code to use a jqgrid
echo Display::grid_js('courses', '', $columns_courses, $column_model_courses, $extra_params_courses, $new_course_list);
echo Display::grid_js('list_default', $url, $columns, $column_model, $extra_params, array(), '');
echo Display::grid_js('list_course', $url_by_course, $columns, $column_model, $extra_params_course, array(), '');
echo Display::grid_js('list_week', $url_week, $column_week, $column_week_model, $extra_params_week, array(), '');
if (!api_is_anonymous()) {
    echo Display::grid_js('exercises', '', $column_exercise, $column_exercise_model, $extra_params_exercise, $my_real_array);
}
?>
});
</script>

<?php 
$courseCode = isset($_GET['course']) ? $_GET['course'] : null;
$reportingTab = '';
if (!api_is_anonymous()) {
    $reportingTab = Tracking::show_user_progress(api_get_user_id(), $session_id, '#tabs-4', false, false);
    if (!empty($reportingTab)) {
        $reportingTab .= '<br />' . Tracking::show_course_detail(api_get_user_id(), $courseCode, $session_id);
    }
    if (empty($reportingTab)) {
        $reportingTab = Display::return_message(get_lang('NoDataAvailable'), 'warning');
Exemplo n.º 14
0
                        array('name'=>'firstname',          'index'=>'firstname',   'width'=>'70',   'align'=>'left', 'sortable' => 'false'),
                        array('name'=>'lastname',           'index'=>'lastname',     'width'=>'70',   'align'=>'left', 'sortable' => 'false'),
                        array('name'=>'skills_acquired',    'index'=>'skills_acquired', 'width'=>'30	',   'align'=>'left', 'sortable' => 'false'),
                        array('name'=>'currently_learning', 'index'=>'currently_learning',    'width'=>'30',   'align'=>'left', 'sortable' => 'false'),
                        array('name'=>'rank',               'index'=>'rank',      'width'=>'30',   'align'=>'left', 'sortable' => 'false')
                       );

//Autowidth
$extra_params['autowidth'] = 'true';

//height auto
$extra_params['height'] = 'auto';
//$extra_params['excel'] = 'excel';

//$extra_params['rowList'] = array(10, 20 ,30);

$jqgrid = Display::grid_js('skill_ranking', $url,$columns,$column_model,$extra_params, array(), $action_links,true);

$content = Display::grid_html('skill_ranking');


$tpl = new Template($tool_name);

$tpl->assign('actions', $actions);
$tpl->assign('message', $message);

$tpl->assign('jqgrid_html', $jqgrid);
$content .= $tpl->fetch('default/skill/skill_ranking.tpl');
$tpl->assign('content', $content);

$tpl->display_one_col_template();
Exemplo n.º 15
0
        $content = $event_controller->listingAction();
        break;
    default:
    case 'listing':
        $content = $event_controller->listingAction();
        break;
}
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_event_email_template';
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Subject'), get_lang('EventTypeName'), get_lang('Language'), get_lang('Status'), get_lang('Actions'));
//Column config
$column_model = array(array('name' => 'subject', 'index' => 'subject', 'width' => '80', 'align' => 'left'), array('name' => 'event_type_name', 'index' => 'event_type_name', 'width' => '80', 'align' => 'left'), array('name' => 'language_id', 'index' => 'language_id', 'width' => '80', 'align' => 'left'), array('name' => 'activated', 'index' => 'activated', 'width' => '80', 'align' => 'left'), array('name' => 'actions', 'index' => 'actions', 'width' => '100'));
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
$htmlHeadXtra[] = api_get_jqgrid_js();
$htmlHeadXtra[] = '<script>
$(function() {
    ' . Display::grid_js('event_email_template', $url, $columns, $column_model, $extra_params, array(), $action_links, true) . '
});
</script>';
$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Events'));
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('actions', $actions);
$tpl->assign('message', $message);
$tpl->assign('content', $content);
$tpl->display_one_col_template();
Exemplo n.º 16
0
                $usergroup->unsubscribe_courses_from_usergroup($id, array(api_get_course_int_id()));
                Display::addFlash(Display::return_message(get_lang('Deleted')));
            }
            break;
    }
}
//jqgrid will use this URL to do the selects
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_usergroups_teacher&type=' . $type . '&group_filter=' . $groupFilter;
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('Name'), get_lang('Users'), get_lang('Status'), get_lang('Type'), get_lang('Actions'));
// Column config
$columnModel = array(array('name' => 'name', 'index' => 'name', 'width' => '35', 'align' => 'left'), array('name' => 'users', 'index' => 'users', 'width' => '15', 'align' => 'left'), array('name' => 'status', 'index' => 'status', 'width' => '15', 'align' => 'left'), array('name' => 'group_type', 'index' => 'group_type', 'width' => '15', 'align' => 'center'), array('name' => 'actions', 'index' => 'actions', 'width' => '10', 'align' => 'center', 'sortable' => 'false'));
// Autowidth
$extraParams['autowidth'] = 'true';
// height auto
$extraParams['height'] = 'auto';
Display::display_header($tool_name, "User");
?>
<script>
$(function() {
<?php 
// grid definition see the $usergroup>display() function
echo Display::grid_js('usergroups', $url, $columns, $columnModel, $extraParams, array(), '', true);
?>
});
</script>
<?php 
echo $actions;
echo UserManager::getUserSubscriptionTab(4);
$usergroup->display_teacher_view();
Display::display_footer();
Exemplo n.º 17
0
 /**
  * Display a sortable table that contains an overview off all the progress of the user in a session
  * @author César Perales <*****@*****.**>, Beeznest Team
  */
 static function display_tracking_progress_overview($sessionId = 0, $courseId = 0, $date_from, $date_to)
 {
     //The order is important you need to check the the $column variable in the model.ajax.php file
     $columns = array(get_lang('LastName'), get_lang('FirstName'), get_lang('Username'), get_lang('Total'), get_lang('Courses'), get_lang('LearningPaths'), get_lang('Exercises'), get_lang('Forums'), get_lang('Assignments'), get_lang('ToolWiki'), get_lang('ToolSurvey'), get_lang('LearnpathsTotal'), get_lang('LearnpathsDone'), get_lang('LearnpathsLeft'), get_lang('LearnpathsProgress'), get_lang('ExercisesTotal'), get_lang('ExercisesDone'), get_lang('ExercisesLeft'), get_lang('ExercisesProgress'), get_lang('ForumsTotal'), get_lang('ForumsDone'), get_lang('ForumsLeft'), get_lang('ForumsProgress'), get_lang('AssignmentsTotal'), get_lang('AssignmentsDone'), get_lang('AssignmentsLeft'), get_lang('AssignmentsProgress'), get_lang('WikiTotal'), get_lang('WikiRevisions'), get_lang('WikiRead'), get_lang('WikiUnread'), get_lang('WikiProgress'), get_lang('SurveysTotal'), get_lang('SurveysDone'), get_lang('SurveysLeft'), get_lang('SurveysProgress'));
     //Column config
     $column_model = array(array('name' => 'lastname', 'index' => 'lastname', 'align' => 'left'), array('name' => 'firstname', 'index' => 'firstname', 'align' => 'left'), array('name' => 'username', 'index' => 'username', 'align' => 'left'), array('name' => 'total', 'index' => 'total', 'align' => 'left'), array('name' => 'courses', 'index' => 'courses', 'align' => 'left', 'sortable' => 'false'), array('name' => 'lessons', 'index' => 'lessons', 'align' => 'left', 'sortable' => 'false'), array('name' => 'exercises', 'index' => 'exercises', 'align' => 'left', 'sortable' => 'false'), array('name' => 'forums', 'index' => 'forums', 'align' => 'left', 'sortable' => 'false'), array('name' => 'homeworks', 'index' => 'homeworks', 'align' => 'left', 'sortable' => 'false'), array('name' => 'wikis', 'index' => 'wikis', 'align' => 'left', 'sortable' => 'false'), array('name' => 'surveys', 'index' => 'surveys', 'align' => 'left', 'sortable' => 'false'), array('name' => 'lessons_total', 'index' => 'lessons_total', 'align' => 'center', 'sortable' => 'false'), array('name' => 'lessons_done', 'index' => 'lessons_done', 'align' => 'center', 'sortable' => 'false'), array('name' => 'lessons_left', 'index' => 'lessons_left', 'align' => 'center', 'sortable' => 'false'), array('name' => 'lessons_progress', 'index' => 'lessons_progress', 'align' => 'center', 'sortable' => 'false'), array('name' => 'exercises_total', 'index' => 'exercises_total', 'align' => 'center', 'sortable' => 'false'), array('name' => 'exercises_done', 'index' => 'exercises_done', 'align' => 'center', 'sortable' => 'false'), array('name' => 'exercises_left', 'index' => 'exercises_left', 'align' => 'center', 'sortable' => 'false'), array('name' => 'exercises_progress', 'index' => 'exercises_progress', 'align' => 'center', 'sortable' => 'false'), array('name' => 'forums_total', 'index' => 'forums_total', 'align' => 'center', 'sortable' => 'false'), array('name' => 'forums_done', 'index' => 'forums_done', 'align' => 'center', 'sortable' => 'false'), array('name' => 'forums_left', 'index' => 'forums_left', 'align' => 'center', 'sortable' => 'false'), array('name' => 'forums_progress', 'index' => 'forums_progress', 'align' => 'center', 'sortable' => 'false'), array('name' => 'assigments_total', 'index' => 'assigments_total', 'align' => 'center', 'sortable' => 'false'), array('name' => 'assigments_done', 'index' => 'assigments_done', 'align' => 'center', 'sortable' => 'false'), array('name' => 'assigments_left', 'index' => 'assigments_left', 'align' => 'center', 'sortable' => 'false'), array('name' => 'assigments_progress', 'index' => 'assigments_progress', 'align' => 'center', 'sortable' => 'false'), array('name' => 'wiki_total', 'index' => 'wiki_total', 'align' => 'center', 'sortable' => 'false'), array('name' => 'wiki_revisions', 'index' => 'wiki_revisions', 'align' => 'center', 'sortable' => 'false'), array('name' => 'wiki_read', 'index' => 'wiki_read', 'align' => 'center', 'sortable' => 'false'), array('name' => 'wiki_unread', 'index' => 'wiki_unread', 'align' => 'center', 'sortable' => 'false'), array('name' => 'wiki_progress', 'index' => 'wiki_progress', 'align' => 'center', 'sortable' => 'false'), array('name' => 'surveys_total', 'index' => 'surveys_total', 'align' => 'center', 'sortable' => 'false'), array('name' => 'surveys_done', 'index' => 'surveys_done', 'align' => 'center', 'sortable' => 'false'), array('name' => 'surveys_left', 'index' => 'surveys_left', 'align' => 'center', 'sortable' => 'false'), array('name' => 'surveys_progress', 'index' => 'surveys_progress', 'align' => 'center', 'sortable' => 'false'));
     $action_links = '';
     // jqgrid will use this URL to do the selects
     $url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_session_progress&session_id=' . $sessionId . '&course_id=' . $courseId . '&date_to=' . $date_to . '&date_from=' . $date_from;
     //Table Id
     $tableId = 'progressOverview';
     //Autowidth
     $extra_params['autowidth'] = 'true';
     $extra_params['shrinkToFit'] = 'true';
     $extra_params['headertitles'] = 'true';
     $extra_params['groupHeaders'] = array('courses_detail' => array("startColumnName" => 'courses', "numberOfColumns" => 7, "titleText" => get_lang('Global')), 'lessons' => array("startColumnName" => 'lessons_total', "numberOfColumns" => 4, "titleText" => get_lang('LearningPaths')), 'exercises' => array("startColumnName" => 'exercises_total', "numberOfColumns" => 4, "titleText" => get_lang('Exercises')), 'forums' => array("startColumnName" => 'forums_total', "numberOfColumns" => 4, "titleText" => get_lang('Forums')), 'assignments' => array("startColumnName" => 'assigments_total', "numberOfColumns" => 4, "titleText" => get_lang('Assignments')), 'wikis' => array("startColumnName" => 'wiki_total', "numberOfColumns" => 5, "titleText" => get_lang('Wiki')), 'surveys' => array("startColumnName" => 'surveys_total', "numberOfColumns" => 4, "titleText" => get_lang('Survey')));
     //height auto
     $extra_params['height'] = 'auto';
     $table = Display::grid_js($tableId, $url, $columns, $column_model, $extra_params, array(), $action_links, true);
     $return = '<script>$(function() {' . $table . 'jQuery("#' . $tableId . '").jqGrid("navGrid","#' . $tableId . '_pager",{view:false, edit:false, add:false, del:false, search:false, excel:true});
             jQuery("#' . $tableId . '").jqGrid("navButtonAdd","#' . $tableId . '_pager",{
                    caption:"",
                    title:"' . get_lang('ExportExcel') . '",
                    onClickButton : function () {
                        jQuery("#' . $tableId . '").jqGrid("excelExport",{"url":"' . $url . '&export_format=xls"});
                    }
             });
         });</script>';
     $return .= Display::grid_html($tableId);
     return $return;
 }
Exemplo n.º 18
0
        $col = array('name' => $extra['1'], 'index' => $extra['1'], 'width' => '120', 'sortable' => 'false', 'wrap_cell' => 'true');
        $column_model[] = $col;
        $columns[] = $extra['3'];
    }
}
if (api_is_student_boss()) {
    $column_model[] = array('name' => 'group', 'index' => 'group', 'width' => '50', 'align' => 'left', 'sortable' => 'false');
    $columns[] = get_lang('Group');
}
// Autowidth
$extra_params['autowidth'] = 'true';
// height auto
$extra_params['height'] = 'auto';
$htmlHeadXtra[] = '<script>
$(function() {
    ' . Display::grid_js('user_course_report', $url, $columns, $column_model, $extra_params, array(), null, true) . '
    jQuery("#user_course_report").jqGrid("navGrid","#user_course_report_pager",{
        view:false,
        edit:false,
        add:false,
        del:false,
        search:false,
        excel:true
    });

    jQuery("#user_course_report").jqGrid("navButtonAdd","#user_course_report_pager", {
       caption:"",
       onClickButton : function () {
           jQuery("#user_course_report").jqGrid("excelExport",{"url":"' . $url . '&export_format=xls"});
       }
    });
 /**
  * Gets the question list per category
  * @param Application $app
  * @param $categoryId
  * @return Response
  */
 public function getQuestionsByCategoryAction(Application $app, $categoryId)
 {
     // Getting CQuizCategory repo.
     /** @var \Doctrine\ORM\EntityManager $em */
     $em = $app['orm.em'];
     $repo = $em->getRepository('Entity\\CQuizCategory');
     /** @var \Entity\CQuizCategory $category */
     $category = $repo->find($categoryId);
     $questionColumns = \Question::getQuestionColumns();
     $columnModel = $questionColumns['column_model'];
     $columns = $questionColumns['columns'];
     $rules = $questionColumns['rules'];
     $grid = \Display::grid_html('questions');
     //jqgrid will use this URL to do the selects
     $url = $app['url_generator']->generate('model_ajax') . '?a=get_questions&categoryId=' . $categoryId;
     $extraParams['postData'] = array('filters' => array("groupOp" => "AND", "rules" => $rules));
     // Autowidth.
     $extraParams['autowidth'] = 'true';
     // Height auto.
     $extraParams['height'] = 'auto';
     $token = null;
     $editUrl = $app['url_generator']->generate('admin_questions');
     $actionLinks = 'function action_formatter(cellvalue, options, rowObject) {
         return \'<a href="' . $editUrl . '/\'+rowObject[0]+\'/edit">' . \Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL) . '</a>' . '\';
     }';
     $testCategory = new \Testcategory($categoryId);
     $count = $testCategory->getCategoryQuestionsNumber();
     $js = \Display::grid_js('questions', $url, $columns, $columnModel, $extraParams, array(), $actionLinks, true);
     //$count = $repo->childCount($category);
     $app['template']->assign('category_children', $count);
     $app['template']->assign('category', $category);
     $app['template']->assign('grid', $grid);
     $app['template']->assign('js', $js);
     $response = $app['template']->render_template('admin/questionmanager/questions.tpl');
     return new Response($response, 200, array());
 }
Exemplo n.º 20
0
$minutes = 60;
$url = api_get_path(WEB_AJAX_PATH) . 'exercise.ajax.php?a=get_live_stats&exercise_id=' . $objExercise->id . '&minutes=' . $minutes;
//The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(get_lang('FirstName'), get_lang('LastName'), get_lang('Time'), get_lang('QuestionsAlreadyAnswered'), get_lang('Score'));
//Column config
$column_model = array(array('name' => 'firstname', 'index' => 'firstname', 'width' => '100', 'align' => 'left'), array('name' => 'lastname', 'index' => 'lastname', 'width' => '100', 'align' => 'left'), array('name' => 'start_date', 'index' => 'start_date', 'width' => '100', 'align' => 'left'), array('name' => 'question', 'index' => 'count_questions', 'width' => '60', 'align' => 'left', 'sortable' => 'false'), array('name' => 'score', 'index' => 'score', 'width' => '50', 'align' => 'left', 'sortable' => 'false'));
//Autowidth
$extra_params['autowidth'] = 'true';
//height auto
$extra_params['height'] = 'auto';
?>
<script>

function refreshGrid() {
    var grid = $("#live_stats");
    grid.trigger("reloadGrid");
    t = setTimeout("refreshGrid()", 10000);
}

$(function() {
    <?php 
echo Display::grid_js('live_stats', $url, $columns, $column_model, $extra_params, array(), null, true);
?>
    refreshGrid();
});
</script>
<?php 
$actions = '<a href="exercise_report.php?exerciseId=' . intval($_GET['exerciseId']) . '&' . api_get_cidreq() . '">' . Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM) . '</a>';
echo $actions = Display::div($actions, array('class' => 'actions'));
echo Display::grid_html('live_stats');
Display::display_footer();
Exemplo n.º 21
0
$extra_params['height'] = 'auto';
//With this function we can add actions to the jgrid (edit, delete, etc)
$action_links = 'function action_formatter(cellvalue, options, rowObject) {
                        //certificates
                        if (rowObject[4] == 1) {
                            return \'<a href="?action=add_skill&id=\'+options.rowId+\'">' . Display::return_icon('add.png', get_lang('AddSkill'), '', ICON_SIZE_SMALL) . '</a>' . '\';
                        } else {
                            return \'' . Display::return_icon('add_na.png', get_lang('YourGradebookFirstNeedsACertificateInOrderToBeLinkedToASkill'), '', ICON_SIZE_SMALL) . '' . '\';
                        }
                 }';
?>
<script>
$(function() {
<?php 
// grid definition see the $career->display() function
echo Display::grid_js('gradebooks', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
?>
});
</script>
<?php 
$gradebook = new Gradebook();
switch ($action) {
    case 'display':
        $gradebook->display();
        break;
    case 'add_skill':
        $id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
        $gradebook_info = $gradebook->get($id);
        $url = api_get_self() . '?action=' . $action . '&id=' . $id;
        $form = $gradebook->show_skill_form($id, $url, $gradebook_info['name']);
        if ($form->validate()) {
Exemplo n.º 22
0
        $actionsRight = Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), 32), 'javascript: void(0);', array('onclick' => 'javascript: window.print();'));
        $actionsRight .= Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), 32), api_get_self() . '?export=csv');
    }
    $toolbar = Display::toolbarAction('toolbar-session', $content = array(0 => $actionsLeft, 1 => $actionsRight));
    echo $toolbar;
    echo Display::page_header(get_lang('YourSessionsList'));
} else {
    $a_sessions = Tracking::get_sessions_coached_by_user($id_coach);
}
$form = new FormValidator('search_course', 'get', api_get_path(WEB_CODE_PATH) . 'mySpace/session.php');
$form->addElement('text', 'keyword', get_lang('Keyword'));
$form->addButtonSearch(get_lang('Search'));
$keyword = '';
if ($form->validate()) {
    $keyword = $form->getSubmitValue('keyword');
}
$form->setDefaults(array('keyword' => $keyword));
$url = api_get_path(WEB_AJAX_PATH) . 'model.ajax.php?a=get_sessions_tracking&keyword=' . Security::remove_XSS($keyword);
$columns = array(get_lang('Title'), get_lang('Date'), get_lang('NbCoursesPerSession'), get_lang('NbStudentPerSession'), get_lang('Details'));
// Column config
$columnModel = array(array('name' => 'name', 'index' => 'name', 'width' => '255', 'align' => 'left'), array('name' => 'date', 'index' => 'date', 'width' => '150', 'align' => 'left', 'sortable' => 'false'), array('name' => 'course_per_session', 'index' => 'course_per_session', 'width' => '150', 'sortable' => 'false'), array('name' => 'student_per_session', 'index' => 'student_per_session', 'width' => '100', 'sortable' => 'false'), array('name' => 'details', 'index' => 'details', 'width' => '100', 'sortable' => 'false'));
$extraParams = array('autowidth' => 'true', 'height' => 'auto');
$js = '<script>
    $(function() {
        ' . Display::grid_js('session_tracking', $url, $columns, $columnModel, $extraParams, array(), null, true) . '
    });
</script>';
echo $js;
$form->display();
echo Display::grid_html('session_tracking');
Display::display_footer();
 /**
  * @param Application $app
  * @param string $cidReq
  * @param int $exerciseId
  * @return Response
  */
 public function questionPoolAction(Application $app, $cidReq = null, $exerciseId = null)
 {
     $extraJS = array();
     //@todo improve this JS includes should be added using twig
     $extraJS[] = api_get_jqgrid_js();
     $app['extraJS'] = $extraJS;
     // @todo this should be auto
     if (empty($exerciseId)) {
         $breadcrumbs = array(array('name' => get_lang('Exercise'), 'url' => array('uri' => api_get_path(WEB_CODE_PATH) . 'exercice/exercice.php?' . api_get_cidreq())), array('name' => get_lang('QuestionPool'), 'url' => array('route' => 'exercise_question_pool_global', 'routeParameters' => array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id()))));
     } else {
         $breadcrumbs = array(array('name' => get_lang('Exercise'), 'url' => array('uri' => api_get_path(WEB_CODE_PATH) . 'exercice/admin.php?' . api_get_cidreq() . '&exerciseId=' . $exerciseId)), array('name' => get_lang('QuestionPool'), 'url' => array('route' => 'exercise_question_pool', 'routeParameters' => array('cidReq' => api_get_course_id(), 'id_session' => api_get_session_id(), 'exerciseId' => $exerciseId))));
     }
     $this->setBreadcrumb($app, $breadcrumbs);
     $questionColumns = \Question::getQuestionColumns($cidReq);
     $columnModel = $questionColumns['column_model'];
     $columns = $questionColumns['columns'];
     $rules = $questionColumns['rules'];
     $grid = \Display::grid_html('questions');
     // jqgrid will use this URL to do the selects
     $extraConditions = null;
     if (!empty($cidReq)) {
         $extraConditions = "courseId=" . api_get_course_int_id();
     }
     if (!empty($exerciseId)) {
         $extraConditions .= "&exerciseId=" . $exerciseId;
     }
     $url = $app['url_generator']->generate('model_ajax') . '?a=get_questions&' . $extraConditions;
     $extraParams['postData'] = array('filters' => array("groupOp" => "AND", "rules" => $rules));
     // Auto-width.
     $extraParams['autowidth'] = 'true';
     // Height auto.
     $extraParams['height'] = 'auto';
     $token = null;
     $js = \Display::grid_js('questions', $url, $columns, $columnModel, $extraParams, array(), null, true);
     $app['template']->assign('grid', $grid);
     $app['template']->assign('js', $js);
     $response = $app['template']->render_template('exercise/question_pool.tpl');
     return new Response($response, 200, array());
 }