#12594 no repeat name and same report parameters

This commit is contained in:
Jonathan 2024-03-01 10:21:31 +01:00
parent 15be9df26f
commit 9317f7688a
2 changed files with 4 additions and 4 deletions

View File

@ -232,7 +232,7 @@ $table->data[3][1] = html_print_label_input_block(
)
);
$table->colspan[4][0] = 2;
$table->data[4][0] = html_print_label_input_block(__('Parameters'), cron_render_parameters($task, $args, 0, true));
$table->data[4][0] = html_print_label_input_block(__('Parameters'), cron_render_parameters($task, $args, $id_report, true));
$traps_generator .= html_print_table($table, true);
if (isset($id_task) === true) {
$buttons[] = html_print_submit_button(
@ -302,7 +302,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
firstDay: "<?php echo $config['datepicker_first_day']; ?>",
});
$('#id_user_task').on('change', function() {
$('#id_user_task, #id_report').on('change', function() {
$.ajax({
url: 'ajax.php',
data: {
@ -330,7 +330,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
} else {
confirmDialog({
title: "<?php echo __('Error'); ?>",
message: "<?php echo __('Name, Report, Task, Group, Date and Hour are required.'); ?>",
message: "<?php echo __('Name, Report, Task and Group are required.'); ?>",
hideCancelButton: true,
});
}

View File

@ -88,7 +88,7 @@ if ($update_schedule === '1') {
$new_schedule = get_parameter('new_schedule', false);
if ($new_schedule === '1') {
$name = get_parameter('name', null);
$sql = sprintf('SELECT * FROM tuser_task_scheduled WHERE name = "%s"', io_safe_input($name));
$sql = sprintf('SELECT * FROM tuser_task_scheduled WHERE name = "%s"', $name);
if (db_get_all_rows_sql($sql) === false) {
enterprise_include_once('/godmode/wizards/ConsoleTasks.class.php');
$task = new ConsoleTasks(0, 'Default message. Not set.', '/images/wizard/consoletasks.png', 'Report Tasks', true);