diff --git a/ci4/app/Config/Routes.php b/ci4/app/Config/Routes.php index 09900984..270b9103 100755 --- a/ci4/app/Config/Routes.php +++ b/ci4/app/Config/Routes.php @@ -370,8 +370,8 @@ $routes->group('clienteprecios', ['namespace' => 'App\Controllers\Clientes'], fu $routes->post('datatable', 'Clienteprecios::datatable', ['as' => 'dataTableOfClienteprecios']); $routes->post('datatable_editor', 'Clienteprecios::datatable_editor', ['as' => 'editorOfClienteprecios']); }); -$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteprecios', 'except' => 'show,new,create,update']); +$routes->resource('clienteprecios', ['namespace' => 'App\Controllers\Clientes', 'controller' => 'Clienteprecios', 'except' => 'show,new,create,update']); $routes->group('clienteplantillaprecios', ['namespace' => 'App\Controllers\Clientes'], function ($routes) { $routes->get('', 'Clienteplantillaprecios::index', ['as' => 'clienteplantillapreciosList']); @@ -512,6 +512,7 @@ $routes->group('clientecontactos', ['namespace' => 'App\Controllers\Clientes'], $routes->post('(:num)/edit', 'Clientecontactos::edit/$1', ['as' => 'updateClienteContactos']); $routes->post('datatable', 'Clientecontactos::datatable', ['as' => 'dataTableOfClienteContactos']); $routes->post('datatable_editor', 'Clientecontactos::datatable_editor', ['as' => 'editorOfClienteContactos']); + $routes->get('delete/(:num)', 'Clientecontactos::delete/$1', ['as' => 'deleteClienteContactos']); $routes->post('allmenuitems', 'Clientecontactos::allItemsSelect', ['as' => 'select2ItemsOfClienteContactos']); $routes->post('menuitems', 'Clientecontactos::menuItems', ['as' => 'menuItemsOfClienteContactos']); }); diff --git a/ci4/app/Controllers/Clientes/Clientecontactos.php b/ci4/app/Controllers/Clientes/Clientecontactos.php index 3bc2f19a..7f425d01 100755 --- a/ci4/app/Controllers/Clientes/Clientecontactos.php +++ b/ci4/app/Controllers/Clientes/Clientecontactos.php @@ -60,7 +60,6 @@ class Clientecontactos extends \App\Controllers\GoBaseResourceController public function add() { - $requestMethod = $this->request->getMethod(); if ($requestMethod === 'post') : diff --git a/ci4/app/Language/es/Presupuestos.php b/ci4/app/Language/es/Presupuestos.php index 22a8ce5b..a9427ec2 100755 --- a/ci4/app/Language/es/Presupuestos.php +++ b/ci4/app/Language/es/Presupuestos.php @@ -24,6 +24,11 @@ return [ 'libroCosidoTapaDura' => "Cosido Tapa Dura", 'libroFresadoTapaBlanda' => "Fresado Tapa Blanda", 'libroFresadoTapaDura' => "Fresado Tapa Dura", + 'libroEspiralTapaDura' => "Espiral Tapa Dura", + 'libroEspiralTapaBlanda' => "Espiral Tapa Blanda", + 'libroWireoTapaDura' => "Wire-o Tapa Dura", + 'libroWireoTapaBlanda' => "Wire-o Tapa Blanda", + 'libroGrapado' => "Grapado", 'datosPresupuesto' => 'Datos generales del presupuesto', 'datosLibro' => 'Datos del libro', diff --git a/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/_clienteFormItems.php b/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/_clienteFormItems.php index 66c48389..396da491 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/_clienteFormItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/_clienteFormItems.php @@ -564,7 +564,6 @@ -
@@ -610,7 +609,6 @@
-
@@ -629,7 +627,6 @@
-
@@ -673,27 +670,6 @@ - - - - - -
- - -
- -*/ ?> - @@ -701,6 +677,12 @@ /**************************************** Funcionamiento general *****************************************/ +const url = window.location.href; +const url_parts = url.split('/'); +let id = -1; +if(url_parts[url_parts.length-2] == 'edit'){ + id = url_parts[url_parts.length-1]; +} $(document).on('click', '.btn-remove', function(e) { @@ -718,18 +700,21 @@ $(document).on('click', '.btn-remove', function(e) { } }); - endSection() ?> section("additionalInlineJs") ?> +/**************************************** + Contactos +*****************************************/ + const lastColNr = $('#tableOfClienteContactos').find("tr:first th").length - 1; const actionBtns = function(data) { return ` - + `; }; @@ -779,7 +764,6 @@ $(document).on('click', '.btn-remove', function(e) { editor.on( 'postSubmit', function ( e, json, data, action ) { - yeniden(json.); }); @@ -803,33 +787,27 @@ $(document).on('click', '.btn-remove', function(e) { ); } ); - // Delete row - $('#tableOfClienteContactos').on( 'click', 'tbody span.remove', function (e) { + $(document).on('click', '.btn-deleted', function(e) { + $(".btn-remove").attr('data-id', $(this).attr('data-id')); + }); - Swal.fire({ - title: '', - text: '', - icon: 'warning', - showCancelButton: true, - confirmButtonColor: '#3085d6', - confirmButtonText: '', - cancelButtonText: '', - cancelButtonColor: '#d33' - }) - .then((result) => { - const dataId = $(this).data('id'); - const row = $(this).closest('tr'); - if (result.value) { - editor - .create( false ) - .edit( this.parentNode, false) - .set( 'deleted_at', new Date().toISOString().slice(0, 19).replace('T', ' ') ) - .set( 'is_deleted', 1 ) - .submit(); - - } - }); + $(document).on('click', '.btn-remove', function(e) { + const dataId = $(this).attr('data-id'); + const row = $(this).closest('tr'); + if ($.isNumeric(dataId)) { + $.ajax({ + url: `/clientecontactos/delete/${dataId}`, + method: 'GET', + }).done((data, textStatus, jqXHR) => { + $('#confirm2delete').modal('toggle'); + theTable.clearPipeline(); + theTable.row($(row)).invalidate().draw(); + popSuccessAlert(data.msg ?? jqXHR.statusText); + }).fail((jqXHR, textStatus, errorThrown) => { + popErrorAlert(jqXHR.responseJSON.messages.error) + }) + } }); var theTable = $('#tableOfClienteContactos').DataTable( { diff --git a/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/viewClienteForm.php b/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/viewClienteForm.php index 6770633d..bfb3d633 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/viewClienteForm.php +++ b/ci4/app/Views/themes/backend/vuexy/form/clientes/cliente/viewClienteForm.php @@ -49,7 +49,7 @@ $('#saveForm').click(); } } - }); + }); $('#soporteId').select2({ diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php index d32bb435..1b5c671b 100644 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/buscador/viewBuscadorList.php @@ -121,6 +121,11 @@ $('#tableOfPresupuestos thead tr:eq(1) th').each(function (i) { selector.append(''); selector.append(''); selector.append(''); + selector.append(''); + selector.append(''); + selector.append(''); + selector.append(''); + selector.append(''); selector.on('change', function () { var val = $.fn.dataTable.util.escapeRegex( @@ -207,6 +212,27 @@ theTable = $('#tableOfPresupuestos').DataTable({ return ''; break; + + case "libroEspiralTapaDura": + return ''; + break; + + case "libroEspiralTapaBlanda": + return ''; + break; + + case "libroWireoTapaDura": + return ''; + break; + + case "libroWireoTapaBlanda": + return ''; + break; + + case "libroGrapado": + return ''; + break; + default: return data; // Debug break;