36 lines
2.0 KiB
PHP
36 lines
2.0 KiB
PHP
<?php
|
|
|
|
class WarehouseProjectController extends TTCrud {
|
|
protected string $headerTitle = 'Projekte';
|
|
protected string $createText = 'Neues Projekt erstellen';
|
|
|
|
//@formatter:off
|
|
protected array $columns = [
|
|
['key' => 'title', 'text' => 'Titel', 'required' => true, 'table' => ['class' => 'text-nowrap', 'priority' => 9]],
|
|
['key' => 'description', 'text' => 'Beschreibung', 'required' => true, 'table' => ['class' => 'text-nowrap']],
|
|
['key' => 'createBy', 'text' => 'Erstellt von', 'required' => true, 'type' => 'select', 'table' => ['class' => 'text-nowrap', 'filter' => 'select'], 'modal' => ['items' => [], 'type' => 'select']],
|
|
['key' => 'create', 'text' => 'Erstellt am', 'required' => true, 'table' => ['filter' => 'date', 'class' => 'text-center']],
|
|
['key' => 'address', 'text' => 'Adresse', 'required' => true, 'type' => 'autocomplete', 'table' => ['class' => 'text-nowrap', 'filter' => false], 'modal' => ['apiUrl' => '/Address/api?do=findAddress', 'items' => '/Address/api?do=findAddress', 'type' => 'autocomplete']],
|
|
['key' => 'status', 'text' => 'Status', 'required' => true, 'table' => ['filter' => 'select'], 'modal' => [ 'type' => 'select', 'items' => [ ['value' => 'erstellt', 'text' => 'Erstellt'], ['value' => 'in_bearbeitung', 'text' => 'In Bearbeitung'], ['value' => 'erledigt', 'text' => 'Erledigt'], ['value' => 'verrechnet', 'text' => 'Verrechnet']]]]
|
|
];
|
|
|
|
|
|
protected array $additionalActions = [
|
|
];
|
|
|
|
protected array $infoMessages = [
|
|
'create' => 'Projekt wurde erstellt',
|
|
'update' => 'Projekt wurde aktualisiert',
|
|
'delete' => 'Projekt wurde gelöscht',
|
|
'noChanges' => 'Keine Änderungen',
|
|
];
|
|
//@formatter:on
|
|
|
|
public function prepareCrudConfig() {
|
|
$users = array_map(function($user) {
|
|
return ['value' => $user->id, 'text' => $user->name];
|
|
}, UserModel::search(['employee' => true]));
|
|
|
|
$this->columns[1]['modal']['items'] = $users;
|
|
}
|
|
} |