#12100 Fix custom graph

This commit is contained in:
miguel angel rasteu 2023-09-21 16:11:58 +02:00
parent 963664c1d8
commit e637866f72
2 changed files with 19 additions and 3 deletions

View File

@ -653,7 +653,8 @@ $("[data-button=export]").click(function(e) {
});
});
$("#button-export-modal").click(function(e) {
// Export graph.
function exportCustomGraph() {
const filter = parseInt($("#export-filter-id").val());
const group = parseInt($("#export-group-id").val());
@ -682,8 +683,19 @@ $("#button-export-modal").click(function(e) {
}
}
});
} else {
confirmDialog({
title: titleExportError,
message: messageExportError,
hideCancelButton: true,
onAccept: function() {
$(
"button.ui-button.ui-corner-all.ui-widget.ui-button-icon-only.ui-dialog-titlebar-close"
).click();
}
});
}
});
}
// Remove graph.
function removeGraph(e) {

View File

@ -636,7 +636,7 @@ $data[2] = html_print_submit_button(
'class' => 'mini w30p',
'icon' => 'next',
'style' => 'margin-left: 208px; width: 130px;',
'onclick' => '',
'onclick' => 'exportCustomGraph()',
],
true
);
@ -937,6 +937,10 @@ const titleExport = "<?php echo __('Export to custom graph'); ?>";
const titleExportConfirm = "<?php echo __('Exported successfully'); ?>";
const messageExportConfirm = "<?php echo __('graphs have been created in Custom graphs'); ?>";
const titleExportError = "<?php echo __('Error to export'); ?>";
const messageExportError = "<?php echo __('Filter cannot be None'); ?>";
const titleRemoveConfirm = "<?php echo __('Delete graph'); ?>";
const messageRemoveConfirm = "<?php echo __('Do you want to delete the graph? Remember to save the changes.'); ?>";
</script>