This commit is contained in:
f4ilji
2024-11-18 01:37:28 +05:00
parent af69b48247
commit 4b103325f7
12 changed files with 165 additions and 15 deletions
@@ -79,17 +79,17 @@ class UserDetailForm
Forms\Components\TextInput::make('year')->label('Года обучения')->string()->required(), Forms\Components\TextInput::make('year')->label('Года обучения')->string()->required(),
Forms\Components\TextInput::make('content')->label('Общая информация')->string()->required(), Forms\Components\TextInput::make('content')->label('Общая информация')->string()->required(),
Forms\Components\TextInput::make('institution')->label('Учебное заведение')->string()->required() Forms\Components\TextInput::make('institution')->label('Учебное заведение')->string()->required()
])->label('Образование'), ])->label('Образование')->defaultItems(0),
Forms\Components\Repeater::make('professionalRetraining')->schema([ Forms\Components\Repeater::make('professionalRetraining')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Профессиональная переподготовка'), ])->label('Профессиональная переподготовка')->defaultItems(0),
Forms\Components\Repeater::make('professionalDevelopment') Forms\Components\Repeater::make('professionalDevelopment')
->schema([ ->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Повышение квалификации'), ])->label('Повышение квалификации')->defaultItems(0),
Forms\Components\Repeater::make('awards')->schema([ Forms\Components\Repeater::make('awards')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Награды'), ])->label('Награды')->defaultItems(0),
]), ]),
Tabs\Tab::make('Преподавание') Tabs\Tab::make('Преподавание')
->schema([ ->schema([
@@ -103,19 +103,19 @@ class UserDetailForm
]), ]),
Forms\Components\Repeater::make('professDisciplines')->schema([ Forms\Components\Repeater::make('professDisciplines')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Преподаваемые дисциплины'), ])->label('Преподаваемые дисциплины')->defaultItems(0),
]), ]),
Tabs\Tab::make('Научная деятельность') Tabs\Tab::make('Научная деятельность')
->schema([ ->schema([
Forms\Components\Repeater::make('attendedConferences')->schema([ Forms\Components\Repeater::make('attendedConferences')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Участие в конференциях'), ])->label('Участие в конференциях')->defaultItems(0),
Forms\Components\Repeater::make('participationScienceProjects')->schema([ Forms\Components\Repeater::make('participationScienceProjects')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Участие в научных проектах'), ])->label('Участие в научных проектах')->defaultItems(0),
Forms\Components\Repeater::make('publications')->schema([ Forms\Components\Repeater::make('publications')->schema([
Forms\Components\TextInput::make('item')->label('')->string()->required() Forms\Components\TextInput::make('item')->label('')->string()->required()
])->label('Публикации'), ])->label('Публикации')->defaultItems(0),
]), ]),
Tabs\Tab::make('Другое') Tabs\Tab::make('Другое')
->schema([ ->schema([
@@ -25,9 +25,10 @@ class TeachersRelationManager extends RelationManager
{ {
return $form return $form
->schema([ ->schema([
Forms\Components\TextInput::make('name') Forms\Components\TextInput::make('teaching_position')->label('Преподавательская должность')->required(),
->required() Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
->maxLength(255), Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]); ]);
} }
@@ -46,6 +47,9 @@ class TeachersRelationManager extends RelationManager
->form(fn (AttachAction $action): array => [ ->form(fn (AttachAction $action): array => [
$action->getRecordSelect(), $action->getRecordSelect(),
Forms\Components\TextInput::make('teaching_position')->label('Преподавательская должность')->required(), Forms\Components\TextInput::make('teaching_position')->label('Преподавательская должность')->required(),
Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]) ])
]) ])
->actions([ ->actions([
@@ -25,6 +25,9 @@ class WorkersRelationManager extends RelationManager
return $form return $form
->schema([ ->schema([
Forms\Components\TextInput::make('position')->label('Должность')->required(), Forms\Components\TextInput::make('position')->label('Должность')->required(),
Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]); ]);
} }
@@ -44,6 +47,9 @@ class WorkersRelationManager extends RelationManager
->form(fn (AttachAction $action): array => [ ->form(fn (AttachAction $action): array => [
$action->getRecordSelect(), $action->getRecordSelect(),
Forms\Components\TextInput::make('position')->label('Должность')->required(), Forms\Components\TextInput::make('position')->label('Должность')->required(),
Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]) ])
]) ])
->actions([ ->actions([
@@ -22,6 +22,9 @@ class WorkersRelationManager extends RelationManager
return $form return $form
->schema([ ->schema([
Forms\Components\TextInput::make('administrativePosition')->label('Должность')->required(), Forms\Components\TextInput::make('administrativePosition')->label('Должность')->required(),
Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]); ]);
} }
@@ -45,6 +48,9 @@ class WorkersRelationManager extends RelationManager
->form(fn (AttachAction $action): array => [ ->form(fn (AttachAction $action): array => [
$action->getRecordSelect(), $action->getRecordSelect(),
Forms\Components\TextInput::make('administrativePosition')->label('Должность')->required(), Forms\Components\TextInput::make('administrativePosition')->label('Должность')->required(),
Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]) ])
]) ])
->actions([ ->actions([
@@ -23,6 +23,9 @@ class WorkersRelationManager extends RelationManager
return $form return $form
->schema([ ->schema([
Forms\Components\TextInput::make('position')->label('Должность')->required(), Forms\Components\TextInput::make('position')->label('Должность')->required(),
Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]); ]);
} }
@@ -45,6 +48,9 @@ class WorkersRelationManager extends RelationManager
->form(fn (AttachAction $action): array => [ ->form(fn (AttachAction $action): array => [
$action->getRecordSelect()->preload(), $action->getRecordSelect()->preload(),
Forms\Components\TextInput::make('position')->label('Должность')->required(), Forms\Components\TextInput::make('position')->label('Должность')->required(),
Forms\Components\TextInput::make('service_email')->label('Служебная почта'),
Forms\Components\TextInput::make('service_phone')->label('Служебный телефон'),
Forms\Components\TextInput::make('cabinet')->label('Кабинет'),
]) ])
]) ])
->actions([ ->actions([
+2 -2
View File
@@ -27,7 +27,7 @@ class Department extends Model
public function workers() public function workers()
{ {
return $this->belongsToMany(User::class, 'workers_departments')->withPivot(['position']); return $this->belongsToMany(User::class, 'workers_departments')->withPivot(['position', 'sort', 'service_email', 'service_phone', 'cabinet']);
} }
public function programs() public function programs()
@@ -37,6 +37,6 @@ class Department extends Model
public function teachers() public function teachers()
{ {
return $this->belongsToMany(User::class, 'teachers_departments')->withPivot(['teaching_position']); return $this->belongsToMany(User::class, 'teachers_departments')->withPivot(['teaching_position', 'sort', 'service_email', 'service_phone', 'cabinet']);
} }
} }
+1 -1
View File
@@ -22,6 +22,6 @@ class Division extends Model
public function workers() public function workers()
{ {
return $this->belongsToMany(User::class, 'division_user')->withPivot(['administrativePosition', 'sort']); return $this->belongsToMany(User::class, 'division_user')->withPivot(['administrativePosition', 'sort', 'service_email', 'service_phone', 'cabinet']);
} }
} }
+1 -1
View File
@@ -27,7 +27,7 @@ class Faculty extends Model
public function workers() public function workers()
{ {
return $this->belongsToMany(User::class, 'workers_faculties')->withPivot(['position'])->whereHas('userDetail'); return $this->belongsToMany(User::class, 'workers_faculties')->withPivot(['position', 'sort', 'service_email', 'service_phone', 'cabinet'])->whereHas('userDetail');
} }
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('workers_faculties', function (Blueprint $table) {
$table->string('service_email')->nullable()->after('position');
$table->string('service_phone')->nullable()->after('service_email');
$table->string('cabinet')->nullable()->after('service_phone');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('workers_faculties', function (Blueprint $table) {
$table->dropColumn('service_email');
$table->dropColumn('service_phone');
$table->dropColumn('cabinet');
});
}
};
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('workers_departments', function (Blueprint $table) {
$table->string('service_email')->nullable()->after('position');
$table->string('service_phone')->nullable()->after('service_email');
$table->string('cabinet')->nullable()->after('service_phone');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('workers_departments', function (Blueprint $table) {
$table->dropColumn('service_email');
$table->dropColumn('service_phone');
$table->dropColumn('cabinet');
});
}
};
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('teachers_departments', function (Blueprint $table) {
$table->string('email')->nullable()->after('teaching_position');
$table->string('phone')->nullable()->after('email');
$table->string('cabinet')->nullable()->after('phone');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('teachers_departments', function (Blueprint $table) {
$table->dropColumn('email');
$table->dropColumn('phone');
$table->dropColumn('cabinet');
});
}
};
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('division_user', function (Blueprint $table) {
$table->string('service_email')->nullable()->after('administrativePosition');
$table->string('service_phone')->nullable()->after('service_email');
$table->string('cabinet')->nullable()->after('service_phone');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('division_user', function (Blueprint $table) {
$table->dropColumn('service_email');
$table->dropColumn('service_phone');
$table->dropColumn('cabinet');
});
}
};