Merge remote-tracking branch 'origin/master' into calendar/synchro-msgraph

This commit is contained in:
Julien Fastré 2022-05-28 00:30:02 +02:00
commit ec536871aa
295 changed files with 4720 additions and 1727 deletions

View File

@ -19,6 +19,7 @@ max_line_length = 80
[COMMIT_EDITMSG] [COMMIT_EDITMSG]
max_line_length = 0 max_line_length = 0
[*.{js, vue}] [*.{js, vue, ts}]
indent_size = 2 indent_size = 2
indent_style = space indent_style = space

View File

@ -11,19 +11,38 @@ and this project adheres to
## Unreleased ## Unreleased
<!-- write down unreleased development here --> <!-- write down unreleased development here -->
* [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) * [storedobject] add title field on StoredObject entity + use it in activity documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604)
* [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) * [main] add a "read more..." on comment embeddable when overflown (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/604)
* [person] add household creation API point (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557) * [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 ## 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 ### 2021-04-29
* [person] prevent circular references in PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/527) * [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) * [person] add maritalStatusComment to PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/582)
* Load relationships without gender in french fixtures * Load relationships without gender in french fixtures
* Add command to remove old draft accompanying periods * 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 ### 2021-04-28

View File

@ -2,7 +2,14 @@
en cours de rédaction 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 ## Assets: nommage des entrypoints
Trois types d'entrypoint: 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: 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) 1. d'abord chill_ (pour tous les modules chill)
2. ensuite une string qui est identique, par bundle 2. ensuite `crud` ou `api`, optionnel, automatiquement ajouté si la route est générée par la configuration
3. si le point est un point d'api (json), alors ajouter la string `api` 3. ensuite une string qui indique le bundle (`main`, `person`, `activity`, ...)
4. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités 4. ensuite, `api`, si la route est une route d'api.
5. ensuite une action (`list`, `view`, `edit`, `new`, ...) 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. 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: 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. 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 ## Règles UI chill
### Titre des pages ### Titre des pages

View File

@ -47,6 +47,7 @@
"symfony/translation": "^4.4", "symfony/translation": "^4.4",
"symfony/twig-bundle": "^4.4", "symfony/twig-bundle": "^4.4",
"symfony/validator": "^4.4", "symfony/validator": "^4.4",
"symfony/web-link": "*",
"symfony/webpack-encore-bundle": "^1.11", "symfony/webpack-encore-bundle": "^1.11",
"symfony/workflow": "^4.4", "symfony/workflow": "^4.4",
"symfony/yaml": "^4.4", "symfony/yaml": "^4.4",

View File

@ -471,11 +471,6 @@ parameters:
count: 1 count: 1
path: src/Bundle/ChillMainBundle/Form/Type/UserPickerType.php 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\\.$#" message: "#^Only booleans are allowed in an if condition, mixed given\\.$#"
count: 2 count: 2

View File

@ -15,6 +15,7 @@ use Chill\ActivityBundle\Validator\Constraints as ActivityValidator;
use Chill\DocStoreBundle\Entity\StoredObject; use Chill\DocStoreBundle\Entity\StoredObject;
use Chill\MainBundle\Entity\Center; use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
use Chill\MainBundle\Entity\HasCenterInterface; use Chill\MainBundle\Entity\HasCenterInterface;
use Chill\MainBundle\Entity\HasScopeInterface; use Chill\MainBundle\Entity\HasScopeInterface;
use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Location;
@ -134,6 +135,11 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
*/ */
private ?Collection $persons = null; private ?Collection $persons = null;
/**
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable", columnPrefix="privateComment_")
*/
private PrivateCommentEmbeddable $privateComment;
/** /**
* @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason") * @ORM\ManyToMany(targetEntity="Chill\ActivityBundle\Entity\ActivityReason")
* @Groups({"docgen:read"}) * @Groups({"docgen:read"})
@ -193,6 +199,7 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
{ {
$this->reasons = new ArrayCollection(); $this->reasons = new ArrayCollection();
$this->comment = new CommentEmbeddable(); $this->comment = new CommentEmbeddable();
$this->privateComment = new PrivateCommentEmbeddable();
$this->persons = new ArrayCollection(); $this->persons = new ArrayCollection();
$this->thirdParties = new ArrayCollection(); $this->thirdParties = new ArrayCollection();
$this->documents = new ArrayCollection(); $this->documents = new ArrayCollection();
@ -400,6 +407,11 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return []; return [];
} }
public function getPrivateComment(): PrivateCommentEmbeddable
{
return $this->privateComment;
}
public function getReasons(): Collection public function getReasons(): Collection
{ {
return $this->reasons; return $this->reasons;
@ -586,6 +598,13 @@ class Activity implements AccompanyingPeriodLinkedWithSocialIssuesEntityInterfac
return $this; return $this;
} }
public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self
{
$this->privateComment = $privateComment;
return $this;
}
public function setReasons(?ArrayCollection $reasons): self public function setReasons(?ArrayCollection $reasons): self
{ {
$this->reasons = $reasons; $this->reasons = $reasons;

View File

@ -167,6 +167,16 @@ class ActivityType
*/ */
private int $personVisible = self::FIELD_REQUIRED; 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": ""}) * @ORM\Column(type="string", nullable=false, options={"default": ""})
*/ */
@ -416,6 +426,16 @@ class ActivityType
return $this->personVisible; return $this->personVisible;
} }
public function getPrivateCommentLabel(): string
{
return $this->privateCommentLabel;
}
public function getPrivateCommentVisible(): int
{
return $this->privateCommentVisible;
}
public function getReasonsLabel(): string public function getReasonsLabel(): string
{ {
return $this->reasonsLabel; return $this->reasonsLabel;
@ -688,6 +708,20 @@ class ActivityType
return $this; 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 public function setReasonsLabel(string $reasonsLabel): self
{ {
$this->reasonsLabel = $reasonsLabel; $this->reasonsLabel = $reasonsLabel;

View File

@ -20,6 +20,7 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\ChillCollectionType; use Chill\MainBundle\Form\Type\ChillCollectionType;
use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\CommentType; use Chill\MainBundle\Form\Type\CommentType;
use Chill\MainBundle\Form\Type\PrivateCommentType;
use Chill\MainBundle\Form\Type\ScopePickerType; use Chill\MainBundle\Form\Type\ScopePickerType;
use Chill\MainBundle\Form\Type\UserPickerType; use Chill\MainBundle\Form\Type\UserPickerType;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper; 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')) { if ($activityType->isVisible('persons')) {
$builder->add('persons', HiddenType::class); $builder->add('persons', HiddenType::class);
$builder->get('persons') $builder->get('persons')
@ -313,6 +321,7 @@ class ActivityType extends AbstractType
'button_add_label' => 'activity.Insert a document', 'button_add_label' => 'activity.Insert a document',
'button_remove_label' => 'activity.Remove a document', 'button_remove_label' => 'activity.Remove a document',
'empty_collection_explain' => 'No documents', 'empty_collection_explain' => 'No documents',
'entry_options' => ['has_title' => true],
]); ]);
} }

