From e685a94465fe8f26c8ff3789242b43c1c20054cf Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Mon, 5 Oct 2020 19:50:31 +0200 Subject: [PATCH] [0005209] Reports: fixed broken reports after session timeout. --- includes/page/header.inc | 2 +- includes/session.inc | 2 +- js/inserts.js | 2 +- js/reports.js | 8 +++++++- reporting/includes/reports_classes.inc | 2 +- reporting/includes/tcpdf.php | 2 +- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/includes/page/header.inc b/includes/page/header.inc index 7777dae4..8db8fe9b 100644 --- a/includes/page/header.inc +++ b/includes/page/header.inc @@ -92,7 +92,7 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="" // titles and screen header global $path_to_root, $SysPrefs, $db_connections; - if (in_ajax()) + if (in_ajax() || isset($_POST['REP_ID'])) return; // just for speed up $theme = user_theme(); diff --git a/includes/session.inc b/includes/session.inc index 21c402e0..71206521 100644 --- a/includes/session.inc +++ b/includes/session.inc @@ -561,7 +561,7 @@ if (!defined('FA_LOGOUT_PHP_FILE')){ { // in case of GET request redirect to avoid confirmation dialog // after return from menu option - header("HTTP/1.1 303 See Other"); + header("HTTP/1.1 307 Temporary Redirect"); header("Location: ".$_SESSION['timeout']['uri']); exit(); } diff --git a/js/inserts.js b/js/inserts.js index 40337e7a..d0722250 100644 --- a/js/inserts.js +++ b/js/inserts.js @@ -314,7 +314,7 @@ var inserts = { e.onclick = function(){ if (validate(e)) { setTimeout(function() { var asp = e.getAttribute('aspect'); - if (asp && asp.indexOf('download') === -1) + if (asp && asp.indexOf('download') === -1 && asp.indexOf('popup') === -1) set_mark((asp && ((asp.indexOf('process') !== -1) || (asp.indexOf('nonajax') !== -1))) ? 'progressbar.gif' : 'ajax-loader.gif'); }, 100); return true; diff --git a/js/reports.js b/js/reports.js index 1c24875e..bd7d0a43 100644 --- a/js/reports.js +++ b/js/reports.js @@ -34,7 +34,13 @@ var replinks = { showClass(this.id.substring(5)); // id=classX return false; } - } + }, + 'button': function(e) { + e.onclick = function() { + window.open('', 'formpopup', 'toolbar=no,scrollbars=yes,resizable=yes,menubar=no'); + e.form.target='formpopup'; + } + }, } function set_options(e) diff --git a/reporting/includes/reports_classes.inc b/reporting/includes/reports_classes.inc index 125cf5f8..dd76d84d 100644 --- a/reporting/includes/reports_classes.inc +++ b/reporting/includes/reports_classes.inc @@ -100,7 +100,7 @@ class BoxReports . "
\n"; $st_params .= submit('Rep'.$report->id, _("Display: ") . access_string($report->name, true), - false, '', $SysPrefs->pdf_debug ? false : 'default process') . hidden('REP_ID', $report->id, false).'

'; + false, '', $SysPrefs->pdf_debug ? false : 'default popup') . hidden('REP_ID', $report->id, false).'

'; $st_params .= $this->getOptions($report->get_controls(), $report->id); $st_params .= "\n" ."\n
\n"; diff --git a/reporting/includes/tcpdf.php b/reporting/includes/tcpdf.php index 01d15527..60d9e39a 100644 --- a/reporting/includes/tcpdf.php +++ b/reporting/includes/tcpdf.php @@ -1,4 +1,4 @@ -4527