Fixed problems with export or view data when data start and end is in same day. Tiquet: #2763

This commit is contained in:
m-lopez-f 2015-09-29 13:12:17 +02:00
parent 8690f981fb
commit 8a8515ecbc
1 changed files with 5 additions and 4 deletions

View File

@ -124,6 +124,7 @@ if (!empty ($export_btn) && !empty ($module)) {
}
$work_end = $end - $period + $work_period;
$work_start = $end - $work_period;
//Buffer to get data, anyway this will report a memory exhaustin
$flag_last_time_slice = false;
@ -165,7 +166,7 @@ if (!empty ($export_btn) && !empty ($module)) {
$output .= $divider;
$output .= $module['data'];
$output .= $divider;
$output .= date ("Y-m-d G:i:s", $module['utimestamp']);
$output .= date ("Y-m-d G:i:s", $work_start ) . ' - ' . date ("Y-m-d G:i:s", $module['utimestamp']);
$output .= $rowend;
}
@ -186,7 +187,7 @@ if (!empty ($export_btn) && !empty ($module)) {
if ($flag_last_time_slice)
breaK;
if (($work_end + $work_period) > $end) {
if (($work_end + $work_period) > $end || $work_period == 0) {
// Get the last timelapse
$work_period = $end - $work_end;
$work_end = $end;
@ -303,7 +304,7 @@ if (empty($export_btn) || $show_form) {
date ("Y-m-d", get_system_time () - SECONDS_1DAY), false, 10, 10, true);
$table->data[3][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-start_date'),this);"));
$table->data[3][1] .= html_print_input_text ('start_time',
date ("H:i", get_system_time () - SECONDS_1DAY), false, 10, 5, true);
date ("H:i:s", get_system_time () - SECONDS_1DAY), false, 10, 9, true);
//End date selector
$table->data[4][0] = '<b>'.__('End date').'</b>';
@ -311,7 +312,7 @@ if (empty($export_btn) || $show_form) {
date ("Y-m-d", get_system_time ()), false, 10, 10, true);
$table->data[4][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-end_date'),this);"));
$table->data[4][1] .= html_print_input_text ('end_time',
date ("H:i", get_system_time ()), false, 10, 5, true);
date ("H:i:s", get_system_time ()), false, 10, 9, true);
//Export type
$table->data[5][0] = '<b>'.__('Export type').'</b>';