View File

@ -57,7 +57,7 @@ class ActivityTypeType extends AbstractType
$fields = [ $fields = [
'persons', 'user', 'date', 'location', 'persons', 'persons', 'user', 'date', 'location', 'persons',
'thirdParties', 'durationTime', 'travelTime', 'attendee', 'thirdParties', 'durationTime', 'travelTime', 'attendee',
'reasons', 'comment', 'sentReceived', 'documents', 'reasons', 'comment', 'privateComment', 'sentReceived', 'documents',
'emergency', 'socialIssues', 'socialActions', 'users', 'emergency', 'socialIssues', 'socialActions', 'users',
]; ];
@ -69,6 +69,9 @@ class ActivityTypeType extends AbstractType
'empty_data' => '', 'empty_data' => '',
]); ]);
} }
$builder
->add('commentVisible', ActivityFieldPresence::class);
} }
public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)

View File

@ -15,8 +15,6 @@ use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem; use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use function in_array;
final class AdminMenuBuilder implements LocalMenuBuilderInterface final class AdminMenuBuilder implements LocalMenuBuilderInterface
{ {
private Security $security; private Security $security;
@ -32,27 +30,38 @@ final class AdminMenuBuilder implements LocalMenuBuilderInterface
return; return;
} }
if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild('Activities', [ $menu->addChild('Activities', [
'route' => 'chill_admin_activity_index', 'route' => 'chill_activity_admin_index',
]) ])
->setAttribute('class', 'list-group-item-header')
->setExtras([ ->setExtras([
'order' => 2000, 'order' => 5000,
'explain' => 'Activity configuration', 'icons' => ['exchange'],
]); ]);
} else {
$menu $menu->addChild('Activity Reasons', [
->addChild('Activities', [ 'route' => 'chill_activity_activityreason',
'route' => 'chill_admin_activity_index', ])->setExtras(['order' => 5010]);
])
->setExtras([ $menu->addChild('Activity Reasons Category', [
'order' => '60', '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 public static function getMenuIds(): array
{ {
return ['admin_index', 'admin_section', 'admin_activity']; return ['admin_section', 'admin_activity'];
} }
} }

View File

@ -83,6 +83,10 @@
{{ form_row(edit_form.comment) }} {{ form_row(edit_form.comment) }}
{% endif %} {% endif %}
{%- if edit_form.privateComment is defined -%}
{{ form_row(edit_form.privateComment) }}
{% endif %}
{%- if edit_form.attendee is defined -%} {%- if edit_form.attendee is defined -%}
{{ form_row(edit_form.attendee) }} {{ form_row(edit_form.attendee) }}
{% endif %} {% endif %}

View File

@ -81,10 +81,13 @@
{% endif %} {% endif %}
{%- if form.comment is defined -%} {%- if form.comment is defined -%}
{# TODO .. public and private #}
{{ form_row(form.comment) }} {{ form_row(form.comment) }}
{% endif %} {% endif %}
{%- if form.privateComment is defined -%}
{{ form_row(form.privateComment) }}
{% endif %}
{%- if form.attendee is defined -%} {%- if form.attendee is defined -%}
{{ form_row(form.attendee) }} {{ form_row(form.attendee) }}
{% endif %} {% endif %}

View File

@ -1,4 +1,5 @@
{%- set t = entity.type -%} {%- set t = entity.type -%}
{% set userId = app.user.id %}
{%- import "@ChillDocStore/Macro/macro.html.twig" as m -%} {%- import "@ChillDocStore/Macro/macro.html.twig" as m -%}
<h1>{{ "Activity"|trans }}</h1> <h1>{{ "Activity"|trans }}</h1>
@ -146,13 +147,28 @@
</dd> </dd>
{% endif %} {% endif %}
{% if t.privateCommentVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) and entity.privateComment.hasCommentForUser(app.user) %}
{% if t.privateCommentLabel is not empty %}
<dt class="inline">{{ t.privateCommentLabel }}</dt>
{% else %}
<dt class="inline">{{ 'Private comment'|trans }}</dt>
{% endif %}
<dd>
<section class="chill-entity entity-comment-embeddable">
<blockquote class="chill-user-quote private-quote">
{{ entity.privateComment.comments[userId] }}
</blockquote>
</section>
</dd>
{% endif %}
{% if t.documentsVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %} {% if t.documentsVisible and is_granted('CHILL_ACTIVITY_SEE_DETAILS', entity) %}
<dt class="inline">{{ 'Documents'|trans }}</dt> <dt class="inline">{{ 'Documents'|trans }}</dt>
<dd> <dd>
{% if entity.documents|length > 0 %} {% if entity.documents|length > 0 %}
<ul> <ul>
{% for d in entity.documents %} {% for d in entity.documents %}
<li>{{ m.download_button(d) }}</li> <li>{{ d.title }}{{ m.download_button(d) }}</li>
{% endfor %} {% endfor %}
</ul> </ul>
{% else %} {% else %}

View File

@ -1,10 +1,10 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %} {% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityPresence list'|trans }}</h1> <h1>{{ 'ActivityPresence list'|trans }}</h1>
@ -34,7 +34,7 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ path('chill_crud_activity_presence_new') }}" class="btn btn-create"> <a href="{{ path('chill_crud_activity_presence_new') }}" class="btn btn-create">
{{ 'Create a new activity presence'|trans }} {{ 'Create a new activity presence'|trans }}

View File

@ -1,10 +1,10 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %} {% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %} {% endembed %}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReason edit'|trans }}</h1> <h1>{{ 'ActivityReason edit'|trans }}</h1>
@ -24,7 +8,7 @@
{{ form_row(edit_form.active) }} {{ form_row(edit_form.active) }}
{{ form_row(edit_form.category) }} {{ form_row(edit_form.category) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> <a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a>
</li> </li>

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReason list'|trans }}</h1> <h1>{{ 'ActivityReason list'|trans }}</h1>
@ -45,7 +29,11 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
<li> <li>
<a href="{{ path('chill_activity_activityreason_new') }}" class="btn btn-new"> <a href="{{ path('chill_activity_activityreason_new') }}" class="btn btn-new">
{{ 'Create a new activity reason'|trans }} {{ 'Create a new activity reason'|trans }}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReason creation'|trans }}</h1> <h1>{{ 'ActivityReason creation'|trans }}</h1>
@ -24,7 +8,7 @@
{{ form_row(form.active) }} {{ form_row(form.active) }}
{{ form_row(form.category) }} {{ form_row(form.category) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> <a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a>
</li> </li>

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReason'|trans }}</h1> <h1>{{ 'ActivityReason'|trans }}</h1>
@ -38,7 +22,7 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel"> <a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReasonCategory edit'|trans }}</h1> <h1>{{ 'ActivityReasonCategory edit'|trans }}</h1>
@ -23,7 +7,7 @@
{{ form_row(edit_form.name) }} {{ form_row(edit_form.name) }}
{{ form_row(edit_form.active) }} {{ form_row(edit_form.active) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel"> <a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReasonCategory list'|trans }}</h1> <h1>{{ 'ActivityReasonCategory list'|trans }}</h1>
@ -46,7 +30,7 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ path('chill_activity_activityreasoncategory_new') }}" class="btn btn-new"> <a href="{{ path('chill_activity_activityreasoncategory_new') }}" class="btn btn-new">
{{ 'Create a new activity category reason'|trans }} {{ 'Create a new activity category reason'|trans }}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReasonCategory creation'|trans }}</h1> <h1>{{ 'ActivityReasonCategory creation'|trans }}</h1>
@ -23,7 +7,7 @@
{{ form_row(form.name) }} {{ form_row(form.name) }}
{{ form_row(form.active) }} {{ form_row(form.active) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a> <a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a>
</li> </li>

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityReasonCategory'|trans }}</h1> <h1>{{ 'ActivityReasonCategory'|trans }}</h1>
@ -37,7 +21,7 @@
</tr> </tr>
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel"> <a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }} {{ 'Back to the list'|trans }}

View File

@ -1,10 +1,10 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %} {% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
* Copyright (C) 2014, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityType list'|trans }}</h1> <h1>{{ 'ActivityType list'|trans }}</h1>
@ -50,7 +34,7 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ path('chill_crud_activity_type_new') }}" class="btn btn-create"> <a href="{{ path('chill_crud_activity_type_new') }}" class="btn btn-create">
{{ 'Create a new activity type'|trans }} {{ 'Create a new activity type'|trans }}

View File

@ -1,10 +1,10 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %} {% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %} {% endembed %}

View File

@ -1,10 +1,10 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %} {% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'ActivityTypeCategory list'|trans }}</h1> <h1>{{ 'ActivityTypeCategory list'|trans }}</h1>
@ -34,7 +34,7 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ path('chill_crud_activity_type_category_new') }}" class="btn btn-create"> <a href="{{ path('chill_crud_activity_type_category_new') }}" class="btn btn-create">
{{ 'Create a new activity type category'|trans }} {{ 'Create a new activity type category'|trans }}

