ソースを参照

carto map link to liste

v1
Charly 3年前
コミット
fef48c4865
19個のファイルの変更11817行の追加11832行の削除
  1. +9
    -0
      assets/app/frontend/js/script.js
  2. +51
    -1
      assets/app/frontend/scss/carto-carte.scss
  3. バイナリ
      public/assets/img/Picto-Loupe.png
  4. +190
    -0
      public/build/app-frontend.36f3c878.js
  5. +0
    -11152
      public/build/app-frontend.94f1a107.css
  6. +0
    -181
      public/build/app-frontend.9cc512c2.js
  7. +11194
    -0
      public/build/app-frontend.e9883437.css
  8. +2
    -2
      public/build/entrypoints.json
  9. バイナリ
      public/build/images/Picto-Loupe.516b7cc4.png
  10. +3
    -2
      public/build/manifest.json
  11. +51
    -14
      src/Controller/Frontend/CartoController.php
  12. +233
    -0
      src/Entity/AbstractData.php
  13. +7
    -199
      src/Entity/CollectifData.php
  14. +1
    -186
      src/Entity/IndividualData.php
  15. +7
    -7
      src/Form/SearchListForm.php
  16. +15
    -0
      src/Repository/TerritoryRepositoryQuery.php
  17. +34
    -0
      src/Repository/TerritoryStore.php
  18. +19
    -87
      templates/frontend/carto-carte.html.twig
  19. +1
    -1
      templates/frontend/carto-liste.html.twig

+ 9
- 0
assets/app/frontend/js/script.js ファイルの表示

@@ -3,8 +3,17 @@ $(document).ready(function () {
manageFormContact();
manageFormSearch();
manageFormIndiv();
initialisePopovers();
});

function initialisePopovers() {
$('[data-toggle="popover"]').popover({
html: true,
container: '.map',
placement: 'top',
});
}

function manageFormIndiv() {
document
.querySelectorAll('.add_item_link')

+ 51
- 1
assets/app/frontend/scss/carto-carte.scss ファイルの表示

@@ -39,19 +39,66 @@
padding: 10px 10px 40px;
position: relative;

.popover {
border: 2px solid $green;
border-radius: 0;

.popover-body {
color: $green;
font-family: dinbold;
padding: 0;

span {
padding: 10px 0 10px 50px;
display: inline-block;
}

a {
font-family: dinbold;
background-image: url($dir-img + 'Picto-Loupe.png');
background-repeat: no-repeat;
background-size: 20px;
background-position: 15px center;
color: $green;
display: inline-block;
width: 100%;
background-color: $yellow;
padding: 5px 0 5px 50px;
}
}

.arrow {
&:after {
border-top-color: $green;
}

&:before {
border-top-color: $green;
}
}
}

.img-map {
display: none;

img {
width: 75px;

&:hover {
cursor: pointer;
}
}
}

.img-vosges {
display: block;
position: absolute;
top: 257px;
left: 387px;
}

.img-belfort {
display: block;
position: absolute;
top: 493px;
left: 491px;
@@ -59,6 +106,7 @@
}

.img-hericourt {
display: block;
position: absolute;
top: 639px;
left: 217px;
@@ -66,13 +114,15 @@
}

.img-montbeliard {
display: block;
position: absolute;
top: 1003px;
left: 319px;
width: 160px;
}

.img-sud {
.img-sud_territoire {
display: block;
position: absolute;
top: 798px;
left: 746px;

バイナリ
public/assets/img/Picto-Loupe.png ファイルの表示

変更前 変更後
幅: 50  |  高さ: 51  |  サイズ: 901B

+ 190
- 0
public/build/app-frontend.36f3c878.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 11152
public/build/app-frontend.94f1a107.css
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 0
- 181
public/build/app-frontend.9cc512c2.js
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 11194
- 0
public/build/app-frontend.e9883437.css
ファイル差分が大きすぎるため省略します
ファイルの表示


+ 2
- 2
public/build/entrypoints.json ファイルの表示

@@ -118,10 +118,10 @@
"/build/vendors-node_modules_core-js_internals_array-iteration_js-node_modules_jquery_src_jquery_js.a55f993d.js",
"/build/vendors-node_modules_core-js_modules_es_string_split_js-node_modules_popper_js_dist_esm_popper_js.22d0763b.js",
"/build/vendors-node_modules_bootstrap_dist_js_bootstrap_js-node_modules_core-js_modules_es_array_for-85fc9f.e742e2fb.js",
"/build/app-frontend.9cc512c2.js"
"/build/app-frontend.36f3c878.js"
],
"css": [
"/build/app-frontend.94f1a107.css"
"/build/app-frontend.e9883437.css"
]
}
}

