Fix import lines (#36303)

This commit is contained in:
John BOTELLA 2025-11-18 18:01:07 +01:00 committed by GitHub
parent 4528a3dac0
commit b9b8fc5bbe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,9 +31,8 @@ if ($object->element == 'propal') {
<!-- START TEMPLATE IMPORT OBJECT LINKED LINES -->
<script>
$(document).ready(function(){
$('.objectlinked_importbtn').click(function (e) {
$(function() {
$(document).on('click', '.objectlinked_importbtn', function(e) {
e.preventDefault();
var page = $(this).attr("href");
@ -78,8 +77,9 @@ $(document).ready(function(){
$( this ).dialog( "close" );
$("#" + formId).append('<input type="hidden" name="action" value="import_lines_from_object" />');
$("#" + formId).append('<input type="hidden" name="fromelement" value="' + fromelement + '" />');
$("#" + formId).append('<input type="hidden" name="token" value="<?php print dol_escape_htmltag(newToken()); ?>" />');
$("#" + formId).append('<input type="hidden" name="fromelementid" value="' + fromelementid + '" />');
$("#" + formId).submit();
$("#" + formId).trigger('submit');
},
"<?php echo $langs->trans("Cancel"); ?>": function() {
$( this ).dialog( "close" );