View File

@ -1,10 +1,10 @@
{% extends "@ChillActivity/Admin/layout_activity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %} {% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %} {% endembed %}

View File

@ -20,7 +20,7 @@
{% block vertical_menu_content %} {% block vertical_menu_content %}
{{ chill_menu('admin_activity', { {{ chill_menu('admin_activity', {
'layout': '@ChillActivity/Admin/menu_activity.html.twig', 'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }} }) }}
{% endblock %} {% endblock %}

View File

@ -1,20 +0,0 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
{% block v_menu_title %}{{ 'Activity configuration menu'|trans }}{% endblock %}

View File

@ -209,6 +209,7 @@ class ActivityContext implements
*/ */
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void
{ {
$storedObject->setTitle($this->translatableStringHelper->localize($template->getName()));
$entity->addDocument($storedObject); $entity->addDocument($storedObject);
$this->em->persist($storedObject); $this->em->persist($storedObject);

View File

@ -10,48 +10,22 @@ chill_activity_activityreasoncategory:
resource: "@ChillActivityBundle/config/routes/activityreasoncategory.yaml" resource: "@ChillActivityBundle/config/routes/activityreasoncategory.yaml"
prefix: / prefix: /
chill_admin_activity_index: chill_activity_admin_index:
path: /{_locale}/admin/activity path: /{_locale}/admin/activity
controller: Chill\ActivityBundle\Controller\AdminController::indexActivityAction controller: Chill\ActivityBundle\Controller\AdminController::indexActivityAction
options:
menus:
admin_section:
label: Activities
order: 2000
icons: [tag]
chill_admin_activity_redirect_to_admin_index: chill_admin_activity_redirect_to_admin_index:
path: /{_locale}/admin/activity_redirect_to_main path: /{_locale}/admin/activity_redirect_to_main
controller: Chill\ActivityBundle\Controller\AdminController::redirectToAdminIndexAction controller: Chill\ActivityBundle\Controller\AdminController::redirectToAdminIndexAction
options:
menus:
admin_activity:
order: 0
label: Main admin menu
chill_activity_type_admin: chill_activity_type_admin:
path: /{_locale}/admin/activity/type path: /{_locale}/admin/activity/type
controller: cscrud_activity_type_controller:index controller: cscrud_activity_type_controller:index
options:
menus:
admin_activity:
order: 2020
label: 'Activity Types'
chill_activity_type_category_admin: chill_activity_type_category_admin:
path: /{_locale}/admin/activity/type_category path: /{_locale}/admin/activity/type_category
controller: cscrud_activity_type_category_controller:index controller: cscrud_activity_type_category_controller:index
options:
menus:
admin_activity:
order: 2999
label: 'Activity Types Categories'
chill_activity_presence_admin: chill_activity_presence_admin:
path: /{_locale}/admin/activity/presence path: /{_locale}/admin/activity/presence
controller: cscrud_activity_presence_controller:index controller: cscrud_activity_presence_controller:index
options:
menus:
admin_activity:
order: 2021
label: 'Activity Presences'

View File

@ -1,11 +1,6 @@
chill_activity_activityreason: chill_activity_activityreason:
path: /{_locale}/admin/activityreason/ path: /{_locale}/admin/activityreason/
controller: Chill\ActivityBundle\Controller\ActivityReasonController::indexAction controller: Chill\ActivityBundle\Controller\ActivityReasonController::indexAction
options:
menus:
admin_activity:
order: 2000
label: "Activity Reasons"
chill_activity_activityreason_show: chill_activity_activityreason_show:
path: /{_locale}/admin/activityreason/{id}/show path: /{_locale}/admin/activityreason/{id}/show

View File

@ -1,11 +1,6 @@
chill_activity_activityreasoncategory: chill_activity_activityreasoncategory:
path: /{_locale}/admin/activityreasoncategory/ path: /{_locale}/admin/activityreasoncategory/
controller: Chill\ActivityBundle\Controller\ActivityReasonCategoryController::indexAction controller: Chill\ActivityBundle\Controller\ActivityReasonCategoryController::indexAction
options:
menus:
admin_activity:
order: 2010
label: "Activity Reasons Category"
chill_activity_activityreasoncategory_show: chill_activity_activityreasoncategory_show:
path: /{_locale}/admin/activityreasoncategory/{id}/show path: /{_locale}/admin/activityreasoncategory/{id}/show

View File

@ -0,0 +1,35 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220425133027 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE activitytype DROP privateCommentLabel');
$this->addSql('ALTER TABLE activitytype DROP privateCommentVisible');
}
public function getDescription(): string
{
return 'add private comment option to activity types';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE activitytype ADD privateCommentLabel VARCHAR(255) DEFAULT \'\' NOT NULL');
$this->addSql('ALTER TABLE activitytype ADD privateCommentVisible SMALLINT DEFAULT 1 NOT NULL');
}
}

View File

@ -0,0 +1,33 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220527124438 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_person_accompanying_period_work DROP privateComment_comments');
}
public function getDescription(): string
{
return 'add private comment to activity';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE activity ADD privateComment_comments JSON DEFAULT \'{}\'');
}
}

View File

@ -44,6 +44,7 @@ Received: Recevoir
by: 'Par ' by: 'Par '
location: Lieu location: Lieu
Reasons: Sujets Reasons: Sujets
Private comment: Commentaire privé
#forms #forms
@ -113,7 +114,7 @@ Activity type configuration: Configuration des categories d'activités
Activity Reasons: Sujets d'une activité Activity Reasons: Sujets d'une activité
Activity Reasons Category: Catégories de sujet d'activités Activity Reasons Category: Catégories de sujet d'activités
Activity Types Categories: Catégories des types d'activité Activity Types Categories: Catégories des types d'activité
Activity Presences: Presences des activités Activity Presences: Presences aux activités
# Crud # Crud
@ -124,6 +125,9 @@ crud:
activity_type_category: activity_type_category:
title_new: Nouvelle catégorie de type d'activité title_new: Nouvelle catégorie de type d'activité
title_edit: Edition d'une catégorie de type d'activité title_edit: Edition d'une catégorie de type d'activité
activity_presence:
title_new: Nouvelle Présence aux activités
title_edit: Edition d'une Présence aux activités
# activity reason admin # activity reason admin
ActivityReason list: Liste des sujets ActivityReason list: Liste des sujets
@ -145,6 +149,10 @@ ActivityReasonCategory: Catégorie de sujet d'activité
ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée ActivityReasonCategory is active and will be proposed: La catégorie est active et sera proposée
ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée ActivityReasonCategory is inactive and won't be proposed: La catégorie est inactive et ne sera pas proposée
#activity presence admin
ActivityPresence list: Liste des Présences aux activités
Create a new activity presence: Créer une nouvelle "Présence aux activités"
# activity type type admin # activity type type admin
ActivityType list: Types d'activités ActivityType list: Types d'activités
Create a new activity type: Créer un nouveau type d'activité Create a new activity type: Créer un nouveau type d'activité
@ -168,6 +176,8 @@ Reasons visible: Visibilité du champ Sujet
Reasons label: Libellé du champ Sujet Reasons label: Libellé du champ Sujet
Comment visible: Visibilité du champ Commentaire Comment visible: Visibilité du champ Commentaire
Comment label: Libellé du champ Commentaire Comment label: Libellé du champ Commentaire
Private comment visible: Visibilité du champ Commentaire Privé
Private comment label: Libellé du champ Commentaire Privé
Emergency visible: Visibilité du champ Urgent Emergency visible: Visibilité du champ Urgent
Emergency label: Libellé du champ Urgent Emergency label: Libellé du champ Urgent
Accompanying period visible: Visibilité du champ Période d'accompagnement Accompanying period visible: Visibilité du champ Période d'accompagnement

View File

@ -0,0 +1,29 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\AsideActivityBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
/**
* Class AdminController.
*/
class AdminController extends AbstractController
{
/**
* @Route("/{_locale}/admin/aside-activity", name="chill_aside_activity_admin")
*/
public function indexAdminAction()
{
return $this->render('ChillAsideActivityBundle:Admin:index.html.twig');
}
}

View File

@ -14,8 +14,6 @@ namespace Chill\AsideActivityBundle\Menu;
use Knp\Menu\MenuItem; use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use function in_array;
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
{ {
private Security $security; private Security $security;
@ -32,27 +30,25 @@ final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuild
return; return;
} }
if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild('Aside activities', [ $menu->addChild('Aside activities', [
'route' => 'chill_crud_aside_activity_category_index', 'route' => 'chill_aside_activity_admin',
]) ])
->setAttribute('class', 'list-group-item-header')
->setExtras([ ->setExtras([
'order' => 900, 'order' => 7000,
'explain' => 'Aside activity type configuration', 'explain' => 'Aside activity type configuration',
]); ]);
} else {
$menu $menu
->addChild('Aside activity categories', [ ->addChild('Aside activity categories', [
'route' => 'chill_crud_aside_activity_category_index', 'route' => 'chill_crud_aside_activity_category_index',
]) ])
->setExtras([ ->setExtras([
'order' => '50', 'order' => 7010,
]); ]);
} }
}
public static function getMenuIds(): array public static function getMenuIds(): array
{ {
return ['admin_index', 'admin_section', 'admin_aside_activity']; return ['admin_section', 'admin_aside_activity'];
} }
} }

