User/Company updates

This commit is contained in:
Ryan Prather 2024-11-29 21:47:37 -05:00
parent eac41ac9fc
commit 8b7f30875b
6 changed files with 71 additions and 1 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@
/public/bundles/ /public/bundles/
/var/ /var/
/vendor/ /vendor/
/theme/
###< symfony/framework-bundle ### ###< symfony/framework-bundle ###
###> phpunit/phpunit ### ###> phpunit/phpunit ###

View File

@ -1,2 +1,3 @@
# cp-pro # CM Tracker
This program is a modern CM Pro and operates as a case management tool that integrates with KidTracks. It also operates on a shared data model so that case workers, case managers/staff supervisors, therapists, and admins all operate on the same data and everything is done through the system.

View File

@ -45,6 +45,7 @@
"symfony/web-link": "7.1.*", "symfony/web-link": "7.1.*",
"symfony/yaml": "7.1.*", "symfony/yaml": "7.1.*",
"twig/extra-bundle": "^2.12|^3.0", "twig/extra-bundle": "^2.12|^3.0",
"twig/intl-extra": "^3.15",
"twig/twig": "^2.12|^3.0" "twig/twig": "^2.12|^3.0"
}, },
"config": { "config": {

View File

@ -199,4 +199,16 @@ class Company
return $this; return $this;
} }
public function __toString(): string
{
$url = ($this->url ? "<br/><a href='$this->url' target='_blank'>$this->url</a>" : '');
return <<<"HTML"
$this->name<br/>
$this->address<br/>
$this->city, $this->state $this->zip<br/>
<a href='tel:{$this->phone}'>$this->phone</a>
$url
HTML;
}
} }

View File

@ -71,6 +71,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(enumType: CaseLevel::class)] #[ORM\Column(enumType: CaseLevel::class)]
private ?CaseLevel $level = null; private ?CaseLevel $level = null;
#[ORM\ManyToOne(inversedBy: 'supervisor')]
private ?Supervision $supervisor = null;
public function __construct() public function __construct()
{ {
$this->userCases = new ArrayCollection(); $this->userCases = new ArrayCollection();
@ -264,4 +267,46 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this; return $this;
} }
public function retrieveUnreadNotifications(): array
{
return [
[
'id' => 1,
'title' => 'Welcome',
'from' => 'Admin',
'type' => 'info',
'message' => 'Welcome to the dashboard.',
'timestamp' => new \DateTime('2024-11-12 10:00:00'),
],
[
'id' => 2,
'title' => 'New Case',
'from' => 'Admin',
'type' => 'info',
'message' => 'You have a new case.',
'timestamp' => new \DateTime('2024-11-13 10:19:56'),
],
[
'id' => 3,
'title' => 'New Message',
'from' => 'Admin',
'type' => 'warning',
'message' => 'You have a new message.',
'timestamp' => new \DateTime('2024-11-16 11:13:25'),
],
];
}
public function getSupervisor(): ?Supervision
{
return $this->supervisor;
}
public function setSupervisor(?Supervision $supervisor): static
{
$this->supervisor = $supervisor;
return $this;
}
} }

View File

@ -33,6 +33,16 @@ class UserRepository extends ServiceEntityRepository implements PasswordUpgrader
$this->getEntityManager()->flush(); $this->getEntityManager()->flush();
} }
public function getCaseManagers(): array
{
return $this->createQueryBuilder('u')
->andWhere('u.job = :job')
->setParameter('job', 'CASE_MANAGER')
->getQuery()
->getResult()
;
}
// /** // /**
// * @return User[] Returns an array of User objects // * @return User[] Returns an array of User objects
// */ // */