Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-mlc
kohinos
Commits
705bb256
Commit
705bb256
authored
Jan 25, 2019
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix doc faq rubrique news BO + add rubriques fixtures
parent
37c4180b
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
82 additions
and
33 deletions
+82
-33
fixtures-mlc-test.yaml
fixtures/fixtures-mlc-test.yaml
+8
-0
DocumentAdmin.php
src/Admin/DocumentAdmin.php
+22
-4
FaqAdmin.php
src/Admin/FaqAdmin.php
+20
-3
GroupeAdmin.php
src/Admin/GroupeAdmin.php
+1
-1
GroupeprestataireAdmin.php
src/Admin/GroupeprestataireAdmin.php
+4
-0
RubriqueAdmin.php
src/Admin/RubriqueAdmin.php
+7
-1
Comptoir.php
src/Entity/Comptoir.php
+0
-1
Document.php
src/Entity/Document.php
+0
-17
Faq.php
src/Entity/Faq.php
+2
-4
News.php
src/Entity/News.php
+0
-1
Prestataire.php
src/Entity/Prestataire.php
+1
-0
User.php
src/Entity/User.php
+17
-1
No files found.
fixtures/fixtures-mlc-test.yaml
View file @
705bb256
...
...
@@ -84,6 +84,7 @@ App\Entity\Adherent:
ecompte
:
'
<randomFloat(2,
0,
50)>'
# user (unique): '@user<numberBetween(1,10)>'
App\Entity\Prestataire
:
prestataire{1..21}
:
raison
:
'
<text(10)>'
...
...
@@ -111,6 +112,13 @@ App\Entity\Prestataire:
prestataireGroup
:
'
@groupe<numberBetween(1,
4)>'
horaires
:
"
<dayOfWeek()>
de
<time('H')>h
à
<time('H')>h"
App\Entity\Rubrique
:
rubrique{1..20}
:
name
:
<text(10)>
content
:
<text(50)>
enabled
:
true
prestataires
:
'
<numberBetween(1,
8)>x
@prestataire<numberBetween(1,
32)>'
App\Entity\User
:
usersuperadmin
:
username
:
'
adminuser'
...
...
src/Admin/DocumentAdmin.php
View file @
705bb256
...
...
@@ -2,17 +2,19 @@
namespace
App\Admin
;
use
App\Entity\User
;
use
FOS\CKEditorBundle\Form\Type\CKEditorType
;
use
Sonata\AdminBundle\Admin\AbstractAdmin
;
use
Sonata\AdminBundle\Datagrid\ListMapper
;
use
Sonata\AdminBundle\Form\FormMapper
;
use
Sonata\AdminBundle\Show\ShowMapper
;
use
Sonata\MediaBundle\Form\Type\MediaType
;
use
Symfony\Component\Form\Extension\Core\Type\CheckboxType
;
use
Symfony\Component\Form\Extension\Core\Type\HiddenType
;
use
Symfony\Component\Form\Extension\Core\Type\TextType
;
class
DocumentAdmin
extends
AbstractAdmin
{
/**
* {@inheritdoc}
*/
...
...
@@ -20,14 +22,29 @@ class DocumentAdmin extends AbstractAdmin
{
$document
=
$this
->
getSubject
();
$formMapper
->
add
(
'user'
,
HiddenType
::
class
,
array
(
'data'
=>
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'security.token_storage'
)
->
getToken
()
->
getUser
()
->
getId
(),
'data_class'
=>
null
,
'entity_class'
=>
User
::
class
,
'em'
=>
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'doctrine'
)
->
getEntityManager
()
))
->
add
(
'media'
,
MediaType
::
class
,
array
(
'provider'
=>
'sonata.media.provider.file'
,
'context'
=>
'document'
,
'label'
=>
'Document'
))
->
add
(
'name'
,
TextType
::
class
,
array
(
'label'
=>
'Titre :'
))
->
add
(
'
tex
t'
,
CKEditorType
::
class
,
array
(
->
add
(
'
conten
t'
,
CKEditorType
::
class
,
array
(
'label'
=>
'Texte'
,
'required'
=>
false
,
))
->
add
(
'media'
,
MediaType
::
class
,
array
(
'provider'
=>
'sonata.media.provider.image'
,
'context'
=>
'document'
))
->
add
(
'enabled'
,
CheckboxType
::
class
,
array
(
'label'
=>
'Activé ?'
,
'required'
=>
false
,
'label_attr'
=>
array
(
'class'
=>
'checkbox-inline'
)
))
;
}
...
...
@@ -39,8 +56,9 @@ class DocumentAdmin extends AbstractAdmin
unset
(
$this
->
listModes
[
'mosaic'
]);
$listMapper
->
addIdentifier
(
'name'
,
null
,
array
(
'label'
=>
'Titre'
))
->
addIdentifier
(
'
text'
,
'html'
,
array
(
'label'
=>
'Text
'
))
->
addIdentifier
(
'
content'
,
'html'
,
array
(
'truncate'
=>
array
(
'length'
=>
80
),
'label'
=>
'Description
'
))
->
addIdentifier
(
'media'
,
null
,
array
(
'label'
=>
'Fichier'
))
->
addIdentifier
(
'enabled'
,
null
,
array
(
'label'
=>
'Activé'
,
'datatype'
=>
'App.Document'
,
'template'
=>
'@SonataAdmin/Boolean/editable_boolean.html.twig'
))
;
}
}
src/Admin/FaqAdmin.php
View file @
705bb256
...
...
@@ -9,6 +9,8 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use
Sonata\AdminBundle\Form\FormMapper
;
use
Sonata\AdminBundle\Show\ShowMapper
;
use
Sonata\MediaBundle\Form\Type\MediaType
;
use
Symfony\Component\Form\Extension\Core\Type\CheckboxType
;
use
Symfony\Component\Form\Extension\Core\Type\HiddenType
;
use
Symfony\Component\Form\Extension\Core\Type\TextType
;
class
FaqAdmin
extends
AbstractAdmin
...
...
@@ -32,10 +34,23 @@ class FaqAdmin extends AbstractAdmin
))
->
add
(
'text'
,
CKEditorType
::
class
,
array
(
'label'
=>
'Texte'
,
'required'
=>
false
,
'required'
=>
false
))
->
add
(
'fichier'
,
MediaType
::
class
,
array
(
'provider'
=>
'sonata.media.provider.file'
,
'context'
=>
'faq'
,
'required'
=>
false
))
->
add
(
'image'
,
MediaType
::
class
,
array
(
'provider'
=>
'sonata.media.provider.image'
,
'context'
=>
'faq'
,
'required'
=>
false
))
->
add
(
'enabled'
,
CheckboxType
::
class
,
array
(
'label'
=>
'Activé ?'
,
'label_attr'
=>
array
(
'class'
=>
'checkbox-inline'
),
'required'
=>
false
))
->
add
(
'fichier'
,
MediaType
::
class
,
array
(
'provider'
=>
'sonata.media.provider.file'
,
'context'
=>
'faq'
))
->
add
(
'image'
,
MediaType
::
class
,
array
(
'provider'
=>
'sonata.media.provider.image'
,
'context'
=>
'faq'
))
;
}
...
...
@@ -50,6 +65,8 @@ class FaqAdmin extends AbstractAdmin
->
addIdentifier
(
'text'
,
'html'
,
array
(
'label'
=>
'Text'
))
->
addIdentifier
(
'fichier'
,
null
,
array
(
'label'
=>
'Fichier'
))
->
addIdentifier
(
'image'
,
null
,
array
(
'label'
=>
'Image'
))
->
addIdentifier
(
'user'
,
null
,
array
(
'label'
=>
'Utilisateur'
))
->
addIdentifier
(
'enabled'
,
null
,
array
(
'label'
=>
'Activé'
,
'datatype'
=>
'App.Document'
,
'template'
=>
'@SonataAdmin/Boolean/editable_boolean.html.twig'
))
;
}
}
src/Admin/GroupeAdmin.php
View file @
705bb256
...
...
@@ -38,7 +38,7 @@ class GroupeAdmin extends AbstractAdmin
{
$groupe
=
$this
->
getSubject
();
$formMapper
->
with
(
"Cr
e
ation d'un groupe"
)
->
with
(
"Cr
é
ation d'un groupe"
)
->
add
(
'siege'
,
HiddenType
::
class
,
array
(
'data'
=>
1
,
'data_class'
=>
null
,
...
...
src/Admin/GroupeprestataireAdmin.php
View file @
705bb256
...
...
@@ -39,6 +39,10 @@ class GroupeprestataireAdmin extends AbstractAdmin
'label'
=>
'Nom du groupe :'
,
'required'
=>
true
))
->
add
(
'content'
,
CKEditorType
::
class
,
array
(
'label'
=>
'Texte'
,
'required'
=>
false
,
))
->
add
(
'horaires'
,
TextareaType
::
class
,
array
(
'label'
=>
'Horaires :'
,
'required'
=>
false
...
...
src/Admin/RubriqueAdmin.php
View file @
705bb256
...
...
@@ -5,6 +5,7 @@ namespace App\Admin;
use
App\Entity\Comptoir
;
use
App\Entity\Prestataire
;
use
App\Entity\Siege
;
use
FOS\CKEditorBundle\Form\Type\CKEditorType
;
use
Sonata\AdminBundle\Admin\AbstractAdmin
;
use
Sonata\AdminBundle\Datagrid\ListMapper
;
use
Sonata\AdminBundle\Form\FormMapper
;
...
...
@@ -37,11 +38,15 @@ class RubriqueAdmin extends AbstractAdmin
{
$groupe
=
$this
->
getSubject
();
$formMapper
->
with
(
"Cr
e
ation d'une rubrique"
)
->
with
(
"Cr
é
ation d'une rubrique"
)
->
add
(
'name'
,
TextType
::
class
,
array
(
'label'
=>
'Nom :'
,
'required'
=>
true
))
->
add
(
'content'
,
CKEditorType
::
class
,
array
(
'label'
=>
'Description :'
,
'required'
=>
false
,
))
->
add
(
'prestataires'
,
CollectionType
::
class
,
array
(
'label'
=>
'Prestataires'
,
'entry_type'
=>
EntityType
::
class
,
...
...
@@ -78,6 +83,7 @@ class RubriqueAdmin extends AbstractAdmin
unset
(
$this
->
listModes
[
'mosaic'
]);
$listMapper
->
addIdentifier
(
'name'
,
null
,
array
(
'label'
=>
'Nom du groupe'
))
->
addIdentifier
(
'content'
,
'html'
,
array
(
'truncate'
=>
array
(
'length'
=>
80
),
'label'
=>
'Description'
))
->
add
(
'getPrestatairesCount'
,
null
,
...
...
src/Entity/Comptoir.php
View file @
705bb256
...
...
@@ -39,7 +39,6 @@ class Comptoir
/**
* @var \Application\Sonata\MediaBundle\Entity\Media
* @Assert\NotBlank()
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumn(name="media_id", referencedColumnName="id")
*/
...
...
src/Entity/Document.php
View file @
705bb256
...
...
@@ -45,11 +45,6 @@ class Document
private
$user
;
/**
* @ORM\Column(type="text", nullable=true)
*/
private
$text
;
/**
* @return int
*/
public
function
getId
()
:
int
...
...
@@ -94,18 +89,6 @@ class Document
return
$this
;
}
public
function
getText
()
:
?
string
{
return
$this
->
text
;
}
public
function
setText
(
?
string
$text
)
:
self
{
$this
->
text
=
$text
;
return
$this
;
}
public
function
__toString
()
:
string
{
return
$this
->
getTitle
()
?
$this
->
getTitle
()
:
'Document'
;
...
...
src/Entity/Faq.php
View file @
705bb256
...
...
@@ -35,17 +35,15 @@ class Faq
/**
* @var \Application\Sonata\MediaBundle\Entity\Media
* @Assert\NotBlank()
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumn(name="media_id", referencedColumnName="id")
* @ORM\JoinColumn(name="media_id", referencedColumnName="id"
, nullable=true
)
*/
protected
$fichier
;
/**
* @var \Application\Sonata\MediaBundle\Entity\Media
* @Assert\NotBlank()
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumn(name="media_id", referencedColumnName="id")
* @ORM\JoinColumn(name="media_id", referencedColumnName="id"
, nullable=true
)
*/
protected
$image
;
...
...
src/Entity/News.php
View file @
705bb256
...
...
@@ -33,7 +33,6 @@ class News
/**
* @var \Application\Sonata\MediaBundle\Entity\Media
* @Assert\NotBlank()
* @ORM\ManyToOne(targetEntity="App\Application\Sonata\MediaBundle\Entity\Media", cascade={"persist"}, fetch="LAZY")
* @ORM\JoinColumn(name="media_id", referencedColumnName="id")
*/
...
...
src/Entity/Prestataire.php
View file @
705bb256
...
...
@@ -153,6 +153,7 @@ class Prestataire
{
$this
->
users
=
new
ArrayCollection
();
$this
->
groupeprestataires
=
new
ArrayCollection
();
$this
->
rubriques
=
new
ArrayCollection
();
}
/**
...
...
src/Entity/User.php
View file @
705bb256
...
...
@@ -3,7 +3,9 @@
namespace
App\Entity
;
use
App\Entity\Adherent
;
use
App\Entity\Document
;
use
App\Entity\EmailToken
;
use
App\Entity\Faq
;
use
App\Entity\Flux
;
use
App\Entity\Prestataire
;
use
Doctrine\Common\Collections\ArrayCollection
;
...
...
@@ -59,11 +61,25 @@ class User extends BaseUser
/**
* @var ArrayCollection|Cotisation[]
*
* @ORM\OneToMany(targetEntity="Cotisation", mappedBy="user", cascade={"persist"}
, orphanRemoval=true
)
* @ORM\OneToMany(targetEntity="Cotisation", mappedBy="user", cascade={"persist"})
*/
private
$cotisations
;
/**
* @var ArrayCollection|Document[]
*
* @ORM\OneToMany(targetEntity="Document", mappedBy="user", cascade={"persist"})
*/
private
$documents
;
/**
* @var ArrayCollection|Faq[]
*
* @ORM\OneToMany(targetEntity="Faq", mappedBy="user", cascade={"persist"})
*/
private
$faqs
;
/**
* @ORM\OneToMany(targetEntity="Flux", mappedBy="operateur")
*/
protected
$flux
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment