diff --git a/.editorconfig b/.editorconfig index e266fdfcb..a3e5a0fc1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,6 +19,7 @@ max_line_length = 80 [COMMIT_EDITMSG] max_line_length = 0 -[*.{js, vue}] +[*.{js, vue, ts}] indent_size = 2 -indent_style = space \ No newline at end of file +indent_style = space + diff --git a/CHANGELOG.md b/CHANGELOG.md index 42f5a1522..3f61f05de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,19 +11,38 @@ and this project adheres to ## Unreleased -* [person] add civility when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) -* [person] add address when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) -* [person] add household creation API point (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) +* [storedobject] add title field on StoredObject entity + use it in activity documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604) +* [main] add a "read more..." on comment embeddable when overflown (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604) +* [person] add closing motive to closed acc course (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/603) +* [person] household filiation: fetch person info when unfolding person (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/586) +* [admin] repair edit of social action in the admin (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/601) +* [admin]: add select2 to Goal form type entity fields (https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/702) +* [main] allow hide permissions group list menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577) +* [main] allow hide change user password menu (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577) +* [main] filter user jobs by active jobs (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577) +* [main] add civility to User (entity, migration and form type) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/577) +* [admin] refactorisation of the admin section: reorganisation of the menu, translations, form types, new entities (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/592) +* [admin] add admin section for languages and countries (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/596) +* [activity] activity admin: translations + remove label field for comment on admin activity type (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/587) +* [main] admin user_job: improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/588) +* [address] can add extra address info even if noAddress (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/576) ## Test releases +### 2022-05-06 + +* [person] add civility when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) +* [person] add address when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) +* [person] add household creation API point (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) + ### 2021-04-29 * [person] prevent circular references in PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/527) * [person] add maritalStatusComment to PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/582) * Load relationships without gender in french fixtures * Add command to remove old draft accompanying periods +* [parcours]: If users assings him/herself as referrer and job is not null. Update parcours job (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/578) ### 2021-04-28 diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 5b9da225e..f1892e244 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -2,7 +2,14 @@ en cours de rédaction +## Translations + +Par bundle, toutes les traductions des pages twig se trouvent dans un seul fichier `translations/messages.fr.yaml`. + +## Emplacement des fichiers + +Les controllers, form type & templates twig sont placés à la racine des dossiers `Controller`, `Form` & `Ressources/views`, respectivement. Pour les pages Admin, on ne les mets plus dans des sous-dossiers Admin. ## Assets: nommage des entrypoints Trois types d'entrypoint: @@ -146,19 +153,20 @@ Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhai Les routes sont nommées de cette manière: -`chill_bundle_entite_action` +`chill_(api|crud)_bundle_(api)_entite_action` 1. d'abord chill_ (pour tous les modules chill) -2. ensuite une string qui est identique, par bundle -3. si le point est un point d'api (json), alors ajouter la string `api` -4. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités -5. ensuite une action (`list`, `view`, `edit`, `new`, ...) +2. ensuite `crud` ou `api`, optionnel, automatiquement ajouté si la route est générée par la configuration +3. ensuite une string qui indique le bundle (`main`, `person`, `activity`, ...) +4. ensuite, `api`, si la route est une route d'api. +5. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités +6. ensuite une action (`list`, `view`, `edit`, `new`, ...) -Le fait d'indiquer `api` en 3 permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`) +Le fait d'indiquer `api` en quatrième position permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`) Si les points 4 et 5 sont inexistants, alors ils sont remplacés par d'autres éléments de manière à garantir l'unicité de la route, et sa bonne compréhension. -### URL +### Nommage des URL Les URL respectent également une convention: @@ -219,6 +227,14 @@ Les éléments suivants devraient se trouver dans la liste: Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte. +#### Pour les URL de l'espace Admin + +Même conventions que dans les autres pages html de l'application, **mais `admin` est ajouté en deuxième position**. Soit: + + +`/{_locale}/admin/bundle/entity/{id}/action` + + ## Règles UI chill ### Titre des pages diff --git a/composer.json b/composer.json index 26bb5a517..e7de2fe89 100644 --- a/composer.json +++ b/composer.json @@ -47,6 +47,7 @@ "symfony/translation": "^4.4", "symfony/twig-bundle": "^4.4", "symfony/validator": "^4.4", + "symfony/web-link": "*", "symfony/webpack-encore-bundle": "^1.11", "symfony/workflow": "^4.4", "symfony/yaml": "^4.4", diff --git a/phpstan-deprecations.neon b/phpstan-deprecations.neon index 2de8b8bc8..42981a551 100644 --- a/phpstan-deprecations.neon +++ b/phpstan-deprecations.neon @@ -471,11 +471,6 @@ parameters: count: 1 path: src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php - - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/Form/UserType.php - - message: "#^Only booleans are allowed in an if condition, mixed given\\.$#" count: 2 diff --git a/src/Bundle/ChillActivityBundle/Entity/Activity.php b/src/Bundle/ChillActivityBundle/Entity/Activity.php index 0c0632722..5fa0bca35 100644 --- a/src/Bundle/ChillActivityBundle/Entity/Activity.php +++ b/src/Bundle/ChillActivityBundle/Entity/Activity.php @@ -15,6 +15,7 @@ use Chill\ActivityBundle\Validator\Constraints as ActivityValidator; use Chill\DocStoreBundle\Entity\StoredObject; use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; +use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable; use Chill\MainBundle\Entity\HasCenterInterface; use Chill\MainBundle\Entity\HasScopeInterface; use Chill\MainBundle\Entity\Location; @@ -134,6 +135,11 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac */ private ?Collection $persons = null; + /** + * @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_") + */ + private PrivateCommentEmbeddable $privateComment; + /** * @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason") * @Groups({"docgen:read"}) @@ -193,6 +199,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac { $this->reasons = new ArrayCollection(); $this->comment = new CommentEmbeddable(); + $this->privateComment = new PrivateCommentEmbeddable(); $this->persons = new ArrayCollection(); $this->thirdParties = new ArrayCollection(); $this->documents = new ArrayCollection(); @@ -400,6 +407,11 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return []; } + public function getPrivateComment(): PrivateCommentEmbeddable + { + return $this->privateComment; + } + public function getReasons(): Collection { return $this->reasons; @@ -586,6 +598,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac return $this; } + public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self + { + $this->privateComment = $privateComment; + + return $this; + } + public function setReasons(?ArrayCollection $reasons): self { $this->reasons = $reasons; diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php index bdf75ed05..845b31ca2 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityType.php @@ -167,6 +167,16 @@ class ActivityType */ private int $personVisible = self::FIELD_REQUIRED; + /** + * @ORM\Column(type="string", nullable=false, options={"default": ""}) + */ + private string $privateCommentLabel = ''; + + /** + * @ORM\Column(type="smallint", nullable=false, options={"default": 1}) + */ + private int $privateCommentVisible = self::FIELD_OPTIONAL; + /** * @ORM\Column(type="string", nullable=false, options={"default": ""}) */ @@ -416,6 +426,16 @@ class ActivityType return $this->personVisible; } + public function getPrivateCommentLabel(): string + { + return $this->privateCommentLabel; + } + + public function getPrivateCommentVisible(): int + { + return $this->privateCommentVisible; + } + public function getReasonsLabel(): string { return $this->reasonsLabel; @@ -688,6 +708,20 @@ class ActivityType return $this; } + public function setPrivateCommentLabel(string $privateCommentLabel): self + { + $this->privateCommentLabel = $privateCommentLabel; + + return $this; + } + + public function setPrivateCommentVisible(int $privateCommentVisible): self + { + $this->privateCommentVisible = $privateCommentVisible; + + return $this; + } + public function setReasonsLabel(string $reasonsLabel): self { $this->reasonsLabel = $reasonsLabel; diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityType.php b/src/Bundle/ChillActivityBundle/Form/ActivityType.php index 6e75bde25..898f39e56 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityType.php @@ -20,6 +20,7 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\CommentType; +use Chill\MainBundle\Form\Type\PrivateCommentType; use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Form\Type\UserPickerType; use Chill\MainBundle\Security\Authorization\AuthorizationHelper; @@ -251,6 +252,13 @@ class ActivityType extends AbstractType ]); } + if ($activityType->isVisible('privateComment')) { + $builder->add('privateComment', PrivateCommentType::class, [ + 'label' => '' === $activityType->getLabel('privateComment') ? 'private comment' : $activityType->getPrivateCommentLabel(), + 'required' => false, + ]); + } + if ($activityType->isVisible('persons')) { $builder->add('persons', HiddenType::class); $builder->get('persons') @@ -313,6 +321,7 @@ class ActivityType extends AbstractType 'button_add_label' => 'activity.Insert a document', 'button_remove_label' => 'activity.Remove a document', 'empty_collection_explain' => 'No documents', + 'entry_options' => ['has_title' => true], ]); } diff --git a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php index 28947d72b..4cdcb31f2 100644 --- a/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php +++ b/src/Bundle/ChillActivityBundle/Form/ActivityTypeType.php @@ -57,7 +57,7 @@ class ActivityTypeType extends AbstractType $fields = [ 'persons', 'user', 'date', 'location', 'persons', 'thirdParties', 'durationTime', 'travelTime', 'attendee', - 'reasons', 'comment', 'sentReceived', 'documents', + 'reasons', 'comment', 'privateComment', 'sentReceived', 'documents', 'emergency', 'socialIssues', 'socialActions', 'users', ]; @@ -69,6 +69,9 @@ class ActivityTypeType extends AbstractType 'empty_data' => '', ]); } + + $builder + ->add('commentVisible', ActivityFieldPresence::class); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php index 13c3b3e6a..1d887fead 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php @@ -15,8 +15,6 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Knp\Menu\MenuItem; use Symfony\Component\Security\Core\Security; -use function in_array; - final class AdminMenuBuilder implements LocalMenuBuilderInterface { private Security $security; @@ -32,27 +30,38 @@ final class AdminMenuBuilder implements LocalMenuBuilderInterface return; } - if (in_array($menuId, ['admin_index', 'admin_section'], true)) { - $menu->addChild('Activities', [ - 'route' => 'chill_admin_activity_index', - ]) - ->setExtras([ - 'order' => 2000, - 'explain' => 'Activity configuration', - ]); - } else { - $menu - ->addChild('Activities', [ - 'route' => 'chill_admin_activity_index', - ]) - ->setExtras([ - 'order' => '60', - ]); - } + $menu->addChild('Activities', [ + 'route' => 'chill_activity_admin_index', + ]) + ->setAttribute('class', 'list-group-item-header') + ->setExtras([ + 'order' => 5000, + 'icons' => ['exchange'], + ]); + + $menu->addChild('Activity Reasons', [ + 'route' => 'chill_activity_activityreason', + ])->setExtras(['order' => 5010]); + + $menu->addChild('Activity Reasons Category', [ + 'route' => 'chill_activity_activityreasoncategory', + ])->setExtras(['order' => 5020]); + + $menu->addChild('Activity type', [ + 'route' => 'chill_activity_type_admin', + ])->setExtras(['order' => 5030]); + + $menu->addChild('Activity Presences', [ + 'route' => 'chill_crud_activity_presence_index', + ])->setExtras(['order' => 5040]); + + $menu->addChild('Activity Types Categories', [ + 'route' => 'chill_activity_type_category_admin', + ])->setExtras(['order' => 5050]); } public static function getMenuIds(): array { - return ['admin_index', 'admin_section', 'admin_activity']; + return ['admin_section', 'admin_activity']; } } diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig index 218dc37b0..8d9ee878c 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/edit.html.twig @@ -83,6 +83,10 @@ {{ form_row(edit_form.comment) }} {% endif %} +{%- if edit_form.privateComment is defined -%} + {{ form_row(edit_form.privateComment) }} +{% endif %} + {%- if edit_form.attendee is defined -%} {{ form_row(edit_form.attendee) }} {% endif %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig index 8e078702c..6f6e1fe53 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/new.html.twig @@ -81,10 +81,13 @@ {% endif %} {%- if form.comment is defined -%} - {# TODO .. public and private #} {{ form_row(form.comment) }} {% endif %} +{%- if form.privateComment is defined -%} + {{ form_row(form.privateComment) }} +{% endif %} + {%- if form.attendee is defined -%} {{ form_row(form.attendee) }} {% endif %} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index ce4c22304..bf4c5c7b6 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -1,4 +1,5 @@ {%- set t = entity.type -%} +{% set userId = app.user.id %} {%- import "@ChillDocStore/Macro/macro.html.twig" as m -%}
@@ -34,5 +34,11 @@ {% endfor %} {% endblock %} + + {% block actions_before %} + |
---|
{{ 'Welcome to the admin section !'|trans }}
- {{ chill_menu('admin_index', { - 'layout': '@ChillMain/Admin/menu_admin_index.html.twig' - }) }} - {% endblock %} diff --git a/src/Bundle/ChillMainBundle/Resources/views/Admin/indexLanguage.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Admin/indexLanguage.html.twig new file mode 100644 index 000000000..6c7655686 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Resources/views/Admin/indexLanguage.html.twig @@ -0,0 +1,13 @@ +{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} + +{% block vertical_menu_content %} + {{ chill_menu('admin_language', { + 'layout': '@ChillMain/Admin/menu_admin_section.html.twig', + }) }} +{% endblock %} + +{% block layout_wvm_content %} + {% block admin_content %} +{{ 'Name'|trans }} | -{{ entity.name }} | -
---|
{{ address.postCode.country.name|localize_translatable_string }}
{% endif %} + {% if address.extra is not empty %} + + {{ address.extra }} + + {% endif %} {{ 'address.consider homeless'|trans }} @@ -89,6 +94,11 @@{{ address.postCode.country.name|localize_translatable_string }}
{{ 'Name'|trans }} | -{{ 'Phonenumber1'|trans }} | -{{ 'Phonenumber2'|trans }} | -{{ 'Email'|trans }} | -{{ 'Address'|trans }} | -{{ 'Active'|trans }} | -{{ 'Name'|trans }} | +{{ 'Phonenumber1'|trans }} | +{{ 'Phonenumber2'|trans }} | +{{ 'Email'|trans }} | +{{ 'Address'|trans }} | +{{ 'Active'|trans }} | + {% endblock %} + {% block table_entities_tbody %} {% for entity in entities %}
---|---|---|---|---|---|
{{ entity.name }} | @@ -44,17 +40,12 @@
{{ 'Title'|trans }} | -{{ 'Available for users'|trans }} | -{{ 'Editable by users'|trans }} | -{{ 'Address required'|trans }} | -{{ 'Contact data'|trans }} | -{{ 'Active'|trans }} | -{{ 'Default for'|trans }} | -{{ 'Title'|trans }} | +{{ 'Available for users'|trans }} | +{{ 'Editable by users'|trans }} | +{{ 'Address required'|trans }} | +{{ 'Contact data'|trans }} | +{{ 'Active'|trans }} | +{{ 'Default for'|trans }} | + {% endblock %} + {% block table_entities_tbody %} {% for entity in entities %}
---|---|---|---|---|---|---|
{{ entity.title | localize_translatable_string }} | @@ -52,14 +48,12 @@
{{ 'Role'|trans }} | {{ 'Circle'|trans }} | {{ 'Actions'|trans }} | -
---|---|---|
- {{ role_scope.role|trans }}
+ {{ role_scope.role|trans }}
{% if expanded_roles[role_scope.role]|length > 1 %}
{{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} @@ -56,40 +56,40 @@ {{ form_end(delete_role_scopes_form[role_scope.id]) }} |
{{ 'This group does not provide any permission'|trans }}
{%- endif -%} - -{{ 'Role'|trans }} | {{ 'Circle'|trans }} | -
---|---|
- {{ role_scope.role|trans }}
+ {{ role_scope.role|trans }}
{% if expanded_roles[role_scope.role]|length > 1 %}
{{ 'Which implies'|trans }} : {% for role in expanded_roles[role_scope.role] %}{{ role|trans }}{% if not loop.last %}, {% endif %}{% endfor %} @@ -47,16 +47,17 @@ |
{{ 'This group does not provide any permission'|trans }}. +
{{ 'This group does not provide any permission'|trans }}. - {{ 'add permissions'|trans|capitalize }}
+ {{ 'add permissions'|trans|capitalize }} + + {% endif %} -{{ 'Name'|trans }} | -{{ entity.name|localize_translatable_string }} | -
---|
{{ 'Permission group'|trans }} | -{{ 'Center'|trans }} | -- |
---|
- - {{ groupcenter.permissionsgroup.name }} - - | -- - {{ groupcenter.center.name }} - - | -- {{ form_start(delete_groupcenter_form[groupcenter.id]) }} - {{ form_row(delete_groupcenter_form[groupcenter.id].submit, { 'attr': { 'class': 'btn btn-chill-red' } } ) }} - {{ form_rest(delete_groupcenter_form[groupcenter.id]) }} - {{ form_end(delete_groupcenter_form[groupcenter.id]) }} - | +{{ 'Permission group'|trans }} | +{{ 'Center'|trans }} | +
---|
{{ 'Any permissions granted to this user'|trans }}.
+ + + {% for groupcenter in entity.groupcenters %} +{{ 'Any permissions granted to this user'|trans }}.
+ {% endif %} + +Dans l'interface d'administration, vous pouvez configurer votre instance selon vos besoins.
- - diff --git a/src/Bundle/ChillMainBundle/translations/messages.fr.yml b/src/Bundle/ChillMainBundle/translations/messages.fr.yml index 452ad306c..c5ab02d6b 100644 --- a/src/Bundle/ChillMainBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillMainBundle/translations/messages.fr.yml @@ -62,9 +62,11 @@ Comment: Commentaire Pinned comment: Commentaire épinglé Any comment: Aucun commentaire Read more: Lire la suite +(more...): (suite...) # comment embeddable No comment associated: Aucun commentaire +private comment: Notes privées #pagination Previous: Précédent @@ -120,6 +122,10 @@ Main admin menu: Menu d'administration principal Actions: Actions Users and permissions: Utilisateurs et permissions Location and location type: Localisations et types de localisation +Back to the admin: Menu d'administration +"Administration interface": Interface d'administration +Welcome to the admin section !: > + Bienvenue dans l'interface d'administration ! #permissions Permissions Menu: Gestion des droits @@ -129,11 +135,6 @@ Permissions management of your chill installation: Gestion des permissions de vo Location Menu: Localisations et types de localisation Management of location: Gestion des localisations et types de localisation -#admin section -"Administration interface": Interface d'administration -Welcome to the admin section !: > - Bienvenue dans l'interface d'administration ! - #admin section for center's administration Create a new center: Créer un nouveau centre Center list: Liste des centres @@ -149,7 +150,7 @@ Permission group "%name%": Groupe de permissions "%name%" Grant those permissions: Attribue ces permissions Which implies: Ce qui implique Permission group: Groupe de permissions -Permissionsgroup: Group de permissions +Permissionsgroup: Groupe de permissions New permission group: Nouveau groupe de permissions PermissionsGroup "%name%" edit: Modification du groupe de permission '%name%' Role: Rôle @@ -158,8 +159,10 @@ Add permission: Ajouter les permissions This group does not provide any permission: Ce groupe n'attribue aucune permission The role '%role%' has been removed: Le rôle "%role%" a été enlevé de ce groupe de permission The role '%role%' on circle '%scope%' has been removed: Le rôle "%role%" sur le cercle "%scope%" a été enlevé de ce groupe de permission +Unclassified: Non classifié #admin section for users +User configuration: Gestion des utilisateurs User edit: Modification d'un utilisateur User'status: Statut de l'utilisateur Disabled, the user is not allowed to login: Désactivé, l'utilisateur n'est pas autorisé à se connecter @@ -181,6 +184,14 @@ Change password: Changer le mot de passe Back to the user edition: Retour au formulaire d'édition Password successfully updated!: Mot de passe mis à jour Flags: Drapeaux +Main location: Localisation principale +Main scope: Cercle +Main center: Centre +user job: Métier de l'utilisateur +Choose a main center: Choisir un centre +Choose a main scope: Choisir un cercle +choose a job: Choisir un métier +choose a location: Choisir une localisation # admin section for users jobs User jobs: Métiers @@ -217,12 +228,24 @@ Location list: Liste des localisations Location type: Type de localisation Phonenumber1: Numéro de téléphone Phonenumber2: Autre numéro de téléphone -Configure location and location type: Configuration des localisations +Location configuration: Configuration des localisations Default for: Type de localisation par défaut pour none: aucun person: usager thirdparty: tiers +#admin section for civility +abbreviation: abbréviation + +#admin section for language and country +Language and countries menu: Menu Langues & Pays +Languages and countries: Langues & Pays +Management of languages and countries: Gestion des langues & pays +Language configuration: Configuration des langues & pays +Language list: Liste des langues +Country list: Liste des pays +Country code: Code du pays + # circles / scopes Choose the circle: Choisir le cercle Scopes: Services @@ -332,6 +355,8 @@ crud: index: title: Utilisateurs add_new: Créer + title_edit: Modifier un utilisateur + title_new: Créer un utilisateur admin_user_job: index: title: Métiers @@ -339,11 +364,35 @@ crud: title_new: Nouveau métier title_edit: Modifier un métier main_location_type: + index: + title: Liste des types de localisations + add_new: Ajouter un type de localisation title_new: Nouveau type de localisation title_edit: Modifier un type de localisation main_location: + index: + title: Liste des localisations + add_new: Ajouter une localisation title_new: Nouvelle localisation title_edit: Modifier une localisation + main_language: + index: + title: Liste des langues + add_new: Ajouter une langue + title_new: Nouvelle langue + title_edit: Modifier une langue + main_country: + index: + title: Liste des pays + add_new: Ajouter un pays + title_new: Nouveau pays + title_edit: Modifier un pays + main_civility: + index: + title: Liste des civilités + add_new: Ajouter une civilité + title_new: Nouvelle civilité + title_edit: Modifier une civilité No entities: Aucun élément diff --git a/src/Bundle/ChillPersonBundle/Controller/AdminController.php b/src/Bundle/ChillPersonBundle/Controller/AdminController.php index 9d16bdc13..b59cbc4a5 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AdminController.php +++ b/src/Bundle/ChillPersonBundle/Controller/AdminController.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; +use Symfony\Component\Routing\Annotation\Route; /** * Class AdminController. @@ -19,13 +20,35 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class AdminController extends AbstractController { /** - * @param $_locale - * - * @return \Symfony\Component\HttpFoundation\Response + * @Route("/{_locale}/admin/accompanying-course", name="chill_accompanying-course_admin_index") */ - public function indexAction($_locale) + public function indexAccompanyingCourseAdminAction() { - return $this->render('ChillPersonBundle:Admin:layout.html.twig', []); + return $this->render('ChillPersonBundle:Admin:indexAccompanyingCourse.html.twig'); + } + + /** + * @Route("/{_locale}/admin/household", name="chill_household_admin_index") + */ + public function indexHouseholdAdminAction() + { + return $this->render('ChillPersonBundle:Admin:indexHousehold.html.twig'); + } + + /** + * @Route("/{_locale}/admin/person", name="chill_person_admin_index") + */ + public function indexPersonAdminAction() + { + return $this->render('ChillPersonBundle:Admin:indexPerson.html.twig'); + } + + /** + * @Route("/{_locale}/admin/social-work", name="chill_social-work_admin_index") + */ + public function indexSocialWorkAdminAction() + { + return $this->render('ChillPersonBundle:Admin:indexSocialWork.html.twig'); } /** diff --git a/src/Bundle/ChillPersonBundle/Controller/AdminMaritalStatusController.php b/src/Bundle/ChillPersonBundle/Controller/AdminMaritalStatusController.php deleted file mode 100644 index d27ebe2e8..000000000 --- a/src/Bundle/ChillPersonBundle/Controller/AdminMaritalStatusController.php +++ /dev/null @@ -1,22 +0,0 @@ -addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php b/src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php new file mode 100644 index 000000000..2297dee32 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/MaritalStatusController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/OriginController.php b/src/Bundle/ChillPersonBundle/Controller/OriginController.php new file mode 100644 index 000000000..b7caae3be --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/OriginController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php b/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php new file mode 100644 index 000000000..ca3047a97 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/PersonResourceKindController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/RelationController.php b/src/Bundle/ChillPersonBundle/Controller/RelationController.php new file mode 100644 index 000000000..8f0c7fa44 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/RelationController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php deleted file mode 100644 index 8105066e9..000000000 --- a/src/Bundle/ChillPersonBundle/Controller/SocialWork/AdminEvaluationController.php +++ /dev/null @@ -1,22 +0,0 @@ -addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php new file mode 100644 index 000000000..38bd13267 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/GoalController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php new file mode 100644 index 000000000..f2d9a1d4d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/ResultController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php new file mode 100644 index 000000000..47cc246bd --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialActionController.php @@ -0,0 +1,26 @@ +addOrderBy('e.ordering', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php new file mode 100644 index 000000000..57dd38e80 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/SocialWork/SocialIssueController.php @@ -0,0 +1,26 @@ +addOrderBy('e.ordering', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 99c408ff1..d7037c1d2 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -146,13 +146,13 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac [ 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, 'name' => 'closing_motive', - 'base_path' => '/admin/closing-motive', + 'base_path' => '/admin/person/closing-motive', 'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class, - 'controller' => \Chill\PersonBundle\Controller\AdminClosingMotiveController::class, + 'controller' => \Chill\PersonBundle\Controller\ClosingMotiveController::class, 'actions' => [ 'index' => [ - 'template' => '@ChillPerson/ClosingMotive/index.html.twig', 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/ClosingMotive/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', @@ -164,12 +164,33 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class, + 'name' => 'origin', + 'base_path' => '/admin/person/origin', + 'form_class' => \Chill\PersonBundle\Form\OriginType::class, + 'controller' => \Chill\PersonBundle\Controller\OriginController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/edit.html.twig', + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\MaritalStatus::class, - 'name' => 'marital_status', - 'base_path' => '/admin/marital-status', + 'name' => 'person_marital-status', + 'base_path' => '/admin/person/marital-status', 'form_class' => \Chill\PersonBundle\Form\MaritalStatusType::class, - 'controller' => \Chill\PersonBundle\Controller\AdminMaritalStatusController::class, + 'controller' => \Chill\PersonBundle\Controller\MaritalStatusController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -185,12 +206,75 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\Household\Position::class, + 'name' => 'person_household_position', + 'base_path' => '/admin/person/household/position', + 'form_class' => \Chill\PersonBundle\Form\HouseholdPositionType::class, + 'controller' => \Chill\PersonBundle\Controller\HouseholdPositionController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdPosition/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdPosition/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/HouseholdPosition/edit.html.twig', + ], + ], + ], + [ + 'class' => \Chill\PersonBundle\Entity\Relationships\Relation::class, + 'name' => 'person_relation', + 'base_path' => '/admin/person/relation', + 'form_class' => \Chill\PersonBundle\Form\RelationType::class, + 'controller' => \Chill\PersonBundle\Controller\RelationController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Relation/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Relation/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Relation/edit.html.twig', + ], + ], + ], + [ + 'class' => \Chill\PersonBundle\Entity\Person\PersonResourceKind::class, + 'name' => 'person_resource-kind', + 'base_path' => '/admin/person/resource-kind', + 'form_class' => \Chill\PersonBundle\Form\PersonResourceKindType::class, + 'controller' => \Chill\PersonBundle\Controller\PersonResourceKindController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/PersonResourceKind/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/PersonResourceKind/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/PersonResourceKind/edit.html.twig', + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\SocialWork\SocialIssue::class, 'name' => 'social_issue', 'base_path' => '/admin/social-work/social-issue', 'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialIssueType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialIssueController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\SocialIssueController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -202,7 +286,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillPerson/SocialWork/edit.html.twig', + 'template' => '@ChillPerson/SocialWork/SocialIssue/edit.html.twig', ], ], ], @@ -211,7 +295,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_action', 'base_path' => '/admin/social-work/social-action', 'form_class' => \Chill\PersonBundle\Form\SocialWork\SocialActionType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminSocialActionController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\SocialActionController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -223,7 +307,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillPerson/SocialWork/edit.html.twig', + 'template' => '@ChillPerson/SocialWork/SocialAction/edit.html.twig', ], ], ], @@ -232,7 +316,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_goal', 'base_path' => '/admin/social-work/goal', 'form_class' => \Chill\PersonBundle\Form\SocialWork\GoalType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminGoalController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\GoalController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -253,7 +337,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_result', 'base_path' => '/admin/social-work/result', 'form_class' => \Chill\PersonBundle\Form\SocialWork\ResultType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminResultController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\ResultController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', @@ -274,7 +358,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac 'name' => 'social_evaluation', 'base_path' => '/admin/social-work/evaluation', 'form_class' => \Chill\PersonBundle\Form\SocialWork\EvaluationType::class, - 'controller' => \Chill\PersonBundle\Controller\SocialWork\AdminEvaluationController::class, + 'controller' => \Chill\PersonBundle\Controller\SocialWork\EvaluationController::class, 'actions' => [ 'index' => [ 'role' => 'ROLE_ADMIN', diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php index e8108bcce..da1709f48 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod.php @@ -978,6 +978,11 @@ class AccompanyingPeriod implements return null !== $this->userPrevious; } + public function hasUser(): bool + { + return null !== $this->user; + } + public function isChangedUser(): bool { return $this->userIsChanged && $this->user !== $this->userPrevious; diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php index 055507162..9c0eade3b 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWork.php @@ -13,6 +13,7 @@ namespace Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\MainBundle\Doctrine\Model\TrackCreationInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; +use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable; use Chill\MainBundle\Entity\User; use Chill\PersonBundle\AccompanyingPeriod\SocialIssueConsistency\AccompanyingPeriodLinkedWithSocialIssuesEntityInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; @@ -143,6 +144,12 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues */ private Collection $persons; + /** + * @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_") + * @Serializer\Groups({"read", "accompanying_period_work:edit"}) + */ + private PrivateCommentEmbeddable $privateComment; + /** * @ORM\ManyToMany(targetEntity=User::class) * @ORM\JoinTable(name="chill_person_accompanying_period_work_referrer") @@ -202,6 +209,7 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues public function __construct() { $this->goals = new ArrayCollection(); + $this->privateComment = new PrivateCommentEmbeddable(); $this->results = new ArrayCollection(); $this->thirdParties = new ArrayCollection(); $this->persons = new ArrayCollection(); @@ -328,6 +336,11 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this->persons; } + public function getPrivateComment(): PrivateCommentEmbeddable + { + return $this->privateComment; + } + /** * @return Collection|User[] */ @@ -505,6 +518,13 @@ class AccompanyingPeriodWork implements AccompanyingPeriodLinkedWithSocialIssues return $this; } + public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self + { + $this->privateComment->merge($privateComment); + + return $this; + } + public function setSocialAction(?SocialAction $socialAction): self { $this->socialAction = $socialAction; diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php index 9349c335e..e9c7496ff 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Evaluation.php @@ -121,14 +121,14 @@ class Evaluation return $this; } - public function setDelay(DateInterval $delay): self + public function setDelay(?DateInterval $delay): self { $this->delay = $delay; return $this; } - public function setNotificationDelay(DateInterval $notificationDelay): self + public function setNotificationDelay(?DateInterval $notificationDelay): self { $this->notificationDelay = $notificationDelay; diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php index b4a9b6aa2..e147ec9d8 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/Result.php @@ -45,7 +45,7 @@ class Result /** * @ORM\Column(type="datetime", nullable=true) */ - private DateTime $desactivationDate; + private ?DateTime $desactivationDate; /** * @ORM\ManyToMany(targetEntity=Goal::class, mappedBy="results") diff --git a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php index 904950489..fbd271b44 100644 --- a/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php +++ b/src/Bundle/ChillPersonBundle/Entity/SocialWork/SocialAction.php @@ -46,10 +46,8 @@ class SocialAction private $desactivationDate; /** - * @ORM\ManyToMany( - * targetEntity=Evaluation::class, - * mappedBy="socialActions" - * ) + * @ORM\ManyToMany(targetEntity=Evaluation::class, inversedBy="socialActions") + * @ORM\JoinTable(name="chill_person_social_work_evaluation_action") */ private Collection $evaluations; @@ -110,6 +108,15 @@ class SocialAction return $this; } + public function addEvaluation(Evaluation $evaluation): self + { + if (!$this->evaluations->contains($evaluation)) { + $this->evaluations[] = $evaluation; + } + + return $this; + } + public function addGoal(Goal $goal): self { if (!$this->goals->contains($goal)) { @@ -300,6 +307,13 @@ class SocialAction return $this; } + public function removeEvaluation(Evaluation $evaluation): self + { + $this->evaluations->removeElement($evaluation); + + return $this; + } + public function removeGoal(Goal $goal): self { $this->goals->removeElement($goal); diff --git a/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php b/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php new file mode 100644 index 000000000..ebd0ac966 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/HouseholdPositionType.php @@ -0,0 +1,47 @@ +add('label', TranslatableStringFormType::class) + ->add('allowHolder', CheckboxType::class, [ + 'required' => false, + 'label' => 'household.allowHolder', + ]) + ->add('shareHousehold', CheckboxType::class, [ + 'required' => false, + 'label' => 'household.shareHousehold', + ]) + ->add('ordering', NumberType::class, [ + 'required' => true, + 'scale' => 5, + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Position::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/OriginType.php b/src/Bundle/ChillPersonBundle/Form/OriginType.php new file mode 100644 index 000000000..e3c08b359 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/OriginType.php @@ -0,0 +1,39 @@ +add('label', TranslatableStringFormType::class) + ->add('noActiveAfter', ChillDateType::class, [ + 'required' => false, + 'input' => 'datetime_immutable', + 'label' => 'origin.noActiveAfter', + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Origin::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php new file mode 100644 index 000000000..8e050cbce --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/PersonResourceKindType.php @@ -0,0 +1,40 @@ +add('title', TranslatableStringFormType::class) + ->add('isActive', ChoiceType::class, [ + 'choices' => [ + 'Active' => true, + 'Inactive' => false, + ], + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', PersonResourceKind::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/RelationType.php b/src/Bundle/ChillPersonBundle/Form/RelationType.php new file mode 100644 index 000000000..e1887115f --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/RelationType.php @@ -0,0 +1,42 @@ +add('title', TranslatableStringFormType::class, [ + 'label' => 'relation.title', + ]) + ->add('reverseTitle', TranslatableStringFormType::class, [ + 'label' => 'relation.reverseTitle', + ]) + ->add('isActive', CheckboxType::class, [ + 'required' => false, + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Relation::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php index 0c6bb0d32..bbe82b59f 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/EvaluationType.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\DateIntervalType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\SocialWork\Evaluation; @@ -39,9 +40,14 @@ class EvaluationType extends AbstractType ->add('title', TranslatableStringFormType::class, [ 'label' => 'Nom', ]) - ->add('delay') - - ->add('notificationDelay'); + ->add('delay', DateIntervalType::class, [ + 'label' => 'evaluation.delay', + 'required' => false, + ]) + ->add('notificationDelay', DateIntervalType::class, [ + 'label' => 'evaluation.notificationDelay', + 'required' => false, + ]); } public function configureOptions(OptionsResolver $resolver) diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php index 4ea0a5e70..ef459f8da 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/GoalType.php @@ -11,13 +11,13 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\SocialWork\Goal; -use Chill\PersonBundle\Entity\SocialWork\SocialAction; +use Chill\PersonBundle\Entity\SocialWork\Result; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -42,21 +42,18 @@ class GoalType extends AbstractType ->add('title', TranslatableStringFormType::class, [ 'label' => 'Nom', ]) - - ->add('socialActions', EntityType::class, [ - 'class' => SocialAction::class, + ->add('results', EntityType::class, [ + 'class' => Result::class, 'required' => false, 'multiple' => true, - 'choice_label' => function (SocialAction $issue) { - return $this->translatableStringHelper->localize($issue->getTitle()); + 'choice_label' => function (Result $r) { + return $this->translatableStringHelper->localize($r->getTitle()); }, + 'attr' => ['class' => 'select2 '], ]) - - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + ->add('desactivationDate', ChillDateType::class, [ 'required' => false, + 'label' => 'goal.desactivationDate', ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php index a0219aaf3..b8a130950 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/ResultType.php @@ -11,11 +11,11 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; use Chill\PersonBundle\Entity\SocialWork\Result; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -40,13 +40,10 @@ class ResultType extends AbstractType ->add('title', TranslatableStringFormType::class, [ 'label' => 'Nom', ]) - ->add('accompanyingPeriodWorks') - ->add('accompanyingPeriodWorkGoals') - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + + ->add('desactivationDate', ChillDateType::class, [ 'required' => false, + 'label' => 'goal.desactivationDate', ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php index 1f1ae0810..77c94fa9d 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialActionType.php @@ -11,13 +11,18 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; +use Chill\MainBundle\Form\Type\DateIntervalType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelper; +use Chill\PersonBundle\Entity\SocialWork\Evaluation; +use Chill\PersonBundle\Entity\SocialWork\Goal; +use Chill\PersonBundle\Entity\SocialWork\Result; use Chill\PersonBundle\Entity\SocialWork\SocialAction; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; +use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -44,6 +49,7 @@ class SocialActionType extends AbstractType ]) ->add('issue', EntityType::class, [ 'class' => SocialIssue::class, + 'label' => 'socialAction.socialIssue', 'choice_label' => function (SocialIssue $issue) { return $this->translatableStringHelper->localize($issue->getTitle()); }, @@ -55,12 +61,47 @@ class SocialActionType extends AbstractType return $this->translatableStringHelper->localize($issue->getTitle()); }, ]) - ->add('defaultNotificationDelay') - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + ->add('ordering', NumberType::class, [ + 'required' => true, + 'scale' => 6, + ]) + ->add('results', EntityType::class, [ + 'class' => Result::class, 'required' => false, + 'multiple' => true, + 'attr' => ['class' => 'select2'], + 'choice_label' => function (Result $r) { + return $this->translatableStringHelper->localize($r->getTitle()); + }, + ]) + + ->add('goals', EntityType::class, [ + 'class' => Goal::class, + 'required' => false, + 'multiple' => true, + 'attr' => ['class' => 'select2'], + 'choice_label' => function (Goal $g) { + return $this->translatableStringHelper->localize($g->getTitle()); + }, + ]) + + ->add('evaluations', EntityType::class, [ + 'class' => Evaluation::class, + 'required' => false, + 'multiple' => true, + 'attr' => ['class' => 'select2'], + 'choice_label' => function (Evaluation $e) { + return $this->translatableStringHelper->localize($e->getTitle()); + }, + ]) + + ->add('defaultNotificationDelay', DateIntervalType::class, [ + 'label' => 'socialAction.defaultNotificationDelay', + 'required' => false, + ]) + ->add('desactivationDate', ChillDateType::class, [ + 'required' => false, + 'label' => 'goal.desactivationDate', ]); } diff --git a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php index 0058b1e51..5aa76fbc6 100644 --- a/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php +++ b/src/Bundle/ChillPersonBundle/Form/SocialWork/SocialIssueType.php @@ -11,12 +11,13 @@ declare(strict_types=1); namespace Chill\PersonBundle\Form\SocialWork; +use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Chill\MainBundle\Templating\TranslatableStringHelperInterface; use Chill\PersonBundle\Entity\SocialWork\SocialIssue; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\Form\AbstractType; -use Symfony\Component\Form\Extension\Core\Type\DateType; +use Symfony\Component\Form\Extension\Core\Type\NumberType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -41,10 +42,12 @@ class SocialIssueType extends AbstractType 'required' => false, 'choice_label' => fn (SocialIssue $issue): ?string => $this->translatableStringHelper->localize($issue->getTitle()), ]) - ->add('desactivationDate', DateType::class, [ - 'attr' => ['class' => 'datepicker'], - 'widget' => 'single_text', - 'format' => 'dd-MM-yyyy', + ->add('ordering', NumberType::class, [ + 'required' => true, + 'scale' => 6, + ]) + ->add('desactivationDate', ChillDateType::class, [ + 'label' => 'goal.desactivationDate', 'required' => false, ]); } diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminAccompanyingCourseMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminAccompanyingCourseMenuBuilder.php new file mode 100644 index 000000000..afd9f9484 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Menu/AdminAccompanyingCourseMenuBuilder.php @@ -0,0 +1,58 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('person_admin.accompanying_period', [ + 'route' => 'chill_accompanying-course_admin_index', + ]) + ->setAttribute('class', 'list-group-item-header') + ->setExtras([ + 'order' => 2200, + 'icons' => ['random'], + ]); + + $menu->addChild('person_admin.closing motives', [ + 'route' => 'chill_crud_closing_motive_index', + ])->setExtras(['order' => 2210]); + + $menu->addChild('person_admin.origin', [ + 'route' => 'chill_crud_origin_index', + ])->setExtras(['order' => 2210]); + } + + public static function getMenuIds(): array + { + return ['admin_section', 'admin_accompanying_course']; + } +} diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php new file mode 100644 index 000000000..e68059e1d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Menu/AdminHouseholdMenuBuilder.php @@ -0,0 +1,58 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('Household', [ + 'route' => 'chill_household_admin_index', + ]) + ->setAttribute('class', 'list-group-item-header') + ->setExtras([ + 'order' => 2100, + 'icons' => ['home'], + ]); + + $menu->addChild('Position', [ + 'route' => 'chill_crud_person_household_position_index', + ])->setExtras(['order' => 2110]); + + $menu->addChild('person_admin.relation', [ + 'route' => 'chill_crud_person_relation_index', + ])->setExtras(['order' => 2120]); + } + + public static function getMenuIds(): array + { + return ['admin_section', 'admin_household']; + } +} diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php new file mode 100644 index 000000000..683f4e7b6 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Menu/AdminPersonMenuBuilder.php @@ -0,0 +1,62 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('Person', [ + 'route' => 'chill_person_admin_index', + ]) + ->setAttribute('class', 'list-group-item-header') + ->setExtras([ + 'order' => 2000, + 'icons' => ['child'], + ]); + + $menu->addChild('Civility', [ + 'route' => 'chill_crud_main_civility_index', + ])->setExtras(['order' => 2010]); + + $menu->addChild('Marital status', [ + 'route' => 'chill_crud_person_marital-status_index', + ])->setExtras(['order' => 2020]); + + $menu->addChild('person_admin.person_resource_kind', [ + 'route' => 'chill_crud_person_resource-kind_index', + ])->setExtras(['order' => 2030]); + } + + public static function getMenuIds(): array + { + return ['admin_section', 'admin_person']; + } +} diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminSocialWorkMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminSocialWorkMenuBuilder.php new file mode 100644 index 000000000..a7244ac15 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Menu/AdminSocialWorkMenuBuilder.php @@ -0,0 +1,70 @@ +authorizationChecker = $authorizationChecker; + } + + public function buildMenu($menuId, MenuItem $menu, array $parameters) + { + if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) { + return; + } + + $menu->addChild('person_admin.social_work', [ + 'route' => 'chill_social-work_admin_index', + ]) + ->setAttribute('class', 'list-group-item-header') + ->setExtras([ + 'order' => 2300, + 'icons' => ['handshake-o'], + ]); + + $menu->addChild('person_admin.social_action', [ + 'route' => 'chill_crud_social_action_index', + ])->setExtras(['order' => 2301]); + + $menu->addChild('person_admin.social_issue', [ + 'route' => 'chill_crud_social_issue_index', + ])->setExtras(['order' => 2302]); + + $menu->addChild('person_admin.social_goal', [ + 'route' => 'chill_crud_social_goal_index', + ])->setExtras(['order' => 2310]); + + $menu->addChild('person_admin.social_evaluation', [ + 'route' => 'chill_crud_social_evaluation_index', + ])->setExtras(['order' => 2320]); + + $menu->addChild('person_admin.social_result', [ + 'route' => 'chill_crud_social_result_index', + ])->setExtras(['order' => 2330]); + } + + public static function getMenuIds(): array + { + return ['admin_section', 'admin_social_work']; + } +} diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js index 57415565b..c5150b015 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js @@ -253,7 +253,6 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou state.accompanyingCourse.administrativeLocation = value; }, updateReferrer(state, value) { - //console.log('value', value); state.accompanyingCourse.user = value; }, updateJob(state, value) { @@ -775,9 +774,7 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou throw error; }) }, - updateReferrer({ commit }, payload) { - console.log('update referrer', payload); - console.log('payload !== null', payload !== null); + updateReferrer({ commit, state }, payload) { const url = `/api/1.0/person/accompanying-course/${id}.json`; let body = { type: "accompanying_period", user: null }; @@ -788,7 +785,10 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou return makeFetch('PATCH', url, body) .then((response) => { commit('updateReferrer', response.user); - commit('setFilteredReferrersSuggested'); + if (null !== payload.user_job && payload.user_job !== state.accompanyingCourse.job) { + this.dispatch('updateJob', payload.user_job); + } + // commit('setFilteredReferrersSuggested'); // this mutation doesn't exist? }) .catch((error) => { commit('catchError', error); @@ -799,6 +799,8 @@ let initPromise = (root) => Promise.all([getScopesPromise(root), accompanyingCou const url = `/api/1.0/person/accompanying-course/${id}.json`; let body = { type: "accompanying_period", job: null }; + console.log('update job', payload); + if (payload !== null) { body = { type: "accompanying_period", job: { id: payload.id, type: payload.type } }; } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue index bab64018a..fb8796de5 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/App.vue @@ -24,6 +24,15 @@