diff --git a/src/Bundle/ChillPersonBundle/Controller/AdminClosingMotiveController.php b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php similarity index 93% rename from src/Bundle/ChillPersonBundle/Controller/AdminClosingMotiveController.php rename to src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php index 9eee2c4a0..cf1436b99 100644 --- a/src/Bundle/ChillPersonBundle/Controller/AdminClosingMotiveController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ClosingMotiveController.php @@ -16,10 +16,10 @@ use Chill\MainBundle\Pagination\PaginatorInterface; use Symfony\Component\HttpFoundation\Request; /** - * Class AdminClosingMotiveController + * Class ClosingMotiveController * Controller for closing motives. */ -class AdminClosingMotiveController extends CRUDController +class ClosingMotiveController extends CRUDController { /** * @param \Chill\MainBundle\CRUD\Controller\string|string $action diff --git a/src/Bundle/ChillPersonBundle/Controller/OriginController.php b/src/Bundle/ChillPersonBundle/Controller/OriginController.php new file mode 100644 index 000000000..b7caae3be --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Controller/OriginController.php @@ -0,0 +1,26 @@ +addOrderBy('e.id', 'ASC'); + + return parent::orderQuery($action, $query, $request, $paginator); + } +} diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 8dad7e6ff..b29d79e8e 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -146,13 +146,13 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac [ 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive::class, 'name' => 'closing_motive', - 'base_path' => '/admin/closing-motive', + 'base_path' => '/admin/person/closing-motive', 'form_class' => \Chill\PersonBundle\Form\ClosingMotiveType::class, - 'controller' => \Chill\PersonBundle\Controller\AdminClosingMotiveController::class, + 'controller' => \Chill\PersonBundle\Controller\ClosingMotiveController::class, 'actions' => [ 'index' => [ - 'template' => '@ChillPerson/ClosingMotive/index.html.twig', 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/ClosingMotive/index.html.twig', ], 'new' => [ 'role' => 'ROLE_ADMIN', @@ -164,6 +164,27 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], ], ], + [ + 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class, + 'name' => 'origin', + 'base_path' => '/admin/person/origin', + 'form_class' => \Chill\PersonBundle\Form\OriginType::class, + 'controller' => \Chill\PersonBundle\Controller\OriginController::class, + 'actions' => [ + 'index' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/index.html.twig', + ], + 'new' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/new.html.twig', + ], + 'edit' => [ + 'role' => 'ROLE_ADMIN', + 'template' => '@ChillPerson/Origin/edit.html.twig', + ], + ], + ], [ 'class' => \Chill\PersonBundle\Entity\MaritalStatus::class, 'name' => 'person_marital-status', diff --git a/src/Bundle/ChillPersonBundle/Form/OriginType.php b/src/Bundle/ChillPersonBundle/Form/OriginType.php new file mode 100644 index 000000000..a9897de25 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/Form/OriginType.php @@ -0,0 +1,39 @@ +add('label', TranslatableStringFormType::class) + ->add('noActiveAfter', ChillDateType::class, [ + 'required' => false, + 'input' => 'datetime_immutable', + 'label' => 'origin.noActiveAfter' + ]); + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefault('class', Origin::class); + } +} diff --git a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php index 9aa1ae749..1e563df86 100644 --- a/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php +++ b/src/Bundle/ChillPersonBundle/Menu/AdminMenuBuilder.php @@ -45,29 +45,42 @@ class AdminMenuBuilder implements LocalMenuBuilderInterface 'route' => 'chill_crud_person_marital-status_index', ])->setExtras(['order' => 2020]); + + $menu->addChild('person_admin.accompanying_period') + ->setAttribute('class', 'list-group-item-header') + ->setExtras(['order' => 2100, 'header' => true]); + + $menu->addChild('person_admin.closing motives', [ + 'route' => 'chill_crud_closing_motive_index', + ])->setExtras(['order' => 2110]); + + $menu->addChild('person_admin.origin', [ + 'route' => 'chill_crud_origin_index', + ])->setExtras(['order' => 2110]); + $menu->addChild('person_admin.social_work') ->setAttribute('class', 'list-group-item-header') - ->setExtras(['order' => 3000, 'header' => true]); + ->setExtras(['order' => 2200, 'header' => true]); $menu->addChild('person_admin.social_action', [ 'route' => 'chill_crud_social_action_index', - ])->setExtras(['order' => 3001]); + ])->setExtras(['order' => 2201]); $menu->addChild('person_admin.social_issue', [ 'route' => 'chill_crud_social_issue_index', - ])->setExtras(['order' => 3002]); + ])->setExtras(['order' => 2202]); $menu->addChild('person_admin.social_goal', [ 'route' => 'chill_crud_social_goal_index', - ])->setExtras(['order' => 3010]); + ])->setExtras(['order' => 2210]); $menu->addChild('person_admin.social_evaluation', [ 'route' => 'chill_crud_social_evaluation_index', - ])->setExtras(['order' => 3020]); + ])->setExtras(['order' => 2220]); $menu->addChild('person_admin.social_result', [ 'route' => 'chill_crud_social_result_index', - ])->setExtras(['order' => 3030]); + ])->setExtras(['order' => 2230]); } public static function getMenuIds(): array diff --git a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig index d132847f2..28678bf6d 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/edit.html.twig @@ -1,12 +1,11 @@ -{% extends '@ChillPerson/Admin/layout.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 %} -{% endblock %} \ No newline at end of file +{% block admin_content %} + {% embed '@ChillMain/CRUD/_edit_content.html.twig' %} + {% block content_form_actions_save_and_show %}{% endblock %} + {% endembed %} +{% endblock admin_content %} \ No newline at end of file diff --git a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig index bdddd6782..6d37a8732 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/ClosingMotive/index.html.twig @@ -1,6 +1,6 @@ -{% extends '@ChillPerson/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 %}