Merge branch 'ent-4327-Vista-Hourly-SLA-Weekly-SLA-en-PDF' into 'develop'

Fix Landscape reports

See merge request artica/pandorafms!2937
This commit is contained in:
Daniel Rodriguez 2019-12-11 15:07:38 +01:00
commit 13d8c69737
24 changed files with 420 additions and 56 deletions

View File

@ -1,5 +1,10 @@
START TRANSACTION;
ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `tevent_response` ADD COLUMN `command_timeout` int(5) unsigned NOT NULL DEFAULT 90;
COMMIT;

View File

@ -842,6 +842,8 @@ ALTER TABLE `treport_content_template` MODIFY COLUMN `historical_db` tinyint(1)
MODIFY COLUMN `lapse_calc` tinyint(1) unsigned NOT NULL DEFAULT '0',
MODIFY COLUMN `lapse` int(11) unsigned NOT NULL DEFAULT '300',
MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0';
ALTER TABLE `treport_content_template` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content_template` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
-- ----------------------------------------------------------------------
-- Table `tnews`
@ -1330,13 +1332,13 @@ ALTER TABLE `tmap` MODIFY COLUMN `id_user` varchar(250) NOT NULL DEFAULT '';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 33);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 34);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '741');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '742');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
UPDATE `tconfig` SET `value` = 'mini_severity,evento,id_agente,estado,timestamp' WHERE `token` LIKE 'event_fields';
DELETE FROM `tconfig` WHERE `token` LIKE 'integria_api_password';
@ -1601,6 +1603,8 @@ ALTER TABLE `treport_content` MODIFY COLUMN `historical_db` tinyint(1) unsigned
MODIFY COLUMN `visual_format` tinyint(1) unsigned NOT NULL DEFAULT '0',
MODIFY COLUMN `failover_mode` tinyint(1) NULL DEFAULT '1',
MODIFY COLUMN `failover_type` tinyint(1) NULL DEFAULT '1';
ALTER TABLE `treport_content` ADD COLUMN `landscape` tinyint(1) UNSIGNED NOT NULL default 0;
ALTER TABLE `treport_content` ADD COLUMN `pagebreak` tinyint(1) UNSIGNED NOT NULL default 0;
-- ---------------------------------------------------------------------
-- Table `tmodule_relationship`

View File

@ -163,7 +163,6 @@ switch ($action) {
$description = null;
$sql = null;
$show_in_same_row = 0;
$show_in_landscape = 0;
$hide_notinit_agents = 0;
$priority_mode = REPORT_PRIORITY_MODE_OK;
$failover_mode = 0;
@ -171,6 +170,8 @@ switch ($action) {
$server_name = '';
$server_id = 0;
$dyn_height = 230;
$landscape = false;
$pagebreak = false;
break;
case 'save':
@ -208,7 +209,6 @@ switch ($action) {
$description = null;
$sql = null;
$show_in_same_row = 0;
$show_in_landscape = 0;
$hide_notinit_agents = 0;
$server_name = '';
$server_id = 0;
@ -236,12 +236,14 @@ switch ($action) {
$name_from_template = $style['name_label'];
$show_in_same_row = $style['show_in_same_row'];
$show_in_landscape = $style['show_in_landscape'];
$hide_notinit_agents = $style['hide_notinit_agents'];
$dyn_height = $style['dyn_height'];
$type = $item['type'];
$name = $style['name_label'];
$landscape = $item['landscape'];
$pagebreak = $item['pagebreak'];
switch ($type) {
case 'event_report_log':
$period = $item['period'];
@ -2554,25 +2556,6 @@ $class = 'databox filters';
</td>
</tr>
<tr id="row_show_in_landscape" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Show in landscape');
?>
</td>
<td>
<?php
html_print_checkbox(
'show_in_landscape',
1,
$show_in_landscape,
false,
false
);
?>
</td>
</tr>
<tr id="row_priority_mode" style="" class="datos">
<td style="font-weight:bold;">
<?php
@ -2779,6 +2762,24 @@ $class = 'databox filters';
</td>
</tr>
<tr id="row_landscape" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Show item in landscape format (only PDF)');
?>
</td>
<td><?php html_print_checkbox('landscape', 1, $landscape); ?></td>
</tr>
<tr id="row_pagebreak" style="" class="datos">
<td style="font-weight:bold;">
<?php
echo __('Page break at the end of the item (only PDF)');
?>
</td>
<td><?php html_print_checkbox('pagebreak', 1, $pagebreak); ?></td>
</tr>
</tbody>
</table>
@ -4472,7 +4473,6 @@ function chooseType() {
$("#row_lapse_calc").hide();
$("#row_lapse").hide();
$("#row_visual_format").hide();
$("#row_show_in_landscape").hide();
$('#row_hide_notinit_agents').hide();
$('#row_priority_mode').hide();
$("#row_module_group").hide();

View File

@ -147,7 +147,7 @@ if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NO
}
// Constant with fonts directory.
define('_MPDF_TTFONTPATH', 'include/fonts/');
define('_MPDF_TTFONTPATH', $config['homedir'].'/include/fonts/');
$activeTab = get_parameter('tab', 'main');
$action = get_parameter('action', 'list');
@ -1415,6 +1415,9 @@ switch ($action) {
$name_it
);
$values['landscape'] = get_parameter('landscape');
$values['pagebreak'] = get_parameter('pagebreak');
/*
Added support for projection graphs,
prediction date and SLA reports
@ -1924,10 +1927,6 @@ switch ($action) {
'show_in_same_row',
0
);
$style['show_in_landscape'] = get_parameter(
'show_in_landscape',
0
);
$style['hide_notinit_agents'] = get_parameter(
'hide_notinit_agents',
0
@ -2100,6 +2099,9 @@ switch ($action) {
$name_it
);
$values['landscape'] = get_parameter('landscape');
$values['pagebreak'] = get_parameter('pagebreak');
// Support for projection graph, prediction date
// and SLA reports 'top_n_value', 'top_n' and 'text'
// fields will be reused for these types of report.
@ -2490,10 +2492,6 @@ switch ($action) {
'show_in_same_row',
0
);
$style['show_in_landscape'] = get_parameter(
'show_in_landscape',
0
);
$style['hide_notinit_agents'] = get_parameter(
'hide_notinit_agents',
0

View File

@ -882,9 +882,9 @@ $row++;
$table_chars->data[$row][1] = html_print_select($options_zoom_graphs, 'zoom_graph', $config['zoom_graph'], '', '', 0, true, false, false);
$row++;
$table_chars->data[$row][0] = __('Graph image height');
$table_chars->data[$row][0] = __('Graph image height for HTML reports');
$table_chars->data[$row][0] .= ui_print_help_tip(
__('This is the height in pixels of the module graph or custom graph in the reports (both: HTML and PDF)'),
__('This is the height in pixels of the module graph or custom graph in the reports (only: HTML)'),
true
);
$table_chars->data[$row][1] = html_print_input_text('graph_image_height', $config['graph_image_height'], '', 20, 20, true);
@ -1050,7 +1050,14 @@ $row++;
$dirFonts = scandir(_MPDF_TTFONTPATH);
foreach ($dirFonts as $entryDir) {
if (strstr($entryDir, '.ttf') !== false) {
$_fonts[$entryDir] = $entryDir;
$explode = explode('-', $entryDir);
if (count($explode) === 1) {
$fonts[$entryDir] = substr($entryDir, 0, (strlen($entryDir) - 4));
}
if ($explode[1] === 'Regular.ttf') {
$fonts[$explode[0].'.ttf'] = $explode[0];
}
}
}

View File

@ -164,15 +164,23 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['width'] = (int) $_REQUEST['viewport_width'];
$params['menu'] = false;
$params_combined = json_decode($_REQUEST['data_combined'], true);
$module_list = json_decode($_REQUEST['data_module_list'], true);
$type_graph_pdf = $_REQUEST['type_graph_pdf'];
if ((isset($params['width']) === false
|| ($params['width'] <= 0))
) {
$params['width'] = 650;
}
if ((int) $params['landscape'] === 1) {
$params['width'] = 850;
}
$params_combined = json_decode($_REQUEST['data_combined'], true);
$module_list = json_decode($_REQUEST['data_module_list'], true);
$type_graph_pdf = $_REQUEST['type_graph_pdf'];
if ($type_graph_pdf === 'slicebar') {
$params['width'] = 150;
$params['height'] = 70;
}
}
echo '<div>';
switch ($type_graph_pdf) {

View File

@ -0,0 +1 @@
Copyright 2011 Google Inc. All Rights Reserved.

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -3856,9 +3856,19 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined=false
$img_url = ui_get_full_url(false).$hack_metaconsole.'/attachment/'.$img_file;
$width_img = 500;
$height_img = (isset($config['graph_image_height'])) ? $config['graph_image_height'] : 280;
$params['height'] = $height_img;
// Set height image.
$height_img = 170;
$params['height'] = 170;
if ((int) $params['landscape'] === 1) {
$height_img = 150;
$params['height'] = 150;
}
if ($type_graph_pdf === 'slicebar') {
$height_img = 70;
$params['height'] = 70;
}
$params_encode_json = urlencode(json_encode($params));
@ -3882,7 +3892,6 @@ function generator_chart_to_pdf($type_graph_pdf, $params, $params_combined=false
if ($params['return_img_base_64']) {
// To be used in alerts.
$width_img = 500;
return $img_content;
} else {
// to be used in PDF files.

View File

@ -859,6 +859,8 @@ function reporting_SLA(
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -1359,6 +1361,8 @@ function reporting_event_top_n(
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$top_n = $content['top_n'];
switch ($top_n) {
@ -1737,6 +1741,8 @@ function reporting_event_report_group(
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = groups_get_name($content['id_group'], true);
if (!empty($content['style']['event_filter_search'])) {
$return['subtitle'] .= ' ('.$content['style']['event_filter_search'].')';
@ -1996,6 +2002,8 @@ function reporting_event_report_module(
];
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_alias.' - '.io_safe_output($module_name);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
@ -2102,6 +2110,8 @@ function reporting_inventory_changes($report, $content, $type)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = agents_get_alias($content['id_agent']);
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -2169,6 +2179,8 @@ function reporting_inventory($report, $content, $type)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -2238,6 +2250,8 @@ function reporting_agent_module($report, $content)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$group_name = groups_get_name($content['id_group'], true);
if ($content['id_module_group'] == 0) {
$module_group_name = __('All');
@ -2326,6 +2340,8 @@ function reporting_exception(
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$exception_condition = $content['exception_condition'];
switch ($exception_condition) {
case REPORT_EXCEPTION_CONDITION_EVERYTHING:
@ -2804,6 +2820,8 @@ function reporting_group_report($report, $content)
$return['server_name'] = $server[0];
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = groups_get_name($content['id_group'], true);
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -2906,6 +2924,8 @@ function reporting_event_report_agent(
$return['label'] = $label;
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = io_safe_output($agent_alias);
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -3115,6 +3135,8 @@ function reporting_historical_data($report, $content)
];
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_alias.' - '.$module_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -3238,6 +3260,8 @@ function reporting_database_serialized($report, $content)
];
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_alias.' - '.$module_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -3374,6 +3398,8 @@ function reporting_group_configuration($report, $content)
$group_name = groups_get_name($content['id_group'], true);
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $group_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -3447,6 +3473,8 @@ function reporting_network_interfaces_report($report, $content, $type='dinamic',
$group_name = groups_get_name($content['id_group']);
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $group_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -3541,6 +3569,7 @@ function agents_get_network_interfaces_array(
'fullscale' => $fullscale,
'server_id' => $id_meta,
'height' => $config['graph_image_height'],
'landscape' => $content['landscape'],
];
$params_combined = [
@ -3647,6 +3676,8 @@ function reporting_alert_report_group($report, $content)
$group_name = groups_get_name($content['id_group'], true);
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $group_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -3832,6 +3863,8 @@ function reporting_alert_report_agent($report, $content)
];
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_alias;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -4000,6 +4033,8 @@ function reporting_alert_report_module($report, $content)
];
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_alias.' - '.$module_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -4161,6 +4196,8 @@ function reporting_sql_graph(
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text();
@ -4264,6 +4301,8 @@ function reporting_monitor_report($report, $content)
];
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_alias.' - '.$module_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -4371,6 +4410,8 @@ function reporting_netflow(
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -4452,6 +4493,8 @@ function reporting_prediction_date($report, $content)
$agent_name_db = io_safe_output(modules_get_agentmodule_agent_name($content['id_agent_module']));
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_name.' - '.$module_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -4528,6 +4571,7 @@ function reporting_projection_graph(
'ttl' => $ttl,
'server_id' => $id_meta,
'height' => $config['graph_image_height'],
'landscape' => $content['landscape'],
];
$params_combined = [
@ -4573,6 +4617,8 @@ function reporting_agent_configuration($report, $content)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
@ -4751,6 +4797,8 @@ function reporting_value($report, $content, $type, $pdf=false)
);
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_name.' - '.$module_name;
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text($report, $content);
@ -4781,6 +4829,7 @@ function reporting_value($report, $content, $type, $pdf=false)
'server_id' => $id_meta,
'height' => $config['graph_image_height'],
'fullscale' => true,
'landscape' => $content['landscape'],
];
switch ($type) {
@ -4927,6 +4976,8 @@ function reporting_url($report, $content, $type='dinamic')
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text();
@ -4964,6 +5015,8 @@ function reporting_text($report, $content)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text();
@ -4985,6 +5038,8 @@ function reporting_sql($report, $content)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text();
@ -6132,6 +6187,8 @@ function reporting_availability($report, $content, $date=false, $time=false)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text(
$report,
@ -6397,6 +6454,8 @@ function reporting_availability_graph($report, $content, $pdf=false)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['failover_type'] = $content['failover_type'];
$return['date'] = reporting_get_date_text($report, $content);
@ -7001,6 +7060,8 @@ function reporting_increment($report, $content)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['id_agent_module'] = $content['id_agent_module'];
$return['id_agent'] = $content['id_agent'];
@ -7100,6 +7161,8 @@ function reporting_general($report, $content)
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
$return['date'] = reporting_get_date_text(
$report,
@ -7515,6 +7578,8 @@ function reporting_custom_graph(
);
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = io_safe_output($graph['name']);
$return['agent_name'] = $agent_alias;
$return['module_name'] = $module_name;
@ -7542,6 +7607,7 @@ function reporting_custom_graph(
'fullscale' => $graphs[0]['fullscale'],
'server_id' => $id_meta,
'height' => $config['graph_image_height'],
'landscape' => $content['landscape'],
];
$params_combined = [
@ -7657,6 +7723,8 @@ function reporting_simple_graph(
}
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['subtitle'] = $agent_alias.' - '.$module_name;
$return['agent_name_db'] = agents_get_name($id_agent);
$return['agent_name'] = $agent_alias;
@ -7720,6 +7788,7 @@ function reporting_simple_graph(
'fullscale' => $fullscale,
'server_id' => $id_meta,
'height' => $config['graph_image_height'],
'landscape' => $content['landscape'],
];
$return['chart'] = grafico_modulo_sparse($params);
@ -7866,13 +7935,8 @@ function reporting_set_conf_charts(
case 'static':
$ttl = 2;
$only_image = true;
if ($content['style']['show_in_landscape']) {
$height = 1100;
$width = 1700;
} else {
$height = 360;
$width = 780;
}
$height = 360;
$width = 780;
break;
case 'data':
@ -12050,7 +12114,7 @@ function reporting_translate_sla_status_for_graph($status)
*/
function reporting_header_table_for_pdf($title='', $description='')
{
$result_pdf .= '<pagebreak>';
$result_pdf = '<pagebreak>';
$result_pdf .= '<table class="header_table databox">';
$result_pdf .= '<thead class="header_tr"><tr>';
$result_pdf .= '<th class="th_first" colspan="2">';
@ -12078,6 +12142,8 @@ function reporting_nt_top_n_report($period, $content, $pdf)
$return = [];
$return['type'] = 'nt_top_n';
$return['title'] = $content['name'];
$return['landscape'] = $content['landscape'];
$return['pagebreak'] = $content['pagebreak'];
$return['description'] = $content['description'];
// Get the data sent and received

View File

@ -388,7 +388,7 @@ select:-internal-list-box {
@font-face {
font-family: "FreeSansBoldFont";
src: url("../fonts/FreeSansBold.ttf") format("truetype");
src: url("../fonts/FreeSans-Bold.ttf") format("truetype");
}
.FreeSansBold {

View File

@ -80,3 +80,63 @@ th.title_table_pdf {
table.table_agent_module tr td {
padding: 5px;
}
/* TABLE OF CONTENTS */
div.mpdf_toc {
font-family: sans-serif;
line-height: normal;
}
a.mpdf_toc_a {
text-decoration: none;
color: #363636;
}
div.mpdf_toc_level_0 {
/* Whole line level 0 */
line-height: 1.5;
margin-left: 0;
padding-right: 0em; /* should match the outdent specified for ToC; 0 is default; suggested value 2em */
}
span.mpdf_toc_t_level_0 {
/* Title level 0 - may be inside <a> */
font-weight: normal;
}
span.mpdf_toc_p_level_0 {
/* Page no. level 0 - may be inside <a> */
}
div.mpdf_toc_level_1 {
/* Whole line level 1 */
margin-left: 2em;
text-indent: -2em;
padding-right: 1em;
padding-bottom: 1em;
}
span.mpdf_toc_t_level_1 {
/* Title level 1 */
font-style: normal;
font-weight: normal;
}
span.mpdf_toc_p_level_1 {
/* Page no. level 1 - may be inside <a> */
}
div.mpdf_toc_level_2 {
/* Whole line level 2 */
margin-left: 4em;
text-indent: -2em;
padding-right: 0em; /* should match the outdent specified for ToC; 0 is default; suggested value 2em */
}
span.mpdf_toc_t_level_2 {
/* Title level 2 */
}
span.mpdf_toc_p_level_2 {
/* Page no. level 2 - may be inside <a> */
}

View File

@ -1457,6 +1457,8 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`failover_mode` tinyint(1) DEFAULT '1',
`failover_type` tinyint(1) DEFAULT '1',
`uncompressed_module` TINYINT DEFAULT '0',
`landscape` tinyint(1) UNSIGNED NOT NULL default 0,
`pagebreak` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE
@ -3023,6 +3025,8 @@ CREATE TABLE IF NOT EXISTS `treport_content_template` (
`failover_mode` tinyint(1) DEFAULT '1',
`failover_type` tinyint(1) DEFAULT '1',
`uncompressed_module` TINYINT DEFAULT '0',
`landscape` tinyint(1) UNSIGNED NOT NULL default 0,
`pagebreak` tinyint(1) UNSIGNED NOT NULL default 0,
PRIMARY KEY(`id_rc`)
) ENGINE = InnoDB DEFAULT CHARSET=utf8;

View File

@ -109,10 +109,10 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''),
('custom_report_front_footer', ''),
('MR', 33),
('MR', 34),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '741'),
('current_package_enterprise', '742'),
('post_process_custom_values', '{"0.00000038580247":"Seconds&#x20;to&#x20;months","0.00000165343915":"Seconds&#x20;to&#x20;weeks","0.00001157407407":"Seconds&#x20;to&#x20;days","0.01666666666667":"Seconds&#x20;to&#x20;minutes","0.00000000093132":"Bytes&#x20;to&#x20;Gigabytes","0.00000095367432":"Bytes&#x20;to&#x20;Megabytes","0.0009765625":"Bytes&#x20;to&#x20;Kilobytes","0.00000001653439":"Timeticks&#x20;to&#x20;weeks","0.00000011574074":"Timeticks&#x20;to&#x20;days"}'),
('custom_docs_logo', 'default_docs.png'),
('custom_support_logo', 'default_support.png'),

View File

@ -329,4 +329,4 @@ class FontVariables
return $this->defaults;
}
}
}