All Lists finalized
This commit is contained in:
@@ -133,7 +133,6 @@ class DetailsController extends CommonController {
|
||||
|
||||
$participants = $this->eventParticipants->getForList($event, $request);
|
||||
$kitchenOverview = $this->eventParticipants->getKitchenOverview($event);
|
||||
|
||||
$html = view('pdfs.' . $listType, [
|
||||
'event' => $event->name,
|
||||
'eventStart' => $event->start_date,
|
||||
@@ -153,4 +152,22 @@ class DetailsController extends CommonController {
|
||||
'Content-Disposition' => 'attachment; filename="' . $listType .'.pdf"',
|
||||
]);
|
||||
}
|
||||
|
||||
public function downloadCsvList(string $eventId, string $listType, Request $request): Response
|
||||
{
|
||||
$event = $this->events->getByIdentifier($eventId);
|
||||
|
||||
$participants = $this->eventParticipants->getForList($event, $request);
|
||||
$kitchenOverview = $this->eventParticipants->getKitchenOverview($event);
|
||||
|
||||
$csv = view('csvs.' . $listType, [
|
||||
'event' => $event->name,
|
||||
'rows' => $participants,
|
||||
])->render();
|
||||
|
||||
return response($csv, 200, [
|
||||
'Content-Type' => 'text/csv; charset=UTF-8',
|
||||
'Content-Disposition' => 'attachment; filename="' . $listType . '.csv"',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ Route::middleware(IdentifyTenant::class)->group(function () {
|
||||
Route::get('/new', CreateController::class);
|
||||
Route::get('/details/{eventId}', DetailsController::class);
|
||||
Route::get('/details/{eventId}/pdf/{listType}', [DetailsController::class, 'downloadPdfList']);
|
||||
Route::get('/details/{eventId}/csv/{listType}', [DetailsController::class, 'downloadCsvList']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -64,8 +64,10 @@ import {onMounted, reactive, ref} from "vue";
|
||||
<input type="button" value="Erste-Hilfe-Liste (PDF)" />
|
||||
</a><br/>
|
||||
|
||||
<input type="button" value="Teili-Liste (CSV)" /><br/>
|
||||
<input type="button" value="KSV-Daten (CSV)" /><br/>
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/csv/participant-list'">
|
||||
<input type="button" value="Teili-Liste (CSV)" />
|
||||
</a><br/>
|
||||
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/kitchen-list'">
|
||||
<input type="button" value="Küchenübersicht (PDF)" />
|
||||
</a><br/>
|
||||
@@ -74,8 +76,13 @@ import {onMounted, reactive, ref} from "vue";
|
||||
<input type="button" value="Beitragsliste (PDF)" />
|
||||
</a><br/>
|
||||
|
||||
<input type="button" value="Getränkeliste (PDF)" /><br/>
|
||||
<input type="button" value="Foto-Erlaubnis (PDF)" /><br/>
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/drinking-list'">
|
||||
<input type="button" value="Getränkeliste (PDF)" />
|
||||
</a><br/>
|
||||
|
||||
<a :href="'/event/details/' + props.data.event.identifier + '/pdf/photo-permission-list'">
|
||||
<input type="button" value="Foto-Erlaubnis (PDF)" />
|
||||
</a><br/>
|
||||
<input type="button" class="fix-button" value="Zahlungserinnerung senden" /><br/>
|
||||
<input type="button" class="deny-button" value="Letzte Mahnung senden" /><br/>
|
||||
<input type="button" value="Rundmail senden" /><br/>
|
||||
|
||||
@@ -51,8 +51,13 @@ class EventParticipantResource extends JsonResource
|
||||
'email_1' => $this->resource->email_1,
|
||||
'amountPaid' => ['value' => $this->resource->amount_paid, 'readable' => $this->resource->amount_paid?->toString() ?? '0,00 Euro'],
|
||||
'amountExpected' => ['value' => $this->resource->amount, 'readable' => $this->resource->amount?->toString() ?? '0,00 Euro'],
|
||||
'alcoholicsAllowed' => new Age($this->resource->birthday)->getAge() >= $event->alcoholics_age,
|
||||
'localGroupPostcode' => $this->resource->localGroup()->first()->postcode,
|
||||
'localGroupCity' => $this->resource->localGroup()->first()->city,
|
||||
'state' => config('postCode.map.' . $this->resource->postcode),
|
||||
'localGroupState' => config('postCode.map.' . $this->resource->localGroup()->first()->postcode),
|
||||
'birthday' => $this->resource->birthday->format('d.m.Y'),
|
||||
]
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user