View File

@ -1,7 +1,9 @@
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} {% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %} {% block vertical_menu_content %}
{{ chill_menu('admin_aside_activity') }} {{ chill_menu('admin_aside_activity', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block layout_wvm_content %}

View File

@ -1,10 +1,10 @@
{% extends "@ChillAsideActivity/Admin/layout_asideactivity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %} {% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %} {% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}

View File

@ -1,6 +1,9 @@
{% extends "@ChillAsideActivity/Admin/layout_asideactivity.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Aside Activity Type List'|trans }}{% endblock title %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'Aside Activity Type List'|trans }}</h1> <h1>{{ 'Aside Activity Type List'|trans }}</h1>
<table class="records_list table table-bordered border-dark"> <table class="records_list table table-bordered border-dark">
@ -36,7 +39,7 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ path('chill_crud_aside_activity_category_new') }}" class="btn btn-create"> <a href="{{ path('chill_crud_aside_activity_category_new') }}" class="btn btn-create">
{{ 'Create a new aside activity type'|trans }} {{ 'Create a new aside activity type'|trans }}

View File

@ -1,10 +1,10 @@
{% extends "@ChillAsideActivity/Admin/layout_asideactivity.html.twig" %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %} {% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %} {% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %} {% endblock %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %} {% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %} {% endembed %}

View File

@ -38,7 +38,7 @@ crud:
confirm_message_delete: Êtes-vous sûr de vouloir supprimer cette activité annexe? confirm_message_delete: Êtes-vous sûr de vouloir supprimer cette activité annexe?
aside_activity_category: aside_activity_category:
title_new: Nouvelle catégorie d'activité annexe title_new: Nouvelle catégorie d'activité annexe
title_edit: Edition d'une catégorie de type d'activité title_edit: Édition d'une catégorie de type d'activité
#forms #forms
Create a new aside activity type: Nouvelle categorie d'activité annexe Create a new aside activity type: Nouvelle categorie d'activité annexe
@ -165,3 +165,4 @@ Phonecall: "Appel téléphonique"
Aside activities: Activités annexes Aside activities: Activités annexes
Aside activity types: Types d'activités annexes Aside activity types: Types d'activités annexes
Aside activity type configuration: Configuration des categories d'activités annexes Aside activity type configuration: Configuration des categories d'activités annexes
Aside activity configuration: Configuration des activités annexes

View File

@ -0,0 +1,28 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CalendarBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class AdminController extends AbstractController
{
/**
* Calendar admin.
*
* @Route("/{_locale}/admin/calendar", name="chill_calendar_admin_index")
*/
public function indexAdminAction()
{
return $this->render('ChillCalendarBundle:Admin:index.html.twig');
}
}

View File

@ -0,0 +1,26 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CalendarBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\HttpFoundation\Request;
class CancelReasonController extends CRUDController
{
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$query->addOrderBy('e.id', 'ASC');
return parent::orderQuery($action, $query, $request, $paginator);
}
}

View File

@ -50,6 +50,29 @@ class ChillCalendarExtension extends Extension implements PrependExtensionInterf
protected function prependCruds(ContainerBuilder $container) protected function prependCruds(ContainerBuilder $container)
{ {
$container->prependExtensionConfig('chill_main', [ $container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\CalendarBundle\Entity\CancelReason::class,
'name' => 'calendar_cancel-reason',
'base_path' => '/admin/calendar/cancel-reason',
'form_class' => \Chill\CalendarBundle\Form\CancelReasonType::class,
'controller' => \Chill\CalendarBundle\Controller\CancelReasonController::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillCalendar/CancelReason/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillCalendar/CancelReason/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillCalendar/CancelReason/edit.html.twig',
],
],
],
],
'apis' => [ 'apis' => [
[ [
'controller' => \Chill\CalendarBundle\Controller\CalendarRangeAPIController::class, 'controller' => \Chill\CalendarBundle\Controller\CalendarRangeAPIController::class,

View File

@ -17,6 +17,7 @@ use Chill\MainBundle\Doctrine\Model\TrackCreationTrait;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface; use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait; use Chill\MainBundle\Doctrine\Model\TrackUpdateTrait;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable; use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
use Chill\MainBundle\Entity\Location; use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User; use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\AccompanyingPeriod;
@ -147,6 +148,12 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
*/ */
private Collection $persons; private Collection $persons;
/**
* @ORM\Embedded(class=PrivateCommentEmbeddable::class, columnPrefix="privateComment_")
* @Serializer\Groups({"calendar:read"})
*/
private PrivateCommentEmbeddable $privateComment;
/** /**
* @ORM\ManyToMany( * @ORM\ManyToMany(
* targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty", * targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty",
@ -175,6 +182,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
public function __construct() public function __construct()
{ {
$this->comment = new CommentEmbeddable(); $this->comment = new CommentEmbeddable();
$this->privateComment = new PrivateCommentEmbeddable();
$this->persons = new ArrayCollection(); $this->persons = new ArrayCollection();
$this->professionals = new ArrayCollection(); $this->professionals = new ArrayCollection();
$this->invites = new ArrayCollection(); $this->invites = new ArrayCollection();
@ -339,6 +347,11 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
return []; return [];
} }
public function getPrivateComment(): PrivateCommentEmbeddable
{
return $this->privateComment;
}
/** /**
* @return Collection|ThirdParty[] * @return Collection|ThirdParty[]
*/ */
@ -518,6 +531,13 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
return $this; return $this;
} }
public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self
{
$this->privateComment = $privateComment;
return $this;
}
public function setSendSMS(?bool $sendSMS): self public function setSendSMS(?bool $sendSMS): self
{ {
$this->sendSMS = $sendSMS; $this->sendSMS = $sendSMS;

View File

@ -20,6 +20,10 @@ use Chill\MainBundle\Form\DataTransformer\IdToUsersDataTransformer;
use Chill\MainBundle\Form\Type\CommentType; use Chill\MainBundle\Form\Type\CommentType;
use Chill\PersonBundle\Form\DataTransformer\PersonsToIdDataTransformer; use Chill\PersonBundle\Form\DataTransformer\PersonsToIdDataTransformer;
use Chill\ThirdPartyBundle\Form\DataTransformer\ThirdPartiesToIdDataTransformer; use Chill\ThirdPartyBundle\Form\DataTransformer\ThirdPartiesToIdDataTransformer;
use Chill\MainBundle\Form\Type\PrivateCommentType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\Person;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
use DateTimeImmutable; use DateTimeImmutable;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
@ -65,6 +69,10 @@ class CalendarType extends AbstractType
->add('comment', CommentType::class, [ ->add('comment', CommentType::class, [
'required' => false, 'required' => false,
]) ])
->add('privateComment', PrivateCommentType::class, [
'required' => false,
'label' => 'private comment',
])
// ->add('cancelReason', EntityType::class, [ // ->add('cancelReason', EntityType::class, [
// 'required' => false, // 'required' => false,
// 'class' => CancelReason::class, // 'class' => CancelReason::class,

View File

@ -0,0 +1,39 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CalendarBundle\Form;
use Chill\CalendarBundle\Entity\CancelReason;
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
class CancelReasonType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TranslatableStringFormType::class)
->add('active', CheckboxType::class, [
'required' => false,
])
->add('canceledBy', TextType::class);
}
public function configureOptions(OptionsResolver $resolver)
{
$resolver
->setDefault('class', CancelReason::class);
}
}

View File

@ -0,0 +1,54 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CalendarBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
class AdminMenuBuilder implements LocalMenuBuilderInterface
{
/**
* @var AuthorizationCheckerInterface
*/
protected $authorizationChecker;
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
{
$this->authorizationChecker = $authorizationChecker;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
return;
}
$menu->addChild('Calendar', [
'route' => 'chill_calendar_admin_index',
])
->setAttribute('class', 'list-group-item-header')
->setExtras([
'order' => 6000,
'icons' => ['calendar'],
]);
$menu->addChild('Cancel reason', [
'route' => 'chill_crud_calendar_cancel-reason_index',
])->setExtras(['order' => 6010]);
}
public static function getMenuIds(): array
{
return ['admin_section', 'admin_calendar'];
}
}

View File

@ -0,0 +1,13 @@
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_calendar', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}<!-- block content empty -->
<h1>{{ 'Calendar configuration' |trans }}</h1>
{% endblock %}
{% endblock %}

View File

@ -44,6 +44,10 @@
{{ form_row(form.comment) }} {{ form_row(form.comment) }}
{% endif %} {% endif %}
{%- if form.privateComment is defined -%}
{{ form_row(form.privateComment) }}
{% endif %}
{%- if form.sendSMS is defined -%} {%- if form.sendSMS is defined -%}
{{ form_row(form.sendSMS) }} {{ form_row(form.sendSMS) }}
{% endif %} {% endif %}

View File

@ -44,6 +44,10 @@
{{ form_row(form.comment) }} {{ form_row(form.comment) }}
{% endif %} {% endif %}
{%- if form.privateComment is defined -%}
{{ form_row(form.privateComment) }}
{% endif %}
{%- if form.sendSMS is defined -%} {%- if form.sendSMS is defined -%}
{{ form_row(form.sendSMS) }} {{ form_row(form.sendSMS) }}
{% endif %} {% endif %}

View File

@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@ -0,0 +1,43 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>{{ 'Id'|trans }}</th>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'canceledBy'|trans }}</th>
<th>{{ 'active'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td>{{ entity.canceledBy }}</td>
<td style="text-align:center;">
{%- if entity.active -%}
<i class="fa fa-check-square-o"></i>
{%- else -%}
<i class="fa fa-square-o"></i>
{%- endif -%}
</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_calendar_cancel-reason_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@ -0,0 +1,12 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@ -0,0 +1,33 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\Migrations\Calendar;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220527124558 extends AbstractMigration
{
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar DROP privateComment_comments');
}
public function getDescription(): string
{
return 'add private comment to calendar';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_calendar.calendar ADD privateComment_comments JSON DEFAULT NULL');
}
}

View File

@ -27,6 +27,18 @@ From the day: Du
to the day: au to the day: au
Transform to activity: Transformer en échange Transform to activity: Transformer en échange
canceledBy: supprimé par
Canceled by: supprimé par
Calendar configuration: Gestion des rendez-vous
crud:
calendar_cancel-reason:
index:
title: Liste des motifs d'annulation
add_new: Ajouter un nouveau
title_new: Nouveau motif d'annulation
title_edit: Modifier le motif d'annulation
chill_calendar: chill_calendar:
form: form:
The main user is mandatory. He will organize the appointment.: L'utilisateur principal est obligatoire. Il est l'organisateur de l'événement. The main user is mandatory. He will organize the appointment.: L'utilisateur principal est obligatoire. Il est l'organisateur de l'événement.

View File

@ -34,6 +34,7 @@ class ChillCustomFieldsExtension extends Extension implements PrependExtensionIn
$loader->load('services/fixtures.yaml'); $loader->load('services/fixtures.yaml');
$loader->load('services/controller.yaml'); $loader->load('services/controller.yaml');
$loader->load('services/command.yaml'); $loader->load('services/command.yaml');
$loader->load('services/menu.yaml');
//add at least a blank array at 'customizable_entities' options //add at least a blank array at 'customizable_entities' options
//$customizable_entities = (isset($config['customizables_entities']) //$customizable_entities = (isset($config['customizables_entities'])

View File

@ -0,0 +1,58 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CustomFieldsBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
class AdminMenuBuilder implements LocalMenuBuilderInterface
{
/**
* @var AuthorizationCheckerInterface
*/
protected $authorizationChecker;
public function __construct(AuthorizationCheckerInterface $authorizationChecker)
{
$this->authorizationChecker = $authorizationChecker;
}
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
if (!$this->authorizationChecker->isGranted('ROLE_ADMIN')) {
return;
}
$menu->addChild('Custom fields', [
'route' => 'customfield_section',
])
->setAttribute('class', 'list-group-item-header')
->setExtras([
'order' => 4500,
'icons' => ['plus'],
]);
$menu->addChild('Custom fields group', [
'route' => 'customfield_section',
])->setExtras(['order' => 4510]);
$menu->addChild('Custom fields group', [
'route' => 'customfieldsgroup',
])->setExtras(['order' => 4520]);
}
public static function getMenuIds(): array
{
return ['admin_section', 'admin_custom_fields'];
}
}

