mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglado que sólo se podia duplicar presupuestos con rotativas
This commit is contained in:
@ -84,14 +84,16 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const domain = window.location.origin
|
||||||
|
const url = window.location.href;
|
||||||
|
const url_parts = url.split('/');
|
||||||
|
var id = -1;
|
||||||
|
if(url_parts[url_parts.length-2] == 'edit'){
|
||||||
|
id = url_parts[url_parts.length-1];
|
||||||
|
}
|
||||||
|
|
||||||
if(gotaNegro){
|
if(gotaNegro){
|
||||||
const domain = window.location.origin
|
|
||||||
const url = window.location.href;
|
|
||||||
const url_parts = url.split('/');
|
|
||||||
var id = -1;
|
|
||||||
if(url_parts[url_parts.length-2] == 'edit'){
|
|
||||||
id = url_parts[url_parts.length-1];
|
|
||||||
}
|
|
||||||
asyncMessageDialog('<?= lang("Basic.global.Warning") ?>', '<?= lang("Presupuestos.duplicarConTipologias") ?>', function() {
|
asyncMessageDialog('<?= lang("Basic.global.Warning") ?>', '<?= lang("Presupuestos.duplicarConTipologias") ?>', function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'post',
|
type: 'post',
|
||||||
@ -117,6 +119,30 @@
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
$.ajax({
|
||||||
|
type: 'post',
|
||||||
|
url: '<?= route_to("updateDataOfCosidotapablanda") ?>',
|
||||||
|
|
||||||
|
data: {
|
||||||
|
tipo: 'duplicar',
|
||||||
|
presupuesto_id: id,
|
||||||
|
<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v
|
||||||
|
},
|
||||||
|
dataType: 'json',
|
||||||
|
success:function(response){
|
||||||
|
|
||||||
|
token=response.<?= csrf_token() ?>;
|
||||||
|
yeniden(token);
|
||||||
|
// redirect
|
||||||
|
new_location = '<?= site_url("presupuestos/cosidotapablanda/edit/") ?>' + response.id
|
||||||
|
window.location.href = new_location;
|
||||||
|
}
|
||||||
|
}).fail(function (jqXHR, textStatus, error) {
|
||||||
|
// Handle error here
|
||||||
|
console.log(jqXHR)
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user