Skip to content

Commit

Permalink
Add inherited vvt to descendent team dashboards
Browse files Browse the repository at this point in the history
Also adds all related entities to dashboard network:
- DSFA
- TOM
- Kontakte
- Datenweitergabe
- Auftragsverarbeitung
- Richtlinie
- Software
  • Loading branch information
melegiul committed Jul 24, 2023
1 parent 58a4f80 commit dc34654
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 23 deletions.
19 changes: 10 additions & 9 deletions src/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,23 @@ public function dashboard(Request $request,
return $this->redirectToRoute('no_team');
}
}
$teamPath = $teamRepository->getPath($currentTeam);

$audit = $auditRepository->findAllByTeam($currentTeam);
$daten = $transferRepository->findActiveTransfersByTeam($currentTeam);
$av = $transferRepository->findActiveOrderProcessingsByTeam($currentTeam);
$vvt = $procedureRepository->findActiveByTeam($currentTeam);
$vvtDsfa = $impactAssessmentRepository->findActiveByTeam($currentTeam);
$kontakte = $contactRepository->findActiveByTeam($currentTeam);
$tom = $tomRepository->findActiveByTeam($currentTeam);
$daten = $transferRepository->findActiveTransfersByTeamPath($teamPath);
$av = $transferRepository->findActiveOrderProcessingsByTeamPath($teamPath);
$vvt = $procedureRepository->findActiveByTeamPath($teamPath);
$vvtDsfa = $impactAssessmentRepository->findActiveByTeamPath($teamPath);
$kontakte = $contactRepository->findActiveByTeamPath($teamPath);
$tom = $tomRepository->findActiveByTeamPath($teamPath);
$forms = $formRepository->findPublicByTeam($currentTeam);
$policies = $policyRepository->findPublicByTeam($currentTeam);
$software = $softwareRepository->findActiveByTeam($currentTeam);
$policies = $policyRepository->findPublicByTeamPath($teamPath);
$software = $softwareRepository->findActiveByTeamPath($teamPath);
$tasks = $taskRepository->findActiveAndOpenByTeam($currentTeam);
$loeschkonzepte = $deletionConceptRepository->findByTeam($currentTeam);
$vvtdatenkategorien = $dataCategoryRepository->findByTeam($currentTeam);
$kritischeAudits = $auditRepository->findCriticalByTeam($currentTeam);
$kritischeVvts = $procedureRepository->findCriticalByTeam($currentTeam);
$kritischeVvts = $procedureRepository->findCriticalByTeamPath($teamPath);
$openDsfa = $impactAssessmentRepository->findActiveAndOpenByTeam($currentTeam);
$buchungen = $bookingRepository->findActiveByUser($user);

Expand Down
16 changes: 8 additions & 8 deletions src/Repository/DatenweitergabeRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,34 @@ public function findActiveByTeamPath(array $teamPath)
}

/**
* @param $value
* @param array $teamPath
* @return int|mixed|string
* find transfers of type Datenweitergabe
*/
public function findActiveTransfersByTeam($value)
public function findActiveTransfersByTeamPath(array $teamPath): mixed
{
return $this->createQueryBuilder('a')
->andWhere('a.team = :val')
->andWhere('a.team IN (:teamPath)')
->andWhere('a.activ = 1')
->andWhere('a.art = 1')
->setParameter('val', $value)
->setParameter('teamPath', $teamPath)
->getQuery()
->getResult()
;
}

/**
* @param $value
* @param array $teamPath
* @return int|mixed|string
* find transfers of type Auftragsverarbeitung
*/
public function findActiveOrderProcessingsByTeam($value)
public function findActiveOrderProcessingsByTeamPath(array $teamPath): mixed
{
return $this->createQueryBuilder('a')
->andWhere('a.team = :val')
->andWhere('a.team IN (:teamPath)')
->andWhere('a.activ = 1')
->andWhere('a.art = 2')
->setParameter('val', $value)
->setParameter('teamPath', $teamPath)
->getQuery()
->getResult()
;
Expand Down
11 changes: 11 additions & 0 deletions src/Repository/KontakteRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,15 @@ public function findActiveByTeam($value)
->getResult()
;
}

public function findActiveByTeamPath(array $teamPath)
{
return $this->createQueryBuilder('a')
->andWhere('a.team IN (:teamPath)')
->andWhere('a.activ = 1')
->setParameter('teamPath', $teamPath)
->getQuery()
->getResult()
;
}
}
6 changes: 3 additions & 3 deletions src/Repository/PoliciesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ public function findActiveByTeam($value)
->getResult();
}

public function findPublicByTeam($value)
public function findPublicByTeamPath(array $teamPath)
{
return $this->createQueryBuilder('a')
->andWhere('a.team = :val')
->andWhere('a.team IN (:teamPath)')
->andWhere('a.activ = 1')
->andWhere('a.status != 4')
->setParameter('val', $value)
->setParameter('teamPath', $teamPath)
->getQuery()
->getResult();
}
Expand Down
13 changes: 13 additions & 0 deletions src/Repository/VVTDsfaRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ public function findActiveByTeam($value)
;
}

public function findActiveByTeamPath(array $teamPath)
{
return $this->createQueryBuilder('a')
->innerJoin('a.vvt', 'v')
->andWhere('a.activ = 1')
->andWhere('v.team IN (:teamPath)')
->andWhere('v.activ = 1')
->setParameter('teamPath', $teamPath)
->getQuery()
->getResult()
;
}

public function findActiveAndOpenByTeam($team) {
return $this->createQueryBuilder('dsfa')
->innerJoin('dsfa.vvt', 'vvt')
Expand Down
6 changes: 3 additions & 3 deletions src/Repository/VVTRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public function findActiveByTeamPath(array $teamPath)
;
}

public function findCriticalByTeam(Team $team) {
public function findCriticalByTeamPath(array $teamPath) {
return $this->createQueryBuilder('vvt')
->andWhere('vvt.team = :team')
->andWhere('vvt.team IN (:teamPath)')
->andWhere('vvt.activ = 1')
->andWhere('vvt.status = 3')
->orderBy('vvt.CreatedAt', 'DESC')
->setParameter('team', $team)
->setParameter('teamPath', $teamPath)
->getQuery()
->getResult();
}
Expand Down

0 comments on commit dc34654

Please sign in to comment.