コード例 #1
0
 /**
  * Constructor
  */
 public function ResultTable($evaluation, $results = array(), $iscourse, $addparams = null, $forprint = false)
 {
     parent::__construct('resultlist', null, null, (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1);
     $this->datagen = new ResultsDataGenerator($evaluation, $results, true);
     $this->evaluation = $evaluation;
     $this->iscourse = $iscourse;
     $this->forprint = $forprint;
     if (isset($addparams)) {
         $this->set_additional_parameters($addparams);
     }
     $scoredisplay = ScoreDisplay::instance();
     $column = 0;
     if ($this->iscourse == '1') {
         $this->set_header($column++, '', false);
         $this->set_form_actions(array('delete' => get_lang('Delete')));
     }
     if (api_is_western_name_order()) {
         $this->set_header($column++, get_lang('FirstName'));
         $this->set_header($column++, get_lang('LastName'));
     } else {
         $this->set_header($column++, get_lang('LastName'));
         $this->set_header($column++, get_lang('FirstName'));
     }
     $this->set_header($column++, get_lang('Score'));
     if ($scoredisplay->is_custom()) {
         $this->set_header($column++, get_lang('Display'));
     }
     if (!$this->forprint) {
         $this->set_header($column++, get_lang('Modify'), false);
     }
 }
コード例 #2
0
 /**
  * Constructor
  * @param Category $currentcat
  * @param array $cats
  * @param array $evals
  * @param array $links
  * @param null $addparams
  */
 public function __construct($currentcat, $cats = array(), $evals = array(), $links = array(), $addparams = null, $exportToPdf = false, $showTeacherView = null, $userId = null, $studentList = array())
 {
     $this->teacherView = is_null($showTeacherView) ? api_is_allowed_to_edit(null, true) : $showTeacherView;
     $this->userId = is_null($userId) ? api_get_user_id() : $userId;
     $this->exportToPdf = $exportToPdf;
     parent::__construct('gradebooklist', null, null, api_is_allowed_to_edit() ? 1 : 0, 20, 'ASC', 'gradebook_list');
     $this->evals_links = array_merge($evals, $links);
     $this->currentcat = $currentcat;
     $this->cats = $cats;
     $this->datagen = new GradebookDataGenerator($cats, $evals, $links);
     if (!empty($userId)) {
         $this->datagen->userId = $userId;
     }
     if (isset($addparams)) {
         $this->set_additional_parameters($addparams);
     }
     $column = 0;
     if ($this->teacherView) {
         if ($this->exportToPdf == false) {
             $this->set_header($column++, '', '', 'width="25px"');
         }
     }
     $this->set_header($column++, get_lang('Type'), '', 'width="35px"');
     $this->set_header($column++, get_lang('Name'), false);
     if ($this->exportToPdf == false) {
         $this->set_header($column++, get_lang('Description'), false);
     }
     if ($this->teacherView) {
         $this->set_header($column++, get_lang('Weight'), '', 'width="100px"');
     } else {
         $this->set_header($column++, get_lang('Weight'), false);
         $this->set_header($column++, get_lang('Result'), false);
         $this->set_header($column++, get_lang('Ranking'), false);
         $this->set_header($column++, get_lang('BestScore'), false);
         $this->set_header($column++, get_lang('Average'), false);
         if (!empty($cats)) {
             if ($this->exportToPdf == false) {
                 $this->set_header($column++, get_lang('Actions'), false);
             }
         }
     }
     // Deactivates the odd/even alt rows in order that the +/- buttons work see #4047
     $this->odd_even_rows_enabled = false;
     // Admins get an edit column.
     if ($this->teacherView) {
         $this->set_header($column++, get_lang('Modify'), false, 'width="195px"');
         // Actions on multiple selected documents.
         $this->set_form_actions(array('setvisible' => get_lang('SetVisible'), 'setinvisible' => get_lang('SetInvisible'), 'deleted' => get_lang('DeleteSelected')));
     } else {
         if (empty($_GET['selectcat']) && !$this->teacherView) {
             if ($this->exportToPdf == false) {
                 $this->set_header($column++, get_lang('Certificates'), false);
             }
         }
     }
 }
コード例 #3
0
 /**
  * Constructor
  */
 function FlatViewTable($selectcat, $users = array(), $evals = array(), $links = array(), $limit_enabled = false, $offset = 0, $addparams = null)
 {
     parent::__construct('flatviewlist', null, null, (api_is_western_name_order() xor api_sort_by_first_name()) ? 1 : 0);
     $this->selectcat = $selectcat;
     $this->datagen = new FlatViewDataGenerator($users, $evals, $links, array('only_subcat' => $this->selectcat->get_id()));
     $this->limit_enabled = $limit_enabled;
     $this->offset = $offset;
     if (isset($addparams)) {
         $this->set_additional_parameters($addparams);
     }
     // step 2: generate rows: students
     $this->datagen->category = $this->selectcat;
 }
コード例 #4
0
 /**
  * Constructor
  */
 function GradebookTable($currentcat, $cats = array(), $evals = array(), $links = array(), $addparams = null)
 {
     //$status = CourseManager::get_user_in_course_status(api_get_user_id(), api_get_course_id());
     parent::__construct('gradebooklist', null, null, api_is_allowed_to_edit() ? 1 : 0);
     $this->evals_links = array_merge($evals, $links);
     $this->currentcat = $currentcat;
     $this->cats = $cats;
     $this->datagen = new GradebookDataGenerator($cats, $evals, $links);
     if (isset($addparams)) {
         $this->set_additional_parameters($addparams);
     }
     $column = 0;
     if (api_is_allowed_to_edit(null, true)) {
         $this->set_header($column++, '', '', 'width="25px"');
     }
     $this->set_header($column++, get_lang('Type'), '', 'width="35px"');
     $this->set_header($column++, get_lang('Name'), false);
     $this->set_header($column++, get_lang('Description'), false);
     if (api_is_allowed_to_edit(null, true)) {
         $this->set_header($column++, get_lang('Weight'), '', 'width="100px"');
     } else {
         $this->set_header($column++, get_lang('Weight'), false);
         $this->set_header($column++, get_lang('Result'), false);
         if (!empty($cats)) {
             $this->set_header($column++, get_lang('Actions'), false);
         }
     }
     //Desactivates the odd/even alt rows in order that the +/- buttons work see #4047
     $this->odd_even_rows_enabled = false;
     /*if (api_is_allowed_to_edit(null, true)) {
     			//$this->set_header($column++, get_lang('CreationDate'),true, 'width="100px"');
     		} elseif (($status<>1)  && !api_is_allowed_to_edit() && (!isset($_GET['selectcat']) || $_GET['selectcat']==0)) {
     			//$this->set_header($column++, get_lang('Date'),true, 'width="100px"');
     		}*/
     //admins get an edit column
     if (api_is_allowed_to_edit(null, true)) {
         $this->set_header($column++, get_lang('Modify'), false, 'width="195px"');
         //actions on multiple selected documents
         $this->set_form_actions(array('setvisible' => get_lang('SetVisible'), 'setinvisible' => get_lang('SetInvisible'), 'deleted' => get_lang('DeleteSelected')));
     } else {
         if (empty($_GET['selectcat']) && !api_is_allowed_to_edit()) {
             $this->set_header($column++, get_lang('Certificates'), false);
         } else {
             //$evals_links = array_merge($evals, $links);
             //if (count($evals_links)>0) {
             //$this->set_header($column++, get_lang('Results'), false);
             //}
         }
     }
 }
コード例 #5
0
 /**
  * Constructor
  */
 public function __construct($userid, $evals = array(), $links = array(), $addparams = null)
 {
     parent::__construct('userlist', null, null, 0);
     $this->userid = $userid;
     $this->datagen = new UserDataGenerator($userid, $evals, $links);
     if (isset($addparams)) {
         $this->set_additional_parameters($addparams);
     }
     $column = 0;
     $this->set_header($column++, get_lang('Type'));
     $this->set_header($column++, get_lang('Evaluation'));
     $this->set_header($column++, get_lang('Course'));
     $this->set_header($column++, get_lang('Category'));
     $this->set_header($column++, get_lang('EvaluationAverage'));
     $this->set_header($column++, get_lang('Result'));
     $scoredisplay = ScoreDisplay::instance();
     if ($scoredisplay->is_custom()) {
         $this->set_header($column++, get_lang('Display'));
     }
 }
コード例 #6
0
 /**
  * @return string
  */
 static function outbox_display()
 {
     $social_link = false;
     if (isset($_REQUEST['f']) && $_REQUEST['f'] == 'social') {
         $social_link = 'f=social';
     }
     $success = get_lang('SelectedMessagesDeleted') . '&nbsp</b><br /><a href="outbox.php?' . $social_link . '">' . get_lang('BackToOutbox') . '</a>';
     $html = null;
     if (isset($_REQUEST['action'])) {
         switch ($_REQUEST['action']) {
             case 'delete':
                 $number_of_selected_messages = count($_POST['id']);
                 if ($number_of_selected_messages != 0) {
                     foreach ($_POST['id'] as $index => $message_id) {
                         MessageManager::delete_message_by_user_receiver(api_get_user_id(), $message_id);
                     }
                 }
                 $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false);
                 break;
             case 'deleteone':
                 MessageManager::delete_message_by_user_receiver(api_get_user_id(), $_GET['id']);
                 $html .= Display::return_message(api_xml_http_response_encode($success), 'normal', false);
                 $html .= '<br/>';
                 break;
         }
     }
     // display sortable table with messages of the current user
     $table = new SortableTable('message_outbox', array('MessageManager', 'get_number_of_messages_sent'), array('MessageManager', 'get_message_data_sent'), 3, 20, 'DESC');
     $parameters['f'] = isset($_GET['f']) && $_GET['f'] == 'social' ? 'social' : null;
     $table->set_additional_parameters($parameters);
     $table->set_header(0, '', false, array('style' => 'width:15px;'));
     $table->set_header(1, get_lang('Messages'), false);
     $table->set_header(2, get_lang('Date'), true, array('style' => 'width:160px;'));
     $table->set_header(3, get_lang('Modify'), false, array('style' => 'width:70px;'));
     $table->set_form_actions(array('delete' => get_lang('DeleteSelectedMessages')));
     $html .= $table->return_table();
     return $html;
 }
