Fixed alert command creation error management

This commit is contained in:
fermin831 2018-10-22 16:54:22 +02:00
parent 7e8fbb4568
commit e24794d6ea
1 changed files with 11 additions and 13 deletions

View File

@ -321,20 +321,18 @@ if ($copy_command) {
$command_to_copy = db_get_row('talert_commands', 'id', $id);
if ($command_to_copy === false) {
ui_print_error_message(__("Command with id $id does not found."));
break 2;
} else {
// Prepare to insert the copy with same values
unset ($command_to_copy['id']);
$command_to_copy['name'].= __(' (copy)');
$result = db_process_sql_insert('talert_commands', $command_to_copy);
// Print the result
ui_print_result_message ($result,
__('Successfully copied'),
__('Could not be copied')
);
}
// Prepare to insert the copy with same values
unset ($command_to_copy['id']);
$command_to_copy['name'].= __(' (copy)');
$result = db_process_sql_insert('talert_commands', $command_to_copy);
// Print the result
ui_print_result_message ($result,
__('Successfully copied'),
__('Could not be copied')
);
}
$table->width = '100%';