Merge remote-tracking branch 'origin/master' into issue578_display_userjob

This commit is contained in:
Julien Fastré 2022-05-27 16:00:16 +02:00
commit 4d0717690b
300 changed files with 4869 additions and 1750 deletions

View File

@ -18,3 +18,10 @@ max_line_length = 80
[COMMIT_EDITMSG]
max_line_length = 0
<<<<<<< Updated upstream
=======
[*.{js, vue, ts}]
indent_size = 2
indent_style = space
>>>>>>> Stashed changes

View File

@ -11,16 +11,29 @@ and this project adheres to
## Unreleased
<!-- write down unreleased development here -->
* [admin] refactorisation of the admin section: reorganisation of the menu, translations, form types, new entities (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/592)
* [admin] add admin section for languages and countries (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/596)
* [activity] activity admin: translations + remove label field for comment on admin activity type (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/587)
* [main] admin user_job: improvements (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/588)
* [address] can add extra address info even if noAddress (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/576)
## Test releases
### 2022-05-06
* [person] add civility when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557)
* [person] add address when creating a person (with the on-the-fly component or in the php form) (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557)
* [person] add household creation API point (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/557)
### 2021-04-29
* [person] prevent circular references in PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/527)
* [person] add maritalStatusComment to PersonDocGenNormalizer (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/582)
* Load relationships without gender in french fixtures
* Add command to remove old draft accompanying periods
* [parcours]: If users assings him/herself as referrer and job is not null. Update parcours job (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/578)
## Test releases
### 2021-04-28
* [address] fix bug when editing address: update location and addressreferenceId + better update of the map in edition (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/593)

View File

@ -2,7 +2,14 @@
en cours de rédaction
## Translations
Par bundle, toutes les traductions des pages twig se trouvent dans un seul fichier `translations/messages.fr.yaml`.
## Emplacement des fichiers
Les controllers, form type & templates twig sont placés à la racine des dossiers `Controller`, `Form` & `Ressources/views`, respectivement. Pour les pages Admin, on ne les mets plus dans des sous-dossiers Admin.
## Assets: nommage des entrypoints
Trois types d'entrypoint:
@ -146,19 +153,20 @@ Ces règles n'ont pas toujours été utilisées par le passé. Elles sont souhai
Les routes sont nommées de cette manière:
`chill_bundle_entite_action`
`chill_(api|crud)_bundle_(api)_entite_action`
1. d'abord chill_ (pour tous les modules chill)
2. ensuite une string qui est identique, par bundle
3. si le point est un point d'api (json), alors ajouter la string `api`
4. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités
5. ensuite une action (`list`, `view`, `edit`, `new`, ...)
2. ensuite `crud` ou `api`, optionnel, automatiquement ajouté si la route est générée par la configuration
3. ensuite une string qui indique le bundle (`main`, `person`, `activity`, ...)
4. ensuite, `api`, si la route est une route d'api.
5. ensuite une string qui indique sur quelle entité porte la route, voire également les sous-entités
6. ensuite une action (`list`, `view`, `edit`, `new`, ...)
Le fait d'indiquer `api` en 3 permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`)
Le fait d'indiquer `api` en quatrième position permet de distinguer les routes d'api qui sont générées par la configuration (qui sont toutes préfixées par `chill_api`, de celles générées manuellement. (Exemple: `chill_api_household__index`, et `chill_person_api_household_members_move`)
Si les points 4 et 5 sont inexistants, alors ils sont remplacés par d'autres éléments de manière à garantir l'unicité de la route, et sa bonne compréhension.
### URL
### Nommage des URL
Les URL respectent également une convention:
@ -219,6 +227,14 @@ Les éléments suivants devraient se trouver dans la liste:
Ces éléments peuvent être entrecoupés de l'identifiant d'une entité. Dans ce cas, cet identifiant se place juste après l'entité auquel il se rapporte.
#### Pour les URL de l'espace Admin
Même conventions que dans les autres pages html de l'application, **mais `admin` est ajouté en deuxième position**. Soit:
`/{_locale}/admin/bundle/entity/{id}/action`
## Règles UI chill
### Titre des pages

View File

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

View File

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

View File

@ -20,6 +20,7 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\ChillCollectionType;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\CommentType;
use Chill\MainBundle\Form\Type\PrivateCommentType;
use Chill\MainBundle\Form\Type\ScopePickerType;
use Chill\MainBundle\Form\Type\UserPickerType;
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
@ -251,6 +252,13 @@ class ActivityType extends AbstractType
]);
}
if ($activityType->isVisible('privateComment')) {
$builder->add('privateComment', PrivateCommentType::class, [
'label' => '' === $activityType->getLabel('privateComment') ? 'private comment' : $activityType->getPrivateCommentLabel(),
'required' => false,
]);
}
if ($activityType->isVisible('persons')) {
$builder->add('persons', HiddenType::class);
$builder->get('persons')

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,5 @@
{%- set t = entity.type -%}
{% set userId = app.user.id %}
{%- import "@ChillDocStore/Macro/macro.html.twig" as m -%}
<h1>{{ "Activity"|trans }}</h1>
@ -146,6 +147,21 @@
</dd>
{% 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) %}
<dt class="inline">{{ 'Documents'|trans }}</dt>
<dd>

