Browse Source

name for form col, debug link admin

v1
charly 3 years ago
parent
commit
1fd9deb9d0
7 changed files with 71 additions and 17 deletions
  1. +31
    -0
      migrations/Version20210930114405.php
  2. +1
    -1
      public/build/entrypoints.json
  3. +1
    -1
      public/build/manifest.json
  4. +2
    -3
      src/Controller/Admin/CollectifDataCrudController.php
  5. +18
    -12
      src/Controller/Admin/DashboardController.php
  6. +17
    -0
      src/Entity/CollectifData.php
  7. +1
    -0
      translations/admin.fr.yaml

+ 31
- 0
migrations/Version20210930114405.php View File

<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20210930114405 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}

public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE collectif_data ADD name VARCHAR(255) DEFAULT NULL');
}

public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE collectif_data DROP name');
}
}

+ 1
- 1
public/build/entrypoints.json View File

"/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js", "/build/vendors-node_modules_core-js_internals_export_js.2e873f33.js",
"/build/vendors-node_modules_core-js_internals_advance-string-index_js-node_modules_core-js_internals-bed4a0.74e1ccb1.js", "/build/vendors-node_modules_core-js_internals_advance-string-index_js-node_modules_core-js_internals-bed4a0.74e1ccb1.js",
"/build/vendors-node_modules_amcharts_amcharts4_charts_js-node_modules_amcharts_amcharts4_core_js-nod-680fc8.d2df4450.js", "/build/vendors-node_modules_amcharts_amcharts4_charts_js-node_modules_amcharts_amcharts4_core_js-nod-680fc8.d2df4450.js",
"/build/app-bulle.1628dbdd.js"
"/build/app-bulle.d8331347.js"
] ]
} }
} }

+ 1
- 1
public/build/manifest.json View File

"build/app-backend.js": "/build/app-backend.e87ef456.js", "build/app-backend.js": "/build/app-backend.e87ef456.js",
"build/app-frontend.css": "/build/app-frontend.2ddca656.css", "build/app-frontend.css": "/build/app-frontend.2ddca656.css",
"build/app-frontend.js": "/build/app-frontend.1e3b4ae2.js", "build/app-frontend.js": "/build/app-frontend.1e3b4ae2.js",
"build/app-bulle.js": "/build/app-bulle.1628dbdd.js",
"build/app-bulle.js": "/build/app-bulle.d8331347.js",
"build/runtime.js": "/build/runtime.ef68e0db.js", "build/runtime.js": "/build/runtime.ef68e0db.js",
"build/pdfmake.js": "/build/pdfmake.fbf70324.js", "build/pdfmake.js": "/build/pdfmake.fbf70324.js",
"build/canvg.js": "/build/canvg.881f9fc1.js", "build/canvg.js": "/build/canvg.881f9fc1.js",

+ 2
- 3
src/Controller/Admin/CollectifDataCrudController.php View File

