Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/3293/head
Julio Montoya 6 years ago
commit 8930e27a7a
  1. 10
      app/Resources/public/css/base.css
  2. 7
      main/inc/lib/message.lib.php
  3. 138
      main/inc/lib/sortable_table.class.php
  4. 39
      main/tracking/courseLog.php

@ -3290,20 +3290,22 @@ form .formw .freeze {
.data_table_pagination {
width: 100%;
margin-top: 5px;
margin-bottom: 5px;
}
.data_table_pagination .btn-toolbar {
margin-bottom: 0;
margin-top: 0;
}
.table-well {
background: #ffffff;
border: 1px solid #dddddd;
padding: 10px 20px;
padding: 10px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
margin-bottom: 20px;
margin-top: 10px;
}
.tabs-margin, .btn-toolbar {

@ -188,7 +188,8 @@ class MessageManager
title as col1,
send_date as col2,
msg_status as col3,
user_sender_id
user_sender_id,
user_receiver_id
FROM $table
WHERE
$whereConditions
@ -207,6 +208,7 @@ class MessageManager
$sendDate = $row['col2'];
$status = $row['col3'];
$senderId = $row['user_sender_id'];
$receiverId = $row['user_receiver_id'];
$title = Security::remove_XSS($title, STUDENT, true);
$title = cut($title, 80, true);
@ -217,6 +219,9 @@ class MessageManager
}
$userInfo = api_get_user_info($senderId);
if ($type == self::MESSAGE_TYPE_OUTBOX) {
$userInfo = api_get_user_info($receiverId);
}
$message[3] = '';
if (!empty($senderId) && !empty($userInfo)) {
$message[1] = '<a '.$class.' href="'.$viewUrl.'&id='.$messageId.'">'.$title.'</a><br />';

@ -169,22 +169,30 @@ class SortableTable extends HTML_Table
$this->per_page = Session::read($this->param_prefix.'per_page', $default_items_per_page);
// If per page changed, then reset the page to 1
if (!empty($this->per_page) && isset($_GET[$this->param_prefix.'per_page']) && $this->per_page != $_GET[$this->param_prefix.'per_page']) {
if (!empty($this->per_page) && isset($_GET[$this->param_prefix.'per_page']) &&
$this->per_page != $_GET[$this->param_prefix.'per_page']
) {
Session::erase($this->param_prefix.'page_nr');
$_GET[$this->param_prefix.'page_nr'] = 1;
}
$this->per_page = isset($_GET[$this->param_prefix.'per_page']) ? (int) $_GET[$this->param_prefix.'per_page'] : $this->per_page;
$this->per_page = isset($_GET[$this->param_prefix.'per_page'])
? (int) $_GET[$this->param_prefix.'per_page']
: $this->per_page;
if (isset($_GET[$this->param_prefix.'per_page'])) {
Session::erase($this->param_prefix.'page_nr');
}
$this->page_nr = Session::read($this->param_prefix.'page_nr', 1);
$this->page_nr = isset($_GET[$this->param_prefix.'page_nr']) ? (int) $_GET[$this->param_prefix.'page_nr'] : $this->page_nr;
$this->page_nr = isset($_GET[$this->param_prefix.'page_nr'])
? (int) $_GET[$this->param_prefix.'page_nr']
: $this->page_nr;
$this->column = Session::read($this->param_prefix.'column', $default_column);
$this->column = isset($_GET[$this->param_prefix.'column']) ? (int) $_GET[$this->param_prefix.'column'] : $this->column;
$this->column = isset($_GET[$this->param_prefix.'column'])
? (int) $_GET[$this->param_prefix.'column']
: $this->column;
// Default direction.
if (in_array(strtoupper($default_order_direction), ['ASC', 'DESC'])) {
@ -373,42 +381,50 @@ class SortableTable extends HTML_Table
$html = '';
$params = $this->get_sortable_table_param_string().'&amp;'.$this->get_additional_url_paramstring();
if (!$empty_table) {
$table_id = 'form_'.$this->table_name.'_id';
$form = $this->get_page_select_form();
$nav = $this->get_navigation_html();
if ($this->get_total_number_of_items() > $this->default_items_per_page) {
$html = '<div class="table-well">';
$html .= '<table class="data_table_pagination">';
$html .= '<tr>';
$html .= '<td style="width:25%;">';
$html .= $form;
$html .= '</td>';
$html .= '<td style="text-align:center;">';
$html .= $this->get_table_title();
$html .= '</td>';
$html .= '<td style="text-align:right;width:25%;">';
$html .= $nav;
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '</div>';
}
if ($empty_table) {
return '';
}
$table_id = 'form_'.$this->table_name.'_id';
$form = $this->get_page_select_form();
$nav = $this->get_navigation_html();
if ($this->get_total_number_of_items() > $this->default_items_per_page) {
$html = '<div class="table-well">';
$html .= '<table class="data_table_pagination">';
$html .= '<tr>';
$html .= '<td style="width:25%;">';
$html .= $form;
$html .= '</td>';
$html .= '<td style="text-align:center;">';
$html .= $this->get_table_title();
$html .= '</td>';
$html .= '<td style="text-align:right;width:25%;">';
$html .= $nav;
$html .= '</td>';
$html .= '</tr>';
$html .= '</table>';
$html .= '</div>';
}
if (count($this->form_actions) > 0) {
$html .= '<form id ="'.$table_id.'" name="form_'.$this->table_name.'" class="form-search" method="post" action="'.api_get_self().'?'.$params.'" >';
}
if (count($this->form_actions) > 0) {
$html .= '<form id ="'.$table_id.'" name="form_'.$this->table_name
.'" class="form-search" method="post" action="'.api_get_self().'?'.$params.'" >';
}
$html .= '<div class="table-responsive">'.$content.'</div>';
if (!$empty_table) {
if (!empty($this->additional_parameters)) {
foreach ($this->additional_parameters as $key => $value) {
$html .= '<input type="hidden" name ="'.Security::remove_XSS($key).'" value ="'.Security::remove_XSS($value).'" />';
}
if (!empty($this->additional_parameters)) {
foreach ($this->additional_parameters as $key => $value) {
$html .= '<input type="hidden" name ="'.Security::remove_XSS($key).'" value ="'
.Security::remove_XSS($value).'" />';
}
$html .= '<input type="hidden" name="action">';
}
$html .= '<input type="hidden" name="action">';
$showFooter = count($this->actionButtons) > 0 ||
count($this->form_actions) > 0 ||
$this->get_total_number_of_items() > $this->default_items_per_page;
if ($showFooter) {
$html .= '<div class="table-well">';
$html .= '<table class="data_table_pagination">';
$html .= '<tr>';
@ -421,7 +437,8 @@ class SortableTable extends HTML_Table
foreach ($this->actionButtons as $action => $data) {
$label = $data['label'];
$icon = $data['icon'];
$html .= '<a class="btn btn-default" href="?'.$params.'&action_table='.$action.'" >'.$icon.'&nbsp;'.$label.'</a>';
$html .= '<a class="btn btn-default" href="?'.$params.'&action_table='.$action.'" >'.$icon.'&nbsp;'
.$label.'</a>';
}
$html .= '</div>'; //btn-group
$html .= '</div>'; //toolbar
@ -430,17 +447,22 @@ class SortableTable extends HTML_Table
if (count($this->form_actions) > 0) {
$html .= '<div class="btn-toolbar">';
$html .= '<div class="btn-group">';
$html .= '<a class="btn btn-default" href="?'.$params.'&amp;'.$this->param_prefix.'selectall=1" onclick="javascript: setCheckbox(true, \''.$table_id.'\'); return false;">'.get_lang('SelectAll').'</a>';
$html .= '<a class="btn btn-default" href="?'.$params.'" onclick="javascript: setCheckbox(false, \''.$table_id.'\'); return false;">'.get_lang('UnSelectAll').'</a> ';
$html .= '<a class="btn btn-default" href="?'.$params.'&amp;'.$this->param_prefix
.'selectall=1" onclick="javascript: setCheckbox(true, \''.$table_id.'\'); return false;">'
.get_lang('SelectAll').'</a>';
$html .= '<a class="btn btn-default" href="?'.$params
.'" onclick="javascript: setCheckbox(false, \''.$table_id.'\'); return false;">'
.get_lang('UnSelectAll').'</a> ';
$html .= '</div>';
$html .= '<div class="btn-group">
<button class="btn btn-default" onclick="javascript:return false;">'.get_lang('Actions').'</button>
<button class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>';
<button class="btn btn-default" type="button">'.get_lang('Actions').'</button>
<button class="btn btn-default dropdown-toggle" type="button" data-toggle="dropdown">
<span class="caret"></span>
</button>';
$html .= '<ul class="dropdown-menu">';
foreach ($this->form_actions as $action => &$label) {
$html .= '<li><a data-action ="'.$action.'" href="#" onclick="javascript:action_click(this, \''.$table_id.'\');">'.$label.'</a></li>';
$html .= '<li><a data-action ="'.$action
.'" href="#" onclick="javascript:action_click(this, \''.$table_id.'\');">'.$label.'</a></li>';
}
$html .= '</ul>';
$html .= '</div>'; //btn-group
@ -450,21 +472,18 @@ class SortableTable extends HTML_Table
$html .= '</td>';
// Pagination
if ($this->get_total_number_of_items() > $this->default_items_per_page) {
$html .= '<td style="text-align:right;">';
$html .= '<td class="text-right">';
$html .= $nav;
$html .= '</td>';
} else {
$html .= '<td> ';
$html .= '</td>';
}
$html .= '</tr>';
$html .= '</table>';
$html .= '</div>'; //toolbar
if (count($this->form_actions) > 0) {
$html .= '</form>';
}
}
if (count($this->form_actions) > 0) {
$html .= '</form>';
}
return $html;
@ -516,7 +535,8 @@ class SortableTable extends HTML_Table
$html .= '<div class="clear"></div>';
if (count($this->form_actions) > 0) {
$params = $this->get_sortable_table_param_string().'&amp;'.$this->get_additional_url_paramstring();
$html .= '<form method="post" action="'.api_get_self().'?'.$params.'" name="form_'.$this->table_name.'">';
$html .= '<form method="post" action="'.api_get_self().'?'.$params
.'" name="form_'.$this->table_name.'">';
}
}
// Getting the items of the table
@ -591,7 +611,8 @@ class SortableTable extends HTML_Table
$html .= '<div class="clear"></div>';
if (count($this->form_actions) > 0) {
$params = $this->get_sortable_table_param_string().'&amp;'.$this->get_additional_url_paramstring();
$html .= '<form method="post" action="'.api_get_self().'?'.$params.'" name="form_'.$this->table_name.'">';
$html .= '<form method="post" action="'.api_get_self().'?'.$params
.'" name="form_'.$this->table_name.'">';
}
}
@ -627,8 +648,7 @@ class SortableTable extends HTML_Table
$i = 0;
$rows = '';
foreach ($row as &$element) {
if ($filter ||
isset($visibility_options[$i]) && $visibility_options[$i]
if ($filter || isset($visibility_options[$i]) && $visibility_options[$i]
) {
$rows .= '<div class="'.$this->table_name.'_grid_element_'.$i.'">'.$element.'</div>';
}
@ -779,7 +799,8 @@ class SortableTable extends HTML_Table
foreach ($param as $key => &$value) {
$result[] = '<input type="hidden" name="'.$key.'" value="'.$value.'"/>';
}
$result[] = '<select style="width: auto;" class="form-control" name="'.$this->param_prefix.'per_page" onchange="javascript: this.form.submit();">';
$result[] = '<select style="width: auto;" class="form-control" name="'.$this->param_prefix
.'per_page" onchange="javascript: this.form.submit();">';
$list = [10, 20, 50, 100, 500, 1000];
$rowList = api_get_configuration_value('table_row_list');
@ -791,10 +812,13 @@ class SortableTable extends HTML_Table
if ($total_number_of_items <= $nr) {
break;
}
$result[] = '<option value="'.$nr.'" '.($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr.'</option>';
$result[] = '<option value="'.$nr.'" '.($nr == $this->per_page ? 'selected="selected"' : '').'>'.$nr
.'</option>';
}
$result[] = '<option value="'.$total_number_of_items.'" '.($total_number_of_items == $this->per_page ? 'selected="selected"' : '').'>'.api_ucfirst(get_lang('All')).'</option>';
$result[] = '<option value="'.$total_number_of_items.'" '
.($total_number_of_items == $this->per_page ? 'selected="selected"' : '')
.'>'.api_ucfirst(get_lang('All')).'</option>';
//}
$result[] = '</select>';
$result[] = '<noscript>';

@ -643,54 +643,37 @@ if ($nbStudents > 0) {
$table->set_header(
4,
get_lang('TrainingTime').'&nbsp;'.
Display::return_icon('info3.gif', get_lang('CourseTimeInfo'), ['align' => 'absmiddle', 'hspace' => '3px']),
false,
['style' => 'width:110px;']
Display::return_icon('info3.gif', get_lang('CourseTimeInfo'), [], ICON_SIZE_TINY),
false
);
$headers['training_time'] = get_lang('TrainingTime');
$table->set_header(
5,
get_lang('CourseProgress').'&nbsp;'.
Display::return_icon(
'info3.gif',
get_lang('ScormAndLPProgressTotalAverage'),
['align' => 'absmiddle', 'hspace' => '3px']
),
false,
['style' => 'width:110px;']
Display::return_icon('info3.gif', get_lang('ScormAndLPProgressTotalAverage'), [], ICON_SIZE_TINY),
false
);
$headers['course_progress'] = get_lang('CourseProgress');
$table->set_header(
6,
get_lang('ExerciseProgress').'&nbsp;'.
Display::return_icon(
'info3.gif',
get_lang('ExerciseProgressInfo'),
['align' => 'absmiddle', 'hspace' => '3px']
),
false,
['style' => 'width:110px;']
Display::return_icon('info3.gif', get_lang('ExerciseProgressInfo'), [], ICON_SIZE_TINY),
false
);
$headers['exercise_progress'] = get_lang('ExerciseProgress');
$table->set_header(
7,
get_lang('ExerciseAverage').'&nbsp;'.
Display::return_icon('info3.gif', get_lang('ExerciseAverageInfo'), ['align' => 'absmiddle', 'hspace' => '3px']),
false,
['style' => 'width:110px;']
Display::return_icon('info3.gif', get_lang('ExerciseAverageInfo'), [], ICON_SIZE_TINY),
false
);
$headers['exercise_average'] = get_lang('ExerciseAverage');
$table->set_header(
8,
get_lang('Score').'&nbsp;'.
Display::return_icon(
'info3.gif',
get_lang('ScormAndLPTestTotalAverage'),
['align' => 'absmiddle', 'hspace' => '3px']
),
false,
['style' => 'width:110px;']
Display::return_icon('info3.gif', get_lang('ScormAndLPTestTotalAverage'), [], ICON_SIZE_TINY),
false
);
$headers['score'] = get_lang('Score');
$table->set_header(9, get_lang('Student_publication'), false);
@ -766,7 +749,7 @@ if ($nbStudents > 0) {
$groupContent = '';
echo Display::panel($html, $titleSession);
$groupTable = new HTML_Table(['class' => 'table data_table']);
$groupTable = new HTML_Table(['class' => 'table table-bordered data_table']);
$column = 0;
$groupTable->setHeaderContents(0, $column++, get_lang('Name'));
$groupTable->setHeaderContents(0, $column++, get_lang('TrainingTime'));

Loading…
Cancel
Save