View File

@ -1,26 +1,8 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} {% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %} {% block vertical_menu_content %}
{{ chill_menu('admin_custom_fields', { {{ chill_menu('admin_custom_fields', {
'layout': '@ChillCustomFields/Admin/menu.html.twig', 'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }} }) }}
{% endblock %} {% endblock %}

View File

@ -1,20 +0,0 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
{% block v_menu_title %}{{ 'Custom fields configuration menu'|trans }}{% endblock %}

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'CustomField edit'|trans }}{% endblock title %} {% block title %}{{ 'CustomField edit'|trans }}{% endblock title %}

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'CustomField creation'|trans }}{% endblock title %} {% block title %}{{ 'CustomField creation'|trans }}{% endblock title %}

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %} {% block admin_content %}
<h1>CustomField</h1> <h1>CustomField</h1>

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'CustomFieldsGroup edit'|trans }}{% endblock %} {% block title %}{{ 'CustomFieldsGroup edit'|trans }}{% endblock %}

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'CustomFieldsGroup list'|trans }}{% endblock %} {% block title %}{{ 'CustomFieldsGroup list'|trans }}{% endblock %}

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %} {% block admin_content %}
<h1>{{ 'CustomFieldsGroup creation'|trans }}</h1> <h1>{{ 'CustomFieldsGroup creation'|trans }}</h1>

