Skip to content

Commit

Permalink
Merge pull request #535 from jan-stanek/zobrazeni-email
Browse files Browse the repository at this point in the history
Zobrazeni e-mailu v prihlasce a prehledu
  • Loading branch information
Jan Staněk authored Jun 16, 2018
2 parents c5a0da7 + f727597 commit 71633b0
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 11 deletions.
13 changes: 11 additions & 2 deletions app/AdminModule/components/UsersGridControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions app/AdminModule/presenters/templates/Users/detail.latte
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@
</tr>
{/if}

<tr>
<th>{_admin.users.users_email}</th>
<td><a href="mailto:{$detailUser->getEmail()}">{$detailUser->getEmail()}</a></td>
</tr>

<tr>
<th>{_admin.users.users_birthdate}</th>
<td>{$detailUser->getBirthdate()|date:'j. n. Y'}</td>
Expand All @@ -67,6 +62,11 @@
<td>{$detailUser->getAge()}</td>
</tr>

<tr>
<th>{_admin.users.users_email}</th>
<td><a href="mailto:{$detailUser->getEmail()}">{$detailUser->getEmail()}</a></td>
</tr>

<tr>
<th>{_admin.users.users_address}</th>
<td>{$detailUser->getAddress()}</td>
Expand Down
5 changes: 5 additions & 0 deletions app/WebModule/forms/ApplicationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]?)$');
Expand Down Expand Up @@ -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(),
Expand Down
5 changes: 5 additions & 0 deletions app/WebModule/forms/PersonalDetailsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]?)$');
Expand All @@ -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(),
Expand Down
2 changes: 2 additions & 0 deletions app/lang/web.cs_CZ.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions app/services/ExcelExportService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down
8 changes: 4 additions & 4 deletions app/services/SkautIsEventEducationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
// ]);
}

/**
Expand Down

0 comments on commit 71633b0

Please sign in to comment.