first commit symfony 6
This commit is contained in:
59
src/Controller/AuditController.php
Normal file
59
src/Controller/AuditController.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
use App\Entity\Audit as Entity;
|
||||
use App\Form\AuditType as Form;
|
||||
|
||||
class AuditController extends AbstractController
|
||||
{
|
||||
private $data="audit";
|
||||
private $entity="App\Entity\Audit";
|
||||
private $twig="Audit/";
|
||||
private $route="app_admin_audit";
|
||||
|
||||
public function list($entityname,$access,ManagerRegistry $em): Response
|
||||
{
|
||||
$datas = $em->getRepository($this->entity)->findBy(["entityname"=>$entityname]);
|
||||
|
||||
return $this->render($this->twig.'list.html.twig',[
|
||||
$this->data."s" => $datas,
|
||||
"entityname" => $entityname,
|
||||
"useheader"=>true,
|
||||
"usemenu"=>false,
|
||||
"usesidebar"=>true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function auditrender($entityname,$entityid,$access,ManagerRegistry $em): Response
|
||||
{
|
||||
$datas = $em->getRepository($this->entity)->findBy(["entityname"=>$entityname,"entityid"=>$entityid]);
|
||||
|
||||
/*
|
||||
if($entityname=="User") {
|
||||
$user=$em->getRepository("App\Entity\User")->find($entityid);
|
||||
if($user) {
|
||||
foreach($user->getModos() as $usermodo) {
|
||||
$auditusermods=$em->getRepository($this->entity)->findBy(["entityname"=>"UserModo","entityid"=>$usermodo->getId()]);
|
||||
foreach($auditusermods as $auditusermod) {
|
||||
$usermodo=$em->getRepository("App\Entity\UserModo")->find($auditusermod->getEntityid());
|
||||
$niveau01=$em->getRepository("App\Entity\Niveau01")->find($usermodo->getNiveau01()->getId());
|
||||
|
||||
$auditusermod->setDescription($auditusermod->getDescription()." UserModo");
|
||||
$auditusermod->setDetail([$niveau01->getId()." = ".$niveau01->getLabel()]);
|
||||
}
|
||||
$datas=array_merge($datas,$auditusermods);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return $this->render($this->twig.'render.html.twig',[
|
||||
$this->data."s" => $datas,
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user