Trabajando

This commit is contained in:
Jaime Jimenez
2023-08-16 19:44:00 +02:00
parent 3b84839fc0
commit d8afcf9c32
9 changed files with 158 additions and 87 deletions

View File

@ -27,6 +27,26 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceControl
{
protected static $controllerSlug = 'tarifaencuadernaciontiradas';
protected $modelName = TarifaEncuadernacionTiradaModel::class;
protected $format = 'json';
protected static $singularObjectName = 'Tarifa Encuadernacion Tirada';
protected static $singularObjectNameCc = 'tarifaEncuadernacionTirada';
protected static $pluralObjectName = 'Tarifa Encuadernacion Tiradas';
protected static $pluralObjectNameCc = 'tarifaEncuadernacionTiradas';
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
{
// Se indica que este controlador trabaja con soft_delete
$this->soft_delete = true;
// Se indica el flag para los ficheros borrados
$this->delete_flag = 1;
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
parent::initController($request, $response, $logger);
}
public function datatable_editor()
{
if ($this->request->isAJAX()) {
@ -50,14 +70,11 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceControl
->validator('Validate::notEmpty', array(
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required'))
),
Field::inst('proveedor')
->options( Options::inst()
->table( 'lg_proveedores' )
->value( 'id' )
->label( 'nombre' )
),
Field::inst('proveedor_id')
->validator('Validate::notEmpty', array(
'message' => lang('TarifaAcabadoLineas.validation.paginas_max.required'))
),
Field::inst('tarifa_encuadernacion_id'),
Field::inst('proveedor_id'),
Field::inst('user_created_id'),
Field::inst('created_at'),
Field::inst('user_updated_id'),
@ -161,9 +178,10 @@ class Tarifaencuadernaciontiradas extends \App\Controllers\GoBaseResourceControl
$tipoId = $provTipoModel->getTipoId("Encuadernacion");
$provList = $provModel->getProvList($tipoId);
$newTokenHash = csrf_hash();
$csrfTokenName = csrf_token();
$data = [
'data' => $provList,
$csrfTokenName => $newTokenHash