View File

@ -14,7 +14,7 @@
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
#} #}
{% extends "@ChillCustomFields/Admin/layout.html.twig" %} {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'CustomFieldsGroup details'|trans }}{% endblock %} {% block title %}{{ 'CustomFieldsGroup details'|trans }}{% endblock %}

View File

@ -1,12 +1,6 @@
customfield_section: customfield_section:
path: /{_locale}/admin/customfield/ path: /{_locale}/admin/customfield/
defaults: { _controller: "ChillCustomFieldsBundle:Admin:index" } defaults: { _controller: "ChillCustomFieldsBundle:Admin:index" }
options:
menus:
admin_section:
order: 1000
label: "Custom fields configuration"
icons: ['asterisk']
customfield_new: customfield_new:
path: /{_locale}/admin/customfield/new path: /{_locale}/admin/customfield/new

View File

@ -1,11 +1,6 @@
customfieldsgroup: customfieldsgroup:
path: /{_locale}/admin/customfieldsgroup/ path: /{_locale}/admin/customfieldsgroup/
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:index" } defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:index" }
options:
menus:
admin_custom_fields:
order: 1010
label: "CustomFields Groups"
customfieldsgroup_show: customfieldsgroup_show:
path: /{_locale}/admin/customfieldsgroup/{id}/show path: /{_locale}/admin/customfieldsgroup/{id}/show

View File

@ -0,0 +1,7 @@
services:
Chill\CustomFieldsBundle\Menu\:
autowire: true
autoconfigure: true
resource: '../../Menu/'
tags: ['chill.menu_builder']

View File

@ -37,16 +37,18 @@ CustomFields List: Liste des champs personnalisés
CustomFields Groups: Groupe de champs personnalisés CustomFields Groups: Groupe de champs personnalisés
#customfield administration #customfield administration
Custom fields: Champs personnalisés
CustomFields configuration: Gestion des champs personnalisés
CustomField edit: Modification d'un champ personnalisé CustomField edit: Modification d'un champ personnalisé
CustomField creation: Nouveau champ personnalisé CustomField creation: Nouveau champ personnalisé
General informations: Informations générales General informations: Informations générales
Options: Options Options: Options
Custom fields group: Groupe de champ personnalisé Custom fields group: Groupe de champs personnalisés
Ordering: Ordre d'apparition Ordering: Ordre d'apparition
Required field: Champs requis Required field: Champs requis
An answer is required: Une réponse est requise An answer is required: Une réponse est requise
Any answer is required: Aucune réponse n'est requise Any answer is required: Aucune réponse n'est requise
Back to the group: Retour au groupe de champs personnalisé Back to the group: Retour au groupe de champs personnalisés
Slug: Identifiant textuel Slug: Identifiant textuel
The custom field has been created: Le champ personnalisé est créé The custom field has been created: Le champ personnalisé est créé
The custom field form contains errors: Le formulaire contient des erreurs The custom field form contains errors: Le formulaire contient des erreurs

View File

