diff --git a/app/AdminModule/components/UsersGridControl.php b/app/AdminModule/components/UsersGridControl.php index 0896652f9..8daa92fbf 100644 --- a/app/AdminModule/components/UsersGridControl.php +++ b/app/AdminModule/components/UsersGridControl.php @@ -267,7 +267,7 @@ public function createComponentUsersGrid($name) ->setTranslateOptions(); $grid->addColumnText('unit', 'admin.users.users_membership') - ->setRendererOnCondition(function ($row) { + ->setRendererOnCondition(function (User $row) { return Html::el('span') ->style('color: red') ->setText($this->userService->getMembershipText($row)); @@ -279,11 +279,20 @@ public function createComponentUsersGrid($name) $grid->addColumnNumber('age', 'admin.users.users_age') ->setSortable() - ->setSortableCallback(function (QueryBuilder $qb, $sort) { + ->setSortableCallback(function (QueryBuilder $qb, array $sort) { $sort = $sort['age'] == 'DESC' ? 'ASC' : 'DESC'; $qb->orderBy('u.birthdate', $sort); }); + $grid->addColumnText('email', 'admin.users.users_email') + ->setRenderer(function (User $row) { + return Html::el('a') + ->href('mailto:' . $row->getEmail()) + ->setText($row->getEmail()); + }) + ->setSortable() + ->setFilterText(); + $grid->addColumnText('city', 'admin.users.users_city') ->setSortable() ->setFilterText(); diff --git a/app/AdminModule/presenters/templates/Users/detail.latte b/app/AdminModule/presenters/templates/Users/detail.latte index 1e06523ff..cc2419d07 100644 --- a/app/AdminModule/presenters/templates/Users/detail.latte +++ b/app/AdminModule/presenters/templates/Users/detail.latte @@ -52,11 +52,6 @@ {/if} - - {_admin.users.users_email} - {$detailUser->getEmail()} - - {_admin.users.users_birthdate} {$detailUser->getBirthdate()|date:'j. n. Y'} @@ -67,6 +62,11 @@ {$detailUser->getAge()} + + {_admin.users.users_email} + {$detailUser->getEmail()} + + {_admin.users.users_address} {$detailUser->getAddress()} diff --git a/app/WebModule/forms/ApplicationForm.php b/app/WebModule/forms/ApplicationForm.php index 1ba5d0b12..7bad9beb4 100644 --- a/app/WebModule/forms/ApplicationForm.php +++ b/app/WebModule/forms/ApplicationForm.php @@ -187,6 +187,10 @@ public function create($id) $inputBirthdate->setDisabled(); } + $form->addText('email', 'web.application_content.email') + ->addRule(Form::FILLED) + ->setDisabled(); + $form->addText('street', 'web.application_content.street') ->addRule(Form::FILLED, 'web.application_content.street_empty') ->addRule(Form::PATTERN, 'web.application_content.street_format', '^(.*[^0-9]+) (([1-9][0-9]*)/)?([1-9][0-9]*[a-cA-C]?)$'); @@ -221,6 +225,7 @@ public function create($id) 'lastName' => $this->user->getLastName(), 'nickName' => $this->user->getNickName(), 'birthdate' => $this->user->getBirthdate(), + 'email' => $this->user->getEmail(), 'street' => $this->user->getStreet(), 'city' => $this->user->getCity(), 'postcode' => $this->user->getPostcode(), diff --git a/app/WebModule/forms/PersonalDetailsForm.php b/app/WebModule/forms/PersonalDetailsForm.php index 91b7b982a..84da59043 100644 --- a/app/WebModule/forms/PersonalDetailsForm.php +++ b/app/WebModule/forms/PersonalDetailsForm.php @@ -87,6 +87,10 @@ public function create($id) $inputBirthdate->setDisabled(); } + $form->addText('email', 'web.application_content.email') + ->addRule(Form::FILLED) + ->setDisabled(); + $form->addText('street', 'web.profile.street') ->addRule(Form::FILLED, 'web.profile.street_empty') ->addRule(Form::PATTERN, 'web.profile.street_format', '^(.*[^0-9]+) (([1-9][0-9]*)/)?([1-9][0-9]*[a-cA-C]?)$'); @@ -109,6 +113,7 @@ public function create($id) 'firstName' => $this->user->getFirstName(), 'lastName' => $this->user->getLastName(), 'nickName' => $this->user->getNickName(), + 'email' => $this->user->getEmail(), 'birthdate' => $this->user->getBirthdate(), 'street' => $this->user->getStreet(), 'city' => $this->user->getCity(), diff --git a/app/lang/web.cs_CZ.neon b/app/lang/web.cs_CZ.neon index 9fa44cc06..d1f090887 100644 --- a/app/lang/web.cs_CZ.neon +++ b/app/lang/web.cs_CZ.neon @@ -73,6 +73,7 @@ profile: lastname: "Příjmení" lastname_empty: "Zadejte příjmení." nickname: "Přezdívka" + email: "E-mail" birthdate: "Datum narození" birthdate_empty: "Zadejte datum narození." street: "Ulice" @@ -130,6 +131,7 @@ application_content: lastname: "Příjmení" lastname_empty: "Zadejte příjmení." nickname: "Přezdívka" + email: "E-mail" birthdate: "Datum narození" birthdate_empty: "Zadejte datum narození." street: "Ulice" diff --git a/app/services/ExcelExportService.php b/app/services/ExcelExportService.php index a5da467b8..9fb2bd291 100644 --- a/app/services/ExcelExportService.php +++ b/app/services/ExcelExportService.php @@ -314,6 +314,11 @@ public function exportUsersList($users, $filename) $sheet->getColumnDimensionByColumn($column)->setAutoSize(FALSE); $sheet->getColumnDimensionByColumn($column++)->setWidth('10'); + $sheet->setCellValueByColumnAndRow($column, $row, $this->translator->translate('common.export.user.email')); + $sheet->getStyleByColumnAndRow($column, $row)->getFont()->setBold(TRUE); + $sheet->getColumnDimensionByColumn($column)->setAutoSize(FALSE); + $sheet->getColumnDimensionByColumn($column++)->setWidth('30'); + $sheet->setCellValueByColumnAndRow($column, $row, $this->translator->translate('common.export.user.city')); $sheet->getStyleByColumnAndRow($column, $row)->getFont()->setBold(TRUE); $sheet->getColumnDimensionByColumn($column)->setAutoSize(FALSE); @@ -413,6 +418,8 @@ public function exportUsersList($users, $filename) $sheet->setCellValueByColumnAndRow($column++, $row, $user->getAge()); + $sheet->setCellValueByColumnAndRow($column++, $row, $user->getEmail()); + $sheet->setCellValueByColumnAndRow($column++, $row, $user->getCity()); $sheet->setCellValueByColumnAndRow($column++, $row, $user->getFee()); diff --git a/app/services/SkautIsEventEducationService.php b/app/services/SkautIsEventEducationService.php index 83d4331c1..ef02a4474 100644 --- a/app/services/SkautIsEventEducationService.php +++ b/app/services/SkautIsEventEducationService.php @@ -109,10 +109,10 @@ protected function getDraftEvents() return $this->skautIs->event->EventEducationAllMyActions([ 'ID_Login' => $this->skautIs->getUser()->getLoginId() ]); -// return $this->skautIs->event->EventEducationAllMyActions([ -// 'ID_Login' => $this->skautIs->getUser()->getLoginId(), -// 'ID_EventEducationState' => 'draft' -// ]); + // return $this->skautIs->event->EventEducationAllMyActions([ + // 'ID_Login' => $this->skautIs->getUser()->getLoginId(), + // 'ID_EventEducationState' => 'draft' + // ]); } /**