wip
This commit is contained in:
1 parent
9a5ad32315
commit
5255bb8391
2 files changed
+9
-10
No files matched your search
@@ -14,7 +14,6 @@ use Carbon\Carbon;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\ActionGroup;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\EditRecord;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
@@ -164,16 +163,13 @@ class EditProjekte extends EditRecord
|
||||
->visible(fn () => Auth::user()->id == 1)
|
||||
->icon('phosphor-arrow-fat-line-right-fill')
|
||||
->modalIcon('phosphor-arrow-fat-line-right-fill')
|
||||
->schema([
|
||||
Select::make('authorId')
|
||||
->label('Author')
|
||||
->options(Projekte::query()->pluck('interner_name', 'id'))
|
||||
->required(),
|
||||
])->action(function (array $data, Projekte $record): void {
|
||||
$res = ProjektObjekteImDetail::where('projekte_id', 15)->get();
|
||||
->action(function ($record): void {
|
||||
$res = ProjektObjekteImDetail::where('projekte_id', $record->id)->get();
|
||||
foreach ($res as $row) {
|
||||
$projekt_methode_id = ProjektMethode::where('cloned_from_id', $row->projekt_methode_id)->value('id');
|
||||
ProjektObjekteImDetail::where('id', $row->id)->update(['projekt_methode_id' => $projekt_methode_id]);
|
||||
if ($projekt_methode_id) {
|
||||
ProjektObjekteImDetail::where('id', $row->id)->update(['projekt_methode_id' => $projekt_methode_id]);
|
||||
}
|
||||
}
|
||||
}),
|
||||
Action::make('reparieren')
|
||||
|
||||
@@ -9,6 +9,7 @@ use App\Models\Gutachter;
|
||||
use App\Models\Projekte;
|
||||
use App\Models\ProjektUser;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
@@ -101,12 +102,14 @@ class ProjektesTable
|
||||
], FiltersLayout::AboveContent)
|
||||
->deferFilters(false)
|
||||
->recordActions([
|
||||
EditAction::make()->iconButton(),
|
||||
DeleteAction::make()->iconButton()
|
||||
->requiresConfirmation(),
|
||||
Action::make('dokument_klonen')
|
||||
->action(fn (Projekte $record) => CloneProjekt::clone($record))
|
||||
->iconButton()
|
||||
->icon('phosphor-copy')
|
||||
->requiresConfirmation(),
|
||||
EditAction::make()->iconButton(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user