1
0

Permitir reenviar solicitud cuando fue rechazada

Dieser Commit ist enthalten in:
Sergio 2022-08-26 09:30:17 -05:00
Ursprung 3e24477d40
Commit c2bcf96a8d
10 geänderte Dateien mit 55 neuen und 28 gelöschten Zeilen

@ -78,7 +78,7 @@ class Filters extends BaseConfig
* @var array
*/
public $filters = [
'inicio' => ['before' => ['/', '/horas']],
'inicio' => ['before' => ['/',]],
'formulario_inicial' => ['before' => ['registro/']]
];
}

@ -63,6 +63,9 @@ class Prestador extends BaseController
$data['id'] = user()->rh_prestador_solicitud_id;
}
// Poner status de revisión (0)
$data['status'] = 0;
// Validar datos
if (!$prestadorModel->save($data)) {
return redirect()->back()->withInput()->with('errors', $prestadorModel->errors());

@ -22,7 +22,7 @@ class FormularioInicialFilter implements FilterInterface
{
// Usuario ya contestó el formulario y fue aprobado
if (user()->idprestador) {
return redirect('/');
return redirect()->route('home');
}
}

@ -2,6 +2,7 @@
namespace App\Filters;
use App\Models\PrestadorSolicitudModel;
use App\Models\UserModel;
use CodeIgniter\Filters\FilterInterface;
use CodeIgniter\HTTP\RequestInterface;
@ -29,8 +30,14 @@ class InicioFilter implements FilterInterface
return redirect('registro');
}
// Ya registró sus datos, está pendiente la aprobación de RH
return \Config\Services::response()->setBody(view('Prestador/success'));
// Ya registr<74> sus datos, est<73> pendiente la aprobaci<63>n de RH
// Ver status de la solicitud
$status = model(PrestadorSolicitudModel::class)->find(user()->rh_prestador_solicitud_id)['status'];
if ($status == 0) // aún no ha sido aprobada
return \Config\Services::response()->setBody(view('Prestador/success'));
else if ($status == 2)
return \Config\Services::response()->setBody(view('Prestador/registroNoAprobado'));
}
}

@ -60,7 +60,7 @@ class PrestadorSolicitudModel extends Model
return $this
->where('status', 0)
->orWhere('status', 2)
->orderBy('id ASC, status DESC')
->orderBy('status ASC, id ASC')
->findAll();
}
return $this->where('id', $id)->first();

@ -21,7 +21,7 @@
<tbody>
<?php foreach ($solicitudes as $solicitud) : ?>
<tr>
<tr class="<?= $solicitud['status'] == 2 ? 'table-danger' : '' ?>">
<td><?= $solicitud['nombre'] . ' ' . $solicitud['apaterno'] . ' ' . $solicitud['amaterno'] ?></td>
<td><?= $solicitud['email'] ?></td>
<td><?= $solicitud['status'] == 0 ? 'Por aprobar' : 'Rechazada' ?></td>
@ -46,16 +46,24 @@
'searching': true,
'ordering': true,
'language': {
"decimal": "",
"emptyTable": "No hay información",
"info": "Mostrando _START_ a _END_ de _TOTAL_ registros",
"infoEmpty": "Mostrando 0 to 0 of 0 registros",
"infoFiltered": "(Filtrado de _MAX_ total registros)",
"infoPostFix": "",
"thousands": ",",
"lengthMenu": "Mostrar _MENU_ registros",
"info": "Página: _PAGE_ / _PAGES_",
"zeroRecords": "No se encontraron registros",
"loadingRecords": "Cargando...",
"processing": "Procesando...",
"search": "Buscar:",
"zeroRecords": "No se encontraron resultados",
"paginate": {
"first": "Inicio",
"last": "Fin",
"next": ">",
"previous": "<"
},
'search': 'Buscar:',
"first": "Primero",
"last": "Ultimo",
"next": "Siguiente",
"previous": "Anterior"
}
},
'order': [],
});

@ -191,9 +191,9 @@
<?php if (isset($revisar)) : ?>
<!-- BOTONES PARA APROBAR / RECHAZAR SOLICITUD-->
<div class="text-end">
<a href="" class="btn btn-primary">Regresar a lista</a>
<a href="<?= route_to('admin_solicitudes') ?>" class="btn btn-primary">Regresar a lista</a>
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#rechazarModal">
Launch demo modal
Rechazar solicitud
</button>
<a href="<?= route_to('admin_solicitud_aprobar', $id) ?>" class="btn btn-success">Aprobar solicitud</a>
</div>
@ -201,7 +201,7 @@
<!-- BOTONES PARA ENVIAR O EDITAR -->
<div class="text-end">
<?php if ($datos) : ?>
<a class="btn btn-danger me-3" href="<?= route_to('/') ?>">Cancelar</a>
<a class="btn btn-danger me-3" href="<?= route_to('home') ?>">Cancelar</a>
<?php endif ?>
<button class="btn btn-primary" type="submit"><?= !empty($datos) ? 'Actualizar' : 'Enviar' ?></button>
</div>

@ -0,0 +1,17 @@
<?= $this->extend('templates/base') ?>
<!-- title -->
<?= $this->section('title') ?>Prestador<?= $this->endSection() ?>
<!-- content -->
<?= $this->section('content') ?>
<h1>Tu solicitud no ha sido aprobada</h1>
<h5>Revisa tu correo electrónico para consultar el motivo por el que esta fue rechazada.</h5>
<h6>
Puedes
<a href="<?= route_to('registro') ?>">corregir tus datos</a>
y enviarlos nuevamente a revisión.
</h6>
<?= $this->endSection() ?>

@ -26,7 +26,7 @@ scratch. This page gets rid of all links and provides the needed markup only.
<!-- Main Sidebar Container -->
<aside class="main-sidebar sidebar-dark-primary elevation-4">
<!-- Brand Logo -->
<a href="index3.html" class="brand-link">
<a href="<?= route_to('admin_home') ?>" class="brand-link">
<img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8">
<span class="brand-text font-weight-light">COPARMEX</span>
</a>
@ -34,14 +34,6 @@ scratch. This page gets rid of all links and provides the needed markup only.
<!-- Sidebar -->
<div class="sidebar">
<!-- Sidebar user panel (optional) -->
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
<div class="image">
<img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
</div>
<div class="info">
<a href="#" class="d-block">Administrador</a>
</div>
</div>
<!-- Sidebar Menu -->
@ -49,7 +41,7 @@ scratch. This page gets rid of all links and provides the needed markup only.
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
<!-- Add icons to the links using the .nav-icon class
with font-awesome or any other icon font library -->
<li class="nav-item">
<li class="nav-item menu-open">
<a href="" class="nav-link">
<i class="nav-icon fas fa-users"></i>
Prestadores

@ -1,6 +1,6 @@
<nav class="navbar navbar-expand-lg navbar-dark bg-dark px-5">
<div class="container-fluid">
<a class="navbar-brand" href="<?= route_to('/') ?>">COPARMEX</a>
<a class="navbar-brand" href="<?= route_to('home') ?>">COPARMEX</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>