{ {
$fields = array(); $fields = array();


$fields[] = TextField::new('name');
$fields[] = AssociationField::new('territory') $fields[] = AssociationField::new('territory')
->setTemplatePath('crud/field/association.html.twig'); ->setTemplatePath('crud/field/association.html.twig');
$fields[] = IntegerField::new('nbParticipant'); $fields[] = IntegerField::new('nbParticipant');
$hasAccess = $this->isGranted('ROLE_ADMIN'); $hasAccess = $this->isGranted('ROLE_ADMIN');
if ($hasAccess) { if ($hasAccess) {
$fields[] = StatusField::new('status') $fields[] = StatusField::new('status')
->setFormTypeOption('data', 0)
->setFormTypeOption('choices', ['Validé' => 1, 'En attente' => 0]) ->setFormTypeOption('choices', ['Validé' => 1, 'En attente' => 0])
->setCustomOption('toggle_label', 'Valider') ->setCustomOption('toggle_label', 'Valider')
->hideOnIndex(); ->hideOnIndex();
EntityDto $entityDto, EntityDto $entityDto,
FieldCollection $fields, FieldCollection $fields,
FilterCollection $filters FilterCollection $filters
): QueryBuilder
{
): QueryBuilder {
$queryBuilder = parent::createIndexQueryBuilder( $queryBuilder = parent::createIndexQueryBuilder(
$searchDto, $searchDto,
$entityDto, $entityDto,

+ 18
- 12
src/Controller/Admin/DashboardController.php View File

public function configureMenuItems(): iterable public function configureMenuItems(): iterable
{ {
$urlNewCollectif = $this->adminUrlGenerator $urlNewCollectif = $this->adminUrlGenerator
->unsetAll()
->setController(CollectifDataCrudController::class) ->setController(CollectifDataCrudController::class)
->setAction(Action::NEW) ->setAction(Action::NEW)
->set('menuIndex', 4) ->set('menuIndex', 4)
->generateUrl(); ->generateUrl();


$urlOfflineCollectif = $this->adminUrlGenerator $urlOfflineCollectif = $this->adminUrlGenerator
->setController(CollectifDataCrudController::class)
->setAction(Action::INDEX)
->set('status', 0)
->set('menuIndex', 4)
->set('submenuIndex', 0)
->generateUrl();
->unsetAll()
->setController(CollectifDataCrudController::class)
->setAction(Action::INDEX)
->set('status', 0)
->set('menuIndex', 4)
->set('submenuIndex', 0)
->generateUrl();


$urlOnlineCollectif = $this->adminUrlGenerator $urlOnlineCollectif = $this->adminUrlGenerator
->unsetAll()
->setController(CollectifDataCrudController::class) ->setController(CollectifDataCrudController::class)
->setAction(Action::INDEX) ->setAction(Action::INDEX)
->set('status', 1) ->set('status', 1)
->generateUrl(); ->generateUrl();


$urlNewIndividuel = $this->adminUrlGenerator $urlNewIndividuel = $this->adminUrlGenerator
->unsetAll()
->setController(IndividualDataCrudController::class) ->setController(IndividualDataCrudController::class)
->setAction(Action::NEW) ->setAction(Action::NEW)
->set('menuIndex', 3) ->set('menuIndex', 3)
->generateUrl(); ->generateUrl();


$urlOfflineIndividuel = $this->adminUrlGenerator $urlOfflineIndividuel = $this->adminUrlGenerator
->setController(IndividualDataCrudController::class)
->setAction(Action::INDEX)
->set('status', 0)
->set('menuIndex', 3)
->set('submenuIndex', 0)
->generateUrl();
->unsetAll()
->setController(IndividualDataCrudController::class)
->setAction(Action::INDEX)
->set('status', 0)
->set('menuIndex', 3)
->set('submenuIndex', 0)
->generateUrl();


$urlOnlineIndividuel = $this->adminUrlGenerator $urlOnlineIndividuel = $this->adminUrlGenerator
->unsetAll()
->setController(IndividualDataCrudController::class) ->setController(IndividualDataCrudController::class)
->setAction(Action::INDEX) ->setAction(Action::INDEX)
->set('status', 1) ->set('status', 1)

+ 17
- 0
src/Entity/CollectifData.php View File

*/ */
private $id; private $id;


/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;

/** /**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="collectifData") * @ORM\ManyToOne(targetEntity=User::class, inversedBy="collectifData")
*/ */
return $this->id; return $this->id;
} }


public function getName(): ?string
{
return $this->name;
}

public function setName(string $name): self
{
$this->name = $name;

return $this;
}

public function getUser(): ?User public function getUser(): ?User
{ {
return $this->user; return $this->user;

+ 1
- 0
translations/admin.fr.yaml View File

nbRevolt: Révolte(s) nbRevolt: Révolte(s)
nbProjectBoost: Projet(s) boosté(s) nbProjectBoost: Projet(s) boosté(s)
nbProjectInspiring: Projet(s) inspirant(s) nbProjectInspiring: Projet(s) inspirant(s)
name: Nom
IndividualData: IndividualData:
label: Données individuel label: Données individuel
label_plurial: Données du formulaire individuel label_plurial: Données du formulaire individuel

Loading…
Cancel
Save