mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado añadir usuarios y fechas a pedidos. añadido inaplazable. color en rojo en fechas cuando inaplazable
This commit is contained in:
@ -211,6 +211,8 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
|
||||
public function update($id = null){
|
||||
|
||||
$data = [];
|
||||
|
||||
if ($this->request->isAJAX()) {
|
||||
$newTokenHash = csrf_hash();
|
||||
$csrfTokenName = csrf_token();
|
||||
@ -242,6 +244,14 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
|
||||
$sanitizedData = $this->sanitized($postData, $nullIfEmpty);
|
||||
|
||||
foreach(array_keys($sanitizedData) as $key){
|
||||
if(str_starts_with($key, "fecha_")){
|
||||
$sanitizedData[$key . "_change_user_id"] =
|
||||
auth()->user()->id;
|
||||
$data[$key . "_change_user"] =
|
||||
model('App\Models\Usuarios\UserModel')->getFullName(auth()->user()->id);
|
||||
}
|
||||
}
|
||||
// JJO
|
||||
$sanitizedData['user_updated_id'] = auth()->user()->id;
|
||||
|
||||
@ -268,10 +278,9 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
$id = $pedidoEntity->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
$data = [
|
||||
'error' => 0,
|
||||
$csrfTokenName => $newTokenHash
|
||||
];
|
||||
$data['error'] = 0;
|
||||
$data[$csrfTokenName] = $newTokenHash;
|
||||
|
||||
return $this->respond($data);
|
||||
|
||||
endif; // $noException && $successfulResult
|
||||
@ -303,7 +312,15 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
|
||||
$this->obtenerDatosFormulario($pedidoEntity);
|
||||
|
||||
|
||||
$pedidoEntity->fecha_entrega_real_change_user = $pedidoEntity->fecha_entrega_real_change_user_id?model('App\Models\Usuarios\UserModel')->
|
||||
getFullName($pedidoEntity->fecha_entrega_real_change_user_id):"";
|
||||
$pedidoEntity->fecha_impresion_change_user = $pedidoEntity->fecha_impresion_change_user_id?model('App\Models\Usuarios\UserModel')->
|
||||
getFullName($pedidoEntity->fecha_impresion_change_user_id):"";
|
||||
$pedidoEntity->fecha_encuadernado_change_user = $pedidoEntity->fecha_encuadernado_change_user_id?model('App\Models\Usuarios\UserModel')->
|
||||
getFullName($pedidoEntity->fecha_encuadernado_change_user_id):"";
|
||||
$pedidoEntity->fecha_entrega_change_externo_user = $pedidoEntity->fecha_entrega_change_externo_user_id?model('App\Models\Usuarios\UserModel')->
|
||||
getFullName($pedidoEntity->fecha_entrega_change_externo_user_id):"";
|
||||
|
||||
$this->viewData['pedidoEntity'] = $pedidoEntity;
|
||||
|
||||
if($pedidoEntity->estado == 'validacion'){
|
||||
@ -321,6 +338,7 @@ class Pedido extends \App\Controllers\BaseResourceController
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Pedidos.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||
|
||||
|
||||
return $this->displayForm(__METHOD__, $id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user