Creation and editing of events
This commit is contained in:
@@ -2,11 +2,15 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Enumerations\EatingHabit;
|
||||
use App\Enumerations\InvoiceType;
|
||||
use App\Enumerations\UserRole;
|
||||
use App\Models\Tenant;
|
||||
use App\Models\User;
|
||||
use App\Repositories\EventRepository;
|
||||
use App\Repositories\PageTextRepository;
|
||||
use App\Resources\UserResource;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -98,6 +102,9 @@ class GlobalDataProvider {
|
||||
}
|
||||
|
||||
private function generateNavbar() : array {
|
||||
$eventRepository = new EventRepository();
|
||||
|
||||
|
||||
$navigation = [
|
||||
'personal' => [],
|
||||
'common' => [],
|
||||
@@ -116,6 +123,14 @@ class GlobalDataProvider {
|
||||
) {
|
||||
$navigation['costunits'][] = ['url' => '/cost-unit/list', 'display' => 'Kostenstellen'];
|
||||
$navigation['costunits'][] = ['url' => '/cost-unit/create', 'display' => 'Neue laufende Tätigkeit'];
|
||||
|
||||
|
||||
foreach ($eventRepository->listAll() as $event) {
|
||||
$navigation['events'][] = ['url' => '/event/details/' . $event->id, 'display' => $event->name];
|
||||
}
|
||||
|
||||
$navigation['events'][] = ['url' => '/event/new', 'display' => 'Neue Veranstaltung'];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,5 +156,13 @@ class GlobalDataProvider {
|
||||
return $activeUsers;
|
||||
}
|
||||
|
||||
public function getEventSettingData() : JsonResponse {
|
||||
return response()->json(
|
||||
[
|
||||
'localGroups' => Tenant::where(['is_active_local_group' => true])->get(),
|
||||
'eatingHabits' => EatingHabit::all(),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user