Add jail's status + directorys history admin
This commit is contained in:
@@ -44,4 +44,5 @@ security:
|
|||||||
- { path: ^/reset-password, roles: PUBLIC_ACCESS }
|
- { path: ^/reset-password, roles: PUBLIC_ACCESS }
|
||||||
- { path: ^/share, roles: PUBLIC_ACCESS }
|
- { path: ^/share, roles: PUBLIC_ACCESS }
|
||||||
- { path: ^/admin, roles: ROLE_ADMIN }
|
- { path: ^/admin, roles: ROLE_ADMIN }
|
||||||
|
- { path: ^/directory/history, roles: ROLE_ADMIN }
|
||||||
- { path: ^/, roles: IS_AUTHENTICATED_REMEMBERED } #IS_AUTHENTICATED_REMEMBERED= user is logged, with form or with cookie
|
- { path: ^/, roles: IS_AUTHENTICATED_REMEMBERED } #IS_AUTHENTICATED_REMEMBERED= user is logged, with form or with cookie
|
||||||
|
|||||||
33
migrations/Version20220910184058.php
Normal file
33
migrations/Version20220910184058.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20220910184058 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('ALTER TABLE jail ADD status VARCHAR(255) NOT NULL');
|
||||||
|
$this->addSql('UPDATE jail SET status = "🔴 To do"');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('ALTER TABLE jail DROP status');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -314,4 +314,21 @@ class DirectoryController extends AbstractController
|
|||||||
'deletedDirectory' => $deleted
|
'deletedDirectory' => $deleted
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#[Route('/history/{id}', name: 'history')]
|
||||||
|
public function history(Directory $Directory, EntityManagerInterface $em): Response
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var LogEntryRepository $logEntryRepository
|
||||||
|
*/
|
||||||
|
$logEntryRepository = $em->getRepository('Gedmo\Loggable\Entity\LogEntry');
|
||||||
|
$directoryHistory = $logEntryRepository->getLogEntries($Directory);
|
||||||
|
return $this->render('directory/history.html.twig', [
|
||||||
|
'controller_name' => 'DocumentController',
|
||||||
|
'directory' => $Directory,
|
||||||
|
'history' => $directoryHistory,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ class Directory
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="boolean", options={"default":"1"})
|
* @ORM\Column(type="boolean", options={"default":"1"})
|
||||||
|
* @Gedmo\Versioned
|
||||||
*/
|
*/
|
||||||
private $wantedDisplay = true;
|
private $wantedDisplay = true;
|
||||||
|
|
||||||
@@ -464,26 +465,31 @@ class Directory
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="string", length=255, nullable=true)
|
* @ORM\Column(type="string", length=255, nullable=true)
|
||||||
|
* @Gedmo\Versioned
|
||||||
*/
|
*/
|
||||||
private $gangInfo;
|
private $gangInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="boolean", options={"default":"0"})
|
* @ORM\Column(type="boolean", options={"default":"0"})
|
||||||
|
* @Gedmo\Versioned
|
||||||
*/
|
*/
|
||||||
private $hasNoPapers = false;
|
private $hasNoPapers = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="text", nullable=true)
|
* @ORM\Column(type="text", nullable=true)
|
||||||
|
* @Gedmo\Versioned
|
||||||
*/
|
*/
|
||||||
private $medicalContact;
|
private $medicalContact;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="text", nullable=true)
|
* @ORM\Column(type="text", nullable=true)
|
||||||
|
* @Gedmo\Versioned
|
||||||
*/
|
*/
|
||||||
private $medicaltrusted;
|
private $medicaltrusted;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="text", nullable=true)
|
* @ORM\Column(type="text", nullable=true)
|
||||||
|
* @Gedmo\Versioned
|
||||||
*/
|
*/
|
||||||
private $medicalLastWish;
|
private $medicalLastWish;
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,12 @@ class Jail extends Document
|
|||||||
*/
|
*/
|
||||||
private $medic = false;
|
private $medic = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="string", length=255)
|
||||||
|
* @Gedmo\Versioned
|
||||||
|
*/
|
||||||
|
private $status;
|
||||||
|
|
||||||
public function __construct(User $user)
|
public function __construct(User $user)
|
||||||
{
|
{
|
||||||
parent::__construct($user);
|
parent::__construct($user);
|
||||||
@@ -129,4 +135,15 @@ class Jail extends Document
|
|||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getStatus(): ?string
|
||||||
|
{
|
||||||
|
return $this->status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setStatus(string $status): self
|
||||||
|
{
|
||||||
|
$this->status = $status;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use App\Form\Type\ContentType;
|
|||||||
use App\Form\Type\DateTimeVisionType;
|
use App\Form\Type\DateTimeVisionType;
|
||||||
use Symfony\Component\Form\FormBuilderInterface;
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||||
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||||
|
|
||||||
class JailType extends DocumentType
|
class JailType extends DocumentType
|
||||||
@@ -38,6 +39,14 @@ class JailType extends DocumentType
|
|||||||
->add('lawyer', CheckboxType::class, ['label' => 'form_label_asked_for_lawyer', 'required' => false])
|
->add('lawyer', CheckboxType::class, ['label' => 'form_label_asked_for_lawyer', 'required' => false])
|
||||||
->add('medic', CheckboxType::class, ['label' => 'form_label_asked_for_medic', 'required' => false])
|
->add('medic', CheckboxType::class, ['label' => 'form_label_asked_for_medic', 'required' => false])
|
||||||
->add('content', ContentType::class)
|
->add('content', ContentType::class)
|
||||||
|
->add('status', ChoiceType::class, [
|
||||||
|
'choices' => [
|
||||||
|
'form_choice_jail_status_todo' => 'form_choice_jail_status_todo',
|
||||||
|
'form_choice_jail_status_inprogress' => 'form_choice_jail_status_inprogress',
|
||||||
|
],
|
||||||
|
'label' => 'form_label_jail_status',
|
||||||
|
'priority' => -800
|
||||||
|
])
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -47,4 +47,8 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if is_granted('ROLE_ADMIN') %}
|
||||||
|
<a href="{{ path('directory_history', {'id': directory.id}) }}" class="btn btn-warning btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_directory_history{% endtrans %} (Admin)"><i class="fas fa-clock"></i></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
12
templates/directory/history.html.twig
Normal file
12
templates/directory/history.html.twig
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block title %}{{ directory.fullName }} - {% trans %}title_history{% endtrans %}{% endblock %}
|
||||||
|
{% block subtitle %}#{{ directory.id }}: {{ directory.fullName }} - {% trans %}title_history{% endtrans %} {% endblock %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
{% include '_cells/historyDisplay.html.twig' with {'history': history, notype: true} %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -230,6 +230,8 @@ form_choice_default: Default
|
|||||||
form_choice_english: English
|
form_choice_english: English
|
||||||
form_choice_french: French
|
form_choice_french: French
|
||||||
form_choice_helicopter: Helicopter
|
form_choice_helicopter: Helicopter
|
||||||
|
form_choice_jail_status_inprogress: 🟠 In Progress
|
||||||
|
form_choice_jail_status_todo: 🔴 To do
|
||||||
form_choice_motorcycle: Motorcycle
|
form_choice_motorcycle: Motorcycle
|
||||||
form_choice_other: Other
|
form_choice_other: Other
|
||||||
form_choice_plane: Plane
|
form_choice_plane: Plane
|
||||||
@@ -306,6 +308,7 @@ form_label_hasnopapers: Has no id card ?
|
|||||||
form_label_imageName: Image Name
|
form_label_imageName: Image Name
|
||||||
form_label_informations: Informations
|
form_label_informations: Informations
|
||||||
form_label_isDesactivated: Desactivated
|
form_label_isDesactivated: Desactivated
|
||||||
|
form_label_jail_status: Jail status
|
||||||
form_label_jailed_at: Cellaring
|
form_label_jailed_at: Cellaring
|
||||||
form_label_language: Vision language
|
form_label_language: Vision language
|
||||||
form_label_lastname: Lastname
|
form_label_lastname: Lastname
|
||||||
@@ -821,6 +824,7 @@ tooltip_boat_licence: Maritime Permit
|
|||||||
tooltip_car_licence: Driving licence
|
tooltip_car_licence: Driving licence
|
||||||
tooltip_copy: Copy
|
tooltip_copy: Copy
|
||||||
tooltip_delete: Delete
|
tooltip_delete: Delete
|
||||||
|
tooltip_directory_history: View History
|
||||||
tooltip_document_shared: Shared document
|
tooltip_document_shared: Shared document
|
||||||
tooltip_download: Download
|
tooltip_download: Download
|
||||||
tooltip_edit_medical: Edition of medical informations
|
tooltip_edit_medical: Edition of medical informations
|
||||||
|
|||||||
@@ -230,6 +230,8 @@ form_choice_default: Défaut
|
|||||||
form_choice_english: Anglais
|
form_choice_english: Anglais
|
||||||
form_choice_french: Français
|
form_choice_french: Français
|
||||||
form_choice_helicopter: Hélicoptère
|
form_choice_helicopter: Hélicoptère
|
||||||
|
form_choice_jail_status_inprogress: 🟠 En cours
|
||||||
|
form_choice_jail_status_todo: 🔴 non traité
|
||||||
form_choice_motorcycle: Moto
|
form_choice_motorcycle: Moto
|
||||||
form_choice_other: Autre
|
form_choice_other: Autre
|
||||||
form_choice_plane: Avion
|
form_choice_plane: Avion
|
||||||
@@ -306,6 +308,7 @@ form_label_hasnopapers: Est sans papier ?
|
|||||||
form_label_imageName: nom de l'image
|
form_label_imageName: nom de l'image
|
||||||
form_label_informations: Informations
|
form_label_informations: Informations
|
||||||
form_label_isDesactivated: Désactivé
|
form_label_isDesactivated: Désactivé
|
||||||
|
form_label_jail_status: Etat du PV de GAV
|
||||||
form_label_jailed_at: Mise en cellule
|
form_label_jailed_at: Mise en cellule
|
||||||
form_label_language: Langue de Vision
|
form_label_language: Langue de Vision
|
||||||
form_label_lastname: Nom
|
form_label_lastname: Nom
|
||||||
@@ -820,6 +823,7 @@ tooltip_boat_licence: Permis Maritime
|
|||||||
tooltip_car_licence: Permis Voiture
|
tooltip_car_licence: Permis Voiture
|
||||||
tooltip_copy: Copier
|
tooltip_copy: Copier
|
||||||
tooltip_delete: Effacer
|
tooltip_delete: Effacer
|
||||||
|
tooltip_directory_history: Voir l'historique
|
||||||
tooltip_document_shared: Document partagé
|
tooltip_document_shared: Document partagé
|
||||||
tooltip_download: Télécharger
|
tooltip_download: Télécharger
|
||||||
tooltip_edit_medical: Éditer les informations médicales
|
tooltip_edit_medical: Éditer les informations médicales
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.6"
|
"version": "0.2.7"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user