コード例 #7
0
ファイル: student.php プロジェクト: KRCM13/chamilo-lms
        }
    }
} else {
    if (api_is_student_boss()) {
        $actions .= Display::url(Display::return_icon('stats.png', get_lang('MyStats'), '', ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "auth/my_progress.php");
        $actions .= Display::url(Display::return_icon('user_na.png', get_lang('Students'), array(), ICON_SIZE_MEDIUM), '#');
        $actions .= Display::url(Display::return_icon("statistics.png", get_lang("CompanyReport"), array(), ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "mySpace/company_reports.php");
        $actions .= Display::url(Display::return_icon("certificate_list.png", get_lang("GradebookSeeListOfStudentsCertificates"), [], ICON_SIZE_MEDIUM), api_get_path(WEB_CODE_PATH) . "gradebook/certificate_report.php");
    }
}
$actions .= '<span style="float:right">';
$actions .= Display::url(Display::return_icon('printer.png', get_lang('Print'), array(), ICON_SIZE_MEDIUM), 'javascript: void(0);', array('onclick' => 'javascript: window.print();'));
$actions .= Display::url(Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), array(), ICON_SIZE_MEDIUM), api_get_self() . '?export=csv&keyword=' . $keyword);
$actions .= '</span>';
$actions .= '</div>';
$table = new SortableTable('tracking_student', 'get_count_users', 'get_users', ($is_western_name_order xor $sort_by_first_name) ? 1 : 0, 10);
$params = array('keyword' => $keyword, 'active' => $active, 'sleeping_days' => $sleepingDays);
$table->set_additional_parameters($params);
if ($is_western_name_order) {
    $table->set_header(0, get_lang('FirstName'), false);
    $table->set_header(1, get_lang('LastName'), false);
} else {
    $table->set_header(0, get_lang('LastName'), false);
    $table->set_header(1, get_lang('FirstName'), false);
}
$table->set_header(2, get_lang('FirstLogin'), false);
$table->set_header(3, get_lang('LastConnexion'), false);
$table->set_header(4, get_lang('Details'), false);
if ($export_csv) {
    if ($is_western_name_order) {
        $csv_header[] = array(get_lang('FirstName'), get_lang('LastName'), get_lang('FirstLogin'), get_lang('LastConnexion'));
コード例 #8
0
 $actions .= '<div class="pull-right">';
 $actions .= '<a href="course_add.php">' . Display::return_icon('new_course.png', get_lang('AddCourse'), '', ICON_SIZE_MEDIUM) . '</a> ';
 if (api_get_setting('course_validation') == 'true') {
     $actions .= '<a href="course_request_review.php">' . Display::return_icon('course_request_pending.png', get_lang('ReviewCourseRequests'), '', ICON_SIZE_MEDIUM) . '</a>';
 }
 $actions .= '</div>';
 $actions .= '<div class="pull-right">';
 $actions .= $sessionFilter->return_form();
 $actions .= '</div>';
 $actions .= $form->return_form();
 if (isset($_GET['session_id']) && !empty($_GET['session_id'])) {
     // Create a sortable table with the course data filtered by session
     $table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data_by_session', 2);
 } else {
     // Create a sortable table with the course data
     $table = new SortableTable('courses', 'get_number_of_courses', 'get_course_data', 2);
 }
 $parameters = array();
 if (isset($_GET['keyword'])) {
     $parameters = array('keyword' => Security::remove_XSS($_GET['keyword']));
 } elseif (isset($_GET['keyword_code'])) {
     $parameters['keyword_code'] = Security::remove_XSS($_GET['keyword_code']);
     $parameters['keyword_title'] = Security::remove_XSS($_GET['keyword_title']);
     $parameters['keyword_category'] = Security::remove_XSS($_GET['keyword_category']);
     $parameters['keyword_language'] = Security::remove_XSS($_GET['keyword_language']);
     $parameters['keyword_visibility'] = Security::remove_XSS($_GET['keyword_visibility']);
     $parameters['keyword_subscribe'] = Security::remove_XSS($_GET['keyword_subscribe']);
     $parameters['keyword_unsubscribe'] = Security::remove_XSS($_GET['keyword_unsubscribe']);
 }
 $table->set_additional_parameters($parameters);
 $table->set_header(0, '', false, 'width="8px"');
コード例 #9
0
    if ($start_date_error) {
        $msg_error .= get_lang('YouMustSelectAtleastAStartDate') . '<br />';
    }
    if ($duration_error) {
        $msg_error .= get_lang('DurationInHoursMustBeNumeric');
    }
    if (!empty($msg_error)) {
        Display::display_error_message($msg_error, false);
    }
    $form->display();
} else {
    if ($action == 'thematic_advance_list') {
        // thematic advance list
        echo '<div class="actions">';
        echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;action=thematic_details">' . Display::return_icon('back.png', get_lang("BackTo"), '', ICON_SIZE_MEDIUM) . '</a>';
        if (api_is_allowed_to_edit(false, true)) {
            echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&amp;action=thematic_advance_add&amp;thematic_id=' . $thematic_id . '"> ' . Display::return_icon('add.png', get_lang('NewThematicAdvance'), '', ICON_SIZE_MEDIUM) . '</a>';
        }
        echo '</div>';
        $table = new SortableTable('thematic_advance_list', array('Thematic', 'get_number_of_thematic_advances'), array('Thematic', 'get_thematic_advance_data'));
        $table->set_additional_parameters($parameters);
        $table->set_header(0, '', false, array('style' => 'width:20px;'));
        $table->set_header(1, get_lang('StartDate'), false);
        $table->set_header(2, get_lang('DurationInHours'), false, array('style' => 'width:80px;'));
        $table->set_header(3, get_lang('Content'), false);
        if (api_is_allowed_to_edit(null, true)) {
            $table->set_header(4, get_lang('Actions'), false, array('style' => 'text-align:center'));
        }
        $table->display();
    }
}
コード例 #10
0
ファイル: user.php プロジェクト: KRCM13/chamilo-lms
    } else {
        // Show buttons for unsubscribe
        if ($course_info['unsubscribe'] == 1) {
            if ($user_id == $current_user_id) {
                $result .= '<a class="btn btn-small btn-danger" href="' . api_get_self() . '?' . api_get_cidreq() . '&type=' . $type . '&unregister=yes&user_id=' . $user_id . '" title="' . get_lang('Unreg') . ' " onclick="javascript:if(!confirm(\'' . addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES, $charset)) . '\')) return false;">' . get_lang('Unreg') . '</a>&nbsp;';
            }
        }
    }
    return $result;
}
function hide_field()
{
    return null;
}
$default_column = 3;
$table = new SortableTable('user_list', 'get_number_of_users', 'get_user_data', $default_column);
$parameters['keyword'] = isset($_GET['keyword']) ? Security::remove_XSS($_GET['keyword']) : null;
$parameters['sec_token'] = Security::get_token();
$table->set_additional_parameters($parameters);
$header_nr = 0;
$indexList = array();
$table->set_header($header_nr++, '', false);
$indexList['photo'] = $header_nr;
$table->set_header($header_nr++, get_lang('Photo'), false);
$table->set_header($header_nr++, get_lang('OfficialCode'));
$indexList['official_code'] = $header_nr;
if ($is_western_name_order) {
    $indexList['firstname'] = $header_nr;
    $table->set_header($header_nr++, get_lang('FirstName'));
    $indexList['lastname'] = $header_nr;
    $table->set_header($header_nr++, get_lang('LastName'));
コード例 #11
0
        $tutor_info .= '<li>';
        $tutor_info .= Display::url($userInfo['complete_name'], $userInfo['profile_url']);
        $tutor_info .= '</li>';
    }
    $tutor_info .= '</ul>';
}
echo Display::page_subheader(get_lang('GroupTutors'));
if (!empty($tutor_info)) {
    echo $tutor_info;
}
echo '<br />';
/*
 * List all the members of the current group
 */
