diff --git a/.gitignore b/.gitignore index 38d06d315..ebdc16e56 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ composer composer.phar composer.lock docs/build/ +node_modules/* .php_cs.cache ###> symfony/framework-bundle ### diff --git a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php index 5634358c7..c55d579e4 100644 --- a/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php +++ b/src/Bundle/ChillActivityBundle/Export/Filter/PersonFilters/ActivityReasonFilter.php @@ -50,7 +50,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt { $where = $qb->getDQLPart('where'); $join = $qb->getDQLPart('join'); - $clause = $qb->expr()->in('reasons', ':selected_activity_reasons'); + $clause = $qb->expr()->in('actreasons', ':selected_activity_reasons'); if (!in_array('actreasons', $qb->getAllAliases(), true)) { $qb->join('activity.reasons', 'actreasons'); @@ -77,6 +77,7 @@ class ActivityReasonFilter implements ExportElementValidatedInterface, FilterInt 'class' => ActivityReason::class, 'choice_label' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getName()), 'group_by' => fn (ActivityReason $reason) => $this->translatableStringHelper->localize($reason->getCategory()->getName()), + 'attr' => ['class' => 'select2 '], 'multiple' => true, 'expanded' => false, ]); diff --git a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php index 5e10c9a14..71a9e3c2a 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AdminMenuBuilder.php @@ -36,7 +36,6 @@ final class AdminMenuBuilder implements LocalMenuBuilderInterface ->setAttribute('class', 'list-group-item-header') ->setExtras([ 'order' => 5000, - 'icons' => ['exchange'], ]); $menu->addChild('Activity Reasons', [ diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig index 49e71bfad..53bd3e8a7 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig @@ -156,7 +156,7 @@
- {{ entity.privateComment.comments[userId] }} + {{ entity.privateComment.comments[userId]|chill_markdown_to_html }}
@@ -172,7 +172,7 @@ {% endfor %} {% else %} - {{ 'Any document found'|trans }} + {{ 'No document found'|trans }} {% endif %} {% endif %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php index 5c438bd0a..c02e53c23 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/AsideActivityFormType.php @@ -12,8 +12,7 @@ declare(strict_types=1); namespace Chill\AsideActivityBundle\Form; use Chill\AsideActivityBundle\Entity\AsideActivity; -use Chill\AsideActivityBundle\Entity\AsideActivityCategory; -use Chill\AsideActivityBundle\Templating\Entity\CategoryRender; +use Chill\AsideActivityBundle\Form\Type\PickAsideActivityCategoryType; use Chill\MainBundle\Form\Type\ChillDateType; use Chill\MainBundle\Form\Type\ChillTextareaType; use Chill\MainBundle\Form\Type\PickUserDynamicType; @@ -21,8 +20,6 @@ use DateInterval; use DateTime; use DateTimeImmutable; use DateTimeZone; -use Doctrine\ORM\EntityRepository; -use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer; @@ -37,20 +34,16 @@ use function in_array; final class AsideActivityFormType extends AbstractType { - private CategoryRender $categoryRender; - private TokenStorageInterface $storage; private array $timeChoices; public function __construct( ParameterBagInterface $parameterBag, - TokenStorageInterface $storage, - CategoryRender $categoryRender + TokenStorageInterface $storage ) { $this->timeChoices = $parameterBag->get('chill_aside_activity.form.time_duration'); $this->storage = $storage; - $this->categoryRender = $categoryRender; } public function buildForm(FormBuilderInterface $builder, array $options) @@ -81,28 +74,10 @@ final class AsideActivityFormType extends AbstractType 'required' => true, ] ) - ->add( - 'type', - EntityType::class, - [ - 'label' => 'Type', - 'required' => true, - 'class' => AsideActivityCategory::class, - 'placeholder' => 'Choose the activity category', - 'query_builder' => static function (EntityRepository $er) { - $qb = $er->createQueryBuilder('ac'); - $qb->where($qb->expr()->eq('ac.isActive', 'TRUE')) - ->addOrderBy('ac.ordering', 'ASC'); - - return $qb; - }, - 'choice_label' => function (AsideActivityCategory $asideActivityCategory) { - $options = []; - - return $this->categoryRender->renderString($asideActivityCategory, $options); - }, - ] - ) + ->add('type', PickAsideActivityCategoryType::class, [ + 'label' => 'Type', + 'required' => true, + ]) ->add('duration', ChoiceType::class, $durationTimeOptions) ->add('note', ChillTextareaType::class, [ 'label' => 'Note', diff --git a/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php new file mode 100644 index 000000000..3ee392517 --- /dev/null +++ b/src/Bundle/ChillAsideActivityBundle/src/Form/Type/PickAsideActivityCategoryType.php @@ -0,0 +1,57 @@ +categoryRender = $categoryRender; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'class' => AsideActivityCategory::class, + 'placeholder' => 'Choose the activity category', + 'query_builder' => static function (EntityRepository $er) { + $qb = $er->createQueryBuilder('ac'); + $qb->where($qb->expr()->eq('ac.isActive', 'TRUE')) + ->addOrderBy('ac.ordering', 'ASC'); + + return $qb; + }, + 'choice_label' => function (AsideActivityCategory $asideActivityCategory) { + $options = []; + + return $this->categoryRender->renderString($asideActivityCategory, $options); + }, + 'attr' => ['class' => 'select2'], + ]); + } + + public function getParent(): string + { + return EntityType::class; + } +} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig index 2f30b14cf..79c2e6919 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/_delete.html.twig @@ -1,4 +1,4 @@ -
+ {% block crud_content_header %}

{{ ('crud.'~crud_name~'.title_delete')|trans({ '%as_string%': 'Aside Activity' }) }}

{% endblock crud_content_header %} @@ -27,4 +27,4 @@ {{ form_end(form) }} -
+ diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig index 4dd12e042..5ffc73684 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/index.html.twig @@ -87,5 +87,5 @@ {% endif %} - + {% endblock %} diff --git a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig index 09acf9859..99ff217b1 100644 --- a/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig +++ b/src/Bundle/ChillAsideActivityBundle/src/Resources/views/asideActivity/new.html.twig @@ -1,4 +1,4 @@ -{% extends '@ChillMain/Admin/layout.html.twig' %} +{% extends '@ChillMain/layout.html.twig' %} {% block js %} {{ parent() }} @@ -14,7 +14,7 @@ {% include('@ChillMain/CRUD/_new_title.html.twig') %} {% endblock %} -{% block admin_content %} +{% block content %} {% embed '@ChillMain/CRUD/_new_content.html.twig' %} {% block content_form_actions_save_and_show %}{% endblock %} {% endembed %} diff --git a/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php index ad00609e2..1658029a7 100644 --- a/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillCalendarBundle/Menu/AdminMenuBuilder.php @@ -39,7 +39,6 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ->setAttribute('class', 'list-group-item-header') ->setExtras([ 'order' => 6000, - 'icons' => ['calendar'], ]); $menu->addChild('Cancel reason', [ diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html index a568ec009..499fb0a83 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html +++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html @@ -3,7 +3,7 @@ {% import "@ChillDocStore/Macro/macro.html.twig" as m %} {% import "@ChillDocStore/Macro/macro_mimeicon.html.twig" as mm %} -
+
diff --git a/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php index 7ac745b12..db63ad6ac 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillCustomFieldsBundle/Menu/AdminMenuBuilder.php @@ -39,7 +39,6 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ->setAttribute('class', 'list-group-item-header') ->setExtras([ 'order' => 4500, - 'icons' => ['plus'], ]); $menu->addChild('Custom fields group', [ diff --git a/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php index 6848ed65a..466c3bace 100644 --- a/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillDocStoreBundle/Menu/AdminMenuBuilder.php @@ -39,7 +39,6 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface ->setAttribute('class', 'list-group-item-header') ->setExtras([ 'order' => 4000, - 'icons' => ['file-pdf-o'], ]); $menu->addChild('Document category list', [ diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig index 299183cca..f914bd7f5 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/AccompanyingCourseDocument/_workflow.html.twig @@ -6,7 +6,7 @@ {{ 'workflow.Document deleted'|trans }} {% else %} -
+
@@ -22,7 +22,6 @@ {{ document.description }} {% endif %} -
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig index 886544b1e..0e739d94b 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro.html.twig @@ -13,3 +13,19 @@ {{ 'Download'|trans }} {% endif %} {% endmacro %} + +{% macro download_button_small(storedObject, filename = null) %} + {% if storedObject is null %} + + {% else %} + + {{ 'Download'|trans }} + {% endif %} +{% endmacro %} \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig index a9bc07e2f..7079a0d94 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig +++ b/src/Bundle/ChillDocStoreBundle/Resources/views/Macro/macro_mimeicon.html.twig @@ -48,8 +48,8 @@ {% endif %} {% endfor %} - + {% endmacro %} \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml index 400e37236..4fbad1546 100644 --- a/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillDocStoreBundle/translations/messages.fr.yml @@ -14,7 +14,7 @@ Edit attributes: Modifier les propriétés du document Existing document: Document existant No document to download: Aucun document à télécharger 'Choose a document category': Choisissez une catégorie de document -Any document found: Aucun document trouvé +No document found: Aucun document trouvé The document is successfully registered: Le document est enregistré The document is successfully updated: Le document est mis à jour Any description: Aucune description diff --git a/src/Bundle/ChillMainBundle/Controller/ScopeApiController.php b/src/Bundle/ChillMainBundle/Controller/ScopeApiController.php new file mode 100644 index 000000000..85041f0f3 --- /dev/null +++ b/src/Bundle/ChillMainBundle/Controller/ScopeApiController.php @@ -0,0 +1,25 @@ +andWhere($query->expr()->eq('e.active', "'TRUE'")); + } + } +} diff --git a/src/Bundle/ChillMainBundle/Controller/UserApiController.php b/src/Bundle/ChillMainBundle/Controller/UserApiController.php index b29fe7c8e..da873e118 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserApiController.php @@ -12,6 +12,7 @@ declare(strict_types=1); namespace Chill\MainBundle\Controller; use Chill\MainBundle\CRUD\Controller\ApiController; +use Chill\MainBundle\Pagination\PaginatorInterface; use Doctrine\ORM\QueryBuilder; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; @@ -70,4 +71,13 @@ class UserApiController extends ApiController $query->andWhere($query->expr()->eq('e.enabled', "'TRUE'")); } } + + /** + * @param mixed $query + * @param mixed $_format + */ + protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator, $_format) + { + return $query->orderBy('e.label', 'ASC'); + } } diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php index 23a4bee89..69546016a 100644 --- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php +++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php @@ -655,6 +655,7 @@ class ChillMainExtension extends Extension implements ], [ 'class' => \Chill\MainBundle\Entity\Scope::class, + 'controller' => \Chill\MainBundle\Controller\ScopeApiController::class, 'name' => 'scope', 'base_path' => '/api/1.0/main/scope', 'base_role' => 'ROLE_USER', diff --git a/src/Bundle/ChillMainBundle/Form/ScopeType.php b/src/Bundle/ChillMainBundle/Form/ScopeType.php index 691328500..86335c554 100644 --- a/src/Bundle/ChillMainBundle/Form/ScopeType.php +++ b/src/Bundle/ChillMainBundle/Form/ScopeType.php @@ -13,6 +13,7 @@ namespace Chill\MainBundle\Form; use Chill\MainBundle\Form\Type\TranslatableStringFormType; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; @@ -21,7 +22,12 @@ class ScopeType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name', TranslatableStringFormType::class); + ->add('name', TranslatableStringFormType::class) + ->add('active', ChoiceType::class, [ + 'choices' => [ + 'Active' => true, + 'Inactive' => false, + ], ]); } /** diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss index aa1d24844..3c9fc8601 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/chillmain.scss @@ -221,12 +221,8 @@ footer.footer { */ div.admin { - flex-direction: row-reverse; div.vertical-menu { - font-size: 0.9em; - .list-group-item { - padding: 0.3rem 0.7rem; - } + .list-group-item {} } } @@ -307,12 +303,12 @@ table.table-bordered { /// meta-data div.createdBy, div.updatedBy, -div.metadata { +.metadata { span.user, span.date { text-decoration: underline dotted; } } -div.metadata { +.metadata { font-size: smaller; color: $gray-600; span.user, span.date { @@ -368,6 +364,19 @@ div#flashMessages { } } +/// unbullet lists +ul.unbullet { + list-style-type: none; + padding-left: 0; +} +/// libellé +span.dt { + font-size: 90%; + font-weight: bolder; + background-color: var(--bs-chill-light-gray); +} + + /* * SPECIFIC RULES */ diff --git a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss index 4d0bfcf8e..19da5aed3 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss +++ b/src/Bundle/ChillMainBundle/Resources/public/chill/scss/render_box.scss @@ -106,18 +106,5 @@ section.chill-entity { // used for comment-embeddable &.entity-comment-embeddable { width: 100%; - - /* already defined !! - div.metadata { - font-size: smaller; - color: $gray-600; - span.user, span.date { - text-decoration: underline dotted; - &:hover { - color: $gray-700; - } - } - } - */ } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue index 30a240938..21ab5e3d0 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue @@ -48,33 +48,35 @@ -
- - - - - - -
+ @@ -118,40 +120,42 @@ -
- - - - - - -
+ @@ -192,32 +196,34 @@ -
- - - - diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue index 2c8e17687..f1cac5254 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress/AddressSelection.vue @@ -98,6 +98,11 @@ export default { } }, }, + mounted() { + if (typeof this.value.point !== 'undefined') { + this.updateMapCenter(this.value.point); + } + }, methods: { transName(value) { return value.streetNumber === undefined ? value.street : `${value.streetNumber}, ${value.street}` diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue index 4ab117395..c0e42a7b1 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/EditPane.vue @@ -187,6 +187,7 @@ div.address-form { div#address_map { height: 400px; width: 100%; + z-index: 1; } } diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue index bc246d542..5048815e2 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/ShowPane.vue @@ -1,6 +1,6 @@