mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Merge branch 'issue596_admin_user' into 'master'
Admin interface See merge request Chill-Projet/chill-bundles!429
This commit is contained in:
commit
6edc9b25db
@ -11,6 +11,10 @@ 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)
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
@ -57,7 +57,7 @@ class ActivityTypeType extends AbstractType
|
||||
$fields = [
|
||||
'persons', 'user', 'date', 'location', 'persons',
|
||||
'thirdParties', 'durationTime', 'travelTime', 'attendee',
|
||||
'reasons', 'comment', 'sentReceived', 'documents',
|
||||
'reasons', '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)
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
@ -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 %}
|
||||
|
@ -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 }}
|
||||
|
@ -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 %}
|
||||
|
@ -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>
|
||||
|
@ -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 }}
|
||||
|
@ -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>
|
||||
|
@ -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 }}
|
||||
|
@ -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 }}
|
||||
|
@ -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 }}
|
||||
|
@ -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>
|
||||
|
@ -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 }}
|
||||
|
@ -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 %}
|
||||
|
@ -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 }}
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
@ -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 }}
|
||||
|
@ -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 %}
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
@ -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'
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -113,7 +113,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 +124,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 +148,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é
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
@ -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 %}
|
@ -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 %}
|
||||
|
@ -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 }}
|
||||
|
@ -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 %}
|
||||
|
@ -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
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
39
src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php
Normal file
39
src/Bundle/ChillCalendarBundle/Form/CancelReasonType.php
Normal 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);
|
||||
}
|
||||
}
|
54
src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php
Normal file
54
src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php
Normal 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'];
|
||||
}
|
||||
}
|
@ -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 %}
|
@ -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 %}
|
@ -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> </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 %}
|
@ -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 %}
|
||||
|
@ -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,15 @@ 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
|
@ -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'])
|
||||
|
58
src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php
Normal file
58
src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php
Normal 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'];
|
||||
}
|
||||
}
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
@ -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>
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -0,0 +1,7 @@
|
||||
services:
|
||||
Chill\CustomFieldsBundle\Menu\:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
resource: '../../Menu/'
|
||||
tags: ['chill.menu_builder']
|
||||
|
@ -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
|
||||
|
@ -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(),
|
||||
]);
|
||||
}
|
||||
|
@ -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',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +0,0 @@
|
||||
{% extends '@ChillPerson/Admin/layout.html.twig' %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{% endblock %}
|
@ -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 %}
|
@ -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 %}
|
@ -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 %}
|
@ -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>
|
@ -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
|
@ -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(),
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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'];
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
@ -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 }}
|
||||
|
@ -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>
|
||||
|
@ -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) }}
|
||||
|
@ -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 %}
|
||||
|
||||
|
@ -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
|
@ -1,4 +1,6 @@
|
||||
services:
|
||||
Chill\DocStoreBundle\Menu\MenuBuilder:
|
||||
Chill\DocStoreBundle\Menu\:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
resource: '../../Menu/'
|
||||
tags: ['chill.menu_builder']
|
||||
|
@ -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
|
||||
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
<?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\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
|
||||
class AdminCountryCRUDController extends CRUDController
|
||||
{
|
||||
}
|
@ -36,7 +36,7 @@ class CenterController extends AbstractController
|
||||
$em->persist($center);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('admin_center_show', ['id' => $center->getId()]));
|
||||
return $this->redirect($this->generateUrl('admin_center'));
|
||||
}
|
||||
|
||||
return $this->render('@ChillMain/Center/new.html.twig', [
|
||||
|
26
src/Bundle/ChillMainBundle/Controller/CivilityController.php
Normal file
26
src/Bundle/ChillMainBundle/Controller/CivilityController.php
Normal 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\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class CivilityController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.order', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
26
src/Bundle/ChillMainBundle/Controller/CountryController.php
Normal file
26
src/Bundle/ChillMainBundle/Controller/CountryController.php
Normal 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\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class CountryController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.countryCode', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
26
src/Bundle/ChillMainBundle/Controller/LanguageController.php
Normal file
26
src/Bundle/ChillMainBundle/Controller/LanguageController.php
Normal 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\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class LanguageController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@ -36,7 +36,7 @@ class ScopeController extends AbstractController
|
||||
$em->persist($scope);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirect($this->generateUrl('admin_scope_show', ['id' => $scope->getId()]));
|
||||
return $this->redirect($this->generateUrl('admin_scope'));
|
||||
}
|
||||
|
||||
return $this->render('@ChillMain/Scope/new.html.twig', [
|
||||
|
@ -19,6 +19,8 @@ use Chill\MainBundle\Form\UserCurrentLocationType;
|
||||
use Chill\MainBundle\Form\UserPasswordType;
|
||||
use Chill\MainBundle\Form\UserType;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Chill\MainBundle\Repository\UserRepository;
|
||||
use Chill\MainBundle\Templating\Listing\FilterOrderHelper;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use RuntimeException;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
@ -39,14 +41,18 @@ class UserController extends CRUDController
|
||||
|
||||
private UserPasswordEncoderInterface $passwordEncoder;
|
||||
|
||||
private UserRepository $userRepository;
|
||||
|
||||
private ValidatorInterface $validator;
|
||||
|
||||
public function __construct(
|
||||
LoggerInterface $chillLogger,
|
||||
ValidatorInterface $validator,
|
||||
UserPasswordEncoderInterface $passwordEncoder
|
||||
UserPasswordEncoderInterface $passwordEncoder,
|
||||
UserRepository $userRepository
|
||||
) {
|
||||
$this->logger = $chillLogger;
|
||||
$this->userRepository = $userRepository;
|
||||
$this->validator = $validator;
|
||||
$this->passwordEncoder = $passwordEncoder;
|
||||
}
|
||||
@ -215,6 +221,27 @@ class UserController extends CRUDController
|
||||
]);
|
||||
}
|
||||
|
||||
protected function buildFilterOrderHelper(string $action, Request $request): ?FilterOrderHelper
|
||||
{
|
||||
return $this->getFilterOrderHelperFactory()
|
||||
->create(self::class)
|
||||
->addSearchBox(['label'])
|
||||
->build();
|
||||
}
|
||||
|
||||
protected function countEntities(string $action, Request $request, ?FilterOrderHelper $filterOrder = null): int
|
||||
{
|
||||
if (!$filterOrder instanceof FilterOrderHelper) {
|
||||
return parent::countEntities($action, $request, $filterOrder);
|
||||
}
|
||||
|
||||
if (null === $filterOrder->getQueryString()) {
|
||||
return parent::countEntities($action, $request, $filterOrder);
|
||||
}
|
||||
|
||||
return $this->userRepository->countByUsernameOrEmail($filterOrder->getQueryString());
|
||||
}
|
||||
|
||||
protected function createFormFor(string $action, $entity, ?string $formClass = null, array $formOptions = []): FormInterface
|
||||
{
|
||||
// for "new", add special config
|
||||
@ -250,6 +277,33 @@ class UserController extends CRUDController
|
||||
return parent::generateTemplateParameter($action, $entity, $request, $defaultTemplateParameters);
|
||||
}
|
||||
|
||||
protected function getQueryResult(
|
||||
string $action,
|
||||
Request $request,
|
||||
int $totalItems,
|
||||
PaginatorInterface $paginator,
|
||||
?FilterOrderHelper $filterOrder = null
|
||||
) {
|
||||
if (0 === $totalItems) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (!$filterOrder instanceof FilterOrderHelper) {
|
||||
return parent::getQueryResult($action, $request, $totalItems, $paginator, $filterOrder);
|
||||
}
|
||||
|
||||
if (null === $filterOrder->getQueryString()) {
|
||||
return parent::getQueryResult($action, $request, $totalItems, $paginator, $filterOrder);
|
||||
}
|
||||
|
||||
return $this->userRepository->findByUsernameOrEmail(
|
||||
$filterOrder->getQueryString(),
|
||||
['usernameCanonical' => 'ASC'],
|
||||
$paginator->getItemsPerPage(),
|
||||
$paginator->getCurrentPageFirstItemNumber()
|
||||
);
|
||||
}
|
||||
|
||||
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request)
|
||||
{
|
||||
// for "new", encode the password
|
||||
@ -264,7 +318,8 @@ class UserController extends CRUDController
|
||||
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.usernameCanonical', 'ASC');
|
||||
$query
|
||||
->addOrderBy('e.usernameCanonical', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
|
26
src/Bundle/ChillMainBundle/Controller/UserJobController.php
Normal file
26
src/Bundle/ChillMainBundle/Controller/UserJobController.php
Normal 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\MainBundle\Controller;
|
||||
|
||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class UserJobController extends CRUDController
|
||||
{
|
||||
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||
{
|
||||
$query->addOrderBy('e.id', 'ASC');
|
||||
|
||||
return parent::orderQuery($action, $query, $request, $paginator);
|
||||
}
|
||||
}
|
@ -13,9 +13,13 @@ namespace Chill\MainBundle\DependencyInjection;
|
||||
|
||||
use Chill\MainBundle\Controller\AddressApiController;
|
||||
use Chill\MainBundle\Controller\CivilityApiController;
|
||||
use Chill\MainBundle\Controller\CivilityController;
|
||||
use Chill\MainBundle\Controller\CountryController;
|
||||
use Chill\MainBundle\Controller\LanguageController;
|
||||
use Chill\MainBundle\Controller\LocationController;
|
||||
use Chill\MainBundle\Controller\LocationTypeController;
|
||||
use Chill\MainBundle\Controller\UserController;
|
||||
use Chill\MainBundle\Controller\UserJobController;
|
||||
use Chill\MainBundle\DependencyInjection\Widget\Factory\WidgetFactoryInterface;
|
||||
use Chill\MainBundle\Doctrine\DQL\GetJsonFieldByKey;
|
||||
use Chill\MainBundle\Doctrine\DQL\JsonAggregate;
|
||||
@ -30,10 +34,16 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent;
|
||||
use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator;
|
||||
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
|
||||
use Chill\MainBundle\Doctrine\Type\PointType;
|
||||
use Chill\MainBundle\Entity\Civility;
|
||||
use Chill\MainBundle\Entity\Country;
|
||||
use Chill\MainBundle\Entity\Language;
|
||||
use Chill\MainBundle\Entity\Location;
|
||||
use Chill\MainBundle\Entity\LocationType;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Entity\UserJob;
|
||||
use Chill\MainBundle\Form\CivilityType;
|
||||
use Chill\MainBundle\Form\CountryType;
|
||||
use Chill\MainBundle\Form\LanguageType;
|
||||
use Chill\MainBundle\Form\LocationFormType;
|
||||
use Chill\MainBundle\Form\LocationTypeType;
|
||||
use Chill\MainBundle\Form\UserJobType;
|
||||
@ -299,6 +309,7 @@ class ChillMainExtension extends Extension implements
|
||||
'cruds' => [
|
||||
[
|
||||
'class' => UserJob::class,
|
||||
'controller' => UserJobController::class,
|
||||
'name' => 'admin_user_job',
|
||||
'base_path' => '/admin/main/user-job',
|
||||
'base_role' => 'ROLE_ADMIN',
|
||||
@ -310,9 +321,11 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/UserJob/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/UserJob/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
@ -382,6 +395,72 @@ class ChillMainExtension extends Extension implements
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => Country::class,
|
||||
'name' => 'main_country',
|
||||
'base_path' => '/admin/main/country',
|
||||
'base_role' => 'ROLE_ADMIN',
|
||||
'form_class' => CountryType::class,
|
||||
'controller' => CountryController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Country/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Country/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Country/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => Civility::class,
|
||||
'name' => 'main_civility',
|
||||
'base_path' => '/admin/main/civility',
|
||||
'base_role' => 'ROLE_ADMIN',
|
||||
'form_class' => CivilityType::class,
|
||||
'controller' => CivilityController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Civility/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Civility/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Civility/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'class' => Language::class,
|
||||
'name' => 'main_language',
|
||||
'base_path' => '/admin/main/language',
|
||||
'base_role' => 'ROLE_ADMIN',
|
||||
'form_class' => LanguageType::class,
|
||||
'controller' => LanguageController::class,
|
||||
'actions' => [
|
||||
'index' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Language/index.html.twig',
|
||||
],
|
||||
'new' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Language/new.html.twig',
|
||||
],
|
||||
'edit' => [
|
||||
'role' => 'ROLE_ADMIN',
|
||||
'template' => '@ChillMain/Language/edit.html.twig',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'apis' => [
|
||||
[
|
||||
|
45
src/Bundle/ChillMainBundle/Form/CivilityType.php
Normal file
45
src/Bundle/ChillMainBundle/Form/CivilityType.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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\MainBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Entity\Civility;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CivilityType extends \Symfony\Component\Form\AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TranslatableStringFormType::class, [
|
||||
'required' => true,
|
||||
])
|
||||
->add('abbreviation', TranslatableStringFormType::class)
|
||||
->add('active', ChoiceType::class, [
|
||||
'choices' => [
|
||||
'Active' => true,
|
||||
'Inactive' => false,
|
||||
],
|
||||
])
|
||||
->add('order', IntegerType::class);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Civility::class,
|
||||
]);
|
||||
}
|
||||
}
|
41
src/Bundle/ChillMainBundle/Form/CountryType.php
Normal file
41
src/Bundle/ChillMainBundle/Form/CountryType.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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\MainBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Entity\Country;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CountryType extends \Symfony\Component\Form\AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('name', TranslatableStringFormType::class, [
|
||||
'label' => 'Name',
|
||||
'required' => true,
|
||||
])
|
||||
->add('countryCode', TextType::class, [
|
||||
'label' => 'Country code',
|
||||
'required' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Country::class,
|
||||
]);
|
||||
}
|
||||
}
|
41
src/Bundle/ChillMainBundle/Form/LanguageType.php
Normal file
41
src/Bundle/ChillMainBundle/Form/LanguageType.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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\MainBundle\Form;
|
||||
|
||||
use Chill\MainBundle\Entity\Language;
|
||||
use Chill\MainBundle\Form\Type\TranslatableStringFormType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class LanguageType extends \Symfony\Component\Form\AbstractType
|
||||
{
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
->add('id', TextType::class, [
|
||||
'label' => 'Id',
|
||||
'required' => true,
|
||||
])
|
||||
->add('name', TranslatableStringFormType::class, [
|
||||
'label' => 'Name',
|
||||
'required' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
'data_class' => Language::class,
|
||||
]);
|
||||
}
|
||||
}
|
@ -83,10 +83,24 @@ final class UserRepository implements ObjectRepository
|
||||
return $this->findBy(['enabled' => true], $orderBy, $limit, $offset);
|
||||
}
|
||||
|
||||
public function findByUsernameOrEmail(string $pattern)
|
||||
public function findByUsernameOrEmail(string $pattern, ?array $orderBy = [], ?int $limit = null, ?int $offset = null): array
|
||||
{
|
||||
$qb = $this->queryByUsernameOrEmail($pattern);
|
||||
|
||||
$qb->select('u');
|
||||
|
||||
if (null !== $limit) {
|
||||
$qb->setMaxResults($limit);
|
||||
}
|
||||
|
||||
if (null !== $offset) {
|
||||
$qb->setFirstResult($offset);
|
||||
}
|
||||
|
||||
foreach ($orderBy as $field => $order) {
|
||||
$qb->addOrderBy('u.' . $field, $order);
|
||||
}
|
||||
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
@ -164,13 +178,13 @@ final class UserRepository implements ObjectRepository
|
||||
|
||||
private function queryByUsernameOrEmail(string $pattern): QueryBuilder
|
||||
{
|
||||
$qb = $this->entityManager->createQueryBuilder('u');
|
||||
$qb = $this->entityManager->createQueryBuilder()->from(User::class, 'u');
|
||||
|
||||
$searchByPattern = $qb->expr()->orX();
|
||||
|
||||
$searchByPattern
|
||||
->add($qb->expr()->eq('u.usernameCanonical', 'LOWER(UNACCENT(:pattern))'))
|
||||
->add($qb->expr()->eq('u.emailCanonical', 'LOWER(UNACCENT(:pattern))'));
|
||||
->add($qb->expr()->like('u.usernameCanonical', 'CONCAT(\'%\', LOWER(UNACCENT(:pattern)), \'%\')'))
|
||||
->add($qb->expr()->like('u.emailCanonical', 'CONCAT(\'%\', LOWER(UNACCENT(:pattern)), \'%\')'));
|
||||
|
||||
$qb
|
||||
->where($searchByPattern)
|
||||
|
@ -187,6 +187,10 @@ div.vertical-menu {
|
||||
background-color: tint-color($chill-yellow, 20%)
|
||||
}
|
||||
}
|
||||
a.list-group-item-header {
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
footer.footer {
|
||||
@ -210,6 +214,20 @@ footer.footer {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* ADMIN STYLES
|
||||
*/
|
||||
|
||||
div.admin {
|
||||
flex-direction: row-reverse;
|
||||
div.vertical-menu {
|
||||
font-size: 0.9em;
|
||||
.list-group-item {
|
||||
padding: 0.3rem 0.7rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* GENERIC MAIN STYLES
|
||||
* miscellaneous
|
||||
@ -217,7 +235,7 @@ footer.footer {
|
||||
|
||||
/// titles
|
||||
h1, h2,
|
||||
.h1, .h2 {
|
||||
.h1, .h2 {
|
||||
font-weight: $headings-font-weight + 100;
|
||||
}
|
||||
|
||||
|
@ -1,8 +0,0 @@
|
||||
{% extends '@ChillMain/Admin/layout_permissions.html.twig' %}
|
||||
|
||||
{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% embed '@ChillMain/CRUD/_index.html.twig' %}
|
||||
{% endembed %}
|
||||
{% endblock content %}
|
@ -1,15 +1,8 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{% endblock %}
|
||||
|
||||
{% block admin_content %}
|
||||
<h1>{{ 'Administration interface'|trans }}</h1>
|
||||
|
||||
<p>{{ 'Welcome to the admin section !'|trans }}</p>
|
||||
|
||||
{{ chill_menu('admin_index', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_index.html.twig'
|
||||
}) }}
|
||||
|
||||
{% endblock %}
|
||||
|
@ -0,0 +1,13 @@
|
||||
{% extends "@ChillMain/Admin/layoutWithVerticalMenu.html.twig" %}
|
||||
|
||||
{% block vertical_menu_content %}
|
||||
{{ chill_menu('admin_language', {
|
||||
'layout': '@ChillMain/Admin/menu_admin_section.html.twig',
|
||||
}) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block layout_wvm_content %}
|
||||
{% block admin_content %}<!-- block content empty -->
|
||||
<h1>{{ 'Language configuration' |trans }}</h1>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user