Merge branch 'ent-12687-sistema-import-export-prd' of https://brutus.artica.es:8081/artica/pandorafms into ent-12687-sistema-import-export-prd

This commit is contained in:
Enrique Martin 2024-02-09 13:56:21 +01:00
commit b2df1b3529
2 changed files with 29 additions and 5 deletions

View File

@ -98,7 +98,7 @@ $input_file = '<input class="input-file-style" style="padding-top: 1px; width: 1
$div_input_file = html_print_div( $div_input_file = html_print_div(
[ [
'style' => 'padding-bottom: 20px;display: flex; justify-content: left;width:100%; height: 60px;', 'style' => 'padding-top: 20px;display: flex; justify-content: left;width:100%; height: 60px;',
'content' => $input_file, 'content' => $input_file,
], ],
true true
@ -108,7 +108,11 @@ $button_import = html_print_submit_button(
__('Import'), __('Import'),
'upload', 'upload',
false, false,
['icon' => 'import'], [
'icon' => 'import',
'class' => 'disabled',
'disabled' => '',
],
true true
); );
@ -206,8 +210,9 @@ $button_export = html_print_button(
false, false,
'', '',
[ [
'class' => 'flex_justify', 'class' => 'flex_justify disabled',
'icon' => 'export', 'icon' => 'export',
'disabled' => '',
], ],
true true
); );
@ -283,9 +288,22 @@ echo '</div>';
); );
} }
$('input[type="file"]').change(function() {
console.log($(this).val());
if ($(this).val() === '') {
$("#button-upload").addClass("disabled");
$('#button-upload').prop('disabled', true);
} else {
$("#button-upload").removeClass("disabled");
$('#button-upload').prop('disabled', false);
}
});
$("#export_type").change(function(e) { $("#export_type").change(function(e) {
if ($(this).val() === '0') { if ($(this).val() === '0') {
$("#resource_type").remove(); $("#resource_type").remove();
$("#button-export_button").addClass("disabled");
$('#button-export_button').prop('disabled', true);
} else { } else {
$.ajax({ $.ajax({
type: "GET", type: "GET",
@ -300,7 +318,8 @@ echo '</div>';
$("#resource_type").remove(); $("#resource_type").remove();
$("#div_select_export").append(`${data}`); $("#div_select_export").append(`${data}`);
$('#select_value').select2(); $('#select_value').select2();
// $("#button-export_button").removeClass("invisible_important"); $("#button-export_button").removeClass("disabled");
$('#button-export_button').prop('disabled', false);
}, },
error: function(data) { error: function(data) {
console.error("Fatal error in AJAX call to interpreter order", data) console.error("Fatal error in AJAX call to interpreter order", data)

View File

@ -13535,3 +13535,8 @@ tr.shown td.details-control {
width: 120px; width: 120px;
height: 32px; height: 32px;
} }
button.disabled {
background: #c0ccdc !important;
border: 0px;
}