diff --git a/src/Bundle/ChillMainBundle/Controller/UserController.php b/src/Bundle/ChillMainBundle/Controller/UserController.php index 61895eaa9..127519013 100644 --- a/src/Bundle/ChillMainBundle/Controller/UserController.php +++ b/src/Bundle/ChillMainBundle/Controller/UserController.php @@ -19,8 +19,11 @@ use Chill\MainBundle\Form\UserCurrentLocationType; use Chill\MainBundle\Form\UserPasswordType; use Chill\MainBundle\Form\UserType; use Chill\MainBundle\Pagination\PaginatorInterface; +use Chill\MainBundle\Templating\Listing\FilterOrderHelper; +use Chill\MainBundle\Templating\Listing\FilterOrderHelperFactoryInterface; use Psr\Log\LoggerInterface; use RuntimeException; +use LogicException; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Form; use Symfony\Component\Form\FormInterface; @@ -41,14 +44,57 @@ class UserController extends CRUDController private ValidatorInterface $validator; + private FilterOrderHelperFactoryInterface $filterOrderHelperFactory; + public function __construct( LoggerInterface $chillLogger, ValidatorInterface $validator, - UserPasswordEncoderInterface $passwordEncoder + UserPasswordEncoderInterface $passwordEncoder, + FilterOrderHelperFactoryInterface $filterOrderHelperFactory ) { $this->logger = $chillLogger; $this->validator = $validator; $this->passwordEncoder = $passwordEncoder; + $this->filterOrderHelperFactory = $filterOrderHelperFactory; + } + + + // public function index(Request $request) + // { + // dump($request); + + // //$filterOrder = $this->buildFilterOrderHelper('index', $request); + // return parent::indexEntityAction('index', $request); + // } + + // protected function buildFilterOrderHelper($action, $request): FilterOrderHelper + // { + // $filter_order = $this->filterOrderHelperFactory + // ->create(self::class) + // ->addSearchBox(['name']) + // ->build(); + // dump($filter_order); + // return $filter_order; + // } + + 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 (null === $filterOrder) { + throw new LogicException('filterOrder should not be null'); + } + dump($filterOrder); + $count = parent::countEntities($action, $request, $filterOrder); + + dump($count); + return $count; } /** diff --git a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig index 46fb7aa29..bab54d56e 100644 --- a/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig +++ b/src/Bundle/ChillMainBundle/Resources/views/User/index.html.twig @@ -3,6 +3,9 @@ {% block admin_content %}

{{"Users"|trans}}

+ + {{ filter_order|chill_render_filter_order_helper }} + {% for entity in entities %}
diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php index 950715a2b..faf37b92c 100644 --- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php +++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php @@ -286,7 +286,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillPerson/SocialWork/edit.html.twig', + 'template' => '@ChillPerson/SocialWork/SocialIssue/edit.html.twig', ], ], ], @@ -307,7 +307,7 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac ], 'edit' => [ 'role' => 'ROLE_ADMIN', - 'template' => '@ChillPerson/SocialWork/edit.html.twig', + 'template' => '@ChillPerson/SocialWork/SocialAction/edit.html.twig', ], ], ], diff --git a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig index 0adc82788..556065e42 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/SocialWork/Evaluation/index.html.twig @@ -5,6 +5,8 @@ {% block table_entities_thead_tr %} {{ 'Id'|trans }} {{ 'Title'|trans }} + {{ 'evaluation.delay'|trans }} + {{ 'evaluation.notificationDelay'|trans }}   {% endblock %} @@ -13,6 +15,32 @@ {{ entity.id }} {{ entity.title|localize_translatable_string }} + + {% if entity.delay is not null %} + {% if entity.delay.d > 0 %} + {{ entity.delay.d }} {{'days'|trans}} + {% endif %} + {% if entity.delay.m > 0 %} + {{ entity.delay.m }} {{'months'|trans}} + {% endif %} + {% if entity.delay.y > 0 %} + {{ entity.delay.y }} {{'years'|trans}} + {% endif %} + {% endif %} + + + {% if entity.notificationDelay is not null %} + {% if entity.notificationDelay.d > 0 %} + {{ entity.notificationDelay.d }} {{'days'|trans}} + {% endif %} + {% if entity.notificationDelay.m > 0 %} + {{ entity.notificationDelay.m }} {{'months'|trans}} + {% endif %} + {% if entity.notificationDelay.y > 0 %} + {{ entity.notificationDelay.y }} {{'years'|trans}} + {% endif %} + {% endif %} +