echo Display::page_subheader(get_lang('GroupMembers'));
$table = new SortableTable('group_users', 'get_number_of_group_users', 'get_group_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 2 : 1);
$my_cidreq = isset($_GET['cidReq']) ? Security::remove_XSS($_GET['cidReq']) : '';
$my_origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : '';
$my_gidreq = isset($_GET['gidReq']) ? Security::remove_XSS($_GET['gidReq']) : '';
$parameters = array('cidReq' => $my_cidreq, 'origin' => $my_origin, 'gidReq' => $my_gidreq);
$table->set_additional_parameters($parameters);
$table->set_header(0, '');
if (api_is_western_name_order()) {
    $table->set_header(1, get_lang('FirstName'));
    $table->set_header(2, get_lang('LastName'));
} else {
    $table->set_header(1, get_lang('LastName'));
    $table->set_header(2, get_lang('FirstName'));
}
if (api_get_setting('display.show_email_addresses') == 'true') {
    $table->set_header(3, get_lang('Email'));
コード例 #12
0
                $not_register_user_message = '<br />' . get_lang('UsersNotRegistered') . '<br/><br /><br />' . $list_not_register_user;
                Display::display_error_message($not_register_user_message, false);
            }
            break;
    }
}
if (!empty($_SESSION['session_user_id'])) {
    unset($_SESSION['session_user_id']);
}
if (!empty($_SESSION['session_user_name'])) {
    unset($_SESSION['session_user_name']);
}
$is_western_name_order = api_is_western_name_order();
$sort_by_first_name = api_sort_by_first_name();
// Build table
$table = new SortableTable('subscribe_users', 'get_number_of_users', 'get_user_data', ($is_western_name_order xor $sort_by_first_name) ? 3 : 2);
$parameters['keyword'] = isset($_REQUEST['keyword']) ? Security::remove_XSS($_REQUEST['keyword']) : null;
$parameters['type'] = isset($_REQUEST['type']) ? $type : null;
$table->set_additional_parameters($parameters);
$col = 0;
$table->set_header($col++, '', false);
$table->set_header($col++, get_lang('OfficialCode'));
if (api_is_western_name_order()) {
    $table->set_header($col++, get_lang('FirstName'));
    $table->set_header($col++, get_lang('LastName'));
} else {
    $table->set_header($col++, get_lang('LastName'));
    $table->set_header($col++, get_lang('FirstName'));
}
if (api_get_setting('show_email_addresses') == 'true') {
    $table->set_header($col++, get_lang('Email'));
コード例 #13
0
$users_tracking_per_page = '';
if (isset($_GET['users_tracking_per_page'])) {
    $users_tracking_per_page = '&users_tracking_per_page=' . intval($_GET['users_tracking_per_page']);
}
echo '<a href="' . api_get_self() . '?' . api_get_cidreq() . '&export=csv&' . $addional_param . $users_tracking_per_page . '">
' . Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
echo '</span>';
echo '</div>';
// Create a search-box.
$form = new FormValidator('search_simple', 'GET', api_get_path(WEB_CODE_PATH) . 'tracking/course_log_resources.php?' . api_get_cidreq() . '&id_session' . $session_id, '', array('class' => 'form-search'), false);
$renderer = $form->defaultRenderer();
$renderer->setCustomElementTemplate('<span>{element}</span>');
$form->addElement('text', 'keyword', get_lang('Keyword'));
$form->addElement('hidden', 'cidReq', api_get_course_id());
$form->addElement('hidden', 'id_session', $session_id);
$form->addButtonSearch(get_lang('SearchUsers'), 'submit');
echo '<div class="actions">';
$form->display();
echo '</div>';
$table = new SortableTable('resources', array('TrackingCourseLog', 'count_item_resources'), array('TrackingCourseLog', 'get_item_resources_data'), 5, 20, 'DESC');
$parameters = array('id_session' => $session_id, 'cidReq' => api_get_course_id());
$table->set_additional_parameters($parameters);
$table->set_header(0, get_lang('Tool'));
$table->set_header(1, get_lang('EventType'));
$table->set_header(2, get_lang('Session'), false);
$table->set_header(3, get_lang('UserName'), true, 'width=65px');
$table->set_header(4, get_lang('IPAddress'), true, 'width=100px');
$table->set_header(5, get_lang('Document'), false);
$table->set_header(6, get_lang('Date'), true, 'width=190px');
$table->display();
Display::display_footer();
コード例 #14
0
ファイル: course.php プロジェクト: ragebat/chamilo-lms
    }
    if ($_GET['action'] == 'error_message') {
        Display::display_error_message(stripslashes($_GET['message']), false);
    }
}
if ($show_import_icon) {
    echo "<div align=\"right\">";
    echo '<a href="user_import.php?id_session=' . $id_session . '&action=export&amp;type=xml">' . Display::return_icon('excel.gif', get_lang('ImportUserListXMLCSV')) . '&nbsp;' . get_lang('ImportUserListXMLCSV') . '</a>';
    echo "</div><br />";
}
if (!api_is_drh() && !api_is_session_admin() && !api_is_platform_admin()) {
    $courses = Tracking::get_courses_followed_by_coach($_user['user_id'], $id_session);
    $a_courses = array_keys($courses);
}
$nb_courses = count($a_courses);
$table = new SortableTable('tracking_list_course', 'count_courses');
$table->set_header(0, get_lang('CourseTitle'), false);
$table->set_header(1, get_lang('NbStudents'), false);
$table->set_header(2, get_lang('TimeSpentInTheCourse') . Display::return_icon('info3.gif', get_lang('TimeOfActiveByTraining'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table->set_header(3, get_lang('ThematicAdvance'), false);
$table->set_header(4, get_lang('AvgStudentsProgress') . Display::return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table->set_header(5, get_lang('AvgCourseScore') . Display::return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
//$table -> set_header(5, get_lang('AvgExercisesScore'), false);// no code for this?
$table->set_header(6, get_lang('AvgMessages'), false);
$table->set_header(7, get_lang('AvgAssignments'), false);
$table->set_header(8, get_lang('Details'), false);
$csv_header[] = array(get_lang('CourseTitle', ''), get_lang('NbStudents', ''), get_lang('TimeSpentInTheCourse', ''), get_lang('ThematicAdvance', ''), get_lang('AvgStudentsProgress', ''), get_lang('AvgCourseScore', ''), get_lang('AvgMessages', ''), get_lang('AvgAssignments', ''));
if (is_array($a_courses)) {
    foreach ($a_courses as $courseId) {
        $courseId = intval($courseId);
        $nb_students_in_course = 0;
コード例 #15
0
ファイル: user_list.php プロジェクト: KRCM13/chamilo-lms
$status_options[SESSIONADMIN] = get_lang('SessionsAdmin');
$status_options[PLATFORM_ADMIN] = get_lang('Administrator');
$form->addElement('select', 'keyword_status', get_lang('Profile'), $status_options);
$active_group = array();
$active_group[] = $form->createElement('checkbox', 'keyword_active', '', get_lang('Active'));
$active_group[] = $form->createElement('checkbox', 'keyword_inactive', '', get_lang('Inactive'));
$form->addGroup($active_group, '', get_lang('ActiveAccount'), '<br/>', false);
$form->addElement('checkbox', 'check_easy_passwords', null, get_lang('CheckEasyPasswords'));
$form->addButtonSearch(get_lang('SearchUsers'));
$defaults = array();
$defaults['keyword_active'] = 1;
$defaults['keyword_inactive'] = 1;
$form->setDefaults($defaults);
$form->addElement('html', '</div>');
$form = $form->returnForm();
$table = new SortableTable('users', 'get_number_of_users', 'get_user_data', (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false, 'width="18px"');
$table->set_header(1, get_lang('Photo'), false);
$table->set_header(2, get_lang('OfficialCode'));
if (api_is_western_name_order()) {
    $table->set_header(3, get_lang('FirstName'));
    $table->set_header(4, get_lang('LastName'));
} else {
    $table->set_header(3, get_lang('LastName'));
    $table->set_header(4, get_lang('FirstName'));
}
$table->set_header(5, get_lang('LoginName'));
$table->set_header(6, get_lang('Email'));
$table->set_header(7, get_lang('Profile'));
$table->set_header(8, get_lang('Active'), true, 'width="15px"');
コード例 #16
0
ファイル: index.php プロジェクト: ilosada/chamilo-lms-icpna
 } else {
     if ($export_csv) {
         $is_western_name_order = api_is_western_name_order(PERSON_NAME_DATA_EXPORT);
     } else {
         $is_western_name_order = api_is_western_name_order();
     }
     $sort_by_first_name = api_sort_by_first_name();
     $tracking_column = isset($_GET['tracking_list_coaches_column']) ? $_GET['tracking_list_coaches_column'] : ($is_western_name_order xor $sort_by_first_name) ? 1 : 0;
     $tracking_direction = isset($_GET['tracking_list_coaches_direction']) && in_array(strtoupper($_GET['tracking_list_coaches_direction']), array('ASC', 'DESC', 'ASCENDING', 'DESCENDING', '0', '1')) ? $_GET['tracking_list_coaches_direction'] : 'DESC';
     // Prepare array for column order - when impossible, use some of user names.
     if ($is_western_name_order) {
         $order = array(0 => 'firstname', 1 => 'lastname', 2 => $sort_by_first_name ? 'firstname' : 'lastname', 3 => 'login_date', 4 => $sort_by_first_name ? 'firstname' : 'lastname', 5 => $sort_by_first_name ? 'firstname' : 'lastname');
     } else {
         $order = array(0 => 'lastname', 1 => 'firstname', 2 => $sort_by_first_name ? 'firstname' : 'lastname', 3 => 'login_date', 4 => $sort_by_first_name ? 'firstname' : 'lastname', 5 => $sort_by_first_name ? 'firstname' : 'lastname');
     }
     $table = new SortableTable('tracking_list_coaches_myspace', 'count_coaches', null, ($is_western_name_order xor $sort_by_first_name) ? 1 : 0);
     $parameters['view'] = 'admin';
     $table->set_additional_parameters($parameters);
     if ($is_western_name_order) {
         $table->set_header(0, get_lang('FirstName'), true);
         $table->set_header(1, get_lang('LastName'), true);
     } else {
         $table->set_header(0, get_lang('LastName'), true);
         $table->set_header(1, get_lang('FirstName'), true);
     }
     $table->set_header(2, get_lang('TimeSpentOnThePlatform'), false);
     $table->set_header(3, get_lang('LastConnexion'), false);
     $table->set_header(4, get_lang('NbStudents'), false);
     $table->set_header(5, get_lang('CountCours'), false);
     $table->set_header(6, get_lang('NumberOfSessions'), false);
     $table->set_header(7, get_lang('Sessions'), false);
コード例 #17
0
 /**
  * This is the main function that displays the list or the table with all
  * the glossary terms
  * @param  string  View ('table' or 'list'). Optional parameter.
  * Defaults to 'table' and prefers glossary_view from the session by default.
  * @return void
  * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
  * @version januari 2009, dokeos 1.8.6
  */
 public static function display_glossary($view = 'table')
 {
     // This function should always be called with the corresponding
     // parameter for view type. Meanwhile, use this cheap trick.
     $glossaryView = Session::read('glossary_view');
     if (empty($glossaryView)) {
         Session::write('glossary_view', $view);
     }
     // action links
     //echo '<div class="actions">';
     $actionsLeft = '';
     if (api_is_allowed_to_edit(null, true)) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=addglossary&msg=add?' . api_get_cidreq() . '">' . Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=export">' . Display::return_icon('export_csv.png', get_lang('ExportGlossaryAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (api_is_allowed_to_edit(null, true)) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=import">' . Display::return_icon('import_csv.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=export_to_pdf">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (isset($_SESSION['glossary_view']) && $_SESSION['glossary_view'] == 'table' or !isset($_SESSION['glossary_view'])) {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=list">' . Display::return_icon('view_detailed.png', get_lang('ListView'), '', ICON_SIZE_MEDIUM) . '</a>';
     } else {
         $actionsLeft .= '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=table">' . Display::return_icon('view_text.png', get_lang('TableView'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     /* BUILD SEARCH FORM */
     $form = new FormValidator('search', 'get', api_get_self() . '?' . api_get_cidreq(), '', array(), FormValidator::LAYOUT_INLINE);
     $form->addText('keyword', '', false, array('class' => 'col-md-2'));
     $form->addElement('hidden', 'cidReq', api_get_course_id());
     $form->addElement('hidden', 'id_session', api_get_session_id());
     $form->addButtonSearch(get_lang('Search'));
     $actionsRight = $form->returnForm();
     $toolbar = Display::toolbarAction('toolbar-document', array(0 => $actionsLeft, 1 => $actionsRight));
     echo $toolbar;
     if ($glossaryView == 'table') {
         $table = new SortableTable('glossary', array('GlossaryManager', 'get_number_glossary_terms'), array('GlossaryManager', 'get_glossary_data'), 0);
         //$table->set_header(0, '', false);
         $table->set_header(0, get_lang('TermName'), true);
         $table->set_header(1, get_lang('TermDefinition'), true);
         if (api_is_allowed_to_edit(null, true)) {
             $table->set_header(2, get_lang('Actions'), false, 'width=90px', array('class' => 'td_actions'));
             $table->set_column_filter(2, array('GlossaryManager', 'actions_filter'));
         }
         $table->display();
     }
     if ($glossaryView == 'list') {
         GlossaryManager::display_glossary_list();
     }
 }
コード例 #18
0
    if (isset($_SESSION['gradebook'])) {
        $param_gradebook = '&gradebook=' . Security::remove_XSS($_SESSION['gradebook']);
    }
    echo '<div class="actions">';
    echo '<a href="index.php?' . api_get_cidreq() . $param_gradebook . '&action=attendance_add">' . Display::return_icon('new_attendance_list.png', get_lang('CreateANewAttendance'), '', ICON_SIZE_MEDIUM) . '</a>';
    /*echo '<a href="index.php?'.api_get_cidreq().$param_gradebook.'&action=calendar_logins">'.
      Display::return_icon('attendance_list.png',get_lang('Logins'),'',ICON_SIZE_MEDIUM).'</a>';*/
    echo '</div>';
}
$attendance = new Attendance();
if ($attendance->get_number_of_attendances() == 0) {
    $attendance->set_name(get_lang('Attendances'));
    $attendance->set_description(get_lang('Attendances'));
    $attendance->attendance_add();
}
$table = new SortableTable('attendance_list', array('Attendance', 'get_number_of_attendances'), array('Attendance', 'get_attendance_data'), $default_column);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false, array('style' => 'width:20px;'));
$table->set_header(1, get_lang('Name'), true);
$table->set_header(2, get_lang('Description'), true);
$table->set_header(3, get_lang('CountDoneAttendance'), true, array('style' => 'width:90px;'));
if (api_is_allowed_to_edit(null, true)) {
    $table->set_header(4, get_lang('Actions'), false, array('style' => 'text-align:center'));
    $actions = array('attendance_set_invisible_select' => get_lang('SetInvisible'), 'attendance_set_visible_select' => get_lang('SetVisible'));
    $allow = api_get_configuration_value('allow_delete_attendance');
    if ($allow) {
        $actions['attendance_delete_select'] = get_lang('DeleteAllSelectedAttendances');
    }
    $table->set_form_actions($actions);
}
if ($table->get_total_number_of_items() > 0) {
コード例 #19
0
 function display_data($return = false)
 {
     $count = array($this, 'count');
     $data = array($this, 'get_data');
     $parameters = array();
     $parameters['sec_token'] = Security::get_token();
     $parameters['ceiling'] = $this->get_ceiling();
     $parameters['active_only'] = $this->get_active_only() ? 'true' : 'false';
     $additional_parameters = $this->get_additional_parameters();
     $parameters = array_merge($additional_parameters, $parameters);
     $table = new SortableTable('users', $count, $data, 1, 50);
     $table->set_additional_parameters($parameters);
     $col = 0;
     $table->set_header($col++, '', false);
     $table->set_header($col++, get_lang('Code'));
     $table->set_header($col++, get_lang('FirstName'));
     $table->set_header($col++, get_lang('LastName'));
     $table->set_header($col++, get_lang('LoginName'));
     $table->set_header($col++, get_lang('Email'));
     $table->set_header($col++, get_lang('Profile'));
     $table->set_header($col++, get_lang('AuthenticationSource'));
     $table->set_header($col++, get_lang('RegisteredDate'));
     $table->set_header($col++, get_lang('LastAccess'), false);
     $table->set_header($col++, get_lang('Active'), false);
     $table->set_column_filter(5, array($this, 'format_email'));
     $table->set_column_filter(6, array($this, 'format_status'));
     $table->set_column_filter(10, array($this, 'format_active'));
     $table->set_form_actions(array('activate' => get_lang('Activate'), 'deactivate' => get_lang('Deactivate'), 'delete' => get_lang('Delete')));
     if ($return) {
         return $table->return_table();
     } else {
         echo $table->return_table();
     }
 }
コード例 #20
0
ファイル: courseLog.php プロジェクト: annickvdp/Chamilo1.9.10
    $form->display();

    if ($export_csv) {
        $csv_content = array();
        //override the SortableTable "per page" limit if CSV
        $_GET['users_tracking_per_page'] = 1000000;
    }

    $all_datas = array();
    $course_code = $_course['id'];

    $user_ids = array_keys($a_students);

    $table = new SortableTable(
        'users_tracking',
        array('TrackingCourseLog', 'get_number_of_users'),
        array('TrackingCourseLog', 'get_user_data'),
        (api_is_western_name_order() xor api_sort_by_first_name()) ? 3 : 2);

    $parameters['cidReq'] 		= Security::remove_XSS($_GET['cidReq']);
    $parameters['id_session'] 	= $session_id;
    $parameters['from'] 		= isset($_GET['myspace']) ? Security::remove_XSS($_GET['myspace']) : null;

    $table->set_additional_parameters($parameters);
    $tab_table_header = array();
    // tab of header texts
    $table->set_header(0, get_lang('OfficialCode'), true);
    $tab_table_header[] = get_lang('OfficialCode');
    if ($is_western_name_order) {
        $table->set_header(1, get_lang('FirstName'), true);
        $tab_table_header[] = get_lang('FirstName');
コード例 #21
0
            $message = Display::return_message(get_lang('ClassDeleted'));
            break;
        case 'show_message':
            $message = Display::return_message(Security::remove_XSS(stripslashes($_GET['message'])));
            break;
    }
}
// Create a search-box
$form = new FormValidator('search_simple', 'get', '', '', null, false);
$renderer =& $form->defaultRenderer();
$renderer->setElementTemplate('<span>{element}</span> ');
$form->addElement('text', 'keyword', get_lang('keyword'));
$form->addElement('button', 'submit', get_lang('Search'));
$content .= $form->return_form();
// Create the sortable table with class information
$table = new SortableTable('classes', 'get_number_of_classes', 'get_class_data', 1);
$table->set_additional_parameters(array('keyword' => $_GET['keyword']));
$table->set_header(0, '', false);
$table->set_header(1, get_lang('ClassName'));
$table->set_header(2, get_lang('NumberOfUsers'));
$table->set_header(3, '', false);
$table->set_column_filter(3, 'modify_filter');
$table->set_form_actions(array('delete_classes' => get_lang('DeleteSelectedClasses')), 'class');
$content .= $table->return_table();
$actions .= Display::url(Display::return_icon('add.png', get_lang('Add'), array(), ICON_SIZE_MEDIUM), 'class_add.php');
$actions .= Display::url(Display::return_icon('import_csv.png', get_lang('AddUsersToAClass'), array(), ICON_SIZE_MEDIUM), 'class_user_import.php');
$actions .= Display::url(Display::return_icon('import_csv.png', get_lang('ImportClassListCSV'), array(), ICON_SIZE_MEDIUM), 'class_import.php');
$app['title'] = $tool_name;
$tpl = $app['template'];
$tpl->assign('content', $content);
$tpl->assign('actions', $actions);
コード例 #22
0
 public static function displayTrackingAccessOverView($courseId, $sessionId, $studentId)
 {
     $courseId = intval($courseId);
     $sessionId = intval($sessionId);
     $studentId = intval($studentId);
     $em = Database::getManager();
     $sessionRepo = $em->getRepository('ChamiloCoreBundle:Session');
     $courseList = [];
     $sessionList = [];
     $studentList = [];
     if (!empty($courseId)) {
         $course = $em->find('ChamiloCoreBundle:Course', $courseId);
         $courseList[$course->getId()] = $course->getTitle();
     }
     if (!empty($sessionId)) {
         $session = $em->find('ChamiloCoreBundle:Session', $sessionId);
         $sessionList[$session->getId()] = $session->getName();
     }
     if (!empty($studentId)) {
         $student = $em->find('ChamiloUserBundle:User', $studentId);
         $studentList[$student->getId()] = $student->getCompleteName();
     }
     $form = new FormValidator('access_overview', 'GET');
     $form->addElement('select_ajax', 'course_id', get_lang('SearchCourse'), $courseList, ['url' => api_get_path(WEB_AJAX_PATH) . 'course.ajax.php?' . http_build_query(['a' => 'search_course_by_session_all', 'session_id' => $sessionId])]);
     $form->addElement('select_ajax', 'session_id', get_lang('SearchSession'), $sessionList, ['url_function' => "\n                    function () {\n                        var params = \$.param({\n                            a: 'search_session_by_course',\n                            course_id: \$('#course_id').val() || 0\n                        });\n\n                        return '" . api_get_path(WEB_AJAX_PATH) . "session.ajax.php?' + params;\n                    }\n                "]);
     $form->addSelect('profile', get_lang('Profile'), ['' => get_lang('Select'), STUDENT => get_lang('Student'), COURSEMANAGER => get_lang('CourseManager'), DRH => get_lang('Drh')], ['id' => 'profile']);
     $form->addElement('select_ajax', 'student_id', get_lang('SearchUsers'), $studentList, ['placeholder' => get_lang('All'), 'url_function' => "\n                    function () {\n                        var params = \$.param({\n                            a: 'search_user_by_course',\n                            session_id: \$('#session_id').val(),\n                            course_id: \$('#course_id').val()\n                        });\n\n                        return '" . api_get_path(WEB_AJAX_PATH) . "course.ajax.php?' + params;\n                    }\n                "]);
     $form->addDateRangePicker('date', get_lang('DateRange'), true, ['id' => 'date_range', 'format' => 'YYYY-MM-DD', 'timePicker' => 'false', 'validate_format' => 'Y-m-d']);
     $form->addHidden('display', 'accessoverview');
     $form->addRule('course_id', get_lang('Required'), 'required');
     $form->addRule('profile', get_lang('Required'), 'required');
     $form->addButton('submit', get_lang('Generate'), 'gear', 'primary');
     $table = null;
     if ($form->validate()) {
         $table = new SortableTable('tracking_access_overview', ['MySpace', 'getNumberOfRrackingAccessOverview'], ['MySpace', 'getUserDataAccessTrackingOverview'], 0);
         $table->additional_parameters = $form->exportValues();
         $table->set_header(0, get_lang('LoginDate'), true);
         $table->set_header(1, get_lang('Username'), true);
         if (api_is_western_name_order()) {
             $table->set_header(2, get_lang('FirstName'), true);
             $table->set_header(3, get_lang('LastName'), true);
         } else {
             $table->set_header(2, get_lang('LastName'), true);
             $table->set_header(3, get_lang('FirstName'), true);
         }
         $table->set_header(4, get_lang('Clicks'), false);
         $table->set_header(5, get_lang('IP'), false);
         $table->set_header(6, get_lang('TimeLoggedIn'), false);
     }
     $template = new Template(null, false, false, false, false, false, false);
     $template->assign('form', $form->returnForm());
     $template->assign('table', $table ? $table->return_table() : null);
     echo $template->fetch($template->get_template('my_space/accessoverview.tpl'));
 }
コード例 #23
0
ファイル: report.php プロジェクト: annickvdp/Chamilo1.9.10
    }

    $start_date = Database::escape_string($_POST['keyword_start_date_start']);
    $end_date = Database::escape_string($_POST['keyword_start_date_end']);

    if ($start_date != '' || $end_date != '') {
        $sql .= " HAVING ";
        if ($start_date != '')
            $sql .= "  access_date >= '$start_date'   ";
        if ($end_date != '') {
            $sql = ($start_date == '') ? $sql : ($sql . " AND ");
            $sql .= "  access_date <= '$end_date'   ";
        }
    }
    $result = Database::query($sql);
    $table_result = new SortableTable();
    $table_result->set_header(0, get_lang('User'), false);
    $table_result->set_header(1, get_lang('Fullname'), false);
    $table_result->set_header(2, get_lang('Date'), false);
    $table_result->set_header(3, get_lang('Course'), false);
    $table_result->set_header(4, get_lang('Tool'), false);
    while ($row = Database::fetch_assoc($result)) {
        $row = array(
                $row['username'],
                $row['fullname'],
                $row['access_date'],
                $row['course'],
                get_lang($tools[$row['tool']]['name'])
            );
        $table_result->addRow($row);
    }
コード例 #24
0
//$form->addElement('text','label',get_lang('FieldLabel'));
//$form->addElement('text','type',get_lang('FieldType'));
//$form->addElement('text','title',get_lang('FieldTitle'));
//$form->addElement('text','default',get_lang('FieldDefaultValue'));
//$form->addElement('submit','submit',get_lang('Search'));
$form->addElement('static', 'search_advanced_link', null, '<a href="user_fields_add.php?action=fill">' . Display::return_icon('add_user_fields.png', get_lang('AddUserField'), '', ICON_SIZE_MEDIUM) . '</a>');
echo '<div class="actions">';
$form->display();
echo '</div>';
// Create a sortable table with user-data
$parameters['sec_token'] = Security::get_token();
//$column_show  = array(1,1,1,1,1,1,1,1,1,0,0);
//$column_order = array(1,2,3,4,5,6,7,8,9,10,11);
$extra_fields = UserManager::get_extra_fields();
$number_of_extra_fields = count($extra_fields);
$table = new SortableTable('user_field', array('UserManager', 'get_number_of_extra_fields'), array('UserManager', 'get_extra_fields'), 5);
$table->set_additional_parameters($parameters);
$table->set_header(0, '', false);
$table->set_header(1, get_lang('FieldLabel'), false);
$table->set_header(2, get_lang('FieldType'), false);
$table->set_header(3, get_lang('FieldTitle'), false);
$table->set_header(4, get_lang('FieldDefaultValue'), false);
$table->set_header(5, get_lang('FieldOrder'), false);
$table->set_header(6, get_lang('FieldVisibility'), false);
$table->set_header(7, get_lang('FieldChangeability'), false);
$table->set_header(8, get_lang('FieldFilter'), false);
$table->set_header(9, get_lang('Modify'), false);
$table->set_column_filter(5, 'order_filter');
$table->set_column_filter(6, 'modify_visibility');
$table->set_column_filter(7, 'modify_changeability');
$table->set_column_filter(8, 'modify_field_filter');
コード例 #25
0
ファイル: thematic.php プロジェクト: secuencia24/chamilo-lms
        case 'thematic_list':
            echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_add' . $url_token . '">' . Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM) . '</a>';
            break;
        case 'thematic_details':
            echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_add' . $url_token . '">' . Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM) . '</a>';
            echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_import_select' . $url_token . '">' . Display::return_icon('import_csv.png', get_lang('ImportThematic'), '', ICON_SIZE_MEDIUM) . '</a>';
            echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_export' . $url_token . '">' . Display::return_icon('export_csv.png', get_lang('ExportThematic'), '', ICON_SIZE_MEDIUM) . '</a>';
            echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_export_pdf' . $url_token . '">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
            break;
        default:
            echo '<a href="index.php?' . api_get_cidreq() . '&action=thematic_add' . $url_token . '">' . Display::return_icon('new_course_progress.png', get_lang('NewThematicSection'), '', ICON_SIZE_MEDIUM) . '</a>';
    }
    echo '</div>';
}
if ($action == 'thematic_list') {
    $table = new SortableTable('thematic_list', array('Thematic', 'get_number_of_thematics'), array('Thematic', 'get_thematic_data'));
    $parameters['action'] = $action;
    $table->set_additional_parameters($parameters);
    $table->set_header(0, '', false, array('style' => 'width:20px;'));
    $table->set_header(1, get_lang('Title'), false);
    if (api_is_allowed_to_edit(null, true)) {
        $table->set_header(2, get_lang('Actions'), false, array('style' => 'text-align:center;width:40%;'));
        $table->set_form_actions(array('thematic_delete_select' => get_lang('DeleteAllThematics')));
    }
    $table->display();
} elseif ($action == 'thematic_details') {
    if (isset($_GET['thematic_plan_save_message']) && $_GET['thematic_plan_save_message'] == 'ok') {
        Display::display_confirmation_message(get_lang('ThematicSectionHasBeenCreatedSuccessfull'));
    }
    if (isset($last_id) && $last_id) {
        $link_to_thematic_plan = '<a href="index.php?' . api_get_cidreq() . '&action=thematic_plan_list&thematic_id=' . $last_id . '">' . Display::return_icon('lesson_plan.png', get_lang('ThematicPlan'), array('style' => 'vertical-align:middle;float:none;'), ICON_SIZE_SMALL) . '</a>';
コード例 #26
0
ファイル: new_ticket.php プロジェクト: KRCM13/chamilo-lms
 $message = $plugin->get_lang('PleaseBeforeRegisterATicketSelectOneUser');
 Display::display_warning_message($message);
 echo '
     <div class="actions">
       <span style="float: right;">&nbsp;</span>
       <form id="search_simple" name="search_simple" method="get" action="' . api_get_self() . '" class="form-search">
         <fieldset>
         <span><label for="keyword">' . get_lang('SearchAUser') . ': &nbsp;</label><input type="text" name="keyword" size="25"></span>
         <span><button type="submit" name="submit" class="btn btn">' . get_lang('Search') . '</button></span>
         <div class="clear"></div>
         </fieldset>
       </form>
     </div>';
 echo '<div class="users-list">';
 $order = api_is_western_name_order() || api_sort_by_first_name() ? 3 : 2;
 $table = new SortableTable('users', 'get_number_of_users', 'get_user_data', $order, 10);
 $table->set_header(0, '', false, 'width="18px"');
 $table->set_header(0, get_lang('Photo'), false);
 $table->set_header(1, get_lang('OfficialCode'));
 if (api_is_western_name_order()) {
     $table->set_header(2, get_lang('FirstName'));
     $table->set_header(3, get_lang('LastName'));
 } else {
     $table->set_header(2, get_lang('LastName'));
     $table->set_header(3, get_lang('FirstName'));
 }
 $table->set_header(4, get_lang('LoginName'));
 $table->set_header(5, get_lang('Email'));
 $table->set_header(6, get_lang('Action'));
 $table->display();
 echo '</div>';
コード例 #27
0
 /**
  * This is the main function that displays the list or the table with all
  * the glossary terms
  * @param  string  View ('table' or 'list'). Optional parameter.
  * Defaults to 'table' and prefers glossary_view from the session by default.
  * @return void
  * @author Patrick Cool <*****@*****.**>, Ghent University, Belgium
  * @version januari 2009, dokeos 1.8.6
  */
 public static function display_glossary($view = 'table')
 {
     // This function should always be called with the corresponding
     // parameter for view type. Meanwhile, use this cheap trick.
     $glossaryView = Session::read('glossary_view');
     if (empty($glossaryView)) {
         Session::write('glossary_view', $view);
     }
     // action links
     echo '<div class="actions">';
     if (api_is_allowed_to_edit(null, true)) {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=addglossary&msg=add?' . api_get_cidreq() . '">' . Display::return_icon('new_glossary_term.png', get_lang('TermAddNew'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     echo '<a href="index.php?' . api_get_cidreq() . '&action=export">' . Display::return_icon('export_csv.png', get_lang('ExportGlossaryAsCSV'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (api_is_allowed_to_edit(null, true)) {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=import">' . Display::return_icon('import_csv.png', get_lang('ImportGlossary'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     echo '<a href="index.php?' . api_get_cidreq() . '&action=export_to_pdf">' . Display::return_icon('pdf.png', get_lang('ExportToPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
     if (isset($glossaryView) && $glossaryView == 'table' or !isset($glossaryView)) {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=list">' . Display::return_icon('view_detailed.png', get_lang('ListView'), '', ICON_SIZE_MEDIUM) . '</a>';
     } else {
         echo '<a href="index.php?' . api_get_cidreq() . '&action=changeview&view=table">' . Display::return_icon('view_text.png', get_lang('TableView'), '', ICON_SIZE_MEDIUM) . '</a>';
     }
     echo '</div>';
     if (!$glossaryView || $glossaryView == 'table') {
         $table = new SortableTable('glossary', array('GlossaryManager', 'get_number_glossary_terms'), array('GlossaryManager', 'get_glossary_data'), 0);
         //$table->set_header(0, '', false);
         $table->set_header(0, get_lang('TermName'), true);
         $table->set_header(1, get_lang('TermDefinition'), true);
         if (api_is_allowed_to_edit(null, true)) {
             $table->set_header(2, get_lang('Actions'), false, 'width=90px', array('class' => 'td_actions'));
             $table->set_column_filter(2, array('GlossaryManager', 'actions_filter'));
         }
         $table->display();
     }
     if ($glossaryView == 'list') {
         GlossaryManager::display_glossary_list();
     }
 }
コード例 #28
0
 /**
  * Constructor
  * @param array $table_data All the information of the table
  * @param int $default_column Default column that will be use in the sorts functions
  * @param int $default_items_per_page quantity of pages that we are going to see
  * @param int $tablename Name of the table
  * @param array $column_show An array with binary values 1: we show the column 2: we don't show it
  * @param array $column_order An array of integers that let us decide how the columns are going to be sort.
  * @param string $direction
  * @param bool $doc_filter special modification to fix the document name order
  */
 public function __construct($table_data, $default_column = 1, $default_items_per_page = 20, $tablename = 'tablename', $column_show = array(), $column_order = array(), $direction = 'ASC', $doc_filter = false)
 {
     $this->column_show = $column_show;
     $this->column_order = $column_order;
     $this->doc_filter = $doc_filter;
     parent::__construct($tablename, null, null, $default_column, $default_items_per_page, $direction);
     $this->table_data = $table_data;
 }
コード例 #29
0
 static function print_activities_stats()
 {
     echo '<h4>' . get_lang('ImportantActivities') . '</h4>';
     // Create a search-box
     $form = new FormValidator('search_simple', 'get', api_get_path(WEB_CODE_PATH) . 'admin/statistics/index.php', '', 'width=200px', false);
     $renderer =& $form->defaultRenderer();
     $renderer->setElementTemplate('<span>{element}</span> ');
     $form->addElement('hidden', 'report', 'activities');
     $form->addElement('hidden', 'activities_direction', 'DESC');
     $form->addElement('hidden', 'activities_column', '4');
     $form->addElement('text', 'keyword', get_lang('keyword'));
     $form->addElement('style_submit_button', 'submit', get_lang('Search'), 'class="search"');
     echo '<div class="actions">';
     $form->display();
     echo '</div>';
     $table = new SortableTable('activities', array('Statistics', 'get_number_of_activities'), array('Statistics', 'get_activities_data'), 5, 50, 'DESC');
     $parameters = array();
     $parameters['report'] = 'activities';
     if (isset($_GET['keyword'])) {
         $parameters['keyword'] = Security::remove_XSS($_GET['keyword']);
     }
     $table->set_additional_parameters($parameters);
     $table->set_header(0, get_lang('EventType'));
     $table->set_header(1, get_lang('DataType'));
     $table->set_header(2, get_lang('Value'));
     $table->set_header(3, get_lang('UserName'));
     $table->set_header(4, get_lang('IPAddress'));
     $table->set_header(5, get_lang('Date'));
     $table->display();
 }
コード例 #30
0
ファイル: survey.lib.php プロジェクト: jloguercio/chamilo-lms
 function display_survey_list_for_coach()
 {
     $parameters = array();
     $parameters['cidReq'] = api_get_course_id();
     if (isset($_GET['do_search'])) {
         $message = get_lang('DisplaySearchResults') . '<br />';
         $message .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '">' . get_lang('DisplayAll') . '</a>';
         Display::display_normal_message($message, false);
     }
     // Create a sortable table with survey-data
     $table = new SortableTable('surveys_coach', 'get_number_of_surveys_for_coach', 'get_survey_data_for_coach', 2);
     $table->set_additional_parameters($parameters);
     $table->set_header(0, '', false);
     $table->set_header(1, get_lang('SurveyName'));
     $table->set_header(2, get_lang('SurveyCode'));
     $table->set_header(3, get_lang('NumberOfQuestions'));
     $table->set_header(4, get_lang('Author'));
     //$table->set_header(5, get_lang('Language'));
     //$table->set_header(6, get_lang('Shared'));
     $table->set_header(5, get_lang('AvailableFrom'));
     $table->set_header(6, get_lang('AvailableUntil'));
     $table->set_header(7, get_lang('Invite'));
     $table->set_header(8, get_lang('Anonymous'));
     $table->set_header(9, get_lang('Modify'), false, 'width="130"');
     $table->set_column_filter(8, 'anonymous_filter');
     $table->set_column_filter(9, 'modify_filter_for_coach');
     $table->display();
 }