mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Trabajando
This commit is contained in:
@ -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
|
||||
|
||||
@ -8,6 +8,9 @@ use App\Models\Collection;
|
||||
use App\Entities\Tarifas\TarifaEncuadernacionEntity;
|
||||
|
||||
use App\Models\Tarifas\TarifaEncuadernacionModel;
|
||||
use App\Models\Compras\ProveedorModel;
|
||||
use App\Models\Compras\ProveedorTipoModel;
|
||||
|
||||
|
||||
class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController
|
||||
{
|
||||
@ -210,6 +213,8 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('Tarifaencuadernacion.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||
|
||||
//JJO
|
||||
$this->viewData['proveedores'] = $this->getProveedores();
|
||||
|
||||
return $this->displayForm(__METHOD__, $id);
|
||||
} // end function edit(...)
|
||||
@ -293,4 +298,11 @@ class Tarifasencuadernacion extends \App\Controllers\GoBaseResourceController
|
||||
}
|
||||
}
|
||||
|
||||
private function getProveedores(){
|
||||
$provTipoModel = new ProveedorTipoModel();
|
||||
$provModel = new ProveedorModel();
|
||||
|
||||
$tipoId = $provTipoModel->getTipoId("Encuadernacion");
|
||||
return $provModel->getProvList($tipoId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user