@ -68,7 +68,7 @@ class AdminDocGeneratorTemplateController extends CRUDController
{ {
$this->denyAccessUnlessGranted('ROLE_ADMIN'); $this->denyAccessUnlessGranted('ROLE_ADMIN');
return $this->render('ChillDocGeneratorBundle:Admin/DocGeneratorTemplate:pick-context.html.twig', [ return $this->render('@ChillDocGenerator/DocGeneratorTemplate/pick-context.html.twig', [
'contexts' => $this->contextManager->getContexts(), 'contexts' => $this->contextManager->getContexts(),
]); ]);
} }

View File

@ -56,16 +56,16 @@ class ChillDocGeneratorExtension extends Extension implements PrependExtensionIn
'controller' => \Chill\DocGeneratorBundle\Controller\AdminDocGeneratorTemplateController::class, 'controller' => \Chill\DocGeneratorBundle\Controller\AdminDocGeneratorTemplateController::class,
'actions' => [ 'actions' => [
'index' => [ 'index' => [
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/index.html.twig', 'template' => '@ChillDocGenerator/DocGeneratorTemplate/index.html.twig',
'role' => 'ROLE_ADMIN', 'role' => 'ROLE_ADMIN',
], ],
'new' => [ 'new' => [
'role' => 'ROLE_ADMIN', 'role' => 'ROLE_ADMIN',
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/new.html.twig', 'template' => '@ChillDocGenerator/DocGeneratorTemplate/new.html.twig',
], ],
'edit' => [ 'edit' => [
'role' => 'ROLE_ADMIN', 'role' => 'ROLE_ADMIN',
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/edit.html.twig', 'template' => '@ChillDocGenerator/DocGeneratorTemplate/edit.html.twig',
], ],
], ],
], ],

View File

@ -16,8 +16,6 @@ use Knp\Menu\MenuItem;
use Symfony\Component\Security\Core\Security; use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use function in_array;
class AdminMenuBuilder implements LocalMenuBuilderInterface class AdminMenuBuilder implements LocalMenuBuilderInterface
{ {
private Security $security; private Security $security;
@ -33,19 +31,17 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
public function buildMenu($menuId, MenuItem $menu, array $parameters) public function buildMenu($menuId, MenuItem $menu, array $parameters)
{ {
if ($this->security->isGranted('ROLE_ADMIN')) { if ($this->security->isGranted('ROLE_ADMIN')) {
if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild($this->translator->trans('docgen.Document generation'), [ $menu->addChild($this->translator->trans('docgen.Document generation'), [
'route' => 'chill_crud_docgen_template_index', 'route' => 'chill_crud_docgen_template_index',
])->setExtras([ ])->setExtras([
'order' => 350, 'order' => 4020,
'explain' => 'docgen.Manage templates and document generation', 'explain' => 'docgen.Manage templates and document generation',
]); ]);
} }
} }
}
public static function getMenuIds(): array public static function getMenuIds(): array
{ {
return ['admin_index', 'admin_section', 'docgen_admin']; return ['admin_section', 'admin_docstore'];
} }
} }

View File

@ -1,4 +0,0 @@
{% extends '@ChillPerson/Admin/layout.html.twig' %}
{% block vertical_menu_content %}
{% endblock %}

View File

@ -1,8 +1,8 @@
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title 'docgen.Edit template'|trans %} {% block title 'docgen.Edit template'|trans %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %} {% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block crud_content_header %} {% block crud_content_header %}

View File

@ -1,6 +1,6 @@
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %} {% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %} {% block table_entities_thead_tr %}
<th></th> <th></th>
@ -34,5 +34,11 @@
</tr> </tr>
{% endfor %} {% endfor %}
{% endblock %} {% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %} {% endembed %}
{% endblock %} {% endblock %}

View File

@ -1,8 +1,8 @@
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title 'docgen.New template'|trans %} {% block title 'docgen.New template'|trans %}
{% block layout_wvm_content %} {% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block crud_content_header %} {% block crud_content_header %}

View File

@ -1,8 +1,8 @@
{% extends '@ChillDocGenerator/Admin/layout.html.twig' %} {% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title 'docgen.Pick template context'|trans %} {% block title 'docgen.Pick template context'|trans %}
{% block layout_wvm_content %} {% block admin_content %}
<div class="col-md-10 col-xxl"> <div class="col-md-10 col-xxl">
<h1>{{ block('title') }}</h1> <h1>{{ block('title') }}</h1>

View File

@ -8,7 +8,7 @@ docgen:
New template: Nouveau modèle New template: Nouveau modèle
Edit template: Modifier modèle Edit template: Modifier modèle
test generate: Tester la génération test generate: Tester la génération
With context: 'Avec le contexte :' With context %name%: 'Avec le contexte "%name%"'
crud: crud:
@ -18,3 +18,5 @@ crud:
add_new: Créer add_new: Créer
Show data instead of generating: Montrer les données au lieu de générer le document
Template file: Fichier modèle

View File

