mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
arreglados bugs en plantillas cliente
This commit is contained in:
@ -120,6 +120,26 @@ class Clienteplantillaprecioslineas extends \App\Controllers\BaseResourceControl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function getStoredRows()
|
||||
{
|
||||
if ($this->request->isAJAX()) {
|
||||
$reqData = $this->request->getPost();
|
||||
$plantilla_id = $reqData['plantilla_id'] ?? 0;
|
||||
|
||||
$resourceData = $this->model->getResource([], $plantilla_id);
|
||||
$resourceData = $resourceData->get()->getResultObject();
|
||||
|
||||
return $this->respond(Collection::datatable(
|
||||
$resourceData,
|
||||
$this->model->getResource([], $plantilla_id)->countAllResults(),
|
||||
$this->model->getResource([], $plantilla_id)->countAllResults()
|
||||
));
|
||||
} else {
|
||||
return $this->failUnauthorized('Invalid request', 403);
|
||||
}
|
||||
}
|
||||
|
||||
public function datatable_editor() {
|
||||
if ($this->request->isAJAX()) {
|
||||
|
||||
@ -178,26 +198,6 @@ class Clienteplantillaprecioslineas extends \App\Controllers\BaseResourceControl
|
||||
),
|
||||
|
||||
)
|
||||
->validator(function ($editor, $action, $data) {
|
||||
if ($action === Editor::ACTION_CREATE || $action === Editor::ACTION_EDIT) {
|
||||
foreach ($data['data'] as $pkey => $values) {
|
||||
// Si no se quiere borrar...
|
||||
if ($data['data'][$pkey]['is_deleted'] != 1) {
|
||||
$process_data['tiempo_min'] = $data['data'][$pkey]['tiempo_min'];
|
||||
$process_data['tiempo_max'] = $data['data'][$pkey]['tiempo_max'];
|
||||
$process_data['tipo'] = $data['data'][$pkey]['tipo'];
|
||||
$process_data['tipo_maquina'] = $data['data'][$pkey]['tipo_maquina'];
|
||||
$process_data['tipo_impresion'] = $data['data'][$pkey]['tipo_impresion'];
|
||||
|
||||
$response = $this->model->checkIntervals($process_data, $pkey, $data['data'][$pkey]['plantilla_id']);
|
||||
// No se pueden duplicar valores al crear o al editar
|
||||
if (!empty($response)) {
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
->on('preCreate', function ($editor, &$values) {
|
||||
$datetime = (new \CodeIgniter\I18n\Time("now"));
|
||||
$editor
|
||||
|
||||
Reference in New Issue
Block a user