バイナリ
public/build/images/Picto-Loupe.516b7cc4.png ファイルの表示

変更前 変更後
幅: 50  |  高さ: 51  |  サイズ: 901B

+ 3
- 2
public/build/manifest.json ファイルの表示

@@ -17,8 +17,8 @@
"build/sov-ticket.js": "/build/sov-ticket.df76c7a0.js",
"build/app-backend.css": "/build/app-backend.3d882954.css",
"build/app-backend.js": "/build/app-backend.e87ef456.js",
"build/app-frontend.css": "/build/app-frontend.94f1a107.css",
"build/app-frontend.js": "/build/app-frontend.9cc512c2.js",
"build/app-frontend.css": "/build/app-frontend.e9883437.css",
"build/app-frontend.js": "/build/app-frontend.36f3c878.js",
"build/runtime.js": "/build/runtime.3095b250.js",
"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_modules_es_string_replace_js.06749256.js": "/build/vendors-node_modules_core-js_modules_es_string_replace_js.06749256.js",
@@ -66,5 +66,6 @@
"build/fonts/fa-regular-400.woff": "/build/fonts/fa-regular-400.36722648.woff",
"build/fonts/din_regular-webfont.woff2": "/build/fonts/din_regular-webfont.b4ef15d4.woff2",
"build/fonts/fa-regular-400.woff2": "/build/fonts/fa-regular-400.68c5af1f.woff2",
"build/images/Picto-Loupe.png": "/build/images/Picto-Loupe.516b7cc4.png",
"build/images/Picto-Envoyer.png": "/build/images/Picto-Envoyer.7553602c.png"
}

+ 51
- 14
src/Controller/Frontend/CartoController.php ファイルの表示

@@ -2,11 +2,14 @@

namespace App\Controller\Frontend;

use App\Entity\AbstractData;
use App\Form\SearchListForm;
use App\Repository\DreamStore;
use App\Repository\ProjectBoostStore;
use App\Repository\ProjectInspiringStore;
use App\Repository\RevoltStore;
use App\Repository\TerritoryStore;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\EntityManagerInterface;
use Dompdf\Dompdf;
use Dompdf\Options;
@@ -14,8 +17,8 @@ use Knp\Component\Pager\PaginatorInterface;
use Lc\SovBundle\Generator\CsvGenerator;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;
use ReflectionClass;

