Compare commits
26 Commits
d85c1571e7
...
458ba42644
Author | SHA1 | Date | |
---|---|---|---|
458ba42644 | |||
6687dc1401 | |||
dc3fec7eff | |||
acee114ccf | |||
5f0ce69a47 | |||
d2f8bc7cbf | |||
b7b0c8e6c4 | |||
722954d0d0 | |||
57e002916c | |||
178f44fd2d | |||
7b4da30342 | |||
03cbbc0db6 | |||
f454888a6f | |||
dce5dcab2f | |||
75cffad2ea | |||
cd8cbcf6ba | |||
6956256341 | |||
42fcb7b2f5 | |||
351cc7c3ac | |||
e1e4c12801 | |||
6260b13df0 | |||
02fcb0cc54 | |||
2d7b7e6d12 | |||
604f693c45 | |||
be80563038 | |||
04d5e88820 |
@ -19,7 +19,7 @@ export function filterAddressesByCase() {
|
||||
addressList.innerHTML = '';
|
||||
|
||||
origin.innerHTML += '<option value="">-- Origin --</option>';
|
||||
destination.innerHTML += '<option value="0">-- Destination --</option>';
|
||||
destination.innerHTML += '<option value="">-- Destination --</option>';
|
||||
|
||||
result.forEach(a => {
|
||||
origin.innerHTML += `<option value='${a.id}'>${a.name}</option>`;
|
||||
@ -38,7 +38,7 @@ export function filterAddressesByCase() {
|
||||
<td>${a.formattedAddress}</td>
|
||||
<td class='align-middle text-center text-xs'>${a.lat}/${a.lon}</td>
|
||||
<td class='align-middle'>
|
||||
<a href='/index.php/addresses/edit/${a.id}' title='Edit Address'>
|
||||
<a href='/addresses/edit/${a.id}' class='text-secondary' title='Edit Address'>
|
||||
<i class='material-symbols-rounded opacity-5'>edit</i>
|
||||
</a>
|
||||
</td>
|
||||
@ -79,7 +79,6 @@ export function filterItineraryByCase() {
|
||||
.then(result => {
|
||||
const itineraryList = document.getElementById('itineraryList');
|
||||
itineraryList.innerHTML = '';
|
||||
console.log(result);
|
||||
|
||||
result.forEach(i => {
|
||||
itineraryList.innerHTML += `
|
||||
|
@ -21,19 +21,19 @@ export function addLocationToItinerary() {
|
||||
let caseMileage = document.getElementById('case-mileage').checked;
|
||||
let caseId = document.getElementById('case-filter').value;
|
||||
|
||||
fetch('/index.php/api/add-location-to-itinerary', {
|
||||
fetch('/api/add-location-to-itinerary', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
caseId: caseId,
|
||||
date: date,
|
||||
origin: origin,
|
||||
destination: destination,
|
||||
departure: departure,
|
||||
arrival: arrival,
|
||||
caseMileage: caseMileage,
|
||||
caseId: caseId
|
||||
caseMileage: caseMileage
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
|
32
assets/js/app/message.js
Normal file
32
assets/js/app/message.js
Normal file
@ -0,0 +1,32 @@
|
||||
export function messageSupervisor() {
|
||||
let btn = document.getElementById('message-supervisor');
|
||||
btn.setAttribute('data-bs-toggle', 'modal');
|
||||
btn.setAttribute('data-bs-target', '#message-modal');
|
||||
btn.click();
|
||||
}
|
||||
|
||||
export function openMessage() {
|
||||
let btn = document.getElementById('open-message');
|
||||
btn.setAttribute('data-bs-toggle', 'modal');
|
||||
btn.setAttribute('data-bs-target', '#message-modal');
|
||||
btn.click();
|
||||
}
|
||||
|
||||
export function sendMessage() {
|
||||
fetch('/api/send-message', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
case: document.getElementById('my-cases').value,
|
||||
message: document.getElementById('message').value
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success === true) {
|
||||
$('#close-modal').click();
|
||||
}
|
||||
});
|
||||
}
|
46
assets/js/app/notes.js
Normal file
46
assets/js/app/notes.js
Normal file
@ -0,0 +1,46 @@
|
||||
export function filterNotes()
|
||||
{
|
||||
let referralId = document.getElementById('referralList').value;
|
||||
let startDate = document.getElementById('startDate').value;
|
||||
let endDate = document.getElementById('endDate').value;
|
||||
let caseId = null;
|
||||
|
||||
if (referralId.substr(0, 5) == 'case-') {
|
||||
caseId = referralId.substr(5);
|
||||
referralId = null;
|
||||
}
|
||||
|
||||
fetch('/api/filter-notes', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({
|
||||
'referral': referralId,
|
||||
'startDate': startDate,
|
||||
'endDate': endDate,
|
||||
'case': caseId
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
const noteList = document.getElementById('note-list');
|
||||
noteList.innerHTML = '';
|
||||
|
||||
data.forEach(i => {
|
||||
noteList.innerHTML += `
|
||||
<tr>
|
||||
<td>${i.date}<br/>
|
||||
${i.startTime}-${i.endTime} (${i.duration})</td>
|
||||
<td class='text-center'>${i.location}</td>
|
||||
<td class='text-center'>${i.method}</td>
|
||||
<td'>${i.members}</td>
|
||||
<td style='text-align: right;'>
|
||||
<a href='/edit-note/${i.noteType}/${i.id}' class='text-secondary' title='Edit Note'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>`;
|
||||
})
|
||||
});
|
||||
}
|
21
assets/js/app/user.js
Normal file
21
assets/js/app/user.js
Normal file
@ -0,0 +1,21 @@
|
||||
export function createSignatureBlock() {
|
||||
pad = new SignaturePad(document.getElementById('signature_pad'));
|
||||
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
||||
canvas.width = canvas.offsetWidth * ratio;
|
||||
canvas.height = canvas.offsetHeight * ratio;
|
||||
canvas.getContext("2d").scale(ratio, ratio);
|
||||
//pad.clear(); // otherwise isEmpty() might return incorrect value
|
||||
}
|
||||
|
||||
export function clearSignatureBlock() {
|
||||
//const pad = new SignaturePad(document.getElementById('signature_pad'));
|
||||
pad.clear();
|
||||
}
|
||||
|
||||
export function saveSignatureBlock() {
|
||||
//const pad = new SignaturePad(document.getElementById('signature_pad'));
|
||||
const data = pad.toData();
|
||||
document.getElementById('signature').value = data;
|
||||
|
||||
return true;
|
||||
}
|
@ -8,3 +8,7 @@
|
||||
color: white;
|
||||
font-size: 6pt;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none !important;
|
||||
}
|
@ -2,6 +2,7 @@ twig:
|
||||
file_name_pattern: '*.twig'
|
||||
globals:
|
||||
mileage_rate: '%env(MILEAGE_RATE)%'
|
||||
company_timezone: '%env(COMPANY_TIMEZONE)%'
|
||||
|
||||
when@test:
|
||||
twig:
|
||||
|
@ -82,4 +82,10 @@ return [
|
||||
'chartjs' => [
|
||||
'version' => '0.3.24',
|
||||
],
|
||||
'signature_pad' => [
|
||||
'version' => '5.0.4',
|
||||
],
|
||||
'tinymce' => [
|
||||
'version' => '7.6.0',
|
||||
],
|
||||
];
|
||||
|
@ -2,17 +2,21 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\CompanyDocument;
|
||||
use App\Entity\Messages;
|
||||
use App\Entity\Supervision;
|
||||
use App\Entity\User;
|
||||
use App\Factory\MessageFactory;
|
||||
use App\Form\CompanyDocumentFormType;
|
||||
use App\Form\EditUserFormType;
|
||||
use App\Form\SupervisorFormType;
|
||||
use App\Form\UserFormType;
|
||||
use App\Libs\Breadcrumb;
|
||||
use App\Libs\NavList;
|
||||
use App\Libs\Libs;
|
||||
use App\Repository\UserRepository;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -28,8 +32,6 @@ class AdminController extends AbstractController
|
||||
{
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount = 0;
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private readonly UserPasswordHasherInterface $userPasswordHasher,
|
||||
@ -43,8 +45,7 @@ class AdminController extends AbstractController
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->navLinks['admin_dashboard'] = NavList::PRESENT_LINK;
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/admin-dashboard.html.twig',
|
||||
@ -55,7 +56,6 @@ class AdminController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_admin_dashboard'), 'Admin Dashboard')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -65,8 +65,7 @@ class AdminController extends AbstractController
|
||||
public function listUsers(#[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
/** @var UserRepository $repo */
|
||||
$repo = $this->entityManager->getRepository(User::class);
|
||||
@ -91,7 +90,6 @@ class AdminController extends AbstractController
|
||||
],
|
||||
'users' => $users,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -104,8 +102,7 @@ class AdminController extends AbstractController
|
||||
SluggerInterface $slugger
|
||||
): Response {
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($admin);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($admin);
|
||||
$this->msgs = Libs::getMessages($admin, $this->entityManager);
|
||||
|
||||
$user = new User();
|
||||
$form = $this->createForm(UserFormType::class, $user);
|
||||
@ -146,7 +143,7 @@ class AdminController extends AbstractController
|
||||
->setRate($form->get('rate')->getData())
|
||||
->setLevel($form->get('level')->getData())
|
||||
->setCompany($admin->getCompany())
|
||||
->setPasswordChanged(new DateTime())
|
||||
->setPasswordChanged(new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE'])))
|
||||
;
|
||||
|
||||
if ($form->get('imageName')->getData()) {
|
||||
@ -187,7 +184,6 @@ class AdminController extends AbstractController
|
||||
],
|
||||
'form' => $form,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -198,8 +194,7 @@ class AdminController extends AbstractController
|
||||
{
|
||||
/** @var UserRepository $userRepo */
|
||||
$userRepo = $this->entityManager->getRepository(User::class);
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($admin);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($admin);
|
||||
$this->msgs = Libs::getMessages($admin, $this->entityManager);
|
||||
|
||||
/** @var User $user */
|
||||
$user = $userRepo->find($id);
|
||||
@ -237,7 +232,6 @@ class AdminController extends AbstractController
|
||||
'data' => $user,
|
||||
'form' => $form,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -248,8 +242,7 @@ class AdminController extends AbstractController
|
||||
{
|
||||
/** @var UserRepository $userRepo */
|
||||
$userRepo = $this->entityManager->getRepository(User::class);
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($admin);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($admin);
|
||||
$this->msgs = Libs::getMessages($admin, $this->entityManager);
|
||||
|
||||
/** @var User $user */
|
||||
$user = $userRepo->find($id);
|
||||
@ -294,7 +287,6 @@ class AdminController extends AbstractController
|
||||
'form' => $form,
|
||||
'supervisors' => $userRepo->getCaseManagers($admin->getCompany()),
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
@ -2,14 +2,18 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\CaseDocument;
|
||||
use App\Entity\CaseLocation;
|
||||
use App\Entity\CompanyDocument;
|
||||
use App\Entity\Location;
|
||||
use App\Entity\Member;
|
||||
use App\Entity\MemberCase;
|
||||
use App\Entity\Messages;
|
||||
use App\Entity\ReferralSource;
|
||||
use App\Entity\User;
|
||||
use App\Entity\UserCase;
|
||||
use App\Factory\MessageFactory;
|
||||
use App\Form\CaseDocumentFormType;
|
||||
use App\Form\LocationFormType;
|
||||
use App\Form\MemberCaseFormType;
|
||||
use App\Form\UserCaseFormType;
|
||||
@ -32,8 +36,6 @@ class CaseController extends AbstractController
|
||||
*/
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount;
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navLinks = []
|
||||
@ -49,8 +51,7 @@ class CaseController extends AbstractController
|
||||
$this->navLinks['case_list'] = 'nav-link text-dark';
|
||||
|
||||
$ucs = $this->entityManager->getRepository(UserCase::class)->findBy(['user' => $user]);
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$cases = [];
|
||||
foreach ($ucs as $uc) {
|
||||
@ -72,7 +73,6 @@ class CaseController extends AbstractController
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'cases' => $cases,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -85,8 +85,7 @@ class CaseController extends AbstractController
|
||||
|
||||
$cases = $this->entityManager->getRepository(MemberCase::class)->findAll();
|
||||
$workers = $this->entityManager->getRepository(User::class)->getCaseWorkers();
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/cases/list-cases.html.twig',
|
||||
@ -99,24 +98,24 @@ class CaseController extends AbstractController
|
||||
'notifications' => $this->msgs,
|
||||
'cases' => $cases,
|
||||
'workers' => $workers,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/case/{caseId}', name: 'app_view_case')]
|
||||
public function showCase(Request $request, string $caseId): Response
|
||||
public function showCase(Request $request, #[CurrentUser()] User $user, string $caseId): Response
|
||||
{
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
|
||||
$caseDocs = $this->entityManager->getRepository(CaseDocument::class)->getDocumentsByCase($case);
|
||||
$compDocs = $this->entityManager->getRepository(CompanyDocument::class)->findBy(['company' => $user->getCompany()]);
|
||||
$sources = $this->entityManager->getRepository(ReferralSource::class)->findAll();
|
||||
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($this->getUser());
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($this->getUser());
|
||||
|
||||
return $this->render(
|
||||
'internal/cases/view-case.html.twig',
|
||||
@ -124,13 +123,14 @@ class CaseController extends AbstractController
|
||||
$this->navLinks,
|
||||
[
|
||||
'case' => $case,
|
||||
'caseDocs' => $caseDocs,
|
||||
'compDocs' => $compDocs,
|
||||
'sources' => $sources,
|
||||
'breadcrumbs' => [
|
||||
new Breadcrumb($this->generateUrl('app_list_cases'), 'List Cases'),
|
||||
new Breadcrumb($this->generateUrl('app_view_case', ['caseId' => $case->getId()]), 'View Case')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -141,10 +141,10 @@ class CaseController extends AbstractController
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($admin);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($admin);
|
||||
|
||||
$companyDocs = $this->entityManager->getRepository(CompanyDocument::class)->findBy(['company' => $admin->getCompany()]);
|
||||
$case = new MemberCase();
|
||||
$form = $this->createForm(MemberCaseFormType::class, $case);
|
||||
$form = $this->createForm(MemberCaseFormType::class, $case, ['docs' => $companyDocs]);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
@ -170,9 +170,9 @@ class CaseController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_add_case'), 'Add Case')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'form' => $form,
|
||||
'sources' => $this->entityManager->getRepository(ReferralSource::class)->retrieveOrderedList(),
|
||||
'docs' => $companyDocs,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -183,7 +183,6 @@ class CaseController extends AbstractController
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($admin);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($admin);
|
||||
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||
$form = $this->createForm(MemberCaseFormType::class, $case);
|
||||
@ -210,7 +209,6 @@ class CaseController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_edit_case', ['id' => $id]), 'Edit Case')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'form' => $form,
|
||||
'case' => $case,
|
||||
'sources' => $this->entityManager->getRepository(ReferralSource::class)->retrieveOrderedList(),
|
||||
@ -224,7 +222,6 @@ class CaseController extends AbstractController
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($admin);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($admin);
|
||||
|
||||
$caseWorkers = $this->entityManager->getRepository(User::class)->getCaseWorkers();
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||
@ -267,7 +264,6 @@ class CaseController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_assign_case', ['id' => $id]), 'Assign User')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'case' => $case,
|
||||
'form' => $form,
|
||||
'id' => $id,
|
||||
@ -278,13 +274,6 @@ class CaseController extends AbstractController
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/case-notes/{id}', name: 'app_case_notes')]
|
||||
public function showCaseNotes(Request $request, string $id): Response
|
||||
{
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||
return new Response();
|
||||
}
|
||||
|
||||
#[Route('/addresses/list', name: 'app_list_case_addresses')]
|
||||
public function listCaseAddresses(Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
@ -292,8 +281,7 @@ class CaseController extends AbstractController
|
||||
$this->navLinks['case_list'] = 'nav-link text-dark';
|
||||
|
||||
$addresses = $this->entityManager->getRepository(Location::class)->getUserLocations($user);
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$ucs = $this->entityManager->getRepository(UserCase::class)->findBy(['user' => $user]);
|
||||
$cases = [];
|
||||
@ -313,7 +301,6 @@ class CaseController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_list_case_addresses'), 'List Case Addresses')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'addresses' => $addresses,
|
||||
'cases' => $cases,
|
||||
]
|
||||
@ -327,8 +314,8 @@ class CaseController extends AbstractController
|
||||
$this->navLinks['case_itinerary'] = NavList::PRESENT_LINK;
|
||||
$this->navLinks['case_list'] = 'nav-link text-dark';
|
||||
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$ucs = $this->entityManager->getRepository(UserCase::class)->findBy(['user' => $user]);
|
||||
|
||||
$cases = [];
|
||||
@ -379,7 +366,6 @@ class CaseController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_case_add_address'), 'Add Case Address')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'form' => $form,
|
||||
'cases' => $cases,
|
||||
]
|
||||
@ -394,7 +380,6 @@ class CaseController extends AbstractController
|
||||
$this->navLinks['case_list'] = 'nav-link text-dark';
|
||||
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($this->getUser());
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($this->getUser());
|
||||
|
||||
$ucs = $this->entityManager->getRepository(UserCase::class)->findBy(['user' => $this->getUser()]);
|
||||
$lcs = $this->entityManager->getRepository(CaseLocation::class)->findBy(['location' => $id]);
|
||||
@ -440,12 +425,61 @@ class CaseController extends AbstractController
|
||||
'inCases' => $inCases,
|
||||
'form' => $form,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/assign-case-doc/{caseId}/{memberId}', name: 'app_assign_case_documents')]
|
||||
public function assignCaseDocument(string $caseId, string $memberId, Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
|
||||
$member = $this->entityManager->getRepository(Member::class)->find($memberId);
|
||||
$companyDocs = $this->entityManager->getRepository(CompanyDocument::class)->findBy(['company' => $user->getCompany()]);
|
||||
|
||||
$form = $this->createForm(CaseDocumentFormType::class, null, ['docs' => $companyDocs]);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$docs = $form['document']->getData();
|
||||
dd($docs);
|
||||
|
||||
$this->entityManager->persist($cd);
|
||||
$this->entityManager->flush();
|
||||
|
||||
$this->redirectToRoute('app_case_members', ['id' => $caseId]);
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'internal/cases/members/assign-document.html.twig',
|
||||
array_merge(
|
||||
$this->navLinks,
|
||||
[
|
||||
'notifications' => $this->msgs,
|
||||
'breadcrumbs' => [
|
||||
new Breadcrumb($this->generateUrl('app_dashboard'), 'Dashboard'),
|
||||
new Breadcrumb($this->generateUrl('app_list_cases'), 'List Cases'),
|
||||
new Breadcrumb($this->generateUrl('app_case_members', ['id' => $caseId]), 'Case Members')
|
||||
],
|
||||
'form' => $form,
|
||||
'case' => $case,
|
||||
'member' => $member,
|
||||
'docs' => $companyDocs,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
return new Response();
|
||||
}
|
||||
|
||||
#[Route('/sign-case-doc/{caseId}/{docId}/{memberId}', name: 'app_display_case_document')]
|
||||
public function displayCaseDocument(string $caseId, string $docId, Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
return new Response();
|
||||
}
|
||||
|
||||
#[Route('/api/filter-address-by-case/{caseId}', name: 'ajax_filter_address_by_case')]
|
||||
public function filterAddressByCase(string $caseId, Request $request): Response
|
||||
{
|
||||
@ -488,8 +522,6 @@ class CaseController extends AbstractController
|
||||
$ret[] = $uc->getMemberCase();
|
||||
}
|
||||
|
||||
dump($ret);
|
||||
die;
|
||||
return $this->json($ret);
|
||||
}
|
||||
}
|
||||
|
@ -29,8 +29,6 @@ class CommunityResourceController extends AbstractController
|
||||
*/
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount;
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private array $navLinks = []
|
||||
@ -43,8 +41,7 @@ class CommunityResourceController extends AbstractController
|
||||
public function list(#[CurrentUser()] User $user): Response
|
||||
{
|
||||
$rsc = $this->entityManager->getRepository(CommunityResource::class)->findAll();
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
return $this->render(
|
||||
'internal/community_resource/list.html.twig',
|
||||
@ -56,7 +53,6 @@ class CommunityResourceController extends AbstractController
|
||||
],
|
||||
'resources' => $rsc,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -65,8 +61,7 @@ class CommunityResourceController extends AbstractController
|
||||
#[Route('/resource/map', name: 'app_community_resource_map')]
|
||||
public function map(#[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$rcs = $this->entityManager->getRepository(CommunityResource::class)->findAll();
|
||||
|
||||
@ -81,7 +76,7 @@ class CommunityResourceController extends AbstractController
|
||||
position: new Point($rsc->getLat(), $rsc->getLon()),
|
||||
title: $rsc->getName(),
|
||||
infoWindow: new InfoWindow(
|
||||
content: "{$rsc->getName()}<br>{$rsc->getAddress()}, {$rsc->getCity()}, {$rsc->getState()->value} {$rsc->getZip()}<br>Services: " . $rsc->getServicesAvailable()
|
||||
content: $rsc->_toInfoWindow()
|
||||
),
|
||||
extra: [
|
||||
'type' => ''
|
||||
@ -100,7 +95,6 @@ class CommunityResourceController extends AbstractController
|
||||
new Breadcrumb('#', 'Community Resources')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -109,8 +103,7 @@ class CommunityResourceController extends AbstractController
|
||||
#[Route('/resource/add', name: 'app_community_resource_add')]
|
||||
public function add(#[CurrentUser()] User $user, Request $request): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$form = $this->createForm(ResourceFormType::class);
|
||||
$form->handleRequest($request);
|
||||
@ -150,7 +143,6 @@ class CommunityResourceController extends AbstractController
|
||||
new Breadcrumb('#', 'Add Resource')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -160,8 +152,7 @@ class CommunityResourceController extends AbstractController
|
||||
#[Route('/resource/edit/{id}', name: 'app_community_resource_edit')]
|
||||
public function edit(string $id, #[CurrentUser()] User $user, Request $request): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$rsc = $this->entityManager->getRepository(CommunityResource::class)->find($id);
|
||||
$form = $this->createForm(ResourceFormType::class, $rsc);
|
||||
@ -199,7 +190,6 @@ class CommunityResourceController extends AbstractController
|
||||
new Breadcrumb('#', 'Edit Resource')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
182
src/Controller/CompanyController.php
Normal file
182
src/Controller/CompanyController.php
Normal file
@ -0,0 +1,182 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Company;
|
||||
use App\Entity\CompanyDocument;
|
||||
use App\Entity\User;
|
||||
use App\Form\CompanyDocumentFormType;
|
||||
use App\Form\InternalCompanyFormType;
|
||||
use App\Libs\Breadcrumb;
|
||||
use App\Libs\NavList;
|
||||
use App\Libs\Libs;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Http\Attribute\CurrentUser;
|
||||
use Symfony\Component\Security\Http\Attribute\IsGranted;
|
||||
use Symfony\Component\String\Slugger\SluggerInterface;
|
||||
|
||||
#[IsGranted('ROLE_ADMIN')]
|
||||
class CompanyController extends AbstractController
|
||||
{
|
||||
private array $msgs;
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navLinks = []
|
||||
){
|
||||
$this->navLinks = NavList::LIST;
|
||||
}
|
||||
|
||||
#[Route('/company', name: 'app_company')]
|
||||
public function editCompanyInfo(
|
||||
#[CurrentUser()] User $user,
|
||||
Request $request,
|
||||
SluggerInterface $slugger
|
||||
): Response {
|
||||
$this->navLinks['company_nav'] = NavList::PRESENT_LINK;
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$company = $user->getCompany();
|
||||
|
||||
$form = $this->createForm(InternalCompanyFormType::class, $company);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if($form->isSubmitted() && $form->isValid()) {
|
||||
/** @var Company $company */
|
||||
$company = $form->getData();
|
||||
|
||||
if ($form->get('companyLogo')->getData()) {
|
||||
$file = $form['companyLogo']->getData();
|
||||
$destination = $this->getParameter('kernel.project_dir').'/public/uploads/company/';
|
||||
$originalFilename = pathinfo($file->getClientOriginalName(), PATHINFO_FILENAME);
|
||||
$newFilename = $slugger->slug($originalFilename).'-'.uniqid().'.'.$file->guessExtension();
|
||||
$file->move(
|
||||
$destination,
|
||||
$newFilename
|
||||
);
|
||||
|
||||
$company->setCompanyLogo($newFilename);
|
||||
}
|
||||
|
||||
$this->entityManager->flush();
|
||||
return $this->redirectToRoute('app_admin_dashboard');
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/company/company-info.html.twig',
|
||||
array_merge(
|
||||
$this->navLinks,
|
||||
[
|
||||
'form' => $form,
|
||||
'company' => $company,
|
||||
'breadcrumbs' => [
|
||||
new Breadcrumb($this->generateUrl('app_admin_dashboard'), "Admin Dashboard"),
|
||||
],
|
||||
'msgs' => $this->msgs,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/docs/list', name: 'app_list_documents')]
|
||||
public function listDocs(#[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->navLinks['company_nav'] = NavList::PRESENT_LINK;
|
||||
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$companyDocs = $this->entityManager->getRepository(CompanyDocument::class)->findBy(['company' => $user->getCompany()], ['title' => 'ASC']);
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/company/docs/list-documents.html.twig',
|
||||
array_merge(
|
||||
$this->navLinks,
|
||||
[
|
||||
'breadcrumbs' => [],
|
||||
'notifications' => $this->msgs,
|
||||
'docs' => $companyDocs,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/docs/add', name: 'app_add_doc')]
|
||||
public function addCompanyDocument(Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->navLinks['company_nav'] = NavList::PRESENT_LINK;
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$form = $this->createForm(CompanyDocumentFormType::class);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
/** @var CompanyDocument $doc */
|
||||
$doc = $form->getData();
|
||||
|
||||
$doc->setCompany($user->getCompany());
|
||||
$doc->setUpdated(new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE'])));
|
||||
|
||||
$this->entityManager->persist($doc);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_list_documents');
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/company/docs/add-document.html.twig',
|
||||
array_merge(
|
||||
$this->navLinks,
|
||||
[
|
||||
'breadcrumbs' => [],
|
||||
'notifications' => $this->msgs,
|
||||
'form' => $form,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
#[Route('/docs/edit/{docId}', name: 'app_edit_doc')]
|
||||
public function editCompanyDocument(string $docId, Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
$companyDoc = $this->entityManager->getRepository(CompanyDocument::class)->find($docId);
|
||||
|
||||
$this->navLinks['company_nav'] = NavList::PRESENT_LINK;
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$form = $this->createForm(CompanyDocumentFormType::class, $companyDoc);
|
||||
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
/** @var CompanyDocument $doc */
|
||||
$doc = $form->getData();
|
||||
|
||||
$doc->setUpdated(new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE'])));
|
||||
|
||||
$this->entityManager->persist($doc);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return $this->redirectToRoute('app_list_documents');
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'internal/admin/company/docs/edit-document.html.twig',
|
||||
array_merge(
|
||||
$this->navLinks,
|
||||
[
|
||||
'breadcrumbs' => [],
|
||||
'notifications' => $this->msgs,
|
||||
'form' => $form,
|
||||
'doc' => $companyDoc,
|
||||
'docText' => str_replace("\r\n", "", $companyDoc->getText())
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
44
src/Controller/DocumentController.php
Normal file
44
src/Controller/DocumentController.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Libs\NavList;
|
||||
use App\Libs\Libs;
|
||||
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 DocumentController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navLinks = []
|
||||
) {
|
||||
$this->navLinks = NavList::LIST;
|
||||
}
|
||||
|
||||
#[Route('/case/{caseId}/doc/{docId}', name: 'app_display_case_doc')]
|
||||
public function displayCaseDocument(string $caseId, string $docId, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
$msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
|
||||
$doc = $this->entityManager->getRepository(CompanyDocument::class)->find($docId);
|
||||
$caseDoc = $this->entityManager->getRepository(CaseDocument::class)->getCaseDocument($case, $doc);
|
||||
|
||||
return $this->render(
|
||||
'internal/cases/documents/display-case-doc.html.twig',
|
||||
array_merge(
|
||||
$this->navLinks,
|
||||
[
|
||||
'msgs' => $msgs,
|
||||
'notificationCount' => count($msgs),
|
||||
'breadcrumbs' => []
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
@ -13,6 +13,7 @@ use App\Libs\Breadcrumb;
|
||||
use App\Libs\Libs;
|
||||
use App\Libs\NavList;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -30,8 +31,6 @@ class ItineraryController extends AbstractController
|
||||
{
|
||||
private array $msgs = [];
|
||||
|
||||
private int $notificationCount = 0;
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navLinks = []
|
||||
@ -44,8 +43,7 @@ class ItineraryController extends AbstractController
|
||||
{
|
||||
$this->navLinks['case_itinerary'] = NavList::PRESENT_LINK;
|
||||
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$itineraries = $this->entityManager->getRepository(CaseItinerary::class)->getRecentTravel(
|
||||
$user
|
||||
@ -67,7 +65,6 @@ class ItineraryController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_dashboard'), 'Dashboard'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'itineraries' => $itineraries,
|
||||
'cases' => $cases
|
||||
]
|
||||
@ -84,11 +81,20 @@ class ItineraryController extends AbstractController
|
||||
if ($request->getPayload()->get('caseId')) {
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($request->getPayload()->get('caseId'));
|
||||
}
|
||||
$startDate = ($request->getPayload()->get('startDate') ?new DateTime($request->getPayload()->get('startDate')) : null);
|
||||
$endDate = ($request->getPayload()->get('endDate') ? new DateTime($request->getPayload()->get('endDate')) : null);
|
||||
$startDate = (
|
||||
$request->getPayload()->get('startDate')
|
||||
?
|
||||
new DateTime($request->getPayload()->get('startDate'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']))
|
||||
:
|
||||
null);
|
||||
$endDate = (
|
||||
$request->getPayload()->get('endDate')
|
||||
?
|
||||
new DateTime($request->getPayload()->get('endDate'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']))
|
||||
:
|
||||
null);
|
||||
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$itineraries = $this->entityManager->getRepository(CaseItinerary::class)->getRecentTravel($user, [
|
||||
'case' => $case,
|
||||
@ -113,7 +119,7 @@ class ItineraryController extends AbstractController
|
||||
),
|
||||
title: $itinerary->getOriginLocation()->getName(),
|
||||
infoWindow: new InfoWindow(
|
||||
content: $itinerary->getOriginLocation()->getName(),
|
||||
content: $itinerary->originInfoWindow(),
|
||||
)
|
||||
));
|
||||
|
||||
@ -124,7 +130,7 @@ class ItineraryController extends AbstractController
|
||||
),
|
||||
title: $itinerary->getDestLocation()->getName(),
|
||||
infoWindow: new InfoWindow(
|
||||
content: $itinerary->getDestLocation()->getName(),
|
||||
content: $itinerary->destinationInfoWindow(),
|
||||
)
|
||||
));
|
||||
|
||||
@ -155,7 +161,6 @@ class ItineraryController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_report_itinerary'), 'Itinerary Report'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'map' => $map,
|
||||
'total_distance' => $total_distance,
|
||||
'total_duration' => $di->format("%H:%i'%s''"),
|
||||
@ -188,7 +193,7 @@ class ItineraryController extends AbstractController
|
||||
$departure = $request->getPayload()->get('departure');
|
||||
$arrival = $request->getPayload()->get('arrival');
|
||||
$caseMileage = (bool) $request->getPayload()->get('caseMileage');
|
||||
$date = new DateTime($request->getPayload()->get('date'));
|
||||
$date = new DateTime($request->getPayload()->get('date'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
|
||||
$route = Libs::getRouteDistance($origin, $destination);
|
||||
|
||||
@ -234,11 +239,11 @@ class ItineraryController extends AbstractController
|
||||
}
|
||||
|
||||
if ($request->getPayload()->get('startDate')) {
|
||||
$startDate = new DateTime($request->getPayload()->get('startDate'));
|
||||
$startDate = new DateTime($request->getPayload()->get('startDate'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
}
|
||||
|
||||
if ($request->getPayload()->get('endDate')) {
|
||||
$endDate = new DateTime($request->getPayload()->get('endDate'));
|
||||
$endDate = new DateTime($request->getPayload()->get('endDate'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
}
|
||||
|
||||
$itineraries = $this->entityManager->getRepository(CaseItinerary::class)->getRecentTravel($user, [
|
||||
|
@ -8,6 +8,7 @@ use App\Entity\MemberCase;
|
||||
use App\Entity\Messages;
|
||||
use App\Form\MemberFormType;
|
||||
use App\Libs\Breadcrumb;
|
||||
use App\Libs\Libs;
|
||||
use App\Libs\NavList;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@ -25,8 +26,6 @@ class MemberController extends AbstractController
|
||||
*/
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount;
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navLinks = [],
|
||||
@ -38,8 +37,7 @@ class MemberController extends AbstractController
|
||||
#[Route('/list-members/{id}', name: 'app_case_members')]
|
||||
public function listMembers(Request $request, #[CurrentUser()] User $user, string $id): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||
$members = $this->entityManager->getRepository(Member::class)->getCaseMembersByName($case);
|
||||
@ -56,7 +54,6 @@ class MemberController extends AbstractController
|
||||
'notifications' => $this->msgs,
|
||||
'case' => $case,
|
||||
'members' => $members,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -65,8 +62,7 @@ class MemberController extends AbstractController
|
||||
#[Route('/add-member/{id}', name: 'app_case_add_member')]
|
||||
public function addMember(Request $request, #[CurrentUser()] User $user, string $id): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
/** @var MemberCase $case */
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||
@ -130,7 +126,6 @@ class MemberController extends AbstractController
|
||||
'notifications' => $this->msgs,
|
||||
'case' => $case,
|
||||
'form' => $form->createView(),
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -139,8 +134,7 @@ class MemberController extends AbstractController
|
||||
#[Route('/case/{caseId}/edit-member/{memberId}', name: 'app_case_edit_member')]
|
||||
public function editMember(Request $request, #[CurrentUser()] User $user, string $caseId, string $memberId): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$member = $this->entityManager->getRepository(Member::class)->find($memberId);
|
||||
|
||||
@ -197,7 +191,6 @@ class MemberController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_case_edit_member', ['caseId' => $caseId, 'memberId' => $memberId]), 'Edit Member'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'member' => $member,
|
||||
'form' => $form->createView(),
|
||||
'caseId' => $caseId,
|
||||
|
@ -3,13 +3,16 @@
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Messages;
|
||||
use App\Entity\Supervision;
|
||||
use App\Entity\User;
|
||||
use App\Enums\MessageType;
|
||||
use App\Libs\Libs;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\Security\Http\Attribute\CurrentUser;
|
||||
|
||||
class MessageController extends AbstractController
|
||||
{
|
||||
@ -32,4 +35,28 @@ class MessageController extends AbstractController
|
||||
'link' => $message->getLink(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/api/send-message', name: 'app_send_message')]
|
||||
public function sendMessage(Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
$sup = $this->entityManager->getRepository(Supervision::class)->getSupervisorByWorker($user);
|
||||
$data = json_decode($request->getContent(), true);
|
||||
$message = new Messages();
|
||||
$message->setSender($user);
|
||||
$message->setSent(new \DateTimeImmutable());
|
||||
$message->setRecipient($sup);
|
||||
$message->setTitle('New Message');
|
||||
$message->setMessage($data['message']);
|
||||
$message->setType(MessageType::GENERAL);
|
||||
|
||||
//dd($message);
|
||||
|
||||
$this->entityManager->persist($message);
|
||||
$this->entityManager->flush();
|
||||
|
||||
return $this->json([
|
||||
'success' => true,
|
||||
'message' => 'Message sent',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ use App\Enums\ReferralServiceType;
|
||||
use App\Form\StandardNoteFormType;
|
||||
use App\Form\VisitNoteFormType;
|
||||
use App\Libs\Breadcrumb;
|
||||
use App\Libs\Libs;
|
||||
use App\Libs\NavList;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
@ -37,8 +38,6 @@ class NoteController extends AbstractController
|
||||
*/
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount;
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navLinks = [],
|
||||
@ -47,14 +46,29 @@ class NoteController extends AbstractController
|
||||
$this->navLinks['case_notes'] = NavList::PRESENT_LINK;
|
||||
}
|
||||
|
||||
#[Route('/list-notes/', name: 'app_list_notes')]
|
||||
public function listNotes(#[CurrentUser()] User $user, Request $request): Response
|
||||
#[Route('/list-notes/{caseId?null}', name: 'app_list_notes')]
|
||||
public function listNotes(string $caseId = null, #[CurrentUser()] User $user, Request $request): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
/** @var UserCase[] $cases */
|
||||
$cases = $this->entityManager->getRepository(UserCase::class)->findBy(['user' => $user]);
|
||||
$caseNotes = null;
|
||||
$case = null;
|
||||
|
||||
if ($caseId != 'null') {
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
|
||||
$params = [
|
||||
'case' => $case,
|
||||
'referral' => null,
|
||||
'startDate' => null,
|
||||
'endDate' => null,
|
||||
];
|
||||
$caseNotes = array_merge(
|
||||
$this->entityManager->getRepository(VisitNote::class)->filterNotes($user, $params),
|
||||
$this->entityManager->getRepository(StandardNote::class)->filterNotes($user, $params),
|
||||
);
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'internal/cases/notes/list-notes.html.twig',
|
||||
@ -66,7 +80,8 @@ class NoteController extends AbstractController
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'cases' => $cases,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'caseNotes' => $caseNotes,
|
||||
'case' => $case,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -78,8 +93,7 @@ class NoteController extends AbstractController
|
||||
/** @var Referral $referral */
|
||||
$referral = $this->entityManager->getRepository(Referral::class)->find($referralId);
|
||||
$this->entityManager->getRepository(Referral::class)->populateNotes($referral);
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$members = $this->entityManager->getRepository(Member::class)->findBy(['caseId' => $referral->getMemberCase()]);
|
||||
$defaultMethod = NoteMethod::BILLABLE;
|
||||
@ -126,7 +140,6 @@ class NoteController extends AbstractController
|
||||
'form' => $form,
|
||||
'default_method' => $defaultMethod,
|
||||
'default_location' => $defaultLocation,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -135,8 +148,8 @@ class NoteController extends AbstractController
|
||||
#[Route('/edit-note/{noteType}/{noteId}', name: 'app_edit_note')]
|
||||
public function editNote(string $noteId, string $noteType, #[CurrentUser()] User $user, Request $request): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$form = null;
|
||||
|
||||
/** @var VisitNote|StandardNote $note */
|
||||
@ -159,7 +172,6 @@ class NoteController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_list_notes'), 'List Notes')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'note' => $note,
|
||||
'referral' => $note->getReferral(),
|
||||
'form' => $form,
|
||||
@ -178,11 +190,11 @@ class NoteController extends AbstractController
|
||||
$case = null;
|
||||
|
||||
if ($request->getPayload()->get('startDate')) {
|
||||
$startDate = new DateTime($request->getPayload()->get('startDate'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
$startDate = new DateTime($request->getPayload()->get('startDate'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
}
|
||||
|
||||
if ($request->getPayload()->get('endDate')) {
|
||||
$endDate = new DateTime($request->getPayload()->get('endDate'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
$endDate = new DateTime($request->getPayload()->get('endDate'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
}
|
||||
|
||||
if ($request->getPayload()->get('referral')) {
|
||||
|
@ -10,6 +10,7 @@ use App\Entity\UserCase;
|
||||
use App\Factory\MessageFactory;
|
||||
use App\Form\ReferralFormType;
|
||||
use App\Libs\Breadcrumb;
|
||||
use App\Libs\Libs;
|
||||
use App\Libs\NavList;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@ -27,8 +28,6 @@ class ReferralController extends AbstractController
|
||||
*/
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount;
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navLinks = []
|
||||
@ -44,8 +43,7 @@ class ReferralController extends AbstractController
|
||||
#[Route('/list-referrals/{id}', name: 'app_list_referrals')]
|
||||
public function listReferrals(#[CurrentUser()] User $user, string $id, Request $request): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||
$openReferrals = $this->entityManager->getRepository(Referral::class)->getActiveReferrals($case);
|
||||
@ -65,7 +63,6 @@ class ReferralController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_list_referrals', ['id' => $case->getId()]), 'Referrals'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'case' => $case,
|
||||
'openReferrals' => $openReferrals,
|
||||
'closedReferrals' => $closedReferrals,
|
||||
@ -78,8 +75,7 @@ class ReferralController extends AbstractController
|
||||
public function addReferral(Request $request, #[CurrentUser()] User $user, string $id): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted(['ROLE_ADMIN', 'ROLE_CASE_MANAGER']);
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($id);
|
||||
/** @var UserCase $uc */
|
||||
@ -114,7 +110,6 @@ class ReferralController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_case_add_referral', ['id' => $case->getId()]), 'Add Referral')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'case' => $case,
|
||||
'form' => $form,
|
||||
]
|
||||
@ -126,8 +121,7 @@ class ReferralController extends AbstractController
|
||||
public function editReferral(Request $request, #[CurrentUser()] User $user, string $caseId, string $referralId): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted(['ROLE_ADMIN', 'ROLE_CASE_MANAGER']);
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$referral = $this->entityManager->getRepository(Referral::class)->find($referralId);
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
|
||||
@ -159,7 +153,6 @@ class ReferralController extends AbstractController
|
||||
new Breadcrumb($this->generateUrl('app_case_edit_referral', ['caseId' => $case->getId(), 'referralId' => $referral->getId()]), 'Edit Referral'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'case' => $case,
|
||||
'form' => $form,
|
||||
'referral' => $referral,
|
||||
|
@ -7,6 +7,7 @@ use App\Entity\ReferralSource;
|
||||
use App\Entity\User;
|
||||
use App\Form\ReferralSourceFormType;
|
||||
use App\Libs\Breadcrumb;
|
||||
use App\Libs\Libs;
|
||||
use App\Libs\NavList;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@ -24,8 +25,6 @@ class ReferralSourceController extends AbstractController
|
||||
*/
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount;
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
private array $navList = []
|
||||
@ -38,8 +37,7 @@ class ReferralSourceController extends AbstractController
|
||||
public function listReferralSources(#[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$sources = $this->entityManager->getRepository(ReferralSource::class)->retrieveOrderedList();
|
||||
|
||||
@ -50,7 +48,6 @@ class ReferralSourceController extends AbstractController
|
||||
[
|
||||
'sources' => $sources,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'breadcrumbs' => [
|
||||
new Breadcrumb($this->generateUrl('app_referral_source'), 'Referral Sources')
|
||||
]
|
||||
@ -63,8 +60,7 @@ class ReferralSourceController extends AbstractController
|
||||
public function addSource(Request $request, #[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$rs = new ReferralSource();
|
||||
$form = $this->createForm(ReferralSourceFormType::class, $rs);
|
||||
@ -89,7 +85,6 @@ class ReferralSourceController extends AbstractController
|
||||
[
|
||||
'form' => $form,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'breadcrumbs' => [
|
||||
new Breadcrumb($this->generateUrl('app_referral_source'), 'Referral Sources'),
|
||||
new Breadcrumb($this->generateUrl('app_add_source'), 'Add Source')
|
||||
@ -103,8 +98,7 @@ class ReferralSourceController extends AbstractController
|
||||
public function editSource(Request $request, #[CurrentUser()] User $user, string $id): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('ROLE_ADMIN');
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$rs = $this->entityManager->getRepository(ReferralSource::class)->find($id);
|
||||
|
||||
@ -130,7 +124,6 @@ class ReferralSourceController extends AbstractController
|
||||
'form' => $form,
|
||||
'rs' => $rs,
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
'breadcrumbs' => [
|
||||
new Breadcrumb($this->generateUrl('app_referral_source'), 'Referral Sources'),
|
||||
new Breadcrumb($this->generateUrl('app_edit_source', ['id' => $id]), 'Edit Source')
|
||||
|
@ -12,6 +12,7 @@ use App\Factory\MessageFactory;
|
||||
use App\Form\StaffNoteFormType;
|
||||
use App\Form\SupervisorStaffNoteFormType;
|
||||
use App\Libs\Breadcrumb;
|
||||
use App\Libs\Libs;
|
||||
use App\Libs\NavList;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@ -29,8 +30,6 @@ class StaffController extends AbstractController
|
||||
*/
|
||||
private array $msgs;
|
||||
|
||||
private int $notificationCount;
|
||||
|
||||
public function __construct(
|
||||
private readonly EntityManagerInterface $entityManager,
|
||||
private array $navLinks = []
|
||||
@ -42,8 +41,7 @@ class StaffController extends AbstractController
|
||||
#[Route('/staff-dashboard', name: 'app_staff_dashboard')]
|
||||
public function staffDashboard(#[CurrentUser()] User $user): Response
|
||||
{
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$sups = $this->entityManager->getRepository(Supervision::class)->findBy(['supervisor' => $user]);
|
||||
$staff = [];
|
||||
@ -62,7 +60,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'Staff Dashboard')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -74,11 +71,11 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->navLinks['staff_dashboard'] = NavList::DEFAULT;
|
||||
$this->navLinks['staff_notes'] = NavList::PRESENT_LINK;
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$sup = $this->entityManager->getRepository(Supervision::class)->findOneBy(['worker' => $user]);
|
||||
|
||||
$ucs = $this->entityManager->getRepository(UserCase::class)->findBy(['user' => $user]);
|
||||
$cases = [];
|
||||
$this->navLinks['staff_dashboard'] = 'nav-link text-dark';
|
||||
@ -101,7 +98,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'Staff Cases')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -113,8 +109,7 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$staff = $this->entityManager->getRepository(User::class)->find($staffId);
|
||||
$ucs = $this->entityManager->getRepository(UserCase::class)->findBy(['user' => $staff]);
|
||||
@ -137,7 +132,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'Staff Cases')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -149,8 +143,9 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$this->navLinks['staff_dashboard'] = NavList::DEFAULT;
|
||||
$this->navLinks['staff_notes'] = NavList::PRESENT_LINK;
|
||||
|
||||
$isWorker = ($staffId == $user->getId()->toString());
|
||||
$staff = $this->entityManager->getRepository(User::class)->find($staffId);
|
||||
@ -179,7 +174,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'List Notes')
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -191,8 +185,9 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$this->navLinks['staff_dashboard'] = NavList::DEFAULT;
|
||||
$this->navLinks['staff_notes'] = NavList::PRESENT_LINK;
|
||||
|
||||
$case = $this->entityManager->getRepository(MemberCase::class)->find($caseId);
|
||||
$form = $this->createForm(StaffNoteFormType::class);
|
||||
@ -242,7 +237,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'Add Note'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -254,8 +248,9 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$this->navLinks['staff_dashboard'] = NavList::DEFAULT;
|
||||
$this->navLinks['staff_notes'] = NavList::PRESENT_LINK;
|
||||
|
||||
$note = $this->entityManager->getRepository(StaffNote::class)->find($noteId);
|
||||
$case = $note->getMemberCase();
|
||||
@ -289,7 +284,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'Edit Note'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -301,8 +295,9 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$this->navLinks['staff_dashboard'] = NavList::DEFAULT;
|
||||
$this->navLinks['staff_notes'] = NavList::PRESENT_LINK;
|
||||
|
||||
$note = $this->entityManager->getRepository(StaffNote::class)->find($noteId);
|
||||
$case = $note->getMemberCase();
|
||||
@ -340,7 +335,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'Sign Note'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -352,8 +346,7 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
|
||||
$note = $this->entityManager->getRepository(StaffNote::class)->find($noteId);
|
||||
$case = $note->getMemberCase();
|
||||
@ -392,7 +385,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'Sign Note'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
@ -404,8 +396,9 @@ class StaffController extends AbstractController
|
||||
if (!$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||||
return $this->redirectToRoute('app_login');
|
||||
}
|
||||
$this->msgs = $this->entityManager->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
$this->notificationCount = $this->entityManager->getRepository(Messages::class)->getUnreadMessageCount($user);
|
||||
$this->msgs = Libs::getMessages($user, $this->entityManager);
|
||||
$this->navLinks['staff_dashboard'] = NavList::DEFAULT;
|
||||
$this->navLinks['staff_notes'] = NavList::PRESENT_LINK;
|
||||
|
||||
$note = $this->entityManager->getRepository(StaffNote::class)->find($noteId);
|
||||
|
||||
@ -421,7 +414,6 @@ class StaffController extends AbstractController
|
||||
new Breadcrumb('', 'View Note'),
|
||||
],
|
||||
'notifications' => $this->msgs,
|
||||
'notificationCount' => $this->notificationCount,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
@ -6,6 +6,7 @@ use App\Entity\MemberCase;
|
||||
use App\Entity\StaffNote;
|
||||
use App\Enums\ReferralServiceType;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
@ -24,7 +25,7 @@ class StaffNoteFixture extends Fixture implements DependentFixtureInterface
|
||||
foreach ($cases as $case) {
|
||||
/** @var MemberCase $case */
|
||||
$note = new StaffNote();
|
||||
$admitDate = new DateTime($case->getAdmitDate()?->format('Y-m-d').' '.$gen->time('H:i:s'));
|
||||
$admitDate = new DateTime($case->getAdmitDate()?->format('Y-m-d').' '.$gen->time('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
$admitDate->add(\DateInterval::createFromDateString('7 day'));
|
||||
$note->setDate($admitDate);
|
||||
$note->setMemberCase($case);
|
||||
|
@ -191,4 +191,22 @@ class CaseItinerary
|
||||
}
|
||||
return $points;
|
||||
}
|
||||
|
||||
public function originInfoWindow(): string
|
||||
{
|
||||
return <<<EOL
|
||||
{$this->originLocation->getName()}<br/>
|
||||
<a href='http://maps.google.com/?q={$this->originLocation->getLat()},{$this->originLocation->getLon()}'>{$this->originLocation->getFormattedAddress()}</a><br/>
|
||||
{$this->departure->format("g:i a")}
|
||||
EOL;
|
||||
}
|
||||
|
||||
public function destinationInfoWindow(): string
|
||||
{
|
||||
return <<<EOL
|
||||
{$this->destLocation->getName()}<br/>
|
||||
<a href='http://maps.google.com/?q={$this->destLocation->getLat()},{$this->destLocation->getLon()}'>{$this->destLocation->getFormattedAddress()}</a><br/>
|
||||
{$this->arrival->format("g:i a")}
|
||||
EOL;
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ namespace App\Entity;
|
||||
use App\Enums\County;
|
||||
use App\Enums\ResourceType;
|
||||
use App\Enums\State;
|
||||
use App\Libs\Libs;
|
||||
use App\Repository\CommunityResourceRepository;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
@ -258,7 +259,7 @@ class CommunityResource
|
||||
|
||||
public function getContactCard(): ?string
|
||||
{
|
||||
$formattedPhone = ($this->phone ? '(' . substr($this->phone, 0, 3) . ') ' . substr($this->phone, 3, 3) . '-' . substr($this->phone, 6) : '');
|
||||
$formattedPhone = ($this->phone ? Libs::formatPhone($this->phone) : '');
|
||||
return ($this->email ? "<a href='mailto:$this->email'>$this->email</a><br/>" : '') .
|
||||
($this->phone ? "<a href='tel:$this->phone'>$formattedPhone</a>" : '');
|
||||
}
|
||||
@ -309,8 +310,8 @@ class CommunityResource
|
||||
return 'C';
|
||||
}
|
||||
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->monClose->format('H:i:s'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
if ($closeAt <= new DateTime()) {
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->monClose->format('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
if ($closeAt <= new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']))) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
@ -347,8 +348,8 @@ class CommunityResource
|
||||
return 'C';
|
||||
}
|
||||
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->tueClose->format('H:i:s'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
if ($closeAt <= new DateTime()) {
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->tueClose->format('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
if ($closeAt <= new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']))) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
@ -385,9 +386,8 @@ class CommunityResource
|
||||
return 'C';
|
||||
}
|
||||
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->wedClose->format('H:i:s'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
|
||||
if ($closeAt <= new DateTime("now", new DateTimeZone('America/Indiana/Indianapolis'))) {
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->wedClose->format('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
if ($closeAt <= new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']))) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
@ -424,8 +424,8 @@ class CommunityResource
|
||||
return 'C';
|
||||
}
|
||||
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->thuClose->format('H:i:s'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
if ($closeAt <= new DateTime()) {
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->thuClose->format('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
if ($closeAt <= new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']))) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
@ -462,8 +462,8 @@ class CommunityResource
|
||||
return 'C';
|
||||
}
|
||||
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->friClose->format('H:i:s'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
if ($closeAt <= new DateTime()) {
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->friClose->format('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
if ($closeAt <= new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']))) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
@ -500,8 +500,8 @@ class CommunityResource
|
||||
return 'C';
|
||||
}
|
||||
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->satClose->format('H:i:s'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
if ($closeAt <= new DateTime()) {
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->satClose->format('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
if ($closeAt <= new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']))) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
@ -538,8 +538,8 @@ class CommunityResource
|
||||
return 'C';
|
||||
}
|
||||
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->sunClose->format('H:i:s'), new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
if ($closeAt <= new DateTime()) {
|
||||
$closeAt = new DateTime($this->today->format('Y-m-d') . ' ' . $this->sunClose->format('H:i:s'), new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
if ($closeAt <= new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']))) {
|
||||
return 'C';
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ class CommunityResource
|
||||
|
||||
public function getHours(): ?string
|
||||
{
|
||||
$this->today = new DateTime('now', new DateTimeZone('America/Indiana/Indianapolis'));
|
||||
$this->today = new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
switch ($this->today->format('w')) {
|
||||
case 0:
|
||||
return $this->sun();
|
||||
@ -672,4 +672,15 @@ class CommunityResource
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function _toInfoWindow(): string
|
||||
{
|
||||
return <<<EOL
|
||||
{$this->name}<br/>
|
||||
<a href='http://maps.google.com/?q={$this->lat},{$this->lon}'>{$this->address}<br/>
|
||||
{$this->city}, {$this->state->value} {$this->zip}</a><br/>
|
||||
{$this->servicesAvailable}<br/>
|
||||
{$this->getContactCard()}
|
||||
EOL;
|
||||
}
|
||||
}
|
||||
|
@ -5,9 +5,12 @@ namespace App\Entity;
|
||||
use App\Repository\CompanyRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Types\UuidType;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
use Vich\UploaderBundle\Entity\File;
|
||||
use Vich\UploaderBundle\Mapping\Annotation as Vich;
|
||||
|
||||
#[ORM\Entity(repositoryClass: CompanyRepository::class)]
|
||||
class Company
|
||||
@ -42,6 +45,12 @@ class Company
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $url = null;
|
||||
|
||||
#[Vich\UploadableField(mapping: 'profile_image', fileNameProperty: 'imageName', size: 'size', mimeType: 'mimeType', originalName: 'originalName', dimensions: 'dimensions')]
|
||||
private ?File $imageFile = null;
|
||||
|
||||
#[ORM\Column(type: Types::STRING, length: 255, nullable: true)]
|
||||
private ?string $companyLogo = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, User>
|
||||
*/
|
||||
@ -200,6 +209,30 @@ class Company
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getImageFile(): ?File
|
||||
{
|
||||
return $this->imageFile;
|
||||
}
|
||||
|
||||
public function setImageFile(?File $imageFile): static
|
||||
{
|
||||
$this->imageFile = $imageFile;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCompanyLogo(): ?string
|
||||
{
|
||||
return $this->companyLogo;
|
||||
}
|
||||
|
||||
public function setCompanyLogo(?string $companyLogo): static
|
||||
{
|
||||
$this->companyLogo = $companyLogo;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function __toString(): string
|
||||
{
|
||||
$url = ($this->url ? "<br/><a href='$this->url' target='_blank'>$this->url</a>" : '');
|
||||
|
@ -98,6 +98,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
#[ORM\Column(length: 15)]
|
||||
private ?string $workPhone = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $signature = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->userCases = new ArrayCollection();
|
||||
@ -439,4 +442,16 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function getSignature(): ?string
|
||||
{
|
||||
return $this->signature;
|
||||
}
|
||||
|
||||
public function setSignature(?string $signature): static
|
||||
{
|
||||
$this->signature = $signature;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
19
src/Enums/DocumentExtras.php
Normal file
19
src/Enums/DocumentExtras.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum DocumentExtras: int
|
||||
{
|
||||
case CLIENT_NAME = 0;
|
||||
case CLIENT_SIGNATURE = 1;
|
||||
case NAMES = 2;
|
||||
case EMAIL = 3;
|
||||
case PHONE = 4;
|
||||
case RELATIONSHIP = 5;
|
||||
case DATE = 6;
|
||||
case EVENT_DETAILS = 7;
|
||||
case ACTION_TAKEN = 8;
|
||||
case COMMENTS = 9;
|
||||
case PROVIDER_NAME = 10;
|
||||
case PROVIDER_SIGNATURE = 11;
|
||||
}
|
38
src/Form/CaseDocumentFormType.php
Normal file
38
src/Form/CaseDocumentFormType.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\CaseDocument;
|
||||
use App\Entity\CompanyDocument;
|
||||
use App\Entity\Member;
|
||||
use App\Entity\User;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EnumType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CaseDocumentFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$docs = $options['docs'];
|
||||
$builder
|
||||
->add('document', EntityType::class, [
|
||||
'class' => CompanyDocument::class,
|
||||
'choices' => $docs,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
'choice_label' => 'title',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => CaseDocument::class,
|
||||
'docs' => [],
|
||||
]);
|
||||
}
|
||||
}
|
36
src/Form/CompanyDocumentFormType.php
Normal file
36
src/Form/CompanyDocumentFormType.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Enums\DocumentExtras;
|
||||
use App\Entity\Company;
|
||||
use App\Entity\CompanyDocument;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EnumType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CompanyDocumentFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('title')
|
||||
->add('text', TextareaType::class)
|
||||
->add('extras', EnumType::class, [
|
||||
'class' => DocumentExtras::class,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => CompanyDocument::class,
|
||||
]);
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ namespace App\Form;
|
||||
use App\DataTransferObject\CompanyDetailsDto;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@ -43,6 +44,7 @@ class CompanyFormType extends AbstractType
|
||||
'required' => true
|
||||
])
|
||||
->add('url', UrlType::class)
|
||||
->add('companyLogo', FileType::class)
|
||||
;
|
||||
}
|
||||
|
||||
|
51
src/Form/InternalCompanyFormType.php
Normal file
51
src/Form/InternalCompanyFormType.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Company;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class InternalCompanyFormType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TextType::class, [
|
||||
'required' => true,
|
||||
'attr' => [
|
||||
'placeholder' => 'Company Name',
|
||||
'class' => 'form-control',
|
||||
'autofocus' => true,
|
||||
'autocomplete' => 'off'
|
||||
]
|
||||
])
|
||||
->add('address', TextType::class)
|
||||
->add('city', TextType::class)
|
||||
->add('state', TextType::class)
|
||||
->add('zip', TextType::class)
|
||||
->add('phone', TextType::class)
|
||||
->add('email', EmailType::class)
|
||||
->add('url', UrlType::class, ['required' => false])
|
||||
->add('companyLogo', FileType::class, [
|
||||
'required' => false,
|
||||
'mapped' => false
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Company::class,
|
||||
'csrf_protection' => true,
|
||||
'csrf_field_name' => '_token',
|
||||
'csrf_token_id' => 'company',
|
||||
]);
|
||||
}
|
||||
}
|
@ -2,12 +2,14 @@
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\CompanyDocument;
|
||||
use App\Entity\MemberCase;
|
||||
use App\Entity\ReferralSource;
|
||||
use App\Enums\CaseLevel;
|
||||
use App\Enums\County;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EnumType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@ -60,6 +62,11 @@ class MemberCaseFormType extends AbstractType
|
||||
->add('county', EnumType::class, [
|
||||
'class' => County::class,
|
||||
])
|
||||
->add('docs', ChoiceType::class, [
|
||||
'data_class' => CompanyDocument::class,
|
||||
'multiple' => true,
|
||||
'expanded' => true,
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
@ -67,6 +74,7 @@ class MemberCaseFormType extends AbstractType
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => MemberCase::class,
|
||||
'docs' => [],
|
||||
'csrf_protection' => true,
|
||||
'csrf_field_name' => '_token',
|
||||
'csrf_token_id' => 'member_case',
|
||||
|
@ -3,8 +3,13 @@
|
||||
namespace App\Libs;
|
||||
|
||||
use App\Entity\Location;
|
||||
use App\Entity\Messages;
|
||||
use App\Entity\User;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class Libs
|
||||
class Libs extends AbstractController
|
||||
{
|
||||
public static function getLatLonFromGeoapify($address): ?array
|
||||
{
|
||||
@ -61,6 +66,27 @@ class Libs
|
||||
return null;
|
||||
}
|
||||
|
||||
#[Route('/api/autocomplete-address/{searchText}', name: 'app_api_autocomplete_address')]
|
||||
public function autocompleteAddress(string $searchText): Response
|
||||
{
|
||||
$params = [
|
||||
'text' => $searchText,
|
||||
'format' => 'json',
|
||||
'apiKey' => $_ENV['GEOAPIFY_API_KEY']
|
||||
];
|
||||
|
||||
$url = "https://api.geoapify.com/v1/autocomplete?".http_build_query($params);
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
|
||||
return AbstractController::json($result);
|
||||
}
|
||||
|
||||
public static function Phone(string $phone): string
|
||||
{
|
||||
$phone = preg_replace('/[^0-9]/', '', $phone);
|
||||
@ -69,4 +95,17 @@ class Libs
|
||||
}
|
||||
return $phone;
|
||||
}
|
||||
|
||||
public static function formatPhone(string $phone): string
|
||||
{
|
||||
$phone = self::Phone($phone);
|
||||
return "(".substr($phone, 0, 3).") ".substr($phone, 3, 3)."-".substr($phone, 6);
|
||||
}
|
||||
|
||||
public static function getMessages(User $user, EntityManagerInterface $em): array
|
||||
{
|
||||
$msgs = $em->getRepository(Messages::class)->getUnreadMessages($user);
|
||||
|
||||
return $msgs;
|
||||
}
|
||||
}
|
||||
|
@ -4,20 +4,23 @@ namespace App\Libs;
|
||||
|
||||
class NavList
|
||||
{
|
||||
public const DEFAULT = 'nav-link text-dark';
|
||||
|
||||
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',
|
||||
'case_notes' => 'nav-link text-dark',
|
||||
'community_resources' => 'nav-link text-dark',
|
||||
'my_cases' => 'nav-link text-dark',
|
||||
'staff_notes' => 'nav-link text-dark',
|
||||
'case_itinerary' => 'nav-link text-dark',
|
||||
'admin_dashboard' => self::DEFAULT,
|
||||
'user_dashboard' => self::DEFAULT,
|
||||
'profile' => self::DEFAULT,
|
||||
'user_list' => self::DEFAULT,
|
||||
'staff_dashboard' => self::DEFAULT,
|
||||
'case_list' => self::DEFAULT,
|
||||
'add_user' => self::DEFAULT,
|
||||
'referral_sources' => self::DEFAULT,
|
||||
'case_notes' => self::DEFAULT,
|
||||
'community_resources' => self::DEFAULT,
|
||||
'my_cases' => self::DEFAULT,
|
||||
'staff_notes' => self::DEFAULT,
|
||||
'case_itinerary' => self::DEFAULT,
|
||||
'company_nav' => self::DEFAULT,
|
||||
];
|
||||
|
||||
public const PRESENT_LINK = 'nav-link text-white active bg-gradient-dark';
|
||||
|
@ -6,6 +6,8 @@ use App\Entity\CaseItinerary;
|
||||
use App\Entity\MemberCase;
|
||||
use App\Entity\User;
|
||||
use App\Entity\UserCase;
|
||||
use DateTime;
|
||||
use DateTimeZone;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
@ -21,8 +23,6 @@ class CaseItineraryRepository extends ServiceEntityRepository
|
||||
|
||||
public function getRecentTravel(User $user, ?array $params = null): ?array
|
||||
{
|
||||
//dd($params);
|
||||
|
||||
$query = $this->createQueryBuilder('ci')
|
||||
->leftJoin(UserCase::class, 'uc', 'WITH', 'uc.memberCase = ci.memberCase')
|
||||
->andWhere('uc.user = :user')
|
||||
@ -49,6 +49,40 @@ class CaseItineraryRepository extends ServiceEntityRepository
|
||||
return $query->getQuery()->getResult();
|
||||
}
|
||||
|
||||
public function getYTDTravel(User $user): ?array
|
||||
{
|
||||
$startDate = new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
|
||||
$query = $this->createQueryBuilder('ci')
|
||||
->leftJoin(UserCase::class, 'uc', 'WITH', 'uc.memberCase = ci.memberCase')
|
||||
->andWhere('uc.user = :user')
|
||||
->setParameter('user', $user->getId()->toBinary())
|
||||
->andWhere('ci.date >= :from')
|
||||
->setParameter('from', $startDate->format('Y-01-01'))
|
||||
->orderBy('ci.date', 'DESC')
|
||||
->addOrderBy('ci.arrival', 'DESC')
|
||||
;
|
||||
|
||||
return $query->getQuery()->getResult();
|
||||
}
|
||||
|
||||
public function getTravelLast30Days(User $user): ?array
|
||||
{
|
||||
$startDate = new DateTime('now', new DateTimeZone($_ENV['COMPANY_TIMEZONE']));
|
||||
|
||||
$query = $this->createQueryBuilder('ci')
|
||||
->leftJoin(UserCase::class, 'uc', 'WITH', 'uc.memberCase = ci.memberCase')
|
||||
->andWhere('uc.user = :user')
|
||||
->setParameter('user', $user->getId()->toBinary())
|
||||
->andWhere('ci.date >= :from')
|
||||
->setParameter('from', $startDate->modify('-30 days')->format('Y-m-d'))
|
||||
->orderBy('ci.date', 'DESC')
|
||||
->addOrderBy('ci.arrival', 'DESC')
|
||||
;
|
||||
|
||||
return $query->getQuery()->getResult();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return CaseLocation[] Returns an array of CaseLocation objects
|
||||
// */
|
||||
|
@ -20,7 +20,7 @@ class MemberRepository extends ServiceEntityRepository
|
||||
public function getCaseMembersByName(MemberCase $case): array
|
||||
{
|
||||
return $this->createQueryBuilder('m')
|
||||
->andWhere('m.caseId = :case')
|
||||
->andWhere('m.memberCase = :case')
|
||||
->setParameter('case', $case->getId()->toBinary())
|
||||
->orderBy('m.lastName, m.firstName', 'ASC')
|
||||
->getQuery()
|
||||
|
@ -24,7 +24,6 @@ class MessagesRepository extends ServiceEntityRepository
|
||||
->andWhere('m.received IS NULL')
|
||||
->setParameter('recipient', $user->getId()->toBinary())
|
||||
->orderBy('m.sent', 'ASC')
|
||||
->setMaxResults(5)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
|
@ -81,6 +81,15 @@
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
{% for d in docs %}
|
||||
<span class='check'>
|
||||
<input type='checkbox' name='{{ field_name(form.docs) }}[]' id='{{ d.title|replace({' ': '-'}) }}' value='{{ d.id }}'/>
|
||||
<label for='{{ d.title|replace({' ': '-'}) }}'>{{ d.title }}</label>
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
@ -151,3 +160,11 @@
|
||||
</section>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_css %}
|
||||
<style type='text/css'>
|
||||
.check {
|
||||
margin: 0 5px;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
@ -31,12 +31,12 @@
|
||||
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='case_form_admitDate' class='form-label'>Admit Date</label>
|
||||
<input type='date' name='{{ field_name(form.admitDate) }}' id='case_form_admitDate' value='{{ case.admitDate|date('Y-m-d') }}' class='form-control'/>
|
||||
<input type='date' name='{{ field_name(form.admitDate) }}' id='case_form_admitDate' value='{{ case.admitDate|date('Y-m-d', company_timezone) }}' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3{% if case.closeDate %} is-filled{% endif %}'>
|
||||
<label for='case_form_closeDate' class='form-label'>Close Date</label>
|
||||
<input type='date' name='{{ field_name(form.closeDate) }}' id='case_form_closeDate' value='{% if case.closeDate %}{{ case.closeDate|date('Y-m-d') }}{% endif %}' class='form-control'/>
|
||||
<input type='date' name='{{ field_name(form.closeDate) }}' id='case_form_closeDate' value='{% if case.closeDate %}{{ case.closeDate|date('Y-m-d', company_timezone) }}{% endif %}' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
|
@ -86,20 +86,20 @@
|
||||
</td>
|
||||
<td class='align-right'>
|
||||
{% if is_granted('ROLE_CASE_MANAGER') or is_granted('ROLE_ADMIN') %}
|
||||
<a href='{{ path('app_edit_case', {id: c.id}) }}' class='' title='Edit Case' data-toggle='tooltip'>
|
||||
<a href='{{ path('app_edit_case', {id: c.id}) }}' class='text-secondary ' title='Edit Case' data-toggle='tooltip'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
<a href='{{ path('app_assign_case', {id: c.id}) }}' class='' title='Assign Case Worker' data-toggle='tooltip'>
|
||||
<a href='{{ path('app_assign_case', {id: c.id}) }}' class='text-secondary ' title='Assign Case Worker' data-toggle='tooltip'>
|
||||
<i class='material-symbols-rounded opacity-5'>badge</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
<a href='{{ path('app_list_referrals', {id: c.id}) }}' class='' title='List Referrals' data-toggle='tooltip'>
|
||||
<a href='{{ path('app_list_referrals', {id: c.id}) }}' class='text-secondary ' title='List Referrals' data-toggle='tooltip'>
|
||||
<i class='material-symbols-rounded opacity-5'>create_new_folder</i>
|
||||
</a>
|
||||
<a href='{{ path('app_case_members', {id: c.id}) }}' class='' title='List Members' data-toggle='tooltip'>
|
||||
<a href='{{ path('app_case_members', {id: c.id}) }}' class='text-secondary ' title='List Members' data-toggle='tooltip'>
|
||||
<i class='material-symbols-rounded opacity-5'>group_add</i>
|
||||
</a>
|
||||
<a href='{{ path('app_case_notes', {id: c.id}) }}' class='' title='Show Notes' data-toggle='tooltip'>
|
||||
<a href='{{ path('app_case_notes', {id: c.id}) }}' class='text-secondary ' title='Show Notes' data-toggle='tooltip'>
|
||||
<i class='material-symbols-rounded opacity-5'>clinical_notes</i>
|
||||
</a>
|
||||
</td>
|
||||
|
@ -58,7 +58,9 @@
|
||||
{{ src.phone }}
|
||||
</td>
|
||||
<td class='align-middle'>
|
||||
<a href="{{ path('app_edit_source', {id: src.id}) }}" class='text-secondary font-weight-bold text-xs' data-toggle='tooltip' data-original-title='Edit Source'>Edit</a>
|
||||
<a href="{{ path('app_edit_source', {id: src.id}) }}" class='text-secondary font-weight-bold text-xs'>
|
||||
<i class='material-symbols-rounded opacity-5'>edit</i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -49,9 +49,7 @@
|
||||
<td>
|
||||
<div class='d-flex px-2 py-1'>
|
||||
<div class='d-flex flex-column justify-content-center'>
|
||||
<h6 class='mb-0 text-small'>
|
||||
{{ l.name }}
|
||||
</h6>
|
||||
<h6 class='mb-0 text-small'>{{ l.name }}</h6>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@ -62,7 +60,7 @@
|
||||
{{ l.lat }}/{{ l.lon }}
|
||||
</td>
|
||||
<td class='align-middle'>
|
||||
<a href='{{ path('app_case_edit_address', {id: l.id}) }}' title='Edit Location'>
|
||||
<a href='{{ path('app_case_edit_address', {id: l.id}) }}' class='text-secondary' title='Edit Location'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
</td>
|
||||
|
@ -55,7 +55,7 @@
|
||||
<tbody id='itineraryList'>
|
||||
{% for i in itineraries %}
|
||||
<tr>
|
||||
<td>{{ i.date|date('F j, Y') }}</td>
|
||||
<td>{{ i.date|date('F j, Y', company_timezone) }}</td>
|
||||
<td>{{ i.memberCase.caseName }}</td>
|
||||
<td>{{ i.originLocation.name }}</td>
|
||||
<td>{{ i.destLocation.name }}</td>
|
||||
|
@ -73,9 +73,12 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class='align-middle'>
|
||||
<a href='{{ path('app_case_edit_member', {caseId: case.id, memberId: member.id}) }}' title='Edit Member'>
|
||||
<a href='{{ path('app_case_edit_member', {caseId: case.id, memberId: member.id}) }}' class='text-secondary' title='Edit Member'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
<a href='{{ path('app_assign_case_documents', {caseId: case.id, memberId: member.id}) }}' class='text-secondary' title='Assign Case Document'>
|
||||
<i class='material-symbols-rounded opacity-5'>content_copy</i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@ -60,16 +60,16 @@
|
||||
<p class='text-center text-xs font-weight-bold mb-0'>{{ c.referrals|length }}</p>
|
||||
</td>
|
||||
<td class='align-right'>
|
||||
<a href='{{ path('app_view_case', {caseId: c.id}) }}' title='View Case'>
|
||||
<a href='{{ path('app_view_case', {caseId: c.id}) }}' class='text-secondary' title='View Case'>
|
||||
<i class='material-symbols-rounded opacity-5'>visibility</i>
|
||||
</a>
|
||||
<a href='{{ path('app_list_referrals', {id: c.id}) }}' title='List Referrals'>
|
||||
<a href='{{ path('app_list_referrals', {id: c.id}) }}' class='text-secondary' title='List Referrals'>
|
||||
<i class='material-symbols-rounded opacity-5'>create_new_folder</i>
|
||||
</a>
|
||||
<a href='{{ path('app_case_members', {id: c.id}) }}' title='List Members'>
|
||||
<a href='{{ path('app_case_members', {id: c.id}) }}' class='text-secondary' title='List Members'>
|
||||
<i class='material-symbols-rounded opacity-5'>group_add</i>
|
||||
</a>
|
||||
<a href='{{ path('app_case_notes', {id: c.id}) }}' title='Show Notes'>
|
||||
<a href='{{ path('app_list_notes', {caseId: c.id}) }}' class='text-secondary' title='Show Notes'>
|
||||
<i class='material-symbols-rounded opacity-5'>clinical_notes</i>
|
||||
</a>
|
||||
</td>
|
||||
|
@ -32,7 +32,7 @@
|
||||
</span>
|
||||
<span class='col {{ endDateWarning }}'>
|
||||
Expiration Date:
|
||||
{{ referral.endDate|date('M j, Y') }}
|
||||
{{ referral.endDate|date('M j, Y', company_timezone) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class='row' style='margin-top:10px;'>
|
||||
|
@ -32,7 +32,7 @@
|
||||
</span>
|
||||
<span class='col {{ endDateWarning }}'>
|
||||
Expiration Date:
|
||||
{{ referral.endDate|date('M j, Y') }}
|
||||
{{ referral.endDate|date('M j, Y', company_timezone) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class='row' style='margin-top:10px;'>
|
||||
|
@ -0,0 +1,292 @@
|
||||
{% 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') }}
|
||||
|
||||
{% if noteType == 'visit' %}
|
||||
<section>
|
||||
<div class="card card-plain">
|
||||
<div class="card-header">
|
||||
<h4 class="font-weight-bolder">Edit Referral Note</h4>
|
||||
<p class="mb-0">{{ referral.memberCase.caseName }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ form_start(form) }}
|
||||
{{ form_errors(form) }}
|
||||
<div class='container'>
|
||||
<div class='row'>
|
||||
{% set endDateWarning = '' %}
|
||||
{% if date("+28 days") >= referral.endDate %}
|
||||
{% set endDateWarning = 'bg-gradient-warning' %}
|
||||
{% elseif date("+14 days") >= referral.endDate %}
|
||||
{% set endDateWarning = 'bg-gradient-danger text-white' %}
|
||||
{% endif %}
|
||||
<span class='col{% if referral.getHoursRemaining() < 40 %} bg-gradient-danger text-white{% endif %}'>
|
||||
Hours:
|
||||
{{ referral.hours }}
|
||||
/
|
||||
Remaining:
|
||||
{{ referral.getHoursRemaining() }}
|
||||
</span>
|
||||
<span class='col {{ endDateWarning }}'>
|
||||
Expiration Date:
|
||||
{{ referral.endDate|date('M j, Y', company_timezone) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class='row' style='margin-top:10px;'>
|
||||
<div class='col'>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_date'></label>
|
||||
<input type='date' name='{{ field_name(form.date) }}' value='{{ field_value(form.date) }}' id='note_form_date' class='form-control' title='Visit Date'/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_startTime'></label>
|
||||
<input type='time' name='{{ field_name(form.startTime) }}' value='{{ field_value(form.startTime) }}' id='note_form_startTime' onchange='calcTime()' class='form-control' title='Start Time'/>
|
||||
<label for='note_form_endTime'></label>
|
||||
<input type='time' name='{{ field_name(form.endTime) }}' value='{{ field_value(form.endTime) }}' id='note_form_endTime' onchange='calcTime()' class='form-control' title='End Time'/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<input type='text' id='case-mins' style='width:49%;margin-right:5px;' disabled='disabled' title='Case Minutes'/>
|
||||
<input type='text' id='case-hours' style='width:49%;margin-left:5px;' disabled='disabled' title='Case Hours'/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.status) }}' id='note_form_status' class='form-control'>
|
||||
<option value=''>-- Status --</option>
|
||||
|
||||
{% for s in enum('App\\Enums\\NoteStatus').cases() %}
|
||||
<option value='{{ s.value }}' {% if s.value == note.status.value %} selected='selected' {% endif %}>{{ s.value|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.location) }}' id='note_form_location' class='form-control'>
|
||||
<option value=''>-- Location --</option>
|
||||
|
||||
{% for l in enum('App\\Enums\\NoteLocation').cases() %}
|
||||
<option value='{{ l.value }}' {% if l.value == note.location.value %} selected='selected' {% endif %}>{{ l.value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.method) }}' id='note_form_method' class='form-control'>
|
||||
<option value=''>-- Method --</option>
|
||||
|
||||
{% for m in enum('App\\Enums\\NoteMethod').cases() %}
|
||||
<option value='{{ m.value }}' {% if m.value == note.method.value %} selected='selected' {% endif %}>{{ m.name|replace({'_': ' '})|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_parentalRole'>Parental Role</label>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.parentalRole) }}' id='note_form_parentalRole' class='form-control'>
|
||||
<option value=''>-- Select --</option>
|
||||
|
||||
{% for q in enum('App\\Enums\\VisitQualityLevel').cases() %}
|
||||
<option value='{{ q.value }}' {% if q.value == note.parentalRole.value %} selected='selected' {% endif %}>{{ q.name|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_childDevelopment'>Child Development</label>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.childDevelopment) }}' id='note_form_childDevelopment' class='form-control'>
|
||||
<option value=''>-- Select --</option>
|
||||
|
||||
{% for q in enum('App\\Enums\\VisitQualityLevel').cases() %}
|
||||
<option value='{{ q.value }}' {% if q.value == note.childDevelopment.value %} selected='selected' {% endif %}>{{ q.name|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_appropriateResponse'>Appropriate Response</label>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.appropriateResponse) }}' id='note_form_appropriateResponse' class='form-control'>
|
||||
<option value=''>-- Select --</option>
|
||||
|
||||
{% for q in enum('App\\Enums\\VisitQualityLevel').cases() %}
|
||||
<option value='{{ q.value }}' {% if q.value == note.appropriateResponse.value %} selected='selected' {% endif %}>{{ q.name|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_childAheadOfSelf'>Child Ahead Of Self</label>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.childAheadOfSelf) }}' id='note_form_childAheadOfSelf' class='form-control'>
|
||||
<option value=''>-- Select --</option>
|
||||
|
||||
{% for q in enum('App\\Enums\\VisitQualityLevel').cases() %}
|
||||
<option value='{{ q.value }}' {% if q.value == note.childAheadOfSelf.value %} selected='selected' {% endif %}>{{ q.name|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_showsEmpathy'>Shows Empathy</label>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.showsEmpathy) }}' id='note_form_showsEmpathy' class='form-control'>
|
||||
<option value=''>-- Select --</option>
|
||||
|
||||
{% for q in enum('App\\Enums\\VisitQualityLevel').cases() %}
|
||||
<option value='{{ q.value }}' {% if q.value == note.showsEmpathy.value %} selected='selected' {% endif %}>{{ q.name|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_childFocused'>Child Focused</label>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.childFocused) }}' id='note_form_childFocused' class='form-control'>
|
||||
<option value=''>-- Select --</option>
|
||||
|
||||
{% for q in enum('App\\Enums\\VisitQualityLevel').cases() %}
|
||||
<option value='{{ q.value }}' {% if q.value == note.childFocused.value %} selected='selected' {% endif %}>{{ q.name|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
{{ form_row(form.members, {
|
||||
'label': 'Members Present',
|
||||
'label_attr': {'class': ''},
|
||||
'attr': {'class': 'form-control'}
|
||||
|
||||
}) }}
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_narrative'>Observed Narrative</label>
|
||||
<textarea name='{{ field_name(form.narrative) }}' id='note_form_narrative' class='form-control' style='width:100%;height:200px;'>{{ field_value(form.narrative) }}</textarea>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_strengths'>Observed Strengths</label>
|
||||
<textarea name='{{ field_name(form.strengths) }}' id='note_form_strengths' class='form-control' style='width:100%;height:200px;'>{{ field_value(form.strengths) }}</textarea>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_issues'>Observed Issues</label>
|
||||
<textarea name='{{ field_name(form.issues) }}' id='note_form_issues' class='form-control' style='width:100%;height:100px;'>{{ field_value(form.issues) }}</textarea>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_recommendation'>Recommendation</label>
|
||||
<textarea name='{{ field_name(form.recommendation) }}' id='note_form_recommendation' class='form-control' style='width:100%;height:100px;'>{{ field_value(form.recommendation) }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Note</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% elseif noteType == 'standard' %}
|
||||
<section>
|
||||
<div class="card card-plain">
|
||||
<div class="card-header">
|
||||
<h4 class="font-weight-bolder">Add Referral Note</h4>
|
||||
<p class="mb-0">{{ referral.memberCase.caseName }}</p>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ form_start(form) }}
|
||||
{{ form_errors(form) }}
|
||||
<div class='container'>
|
||||
<div class='row'>
|
||||
{% set endDateWarning = '' %}
|
||||
{% if date("+28 days") >= referral.endDate %}
|
||||
{% set endDateWarning = 'bg-gradient-warning' %}
|
||||
{% elseif date("+14 days") >= referral.endDate %}
|
||||
{% set endDateWarning = 'bg-gradient-danger text-white' %}
|
||||
{% endif %}
|
||||
<span class='col{% if referral.hours < 40 %} bg-gradient-danger text-white{% endif %}'>
|
||||
Hours:
|
||||
{{ referral.hours }}
|
||||
/
|
||||
Remaining:
|
||||
{{ referral.getHoursRemaining() }}
|
||||
</span>
|
||||
<span class='col {{ endDateWarning }}'>
|
||||
Expiration Date:
|
||||
{{ referral.endDate|date('M j, Y', company_timezone) }}
|
||||
</span>
|
||||
</div>
|
||||
<div class='row' style='margin-top:10px;'>
|
||||
<div class='col'>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_date'></label>
|
||||
<input type='date' name='{{ field_name(form.date) }}' id='note_form_date' class='form-control' title='Visit Date'/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_startTime'></label>
|
||||
<input type='time' name='{{ field_name(form.startTime) }}' id='note_form_startTime' onchange='calcTime()' class='form-control' title='Start Time'/>
|
||||
<label for='note_form_endTime'></label>
|
||||
<input type='time' name='{{ field_name(form.endTime) }}' id='note_form_endTime' onchange='calcTime()' class='form-control' title='End Time'/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<input type='text' id='case-mins' style='width:49%;margin-right:5px;' disabled='disabled' title='Case Minutes'/>
|
||||
<input type='text' id='case-hours' style='width:49%;margin-left:5px;' disabled='disabled' title='Case Hours'/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.status) }}' id='note_form_status' class='form-control'>
|
||||
<option value=''>-- Status --</option>
|
||||
|
||||
{% for s in enum('App\\Enums\\NoteStatus').cases() %}
|
||||
<option value='{{ s.value }}'>{{ s.value|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.location) }}' id='note_form_location' class='form-control'>
|
||||
<option value=''>-- Location --</option>
|
||||
|
||||
{% for l in enum('App\\Enums\\NoteLocation').cases() %}
|
||||
<option value='{{ l.value }}' {% if l == default_location %} selected='selected' {% endif %}>{{ l.value }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<select name='{{ field_name(form.method) }}' id='note_form_method' class='form-control'>
|
||||
<option value=''>-- Method --</option>
|
||||
|
||||
{% for m in enum('App\\Enums\\NoteMethod').cases() %}
|
||||
<option value='{{ m.value }}' {% if m == default_method %} selected='selected' {% endif %}>{{ m.name|replace({'_': ' '})|lower|capitalize }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col'>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
{{ form_row(form.members, {
|
||||
'label': 'Members Present',
|
||||
'label_attr': {'class': ''},
|
||||
'attr': {'class': 'form-control'}
|
||||
}) }}
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='case_note_note' class='form-label'>Notes</label>
|
||||
<textarea name='{{ field_name(form.note) }}' id='case_note_note' class='form-control' style='width:100%;height:300px;'></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Save Note</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
@ -16,21 +16,6 @@
|
||||
<h6 class="text-white text-capitalize ps-3">Referral Note List</h6>
|
||||
</div>
|
||||
<div>
|
||||
<select id='referralList' onchange='filterNotes()'>
|
||||
<option value=''>-- Select Referral --</option>
|
||||
|
||||
{% for c in cases %}
|
||||
<optgroup label='{{ c.memberCase.caseName }}'>
|
||||
{% for r in c.memberCase.referrals %}
|
||||
<option value='{{ r.id }}'>
|
||||
{{ r.referralId }}
|
||||
/
|
||||
{{ r.serviceCode.value }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="button" class="btn btn-block btn-light mb-3" onclick="window.open('/index.php/add-note/'+document.getElementById('referralList').value, '_self')">Add Note</button>
|
||||
</div>
|
||||
</div>
|
||||
@ -38,15 +23,33 @@
|
||||
<div class="card-body px-0 pb-2">
|
||||
<div>
|
||||
Filter:
|
||||
<input type='date' id='startDate' onchange='filterNotes()' title='Start Date'/>
|
||||
<input type='date' id='endDate' onchange='filterNotes()' title='End Date'/>
|
||||
<select id='referralList'>
|
||||
<option value=''>-- Select Referral --</option>
|
||||
|
||||
{% for c in cases %}
|
||||
<optgroup label='{{ c.memberCase.caseName }}'>
|
||||
<option value='case-{{ c.memberCase.id }}' {% if case and case.id == c.memberCase.id %} selected='selected' {% endif %}>{{ c.memberCase.caseName }} All Referrals</option>
|
||||
{% for r in c.memberCase.referrals %}
|
||||
<option value='{{ r.id }}'>
|
||||
{{ c.memberCase.caseName }}
|
||||
/
|
||||
{{ r.referralId }}
|
||||
/
|
||||
{{ r.serviceCode.value }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type='date' id='startDate' title='Start Date'/>
|
||||
<input type='date' id='endDate' title='End Date'/>
|
||||
<button name='filter-notes' id='filter-notes'>Filter Notes</button>
|
||||
</div>
|
||||
<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">DOS</th>
|
||||
<th class="text-uppercase text-secondary text-xxs font-weight-bolder opacity-7 ps-2">Service</th>
|
||||
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Location</th>
|
||||
<th class="text-center text-uppercase text-secondary text-xxs font-weight-bolder opacity-7">Method</th>
|
||||
<th class='text-right text-uppercase text-secondary text-xxs font-weight-bolder opacity-7'>Members Present</th>
|
||||
@ -54,22 +57,22 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id='note-list'>
|
||||
{% for note in notes %}
|
||||
{% set members = note.getMembers() %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ note.date|date('M j, Y') }}<br/>
|
||||
{{ note.startTime|date('g:i a') }}-{{ note.endTime|date('g:i a') }}
|
||||
</td>
|
||||
<td>{{ note.referral.serviceCode.value }}</td>
|
||||
<td class='text-center'>{{ note.location.value }}</td>
|
||||
<td>{{ note.method.name|replace({'_': ' '})|lower|capitalize }}</td>
|
||||
<td>
|
||||
{{ dump(members) }}
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if caseNotes %}
|
||||
{% for n in caseNotes %}
|
||||
<tr>
|
||||
<td>{{ n.date|date("F j, Y", company_timezone) }}<br/>
|
||||
{{ n.startTime|date("g:i a", company_timezone) }}-{{ n.endTime|date("g:i a", company_timezone) }} ({{ n.calcTimeUsed() }})</td>
|
||||
<td class='text-center'>{{ n.location.value }}</td>
|
||||
<td class='text-center'>{{ n.method.name|lower|replace({"_": " "})|capitalize }}</td>
|
||||
<td></td>
|
||||
<td style='text-align: right;'>
|
||||
<a href='/edit-note/{{ n.id }}' class='text-secondary' title='Edit Note'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@ -80,3 +83,15 @@
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_js %}
|
||||
<script type='module'>
|
||||
import $ from "{{ asset('vendor/jquery/jquery.index.js') }}";
|
||||
import {filterNotes} from "{{ asset('js/app/notes.js') }}";
|
||||
window.$ = $;
|
||||
|
||||
$(function () {
|
||||
$('#filter-notes').click(filterNotes);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -41,7 +41,7 @@
|
||||
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='referral_form_endDate' class='form-label'></label>
|
||||
<input type='date' name='{{ field_name(form.endDate) }}' id='referral_form_endDate' value='{{ referral.endDate|date("Y-m-d") }}' class='form-control'/>
|
||||
<input type='date' name='{{ field_name(form.endDate) }}' id='referral_form_endDate' value='{{ referral.endDate|date("Y-m-d", company_timezone) }}' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
|
@ -113,7 +113,7 @@
|
||||
<p class='text-xs font-weight-bold mb-0'>{{ r.dischargeReason.value }}</p>
|
||||
</td>
|
||||
<td>
|
||||
<p class='text-xs font-weight-bold mb-0'>{{ r.dischargeDate|date("F j, Y") }}</p>
|
||||
<p class='text-xs font-weight-bold mb-0'>{{ r.dischargeDate|date("F j, Y", company_timezone) }}</p>
|
||||
</td>
|
||||
<td class='align-right'></td>
|
||||
</tr>
|
||||
|
@ -28,12 +28,12 @@
|
||||
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
<label for='case_form_admitDate' class='form-label'>Admit Date</label>
|
||||
<input type='date' name='admitDate' id='case_form_admitDate' value='{{ case.admitDate|date('Y-m-d') }}' class='form-control'/>
|
||||
<input type='date' name='admitDate' id='case_form_admitDate' value='{{ case.admitDate|date('Y-m-d', company_timezone) }}' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3{% if case.closeDate %} is-filled{% endif %}'>
|
||||
<label for='case_form_closeDate' class='form-label'></label>
|
||||
<input type='date' name='closeDate' id='case_form_closeDate' value='{% if case.closeDate %}{{ case.closeDate|date('Y-m-d') }}{% endif %}' class='form-control'/>
|
||||
<input type='date' name='closeDate' id='case_form_closeDate' value='{% if case.closeDate %}{{ case.closeDate|date('Y-m-d', company_timezone) }}{% endif %}' class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% set today = date("now", "America/Indiana/Indianapolis") %}
|
||||
{% set today = date("now", company_timezone) %}
|
||||
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||
|
||||
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||
@ -61,10 +61,10 @@
|
||||
<td>{{ r.getHours() }}</td>
|
||||
<td>{{ r.lat|number_format(6) }}/{{ r.lon|number_format(6) }}</td>
|
||||
<td class='align-right'>
|
||||
<a href='{{ path('app_community_resource_edit', {id: r.id}) }}' title='Edit Resource'>
|
||||
<a href='{{ path('app_community_resource_edit', {id: r.id}) }}' class='text-secondary' title='Edit Resource'>
|
||||
<i class="material-symbols-rounded opacity-5">edit</i>
|
||||
</a>
|
||||
<a href='{{ path('app_community_resource_download', {id: r.id}) }}' title='Download vCard'>
|
||||
<a href='{{ path('app_community_resource_download', {id: r.id}) }}' class='text-secondary' title='Download vCard'>
|
||||
<i class="material-symbols-rounded opacity-5">import_contacts</i>
|
||||
</a>
|
||||
</td>
|
||||
|
@ -4,7 +4,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
{% set today = date("now", "America/Indiana/Indianapolis") %}
|
||||
{% set today = date("now", company_timezone) %}
|
||||
{{ block('nav', 'internal/libs/nav.html.twig') }}
|
||||
|
||||
<main class="main-content position-relative max-height-vh-100 h-100 border-radius-lg ">
|
||||
|
@ -3,7 +3,11 @@
|
||||
<div class="sidenav-header">
|
||||
<i class="fas fa-times p-3 cursor-pointer text-dark opacity-5 position-absolute end-0 top-0 d-none d-xl-none" aria-hidden="true" id="iconSidenav"></i>
|
||||
<a class="navbar-brand px-4 py-3 m-0" href="{{ path('app_dashboard') }}">
|
||||
<img src="{{ asset('img/logo-ct-dark.png') }}" class="navbar-brand-img" width="26" height="26" alt="main_logo">
|
||||
{% if app.user.company.companyLogo %}
|
||||
<img src="/uploads/company/{{ app.user.company.companyLogo }}" class="navbar-brand-img" width="30" height="30" alt="main_logo">
|
||||
{% else %}
|
||||
<img src="{{ asset('img/logo-ct-dark.png') }}" class="navbar-brand-img" width="30" height="30" alt="main_logo">
|
||||
{% endif %}
|
||||
<span class="ms-1 text-sm text-dark">CM Tracker</span>
|
||||
</a>
|
||||
</div>
|
||||
@ -26,6 +30,12 @@
|
||||
<span class="nav-link-text ms-1">Admin Dashboard</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class='nav-item'>
|
||||
<a class='{{ company_nav }}' href='{{ path('app_company') }}'>
|
||||
<i class='material-symbols-rounded opacity-5'>folder_open</i>
|
||||
<span class='nav-link-text ms-1'>Company</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="{{ user_list }}" href="{{ path('app_list_users') }}">
|
||||
<i class="material-symbols-rounded opacity-5">assignment</i>
|
||||
|
@ -39,10 +39,10 @@
|
||||
<li class="nav-item dropdown pe-3 d-flex align-items-center" title="Notifications">
|
||||
<a href="javascript:;" class="nav-link text-body p-0 notification" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="material-symbols-rounded">notifications</i>
|
||||
<span class='badge' {% if notificationCount == 0 %} style='display:none;' {% endif %}>{{ notificationCount }}</span>
|
||||
<span class='badge' {% if (notifications|length) == 0 %} style='display:none;' {% endif %}>{{ notifications|length }}</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end px-2 py-3 me-sm-n4" aria-labelledby="dropdownMenuButton">
|
||||
{% for note in notifications %}
|
||||
{% for note in notifications|slice(0, 4) %}
|
||||
<li class='mb-2'>
|
||||
<a class='dropdown-item border-radius-md' href="javascript:openNotification('{{ note.id }}');">
|
||||
<div class='d-flex py-1'>
|
||||
|
@ -39,41 +39,41 @@
|
||||
<td>
|
||||
<div class='d-flex px-2 py-1'>
|
||||
<div class='d-flex flex-column justify-content-center'>
|
||||
<h6 class='mb-0 text-small'>{{ n.date|date('F j, Y') }}</h6>
|
||||
<h6 class='mb-0 text-small'>{{ n.date|date('F j, Y', company_timezone) }}</h6>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{% if n.supervisorSignDateTime %}
|
||||
{{ n.supervisorSignDateTime|date('F j, Y h:i a') }}
|
||||
{{ n.supervisorSignDateTime|date('F j, Y h:i a', company_timezone) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if n.workerSignDatetime %}
|
||||
{{ n.workerSignDatetime|date('F j, Y h:i a') }}
|
||||
{{ n.workerSignDatetime|date('F j, Y h:i a', company_timezone) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class='align-right'>
|
||||
{% if isWorker and not n.workerSignDatetime %}
|
||||
<a href='{{ path('app_staff_edit_note', {noteId: n.id}) }}' title='Edit Note'>
|
||||
<a href='{{ path('app_staff_edit_note', {noteId: n.id}) }}' class='text-secondary' title='Edit Note'>
|
||||
<i class='material-symbols-rounded opacity-5'>edit</i>
|
||||
</a>
|
||||
<a href='{{ path('app_staff_sign_my_note', {noteId: n.id}) }}' title='Sign Note'>
|
||||
<a href='{{ path('app_staff_sign_my_note', {noteId: n.id}) }}' class='text-secondary' title='Sign Note'>
|
||||
<i class='material-symbols-rounded opacity-5'>draw</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if isWorker and n.workerSignDatetime %}
|
||||
<a href='{{ path('app_staff_view_note', {noteId: n.id}) }}' title='View Note'>
|
||||
<a href='{{ path('app_staff_view_note', {noteId: n.id}) }}' class='text-secondary' title='View Note'>
|
||||
<i class='material-symbols-rounded opacity-5'>visibility</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if not isWorker and not n.supervisorSignDateTime %}
|
||||
<a href='{{ path('app_staff_sign_worker_note', {noteId: n.id}) }}' title='Sign Note'>
|
||||
<a href='{{ path('app_staff_sign_worker_note', {noteId: n.id}) }}' class='text-secondary' title='Sign Note'>
|
||||
<i class='material-symbols-rounded opacity-5'>draw</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
{% if not isWorker and n.supervisorSignDateTime %}
|
||||
<a href='{{ path('app_staff_view_note', {noteId: n.id}) }}' title='View Note'>
|
||||
<a href='{{ path('app_staff_view_note', {noteId: n.id}) }}' class='text-secondary' title='View Note'>
|
||||
<i class='material-symbols-rounded opacity-5'>visibility</i>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
@ -19,17 +19,17 @@
|
||||
<div class='col'>
|
||||
<div>
|
||||
<div>Supervisor:
|
||||
{{ note.supervisorSignDateTime|date("F j, Y h:i a") }}</div>
|
||||
{{ note.supervisorSignDateTime|date("F j, Y h:i a", company_timezone) }}</div>
|
||||
<div>Case Worker:
|
||||
{% if note.workerSignDatetime %}
|
||||
{{ note.workerSignDatetime|date("F j, Y h:i a") }}{% else %}Unsigned
|
||||
{{ note.workerSignDatetime|date("F j, Y h:i a", company_timezone) }}{% else %}Unsigned
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3'>
|
||||
<label for='note_form_date'></label>
|
||||
<input type='date' name='date' id='note_form_date' value='{{ note.date|date("Y-m-d") }}' disabled="disabled" class='form-control'/>
|
||||
<input type='date' name='date' id='note_form_date' value='{{ note.date|date("Y-m-d", company_timezone) }}' disabled="disabled" class='form-control'/>
|
||||
</div>
|
||||
|
||||
<div class='input-group input-group-outline mb-3 is-filled'>
|
||||
|
@ -19,7 +19,8 @@
|
||||
<div>
|
||||
<h4 class='mb-0'>{{ s.name }}</h4>
|
||||
<p class='text-sm mb-0 text-capitalize'>
|
||||
<a href='tel:'></a>
|
||||
<a href='mailto:{{ s.email }}'>{{ s.email }}</a><br />
|
||||
{% if s.workPhone %}<a href='tel:{{ s.workPhone }}'>{{ s.getFormattedPhone() }}</a>{% endif %}
|
||||
</p>
|
||||
</div>
|
||||
<div class="icon icon-md icon-shape bg-gradient-dark shadow-dark shadow text-center border-radius-lg">
|
||||
@ -30,8 +31,9 @@
|
||||
<hr class='dark horizontal my-0'>
|
||||
<div class='card-footer p-2 ps-3'>
|
||||
<p class='mb-0 text-sm'>
|
||||
<span class='text-info font-weight-bolder'>
|
||||
<a href='{{ path('app_staff_cases', {staffId: s.id}) }}'>Staff Cases</a>
|
||||
<span class='font-weight-bolder'>
|
||||
<button class='btn btn-primary bg-gradient-dark' onclick='window.location.href="{{ path('app_staff_cases', {staffId: s.id}) }}"'>Staff Cases</button>
|
||||
<button class='btn btn-primary bg-gradient-dark' id='send-message' data-user-id='{{ s.id }}'>Send Message</button>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
@ -40,5 +42,43 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='modal fade' id='message-modal' tabindex='-1' role='dialog' aria-labelledby='message-modal-title'>
|
||||
<div class='modal-dialog modal-dialog-centered' role='document'>
|
||||
<div class='modal-content'>
|
||||
<div class="modal-header">
|
||||
<h6 class="modal-title font-weight-normal" id="message-modal-label">Message Staff</h6>
|
||||
<button type="button" class="btn-close text-dark" data-bs-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class='modal-body'>
|
||||
<form>
|
||||
<input type='hidden' id='my-case' value=''/>
|
||||
<div class='input-group input-group-outline my-3'>
|
||||
<textarea name='message' id='message' style='width:100%;height:100px;'></textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class='modal-footer'>
|
||||
<button type='button' id='close-modal' class='btn bg-gradient-secondary' data-bs-dismiss='modal'>Close</button>
|
||||
<button type='button' id='send-message' class='btn bg-gradient-primary'>Send Message</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
||||
{% block page_js %}
|
||||
<script type='module'>
|
||||
import $ from "{{ asset('vendor/jquery/jquery.index.js') }}";
|
||||
import {openMessage, sendMessage} from '{{ asset("js/app/message.js") }}';
|
||||
window.$ = $;
|
||||
|
||||
$(function () {
|
||||
document.getElementById('open-message').addEventListener('click', openMessage);
|
||||
document.getElementById('send-message').addEventListener('click', sendMessage);
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<!-- Navbar -->
|
||||
<nav class="navbar navbar-expand-lg blur border-radius-xl top-0 z-index-3 shadow position-absolute my-3 py-2 start-0 end-0 mx-4">
|
||||
<div class="container-fluid ps-2 pe-0">
|
||||
<a class="navbar-brand font-weight-bolder ms-lg-0 ms-3 " href="/index.php/dashboard">
|
||||
<a class="navbar-brand font-weight-bolder ms-lg-0 ms-3 " href="{{ path('app_dashboard') }}">
|
||||
CM Tracker
|
||||
</a>
|
||||
<button class="navbar-toggler shadow-none ms-2" type="button" data-bs-toggle="collapse" data-bs-target="#navigation" aria-controls="navigation" aria-expanded="false" aria-label="Toggle navigation">
|
||||
@ -15,16 +15,23 @@
|
||||
<div class="collapse navbar-collapse" id="navigation">
|
||||
<ul
|
||||
class="navbar-nav mx-auto">
|
||||
<!-- @todo only display when logged in -->
|
||||
{% if company is defined %}
|
||||
<li class='nav-item'>
|
||||
<a class='nav-link d-flex align-items-center me-2' href='{{ path('app_list_documents') }}'>
|
||||
<i class='material-symbols-rounded opacity-5'>content_copy</i>
|
||||
Company Documents
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if app.user %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link d-flex align-items-center me-2 active" aria-current="page" href="/index.php/dashboard">
|
||||
<a class="nav-link d-flex align-items-center me-2 active" aria-current="page" href="{{ path('app_dashboard') }}">
|
||||
<i class="fa fa-chart-pie opacity-6 text-dark me-1"></i>
|
||||
Dashboard
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link me-2" href="/index.php/profile">
|
||||
<a class="nav-link me-2" href="{{ path('app_profile') }}">
|
||||
<i class="fa fa-user opacity-6 text-dark me-1"></i>
|
||||
Profile
|
||||
</a>
|
||||
@ -32,13 +39,13 @@
|
||||
{% endif %}
|
||||
{% if not app.user %}
|
||||
<li class='nav-item'>
|
||||
<a class='nav-link me-2' href='/index.php/register'>
|
||||
<a class='nav-link me-2' href='{{ path('app_register') }}'>
|
||||
<i class='fas fa-key opacity-6 text-dark me-1'></i>
|
||||
Register
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link me-2" href="/index.php/">
|
||||
<a class="nav-link me-2" href="{{ path('app_login') }}">
|
||||
<i class="fas fa-key opacity-6 text-dark me-1"></i>
|
||||
Sign In
|
||||
</a>
|
||||
|
@ -61,6 +61,9 @@
|
||||
<label for="registration_form_url" class="form-label">URL</label>
|
||||
<input type="text" name="{{ field_name(form.url) }}" class="form-control"/>
|
||||
</div>
|
||||
<div class='input-group input-group-outline mb-3' id='company-logo'>
|
||||
{{ form_row(form.companyLogo) }}
|
||||
</div>
|
||||
<div class="text-center">
|
||||
<button type="submit" class="btn btn-lg bg-gradient-dark btn-lg w-100 mt-4 mb-0">Next</button>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user