@ -102,10 +102,18 @@ class DocumentCategoryController extends AbstractController
public function new(Request $request): Response public function new(Request $request): Response
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$nextId = $em
->createQuery(
'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c'
)
->getSingleResult();
$documentCategory = new DocumentCategory( $documentCategory = new DocumentCategory(
ChillDocStoreBundle::class, ChillDocStoreBundle::class,
$em->getRepository(DocumentCategory::class)->nextIdInsideBundle() reset($nextId)
); );
$documentCategory $documentCategory
->setDocumentClass(PersonDocument::class); ->setDocumentClass(PersonDocument::class);
@ -120,8 +128,6 @@ class DocumentCategoryController extends AbstractController
return $this->redirectToRoute('document_category_index'); return $this->redirectToRoute('document_category_index');
} }
$documentCategory->setBundleId(ChillDocStoreBundle::class);
return $this->render('ChillDocStoreBundle:DocumentCategory:new.html.twig', [ return $this->render('ChillDocStoreBundle:DocumentCategory:new.html.twig', [
'document_category' => $documentCategory, 'document_category' => $documentCategory,
'form' => $form->createView(), 'form' => $form->createView(),

View File

@ -87,6 +87,13 @@ class DocumentCategory
return $this->name; return $this->name;
} }
public function setBundleId($id): self
{
$this->bundleId = $id;
return $this;
}
public function setDocumentClass($documentClass): self public function setDocumentClass($documentClass): self
{ {
$this->documentClass = $documentClass; $this->documentClass = $documentClass;

View File

@ -71,6 +71,12 @@ class StoredObject implements AsyncFileInterface, Document
*/ */
private array $keyInfos = []; private array $keyInfos = [];
/**
* @ORM\Column(type="text", name="title")
* @Serializer\Groups({"read", "write"})
*/
private string $title = '';
/** /**
* @ORM\Column(type="text", name="type") * @ORM\Column(type="text", name="type")
* @Serializer\Groups({"read", "write"}) * @Serializer\Groups({"read", "write"})
@ -127,6 +133,11 @@ class StoredObject implements AsyncFileInterface, Document
return $this->getFilename(); return $this->getFilename();
} }
public function getTitle()
{
return $this->title;
}
public function getType() public function getType()
{ {
return $this->type; return $this->type;
@ -177,6 +188,13 @@ class StoredObject implements AsyncFileInterface, Document
return $this; return $this;
} }
public function setTitle(?string $title)
{
$this->title = (string) $title;
return $this;
}
public function setType(?string $type) public function setType(?string $type)
{ {
$this->type = (string) $type; $this->type = (string) $type;

View File

@ -37,13 +37,13 @@ class DocumentCategoryType extends AbstractType
$builder $builder
->add('bundleId', ChoiceType::class, [ ->add('bundleId', ChoiceType::class, [
'choices' => $this->chillBundlesFlipped, 'choices' => $this->chillBundlesFlipped,
'disabled' => true, 'disabled' => false,
]) ])
->add('idInsideBundle', null, [ ->add('idInsideBundle', null, [
'disabled' => true, 'disabled' => true,
]) ])
->add('documentClass', null, [ ->add('documentClass', null, [
'disabled' => true, 'disabled' => false,
]) // cahcerh par default PersonDocument ]) // cahcerh par default PersonDocument
->add('name', TranslatableStringFormType::class); ->add('name', TranslatableStringFormType::class);
} }

View File

@ -17,6 +17,7 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\CallbackTransformer; use Symfony\Component\Form\CallbackTransformer;
use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
@ -40,6 +41,13 @@ class StoredObjectType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
if (true === $options['has_title']) {
$builder
->add('title', TextType::class, [
'label' => 'Title',
]);
}
$builder $builder
->add('filename', AsyncUploaderType::class) ->add('filename', AsyncUploaderType::class)
->add('type', HiddenType::class) ->add('type', HiddenType::class)
@ -70,6 +78,10 @@ class StoredObjectType extends AbstractType
{ {
$resolver $resolver
->setDefault('data_class', StoredObject::class); ->setDefault('data_class', StoredObject::class);
$resolver
->setDefault('has_title', false)
->setAllowedTypes('has_title', ['bool']);
} }
public function getBlockPrefix() public function getBlockPrefix()

View File

@ -9,7 +9,7 @@
declare(strict_types=1); declare(strict_types=1);
namespace Chill\PersonBundle\Menu; namespace Chill\DocStoreBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem; use Knp\Menu\MenuItem;
@ -33,16 +33,22 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
return; return;
} }
$menu->addChild('Person', [ $menu->addChild('Documents', [
'route' => 'chill_person_admin', 'route' => 'chill_docstore_admin',
]) ])
->setAttribute('class', 'list-group-item-header')
->setExtras([ ->setExtras([
'order' => 20, 'order' => 4000,
'icons' => ['file-pdf-o'],
]); ]);
$menu->addChild('Document category list', [
'route' => 'chill_docstore_category_admin',
])->setExtras(['order' => 4010]);
} }
public static function getMenuIds(): array public static function getMenuIds(): array
{ {
return ['admin_section']; return ['admin_section', 'admin_docstore'];
} }
} }

View File

@ -61,15 +61,4 @@ class DocumentCategoryRepository implements ObjectRepository
{ {
return DocumentCategory::class; return DocumentCategory::class;
} }
public function nextIdInsideBundle()
{
$array_res = $this->em
->createQuery(
'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c'
)
->getSingleResult();
return reset($array_res);
}
} }

View File

@ -1,26 +1,8 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %} {% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
{% block vertical_menu_content %} {% block vertical_menu_content %}
{{ chill_menu('admin_docstore', { {{ chill_menu('admin_docstore', {
'layout': '@ChillDocStore/Admin/menu.html.twig', 'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }} }) }}
{% endblock %} {% endblock %}

View File

@ -1,21 +0,0 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
<info@champs-libres.coop> / <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "@ChillMain/Menu/verticalMenu.html.twig" %}
{% block v_menu_title %}{{ 'Documents configuration'|trans }}{% endblock %}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2018, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
{% block title %}{{ 'Document category edit'|trans }}{% endblock title %} {% block title %}{{ 'Document category edit'|trans }}{% endblock title %}
@ -27,7 +11,7 @@
{{ form_start(form) }} {{ form_start(form) }}
{{ form_widget(form) }} {{ form_widget(form) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('document_category_index') }}" class="btn btn-cancel"> <a href="{{ path('document_category_index') }}" class="btn btn-cancel">
{{ 'Back to the category list' | trans }} {{ 'Back to the category list' | trans }}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2018, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
{% block title %}{{ 'Document category list' | trans }}{% endblock title %} {% block title %}{{ 'Document category list' | trans }}{% endblock title %}
@ -54,7 +38,7 @@
</tbody> </tbody>
</table> </table>
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li> <li>
<a href="{{ path('document_category_new') }}" class="btn btn-create">{{ 'Create new category' | trans }}</a> <a href="{{ path('document_category_new') }}" class="btn btn-create">{{ 'Create new category' | trans }}</a>
</li> </li>

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2018, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
{% block title %}{{ 'Create new document category' | trans }}{% endblock title %} {% block title %}{{ 'Create new document category' | trans }}{% endblock title %}
@ -27,14 +11,14 @@
{{ form_start(form) }} {{ form_start(form) }}
{{ form_widget(form) }} {{ form_widget(form) }}
<ul class="record_actions"> <ul class="record_actions sticky-form-buttons">
<li class="cancel"> <li class="cancel">
<a href="{{ path('document_category_index') }}" class="btn btn-cancel"> <a href="{{ path('document_category_index') }}" class="btn btn-cancel">
{{ 'Back to the category list' | trans }} {{ 'Back to the category list' | trans }}
</a> </a>
</li> </li>
<li> <li>
<button class="btn btn-new">{{ button_label|default('New')|trans }}</button> <button class="btn btn-new">{{ button_label|default('Create')|trans }}</button>
</li> </li>
</ul> </ul>
{{ form_end(form) }} {{ form_end(form) }}

View File

@ -1,20 +1,4 @@
{# {% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
* Copyright (C) 2018, Champs Libres Cooperative SCRLFS, <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
#}
{% extends "ChillDocStoreBundle:Admin:layout.html.twig" %}
{% block title %}{{ 'Document category show'|trans }}{% endblock title %} {% block title %}{{ 'Document category show'|trans }}{% endblock title %}

View File

@ -1,4 +1,5 @@
{% block stored_object_widget %} {% block stored_object_widget %}
{% if form.title is defined %} {{ form_row(form.title) }} {% endif %}
<div <div
data-stored-object="data-stored-object" data-stored-object="data-stored-object"
data-label-preparing="{{ ('Preparing'|trans ~ '...')|escape('html_attr') }}" data-label-preparing="{{ ('Preparing'|trans ~ '...')|escape('html_attr') }}"

View File

@ -25,8 +25,3 @@ chill_docstore_admin_redirect_to_admin_index:
chill_docstore_category_admin: chill_docstore_category_admin:
path: /{_locale}/admin/document/category path: /{_locale}/admin/document/category
controller: Chill\DocStoreBundle\Controller\DocumentCategoryController::indexAction controller: Chill\DocStoreBundle\Controller\DocumentCategoryController::indexAction
options:
menus:
admin_docstore:
order: 90
label: "Documents categories"

Some files were not shown because too many files have changed in this diff Show More