mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Add button diagnostic
This commit is contained in:
parent
9db7bd37f2
commit
4d7f92e3f0
@ -68,6 +68,10 @@ class Diagnostics extends Wizard
|
|||||||
// Check access.
|
// Check access.
|
||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
|
$this->url = ui_get_full_url(
|
||||||
|
'index.php?sec=gextensions&sec2=tools/diagnostics'
|
||||||
|
);
|
||||||
|
|
||||||
$this->ajaxController = $page;
|
$this->ajaxController = $page;
|
||||||
$this->pdf = $pdf;
|
$this->pdf = $pdf;
|
||||||
$this->product_name = io_safe_output(get_product_name());
|
$this->product_name = io_safe_output(get_product_name());
|
||||||
@ -123,15 +127,34 @@ class Diagnostics extends Wizard
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
if ($this->pdf === true) {
|
||||||
|
$this->exportPDF();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
ui_require_css_file('diagnostics');
|
ui_require_css_file('diagnostics');
|
||||||
|
|
||||||
|
$pdf_url = $this->url.'&pdf=true';
|
||||||
|
$pdf_img = html_print_image(
|
||||||
|
'images/pdf.png',
|
||||||
|
true,
|
||||||
|
['title' => __('Export to PDF')]
|
||||||
|
);
|
||||||
|
$header_buttons = [
|
||||||
|
'csv' => [
|
||||||
|
'active' => false,
|
||||||
|
'text' => '<a target="_new" href="'.$pdf_url.'">'.$pdf_img.'</a>',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
// Header.
|
// Header.
|
||||||
ui_print_page_header(
|
ui_print_page_header(
|
||||||
__('%s Diagnostic tool', $this->product_name),
|
__('%s Diagnostic tool', $this->product_name),
|
||||||
'images/gm_massive_operations.png',
|
'images/gm_massive_operations.png',
|
||||||
false,
|
false,
|
||||||
'diagnostic_tool_tab',
|
'diagnostic_tool_tab',
|
||||||
true
|
true,
|
||||||
|
$header_buttons
|
||||||
);
|
);
|
||||||
|
|
||||||
// Print all Methods Diagnostic Info.
|
// Print all Methods Diagnostic Info.
|
||||||
@ -2080,6 +2103,10 @@ class Diagnostics extends Wizard
|
|||||||
enterprise_include_once('/include/class/Pdf.class.php');
|
enterprise_include_once('/include/class/Pdf.class.php');
|
||||||
$mpdf = new Pdf([]);
|
$mpdf = new Pdf([]);
|
||||||
|
|
||||||
|
// Ignore pending HTML outputs.
|
||||||
|
while (@ob_end_clean()) {
|
||||||
|
}
|
||||||
|
|
||||||
// ADD style.
|
// ADD style.
|
||||||
$mpdf->addStyle($config['homedir'].'/include/styles/diagnostics.css');
|
$mpdf->addStyle($config['homedir'].'/include/styles/diagnostics.css');
|
||||||
|
|
||||||
@ -2112,6 +2139,8 @@ class Diagnostics extends Wizard
|
|||||||
|
|
||||||
// Write html filename.
|
// Write html filename.
|
||||||
$mpdf->writePDFfile($filename);
|
$mpdf->writePDFfile($filename);
|
||||||
|
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ global $config;
|
|||||||
require_once $config['homedir'].'/include/class/Diagnostics.class.php';
|
require_once $config['homedir'].'/include/class/Diagnostics.class.php';
|
||||||
|
|
||||||
$ajaxPage = 'tools/diagnostics';
|
$ajaxPage = 'tools/diagnostics';
|
||||||
$pdf = false;
|
$pdf = get_parameter('pdf', false);
|
||||||
|
|
||||||
|
|
||||||
// Control call flow.
|
// Control call flow.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user