mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
todo ok a falta de los servicios por defecto
This commit is contained in:
@ -47,7 +47,6 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
public function initController(\CodeIgniter\HTTP\RequestInterface $request, \CodeIgniter\HTTP\ResponseInterface $response, \Psr\Log\LoggerInterface $logger)
|
||||
{
|
||||
|
||||
//$this->viewData['pageTitle'] = lang('Presupuestos.moduleTitleCosidoTB');
|
||||
$this->viewData['usingSweetAlert'] = true;
|
||||
|
||||
// Se indica que este controlador trabaja con soft_delete
|
||||
@ -57,14 +56,6 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
$this->viewData = ['usingServerSideDataTable' => true]; // JJO
|
||||
|
||||
$this->viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Presupuestos.presupuesto')]),
|
||||
'presupuestoEntity' => new PresupuestoEntity(),
|
||||
'usingServerSideDataTable' => true,
|
||||
|
||||
];
|
||||
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->model = new PresupuestoModel();
|
||||
}
|
||||
@ -73,20 +64,24 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
public function list($tipo_impresion_id = 4)
|
||||
{
|
||||
|
||||
|
||||
// Se pasa a la vista el tipo de presupuesto
|
||||
$viewData['tipo_impresion_id'] = $tipo_impresion_id;
|
||||
$viewData = [
|
||||
'currentModule' => static::$controllerSlug,
|
||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('Presupuestos.presupuesto')]),
|
||||
'presupuestoEntity' => new PresupuestoEntity(),
|
||||
'usingServerSideDataTable' => true,
|
||||
'tipo_impresion_id' => $tipo_impresion_id
|
||||
];
|
||||
|
||||
$viewData = array_merge($viewData, $this->getStringsFromTipoImpresion($tipo_impresion_id));
|
||||
|
||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||
|
||||
|
||||
return view(static::$viewPath . 'viewCosidotapablandaList', $viewData);
|
||||
}
|
||||
|
||||
|
||||
public function add($tipo_impresion_id = 4)
|
||||
public function add($tipo_impresion_id = null)
|
||||
{
|
||||
|
||||
// JJO
|
||||
@ -143,8 +138,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
|
||||
endif; // ($requestMethod === 'post')
|
||||
|
||||
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||
$this->viewData['presupuestoEntity'] = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
|
||||
$this->viewData['tipo_impresion_id'] = $tipo_impresion_id; // Cosido tapa blanda JJO
|
||||
$presupuestoEntity = isset($sanitizedData) ? new PresupuestoEntity($sanitizedData) : new PresupuestoEntity();
|
||||
$this->viewData['presupuestoEntity'] = $presupuestoEntity;
|
||||
$this->viewData['isCosido'] = (new TipoPresupuestoModel())->get_isCosido($this->viewData['tipo_impresion_id']);
|
||||
|
||||
$this->viewData['clienteList'] = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
|
||||
@ -356,7 +352,9 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
'fajaColor' => 16,
|
||||
];
|
||||
|
||||
$this->viewData['tipo_impresion_id'] = 4; // Cosido tapa blanda JJO
|
||||
$this->viewData['tipo_impresion_id'] = $presupuestoEntity->tipo_impresion_id; // Cosido tapa blanda JJO
|
||||
|
||||
$this->viewData = array_merge($this->viewData, $this->getStringsFromTipoImpresion($presupuestoEntity->tipo_impresion_id));
|
||||
|
||||
$this->viewData['formAction'] = route_to('updateCosidotapablanda', $id);
|
||||
|
||||
@ -397,13 +395,13 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
$dir3 = $reqData['order']['0']['dir'] ?? 'asc';
|
||||
|
||||
// por defecto, se deja cosido tapa blanda por ahora JJO
|
||||
$tipo_presupuesto_id = $reqData['tipo_presupuesto_id'] ?? 4;
|
||||
$tipo_impresion_id = $reqData['tipo_impresion_id'] ?? 4;
|
||||
|
||||
if (is_null($type)) {
|
||||
|
||||
$searchValues = get_filter_datatables_columns($reqData);
|
||||
|
||||
$resourceData = $this->model->getResource($searchValues, $tipo_presupuesto_id)->orderBy($order1, $dir1)->orderBy($order2, $dir2)
|
||||
$resourceData = $this->model->getResource($searchValues, $tipo_impresion_id)->orderBy($order1, $dir1)->orderBy($order2, $dir2)
|
||||
->orderBy($order3, $dir3)->limit($length, $start)->get()->getResultObject();
|
||||
foreach ($resourceData as $item) :
|
||||
if (isset($item->comentarios_pdf) && strlen($item->comentarios_pdf) > 100) :
|
||||
@ -455,7 +453,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
|
||||
'ancho' => intval($reqData['ancho']) ?? 100000,
|
||||
'alto' => intval($reqData['alto']) ?? 100000,
|
||||
'a_favor_fibra' => $reqData['a_favor_fibra'] ?? 1,
|
||||
'isCosido' => true, // JJO esto es custom por cada tipo de presupuesto
|
||||
'isCosido' => (new TipoPresupuestoModel())->get_isCosido($tipo_impresion_id), // JJO esto es custom por cada tipo de presupuesto
|
||||
);
|
||||
|
||||
$papel_generico = [
|
||||
|
||||
Reference in New Issue
Block a user