Compare commits
6 Commits
24877f51af
...
a8404841c4
Author | SHA1 | Date | |
---|---|---|---|
a8404841c4 | |||
59ea833841 | |||
2726a00502 | |||
db01c1296c | |||
e25eff2d49 | |||
a38e63add9 |
33
migrations/Version20241205035323.php
Normal file
33
migrations/Version20241205035323.php
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
final class Version20241205035323 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('CREATE TABLE referral_source (id BINARY(16) NOT NULL COMMENT \'(DC2Type:uuid)\', agency VARCHAR(10) NOT NULL, name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, phone VARCHAR(15) DEFAULT NULL, county VARCHAR(100) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
|
||||
$this->addSql('ALTER TABLE member_case DROP hours, DROP end_date, DROP referral_number, CHANGE country county VARCHAR(45) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('DROP TABLE referral_source');
|
||||
$this->addSql('ALTER TABLE member_case ADD hours DOUBLE PRECISION NOT NULL, ADD end_date DATE NOT NULL, ADD referral_number VARCHAR(45) NOT NULL, CHANGE county country VARCHAR(45) DEFAULT NULL');
|
||||
}
|
||||
}
|
120
src/Controller/ReferralSourceController.php
Normal file
120
src/Controller/ReferralSourceController.php
Normal file
@ -0,0 +1,120 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\ReferralSource;
|
||||
use App\Entity\User;
|
||||
use App\Form\ReferralSourceFormType;
|
||||
use App\Libs\NavList;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\CurrentUser;
|
||||
|
||||
class ReferralSourceController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navList = []
|
||||
) {
|
||||
$this->navList = NavList::LIST;
|
||||
}
|
||||
|
||||
#[Route('/list-referral-sources', name: 'app_referral_source')]
|
||||
public function listReferralSources(#[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->navList['referral_sources'] = 'nav-link text-white active bg-gradient-dark';
|
||||
|
||||
$sources = $this->entityManager->getRepository(ReferralSource::class)->retrieveOrderedList();
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/referral_source/list-referral-sources.html.twig',
|
||||
array_merge(
|
||||
$this->navList,
|
||||
[
|
||||
'sources' => $sources,
|
||||
'notifications' => $user->retrieveUnreadNotifications(),
|
||||
'breadcrumbs' => [
|
||||
'Referral Sources'
|
||||
]
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/add-source', name: 'app_add_source')]
|
||||
public function addSource(Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->navList['referral_sources'] = 'nav-link text-white active bg-gradient-dark';
|
||||
|
||||
$rs = new ReferralSource();
|
||||
$form = $this->createForm(ReferralSourceFormType::class, $rs);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$rs = $form->getData();
|
||||
|
||||
$this->entityManager->persist($rs);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_referral_source');
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/referral_source/add-source.html.twig',
|
||||
array_merge(
|
||||
$this->navList,
|
||||
[
|
||||
'form' => $form,
|
||||
'notifications' => $user->retrieveUnreadNotifications(),
|
||||
'breadcrumbs' => [
|
||||
'Referral Sources',
|
||||
'Add Source'
|
||||
]
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/edit-source/{id}', name: 'app_edit_source')]
|
||||
public function editSource(Request $request, #[CurrentUser()] User $user, string $id): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->navList['referral_sources'] = 'nav-link text-white active bg-gradient-dark';
|
||||
|
||||
$rs = $this->entityManager->getRepository(ReferralSource::class)->find($id);
|
||||
|
||||
$form = $this->createForm(ReferralSourceFormType::class, $rs);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$rs = $form->getData();
|
||||
|
||||
$this->entityManager->persist($rs);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_referral_source');
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/referral_source/edit-source.html.twig',
|
||||
array_merge(
|
||||
$this->navList,
|
||||
[
|
||||
'form' => $form,
|
||||
'notifications' => $user->retrieveUnreadNotifications(),
|
||||
'breadcrumbs' => [
|
||||
'Referral Sources',
|
||||
'Edit Source'
|
||||
]
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
98
src/Entity/ReferralSource.php
Normal file
98
src/Entity/ReferralSource.php
Normal file
@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\ReferralSourceRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Types\UuidType;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ReferralSourceRepository::class)]
|
||||
class ReferralSource
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: UuidType::NAME, unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $id = null;
|
||||
|
||||
#[ORM\Column(length: 10)]
|
||||
private ?string $agency = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $email = null;
|
||||
|
||||
#[ORM\Column(length: 15, nullable: true)]
|
||||
private ?string $phone = null;
|
||||
|
||||
#[ORM\Column(length: 100, nullable: true)]
|
||||
private ?string $county = null;
|
||||
|
||||
public function getId(): ?Uuid
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getAgency(): ?string
|
||||
{
|
||||
return $this->agency;
|
||||
}
|
||||
|
||||
public function setAgency(string $agency): static
|
||||
{
|
||||
$this->agency = $agency;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPhone(): ?string
|
||||
{
|
||||
return $this->phone;
|
||||
}
|
||||
|
||||
public function setPhone(?string $phone): static
|
||||
{
|
||||
$this->phone = $phone;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCounty(): ?string
|
||||
{
|
||||
return $this->county;
|
||||
}
|
||||
|
||||
public function setCounty(?string $county): static
|
||||
{
|
||||
$this->county = $county;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
29
src/Form/ReferralSourceFormType.php
Normal file
29
src/Form/ReferralSourceFormType.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\ReferralSource;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class ReferralSourceFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('agency')
|
||||
->add('name')
|
||||
->add('email')
|
||||
->add('phone')
|
||||
->add('county')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => ReferralSource::class,
|
||||
]);
|
||||
}
|
||||
}
|
17
src/Libs/NavList.php
Normal file
17
src/Libs/NavList.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Libs;
|
||||
|
||||
class NavList
|
||||
{
|
||||
public const LIST = [
|
||||
'admin_dashboard' => 'nav-link text-dark',
|
||||
'user_dashboard' => 'nav-link text-dark',
|
||||
'profile' => 'nav-link text-dark',
|
||||
'user_list' => 'nav-link text-dark',
|
||||
'staff_dashboard' => 'nav-link text-dark',
|
||||
'case_list' => 'nav-link text-dark',
|
||||
'add_user' => 'nav-link text-dark',
|
||||
'referral_sources' => 'nav-link text-dark',
|
||||
];
|
||||
}
|
52
src/Repository/ReferralSourceRepository.php
Normal file
52
src/Repository/ReferralSourceRepository.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\ReferralSource;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<ReferralSource>
|
||||
*/
|
||||
class ReferralSourceRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, ReferralSource::class);
|
||||
}
|
||||
|
||||
public function retrieveOrderedList(): array
|
||||
{
|
||||
return $this->createQueryBuilder('r')
|
||||
->orderBy('r.name', 'ASC')
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return ReferralSource[] Returns an array of ReferralSource objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('r.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?ReferralSource
|
||||
// {
|
||||
// return $this->createQueryBuilder('r')
|
||||
// ->andWhere('r.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Add Referral Source
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||
|
||||
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||
|
||||
<section>
|
||||
<div class='page-header min-vh-100'>
|
||||
<div class='container'>
|
||||
<div class="row">
|
||||
<div class="col-6 d-lg-flex d-none h-100 my-auto pe-0 position-absolute top-0 start-0 text-center justify-content-center flex-column">
|
||||
<div class="position-relative bg-gradient-primary h-100 m-3 px-7 border-radius-lg d-flex flex-column justify-content-center" style="background-image: url('/assets/img/illustrations/illustration-signup.jpg'); background-size: cover;"></div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-5 col-md-7 d-flex flex-column ms-auto me-auto ms-lg-auto me-lg-5">
|
||||
<div class="card card-plain">
|
||||
<div class="card-header">
|
||||
<h4 class="font-weight-bolder">Add Referral Source</h4>
|
||||
<p class="mb-0">Add a source of receiving referrals</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ form_errors(form) }}
|
||||
|
||||
{{ form_start(form) }}
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='ref_src_name' class='form-label'>Name</label>
|
||||
<input type='text' name='{{ field_name(form.name) }}' id='ref_src_name' placeholder='' class='form-control' required='required'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='ref_src_agency' class='form-label'>Agency</label>
|
||||
<input type='text' name='{{ field_name(form.agency) }}' id='ref_src_agency' placeholder='' class='form-control' required='required'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='ref_src_email' class='form-label'>Email</label>
|
||||
<input type='email' name='{{ field_name(form.email) }}' id='ref_src_email' placeholder='' class='form-control' required='required'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='ref_src_phone' class='form-label'>Phone</label>
|
||||
<input type='phone' name='{{ field_name(form.phone) }}' id='ref_src_phone' placeholder='' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='ref_src_county' class='form-label'>County</label>
|
||||
<input type='text' name='{{ field_name(form.county) }}' id='ref_src_county' placeholder='' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='text-center'>
|
||||
<button type='submit' class='btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0'>Add Source</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
{% endblock %}
|
@ -0,0 +1,66 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Referral Source
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||
|
||||
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||
|
||||
<section>
|
||||
<div class='page-header min-vh-100'>
|
||||
<div class='container'>
|
||||
<div class="row">
|
||||
<div class="col-6 d-lg-flex d-none h-100 my-auto pe-0 position-absolute top-0 start-0 text-center justify-content-center flex-column">
|
||||
<div class="position-relative bg-gradient-primary h-100 m-3 px-7 border-radius-lg d-flex flex-column justify-content-center" style="background-image: url('/assets/img/illustrations/illustration-signup.jpg'); background-size: cover;"></div>
|
||||
</div>
|
||||
<div class="col-xl-4 col-lg-5 col-md-7 d-flex flex-column ms-auto me-auto ms-lg-auto me-lg-5">
|
||||
<div class="card card-plain">
|
||||
<div class="card-header">
|
||||
<h4 class="font-weight-bolder">Add Referral Source</h4>
|
||||
<p class="mb-0">Add a source of receiving referrals</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ form_errors(form) }}
|
||||
|
||||
{{ form_start(form) }}
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='ref_src_name' class='form-label'>Name</label>
|
||||
<input type='text' name='{{ field_name(form.name) }}' value='{{ field_value(form.name) }}' id='ref_src_name' class='form-control' required='required'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='ref_src_agency' class='form-label'>Agency</label>
|
||||
<input type='text' name='{{ field_name(form.agency) }}' value='{{ field_value(form.agency) }}' id='ref_src_agency' class='form-control' required='required'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='ref_src_email' class='form-label'>Email</label>
|
||||
<input type='email' name='{{ field_name(form.email) }}' value='{{ field_value(form.email) }}' id='ref_src_email' class='form-control' required='required'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3 {% if field_value(form.phone) %}is-filled{% endif %}'>
|
||||
<label for='ref_src_phone' class='form-label'>Phone</label>
|
||||
<input type='phone' name='{{ field_name(form.phone) }}' value='{{ field_value(form.phone) }}' id='ref_src_phone' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='ref_src_county' class='form-label'>County</label>
|
||||
<input type='text' name='{{ field_name(form.county) }}' value='{{ field_value(form.county) }}' id='ref_src_county' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='text-center'>
|
||||
<button type='submit' class='btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0'>Save Source</button>
|
||||
</div>
|
||||
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
{% endblock %}
|
@ -0,0 +1,78 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Referral Source List
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||
|
||||
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||
|
||||
<div class="container-fluid py-2">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card my-4">
|
||||
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
|
||||
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
|
||||
<div>
|
||||
<h6 class="text-white text-capitalize ps-3">Referral Source List</h6>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('/index.php/add-source', '_self')">Add Source</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body px-0 pb-2">
|
||||
<div class="table-responsive p-0">
|
||||
<table class="table align-items-center mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Name</th>
|
||||
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">Agency</th>
|
||||
<th class='text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>County</th>
|
||||
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Phone</th>
|
||||
<th class="text-secondary opacity-7"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for src in sources %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class='d-flex px-2 py-1'>
|
||||
<div>
|
||||
<img src='' class='avatar avatar-sm me-3 border-radius-large' alt='{{ src.name }}'>
|
||||
</div>
|
||||
<div class='d-flex flex-column justify-content-center'>
|
||||
<h6 class='mb-0 text-small'>{{ src.name }}</h6>
|
||||
<p class='text-xs text-secondary mb-0'>
|
||||
<a href='mailto:{{ src.email }}'>{{ src.email }}</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class='text-xs font-weight-bold mb-0'>{{ src.agency }}</p>
|
||||
</td>
|
||||
<td>
|
||||
<p class='text-xs font-weight-bold mb-0'>{{ src.county }}</p>
|
||||
</td>
|
||||
<td class='align-middle text-center text-xs'>
|
||||
{{ src.phone }}
|
||||
</td>
|
||||
<td class='align-middle'>
|
||||
<a href='/index.php/edit-source/{{ src.id }}' class='text-secondary font-weight-bold text-xs' data-toggle='tooltip' data-original-title='Edit Source'>Edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
{% endblock %}
|
@ -40,13 +40,26 @@
|
||||
<input type="password" name="{{ field_name(form.password) }}" id='user_form_password' placeholder="" class="form-control" required="required"/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='user_form_job' class='form-label'>Job</label>
|
||||
<select name='{{ field_name(form.job) }}' id='user_form_job' class='form-control'>
|
||||
<option value=''></option>
|
||||
{% for jt in enum('App\\Enums\\JobType').cases() %}
|
||||
<option value='{{ jt.value }}'>{{ jt.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class='row justify-content-center flex-column'>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.caseWorker) }}' id='user_form_job_CASE_WORKER' value='CASE_WORKER'/>
|
||||
<label for='user_form_job_CASE_WORKER'>Case Worker</label><br/>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.therapist) }}' id='user_form_job_THERAPIST' value='THERAPIST'/>
|
||||
<label for='user_form_job_THERAPIST'>Therapist</label><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row justify-content-center flex-column'>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.caseManager) }}' id='user_form_job_CASE_MANAGER' value='CASE_MANAGER'/>
|
||||
<label for='user_form_job_CASE_MANAGER'>Case Manager</label>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.su) }}' id='user_form_job_ADMIN' value='THERAPIST'/>
|
||||
<label for='user_form_job_ADMIN'>Admin</label><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='user_form_level' class='form-label'>Level</label>
|
||||
|
@ -30,15 +30,27 @@
|
||||
<label for="user_form_email" class="form-label">Email</label>
|
||||
<input type="email" name="{{ field_name(form.email) }}" value='{{ field_value(form.email) }}' class="form-control" required="required"/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='user_form_job' class='form-label'>Job</label>
|
||||
<select name='{{ field_name(form.job) }}' id='user_form_job' class='form-control'>
|
||||
<option value=''></option>
|
||||
{% for j in enum('App\\Enums\\JobType').cases() %}
|
||||
{% set selected = (j.value == data.job.value) %}
|
||||
<option value='{{ j.value }}' {% if selected %} selected="true" {% endif %}>{{ j.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<div class='row justify-content-center flex-column'>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.caseWorker) }}' id='user_form_job_CASE_WORKER' value='CASE_WORKER' {% if is_granted('ROLE_CASE_WORKER') %} checked="checked" {% endif %}/>
|
||||
<label for='user_form_job_CASE_WORKER'>Case Worker</label><br/>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.therapist) }}' id='user_form_job_THERAPIST' value='THERAPIST' {% if is_granted('ROLE_THERAPIST') %} checked="checked" {% endif %}/>
|
||||
<label for='user_form_job_THERAPIST'>Therapist</label><br/>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row justify-content-center flex-column'>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.caseManager) }}' id='user_form_job_CASE_MANAGER' value='CASE_MANAGER' {% if is_granted('ROLE_CASE_MANAGER') %} checked="checked" {% endif %}/>
|
||||
<label for='user_form_job_CASE_MANAGER'>Case Manager</label>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<input type='checkbox' name='{{ field_name(form.su) }}' id='user_form_job_ADMIN' value='ADMIN' {% if is_granted('ROLE_ADMIN') %} checked="checked" {% endif %}/>
|
||||
<label for='user_form_job_ADMIN'>Admin</label><br/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='user_form_level' class='form-label'>Level</label>
|
||||
|
@ -11,8 +11,13 @@
|
||||
<div class="col-12">
|
||||
<div class="card my-4">
|
||||
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
|
||||
<div class="bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3">
|
||||
<h6 class="text-white text-capitalize ps-3">User List</h6>
|
||||
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
|
||||
<div>
|
||||
<h6 class="text-white text-capitalize ps-3">User List</h6>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('/index.php/add-user', '_self')">Add User</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body px-0 pb-2">
|
||||
@ -44,7 +49,7 @@
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<p class='text-xs font-weight-bold mb-0'>{{ user.job.value|lower|capitalize }}</p>
|
||||
<p class='text-xs font-weight-bold mb-0'>{{ user.getJobs()|join(', ') }}</p>
|
||||
</td>
|
||||
<td class='align-middle text-center text-xs'>
|
||||
{{ user.userCases|length }}
|
||||
|
45
templates/internal/cases/case-list.html.twig
Normal file
45
templates/internal/cases/case-list.html.twig
Normal file
@ -0,0 +1,45 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||
|
||||
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||
{{ block('topnav', 'internal/libs/top-nav.html.twig') }}
|
||||
|
||||
<div class="container-fluid py-2">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card my-4">
|
||||
<div class="card-header p-0 position-relative mt-n4 mx-3 z-index-2">
|
||||
<div class="d-flex justify-content-between bg-gradient-dark shadow-dark border-radius-lg pt-4 pb-3 ps-3 p-2">
|
||||
<div>
|
||||
<h6 class="text-white text-capitalize ps-3">Case List</h6>
|
||||
</div>
|
||||
<div>
|
||||
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('/index.php/add-case', '_self')">Add Case</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body px-0 pb-2">
|
||||
<div class="table-responsive p-0">
|
||||
<table class="table align-items-center mb-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Name</th>
|
||||
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">Case #</th>
|
||||
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Referral #</th>
|
||||
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Hours Rem</th>
|
||||
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">End Date</th>
|
||||
<th class="text-secondary opacity-7"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
@ -16,16 +16,28 @@
|
||||
<hr class="horizontal dark mt-0 mb-2">
|
||||
<div class="collapse navbar-collapse w-auto " id="sidenav-collapse-main">
|
||||
<ul class="navbar-nav">
|
||||
{% if app.user.job.name == 'ADMIN' %}
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<li class='nav-item'>
|
||||
<a class="{{ admin_dashboard }}" href="/index.php/admin-dashboard">
|
||||
<i class="material-symbols-rounded opacity-5">dashboard</i>
|
||||
<span class="nav-link-text ms-1">Admin Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class='nav-item'>
|
||||
<a class='{{ case_list }}' href='/index.php/list-cases'>
|
||||
<i class='material-symbols-rounded opacity-5'>cases</i>
|
||||
<span class='nav-link-text ms-1'>Case List</span>
|
||||
</a>
|
||||
</li>
|
||||
<li clas='nav-item'>
|
||||
<a class='{{ referral_sources }}' href='/index.php/list-referral-sources'>
|
||||
<i class='material-symbols-rounded opacity-5'>groups</i>
|
||||
<span class='nav-link-text ms-1'>Referral Sources</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if app.user.job.name == 'CASE_MANAGER' %}
|
||||
{% if is_granted('ROLE_CASE_MANAGER') %}
|
||||
<li class='nav-item'>
|
||||
<a class='{{ staff_dashboard }}' href='/index.php/staff-dashboard'>
|
||||
<i class='material-symbols-rounded opacity-5'>dashboard</i>
|
||||
@ -40,32 +52,6 @@
|
||||
<span class="nav-link-text ms-1">Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
{#
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="../pages/tables.html">
|
||||
<i class="material-symbols-rounded opacity-5">table_view</i>
|
||||
<span class="nav-link-text ms-1">Tables</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="../pages/billing.html">
|
||||
<i class="material-symbols-rounded opacity-5">receipt_long</i>
|
||||
<span class="nav-link-text ms-1">Billing</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="../pages/virtual-reality.html">
|
||||
<i class="material-symbols-rounded opacity-5">view_in_ar</i>
|
||||
<span class="nav-link-text ms-1">Virtual Reality</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link text-dark" href="../pages/notifications.html">
|
||||
<i class="material-symbols-rounded opacity-5">notifications</i>
|
||||
<span class="nav-link-text ms-1">Notifications</span>
|
||||
</a>
|
||||
</li>
|
||||
#}
|
||||
<li class="nav-item mt-3">
|
||||
<h6 class="ps-4 ms-2 text-uppercase text-xs text-dark font-weight-bolder opacity-5">Account pages</h6>
|
||||
</li>
|
||||
@ -75,19 +61,13 @@
|
||||
<span class="nav-link-text ms-1">Profile</span>
|
||||
</a>
|
||||
</li>
|
||||
{% if app.user.job.value == 'ADMIN' %}
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<li class="nav-item">
|
||||
<a class="{{ user_list }}" href="/index.php/list-users">
|
||||
<i class="material-symbols-rounded opacity-5">assignment</i>
|
||||
<span class="nav-link-text ms-1">User List</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class='nav-item'>
|
||||
<a class='text-dark nav-link' href='/index.php/add-user'>
|
||||
<i class='material-symbols-rounded opacity-5'>person</i>
|
||||
<span class='nav-link-text ms-1'>Add User</span>
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class='nav-item'>
|
||||
<a class='text-dark nav-link' href='/index.php/logout'>
|
||||
|
@ -9,26 +9,8 @@
|
||||
<input type="text" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<ul
|
||||
class="navbar-nav d-flex align-items-center justify-content-end">
|
||||
{#
|
||||
<li class="nav-item d-flex align-items-center">
|
||||
<a class="btn btn-outline-primary btn-sm mb-0 me-3" target="_blank" href="https://www.creative-tim.com/builder?ref=navbar-material-dashboard">Online Builder</a>
|
||||
</li>
|
||||
<li class="mt-1">
|
||||
<a class="github-button" href="https://github.com/creativetimofficial/material-dashboard" data-icon="octicon-star" data-size="large" data-show-count="true" aria-label="Star creativetimofficial/material-dashboard on GitHub">Star</a>
|
||||
</li>
|
||||
<li class="nav-item d-xl-none ps-3 d-flex align-items-center">
|
||||
<a href="javascript:;" class="nav-link text-body p-0" id="iconNavbarSidenav">
|
||||
<div class="sidenav-toggler-inner">
|
||||
<i class="sidenav-toggler-line"></i>
|
||||
<i class="sidenav-toggler-line"></i>
|
||||
<i class="sidenav-toggler-line"></i>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
#}
|
||||
{% if app.user.job.name == 'ADMIN' %}
|
||||
<ul class="navbar-nav d-flex align-items-center justify-content-end">
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<li class="nav-item px-3 d-flex align-items-center" title="Site Settings">
|
||||
<a href="javascript:;" class="nav-link text-body p-0">
|
||||
<i class="material-symbols-rounded fixed-plugin-button-nav">settings</i>
|
||||
@ -62,76 +44,6 @@
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
{#
|
||||
<li class="mb-2">
|
||||
<a class="dropdown-item border-radius-md" href="javascript:;">
|
||||
<div class="d-flex py-1">
|
||||
<div class="my-auto">
|
||||
<img src="../assets/img/team-2.jpg" class="avatar avatar-sm me-3 ">
|
||||
</div>
|
||||
<div class="d-flex flex-column justify-content-center">
|
||||
<h6 class="text-sm font-weight-normal mb-1">
|
||||
<span class="font-weight-bold">New message</span>
|
||||
from Laur
|
||||
</h6>
|
||||
<p class="text-xs text-secondary mb-0">
|
||||
<i class="fa fa-clock me-1"></i>
|
||||
13 minutes ago
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="mb-2">
|
||||
<a class="dropdown-item border-radius-md" href="javascript:;">
|
||||
<div class="d-flex py-1">
|
||||
<div class="my-auto">
|
||||
<img src="../assets/img/small-logos/logo-spotify.svg" class="avatar avatar-sm bg-gradient-dark me-3 ">
|
||||
</div>
|
||||
<div class="d-flex flex-column justify-content-center">
|
||||
<h6 class="text-sm font-weight-normal mb-1">
|
||||
<span class="font-weight-bold">New album</span>
|
||||
by Travis Scott
|
||||
</h6>
|
||||
<p class="text-xs text-secondary mb-0">
|
||||
<i class="fa fa-clock me-1"></i>
|
||||
1 day
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="dropdown-item border-radius-md" href="javascript:;">
|
||||
<div class="d-flex py-1">
|
||||
<div class="avatar avatar-sm bg-gradient-secondary me-3 my-auto">
|
||||
<svg width="12px" height="12px" viewbox="0 0 43 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>credit-card</title>
|
||||
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(-2169.000000, -745.000000)" fill="#FFFFFF" fill-rule="nonzero">
|
||||
<g transform="translate(1716.000000, 291.000000)">
|
||||
<g transform="translate(453.000000, 454.000000)">
|
||||
<path class="color-background" d="M43,10.7482083 L43,3.58333333 C43,1.60354167 41.3964583,0 39.4166667,0 L3.58333333,0 C1.60354167,0 0,1.60354167 0,3.58333333 L0,10.7482083 L43,10.7482083 Z" opacity="0.593633743"></path>
|
||||
<path class="color-background" d="M0,16.125 L0,32.25 C0,34.2297917 1.60354167,35.8333333 3.58333333,35.8333333 L39.4166667,35.8333333 C41.3964583,35.8333333 43,34.2297917 43,32.25 L43,16.125 L0,16.125 Z M19.7083333,26.875 L7.16666667,26.875 L7.16666667,23.2916667 L19.7083333,23.2916667 L19.7083333,26.875 Z M35.8333333,26.875 L28.6666667,26.875 L28.6666667,23.2916667 L35.8333333,23.2916667 L35.8333333,26.875 Z"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
<div class="d-flex flex-column justify-content-center">
|
||||
<h6 class="text-sm font-weight-normal mb-1">
|
||||
Payment successfully completed
|
||||
</h6>
|
||||
<p class="text-xs text-secondary mb-0">
|
||||
<i class="fa fa-clock me-1"></i>
|
||||
2 days
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
#}
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item d-flex align-items-center" title="Profile">
|
||||
|
Loading…
Reference in New Issue
Block a user