mise à jour sur les interventions (fab) #2
98 changed files with 12622 additions and 350 deletions
|
|
@ -18,27 +18,27 @@ steps:
|
|||
- mysql -hdb -uroot -proot -e "CREATE DATABASE app"
|
||||
|
||||
"Configure app":
|
||||
image: deblan/php:8.0
|
||||
image: deblan/php:8.1
|
||||
commands:
|
||||
- echo APP_ENV=prod >> .env.local
|
||||
- echo APP_SECRET=$(openssl rand -hex 32) >> .env.local
|
||||
- echo DATABASE_URL=mysql://root:root@db/app >> .env.local
|
||||
|
||||
"Installs PHP dependencies":
|
||||
image: deblan/php:8.0
|
||||
image: deblan/php:8.1
|
||||
commands:
|
||||
- apt-get update && apt-get -y install git
|
||||
- composer install --no-scripts
|
||||
|
||||
"Migrates database":
|
||||
image: deblan/php:8.0
|
||||
image: deblan/php:8.1
|
||||
environment:
|
||||
- PHP=php
|
||||
PHP: php
|
||||
commands:
|
||||
- ./bin/doctrine-migrate
|
||||
|
||||
"Generates JS routes":
|
||||
image: deblan/php:8.0
|
||||
image: deblan/php:8.1
|
||||
commands:
|
||||
- php bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
|
||||
|
||||
|
|
@ -65,4 +65,4 @@ services:
|
|||
db:
|
||||
image: mariadb:10.3
|
||||
environment:
|
||||
- MARIADB_ROOT_PASSWORD=root
|
||||
MARIADB_ROOT_PASSWORD: root
|
||||
|
|
|
|||
|
|
@ -10,8 +10,16 @@ skip_clone: true
|
|||
steps:
|
||||
"Deploy the app":
|
||||
image: deblan/mage
|
||||
secrets: [ssh_user, ssh_host, ssh_priv_key, app_directory]
|
||||
volumes: *volumes
|
||||
environment:
|
||||
SSH_USER:
|
||||
from_secret: ssh_user
|
||||
SSH_HOST:
|
||||
from_secret: ssh_host
|
||||
SSH_PRIV_KEY:
|
||||
from_secret: ssh_priv_key
|
||||
APP_DIRECTORY:
|
||||
from_secret: app_directory
|
||||
commands:
|
||||
- cd "/builds/$CI_COMMIT_SHA"
|
||||
- mkdir "$HOME/.ssh"
|
||||
|
|
|
|||
|
|
@ -5,9 +5,13 @@ const FilesCollectionSorter = require('./modules/collection-sorter.js')
|
|||
const Calendar = require('./modules/calendar.js')
|
||||
const Masks = require('./modules/masks.js')
|
||||
const PdfViewer = require('./modules/pdf-viewer.js')
|
||||
const EstablishmentGroupsChoices = require('./modules/establishment-groups-choices.js')
|
||||
const Choices = require('./modules/choices')
|
||||
|
||||
new AddressAutocomplete()
|
||||
new FilesCollectionSorter()
|
||||
new Calendar()
|
||||
new Masks()
|
||||
new PdfViewer()
|
||||
new EstablishmentGroupsChoices()
|
||||
new Choices()
|
||||
|
|
|
|||
16
assets/js/modules/choices.js
Normal file
16
assets/js/modules/choices.js
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const Choices = require('choices.js')
|
||||
const $ = require('jquery')
|
||||
|
||||
const addJschoice = () => {
|
||||
document.querySelectorAll('*[data-jschoice]').forEach((item) => {
|
||||
return new Choices(item, {
|
||||
searchFields: ['label'],
|
||||
searchResultLimit: 30,
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = () => {
|
||||
$('*[data-collection]').on('collection.update', addJschoice)
|
||||
$('body').on('shown.bs.modal', '.modal', addJschoice)
|
||||
}
|
||||
52
assets/js/modules/establishment-groups-choices.js
Normal file
52
assets/js/modules/establishment-groups-choices.js
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
const $ = require("jquery")
|
||||
const Choices = require("choices.js")
|
||||
|
||||
class EstablishmentGroupsChoices {
|
||||
constructor() {
|
||||
this.setEstablishmentGroupsChoices()
|
||||
}
|
||||
|
||||
setEstablishmentGroupsChoices() {
|
||||
if ($("#intervention_establishmentGroup").length) {
|
||||
let intervention_establishment = document.getElementById(
|
||||
"intervention_establishment",
|
||||
)
|
||||
let intervention_establishmentChoices = new Choices(
|
||||
intervention_establishment,
|
||||
{
|
||||
searchFields: ["label"],
|
||||
searchResultLimit: 30,
|
||||
},
|
||||
)
|
||||
let establishmentGroupsChoices = this
|
||||
this.updateEstablishmentGroup()
|
||||
|
||||
intervention_establishment.addEventListener(
|
||||
"hideDropdown",
|
||||
function (event) {
|
||||
establishmentGroupsChoices.updateEstablishmentGroup()
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
updateEstablishmentGroup() {
|
||||
$("#intervention_establishmentGroup option").each(function (i, elm) {
|
||||
if (
|
||||
parseInt($(elm).data("establishment")) ===
|
||||
parseInt($("#intervention_establishment").val())
|
||||
) {
|
||||
$(elm).prop("disabled", false)
|
||||
$(elm).show()
|
||||
} else {
|
||||
$(elm).prop("disabled", true)
|
||||
$(elm).hide()
|
||||
}
|
||||
if ($(elm).is(":selected") && $(elm).is(":disabled")) {
|
||||
$(elm).prop("selected", false)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = EstablishmentGroupsChoices
|
||||
11543
composer.lock
generated
Normal file
11543
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -10,8 +10,9 @@
|
|||
"dependencies": {
|
||||
"chunk": "^0.0.3",
|
||||
"inputmask": "^5.0.8-beta.17",
|
||||
"murph-project": "^1",
|
||||
"murph-project": "~1.9.4",
|
||||
"pdfobject": "^2.2.8",
|
||||
"vue-fragment": "^1.5.2"
|
||||
}
|
||||
},
|
||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
namespace App\Bundle;
|
||||
|
||||
use App\DependencyInjection\AppExtension;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class AppBundle extends Bundle
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,7 +2,12 @@
|
|||
|
||||
namespace App\Command;
|
||||
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Event;
|
||||
use App\Entity\Project;
|
||||
use App\Entity\Speaker;
|
||||
use App\Factory\EventFactory;
|
||||
use App\Repository\EventRepositoryQuery;
|
||||
use App\Repository\ProjectRepositoryQuery;
|
||||
use App\Repository\SpeakerRepositoryQuery;
|
||||
use App\Security\OpenSSL;
|
||||
|
|
@ -13,11 +18,6 @@ use Symfony\Component\Console\Command\Command;
|
|||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Repository\EventRepositoryQuery;
|
||||
use App\Factory\EventFactory;
|
||||
use App\Entity\Speaker;
|
||||
use App\Entity\Event;
|
||||
|
||||
#[AsCommand(
|
||||
name: 'caldav:sync',
|
||||
|
|
@ -109,7 +109,8 @@ class CaldavSyncCommand extends Command
|
|||
$event = $this->eventQuery->create()
|
||||
->where('.uid = :uid')
|
||||
->setParameter('uid', $calEvent->getUid())
|
||||
->findOne();
|
||||
->findOne()
|
||||
;
|
||||
|
||||
if (!$event) {
|
||||
$event = $this->eventFactory->createFromEvent($calEvent);
|
||||
|
|
|
|||
53
src/Command/UpdateEntityInterventionCommand.php
Normal file
53
src/Command/UpdateEntityInterventionCommand.php
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
namespace App\Command;
|
||||
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Repository\InterventionRepositoryQuery;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class UpdateEntityInterventionCommand extends Command
|
||||
{
|
||||
public function __construct(
|
||||
protected EntityManager $entityManager,
|
||||
protected InterventionRepositoryQuery $interventionQuery
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('update:entity:intervention')
|
||||
->setDescription('Update entity intervention between 2 migrations. Adding field establishmentGroup and removingEstablishmentGroups')
|
||||
->setHelp('')
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$interventions = $this->interventionQuery->create()->find();
|
||||
|
||||
foreach ($interventions as $intervention) {
|
||||
if (null !== $intervention->getEstablishmentGroupsOld()->first()) {
|
||||
$intervention->setEstablishmentGroup($intervention->getEstablishmentGroupsOld()[0]);
|
||||
|
||||
$this->entityManager->update($intervention, flush: false);
|
||||
}
|
||||
}
|
||||
|
||||
$this->entityManager->flush();
|
||||
|
||||
$output->writeln('Les entités interventions ont été mis à jour. Exécuter de nouveau la migration suivante. ');
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,45 +6,45 @@ use App\Core\Controller\Admin\Crud\CrudController;
|
|||
use App\Core\Crud\CrudConfiguration;
|
||||
use App\Core\Crud\Field;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Form\FileUploadHandler;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Bill as Entity;
|
||||
use App\Entity\BillPeer;
|
||||
use App\Event\EntityManagerEvent;
|
||||
use App\Factory\BillCategoryFactory;
|
||||
use App\Factory\BillFactory as Factory;
|
||||
use App\Form\BillType as Type;
|
||||
use App\Factory\BillVendorFactory;
|
||||
use App\Form\BillFilterType as FilterType;
|
||||
use App\Form\BillType as Type;
|
||||
use App\Repository\BillCategoryRepositoryQuery;
|
||||
use App\Repository\BillRepositoryQuery as RepositoryQuery;
|
||||
use App\Repository\BillVendorRepositoryQuery;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Form;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use App\Core\Form\FileUploadHandler;
|
||||
use Symfony\Component\Form\Form;
|
||||
use function Symfony\Component\String\u;
|
||||
use App\Repository\BillVendorRepositoryQuery;
|
||||
use App\Factory\BillVendorFactory;
|
||||
use App\Repository\BillCategoryRepositoryQuery;
|
||||
use App\Factory\BillCategoryFactory;
|
||||
use App\Event\EntityManagerEvent;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use App\Entity\BillPeer;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class BillAdminController extends CrudController
|
||||
{
|
||||
#[Route(path: "/admin/bill/{page}", name: "admin_bill_index", methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill/{page}', name: 'admin_bill_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/new", name: "admin_bill_new", methods: ['GET', 'POST'])]
|
||||
#[Route(path: '/admin/bill/new', name: 'admin_bill_new', methods: ['GET', 'POST'])]
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request, FileUploadHandler $fileUpload): Response
|
||||
{
|
||||
return $this->doNew(
|
||||
$factory->create(),
|
||||
$entityManager,
|
||||
$request,
|
||||
function(Entity $entity, Form $form, Request $request) use ($fileUpload) {
|
||||
function (Entity $entity, Form $form, Request $request) use ($fileUpload) {
|
||||
$directory = 'uploads/Factures/';
|
||||
|
||||
$fileUpload->handleForm(
|
||||
|
|
@ -58,19 +58,19 @@ class BillAdminController extends CrudController
|
|||
);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/show/{entity}", name: "admin_bill_show", methods: ['GET'])]
|
||||
#[Route(path: '/admin/bill/show/{entity}', name: 'admin_bill_show', methods: ['GET'])]
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/filter", name: "admin_bill_filter", methods: ['GET'])]
|
||||
#[Route(path: '/admin/bill/filter', name: 'admin_bill_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/edit/{entity}", name: "admin_bill_edit", methods: ['GET', 'POST'])]
|
||||
#[Route(path: '/admin/bill/edit/{entity}', name: 'admin_bill_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(
|
||||
Entity $entity,
|
||||
EntityManager $entityManager,
|
||||
|
|
@ -79,13 +79,12 @@ class BillAdminController extends CrudController
|
|||
BillCategoryRepositoryQuery $categoryQuery,
|
||||
BillCategoryFactory $categoryFactory,
|
||||
Request $request
|
||||
): Response
|
||||
{
|
||||
): Response {
|
||||
return $this->doEdit(
|
||||
$entity,
|
||||
$entityManager,
|
||||
$request,
|
||||
function(Entity $entity, Form $form, Request $request) use (
|
||||
function (Entity $entity, Form $form, Request $request) use (
|
||||
$entityManager,
|
||||
$vendorQuery,
|
||||
$vendorFactory,
|
||||
|
|
@ -99,7 +98,7 @@ class BillAdminController extends CrudController
|
|||
$value = $form->get($key)->getData();
|
||||
$customValue = $form->get(u('custom_'.$key)->camel())->getData();
|
||||
|
||||
if ($customValue !== null) {
|
||||
if (null !== $customValue) {
|
||||
if ($elements[2]) {
|
||||
$customValue = u($customValue)->upper();
|
||||
}
|
||||
|
|
@ -110,7 +109,7 @@ class BillAdminController extends CrudController
|
|||
->findOne()
|
||||
;
|
||||
|
||||
if ($value === null) {
|
||||
if (null === $value) {
|
||||
$value = $elements[1]->create($customValue);
|
||||
$entityManager->create($value);
|
||||
}
|
||||
|
|
@ -122,7 +121,7 @@ class BillAdminController extends CrudController
|
|||
);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/update_status/{entity}/{status}", name: "admin_bill_update_status", methods: ['GET'])]
|
||||
#[Route(path: '/admin/bill/update_status/{entity}/{status}', name: 'admin_bill_update_status', methods: ['GET'])]
|
||||
public function updateStatus(Entity $entity, int $status, EntityManager $entityManager, Request $request, EventDispatcherInterface $eventDispatcher): Response
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('update_status', $request->query->get('_token'))) {
|
||||
|
|
@ -143,25 +142,25 @@ class BillAdminController extends CrudController
|
|||
]);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/sort/{page}", name: "admin_bill_sort", methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill/sort/{page}', name: 'admin_bill_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/batch/{page}", name: "admin_bill_batch", methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill/batch/{page}', name: 'admin_bill_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/delete/{entity}", name: "admin_bill_delete", methods: ['DELETE', 'POST'])]
|
||||
#[Route(path: '/admin/bill/delete/{entity}', name: 'admin_bill_delete', methods: ['DELETE', 'POST'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill/inline_edit/{entity}/{context}/{label}", name: 'admin_bill_inline_edit', methods: ['GET', 'POST'])]
|
||||
#[Route(path: '/admin/bill/inline_edit/{entity}/{context}/{label}', name: 'admin_bill_inline_edit', methods: ['GET', 'POST'])]
|
||||
public function inlineEdit(string $context, string $label, Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doInlineEdit($context, $label, $entity, $entityManager, $request);
|
||||
|
|
@ -247,8 +246,8 @@ class BillAdminController extends CrudController
|
|||
'format' => 'd/m/Y',
|
||||
])
|
||||
->setField('index', 'Montant TTC', Field\TextField::class, [
|
||||
'property_builder' => function(EntityInterface $entity) {
|
||||
if ($entity->getAmountTtc() !== null) {
|
||||
'property_builder' => function (EntityInterface $entity) {
|
||||
if (null !== $entity->getAmountTtc()) {
|
||||
return sprintf('<span style="user-select: all">%01.2f</span> €', $entity->getAmountTtc());
|
||||
}
|
||||
},
|
||||
|
|
@ -257,8 +256,8 @@ class BillAdminController extends CrudController
|
|||
'attr' => ['class' => 'text-right'],
|
||||
])
|
||||
->setField('index', 'Montant HT', Field\TextField::class, [
|
||||
'property_builder' => function(EntityInterface $entity) {
|
||||
if ($entity->getAmountHt() !== null) {
|
||||
'property_builder' => function (EntityInterface $entity) {
|
||||
if (null !== $entity->getAmountHt()) {
|
||||
return sprintf('<span style="user-select: all">%01.2f</span> €', $entity->getAmountHt());
|
||||
}
|
||||
},
|
||||
|
|
@ -268,7 +267,7 @@ class BillAdminController extends CrudController
|
|||
])
|
||||
->setField('index', 'Statut', Field\ButtonField::class, [
|
||||
'property' => 'humanStatus',
|
||||
'button_attr_builder' => function(EntityInterface $entity) {
|
||||
'button_attr_builder' => function (EntityInterface $entity) {
|
||||
$classes = [
|
||||
0 => 'btn btn-sm btn-light',
|
||||
1 => 'btn btn-sm btn-warning',
|
||||
|
|
@ -278,7 +277,7 @@ class BillAdminController extends CrudController
|
|||
return ['class' => $classes[$entity->getStatus()]];
|
||||
},
|
||||
'sort' => ['status', '.status'],
|
||||
'inline_form' => function(FormBuilderInterface $builder) {
|
||||
'inline_form' => function (FormBuilderInterface $builder) {
|
||||
$builder->add('status', ChoiceType::class, [
|
||||
'choices' => BillPeer::choices(),
|
||||
'help' => 'Modifier cette valeur manuellement ne permet pas d\'envoyer des notifications par mail',
|
||||
|
|
|
|||
|
|
@ -18,49 +18,49 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
class BillCategoryAdminController extends CrudController
|
||||
{
|
||||
#[Route(path: "/admin/bill_category/{page}", name: "admin_bill_category_index", methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill_category/{page}', name: 'admin_bill_category_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_category/new", name: "admin_bill_category_new", methods: ['GET', 'POST'])]
|
||||
#[Route(path: '/admin/bill_category/new', name: 'admin_bill_category_new', methods: ['GET', 'POST'])]
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_category/show/{entity}", name: "admin_bill_category_show", methods: ['GET'])]
|
||||
#[Route(path: '/admin/bill_category/show/{entity}', name: 'admin_bill_category_show', methods: ['GET'])]
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_category/filter", name: "admin_bill_category_filter", methods: ['GET'])]
|
||||
#[Route(path: '/admin/bill_category/filter', name: 'admin_bill_category_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_category/edit/{entity}", name: "admin_bill_category_edit", methods: ['GET', 'POST'])]
|
||||
#[Route(path: '/admin/bill_category/edit/{entity}', name: 'admin_bill_category_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_category/sort/{page}", name: "admin_bill_category_sort", methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill_category/sort/{page}', name: 'admin_bill_category_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_category/batch/{page}", name: "admin_bill_category_batch", methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill_category/batch/{page}', name: 'admin_bill_category_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_category/delete/{entity}", name: "admin_bill_category_delete", methods: ['DELETE', 'POST'])]
|
||||
#[Route(path: '/admin/bill_category/delete/{entity}', name: 'admin_bill_category_delete', methods: ['DELETE', 'POST'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use App\Core\Entity\EntityInterface;
|
|||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\BillVendor as Entity;
|
||||
use App\Factory\BillVendorFactory as Factory;
|
||||
use App\Form\BillVendorType as Type;
|
||||
use App\Form\BillVendorFilterType as FilterType;
|
||||
use App\Form\BillVendorType as Type;
|
||||
use App\Repository\BillVendorRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
|
@ -19,49 +19,49 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
class BillVendorAdminController extends CrudController
|
||||
{
|
||||
#[Route(path: "/admin/bill_vendor/{page}", name: "admin_bill_vendor_index", methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill_vendor/{page}', name: 'admin_bill_vendor_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_vendor/new", name: "admin_bill_vendor_new", methods: ['GET', 'POST'])]
|
||||
#[Route(path: '/admin/bill_vendor/new', name: 'admin_bill_vendor_new', methods: ['GET', 'POST'])]
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_vendor/show/{entity}", name: "admin_bill_vendor_show", methods: ['GET'])]
|
||||
#[Route(path: '/admin/bill_vendor/show/{entity}', name: 'admin_bill_vendor_show', methods: ['GET'])]
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_vendor/filter", name: "admin_bill_vendor_filter", methods: ['GET'])]
|
||||
#[Route(path: '/admin/bill_vendor/filter', name: 'admin_bill_vendor_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_vendor/edit/{entity}", name: "admin_bill_vendor_edit", methods: ['GET', 'POST'])]
|
||||
#[Route(path: '/admin/bill_vendor/edit/{entity}', name: 'admin_bill_vendor_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_vendor/sort/{page}", name: "admin_bill_vendor_sort", methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill_vendor/sort/{page}', name: 'admin_bill_vendor_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_vendor/batch/{page}", name: "admin_bill_vendor_batch", methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
#[Route(path: '/admin/bill_vendor/batch/{page}', name: 'admin_bill_vendor_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: "/admin/bill_vendor/delete/{entity}", name: "admin_bill_vendor_delete", methods: ['DELETE', 'POST'])]
|
||||
#[Route(path: '/admin/bill_vendor/delete/{entity}', name: 'admin_bill_vendor_delete', methods: ['DELETE', 'POST'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use App\Core\Entity\EntityInterface;
|
|||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Conference as Entity;
|
||||
use App\Factory\ConferenceFactory as Factory;
|
||||
use App\Form\ConferenceType as Type;
|
||||
use App\Form\ConferenceFilterType as FilterType;
|
||||
use App\Form\ConferenceType as Type;
|
||||
use App\Repository\ConferenceRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
|
@ -109,13 +109,31 @@ class ConferenceAdminController extends CrudController
|
|||
|
||||
->setField('index', 'Label', Field\TextField::class, [
|
||||
'property' => 'label',
|
||||
'sort' => ['label', '.label'],
|
||||
])
|
||||
->setField('index', 'Theme type', Field\ButtonField::class, [
|
||||
'property' => 'themeType',
|
||||
'sort' => ['date', '.date'],
|
||||
'sort' => ['themeType', '.themeType'],
|
||||
'attr' => ['class' => 'col-3'],
|
||||
'button_attr' => ['class' => 'btn btn-sm btn-light'],
|
||||
])
|
||||
->setField('index', 'Speakers', Field\TextField::class, [
|
||||
'attr' => ['class' => 'col-md-2'],
|
||||
'raw' => true,
|
||||
'property_builder' => function (EntityInterface $entity) {
|
||||
$speakers = [];
|
||||
|
||||
foreach ($entity->getSpeakers() as $speaker) {
|
||||
$speakers[] = sprintf(
|
||||
'<button class="btn btn-sm btn-outline-%s mr-1">%s</button>',
|
||||
$speaker->getColor(),
|
||||
$speaker
|
||||
);
|
||||
}
|
||||
|
||||
return implode(' ', $speakers);
|
||||
},
|
||||
])
|
||||
->setField('index', 'Date', Field\DateField::class, [
|
||||
'property' => 'date',
|
||||
'format' => 'd/m/Y',
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use App\Core\Controller\Site\PageController;
|
|||
use App\Entity\Debriefing;
|
||||
use Knp\Snappy\Pdf;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
|
||||
|
||||
class DebriefingController extends PageController
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use App\Core\Entity\EntityInterface;
|
|||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Establishment as Entity;
|
||||
use App\Factory\EstablishmentFactory as Factory;
|
||||
use App\Form\EstablishmentType as Type;
|
||||
use App\Form\EstablishmentFilterType as FilterType;
|
||||
use App\Form\EstablishmentType as Type;
|
||||
use App\Repository\EstablishmentRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
|
@ -129,7 +129,7 @@ class EstablishmentAdminController extends CrudController
|
|||
'sort' => ['name', '.name'],
|
||||
])
|
||||
|
||||
->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
->setBatchAction('index', 'delete', 'Delete', function (EntityInterface $entity, EntityManager $manager) {
|
||||
$manager->delete($entity);
|
||||
})
|
||||
;
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class ExpenseReportAdminController extends CrudController
|
|||
throw $this->createAccessDeniedException();
|
||||
}
|
||||
|
||||
if ($entity->getTotalAmount() === 0.0) {
|
||||
if (0.0 === $entity->getTotalAmount()) {
|
||||
$this->addFlash('warning', 'Cette action est interdite car le total de la note de frais est 0.');
|
||||
|
||||
return $this->redirectToRoute('admin_expense_report_edit', [
|
||||
|
|
@ -200,7 +200,7 @@ class ExpenseReportAdminController extends CrudController
|
|||
throw $this->createAccessDeniedException();
|
||||
}
|
||||
|
||||
if ($entity->getTotalAmount() === 0.0) {
|
||||
if (0.0 === $entity->getTotalAmount()) {
|
||||
$this->addFlash('warning', 'Cette action est interdite car le total de la note de frais est 0.');
|
||||
|
||||
return $this->redirectToRoute('admin_expense_report_edit', [
|
||||
|
|
@ -262,6 +262,34 @@ class ExpenseReportAdminController extends CrudController
|
|||
]);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/expense_report/sort/{page}', name: 'admin_expense_report_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/expense_report/batch/{page}', name: 'admin_expense_report_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
if (!$this->isGranted('ROLE_TREASURER')) {
|
||||
$query->filterByUser($this->getUser());
|
||||
}
|
||||
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/expense_report/delete/{entity}', name: 'admin_expense_report_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
if (!$this->isGranted('ROLE_TREASURER')) {
|
||||
if ($entity->getUser()->getId() !== $entity->getUser()->getId()) {
|
||||
throw $this->createAccessDeniedException();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function beforeUpdate(EntityInterface $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
$deleteBills = $request->request->get($form->getName())['deleteBills']['bills'] ?? [];
|
||||
|
|
@ -296,34 +324,6 @@ class ExpenseReportAdminController extends CrudController
|
|||
$entity->setBills($bills);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/expense_report/sort/{page}', name: 'admin_expense_report_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/expense_report/batch/{page}', name: 'admin_expense_report_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
if (!$this->isGranted('ROLE_TREASURER')) {
|
||||
$query->filterByUser($this->getUser());
|
||||
}
|
||||
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/expense_report/delete/{entity}', name: 'admin_expense_report_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
if (!$this->isGranted('ROLE_TREASURER')) {
|
||||
if ($entity->getUser()->getId() !== $entity->getUser()->getId()) {
|
||||
throw $this->createAccessDeniedException();
|
||||
}
|
||||
}
|
||||
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use App\Core\Entity\EntityInterface;
|
|||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Intervention as Entity;
|
||||
use App\Factory\InterventionFactory as Factory;
|
||||
use App\Form\InterventionType as Type;
|
||||
use App\Form\InterventionFilterType as FilterType;
|
||||
use App\Form\InterventionType as Type;
|
||||
use App\Repository\InterventionRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
|
@ -74,7 +74,6 @@ class InterventionAdminController extends CrudController
|
|||
->setPageTitle('edit', 'Intervention {id}')
|
||||
->setPageTitle('new', 'Nouvelle intervention')
|
||||
->setPageTitle('show', 'Intervention {id}')
|
||||
|
||||
->setPageRoute('index', 'admin_intervention_index')
|
||||
->setPageRoute('new', 'admin_intervention_new')
|
||||
->setPageRoute('edit', 'admin_intervention_edit')
|
||||
|
|
@ -83,7 +82,6 @@ class InterventionAdminController extends CrudController
|
|||
->setPageRoute('batch', 'admin_intervention_batch')
|
||||
->setPageRoute('delete', 'admin_intervention_delete')
|
||||
->setPageRoute('filter', 'admin_intervention_filter')
|
||||
|
||||
->setForm('edit', Type::class, [])
|
||||
->setForm('new', Type::class)
|
||||
->setForm('filter', FilterType::class)
|
||||
|
|
@ -106,37 +104,50 @@ class InterventionAdminController extends CrudController
|
|||
// ->setAction('show', 'edit', true)
|
||||
|
||||
->setDefaultSort('index', 'date', 'desc')
|
||||
|
||||
->setView('form', 'admin/intervention/_form.html.twig')
|
||||
|
||||
->setField('index', 'Establishments', Field\TextField::class, [
|
||||
'property_builder' => function(EntityInterface $entity) {
|
||||
return implode('<br>', array_map(function($e) {
|
||||
return $e->getName();
|
||||
}, $entity->getEstablishments()->toArray()));
|
||||
->setField('index', 'Establishment', Field\TextField::class, [
|
||||
'property_builder' => function (EntityInterface $entity) {
|
||||
return $entity->getEstablishment();
|
||||
},
|
||||
'raw' => true,
|
||||
])
|
||||
->setField('index', 'Theme type', Field\ButtonField::class, [
|
||||
'property' => 'themeType',
|
||||
'sort' => ['date', '.date'],
|
||||
->setField('index', 'EstablishmentGroup', Field\ButtonField::class, [
|
||||
'property' => 'establishmentGroup',
|
||||
'sort' => ['establishmentGroup', '.establishmentGroup'],
|
||||
'attr' => ['class' => 'col-md-2'],
|
||||
'button_attr' => ['class' => 'btn btn-sm btn-light'],
|
||||
])
|
||||
->setField('index', 'Activity reference', Field\ButtonField::class, [
|
||||
'property' => 'activityReference',
|
||||
'sort' => ['activityReference', '.activityReference'],
|
||||
->setField('index', 'Theme type', Field\ButtonField::class, [
|
||||
'property' => 'themeType',
|
||||
'sort' => ['themeType', '.themeType'],
|
||||
'attr' => ['class' => 'col-md-2'],
|
||||
'button_attr' => ['class' => 'btn btn-sm btn-light'],
|
||||
])
|
||||
|
||||
->setField('index', 'Speakers', Field\TextField::class, [
|
||||
'attr' => ['class' => 'col-md-2'],
|
||||
'raw' => true,
|
||||
'property_builder' => function (EntityInterface $entity) {
|
||||
$speakers = [];
|
||||
|
||||
foreach ($entity->getSpeakers() as $speaker) {
|
||||
$speakers[] = sprintf(
|
||||
'<button class="btn btn-sm btn-outline-%s mr-1">%s</button>',
|
||||
$speaker->getColor(),
|
||||
$speaker
|
||||
);
|
||||
}
|
||||
|
||||
return implode('', $speakers);
|
||||
},
|
||||
])
|
||||
->setField('index', 'Date', Field\DateField::class, [
|
||||
'property' => 'date',
|
||||
'format' => 'd/m/Y',
|
||||
'sort' => ['date', '.date'],
|
||||
'attr' => ['class' => 'col-md-2'],
|
||||
])
|
||||
|
||||
->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
->setBatchAction('index', 'delete', 'Delete', function (EntityInterface $entity, EntityManager $manager) {
|
||||
$manager->delete($entity);
|
||||
})
|
||||
;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use App\Core\Entity\EntityInterface;
|
|||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\Project as Entity;
|
||||
use App\Factory\ProjectFactory as Factory;
|
||||
use App\Form\ProjectType as Type;
|
||||
use App\Form\ProjectFilterType as FilterType;
|
||||
use App\Form\ProjectType as Type;
|
||||
use App\Repository\ProjectRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
|
|
|||
123
src/Controller/PublicLevelAdminController.php
Normal file
123
src/Controller/PublicLevelAdminController.php
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Core\Controller\Admin\Crud\CrudController;
|
||||
use App\Core\Crud\CrudConfiguration;
|
||||
use App\Core\Crud\Field;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Manager\EntityManager;
|
||||
use App\Entity\PublicLevel as Entity;
|
||||
use App\Factory\PublicLevelFactory as Factory;
|
||||
use App\Form\PublicLevelType as Type;
|
||||
use App\Repository\PublicLevelRepositoryQuery as RepositoryQuery;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Session\Session;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class PublicLevelAdminController extends CrudController
|
||||
{
|
||||
#[Route(path: '/admin/public_level/{page}', name: 'admin_public_level_index', methods: ['GET'], requirements: ['page' => '\d+'])]
|
||||
public function index(RepositoryQuery $query, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doIndex($page, $query, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/public_level/new', name: 'admin_public_level_new', methods: ['GET', 'POST'])]
|
||||
public function new(Factory $factory, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doNew($factory->create(), $entityManager, $request);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/public_level/show/{entity}', name: 'admin_public_level_show', methods: ['GET'])]
|
||||
public function show(Entity $entity): Response
|
||||
{
|
||||
return $this->doShow($entity);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/public_level/filter', name: 'admin_public_level_filter', methods: ['GET'])]
|
||||
public function filter(Session $session): Response
|
||||
{
|
||||
return $this->doFilter($session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/public_level/edit/{entity}', name: 'admin_public_level_edit', methods: ['GET', 'POST'])]
|
||||
public function edit(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doEdit($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/public_level/sort/{page}', name: 'admin_public_level_sort', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function sort(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doSort($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/public_level/batch/{page}', name: 'admin_public_level_batch', methods: ['POST'], requirements: ['page' => '\d+'])]
|
||||
public function batch(RepositoryQuery $query, EntityManager $entityManager, Request $request, Session $session, int $page = 1): Response
|
||||
{
|
||||
return $this->doBatch($page, $query, $entityManager, $request, $session);
|
||||
}
|
||||
|
||||
#[Route(path: '/admin/public_level/delete/{entity}', name: 'admin_public_level_delete', methods: ['DELETE'])]
|
||||
public function delete(Entity $entity, EntityManager $entityManager, Request $request): Response
|
||||
{
|
||||
return $this->doDelete($entity, $entityManager, $request);
|
||||
}
|
||||
|
||||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
->setPageTitle('index', 'Niveaux')
|
||||
->setPageTitle('edit', '{name}')
|
||||
->setPageTitle('new', 'Niveau')
|
||||
->setPageTitle('show', '{name}')
|
||||
|
||||
->setPageRoute('index', 'admin_public_level_index')
|
||||
->setPageRoute('new', 'admin_public_level_new')
|
||||
->setPageRoute('edit', 'admin_public_level_edit')
|
||||
->setPageRoute('show', 'admin_public_level_show')
|
||||
->setPageRoute('sort', 'admin_public_level_sort')
|
||||
->setPageRoute('batch', 'admin_public_level_batch')
|
||||
->setPageRoute('delete', 'admin_public_level_delete')
|
||||
->setPageRoute('filter', 'admin_public_level_filter')
|
||||
|
||||
->setForm('edit', Type::class, [])
|
||||
->setForm('new', Type::class)
|
||||
// ->setForm('filter', Type::class)
|
||||
|
||||
// ->setMaxPerPage('index', 20)
|
||||
|
||||
// ->setIsSortableCollection('index', false)
|
||||
// ->setSortableCollectionProperty('sortOrder')
|
||||
|
||||
// ->setAction('index', 'new', true)
|
||||
->setAction('index', 'show', false)
|
||||
// ->setAction('index', 'edit', true)
|
||||
// ->setAction('index', 'delete', true)
|
||||
|
||||
// ->setAction('edit', 'back', true)
|
||||
->setAction('edit', 'show', false)
|
||||
// ->setAction('edit', 'delete', true)
|
||||
|
||||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
->setField('index', 'name', Field\TextField::class, [
|
||||
'property' => 'name',
|
||||
'sort' => ['name', '.name'],
|
||||
])
|
||||
->setDefaultSort('index', 'name', 'asc')
|
||||
|
||||
->setBatchAction('index', 'delete', 'Delete', function (EntityInterface $entity, EntityManager $manager) {
|
||||
$manager->delete($entity);
|
||||
})
|
||||
;
|
||||
}
|
||||
|
||||
protected function getSection(): string
|
||||
{
|
||||
return 'public_level';
|
||||
}
|
||||
}
|
||||
|
|
@ -115,7 +115,6 @@ class SpeakerAdminController extends CrudController
|
|||
|
||||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
->setDefaultSort('index', 'name')
|
||||
|
||||
->setFormOptions('new', [
|
||||
|
|
|
|||
|
|
@ -113,15 +113,15 @@ class TeamContactAdminController extends CrudController
|
|||
'attr' => ['class' => 'col-md-4'],
|
||||
])
|
||||
->setField('index', 'Téléphones', Field\TextField::class, [
|
||||
'property_builder' => function(EntityInterface $entity) {
|
||||
return implode("<br>", array_map(fn($e) => $e['value'], $entity->getPhones()));
|
||||
'property_builder' => function (EntityInterface $entity) {
|
||||
return implode('<br>', array_map(fn ($e) => $e['value'], $entity->getPhones()));
|
||||
},
|
||||
'raw' => true,
|
||||
'attr' => ['class' => 'col-md-4'],
|
||||
])
|
||||
->setField('index', 'Emails', Field\TextField::class, [
|
||||
'property_builder' => function(EntityInterface $entity) {
|
||||
return implode("<br>", array_map(fn($e) => $e['value'], $entity->getEmails()));
|
||||
'property_builder' => function (EntityInterface $entity) {
|
||||
return implode('<br>', array_map(fn ($e) => $e['value'], $entity->getEmails()));
|
||||
},
|
||||
'raw' => true,
|
||||
'attr' => ['class' => 'col-md-4'],
|
||||
|
|
|
|||
|
|
@ -104,6 +104,9 @@ class ThemeTypeAdminController extends CrudController
|
|||
// ->setAction('show', 'back', true)
|
||||
// ->setAction('show', 'edit', true)
|
||||
|
||||
// ->setAction('index', 'delete', false)
|
||||
// ->setAction('edit', 'delete', false)
|
||||
|
||||
->setField('index', 'Label', Field\TextField::class, [
|
||||
'property' => 'label',
|
||||
'sort' => ['label', '.label'],
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class ToolAdminController extends CrudController
|
|||
protected function getConfiguration(): CrudConfiguration
|
||||
{
|
||||
return CrudConfiguration::create()
|
||||
->setPageTitle('index', 'Outils et supports')
|
||||
->setPageTitle('index', 'Outils et capsules')
|
||||
->setPageTitle('edit', '{label}')
|
||||
->setPageTitle('new', 'Nouvel outil')
|
||||
->setPageTitle('show', '{label}')
|
||||
|
|
@ -109,8 +109,9 @@ class ToolAdminController extends CrudController
|
|||
'sort' => ['label', '.label'],
|
||||
])
|
||||
->setDefaultSort('index', 'label', 'asc')
|
||||
->setView('form', 'admin/tool/_form.html.twig')
|
||||
|
||||
->setBatchAction('index', 'delete', 'Delete', function(EntityInterface $entity, EntityManager $manager) {
|
||||
->setBatchAction('index', 'delete', 'Delete', function (EntityInterface $entity, EntityManager $manager) {
|
||||
$manager->delete($entity);
|
||||
})
|
||||
;
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ class Configuration implements ConfigurationInterface
|
|||
{
|
||||
public function getConfigTreeBuilder(): TreeBuilder
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('app');
|
||||
|
||||
return $treeBuilder;
|
||||
return new TreeBuilder('app');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\ContactRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
trait AddressTrait
|
||||
|
|
|
|||
|
|
@ -2,16 +2,17 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Doctrine\Timestampable;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\BillRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Doctrine\Timestampable;
|
||||
|
||||
#[ORM\Entity(repositoryClass: BillRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class Bill implements EntityInterface
|
||||
{
|
||||
use Timestampable;
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
|
|
@ -26,7 +27,7 @@ class Bill implements EntityInterface
|
|||
#[ORM\Column(nullable: true)]
|
||||
private ?float $amountHt = null;
|
||||
|
||||
#[ORM\Column(options: ["default" => 0])]
|
||||
#[ORM\Column(options: ['default' => 0])]
|
||||
private ?int $status = 0;
|
||||
|
||||
#[ORM\Column(type: Types::DATE_MUTABLE, nullable: true)]
|
||||
|
|
@ -46,8 +47,6 @@ class Bill implements EntityInterface
|
|||
#[ORM\JoinColumn(onDelete: 'SET NULL')]
|
||||
private ?BillCategory $category = null;
|
||||
|
||||
use Timestampable;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
|
|
|
|||
|
|
@ -2,17 +2,18 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Doctrine\Timestampable;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\BillCategoryRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Doctrine\Timestampable;
|
||||
|
||||
#[ORM\Entity(repositoryClass: BillCategoryRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class BillCategory implements EntityInterface
|
||||
{
|
||||
use Timestampable;
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
|
|
@ -24,8 +25,6 @@ class BillCategory implements EntityInterface
|
|||
#[ORM\OneToMany(mappedBy: 'category', targetEntity: Bill::class)]
|
||||
private Collection $bills;
|
||||
|
||||
use Timestampable;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->bills = new ArrayCollection();
|
||||
|
|
|
|||
|
|
@ -2,17 +2,18 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Doctrine\Timestampable;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\BillVendorRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Doctrine\Timestampable;
|
||||
|
||||
#[ORM\Entity(repositoryClass: BillVendorRepository::class)]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
class BillVendor implements EntityInterface
|
||||
{
|
||||
use Timestampable;
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
|
|
@ -24,8 +25,6 @@ class BillVendor implements EntityInterface
|
|||
#[ORM\OneToMany(mappedBy: 'vendor', targetEntity: Bill::class)]
|
||||
private Collection $bills;
|
||||
|
||||
use Timestampable;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->bills = new ArrayCollection();
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class Conference implements EntityInterface
|
|||
#[ORM\Column(type: 'integer')]
|
||||
protected $persons;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: ThemeType::class, inversedBy: 'conferences', cascade: ['persist', 'remove'])]
|
||||
#[ORM\ManyToOne(targetEntity: ThemeType::class, inversedBy: 'conferences', cascade: ['persist'])]
|
||||
#[ORM\JoinColumn(nullable: false)]
|
||||
protected $themeType;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use Doctrine\ORM\Mapping as ORM;
|
|||
#[ORM\Entity(repositoryClass: EstablishmentRepository::class)]
|
||||
class Establishment implements EntityInterface
|
||||
{
|
||||
use AddressTrait;
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
|
|
@ -19,8 +20,6 @@ class Establishment implements EntityInterface
|
|||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $name;
|
||||
|
||||
use AddressTrait;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: EstablishmentGroup::class, mappedBy: 'establishment', orphanRemoval: true, cascade: ['persist', 'remove'])]
|
||||
protected $establishmentGroups;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,15 @@ class EstablishmentGroup implements EntityInterface
|
|||
#[ORM\JoinColumn(nullable: false)]
|
||||
protected $establishment;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Intervention::class, mappedBy: 'establishmentGroups')]
|
||||
protected $interventions;
|
||||
#[ORM\ManyToMany(targetEntity: Intervention::class, mappedBy: 'establishmentGroupsOld')]
|
||||
protected $interventionsOld;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'establishmentGroup', targetEntity: Intervention::class)]
|
||||
private Collection $interventions;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->interventionsOld = new ArrayCollection();
|
||||
$this->interventions = new ArrayCollection();
|
||||
}
|
||||
|
||||
|
|
@ -65,6 +69,33 @@ class EstablishmentGroup implements EntityInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Intervention>
|
||||
*/
|
||||
public function getInterventionsOld(): Collection
|
||||
{
|
||||
return $this->interventionsOld;
|
||||
}
|
||||
|
||||
public function addInterventionOld(Intervention $intervention): self
|
||||
{
|
||||
if (!$this->interventionsOld->contains($intervention)) {
|
||||
$this->interventionsOld[] = $intervention;
|
||||
$intervention->addEstablishmentGroupOld($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeInterventionOld(Intervention $intervention): self
|
||||
{
|
||||
if ($this->interventionsOld->removeElement($intervention)) {
|
||||
$intervention->removeEstablishmentGroupOld($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Intervention>
|
||||
*/
|
||||
|
|
@ -73,20 +104,23 @@ class EstablishmentGroup implements EntityInterface
|
|||
return $this->interventions;
|
||||
}
|
||||
|
||||
public function addIntervention(Intervention $intervention): self
|
||||
public function addIntervention(Intervention $intervention): static
|
||||
{
|
||||
if (!$this->interventions->contains($intervention)) {
|
||||
$this->interventions[] = $intervention;
|
||||
$intervention->addEstablishmentGroup($this);
|
||||
$this->interventions->add($intervention);
|
||||
$intervention->setEstablishmentGroup($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeIntervention(Intervention $intervention): self
|
||||
public function removeIntervention(Intervention $intervention): static
|
||||
{
|
||||
if ($this->interventions->removeElement($intervention)) {
|
||||
$intervention->removeEstablishmentGroup($this);
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($intervention->getEstablishmentGroup() === $this) {
|
||||
$intervention->setEstablishmentGroup(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
|
|
|||
|
|
@ -57,16 +57,22 @@ class Intervention implements EntityInterface
|
|||
protected $comment;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: EstablishmentGroup::class, inversedBy: 'interventions')]
|
||||
protected $establishmentGroups;
|
||||
protected $establishmentGroupsOld;
|
||||
|
||||
#[ORM\Column(type: 'float', nullable: true)]
|
||||
protected $price;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'interventions')]
|
||||
private ?EstablishmentGroup $establishmentGroup = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $persons = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->speakers = new ArrayCollection();
|
||||
$this->tools = new ArrayCollection();
|
||||
$this->establishmentGroups = new ArrayCollection();
|
||||
$this->establishmentGroupsOld = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
|
@ -254,45 +260,35 @@ class Intervention implements EntityInterface
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getEstablishments(): ArrayCollection
|
||||
public function getEstablishment(): ?Establishment
|
||||
{
|
||||
$data = new ArrayCollection();
|
||||
|
||||
foreach ($this->getEstablishmentGroups() as $group) {
|
||||
if (!$data->contains($group->getEstablishment())) {
|
||||
$data->add($group->getEstablishment());
|
||||
}
|
||||
if ($this->getEstablishmentGroup()) {
|
||||
return $this->getEstablishmentGroup()->getEstablishment();
|
||||
}
|
||||
|
||||
$establishments = $data->toArray();
|
||||
|
||||
usort($establishments, function($a, $b) {
|
||||
return $a->getName() <=> $b->getName();
|
||||
});
|
||||
|
||||
return new ArrayCollection($establishments);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, EstablishmentGroup>
|
||||
*/
|
||||
public function getEstablishmentGroups(): Collection
|
||||
public function getEstablishmentGroupsOld(): Collection
|
||||
{
|
||||
return $this->establishmentGroups;
|
||||
return $this->establishmentGroupsOld;
|
||||
}
|
||||
|
||||
public function addEstablishmentGroup(EstablishmentGroup $establishmentGroup): self
|
||||
public function addEstablishmentGroupOld(EstablishmentGroup $establishmentGroup): self
|
||||
{
|
||||
if (!$this->establishmentGroups->contains($establishmentGroup)) {
|
||||
$this->establishmentGroups[] = $establishmentGroup;
|
||||
if (!$this->establishmentGroupsOld->contains($establishmentGroup)) {
|
||||
$this->establishmentGroupsOld[] = $establishmentGroup;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeEstablishmentGroup(EstablishmentGroup $establishmentGroup): self
|
||||
public function removeEstablishmentGroupOld(EstablishmentGroup $establishmentGroup): self
|
||||
{
|
||||
$this->establishmentGroups->removeElement($establishmentGroup);
|
||||
$this->establishmentGroupsOld->removeElement($establishmentGroup);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -308,4 +304,28 @@ class Intervention implements EntityInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEstablishmentGroup(): ?EstablishmentGroup
|
||||
{
|
||||
return $this->establishmentGroup;
|
||||
}
|
||||
|
||||
public function setEstablishmentGroup(?EstablishmentGroup $establishmentGroup): static
|
||||
{
|
||||
$this->establishmentGroup = $establishmentGroup;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPersons(): ?int
|
||||
{
|
||||
return $this->persons;
|
||||
}
|
||||
|
||||
public function setPersons(?int $persons): static
|
||||
{
|
||||
$this->persons = $persons;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
namespace App\Entity\Page;
|
||||
|
||||
use App\Core\Entity\Site\Page\Page;
|
||||
use App\Core\Entity\Site\Page as BlockEntity;
|
||||
use App\Core\Form\Site\Page as Block;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
|
|
|
|||
78
src/Entity/PublicLevel.php
Normal file
78
src/Entity/PublicLevel.php
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\PublicLevelRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: PublicLevelRepository::class)]
|
||||
class PublicLevel implements EntityInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Tool::class, mappedBy: 'publicLevels')]
|
||||
private Collection $tools;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->tools = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
{
|
||||
return $this->getName();
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public function setName(string $name): static
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Tool>
|
||||
*/
|
||||
public function getTools(): Collection
|
||||
{
|
||||
return $this->tools;
|
||||
}
|
||||
|
||||
public function addTool(Tool $tool): static
|
||||
{
|
||||
if (!$this->tools->contains($tool)) {
|
||||
$this->tools->add($tool);
|
||||
$tool->addPublicLevel($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeTool(Tool $tool): static
|
||||
{
|
||||
if ($this->tools->removeElement($tool)) {
|
||||
$tool->removePublicLevel($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,10 +4,10 @@ namespace App\Entity;
|
|||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\SpeakerRepository;
|
||||
use App\Security\EncryptedEntityInterface;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Security\EncryptedEntityInterface;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SpeakerRepository::class)]
|
||||
class Speaker implements EntityInterface, EncryptedEntityInterface
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\TeamContactRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
|
||||
#[ORM\Entity(repositoryClass: TeamContactRepository::class)]
|
||||
class TeamContact implements EntityInterface
|
||||
|
|
|
|||
|
|
@ -19,16 +19,20 @@ class ThemeType implements EntityInterface
|
|||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $label;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Conference::class, mappedBy: 'themeType', orphanRemoval: true)]
|
||||
#[ORM\OneToMany(targetEntity: Conference::class, mappedBy: 'themeType')]
|
||||
protected $conferences;
|
||||
|
||||
#[ORM\OneToMany(targetEntity: Intervention::class, mappedBy: 'themeType', orphanRemoval: true)]
|
||||
#[ORM\OneToMany(targetEntity: Intervention::class, mappedBy: 'themeType')]
|
||||
protected $interventions;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Tool::class, mappedBy: 'themeTypes')]
|
||||
private Collection $tools;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->conferences = new ArrayCollection();
|
||||
$this->interventions = new ArrayCollection();
|
||||
$this->tools = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
|
|
@ -112,4 +116,31 @@ class ThemeType implements EntityInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Tool>
|
||||
*/
|
||||
public function getTools(): Collection
|
||||
{
|
||||
return $this->tools;
|
||||
}
|
||||
|
||||
public function addTool(Tool $tool): static
|
||||
{
|
||||
if (!$this->tools->contains($tool)) {
|
||||
$this->tools->add($tool);
|
||||
$tool->addThemeType($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeTool(Tool $tool): static
|
||||
{
|
||||
if ($this->tools->removeElement($tool)) {
|
||||
$tool->removeThemeType($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Core\Entity\EntityInterface;
|
||||
use App\Repository\ToolRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use App\Core\Entity\EntityInterface;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ToolRepository::class)]
|
||||
class Tool implements EntityInterface
|
||||
|
|
@ -19,12 +20,29 @@ class Tool implements EntityInterface
|
|||
#[ORM\Column(type: 'string', length: 255)]
|
||||
protected $label;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: Intervention::class, mappedBy: 'tools', cascade: ['persist', 'remove'])]
|
||||
#[ORM\ManyToMany(targetEntity: Intervention::class, mappedBy: 'tools', cascade: ['persist'])]
|
||||
protected $interventions;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $averageTime = null;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: ThemeType::class, inversedBy: 'tools')]
|
||||
private Collection $themeTypes;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $equipment = null;
|
||||
|
||||
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: PublicLevel::class, inversedBy: 'tools')]
|
||||
private Collection $publicLevels;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->interventions = new ArrayCollection();
|
||||
$this->themeTypes = new ArrayCollection();
|
||||
$this->publicLevels = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function __toString()
|
||||
|
|
@ -75,4 +93,88 @@ class Tool implements EntityInterface
|
|||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAverageTime(): ?int
|
||||
{
|
||||
return $this->averageTime;
|
||||
}
|
||||
|
||||
public function setAverageTime(?int $averageTime): static
|
||||
{
|
||||
$this->averageTime = $averageTime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, ThemeType>
|
||||
*/
|
||||
public function getThemeTypes(): Collection
|
||||
{
|
||||
return $this->themeTypes;
|
||||
}
|
||||
|
||||
public function addThemeType(ThemeType $themeType): static
|
||||
{
|
||||
if (!$this->themeTypes->contains($themeType)) {
|
||||
$this->themeTypes->add($themeType);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeThemeType(ThemeType $themeType): static
|
||||
{
|
||||
$this->themeTypes->removeElement($themeType);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEquipment(): ?string
|
||||
{
|
||||
return $this->equipment;
|
||||
}
|
||||
|
||||
public function setEquipment(?string $equipment): static
|
||||
{
|
||||
$this->equipment = $equipment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDescription(): ?string
|
||||
{
|
||||
return $this->description;
|
||||
}
|
||||
|
||||
public function setDescription(?string $description): static
|
||||
{
|
||||
$this->description = $description;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, PublicLevel>
|
||||
*/
|
||||
public function getPublicLevels(): Collection
|
||||
{
|
||||
return $this->publicLevels;
|
||||
}
|
||||
|
||||
public function addPublicLevel(PublicLevel $publicLevel): static
|
||||
{
|
||||
if (!$this->publicLevels->contains($publicLevel)) {
|
||||
$this->publicLevels->add($publicLevel);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removePublicLevel(PublicLevel $publicLevel): static
|
||||
{
|
||||
$this->publicLevels->removeElement($publicLevel);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ namespace App\EventSubscriber;
|
|||
use App\Core\Entity\EntityInterface;
|
||||
use App\Core\Event\EntityManager\EntityManagerEvent;
|
||||
use App\Core\EventSubscriber\EntityManagerEventSubscriber;
|
||||
use App\Entity\Bill;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use App\Core\Slugify\Slugify;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use App\Core\Notification\MailNotifier;
|
||||
use App\Core\Slugify\Slugify;
|
||||
use App\Entity\Bill;
|
||||
use App\Repository\UserRepositoryQuery;
|
||||
use Symfony\Component\Filesystem\Filesystem;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
class BillEventSubscriber extends EntityManagerEventSubscriber
|
||||
{
|
||||
|
|
@ -23,8 +23,7 @@ class BillEventSubscriber extends EntityManagerEventSubscriber
|
|||
MailNotifier $notifier,
|
||||
UserRepositoryQuery $userQuery,
|
||||
UrlGeneratorInterface $urlGenerator
|
||||
)
|
||||
{
|
||||
) {
|
||||
$this->slugger = $slugger;
|
||||
$this->notifier = $notifier;
|
||||
$this->userQuery = $userQuery;
|
||||
|
|
@ -51,8 +50,10 @@ class BillEventSubscriber extends EntityManagerEventSubscriber
|
|||
|
||||
$this->notifier
|
||||
->setSubject('[Tinternet][Facture] '.$event->getEntity()->getHumanStatus())
|
||||
->addRecipientsByUsers($this->userQuery->where('.isTreasurer = true')->find(),
|
||||
true)
|
||||
->addRecipientsByUsers(
|
||||
$this->userQuery->where('.isTreasurer = true')->find(),
|
||||
true
|
||||
)
|
||||
->notify('mail/bill/status_updated.html.twig', [
|
||||
'entity' => $event->getEntity(),
|
||||
'user' => $event->getParams()['user'],
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@ use App\Core\Event\Setting\NavigationSettingEvent;
|
|||
use App\Core\EventSubscriber\NavigationSettingEventSubscriber as EventSubscriber;
|
||||
use App\Core\Setting\NavigationSettingManager;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
|
||||
/**
|
||||
* class NavigationSettingEventSubscriber.
|
||||
|
|
|
|||
|
|
@ -5,10 +5,9 @@ namespace App\EventSubscriber\Task;
|
|||
use App\Core\Event\Task\TaskInitEvent;
|
||||
use App\Core\Event\Task\TaskRunRequestedEvent;
|
||||
use App\Core\EventSubscriber\Task\TaskEventSubscriber;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
use Symfony\Component\Console\Output\BufferedOutput;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
use Symfony\Component\HttpKernel\KernelInterface;
|
||||
|
||||
class CaldavSyncEventSubscriber extends TaskEventSubscriber
|
||||
{
|
||||
|
|
|
|||
14
src/Factory/PublicLevelFactory.php
Normal file
14
src/Factory/PublicLevelFactory.php
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<?php
|
||||
|
||||
namespace App\Factory;
|
||||
|
||||
use App\Core\Factory\FactoryInterface;
|
||||
use App\Entity\PublicLevel as Entity;
|
||||
|
||||
class PublicLevelFactory implements FactoryInterface
|
||||
{
|
||||
public function create(): Entity
|
||||
{
|
||||
return new Entity();
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,6 @@ use Symfony\Component\Form\AbstractType;
|
|||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Form\DateRangeType;
|
||||
|
||||
class BillFilterType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,19 +3,19 @@
|
|||
namespace App\Form;
|
||||
|
||||
use App\Entity\Bill;
|
||||
use App\Entity\BillCategory;
|
||||
use App\Entity\BillPeer;
|
||||
use App\Entity\BillVendor;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
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\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\File;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use App\Entity\BillPeer;
|
||||
use App\Entity\BillCategory;
|
||||
|
||||
class BillType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,11 +2,9 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\BillVendor;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class BillVendorFilterType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@ namespace App\Form;
|
|||
|
||||
use App\Entity\Conference;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
|
||||
class ConferenceType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@
|
|||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Validator\Constraints\Email;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class ContactEmailType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
|
||||
class ContactPhoneType extends AbstractType
|
||||
|
|
|
|||
|
|
@ -3,10 +3,9 @@
|
|||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
|
||||
class DateRangeType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Core\Form\Type\TinymceTextareaType;
|
||||
use App\Entity\Debriefing;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Core\Form\Type\TinymceTextareaType;
|
||||
|
||||
class DebriefingType extends AbstractType
|
||||
{
|
||||
|
|
@ -40,7 +40,8 @@ class DebriefingType extends AbstractType
|
|||
'rows' => 15,
|
||||
],
|
||||
])
|
||||
->add('files',
|
||||
->add(
|
||||
'files',
|
||||
CollectionType::class,
|
||||
[
|
||||
'entry_type' => FileType::class,
|
||||
|
|
|
|||
|
|
@ -2,14 +2,12 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Entity\Establishment;
|
||||
use App\Entity\Project;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use App\Entity\Project;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
|
||||
class EstablishmentFilterType extends AbstractType
|
||||
{
|
||||
|
|
@ -24,7 +22,8 @@ class EstablishmentFilterType extends AbstractType
|
|||
'required' => false,
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('p')
|
||||
->orderBy('p.label', 'ASC');
|
||||
->orderBy('p.label', 'ASC')
|
||||
;
|
||||
},
|
||||
])
|
||||
;
|
||||
|
|
|
|||
|
|
@ -3,12 +3,9 @@
|
|||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Core\Form\FileManager\FilePickerType;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
class ExpenseReportDeleteBillType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,11 +3,10 @@
|
|||
namespace App\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Core\Form\FileManager\FilePickerType;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use Symfony\Component\Form\Extension\Core\Type\FileType;
|
||||
|
||||
class ExpenseReportNewBillType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ namespace App\Form;
|
|||
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Entity\ExpenseReport;
|
||||
use App\Entity\User;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
|
|
@ -11,7 +12,6 @@ use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
|||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Validator\Constraints\NotBlank;
|
||||
use App\Entity\User;
|
||||
|
||||
class ExpenseReportType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,24 +2,39 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Intervention;
|
||||
use App\Entity\Establishment;
|
||||
use App\Entity\Speaker;
|
||||
use App\Entity\ThemeType;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use App\Entity\Establishment;
|
||||
|
||||
class InterventionFilterType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('activityReference', null, [
|
||||
->add('themeType', EntityType::class, [
|
||||
'class' => ThemeType::class,
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
])
|
||||
->add('speakers', EntityType::class, [
|
||||
'class' => Speaker::class,
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
])
|
||||
->add('establishment', EntityType::class, [
|
||||
'class' => Establishment::class,
|
||||
'required' => false,
|
||||
'attr' => [
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,28 +2,27 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\Establishment;
|
||||
use App\Entity\EstablishmentGroup;
|
||||
use App\Entity\Intervention;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
|
||||
use App\Entity\Establishment;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
|
||||
class InterventionType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('activityReference')
|
||||
->add('date', null, [
|
||||
'html5' => true,
|
||||
'widget' => 'single_text',
|
||||
])
|
||||
->add('groups')
|
||||
->add('levels')
|
||||
->add('themeType')
|
||||
->add('persons')
|
||||
->add('themes', null, [
|
||||
'attr' => ['rows' => 5],
|
||||
])
|
||||
|
|
@ -31,15 +30,10 @@ class InterventionType extends AbstractType
|
|||
'attr' => ['rows' => 7],
|
||||
])
|
||||
->add('tools', null, [
|
||||
'expanded' => true,
|
||||
])
|
||||
->add('price', NumberType::class, [
|
||||
'attr' => [
|
||||
'step' => 0.01,
|
||||
'size' => 15,
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
'scale' => 2,
|
||||
'required' => false,
|
||||
'html5' => true,
|
||||
])
|
||||
->add('toolsDetails', null, [
|
||||
'attr' => ['rows' => 5],
|
||||
|
|
@ -56,22 +50,37 @@ class InterventionType extends AbstractType
|
|||
->add('speakers', null, [
|
||||
'expanded' => true,
|
||||
])
|
||||
->add('establishmentGroups', null, [
|
||||
'multiple' => true,
|
||||
'attr' => [
|
||||
'size' => 15,
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
'group_by' => function($choice, $key, $value) {
|
||||
return $choice->getEstablishment()->getName();
|
||||
},
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('g')
|
||||
->leftJoin('g.establishment', 'e')
|
||||
->addOrderBy('e.name', 'ASC')
|
||||
->addOrderBy('g.label', 'ASC');
|
||||
->add('establishment', EntityType::class, [
|
||||
'mapped' => false,
|
||||
'class' => Establishment::class,
|
||||
'placeholder' => 'Sélectionner un établissement',
|
||||
'data' => $options['data']->getEstablishment(),
|
||||
'query_builder' => function (EntityRepository $er): QueryBuilder {
|
||||
return $er->createQueryBuilder('e')
|
||||
->orderBy('e.name', 'ASC')
|
||||
;
|
||||
},
|
||||
])
|
||||
->add(
|
||||
'establishmentGroup',
|
||||
EntityType::class,
|
||||
[
|
||||
'class' => EstablishmentGroup::class,
|
||||
'multiple' => false,
|
||||
'placeholder' => 'Séléctionner une classe',
|
||||
'required' => true,
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('g')
|
||||
->leftJoin('g.establishment', 'e')
|
||||
->addOrderBy('e.name', 'ASC')
|
||||
->addOrderBy('g.label', 'ASC')
|
||||
;
|
||||
},
|
||||
'choice_attr' => function (?EstablishmentGroup $establishmentGroup): array {
|
||||
return $establishmentGroup ? ['data-establishment' => strtolower($establishmentGroup->getEstablishment()->getId())] : [];
|
||||
},
|
||||
]
|
||||
)
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Entity\Project;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Symfony\Component\Form\Extension\Core\Type\NumberType;
|
||||
|
||||
class ProjectType extends AbstractType
|
||||
{
|
||||
|
|
@ -24,7 +24,8 @@ class ProjectType extends AbstractType
|
|||
],
|
||||
'query_builder' => function (EntityRepository $er) {
|
||||
return $er->createQueryBuilder('e')
|
||||
->addOrderBy('e.name', 'ASC');
|
||||
->addOrderBy('e.name', 'ASC')
|
||||
;
|
||||
},
|
||||
])
|
||||
->add('price', NumberType::class, [
|
||||
|
|
@ -44,7 +45,8 @@ class ProjectType extends AbstractType
|
|||
->add('client', null, [
|
||||
'attr' => ['rows' => 7],
|
||||
])
|
||||
->add('files',
|
||||
->add(
|
||||
'files',
|
||||
CollectionType::class,
|
||||
[
|
||||
'entry_type' => FileType::class,
|
||||
|
|
|
|||
25
src/Form/PublicLevelType.php
Normal file
25
src/Form/PublicLevelType.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\PublicLevel;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PublicLevelType extends AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name')
|
||||
;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => PublicLevel::class,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,10 +4,10 @@ namespace App\Form;
|
|||
|
||||
use App\Entity\Speaker;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
|
||||
class SpeakerType extends AbstractType
|
||||
{
|
||||
|
|
@ -31,14 +31,14 @@ class SpeakerType extends AbstractType
|
|||
if ($options['edit_caldav']) {
|
||||
$builder
|
||||
->add('caldavHost', null, [
|
||||
'help' => 'https://exemple.fr/remote.php/dav'
|
||||
'help' => 'https://exemple.fr/remote.php/dav',
|
||||
])
|
||||
->add('caldavUsername')
|
||||
->add('caldavPassword', PasswordType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('caldavCalendarUri', null, [
|
||||
'help' => '/remote.php/dav/calendars/johnDoe/myCalendar/'
|
||||
'help' => '/remote.php/dav/calendars/johnDoe/myCalendar/',
|
||||
])
|
||||
;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,12 +2,11 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
use App\Entity\TeamContact;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use App\Core\Form\Type\CollectionType;
|
||||
|
||||
class TeamContactType extends AbstractType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Core\Form\Type\TinymceTextareaType;
|
||||
use App\Entity\Tool;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
|
@ -13,6 +14,33 @@ class ToolType extends AbstractType
|
|||
{
|
||||
$builder
|
||||
->add('label')
|
||||
->add('averageTime')
|
||||
->add('themeTypes', null, [
|
||||
'attr' => [
|
||||
'size' => 15,
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
])
|
||||
->add(
|
||||
'publicLevels',
|
||||
null,
|
||||
[
|
||||
'attr' => [
|
||||
'size' => 15,
|
||||
'data-jschoice' => '',
|
||||
],
|
||||
]
|
||||
)
|
||||
->add('equipment', TinymceTextareaType::class, [
|
||||
'attr' => [
|
||||
'rows' => 40,
|
||||
],
|
||||
])
|
||||
->add('description', TinymceTextareaType::class, [
|
||||
'attr' => [
|
||||
'rows' => 40,
|
||||
],
|
||||
])
|
||||
;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Form;
|
||||
|
||||
use App\Core\Form\UserType as BaseUserType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
class UserType extends BaseUserType
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\Persistence\ManagerRegistry;
|
|||
/**
|
||||
* @extends ServiceEntityRepository<BillCategory>
|
||||
*
|
||||
* @method BillCategory|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method BillCategory|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|BillCategory find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|BillCategory findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method BillCategory[] findAll()
|
||||
* @method BillCategory[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\BillCategoryRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class BillCategoryRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\Persistence\ManagerRegistry;
|
|||
/**
|
||||
* @extends ServiceEntityRepository<Bill>
|
||||
*
|
||||
* @method Bill|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Bill|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Bill find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Bill findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Bill[] findAll()
|
||||
* @method Bill[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\Persistence\ManagerRegistry;
|
|||
/**
|
||||
* @extends ServiceEntityRepository<BillVendor>
|
||||
*
|
||||
* @method BillVendor|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method BillVendor|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|BillVendor find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|BillVendor findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method BillVendor[] findAll()
|
||||
* @method BillVendor[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\BillVendorRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class BillVendorRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Conference|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Conference|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Conference find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Conference findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Conference[] findAll()
|
||||
* @method Conference[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -28,13 +28,6 @@ class ConferenceRepositoryQuery extends RepositoryQuery
|
|||
;
|
||||
}
|
||||
|
||||
protected function filterHandler(string $name, $value)
|
||||
{
|
||||
if ('themeType' === $name) {
|
||||
return $this->withThemeType($value);
|
||||
}
|
||||
}
|
||||
|
||||
public function latest(int $max = 5)
|
||||
{
|
||||
return $this
|
||||
|
|
@ -42,4 +35,11 @@ class ConferenceRepositoryQuery extends RepositoryQuery
|
|||
->setMaxResults($max)
|
||||
;
|
||||
}
|
||||
|
||||
protected function filterHandler(string $name, $value)
|
||||
{
|
||||
if ('themeType' === $name) {
|
||||
return $this->withThemeType($value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Debriefing|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Debriefing|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Debriefing find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Debriefing findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Debriefing[] findAll()
|
||||
* @method Debriefing[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\DebriefingRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class DebriefingRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method EstablishmentGroup|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method EstablishmentGroup|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|EstablishmentGroup find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|EstablishmentGroup findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method EstablishmentGroup[] findAll()
|
||||
* @method EstablishmentGroup[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\EstablishmentGroupRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class EstablishmentGroupRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Establishment|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Establishment|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Establishment find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Establishment findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Establishment[] findAll()
|
||||
* @method Establishment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Event|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Event|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Event find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Event findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Event[] findAll()
|
||||
* @method Event[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method ExpenseReport|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method ExpenseReport|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|ExpenseReport find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|ExpenseReport findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method ExpenseReport[] findAll()
|
||||
* @method ExpenseReport[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\ExpenseReportRepository as Repository;
|
||||
use App\Entity\User;
|
||||
use App\Repository\ExpenseReportRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class ExpenseReportRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
@ -18,6 +18,7 @@ class ExpenseReportRepositoryQuery extends RepositoryQuery
|
|||
{
|
||||
return $this
|
||||
->andWhere('.user = :user')
|
||||
->setParameter('user', $user->getId());
|
||||
->setParameter('user', $user->getId())
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Intervention|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Intervention|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Intervention find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Intervention findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Intervention[] findAll()
|
||||
* @method Intervention[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -13,17 +13,6 @@ class InterventionRepositoryQuery extends RepositoryQuery
|
|||
parent::__construct($repository, 'i', $paginator);
|
||||
}
|
||||
|
||||
protected function filterHandler(string $name, $value)
|
||||
{
|
||||
if ('establishment' === $name) {
|
||||
$this
|
||||
->leftJoin('.establishmentGroups', 'g')
|
||||
->andWhere('g.establishment = :establishment')
|
||||
->setParameter(':establishment', $value)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
public function latest(int $max = 5)
|
||||
{
|
||||
return $this
|
||||
|
|
@ -31,4 +20,29 @@ class InterventionRepositoryQuery extends RepositoryQuery
|
|||
->setMaxResults($max)
|
||||
;
|
||||
}
|
||||
|
||||
protected function filterHandler(string $name, $value)
|
||||
{
|
||||
if ('establishment' === $name) {
|
||||
$this
|
||||
->leftJoin('.establishmentGroup', 'g')
|
||||
->andWhere('g.establishment = :establishment')
|
||||
->setParameter(':establishment', $value)
|
||||
;
|
||||
}
|
||||
|
||||
if ('speakers' === $name) {
|
||||
$this
|
||||
->andWhere(':speaker MEMBER OF .speakers')
|
||||
->setParameter(':speaker', $value)
|
||||
;
|
||||
}
|
||||
|
||||
if ('themeType' === $name) {
|
||||
$this
|
||||
->andWhere(':themeType = .themeType')
|
||||
->setParameter(':themeType', $value)
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Project|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Project|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Project find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Project findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Project[] findAll()
|
||||
* @method Project[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
48
src/Repository/PublicLevelRepository.php
Normal file
48
src/Repository/PublicLevelRepository.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\PublicLevel;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<PublicLevel>
|
||||
*
|
||||
* @method null|PublicLevel find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|PublicLevel findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method PublicLevel[] findAll()
|
||||
* @method PublicLevel[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
class PublicLevelRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, PublicLevel::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return PublicLevel[] Returns an array of PublicLevel objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('p.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?PublicLevel
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
15
src/Repository/PublicLevelRepositoryQuery.php
Normal file
15
src/Repository/PublicLevelRepositoryQuery.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use App\Repository\PublicLevelRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class PublicLevelRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
||||
{
|
||||
parent::__construct($repository, 'p', $paginator);
|
||||
}
|
||||
}
|
||||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Speaker|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Speaker|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Speaker find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Speaker findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Speaker[] findAll()
|
||||
* @method Speaker[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\Persistence\ManagerRegistry;
|
|||
/**
|
||||
* @extends ServiceEntityRepository<TeamContact>
|
||||
*
|
||||
* @method TeamContact|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method TeamContact|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|TeamContact find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|TeamContact findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method TeamContact[] findAll()
|
||||
* @method TeamContact[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\TeamContactRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class TeamContactRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method ThemeType|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method ThemeType|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|ThemeType find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|ThemeType findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method ThemeType[] findAll()
|
||||
* @method ThemeType[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\ThemeTypeRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class ThemeTypeRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ use Doctrine\ORM\ORMException;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @method Tool|null find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method Tool|null findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method null|Tool find($id, $lockMode = null, $lockVersion = null)
|
||||
* @method null|Tool findOneBy(array $criteria, array $orderBy = null)
|
||||
* @method Tool[] findAll()
|
||||
* @method Tool[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
namespace App\Repository;
|
||||
|
||||
use App\Core\Repository\RepositoryQuery;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
use App\Repository\ToolRepository as Repository;
|
||||
use Knp\Component\Pager\PaginatorInterface;
|
||||
|
||||
class ToolRepositoryQuery extends RepositoryQuery
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,9 +6,8 @@ use App\Entity\User;
|
|||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
|
||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\PasswordUpgraderInterface;
|
||||
|
||||
class UserRepository extends ServiceEntityRepository implements PasswordUpgraderInterface
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ class OpenSSL
|
|||
|
||||
/**
|
||||
* Encrypts data by using the public key.
|
||||
*
|
||||
* @param mixed $data
|
||||
*/
|
||||
public function encrypt($data): ?string
|
||||
{
|
||||
|
|
@ -41,6 +43,8 @@ class OpenSSL
|
|||
|
||||
/**
|
||||
* Decrypts data by using the private key.
|
||||
*
|
||||
* @param mixed $data
|
||||
*/
|
||||
public function decrypt($data): ?string
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,19 +23,6 @@ class CaldavClient
|
|||
$this->password = $password;
|
||||
}
|
||||
|
||||
protected function getClient(): Client
|
||||
{
|
||||
if (null === $this->client) {
|
||||
$this->client = new Client([
|
||||
'baseUri' => $this->host,
|
||||
'userName' => $this->username,
|
||||
'password' => $this->password,
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
public function getEvents(string $calendarUri)
|
||||
{
|
||||
$body = '<c:calendar-query xmlns:d="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
|
||||
|
|
@ -71,6 +58,19 @@ class CaldavClient
|
|||
return $events;
|
||||
}
|
||||
|
||||
protected function getClient(): Client
|
||||
{
|
||||
if (null === $this->client) {
|
||||
$this->client = new Client([
|
||||
'baseUri' => $this->host,
|
||||
'userName' => $this->username,
|
||||
'password' => $this->password,
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->client;
|
||||
}
|
||||
|
||||
protected function createEvent(string $rawEvent): Event
|
||||
{
|
||||
preg_match_all('/
|
||||
|
|
|
|||
|
|
@ -21,11 +21,8 @@
|
|||
{% for item in entity.speakers %}
|
||||
<span class="btn btn-sm btn-{{ item.color }} mr-2">{{ item.name }}</span>
|
||||
{% endfor %}
|
||||
|
||||
{% for item in entity.establishments %}
|
||||
<span class="btn btn-sm btn-light border mr-2">{{ item.name }}</span>
|
||||
{% endfor %}
|
||||
|
||||
<span class="btn btn-sm btn-light border mr-2">{{ entity.establishment }}</span>
|
||||
|
||||
<span class="float-right btn btn-sm btn-light border">
|
||||
{{ entity.date|date('d/m/Y') }}
|
||||
</span>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{% for item in ['date', 'establishmentGroups', 'activityReference', 'groups', 'levels', 'price', 'speakers'] %}
|
||||
{% for item in ['date', 'establishment','establishmentGroup', 'persons', 'speakers'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -25,10 +25,17 @@
|
|||
|
||||
{{ include('@Core/admin/module/_menu_item.html.twig', {
|
||||
id: 'tool',
|
||||
label: 'Outils et supports',
|
||||
label: 'Outils et capsules',
|
||||
route: path('admin_tool_index'),
|
||||
icon: 'fa fa-dice-d6'
|
||||
}) }}
|
||||
|
||||
{{ include('@Core/admin/module/_menu_item.html.twig', {
|
||||
id: 'tool',
|
||||
label: 'Niveaux',
|
||||
route: path('admin_public_level_index'),
|
||||
icon: 'fa fa-solid fa-user-graduate'
|
||||
}) }}
|
||||
</ul>
|
||||
|
||||
{{ include('@Core/admin/module/_menu_section.html.twig', {label: 'Suivis'}) }}
|
||||
|
|
|
|||
13
templates/admin/tool/_form.html.twig
Normal file
13
templates/admin/tool/_form.html.twig
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{% for item in ['themeTypes', 'publicLevels', 'averageTime'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="col-md-9 pl-md-3 pr-md-3">
|
||||
{% for item in ['label', 'description', 'equipment'] %}
|
||||
{% include(configuration.view('form_widget', '@Core/admin/crud/_form_widget.html.twig')) with {form: form[item]} %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -7,17 +7,22 @@
|
|||
"Speakers": "Intervenant⋅e⋅s"
|
||||
"Establishment": "Établissement"
|
||||
"Establishments": "Établissements"
|
||||
"Establishment groups": "Classes et groupes"
|
||||
"Establishment group": "Classe ou groupe"
|
||||
"EstablishmentGroup": "Classe ou groupe"
|
||||
"Activity reference": "Activité de référence"
|
||||
"Comment": "Commentaire"
|
||||
"Groups": "Groupe(s)"
|
||||
"Levels": "Niveau(x)"
|
||||
"Themes": "Thématiques abordées"
|
||||
"Tools": "Outils et supports"
|
||||
"Tools details": "Détails outils et supports"
|
||||
"Theme types": "Thématiques"
|
||||
"Tools": "Outils et capsules"
|
||||
"Tools details": "Détails outils et capsules"
|
||||
"Public levels": "Niveaux"
|
||||
"Average time" : "Temps moyen (en min)"
|
||||
"Equipment": "Équipement"
|
||||
"Feedback": "Les retours des participant⋅e⋅s"
|
||||
"Vigilant points": "Point(s) de vigilance observé(s) par l'intervenant⋅e"
|
||||
"Persons": "Personnes"
|
||||
"Persons": "Nombre de personnes"
|
||||
"Theme type": "Type de thématique"
|
||||
"Topic": "Sujet"
|
||||
"Project": "Projet"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue