mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
subir cambios antes de update
This commit is contained in:
@ -536,6 +536,7 @@ $routes->group('presupuestocliente', ['namespace' => 'App\Controllers\Presupuest
|
|||||||
$routes->post('datatable', 'Cosidotapablanda::datatable', ['as' => 'tablaPresupuestosCliente']);
|
$routes->post('datatable', 'Cosidotapablanda::datatable', ['as' => 'tablaPresupuestosCliente']);
|
||||||
$routes->post('getgramaje', 'Presupuestocliente::getGramaje', ['as' => 'obtenerGramaje']);
|
$routes->post('getgramaje', 'Presupuestocliente::getGramaje', ['as' => 'obtenerGramaje']);
|
||||||
$routes->post('presupuesto', 'Presupuestocliente::presupuesto', ['as' => 'presupuestoCliente']);
|
$routes->post('presupuesto', 'Presupuestocliente::presupuesto', ['as' => 'presupuestoCliente']);
|
||||||
|
$routes->post('getDireccionesCliente', 'Presupuestocliente::getDireccionesCliente', ['as' => 'getDirecciones']);
|
||||||
});
|
});
|
||||||
$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
|
$routes->resource('presupuestocliente', ['namespace' => 'App\Controllers\Presupuestos', 'controller' => 'Presupuestocliente', 'except' => 'show,new,create,update']);
|
||||||
|
|
||||||
|
|||||||
@ -608,11 +608,12 @@ class Presupuestocliente extends \App\Controllers\GoBaseResourceController
|
|||||||
|
|
||||||
public function presupuesto()
|
public function presupuesto()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
if ($this->request->isAJAX()) {
|
if ($this->request->isAJAX()) {
|
||||||
$reqData = $this->request->getPost();
|
$reqData = $this->request->getPost();
|
||||||
|
|
||||||
|
$newTokenHash = csrf_hash();
|
||||||
|
$csrfTokenName = csrf_token();
|
||||||
|
|
||||||
$error =(object)[
|
$error =(object)[
|
||||||
'interior' => "",
|
'interior' => "",
|
||||||
'cubierta' => "",
|
'cubierta' => "",
|
||||||
@ -931,6 +932,7 @@ class Presupuestocliente extends \App\Controllers\GoBaseResourceController
|
|||||||
'guardas' => $guardas,
|
'guardas' => $guardas,
|
||||||
'serviciosDefecto' => $servDefecto,
|
'serviciosDefecto' => $servDefecto,
|
||||||
'servicios_automaticos' => $serviciosAutomaticos,
|
'servicios_automaticos' => $serviciosAutomaticos,
|
||||||
|
$csrfTokenName => $newTokenHash
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -940,16 +942,33 @@ class Presupuestocliente extends \App\Controllers\GoBaseResourceController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getDireccionesCliente(){
|
||||||
|
if ($this->request->isAJAX()) {
|
||||||
|
|
||||||
|
$newTokenHash = csrf_hash();
|
||||||
|
$csrfTokenName = csrf_token();
|
||||||
|
|
||||||
|
$reqData = $this->request->getPost();
|
||||||
|
$cliente_id = $reqData['id'] ?? 0;
|
||||||
|
$model = model('App\Models\Clientes\ClienteDireccionesModel');
|
||||||
|
$data = $model->getMenuDirecciones($cliente_id);
|
||||||
|
array_unshift($data, ['id' => 0, 'text' => 'Agregar nueva dirección']);
|
||||||
|
|
||||||
|
return $this->respond([
|
||||||
|
'menu'=>$data,
|
||||||
|
$csrfTokenName => $newTokenHash
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
return $this->failUnauthorized('Invalid request', 403);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************
|
/***********************
|
||||||
*
|
*
|
||||||
* Funciones auxiliares
|
* Funciones auxiliares
|
||||||
*
|
*
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected function calcular_lomo($lineas, $lomo_inicial){
|
protected function calcular_lomo($lineas, $lomo_inicial){
|
||||||
$lomo = $lomo_inicial;
|
$lomo = $lomo_inicial;
|
||||||
foreach ($lineas as $linea) {
|
foreach ($lineas as $linea) {
|
||||||
|
|||||||
@ -189,6 +189,7 @@ class LoginAuthFilter implements FilterInterface
|
|||||||
'cast',
|
'cast',
|
||||||
'getGramaje',
|
'getGramaje',
|
||||||
'presupuesto',
|
'presupuesto',
|
||||||
|
'getDireccionesCliente'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,4 +30,11 @@
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
|
||||||
|
window.routes_direcciones = {
|
||||||
|
direcciones: "<?= route_to('getDirecciones') ?>",
|
||||||
|
}
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -1,3 +1,30 @@
|
|||||||
|
function initDirecciones() {
|
||||||
|
data = {
|
||||||
|
id: $('#clienteId').val()
|
||||||
|
},
|
||||||
|
data = Object.assign(data, window.token_ajax)
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: window.routes_direcciones.direcciones,
|
||||||
|
type: 'POST',
|
||||||
|
data: data,
|
||||||
|
success: function(response) {
|
||||||
|
$("#direcciones").empty();
|
||||||
|
$.each(response.menu, function(key, value) {
|
||||||
|
$('#direcciones')
|
||||||
|
.append($('<option>', { value : key })
|
||||||
|
.text(value));
|
||||||
|
});
|
||||||
|
$('#direcciones').val();
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
$("#direcciones").empty();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function initTiradasDirecciones() {
|
function initTiradasDirecciones() {
|
||||||
const _this = this
|
const _this = this
|
||||||
|
|
||||||
@ -61,6 +88,13 @@ function updateTiradasDireccionesCheck(el) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#direcciones').on('change', function() {
|
||||||
|
if( $('#direcciones').val() == 0 ) {
|
||||||
|
console.log("Nueva direccion")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
$('#insertarDireccion').on('click', function() {
|
$('#insertarDireccion').on('click', function() {
|
||||||
//if( ('#direcciones').val() > 0 ) {
|
//if( ('#direcciones').val() > 0 ) {
|
||||||
|
|
||||||
|
|||||||
@ -208,6 +208,7 @@
|
|||||||
}
|
}
|
||||||
}).on('core.form.valid', function () {
|
}).on('core.form.valid', function () {
|
||||||
validationStepper.next();
|
validationStepper.next();
|
||||||
|
initDirecciones();
|
||||||
initTiradasDirecciones();
|
initTiradasDirecciones();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -10,11 +10,10 @@
|
|||||||
"slack": "https://codeigniterchat.slack.com"
|
"slack": "https://codeigniterchat.slack.com"
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": "^8.1",
|
"php": "^8.2",
|
||||||
"codeigniter4/framework": "^4.0",
|
"codeigniter4/framework": "^4.0",
|
||||||
"codeigniter4/shield": "^1.0",
|
"codeigniter4/shield": "^1.0",
|
||||||
"dompdf/dompdf": "^2.0",
|
"dompdf/dompdf": "^2.0"
|
||||||
//"phpoffice/phpspreadsheet": "^1.18"
|
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"fakerphp/faker": "^1.9",
|
"fakerphp/faker": "^1.9",
|
||||||
|
|||||||
36
xdebug.log
36
xdebug.log
@ -438322,3 +438322,39 @@ Stack trace:
|
|||||||
[71] [Step Debug] ERR: Could not connect to debugging client. Tried: 10.5.0.1:9003 (from REMOTE_ADDR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port).
|
[71] [Step Debug] ERR: Could not connect to debugging client. Tried: 10.5.0.1:9003 (from REMOTE_ADDR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port).
|
||||||
[71] Log closed at 2024-05-06 19:49:12.627128
|
[71] Log closed at 2024-05-06 19:49:12.627128
|
||||||
|
|
||||||
|
[22] Log opened at 2024-05-07 15:47:13.581991
|
||||||
|
[22] [Config] INFO: Control socket set up succesfully: '@xdebug-ctrl.22'
|
||||||
|
[22] [Step Debug] INFO: Checking for client discovery headers: 'HTTP_X_FORWARDED_FOR,REMOTE_ADDR'.
|
||||||
|
[22] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
|
||||||
|
[22] [Step Debug] INFO: Checking header 'REMOTE_ADDR'.
|
||||||
|
[22] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 10.5.0.1:9003.
|
||||||
|
[22] [Step Debug] WARN: Creating socket for '10.5.0.1:9003', poll success, but error: Operation now in progress (29).
|
||||||
|
[22] [Step Debug] WARN: Could not connect to client host discovered through HTTP headers, connecting to configured address/port: host.docker.internal:9003.
|
||||||
|
[22] [Step Debug] WARN: Creating socket for 'host.docker.internal:9003', getaddrinfo: Invalid argument.
|
||||||
|
[22] [Step Debug] ERR: Could not connect to debugging client. Tried: 10.5.0.1:9003 (from REMOTE_ADDR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port).
|
||||||
|
[22] Log closed at 2024-05-07 15:47:13.646557
|
||||||
|
|
||||||
|
[22] Log opened at 2024-05-07 15:47:13.889324
|
||||||
|
[22] [Config] INFO: Control socket set up succesfully: '@xdebug-ctrl.22'
|
||||||
|
[22] [Step Debug] INFO: Checking for client discovery headers: 'HTTP_X_FORWARDED_FOR,REMOTE_ADDR'.
|
||||||
|
[22] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
|
||||||
|
[22] [Step Debug] INFO: Checking header 'REMOTE_ADDR'.
|
||||||
|
[22] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 10.5.0.1:9003.
|
||||||
|
[22] [Step Debug] WARN: Creating socket for '10.5.0.1:9003', poll success, but error: Operation now in progress (29).
|
||||||
|
[22] [Step Debug] WARN: Could not connect to client host discovered through HTTP headers, connecting to configured address/port: host.docker.internal:9003.
|
||||||
|
[22] [Step Debug] WARN: Creating socket for 'host.docker.internal:9003', getaddrinfo: Invalid argument.
|
||||||
|
[22] [Step Debug] ERR: Could not connect to debugging client. Tried: 10.5.0.1:9003 (from REMOTE_ADDR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port).
|
||||||
|
[22] Log closed at 2024-05-07 15:47:13.948692
|
||||||
|
|
||||||
|
[23] Log opened at 2024-05-07 15:47:45.788281
|
||||||
|
[23] [Config] INFO: Control socket set up succesfully: '@xdebug-ctrl.23'
|
||||||
|
[23] [Step Debug] INFO: Checking for client discovery headers: 'HTTP_X_FORWARDED_FOR,REMOTE_ADDR'.
|
||||||
|
[23] [Step Debug] INFO: Checking header 'HTTP_X_FORWARDED_FOR'.
|
||||||
|
[23] [Step Debug] INFO: Checking header 'REMOTE_ADDR'.
|
||||||
|
[23] [Step Debug] INFO: Client host discovered through HTTP header, connecting to 10.5.0.1:9003.
|
||||||
|
[23] [Step Debug] WARN: Creating socket for '10.5.0.1:9003', poll success, but error: Operation now in progress (29).
|
||||||
|
[23] [Step Debug] WARN: Could not connect to client host discovered through HTTP headers, connecting to configured address/port: host.docker.internal:9003.
|
||||||
|
[23] [Step Debug] WARN: Creating socket for 'host.docker.internal:9003', getaddrinfo: Invalid argument.
|
||||||
|
[23] [Step Debug] ERR: Could not connect to debugging client. Tried: 10.5.0.1:9003 (from REMOTE_ADDR HTTP header), host.docker.internal:9003 (fallback through xdebug.client_host/xdebug.client_port).
|
||||||
|
[23] Log closed at 2024-05-07 15:47:45.851339
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user