class CartoController extends DefaultController
{
@@ -24,6 +27,7 @@ class CartoController extends DefaultController
protected RevoltStore $revoltStore;
protected ProjectBoostStore $projectBoostStore;
protected ProjectInspiringStore $projectInspiringStore;
protected TerritoryStore $territoryStore;
protected PaginatorInterface $paginator;
protected Environment $templating;
protected ParameterBagInterface $parameterBag;
@@ -34,6 +38,7 @@ class CartoController extends DefaultController
RevoltStore $revoltStore,
ProjectBoostStore $projectBoostStore,
ProjectInspiringStore $projectInspiringStore,
TerritoryStore $territoryStore,
PaginatorInterface $paginator,
Environment $templating,
ParameterBagInterface $parameterBag
@@ -43,6 +48,7 @@ class CartoController extends DefaultController
$this->revoltStore = $revoltStore;
$this->projectBoostStore = $projectBoostStore;
$this->projectInspiringStore = $projectInspiringStore;
$this->territoryStore = $territoryStore;
$this->paginator = $paginator;
$this->templating = $templating;
$this->parameterBag = $parameterBag;
@@ -61,16 +67,20 @@ class CartoController extends DefaultController
public function cartoListe(Request $request)
{
$resultArrayPagination = array();
$form = $this->createForm(SearchListForm::class, null, [
'method' => 'GET',
]);

$form = $this->createForm(SearchListForm::class);
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
$data = $form->getData();

$resultArray = $this->generateResultArray($data);

if ($form->get('search_button')->isClicked()) {
if ($form->get('export_excel')->isClicked()) {
return $this->exportCsv($resultArray);
} elseif ($form->get('export_pdf')->isClicked()) {
return $this->exportPdf($resultArray);
} else {
$page = $data['page'];

$resultArrayPagination = $this->paginator->paginate(
@@ -78,10 +88,6 @@ class CartoController extends DefaultController
$page,
10
);
} elseif ($form->get('export_excel')->isClicked()) {
return $this->exportCsv($resultArray);
} elseif ($form->get('export_pdf')->isClicked()) {
return $this->exportPdf($resultArray);
}
}

@@ -104,20 +110,20 @@ class CartoController extends DefaultController
$territoryArray = $data['territory'];
$thematicArray = $data['thematic'];

if (in_array('dream', $categoryArray) || empty($categoryArray)) {
if (in_array(AbstractData::CATEGORY_DREAM, $categoryArray) || empty($categoryArray)) {
$dreamArray = $this->dreamStore->filterSearch($subthematic, $territoryArray, $thematicArray);
}
if (in_array('revolt', $categoryArray) || empty($categoryArray)) {
if (in_array(AbstractData::CATEGORY_REVOLT, $categoryArray) || empty($categoryArray)) {
$revoltArray = $this->revoltStore->filterSearch($subthematic, $territoryArray, $thematicArray);
}
if (in_array('projectBoost', $categoryArray) || empty($categoryArray)) {
if (in_array(AbstractData::CATEGORY_PROJECTBOOST, $categoryArray) || empty($categoryArray)) {
$projectBoostArray = $this->projectBoostStore->filterSearch(
$subthematic,
$territoryArray,
$thematicArray
);
}
if (in_array('projectInspiring', $categoryArray) || empty($categoryArray)) {
if (in_array(AbstractData::CATEGORY_PROJECTINSPIRING, $categoryArray) || empty($categoryArray)) {
$projectInspiringArray = $this->projectInspiringStore->filterSearch(
$subthematic,
$territoryArray,
@@ -130,9 +136,41 @@ class CartoController extends DefaultController

public function cartoCarte()
{
$resultArray = $this->generateAllResultArray();
$resultSortArray = array();
$territoryArray = $this->territoryStore->get();

foreach ($territoryArray as $territory) {
$resultSortArray[$territory->getDevAlias()] =
[
AbstractData::TERRITORY => "",
AbstractData::CATEGORY_REVOLT => "0",
AbstractData::CATEGORY_DREAM => "0",
AbstractData::CATEGORY_PROJECTBOOST => "0",
AbstractData::CATEGORY_PROJECTINSPIRING => "0",
];
}

foreach ($resultArray as $result) {
$className = (new ReflectionClass($result))->getShortName();
if ($result->getIndividualData()) {
$devAliasTerritory = $result->getIndividualData()->getTerritory()->getDevAlias();
$idTerritory = $result->getIndividualData()->getTerritory()->getId();
} elseif ($result->getCollectifData()->getTerritory()) {
$devAliasTerritory = $result->getCollectifData()->getTerritory()->getDevAlias();
$idTerritory = $result->getCollectifData()->getTerritory()->getId();
}

if (empty($resultSortArray[$devAliasTerritory][AbstractData::TERRITORY])) {
$resultSortArray[$devAliasTerritory][AbstractData::TERRITORY] = $idTerritory;
}
$resultSortArray[$devAliasTerritory][$className] = $resultSortArray[$devAliasTerritory][$className] + 1;
}

return $this->render(
'frontend/carto-carte.html.twig',
[
'resultSortArray' => $resultSortArray,
'nbContrib' => $this->countContrib()
]
);
@@ -159,7 +197,6 @@ class CartoController extends DefaultController
)
]);

// return new Response($html);
// Load HTML to Dompdf
$dompdf->loadHtml($html);


+ 233
- 0
src/Entity/AbstractData.php ファイルの表示

@@ -0,0 +1,233 @@
<?php

namespace App\Entity;

use App\Entity\User\User;
use App\Repository\AbstractDataRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Extension\StatusInterface;
use Lc\SovBundle\Doctrine\Extension\StatusTrait;

/**
* @ORM\MappedSuperclass()
*/
abstract class AbstractData implements StatusInterface, EntityInterface
{
use StatusTrait;

const TERRITORY = "Territory";
const CATEGORY_REVOLT = "Revolt";
const CATEGORY_DREAM = "Dream";
const CATEGORY_PROJECTBOOST = "ProjectBoost";
const CATEGORY_PROJECTINSPIRING = "ProjectInspiring";

const CATEGORY_LABEL_REVOLT = "Nos révoltes";
const CATEGORY_LABEL_DREAM = "Nos rêves";
const CATEGORY_LABEL_PROJECTBOOST = "Les actions à booster";
const CATEGORY_LABEL_PROJECTINSPIRING = "Les actions inspirantes";

static function getCategory(): array
{
return [
self::CATEGORY_LABEL_REVOLT => self::CATEGORY_REVOLT,
self::CATEGORY_LABEL_DREAM => self::CATEGORY_DREAM,
self::CATEGORY_LABEL_PROJECTBOOST => self::CATEGORY_PROJECTBOOST,
self::CATEGORY_LABEL_PROJECTINSPIRING => self::CATEGORY_PROJECTINSPIRING,
];
}

/**
* @ORM\OneToMany(targetEntity=Revolt::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
protected $revolt;

/**
* @ORM\OneToMany(targetEntity=Dream::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
protected $dream;

/**
* @ORM\OneToMany(targetEntity=ProjectBoost::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
protected $projectBoost;

/**
* @ORM\OneToMany(targetEntity=ProjectInspiring::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
protected $projectInspiring;

/**
* @ORM\ManyToOne(targetEntity=Territory::class, inversedBy="collectifData")
*/
protected $territory;

public function __construct()
{
$this->revolt = new ArrayCollection();
$this->dream = new ArrayCollection();
$this->projectBoost = new ArrayCollection();
$this->projectInspiring = new ArrayCollection();
}

public function getResume()
{
return count($this->getRevolt()) . " révolte(s) - " . count($this->getDream()) . " rêve(s) - " . count(
$this->getProjectBoost()
) . " projet(s) boosté(s) - " . count($this->getProjectInspiring()) . " projets inspirants";
}

public function getNbDream(): string
{
return count($this->getDream());
}

public function getNbRevolt(): string
{
return count($this->getRevolt());
}

public function getNbProjectBoost(): string
{
return count($this->getProjectBoost());
}

public function getNbProjectInspiring(): string
{
return count($this->getProjectInspiring());
}

/**
* @return Collection|Revolt[]
*/
public function getRevolt(): Collection
{
return $this->revolt;
}

public function addRevolt(Revolt $revolt): self
{
if (!$this->revolt->contains($revolt)) {
$this->revolt[] = $revolt;
$revolt->setCollectifData($this);
}

return $this;
}

public function removeRevolt(Revolt $revolt): self
{
if ($this->revolt->removeElement($revolt)) {
// set the owning side to null (unless already changed)
if ($revolt->getCollectifData() === $this) {
$revolt->setCollectifData(null);
}
}

return $this;
}

/**
* @return Collection|Dream[]
*/
public function getDream(): Collection
{
return $this->dream;
}

public function addDream(Dream $dream): self
{
if (!$this->dream->contains($dream)) {
$this->dream[] = $dream;
$dream->setCollectifData($this);
}

return $this;
}

public function removeDream(Dream $dream): self
{
if ($this->dream->removeElement($dream)) {
// set the owning side to null (unless already changed)
if ($dream->getCollectifData() === $this) {
$dream->setCollectifData(null);
}
}

return $this;
}

/**
* @return Collection|ProjectBoost[]
*/
public function getProjectBoost(): Collection
{
return $this->projectBoost;
}

public function addProjectBoost(ProjectBoost $projectBoost): self
{
if (!$this->projectBoost->contains($projectBoost)) {
$this->projectBoost[] = $projectBoost;
$projectBoost->setCollectifData($this);
}

return $this;
}

public function removeProjectBoost(ProjectBoost $projectBoost): self
{
if ($this->projectBoost->removeElement($projectBoost)) {
// set the owning side to null (unless already changed)
if ($projectBoost->getCollectifData() === $this) {
$projectBoost->setCollectifData(null);
}
}

return $this;
}

/**
* @return Collection|ProjectInspiring[]
*/
public function getProjectInspiring(): Collection
{
return $this->projectInspiring;
}

public function addProjectInspiring(ProjectInspiring $projectInspiring): self
{
if (!$this->projectInspiring->contains($projectInspiring)) {
$this->projectInspiring[] = $projectInspiring;
$projectInspiring->setCollectifData($this);
}

return $this;
}

public function removeProjectInspiring(ProjectInspiring $projectInspiring): self
{
if ($this->projectInspiring->removeElement($projectInspiring)) {
// set the owning side to null (unless already changed)
if ($projectInspiring->getCollectifData() === $this) {
$projectInspiring->setCollectifData(null);
}
}

return $this;
}

public function getTerritory(): ?Territory
{
return $this->territory;
}

public function setTerritory(?Territory $territory): self
{
$this->territory = $territory;

return $this;
}
}

+ 7
- 199
src/Entity/CollectifData.php ファイルの表示

@@ -14,10 +14,8 @@ use Lc\SovBundle\Doctrine\Extension\StatusTrait;
/**
* @ORM\Entity(repositoryClass=CollectifDataRepository::class)
*/
class CollectifData implements StatusInterface, EntityInterface
class CollectifData extends AbstractData
{
use StatusTrait;

/**
* @ORM\Id
* @ORM\GeneratedValue
@@ -25,96 +23,26 @@ class CollectifData implements StatusInterface, EntityInterface
*/
private $id;

/**
* @ORM\Column(type="integer")
*/
private $nbParticipant;

/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="collectifData")
*/
private $user;

/**
* @ORM\OneToMany(targetEntity=Revolt::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
private $revolt;

/**
* @ORM\OneToMany(targetEntity=Dream::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
private $dream;

/**
* @ORM\OneToMany(targetEntity=ProjectBoost::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
private $projectBoost;

/**
* @ORM\OneToMany(targetEntity=ProjectInspiring::class, mappedBy="collectifData", cascade={"persist", "remove"})
*/
private $projectInspiring;

/**
* @ORM\ManyToOne(targetEntity=Territory::class, inversedBy="collectifData")
* @ORM\Column(type="integer")
*/
private $territory;

public function __construct()
{
$this->revolt = new ArrayCollection();
$this->dream = new ArrayCollection();
$this->projectBoost = new ArrayCollection();
$this->projectInspiring = new ArrayCollection();
}
private $nbParticipant;

public function __toString()
{
return $this->nbParticipant . " participants";
}

public function getResume()
{
return count($this->getRevolt()) . " révolte(s) - " . count($this->getDream()) . " rêve(s) - " . count($this->getProjectBoost()) . " projet(s) boosté(s) - " . count($this->getProjectInspiring()) . " projets inspirants";
}

public function getNbDream():string
{
return count($this->getDream());
}

public function getNbRevolt():string
{
return count($this->getRevolt());
}

public function getNbProjectBoost():string
{
return count($this->getProjectBoost());
}

public function getNbProjectInspiring():string
{
return count($this->getProjectInspiring());
}

public function getId(): ?int
{
return $this->id;
}

public function getNbParticipant(): ?int
{
return $this->nbParticipant;
}

public function setNbParticipant(int $nbParticipant): self
{
$this->nbParticipant = $nbParticipant;

return $this;
}

public function getUser(): ?User
{
return $this->user;
@@ -127,134 +55,14 @@ class CollectifData implements StatusInterface, EntityInterface
return $this;
}

/**
* @return Collection|Revolt[]
*/
public function getRevolt(): Collection
{
return $this->revolt;
}

public function addRevolt(Revolt $revolt): self
{
if (!$this->revolt->contains($revolt)) {
$this->revolt[] = $revolt;
$revolt->setCollectifData($this);
}

return $this;
}

public function removeRevolt(Revolt $revolt): self
{
if ($this->revolt->removeElement($revolt)) {
// set the owning side to null (unless already changed)
if ($revolt->getCollectifData() === $this) {
$revolt->setCollectifData(null);
}
}

return $this;
}

/**
* @return Collection|Dream[]
*/
public function getDream(): Collection
{
return $this->dream;
}

public function addDream(Dream $dream): self
{
if (!$this->dream->contains($dream)) {
$this->dream[] = $dream;
$dream->setCollectifData($this);
}

return $this;
}

public function removeDream(Dream $dream): self
{
if ($this->dream->removeElement($dream)) {
// set the owning side to null (unless already changed)
if ($dream->getCollectifData() === $this) {
$dream->setCollectifData(null);
}
}

return $this;
}

/**
* @return Collection|ProjectBoost[]
*/
public function getProjectBoost(): Collection
{
return $this->projectBoost;
}

public function addProjectBoost(ProjectBoost $projectBoost): self
{
if (!$this->projectBoost->contains($projectBoost)) {
$this->projectBoost[] = $projectBoost;
$projectBoost->setCollectifData($this);
}

return $this;
}

public function removeProjectBoost(ProjectBoost $projectBoost): self
{
if ($this->projectBoost->removeElement($projectBoost)) {
// set the owning side to null (unless already changed)
if ($projectBoost->getCollectifData() === $this) {
$projectBoost->setCollectifData(null);
}
}

return $this;
}

/**
* @return Collection|ProjectInspiring[]
*/
public function getProjectInspiring(): Collection
{
return $this->projectInspiring;
}

public function addProjectInspiring(ProjectInspiring $projectInspiring): self
{
if (!$this->projectInspiring->contains($projectInspiring)) {
$this->projectInspiring[] = $projectInspiring;
$projectInspiring->setCollectifData($this);
}

return $this;
}

public function removeProjectInspiring(ProjectInspiring $projectInspiring): self
{
if ($this->projectInspiring->removeElement($projectInspiring)) {
// set the owning side to null (unless already changed)
if ($projectInspiring->getCollectifData() === $this) {
$projectInspiring->setCollectifData(null);
}
}

return $this;
}

public function getTerritory(): ?Territory
public function getNbParticipant(): ?int
{
return $this->territory;
return $this->nbParticipant;
}

public function setTerritory(?Territory $territory): self
public function setNbParticipant(int $nbParticipant): self
{
$this->territory = $territory;
$this->nbParticipant = $nbParticipant;

return $this;
}

+ 1
- 186
src/Entity/IndividualData.php ファイルの表示

@@ -13,9 +13,8 @@ use Lc\SovBundle\Doctrine\Extension\StatusTrait;
/**
* @ORM\Entity(repositoryClass=IndividualDataRepository::class)
*/
class IndividualData implements StatusInterface, EntityInterface
class IndividualData extends AbstractData
{
use StatusTrait;

/**
* @ORM\Id
@@ -49,64 +48,11 @@ class IndividualData implements StatusInterface, EntityInterface
*/
private $introAnswer;

/**
* @ORM\OneToMany(targetEntity=Revolt::class, mappedBy="individualData", cascade={"persist", "remove"})
*/
private $revolt;

/**
* @ORM\OneToMany(targetEntity=Dream::class, mappedBy="individualData", cascade={"persist", "remove"})
*/
private $dream;

/**
* @ORM\OneToMany(targetEntity=ProjectBoost::class, mappedBy="individualData", cascade={"persist", "remove"})
*/
private $projectBoost;

/**
* @ORM\OneToMany(targetEntity=ProjectInspiring::class, mappedBy="individualData", cascade={"persist", "remove"})
*/
private $projectInspiring;

/**
* @ORM\ManyToOne(targetEntity=Territory::class, inversedBy="individualData")
*/
private $territory;

public function __construct()
{
$this->revolt = new ArrayCollection();
$this->dream = new ArrayCollection();
$this->projectBoost = new ArrayCollection();
$this->projectInspiring = new ArrayCollection();
}

public function __toString()
{
return $this->firstname . " " . $this->lastname;
}

public function getNbDream(): string
{
return count($this->getDream());
}

public function getNbRevolt(): string
{
return count($this->getRevolt());
}

public function getNbProjectBoost(): string
{
return count($this->getProjectBoost());
}

public function getNbProjectInspiring(): string
{
return count($this->getProjectInspiring());
}

public function getId(): ?int
{
return $this->id;
@@ -172,135 +118,4 @@ class IndividualData implements StatusInterface, EntityInterface
return $this;
}

/**
* @return Collection|Revolt[]
*/
public function getRevolt(): Collection
{
return $this->revolt;
}

public function addRevolt(Revolt $revolt): self
{
if (!$this->revolt->contains($revolt)) {
$this->revolt[] = $revolt;
$revolt->setIndividualData($this);
}

return $this;
}

public function removeRevolt(Revolt $revolt): self
{
if ($this->revolt->removeElement($revolt)) {
// set the owning side to null (unless already changed)
if ($revolt->getIndividualData() === $this) {
$revolt->setIndividualData(null);
}
}

return $this;
}

/**
* @return Collection|Dream[]
*/
public function getDream(): Collection
{
return $this->dream;
}

public function addDream(Dream $dream): self
{
if (!$this->dream->contains($dream)) {
$this->dream[] = $dream;
$dream->setIndividualData($this);
}

return $this;
}

public function removeDream(Dream $dream): self
{
if ($this->dream->removeElement($dream)) {
// set the owning side to null (unless already changed)
if ($dream->getIndividualData() === $this) {
$dream->setIndividualData(null);
}
}

return $this;
}

/**
* @return Collection|ProjectBoost[]
*/
public function getProjectBoost(): Collection
{
return $this->projectBoost;
}

public function addProjectBoost(ProjectBoost $projectBoost): self
{
if (!$this->projectBoost->contains($projectBoost)) {
$this->projectBoost[] = $projectBoost;
$projectBoost->setIndividualData($this);
}

return $this;
}

public function removeProjectBoost(ProjectBoost $projectBoost): self
{
if ($this->projectBoost->removeElement($projectBoost)) {
// set the owning side to null (unless already changed)
if ($projectBoost->getIndividualData() === $this) {
$projectBoost->setIndividualData(null);
}
}

return $this;
}

/**
* @return Collection|ProjectInspiring[]
*/
public function getProjectInspiring(): Collection
{
return $this->projectInspiring;
}

public function addProjectInspiring(ProjectInspiring $projectInspiring): self
{
if (!$this->projectInspiring->contains($projectInspiring)) {
$this->projectInspiring[] = $projectInspiring;
$projectInspiring->setIndividualData($this);
}

return $this;
}

public function removeProjectInspiring(ProjectInspiring $projectInspiring): self
{
if ($this->projectInspiring->removeElement($projectInspiring)) {
// set the owning side to null (unless already changed)
if ($projectInspiring->getIndividualData() === $this) {
$projectInspiring->setIndividualData(null);
}
}

return $this;
}

public function getTerritory(): ?Territory
{
return $this->territory;
}

public function setTerritory(?Territory $territory): self
{
$this->territory = $territory;

return $this;
}
}

+ 7
- 7
src/Form/SearchListForm.php ファイルの表示

@@ -2,6 +2,7 @@

namespace App\Form;

use App\Entity\AbstractData;
use App\Entity\Territory;
use App\Entity\Thematic;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
@@ -37,10 +38,7 @@ class SearchListForm extends AbstractType
'expanded' => true,
'multiple' => true,
'choices' => [
'Nos révoltes' => 'revolt',
'Nos rêves' => 'dream',
'Les actions à booster' => 'projectBoost',
'Les actions inspirantes' => 'projectInspiring'
AbstractData::getCategory()
]
])
->add('thematic', EntityType::class, [
@@ -70,8 +68,10 @@ class SearchListForm extends AbstractType

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
$resolver->setDefaults(
[
'csrf_protection' => false,
]
);
}
}

+ 15
- 0
src/Repository/TerritoryRepositoryQuery.php ファイルの表示

@@ -0,0 +1,15 @@
<?php

namespace App\Repository;

use Knp\Component\Pager\PaginatorInterface;
use Lc\SovBundle\Repository\AbstractRepositoryQuery;
use Lc\SovBundle\Repository\RepositoryQueryInterface;

class TerritoryRepositoryQuery extends AbstractRepositoryQuery implements RepositoryQueryInterface
{
public function __construct(TerritoryRepository $repository, PaginatorInterface $paginator)
{
parent::__construct($repository, 'r', $paginator);
}
}

+ 34
- 0
src/Repository/TerritoryStore.php ファイルの表示

@@ -0,0 +1,34 @@
<?php

namespace App\Repository;


use Lc\SovBundle\Repository\AbstractStore;
use Lc\SovBundle\Repository\RepositoryQueryInterface;
use Lc\SovBundle\Repository\StoreInterface;

class TerritoryStore extends AbstractStore implements StoreInterface
{

public function __construct(TerritoryRepositoryQuery $query)
{
$this->query = $query;
}

public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
$query->orderBy('id');
return $query;
}

public function filtersDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
return $query;
}

public function relationsDefault(RepositoryQueryInterface $query): RepositoryQueryInterface
{
return $query;
}

}

+ 19
- 87
templates/frontend/carto-carte.html.twig ファイルの表示

@@ -45,100 +45,32 @@
</div>
</div>
</div>
<div class="help-legend">Cliquer sur les pictos pour découvrir les résultats de la consultation par territoire !</div>
<div class="help-legend">Cliquer sur les pictos pour découvrir les résultats de la consultation par territoire
!
</div>

<div class="map">
<img src="{{ 'assets/img/Carte-NFC.png' }}" alt="carte">

<div class="img-map img-vosges">
<a href="" title="">
<img src="{{ 'assets/img/Picto-Revoltes.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Reve.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Booster.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Inspirantes.png' }}" alt="">
</a>
</div>

<div class="img-map img-belfort">
<a href="" title="">
<img src="{{ 'assets/img/Picto-Revoltes.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Reve.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Booster.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Inspirantes.png' }}" alt="">
</a>
</div>

<div class="img-map img-hericourt">
<a href="" title="">
<img src="{{ 'assets/img/Picto-Revoltes.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Reve.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Booster.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Inspirantes.png' }}" alt="">
</a>
</div>
{% for key, result in resultSortArray %}
<div class="img-map img-{{ key }}">
{% set url = '<a href="'~ path('app_carto_liste', {search_list_form:{category:{'':constant('App\\Entity\\AbstractData::CATEGORY_REVOLT')}, territory:{'':result.Territory}}}) ~'">Consulter la liste</a>' %}
<img src="{{ 'assets/img/Picto-Revoltes.png' }}" alt="" data-toggle="popover"
data-content='<span>Nombre de Révoltes : {{ result.Revolt }} </span> {{ url }}'>

<div class="img-map img-montbeliard">
<a href="" title="">
<img src="{{ 'assets/img/Picto-Revoltes.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Reve.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Booster.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Inspirantes.png' }}" alt="">
</a>
</div>
{% set url = '<a href="'~ path('app_carto_liste', {search_list_form:{category:{'':constant('App\\Entity\\AbstractData::CATEGORY_DREAM')}, territory:{'':result.Territory}}}) ~'">Consulter la liste</a>' %}
<img src="{{ 'assets/img/Picto-Reve.png' }}" alt="" data-toggle="popover"
data-content='<span>Nombre de Rêves : {{ result.Dream }} </span> {{ url }}'>

<div class="img-map img-montbeliard">
<a href="" title="">
<img src="{{ 'assets/img/Picto-Revoltes.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Reve.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Booster.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Inspirantes.png' }}" alt="">
</a>
</div>
{% set url = '<a href="'~ path('app_carto_liste', {search_list_form:{category:{'':constant('App\\Entity\\AbstractData::CATEGORY_PROJECTBOOST')}, territory:{'':result.Territory}}}) ~'">Consulter la liste</a>' %}
<img src="{{ 'assets/img/Picto-Actions-Booster.png' }}" alt="" data-toggle="popover"
data-content='<span>Nombre de projets à booster : {{ result.ProjectBoost }} </span> {{ url }}'>

<div class="img-map img-sud">
<a href="" title="">
<img src="{{ 'assets/img/Picto-Revoltes.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Reve.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Booster.png' }}" alt="">
</a>
<a href="" title="">
<img src="{{ 'assets/img/Picto-Actions-Inspirantes.png' }}" alt="">
</a>
</div>
{% set url = '<a href="'~ path('app_carto_liste', {search_list_form:{category:{'':constant('App\\Entity\\AbstractData::CATEGORY_PROJECTINSPIRING')}, territory:{'':result.Territory}}}) ~'">Consulter la liste</a>' %}
<img src="{{ 'assets/img/Picto-Actions-Inspirantes.png' }}" alt="" data-toggle="popover"
data-content='<span>Nombre de projets inspirants : {{ result.ProjectInspiring }} </span> {{ url }}'>
</div>
{% endfor %}
</div>
</div>
{% endblock %}

+ 1
- 1
templates/frontend/carto-liste.html.twig ファイルの表示

@@ -4,7 +4,7 @@
{% block carto %}
<div id="carto-liste">
<h1 class="title-liste">La liste simple... et rêvolutionnaire !</h1>
{{ form_start(form, { 'attr' : { 'class': 'form-search' } }) }}
{{ form_start(form, { 'attr' : { 'class': 'form-search' }}) }}
<div class="row">
<div class="col-6">
{{ form_errors(form) }}

読み込み中…
キャンセル
保存