mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Terminada exposicion de tablas ubicacion y series
This commit is contained in:
@ -2,13 +2,13 @@
|
||||
|
||||
use App\Controllers\BaseResourceController;
|
||||
use App\Models\Collection;
|
||||
use App\Entities\Configuracion\UbicacionesEntity;
|
||||
use App\Models\Configuracion\UbicacionesModel;
|
||||
use App\Entities\Configuracion\SeriesFacturasEntity;
|
||||
use App\Models\Configuracion\SeriesFacturasModel;
|
||||
|
||||
class SeriesFacturas extends BaseResourceController
|
||||
{
|
||||
|
||||
protected $modelName = UbicacionesModel::class;
|
||||
protected $modelName = SeriesFacturasModel::class;
|
||||
protected $format = 'json';
|
||||
|
||||
protected static $singularObjectName = 'Series Facturas';
|
||||
@ -31,7 +31,7 @@ class SeriesFacturas extends BaseResourceController
|
||||
// Breadcrumbs (IMN)
|
||||
$this->viewData['breadcrumb'] = [
|
||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
||||
['title' => lang("App.menu_ubicaciones"), 'route' => route_to('seriesFacturasList'), 'active' => true]
|
||||
['title' => lang("App.menu_series_facturas"), 'route' => route_to('seriesFacturasList'), 'active' => true]
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
@ -44,14 +44,14 @@ class SeriesFacturas extends BaseResourceController
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('SeriesFacturas.moduleTitle')]),
|
||||
'ubicacionesEntity' => new UbicacionesEntity(),
|
||||
'seriesFacturasEntity' => new SeriesFacturasEntity(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
];
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
return view(static::$viewPath . 'viewUbicacionesList', $viewData);
|
||||
return view(static::$viewPath . 'viewSeriesFacturasList', $viewData);
|
||||
}
|
||||
|
||||
|
||||
@ -101,7 +101,7 @@ class SeriesFacturas extends BaseResourceController
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['ubicacionesEntity'] = isset($sanitizedData) ? new UbicacionesEntity($sanitizedData) : new UbicacionesEntity();
|
||||
$this->viewData['seriesFacturasEntity'] = isset($sanitizedData) ? new SeriesFacturasEntity($sanitizedData) : new SeriesFacturasEntity();
|
||||
$this->viewData['formAction'] = route_to('seriesFacturasAdd');
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||
|
||||
@ -116,9 +116,9 @@ class SeriesFacturas extends BaseResourceController
|
||||
return $this->redirect2listView();
|
||||
endif;
|
||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||
$ubicacionesEntity = $this->model->find($id);
|
||||
$seriesFacturasEntity = $this->model->find($id);
|
||||
|
||||
if ($ubicacionesEntity == false) :
|
||||
if ($seriesFacturasEntity == false) :
|
||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('SeriesFacturas.moduleTitle')), $id]);
|
||||
return $this->redirect2listView('sweet-error', $message);
|
||||
endif;
|
||||
@ -148,11 +148,11 @@ class SeriesFacturas extends BaseResourceController
|
||||
|
||||
endif;
|
||||
|
||||
$ubicacionesEntity->fill($sanitizedData);
|
||||
$seriesFacturasEntity->fill($sanitizedData);
|
||||
$thenRedirect = false;
|
||||
endif;
|
||||
if ($noException && $successfulResult) :
|
||||
$id = $ubicacionesEntity->id ?? $id;
|
||||
$id = $seriesFacturasEntity->id ?? $id;
|
||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect) :
|
||||
@ -168,7 +168,7 @@ class SeriesFacturas extends BaseResourceController
|
||||
endif; // $noException && $successfulResult
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['ubicacionesEntity'] = $ubicacionesEntity;
|
||||
$this->viewData['seriesFacturasEntity'] = $seriesFacturasEntity;
|
||||
$this->viewData['formAction'] = route_to('seriesFacturasEdit', $id);
|
||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||
|
||||
@ -189,7 +189,7 @@ class SeriesFacturas extends BaseResourceController
|
||||
$length = $reqData['length'] ?? 5;
|
||||
$search = $reqData['search']['value'];
|
||||
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||
$order = UbicacionesModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
|
||||
$order = SeriesFacturasModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
|
||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||
|
||||
Reference in New Issue
Block a user