Skip to content

Commit 653d9f6

Browse files
author
Jan Staněk
authored
Merge pull request #486 from jan-stanek/zobrazeni-logu
zobrazeni historie prihlasky
2 parents 81d2887 + f49ec4a commit 653d9f6

File tree

7 files changed

+141
-55
lines changed

7 files changed

+141
-55
lines changed

app/AdminModule/ProgramModule/presenters/templates/Blocks/detail.latte

+55-55
Original file line numberDiff line numberDiff line change
@@ -72,66 +72,66 @@
7272
{snippet programs}
7373
<table class="table table-bordered">
7474
<thead>
75-
<tr>
76-
<th class="text-right">{_admin.program.blocks_program_start}</th>
77-
<th class="text-right">{_admin.program.blocks_program_end}</th>
78-
<th>{_admin.program.blocks_program_room}</th>
79-
<th>{_admin.program.blocks_program_occupancy}</th>
80-
<th class="text-center" style="white-space: nowrap; width: 1%;">{_ublaboo_datagrid.action}</th>
81-
</tr>
75+
<tr style="font-size: 90%">
76+
<th class="text-right">{_admin.program.blocks_program_start}</th>
77+
<th class="text-right">{_admin.program.blocks_program_end}</th>
78+
<th>{_admin.program.blocks_program_room}</th>
79+
<th>{_admin.program.blocks_program_occupancy}</th>
80+
<th class="text-center" style="white-space: nowrap; width: 1%;">{_ublaboo_datagrid.action}</th>
81+
</tr>
8282
</thead>
8383

8484
<tbody>
85-
{var $i = 1}
86-
{foreach $block->getPrograms() as $program}
87-
{var $background = $i % 2 ? '#F9F9F9' : '#FFFFFF'}
88-
<tr style="background-color: {$background|noescape}">
89-
<td class="text-right">
90-
{var $startDay = $program->getStart()->format('N')}
91-
{_common.day.$startDay}
92-
{$program->getStart()|date:"j. n. G:i"}
93-
</td>
94-
<td class="text-right">
95-
{var $endDay = $program->getEnd()->format('N')}
96-
{_common.day.$endDay}
97-
{$program->getEnd()|date:"j. n. G:i"}
98-
</td>
99-
<td>
100-
{if $program->getRoom() !== null}
101-
{$program->getRoom()->getName()}
102-
{/if}
103-
</td>
104-
<td>
105-
{$program->getAttendeesCount()}
106-
</td>
107-
<td class="text-right" style="white-space: nowrap; width: 1%;">
108-
{if $programId == $program->getId()}
109-
<a class="btn btn-xs btn-warning ajax" n:href="showattendees! 0">
110-
{_admin.program.blocks_program_hide_attendees_list}
111-
</a>
112-
{else}
113-
<a class="btn btn-xs btn-default ajax" n:href="showattendees! $program->getId()">
114-
{_admin.program.blocks_program_show_attendees_list}
115-
</a>
116-
{/if}
117-
{if $userAllowedModifySchedule}
118-
<a class="btn btn-xs btn-danger" n:href="deleteProgram! $program->getId()"
119-
data-toggle="confirmation"
120-
data-content="{_admin.program.blocks_program_delete_confirm}">
121-
<i class="fa fa-trash"></i>
122-
</a>
123-
{/if}
124-
</td>
125-
</tr>
126-
{if $programId == $program->getId()}
127-
<tr style="background-color: #337AB7" class="program-attendees">
128-
<td colspan="5" style="padding: 10px">
129-
{control programAttendeesGrid}
85+
{var $i = 1}
86+
{foreach $block->getPrograms() as $program}
87+
{var $background = $i % 2 ? '#F9F9F9' : '#FFFFFF'}
88+
<tr style="background-color: {$background|noescape}">
89+
<td class="text-right">
90+
{var $startDay = $program->getStart()->format('N')}
91+
{_common.day.$startDay}
92+
{$program->getStart()|date:"j. n. G:i"}
93+
</td>
94+
<td class="text-right">
95+
{var $endDay = $program->getEnd()->format('N')}
96+
{_common.day.$endDay}
97+
{$program->getEnd()|date:"j. n. G:i"}
98+
</td>
99+
<td>
100+
{if $program->getRoom() !== null}
101+
{$program->getRoom()->getName()}
102+
{/if}
103+
</td>
104+
<td>
105+
{$program->getAttendeesCount()}
106+
</td>
107+
<td class="text-right" style="white-space: nowrap; width: 1%;">
108+
{if $programId == $program->getId()}
109+
<a class="btn btn-xs btn-warning ajax" n:href="showattendees! 0">
110+
{_admin.program.blocks_program_hide_attendees_list}
111+
</a>
112+
{else}
113+
<a class="btn btn-xs btn-default ajax" n:href="showattendees! $program->getId()">
114+
{_admin.program.blocks_program_show_attendees_list}
115+
</a>
116+
{/if}
117+
{if $userAllowedModifySchedule}
118+
<a class="btn btn-xs btn-danger" n:href="deleteProgram! $program->getId()"
119+
data-toggle="confirmation"
120+
data-content="{_admin.program.blocks_program_delete_confirm}">
121+
<i class="fa fa-trash"></i>
122+
</a>
123+
{/if}
130124
</td>
131125
</tr>
132-
{/if}
133-
{var $i = $i + 1}
134-
{/foreach}
126+
{if $programId == $program->getId()}
127+
<tr style="background-color: #337AB7" class="program-attendees">
128+
<td colspan="5" style="padding: 8px">
129+
{control programAttendeesGrid}
130+
</td>
131+
</tr>
132+
{/if}
133+
{var $i = $i + 1}
134+
{/foreach}
135135
</tbody>
136136
</table>
137137
{/snippet}

