recuperados cambios de rama antigua

This commit is contained in:
jaimejimenezortega
2024-04-14 20:55:38 +02:00
parent 5c298bfc78
commit f5262ac77e
12 changed files with 102 additions and 112 deletions

View File

@ -718,13 +718,6 @@ $(document).on('click', '.btn-remove', function(e) {
}
});
// funcion para obtener el cliente id de la url
function getId(){
var url = window.location.href;
var parts = url.split("/");
return parts[parts.length-1];
}
<?=$this->endSection() ?>
@ -775,11 +768,11 @@ function getId(){
editor.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
d.data[0]['cliente_id'] = getId();
d.data[0]['cliente_id'] = id;
}
else if(type === 'edit' ) {
for (v in d.data){
d.data[v]['cliente_id'] = getId();
d.data[v]['cliente_id'] = id;
}
}
});
@ -855,7 +848,7 @@ function getId(){
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfClienteContactos') ?>',
data: {
id_cliente: getId(),
id_cliente: id,
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
@ -1019,11 +1012,11 @@ function getId(){
editorPrecios.on( 'preSubmit', function ( e, d, type ) {
if ( type === 'create'){
d.data[0]['cliente_id'] = getId();
d.data[0]['cliente_id'] = id;
}
else if(type === 'edit' ) {
for (v in d.data){
d.data[v]['cliente_id'] = getId();
d.data[v]['cliente_id'] = id;
}
}
});
@ -1083,7 +1076,7 @@ function getId(){
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfClienteprecios') ?>',
data: {
cliente_id: getId(),
cliente_id: id,
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
@ -1373,7 +1366,7 @@ var tableDirecciones = $('#tableOfDireccionesEnvio').DataTable( {
ajax : $.fn.dataTable.pipeline( {
url: '<?= route_to('dataTableOfClienteDirecciones') ?>',
data: function ( d ) {
d.cliente_id = getId();
d.cliente_id = id;
},
method: 'POST',
headers: {'X-Requested-With': 'XMLHttpRequest'},
@ -1468,7 +1461,7 @@ function delete_direccion_envio(dataId){
<?=$this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.min.css') ?>">
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-bs5/datatables.bootstrap5.css") ?>">
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-bs5/dataTables.bootstrap5.min.css") ?>">
<?=$this->endSection() ?>
<?= $this->section('additionalExternalJs') ?>