This commit is contained in:
salam committed 2025-10-31 15:38:20 +01:00
1 parent 30563ee98d
commit 622b37bb90
12 files changed
+56 -56

No files matched your search

@@ -1,10 +1,10 @@
<?php
namespace App\Actions\Generate\Nutzwerte;
namespace App\Actions\Generate\Tabellen;
use App\Actions\Generate\Utilities\Format;
use App\Actions\Generate\Utilities\Html;
use App\Models\Merkmale;
use App\Models\ProjektMerkmale;
use App\Models\ProjektMethode;
use App\Models\ProjektObjekte;
@@ -29,14 +29,14 @@ class ZuUndAbschlaege
$header_row = ['Top Nummer', 'Geschoß', 'Typ', 'Nutzfläche'];
}
$merkmale = Merkmale::where('projekte_id', $projekte_id)->pluck('name', 'code');
$projekt_merkmale = ProjektMerkmale::where('projekte_id', $projekte_id)->pluck('name', 'code');
$markmale_codes = [];
foreach ($merkmale as $key => $value) {
foreach ($projekt_merkmale as $key => $value) {
$markmale_codes[] = $key;
$header_row[] = $value;
}
$header_row[] = 'Summe Merkmale';
$header_row[] = 'Summe ProjektMerkmale';
$header_row[] = 'Wohnungsbewertung';
$html = '<table class="table-striped">';
@@ -2,8 +2,8 @@
namespace App\Filament\Resources\Projektes\RelationManagers;
use App\Models\Merkmale;
use App\Models\Orientierung;
use App\Models\ProjektMerkmale;
use App\Models\ProjektObjekte;
use Filament\Actions\Action;
use Filament\Actions\BulkAction;
@@ -55,7 +55,7 @@ class ProjektObjekteRelationManager extends RelationManager
public function table(Table $table): Table
{
$spalten = Merkmale::where('projekte_id', $this->ownerRecord->id)->pluck('name', 'code');
$spalten = ProjektMerkmale::where('projekte_id', $this->ownerRecord->id)->pluck('name', 'code');
return $table
// ->striped()
@@ -251,14 +251,14 @@ class ProjektObjekteRelationManager extends RelationManager
->modalDescription('Die dazugehörigen Räume werde in "Objekte im Detail" erstellt.')
->icon('phosphor-file-plus')
->createAnother(false),
Action::make('merkmale')
Action::make('projekt_merkmale')
->icon('phosphor-pen')
->modalCancelAction(fn (Action $action) => $action->label('Schließen'))
->modalSubmitAction(false)
->modalHeading('Merkmale')
->modalHeading('ProjektMerkmale')
->slideOver()
// ->modalWidth(Width::Medium)
->modalContent(view('filament.pages.actions.merkmale'))
->modalContent(view('filament.pages.actions.projekt_merkmale'))
->after(function (Component $livewire) {
$livewire->dispatch('refreshOrientierung');
}),
@@ -2,7 +2,7 @@
namespace App\Filament\Resources\Projektes\Widgets;
use App\Models\Merkmale;
use App\Models\ProjektMerkmale;
use App\Models\ProjektObjekte;
use Filament\Actions\Action;
use Filament\Actions\DeleteAction;
@@ -13,11 +13,11 @@ use Filament\Tables\Table;
use Filament\Widgets\TableWidget;
use Illuminate\Database\Eloquent\Builder;
class WidgetMerkmale extends TableWidget
class WidgetProjektMerkmale extends TableWidget
{
protected static ?string $navigationLabel = 'Merkmal';
protected static ?string $pluralModelLabel = 'Merkmale';
protected static ?string $pluralModelLabel = 'ProjektMerkmale';
protected static ?string $modelLabel = 'Merkmal';
@@ -29,7 +29,7 @@ class WidgetMerkmale extends TableWidget
{
return $table
->striped()
->query(fn (): Builder => Merkmale::where('projekte_id', $this->projekte_id))
->query(fn (): Builder => ProjektMerkmale::where('projekte_id', $this->projekte_id))
->defaultSort('code')
->columns([
TextColumn::make('name'),
@@ -73,9 +73,9 @@ class WidgetMerkmale extends TableWidget
->prefixIcon('phosphor-house-simple'),
])
->action(function (array $data) {
$code = Merkmale::getfreecode($this->projekte_id);
$code = ProjektMerkmale::getfreecode($this->projekte_id);
if ($code) {
$merkmal = new Merkmale;
$merkmal = new ProjektMerkmale;
$merkmal->projekte_id = $this->projekte_id;
$merkmal->code = $code;
$merkmal->name = $data['name'];
@@ -4,7 +4,7 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Merkmale extends Model
class ProjektMerkmale extends Model
{
protected $fillable = [
'projekte_id',