mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-16 19:40:44 +01:00
Pulsante per processare FE da remoto
This commit is contained in:
parent
9d230c2bab
commit
0ca8ba237f
@ -90,4 +90,18 @@ switch (filter('op')) {
|
|||||||
include __DIR__.'/rows.php';
|
include __DIR__.'/rows.php';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'process':
|
||||||
|
$name = get('name');
|
||||||
|
|
||||||
|
// Processo il file ricevuto
|
||||||
|
if (Interaction::isEnabled()) {
|
||||||
|
$process_result = Interaction::processXML($name);
|
||||||
|
if (!empty($process_resul)) {
|
||||||
|
flash()->error($process_result);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ if (!empty($list)) {
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>'.tr('Nome').'</th>
|
<th>'.tr('Nome').'</th>
|
||||||
<th width="10%" class="text-center">#</th>
|
<th width="20%" class="text-center">#</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>';
|
<tbody>';
|
||||||
@ -29,6 +29,11 @@ if (!empty($list)) {
|
|||||||
<button type="button" class="btn btn-danger" onclick="delete_fe(this, \''.$element.'\')">
|
<button type="button" class="btn btn-danger" onclick="delete_fe(this, \''.$element.'\')">
|
||||||
<i class="fa fa-trash"></i>
|
<i class="fa fa-trash"></i>
|
||||||
</button>';
|
</button>';
|
||||||
|
}else{
|
||||||
|
echo '
|
||||||
|
<button type="button" class="btn btn-info" onclick="process_fe(this, \''.$element.'\')">
|
||||||
|
<i class="fa fa-upload"></i>
|
||||||
|
</button>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
@ -81,6 +86,13 @@ function download(button, file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function delete_fe(button, file) {
|
function delete_fe(button, file) {
|
||||||
|
swal({
|
||||||
|
title: "'.tr("Rimuovere la fattura salvata localmente?").'",
|
||||||
|
html: "'.tr("Sarà possibile inserirla nuovamente nel gestionale attraverso il caricamento").'",
|
||||||
|
type: "error",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: "'.tr('Sì').'"
|
||||||
|
}).then(function (result) {
|
||||||
var restore = buttonLoading(button);
|
var restore = buttonLoading(button);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -98,6 +110,35 @@ function delete_fe(button, file) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function process_fe(button, file) {
|
||||||
|
swal({
|
||||||
|
title: "'.tr("Segnare la fattura come processata?").'",
|
||||||
|
html: "'.tr("Non sarà possibile individuarla nuovamente in modo automatico: l'unico modo per recuperarla sarà contattare l'assistenza").'",
|
||||||
|
type: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonText: "'.tr('Sì').'"
|
||||||
|
}).then(function (result) {
|
||||||
|
var restore = buttonLoading(button);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: globals.rootdir + "/actions.php",
|
||||||
|
type: "get",
|
||||||
|
data: {
|
||||||
|
id_module: globals.id_module,
|
||||||
|
id_plugin: '.$id_plugin.',
|
||||||
|
op: "process",
|
||||||
|
name: file,
|
||||||
|
},
|
||||||
|
success: function(data) {
|
||||||
|
$("#list").load("'.$structure->fileurl('list.php').'?id_module='.$id_module.'&id_plugin='.$id_plugin.'", function() {
|
||||||
|
buttonRestore(button, restore);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
start_local_datatables();
|
start_local_datatables();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user