View File

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

View File

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

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReason edit'|trans }}</h1>
@ -24,7 +8,7 @@
{{ form_row(edit_form.active) }}
{{ form_row(edit_form.category) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a>
</li>

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReason list'|trans }}</h1>
@ -45,7 +29,11 @@
</tbody>
</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>
<a href="{{ path('chill_activity_activityreason_new') }}" class="btn btn-new">
{{ 'Create a new activity reason'|trans }}

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReason creation'|trans }}</h1>
@ -24,7 +8,7 @@
{{ form_row(form.active) }}
{{ form_row(form.category) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a>
</li>

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReason'|trans }}</h1>
@ -38,7 +22,7 @@
</tbody>
</table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activityreason') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReasonCategory edit'|trans }}</h1>
@ -23,7 +7,7 @@
{{ form_row(edit_form.name) }}
{{ form_row(edit_form.active) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReasonCategory list'|trans }}</h1>
@ -46,7 +30,7 @@
</tbody>
</table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('chill_activity_activityreasoncategory_new') }}" class="btn btn-new">
{{ 'Create a new activity category reason'|trans }}

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReasonCategory creation'|trans }}</h1>
@ -23,7 +7,7 @@
{{ form_row(form.name) }}
{{ form_row(form.active) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel">{{ 'Back to the list'|trans }}</a>
</li>

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityReasonCategory'|trans }}</h1>
@ -37,7 +21,7 @@
</tr>
</tbody>
</table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('chill_activity_activityreasoncategory') }}" class="btn btn-cancel">
{{ '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 %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %}

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
<h1>{{ 'ActivityType list'|trans }}</h1>
@ -50,7 +34,7 @@
</tbody>
</table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('chill_crud_activity_type_new') }}" class="btn btn-create">
{{ '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 %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
{#
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* 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
@ -20,7 +20,7 @@
{% block vertical_menu_content %}
{{ chill_menu('admin_activity', {
'layout': '@ChillActivity/Admin/menu_activity.html.twig',
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% 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

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

View File

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

View File

@ -1,11 +1,6 @@
chill_activity_activityreasoncategory:
path: /{_locale}/admin/activityreasoncategory/
controller: Chill\ActivityBundle\Controller\ActivityReasonCategoryController::indexAction
options:
menus:
admin_activity:
order: 2010
label: "Activity Reasons Category"
chill_activity_activityreasoncategory_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 '
location: Lieu
Reasons: Sujets
Private comment: Commentaire privé
#forms
@ -113,7 +114,7 @@ Activity type configuration: Configuration des categories d'activités
Activity Reasons: Sujets d'une activité
Activity Reasons Category: Catégories de sujet d'activités
Activity Types Categories: Catégories des types d'activité
Activity Presences: Presences des activités
Activity Presences: Presences aux activités
# Crud
@ -124,6 +125,9 @@ crud:
activity_type_category:
title_new: Nouvelle 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
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 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
ActivityType list: Types d'activités
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
Comment visible: Visibilité 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 label: Libellé du champ Urgent
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 Symfony\Component\Security\Core\Security;
use function in_array;
final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuilderInterface
{
private Security $security;
@ -32,27 +30,25 @@ final class AdminMenuBuilder implements \Chill\MainBundle\Routing\LocalMenuBuild
return;
}
if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild('Aside activities', [
$menu->addChild('Aside activities', [
'route' => 'chill_aside_activity_admin',
])
->setAttribute('class', 'list-group-item-header')
->setExtras([
'order' => 7000,
'explain' => 'Aside activity type configuration',
]);
$menu
->addChild('Aside activity categories', [
'route' => 'chill_crud_aside_activity_category_index',
])
->setExtras([
'order' => 900,
'explain' => 'Aside activity type configuration',
]);
} else {
$menu
->addChild('Aside activity categories', [
'route' => 'chill_crud_aside_activity_category_index',
])
->setExtras([
'order' => '50',
]);
}
->setExtras([
'order' => 7010,
]);
}
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" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_aside_activity') }}
{{ chill_menu('admin_aside_activity', {
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% endblock %}
{% 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 %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_view %}{% endblock %}
{% block content_form_actions_save_and_show %}{% endblock %}

View File

@ -1,7 +1,10 @@
{% 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 %}
<h1>{{ 'Aside Activity Type List'|trans }}</h1>
<h1>{{ 'Aside Activity Type List'|trans }}</h1>
<table class="records_list table table-bordered border-dark">
<thead>
@ -36,7 +39,7 @@
</tbody>
</table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('chill_crud_aside_activity_category_new') }}" class="btn btn-create">
{{ '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 %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block layout_wvm_content %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}

View File

@ -38,7 +38,7 @@ crud:
confirm_message_delete: Êtes-vous sûr de vouloir supprimer cette activité annexe?
aside_activity_category:
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
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 activity types: Types 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

@ -47,6 +47,29 @@ class ChillCalendarExtension extends Extension implements PrependExtensionInterf
protected function prependCruds(ContainerBuilder $container)
{
$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' => [
[
'controller' => \Chill\CalendarBundle\Controller\CalendarRangeAPIController::class,

View File

@ -14,6 +14,7 @@ namespace Chill\CalendarBundle\Entity;
use Chill\ActivityBundle\Entity\Activity;
use Chill\CalendarBundle\Repository\CalendarRepository;
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
use Chill\MainBundle\Entity\Embeddable\PrivateCommentEmbeddable;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
@ -115,6 +116,12 @@ class Calendar
*/
private Collection $persons;
/**
* @ORM\Embedded(class=PrivateCommentEmbeddable::class, columnPrefix="privateComment_")
* @Serializer\Groups({"calendar:read"})
*/
private PrivateCommentEmbeddable $privateComment;
/**
* @ORM\ManyToMany(
* targetEntity="Chill\ThirdPartyBundle\Entity\ThirdParty",
@ -151,6 +158,7 @@ class Calendar
public function __construct()
{
$this->comment = new CommentEmbeddable();
$this->privateComment = new PrivateCommentEmbeddable();
$this->persons = new ArrayCollection();
$this->professionals = new ArrayCollection();
$this->invites = new ArrayCollection();
@ -278,6 +286,11 @@ class Calendar
return [];
}
public function getPrivateComment(): PrivateCommentEmbeddable
{
return $this->privateComment;
}
/**
* @return Collection|ThirdParty[]
*/
@ -407,6 +420,13 @@ class Calendar
return $this;
}
public function setPrivateComment(PrivateCommentEmbeddable $privateComment): self
{
$this->privateComment = $privateComment;
return $this;
}
public function setSendSMS(?bool $sendSMS): self
{
$this->sendSMS = $sendSMS;

View File

@ -18,6 +18,7 @@ use Chill\CalendarBundle\Entity\Invite;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Form\Type\CommentType;
use Chill\MainBundle\Form\Type\PrivateCommentType;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Entity\Person;
use Chill\ThirdPartyBundle\Entity\ThirdParty;
@ -51,6 +52,10 @@ class CalendarType extends AbstractType
->add('comment', CommentType::class, [
'required' => false,
])
->add('privateComment', PrivateCommentType::class, [
'required' => false,
'label' => 'private comment',
])
// ->add('cancelReason', EntityType::class, [
// 'required' => false,
// '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

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

View File

@ -43,6 +43,10 @@
{{ form_row(form.comment) }}
{% endif %}
{%- if form.privateComment is defined -%}
{{ form_row(form.privateComment) }}
{% endif %}
{%- if form.sendSMS is defined -%}
{{ form_row(form.sendSMS) }}
{% endif %}
@ -50,22 +54,22 @@
<div id="fullCalendar"></div>
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a
class="btn btn-cancel"
{%- if context == 'person' -%}
href="{{ chill_return_path_or('chill_calendar_calendar_list', { 'person_id': person.id } )}}"
{%- else -%}
href="{{ chill_return_path_or('chill_calendar_calendar_list', { 'accompanying_period_id': accompanyingCourse.id } )}}"
{%- endif -%}
>
{{ 'Cancel'|trans|chill_return_path_label }}
</a>
</li>
<li>
<button class="btn btn-create" type="submit">
{{ 'Create'|trans }}
</button>
</li>
<li class="cancel">
<a
class="btn btn-cancel"
{%- if context == 'person' -%}
href="{{ chill_return_path_or('chill_calendar_calendar_list', { 'person_id': person.id } )}}"
{%- else -%}
href="{{ chill_return_path_or('chill_calendar_calendar_list', { 'accompanying_period_id': accompanyingCourse.id } )}}"
{%- endif -%}
>
{{ 'Cancel'|trans|chill_return_path_label }}
</a>
</li>
<li>
<button class="btn btn-create" type="submit">
{{ 'Create'|trans }}
</button>
</li>
</ul>
{{ form_end(form) }}

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

@ -17,7 +17,7 @@ status: Statut du rendez-vous
calendar location: Localistion du rendez-vous
calendar comment: Remarque sur le rendez-vous
sendSMS: Envoi d'un SMS
Send s m s: Envoi d'un SMS ?
Send s m s: Envoi d'un SMS ?
Cancel reason: Motif d'annulation
Add a new calendar: Ajouter un nouveau rendez-vous
"Success : calendar item updated!": "Rendez-vous mis à jour"
@ -25,4 +25,16 @@ Add a new calendar: Ajouter un nouveau rendez-vous
The calendar item has been successfully removed.: Le rendez-vous a été supprimé
From the day: Du
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

View File

@ -34,6 +34,7 @@ class ChillCustomFieldsExtension extends Extension implements PrependExtensionIn
$loader->load('services/fixtures.yaml');
$loader->load('services/controller.yaml');
$loader->load('services/command.yaml');
$loader->load('services/menu.yaml');
//add at least a blank array at 'customizable_entities' options
//$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" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_custom_fields', {
'layout': '@ChillCustomFields/Admin/menu.html.twig',
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% 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
* 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 %}

View File

@ -14,7 +14,7 @@
* 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 "@ChillCustomFields/Admin/layout.html.twig" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'CustomField creation'|trans }}{% endblock title %}
@ -39,7 +39,7 @@
{% endif %}
{{ form_row(form.submit, {'attr': { 'class': 'btn btn-create' } } ) }}
{{ form_end(form) }}
<ul class="record_actions">
<li>
{% if entity.customFieldsGroup is not null %}

View File

@ -14,7 +14,7 @@
* 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 "@ChillCustomFields/Admin/layout.html.twig" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>CustomField</h1>

View File

@ -14,7 +14,7 @@
* 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 "@ChillCustomFields/Admin/layout.html.twig" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% 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
* 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 %}

View File

@ -14,7 +14,7 @@
* 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 "@ChillCustomFields/Admin/layout.html.twig" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block admin_content %}
<h1>{{ 'CustomFieldsGroup creation'|trans }}</h1>

View File

@ -14,7 +14,7 @@
* 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 "@ChillCustomFields/Admin/layout.html.twig" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'CustomFieldsGroup details'|trans }}{% endblock %}
@ -62,9 +62,9 @@
</a>
</li>
</ul>
<h2>{{ 'Fields associated with this group'|trans }}</h2>
{%- if entity.customFields|length > 0 -%}
<table>
<thead>

View File

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

View File

@ -1,11 +1,6 @@
customfieldsgroup:
path: /{_locale}/admin/customfieldsgroup/
defaults: { _controller: "ChillCustomFieldsBundle:CustomFieldsGroup:index" }
options:
menus:
admin_custom_fields:
order: 1010
label: "CustomFields Groups"
customfieldsgroup_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
#customfield administration
Custom fields: Champs personnalisés
CustomFields configuration: Gestion des champs personnalisés
CustomField edit: Modification d'un champ personnalisé
CustomField creation: Nouveau champ personnalisé
General informations: Informations générales
Options: Options
Custom fields group: Groupe de champ personnalisé
Custom fields group: Groupe de champs personnalisés
Ordering: Ordre d'apparition
Required field: Champs requis
An answer is required: Une réponse 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
The custom field has been created: Le champ personnalisé est créé
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');
return $this->render('ChillDocGeneratorBundle:Admin/DocGeneratorTemplate:pick-context.html.twig', [
return $this->render('@ChillDocGenerator/DocGeneratorTemplate/pick-context.html.twig', [
'contexts' => $this->contextManager->getContexts(),
]);
}

View File

@ -56,16 +56,16 @@ class ChillDocGeneratorExtension extends Extension implements PrependExtensionIn
'controller' => \Chill\DocGeneratorBundle\Controller\AdminDocGeneratorTemplateController::class,
'actions' => [
'index' => [
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/index.html.twig',
'template' => '@ChillDocGenerator/DocGeneratorTemplate/index.html.twig',
'role' => 'ROLE_ADMIN',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/new.html.twig',
'template' => '@ChillDocGenerator/DocGeneratorTemplate/new.html.twig',
],
'edit' => [
'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\Contracts\Translation\TranslatorInterface;
use function in_array;
class AdminMenuBuilder implements LocalMenuBuilderInterface
{
private Security $security;
@ -33,19 +31,17 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
public function buildMenu($menuId, MenuItem $menu, array $parameters)
{
if ($this->security->isGranted('ROLE_ADMIN')) {
if (in_array($menuId, ['admin_index', 'admin_section'], true)) {
$menu->addChild($this->translator->trans('docgen.Document generation'), [
'route' => 'chill_crud_docgen_template_index',
])->setExtras([
'order' => 350,
'explain' => 'docgen.Manage templates and document generation',
]);
}
$menu->addChild($this->translator->trans('docgen.Document generation'), [
'route' => 'chill_crud_docgen_template_index',
])->setExtras([
'order' => 4020,
'explain' => 'docgen.Manage templates and document generation',
]);
}
}
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 layout_wvm_content %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% 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' %}
{% block table_entities_thead_tr %}
<th></th>
@ -34,5 +34,11 @@
</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

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

View File

@ -8,7 +8,7 @@ docgen:
New template: Nouveau modèle
Edit template: Modifier modèle
test generate: Tester la génération
With context: 'Avec le contexte :'
With context %name%: 'Avec le contexte "%name%"'
crud:
@ -18,3 +18,5 @@ crud:
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
{
$em = $this->getDoctrine()->getManager();
$nextId = $em
->createQuery(
'SELECT MAX(c.idInsideBundle) + 1 FROM ChillDocStoreBundle:DocumentCategory c'
)
->getSingleResult();
$documentCategory = new DocumentCategory(
ChillDocStoreBundle::class,
$em->getRepository(DocumentCategory::class)->nextIdInsideBundle()
reset($nextId)
);
$documentCategory
->setDocumentClass(PersonDocument::class);
@ -120,8 +128,6 @@ class DocumentCategoryController extends AbstractController
return $this->redirectToRoute('document_category_index');
}
$documentCategory->setBundleId(ChillDocStoreBundle::class);
return $this->render('ChillDocStoreBundle:DocumentCategory:new.html.twig', [
'document_category' => $documentCategory,
'form' => $form->createView(),

View File

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

View File

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

View File

@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\DocStoreBundle\Form;
use Chill\DocStoreBundle\Entity\Document;
use Chill\DocStoreBundle\Entity\DocumentCategory;
use Chill\DocStoreBundle\Entity\PersonDocument;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\ChillTextareaType;
@ -63,7 +64,7 @@ class PersonDocumentType extends AbstractType
->add('date', ChillDateType::class)
->add('category', EntityType::class, [
'placeholder' => 'Choose a document category',
'class' => 'ChillDocStoreBundle:DocumentCategory',
'class' => DocumentCategory::class,
'query_builder' => static function (EntityRepository $er) {
return $er->createQueryBuilder('c')
->where('c.documentClass = :docClass')

View File

@ -9,7 +9,7 @@
declare(strict_types=1);
namespace Chill\PersonBundle\Menu;
namespace Chill\DocStoreBundle\Menu;
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
use Knp\Menu\MenuItem;
@ -33,16 +33,22 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface
return;
}
$menu->addChild('Person', [
'route' => 'chill_person_admin',
$menu->addChild('Documents', [
'route' => 'chill_docstore_admin',
])
->setAttribute('class', 'list-group-item-header')
->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
{
return ['admin_section'];
return ['admin_section', 'admin_docstore'];
}
}

View File

@ -61,15 +61,4 @@ class DocumentCategoryRepository implements ObjectRepository
{
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" %}
{% block vertical_menu_content %}
{{ chill_menu('admin_docstore', {
'layout': '@ChillDocStore/Admin/menu.html.twig',
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
}) }}
{% 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 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Document category edit'|trans }}{% endblock title %}
@ -27,7 +11,7 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('document_category_index') }}" class="btn btn-cancel">
{{ 'Back to the category list' | trans }}

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Document category list' | trans }}{% endblock title %}
@ -54,7 +38,7 @@
</tbody>
</table>
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li>
<a href="{{ path('document_category_new') }}" class="btn btn-create">{{ 'Create new category' | trans }}</a>
</li>

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Create new document category' | trans }}{% endblock title %}
@ -27,14 +11,14 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<ul class="record_actions">
<ul class="record_actions sticky-form-buttons">
<li class="cancel">
<a href="{{ path('document_category_index') }}" class="btn btn-cancel">
{{ 'Back to the category list' | trans }}
</a>
</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>
</ul>
{{ form_end(form) }}

View File

@ -1,20 +1,4 @@
{#
* 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" %}
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Document category show'|trans }}{% endblock title %}

View File

@ -85,8 +85,6 @@ class AccompanyingCourseDocumentVoter extends AbstractChillVoter implements Prov
protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
{
$this->logger->debug(sprintf('Voting from %s class', self::class));
if (!$token->getUser() instanceof User) {
return false;
}

View File

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

View File

@ -1,4 +1,6 @@
services:
Chill\DocStoreBundle\Menu\MenuBuilder:
Chill\DocStoreBundle\Menu\:
autowire: true
autoconfigure: true
resource: '../../Menu/'
tags: ['chill.menu_builder']

View File

@ -59,6 +59,7 @@ Document class: Classe de document
no records found:
Create new category: Créer une nouvelle catégorie
Back to the category list: Retour à la liste
Create new DocumentCategory: Créer une nouvelle catégorie de document
# WOPI EDIT
online_edit_document: Éditer en ligne

View File

@ -76,7 +76,8 @@ final class AddressReferenceAPIController extends ApiController
protected function customizeQuery(string $action, Request $request, $qb): void
{
if ($request->query->has('postal_code')) {
$qb->where('e.postcode = :postal_code')
$qb->where($qb->expr()->isNull('e.deletedAt'))
->andWhere('e.postcode = :postal_code')
->setParameter('postal_code', $request->query->get('postal_code'));
}
}

View File

@ -24,13 +24,27 @@ class AdminController extends AbstractController
return $this->render('@ChillMain/Admin/index.html.twig');
}
public function indexLocationsAction()
/**
* @Route("/{_locale}/admin/language", name="chill_main_language_admin")
*/
public function indexLanguageAction()
{
return $this->render('@ChillMain/Admin/layout_location.html.twig');
return $this->render('@ChillMain/Admin/indexLanguage.html.twig');
}
public function indexPermissionsAction()
/**
* @Route("/{_locale}/admin/location", name="chill_main_location_admin")
*/
public function indexLocationAction()
{
return $this->render('@ChillMain/Admin/layout_permissions.html.twig');
return $this->render('@ChillMain/Admin/indexLocation.html.twig');
}
/**
* @Route("/{_locale}/admin/user", name="chill_main_user_admin")
*/
public function indexUserAction()
{
return $this->render('@ChillMain/Admin/indexUser.html.twig');
}
}

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