Merge pull request #1258 from jloguercio/1.11.x

Fix Teacher report time
pull/2487/head
José Loguercio 9 years ago committed by GitHub
commit 6a92e673de
  1. 6
      main/admin/teacher_time_report.php
  2. 118
      main/template/default/admin/teacher_time_report.tpl

@ -388,6 +388,6 @@ $tpl->assign('form', $form->returnForm());
$tpl->assign('rows', $timeReport->data);
$contentTemplate = $tpl->get_template('admin/teacher_time_report.tpl');
$tpl->display($contentTemplate);
$contentTemplate = $tpl->fetch('default/admin/teacher_time_report.tpl');
$tpl->assign('content', $contentTemplate);
$tpl->display_one_col_template();

@ -1,71 +1,67 @@
{% extends template ~ "/layout/main.tpl" %}
{% block body %}
<script>
$(document).on('ready', function () {
$('#course').on('change', function () {
$('#session').prop('selectedIndex', 0);
$('#teacher').prop('selectedIndex', 0);
});
<script>
$(document).on('ready', function () {
$('#course').on('change', function () {
$('#session').prop('selectedIndex', 0);
$('#teacher').prop('selectedIndex', 0);
});
$('#session').on('change', function () {
$('#course').prop('selectedIndex', 0);
$('#teacher').prop('selectedIndex', 0);
});
$('#session').on('change', function () {
$('#course').prop('selectedIndex', 0);
$('#teacher').prop('selectedIndex', 0);
});
$('#teacher').on('change', function () {
$('#course').prop('selectedIndex', 0);
$('#session').prop('selectedIndex', 0);
});
$('#teacher').on('change', function () {
$('#course').prop('selectedIndex', 0);
$('#session').prop('selectedIndex', 0);
});
$('#daterange').on('apply.daterangepicker', function (ev, picker) {
$('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
$('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
}).on('cancel.daterangepicker', function (ev, picker) {
$('#daterange, [name="from"], [name="until"]').val('');
});
$('#daterange').on('apply.daterangepicker', function (ev, picker) {
$('[name="from"]').val(picker.startDate.format('YYYY-MM-DD'));
$('[name="until"]').val(picker.endDate.format('YYYY-MM-DD'));
}).on('cancel.daterangepicker', function (ev, picker) {
$('#daterange, [name="from"], [name="until"]').val('');
});
</script>
<div class="col-md-12">
<div class="actions">
<a href="{{ _p.web_main }}admin/teachers_time_by_session_report.php">
{{ 'session.png'|img(32, 'Sessions'|get_lang) }}
});
</script>
<div class="col-md-12">
<div class="actions">
<a href="{{ _p.web_main }}admin/teachers_time_by_session_report.php">
{{ 'session.png'|img(32, 'Sessions'|get_lang) }}
</a>
<div class="pull-right">
<a href="{{ _p.web_self ~ '?' ~ {'export':'pdf','from':selectedFrom,'until':selectedUntil,'course':selectedCourse,'session':selectedSession,'teacher':selectedTeacher}|url_encode }}">
{{ 'pdf.png' | img(32, 'ExportToPDF'|get_lang ) }}
</a>
<a href="{{ _p.web_self ~ '?' ~ {'export':'xls','from':selectedFrom,'until':selectedUntil,'course':selectedCourse,'session':selectedSession,'teacher':selectedTeacher}|url_encode }}">
{{ 'export_excel.png' | img(32, 'ExportExcel'|get_lang ) }}
</a>
<div class="pull-right">
<a href="{{ _p.web_self ~ '?' ~ {'export':'pdf','from':selectedFrom,'until':selectedUntil,'course':selectedCourse,'session':selectedSession,'teacher':selectedTeacher}|url_encode }}">
{{ 'pdf.png' | img(32, 'ExportToPDF'|get_lang ) }}
</a>
<a href="{{ _p.web_self ~ '?' ~ {'export':'xls','from':selectedFrom,'until':selectedUntil,'course':selectedCourse,'session':selectedSession,'teacher':selectedTeacher}|url_encode }}">
{{ 'export_excel.png' | img(32, 'ExportExcel'|get_lang ) }}
</a>
</div>
</div>
<h1 class="page-header">{{ 'TeacherTimeReport' | get_lang }}</h1>
{{ form }}
<h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2>
<table class="table">
<thead>
</div>
<h1 class="page-header">{{ 'TeacherTimeReport' | get_lang }}</h1>
{{ form }}
<h2 class="page-header">{{ reportTitle }} <small>{{ reportSubTitle }}</small></h2>
<table class="table">
<thead>
<tr>
{% if withFilter %}
<th>{{ 'Session' | get_lang }}</th>
<th>{{ 'Course' | get_lang }}</th>
{% endif %}
<th>{{ 'Coach' | get_lang }}</th>
<th>{{ 'TotalTime' | get_lang }}</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
{% if withFilter %}
<th>{{ 'Session' | get_lang }}</th>
<th>{{ 'Course' | get_lang }}</th>
<td>{{ row.session ? row.session.name : '&nbsp' }}</td>
<td>{{ row.course.name }}</td>
{% endif %}
<th>{{ 'Coach' | get_lang }}</th>
<th>{{ 'TotalTime' | get_lang }}</th>
<td>{{ row.coach.completeName }} ({{ row.coach.username}})</td>
<td>{{ row.totalTime }}</td>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
{% if withFilter %}
<td>{{ row.session ? row.session.name : '&nbsp' }}</td>
<td>{{ row.course.name }}</td>
{% endif %}
<td>{{ row.coach.completeName }} ({{ row.coach.username}})</td>
<td>{{ row.totalTime }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% endfor %}
</tbody>
</table>
</div>

Loading…
Cancel
Save