app/AdminModule/components/ApplicationsGridControl.php

+4
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ public function createComponentApplicationsGrid($name)
137137
->orderBy('a.applicationId')
138138
);
139139
$grid->setPagination(FALSE);
140+
$grid->setItemsDetail()
141+
->setTemplateParameters(['applicationRepository' => $this->applicationRepository]);
142+
$grid->setTemplateFile(__DIR__ . '/templates/applications_grid_template.latte');
143+
140144

141145
$grid->addColumnDateTime('applicationDate', 'admin.users.users_applications_application_date')
142146
->setFormat('j. n. Y H:i');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{extends $original_template}
2+
3+
{block detail}
4+
{var $applications = $applicationRepository->findByApplicationId($item->getApplicationId())}
5+
<table class="table table-bordered">
6+
<thead>
7+
<tr>
8+
<th>{_admin.users.users_applications_roles}</th>
9+
<th>{_admin.users.users_applications_subevents}</th>
10+
<th class="text-right">{_admin.users.users_applications_fee}</th>
11+
<th>{_admin.users.users_applications_variable_symbol}</th>
12+
<th class="text-right">{_admin.users.users_applications_maturity_date}</th>
13+
<th>{_admin.users.users_applications_payment_method}</th>
14+
<th class="text-right">{_admin.users.users_applications_payment_date}</th>
15+
<th class="text-right">{_admin.users.users_applications_income_proof_printed_date}</th>
16+
<th>{_admin.users.users_applications_state}</th>
17+
<th class="text-right">{_admin.users.users_applications_valid_from}</th>
18+
<th class="text-right">{_admin.users.users_applications_valid_to}</th>
19+
<th>{_admin.users.users_applications_created_by}</th>
20+
</tr>
21+
</thead>
22+
23+
<tbody>
24+
{var $i = 1}
25+
{foreach $applications as $application}
26+
{var $background = $i % 2 ? '#F9F9F9' : '#FFFFFF'}
27+
<tr style="background-color: {$background|noescape}">
28+
<td>{$application->getRolesText()}</td>
29+
<td>{$application->getSubeventsText()}</td>
30+
<td class="text-right">{$application->getFee()}</td>
31+
<td>{$application->getVariableSymbolText()}</td>
32+
<td class="text-right">{$application->getMaturityDateText()}</td>
33+
<td>{if $application->getPaymentMethod()}{_'common.payment.' . $application->getPaymentMethod()}{/if}</td>
34+
<td class="text-right">{$application->getPaymentDateText()}</td>
35+
<td class="text-right">{$application->getIncomeProofPrintedDateText()}</td>
36+
<td>{_'common.application_state.' . $application->getState()}</td>
37+
<td class="text-right">{$application->getValidFrom()|date:'j. n. Y H:i'}</td>
38+
<td class="text-right">{$application->getValidTo()|date:'j. n. Y H:i'}</td>
39+
<td>{if $application->getCreatedBy()}{$application->getCreatedBy()->getDisplayName()}{/if}</td>
40+
</tr>
41+
{var $i = $i + 1}
42+
{/foreach}
43+
</tbody>
44+
</table>
45+
{/block}

app/lang/admin.cs_CZ.neon

+3
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ users:
366366
users_applications_payment_date: "Zaplaceno dne"
367367
users_applications_income_proof_printed_date: "Doklad vytištěn"
368368
users_applications_state: "Stav"
369+
users_applications_valid_from: "Platná od"
370+
users_applications_valid_to: "Platná do"
371+
users_applications_created_by: "Vytvořil"
369372
users_applications_saved: "Přihláška byla úspěšně uložena."
370373
users_applications_download_payment_proof_bank: "Stáhnout potvrzení o přijetí platby"
371374
users_applications_download_payment_proof_cash: "Stáhnout příjmový doklad"

app/model/User/Application/Application.php

+18
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,15 @@ public function getPaymentDate()
358358
return $this->paymentDate;
359359
}
360360

361+
/**
362+
* Vrací datum platby jako text.
363+
* @return string|null
364+
*/
365+
public function getPaymentDateText(): ?string
366+
{
367+
return $this->paymentDate !== NULL ? $this->paymentDate->format('j. n. Y') : NULL;
368+
}
369+
361370
/**
362371
* @param \DateTime $paymentDate
363372
*/
@@ -374,6 +383,15 @@ public function getIncomeProofPrintedDate()
374383
return $this->incomeProofPrintedDate;
375384
}
376385

386+
/**
387+
* Vrací datum vytištění dokladu jako text.
388+
* @return string|null
389+
*/
390+
public function getIncomeProofPrintedDateText(): ?string
391+
{
392+
return $this->incomeProofPrintedDate !== NULL ? $this->incomeProofPrintedDate->format('j. n. Y') : NULL;
393+
}
394+
377395
/**
378396
* @param \DateTime $incomeProofPrintedDate
379397
*/

app/model/User/Application/ApplicationRepository.php

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use App\Model\Enums\ApplicationState;
66
use Doctrine\Common\Collections\ArrayCollection;
77
use Doctrine\Common\Collections\Collection;
8+
use Doctrine\Common\Collections\Criteria;
89
use Kdyby\Doctrine\EntityRepository;
910

1011

@@ -25,6 +26,17 @@ public function findById($id)
2526
return $this->findOneBy(['id' => $id]);
2627
}
2728

29+
/**
30+
* Vrací přihlášky podle id, které mají společné všechny verze přihlášky.
31+
* @param $id
32+
* @return Collection|Application[]
33+
*/
34+
public function findByApplicationId(int $id): Collection
35+
{
36+
$result = $this->findBy(['applicationId' => $id]);
37+
return new ArrayCollection($result);
38+
}
39+
2840
/**
2941
* Uloží přihlášku.
3042
* @param Application $application

www/css/admin/style.css

+4
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ body {
102102
height: 28px !important;
103103
}
104104

105+
.datagrid .row-item-detail {
106+
background-color: #337ab7 !important;
107+
}
108+
105109
/* tabulka bez ramecku */
106110
.table-borderless tbody tr td,
107111
.table-borderless tbody tr th,

0 commit comments

Comments
 (0)