diff --git a/app/Http/Controllers/CreateProjectController.php b/app/Http/Controllers/CreateProjectController.php
index 88a74d21..e7c67531 100644
--- a/app/Http/Controllers/CreateProjectController.php
+++ b/app/Http/Controllers/CreateProjectController.php
@@ -332,7 +332,7 @@ public function CreateNewEquipmentFromPendingEquipment(Request $request, $id)
public function processStep1(Request $request)
{
- dd($request);
+ // dd($request);
// Validação...
$installationId = $request->input('installation_id');
@@ -366,6 +366,7 @@ public function processStep1(Request $request)
$project->date_started = $request->input('date_started');
$project->plant_id = $installationId;
+ $project->order_project = 1;
$project->save();
diff --git a/app/Http/Controllers/CustomRegistrationController.php b/app/Http/Controllers/CustomRegistrationController.php
index 2ba13fa2..dd5a57db 100644
--- a/app/Http/Controllers/CustomRegistrationController.php
+++ b/app/Http/Controllers/CustomRegistrationController.php
@@ -31,7 +31,6 @@ public function store(Request $request): RedirectResponse
// Chame sendEmailVerificationNotification para enviar o e-mail de verificação
$user->sendEmailVerificationNotification();
- // // Auth::login($user);
$pendingUser = PendingUser::where('pending_email', $user->email)->first();
if ($pendingUser) {
diff --git a/app/Http/Controllers/ExecutionProjectController.php b/app/Http/Controllers/ExecutionProjectController.php
new file mode 100644
index 00000000..ab450b37
--- /dev/null
+++ b/app/Http/Controllers/ExecutionProjectController.php
@@ -0,0 +1,91 @@
+with('DatasProject', $DatasProject)
+ ->with('equipmentsTypes', $equipmentsTypes);
+ }
+
+ public function receiveWorkstationExecutionProject($receiveNumberProject)
+ {
+
+ $model = ConstructionWorkstation::where('company_projects_id', $receiveNumberProject)->with('workstationsAssociationTasks');
+
+ return DataTables::of($model)
+ // ->addColumn('workstations_Association_Tasks', function ($row) {
+ // return $row->workstationsAssociationTasks->pluck('elemental_tasks_id')->implode('-');
+ // })
+ ->toJson();
+ }
+
+ public function receiveEquipmentIdForShowModal($EquipmentID)
+ {
+ $equipment = Equipment::find($EquipmentID);
+
+ $task_codes = $equipment->orderEquipmentTasks->map(function ($task) {
+ return $task->elementalTask->elemental_tasks_code;
+ })->toArray();
+
+ return response()->json(['task_codes' => $task_codes]);
+ }
+
+ public function receiveEquipmentsExecutionProject($receiveNumberProject)
+ {
+ // Recebe os dados vindos da funcao 'data' criada na view
+ $equipment_type_id = request('equipment_type_id');
+ $ambits_id = request('ambits_id');
+
+ //Recebe sempre apenas os equipamentos relacionados a obra
+ $model = Equipment::where('company_projects_id', $receiveNumberProject);
+
+ // Caso 'equipment_type_id' seja '#', mostra todos os equipamentos
+ if ($equipment_type_id == '#') {
+ $model = Equipment::query()->with(['equipmentType', 'unit', 'equipmentAssociationAmbit.ambitsEquipment']);
+ }
+ // Caso 'equipment_type_id' não seja '#', filtra os equipamentos por tipo e ambito (caso 'ambits_id' não seja '#')
+ else {
+ $equipment_type_id = intval($equipment_type_id);
+ $model = Equipment::where('equipments.equipment_type_id', $equipment_type_id)
+ ->join('equipment_association_ambits', 'equipments.equipment_id', '=', 'equipment_association_ambits.equipment_id')
+ ->with(['equipmentType', 'unit', 'equipmentAssociationAmbit.ambitsEquipment']);
+
+ if ($ambits_id != '#') {
+ $ambits_id = intval($ambits_id);
+ $model->where('equipment_association_ambits.ambits_id', $ambits_id);
+ }
+ }
+
+ return DataTables::of($model)
+ ->addColumn('equipment_type', function ($row) {
+ return $row->equipmentType->equipment_type_name;
+ })
+ ->addColumn('Ambits', function ($row) {
+ return $row->equipmentAssociationAmbit->ambitsEquipment->ambits_description;
+ })
+ ->addColumn('order_tasks', function ($row) {
+ return $row->orderEquipmentTasks->map(function ($task) {
+ return $task->elementalTask->elemental_tasks_code;
+ })->implode('-');
+ })
+ ->toJson();
+ }
+}
diff --git a/app/Http/Controllers/PreparedProjectController.php b/app/Http/Controllers/PreparedProjectController.php
index 5a084411..8d7af6e4 100644
--- a/app/Http/Controllers/PreparedProjectController.php
+++ b/app/Http/Controllers/PreparedProjectController.php
@@ -34,7 +34,7 @@ public function PreparedProject($ProjectId)
->get();
return view('projectsClients/preparedProject')
- ->with('equipmentsProjects', $equipmentsProjects)
+ // ->with('equipmentsProjects', $equipmentsProjects)
->with('equipmentsTypes', $equipmentsTypes)
->with('units', $checkUnits)
->with('numberProject', $numberProject);
diff --git a/app/Models/ConstructionWorkstation.php b/app/Models/ConstructionWorkstation.php
index 85ab1070..e5b13013 100644
--- a/app/Models/ConstructionWorkstation.php
+++ b/app/Models/ConstructionWorkstation.php
@@ -15,5 +15,12 @@ class ConstructionWorkstation extends Model
protected $primaryKey = 'id_workstations';
-
+ // public function workstationsAssociationTasks()
+ // {
+ // return $this->hasMany(WorkstationsAssociationTasks::class, 'id_workstations', 'id_workstations');
+ // }
+ public function workstationsAssociationTasks()
+ {
+ return $this->hasMany(WorkstationsAssociationTasks::class, 'id_workstations');
+ }
}
diff --git a/app/Models/ElementalTasks.php b/app/Models/ElementalTasks.php
new file mode 100644
index 00000000..622dfc26
--- /dev/null
+++ b/app/Models/ElementalTasks.php
@@ -0,0 +1,21 @@
+hasMany(OrderEquipmentTasks::class,'elemental_tasks_id','elemental_tasks_id');
+ }
+}
diff --git a/app/Models/OrderEquipmentTasks.php b/app/Models/OrderEquipmentTasks.php
index fcd786f8..1d02fe95 100644
--- a/app/Models/OrderEquipmentTasks.php
+++ b/app/Models/OrderEquipmentTasks.php
@@ -16,4 +16,9 @@ public function equipment()
{
return $this->belongsTo(Equipment::class, 'equipment_id', 'equipment_id');
}
+
+ public function elementalTask()
+ {
+ return $this->belongsTo(ElementalTasks::class,'elemental_tasks_id','elemental_tasks_id');
+ }
}
diff --git a/app/Models/WorkstationsAssociationTasks.php b/app/Models/WorkstationsAssociationTasks.php
index 3ed94892..987d93cd 100644
--- a/app/Models/WorkstationsAssociationTasks.php
+++ b/app/Models/WorkstationsAssociationTasks.php
@@ -12,5 +12,14 @@ class WorkstationsAssociationTasks extends Model
public $timestamps = false;
protected $table = 'workstations_association_tasks';
-
+
+
+ // public function constructionWorkstation()
+ // {
+ // return $this->belongsTo(ConstructionWorkstation::class, 'equipment_id', 'equipment_id');
+ // }
+ public function constructionWorkstation()
+ {
+ return $this->belongsTo(ConstructionWorkstation::class, 'id_workstations');
+ }
}
diff --git a/app/Providers/FortifyServiceProvider.php b/app/Providers/FortifyServiceProvider.php
index 3593a280..6d322a67 100644
--- a/app/Providers/FortifyServiceProvider.php
+++ b/app/Providers/FortifyServiceProvider.php
@@ -11,12 +11,16 @@
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
+use App\Models\User;
+use Illuminate\Support\Facades\Hash;
+
+
use Laravel\Fortify\Contracts\ResetPasswordViewResponse;
use App\Http\Controllers\Auth\ResetPasswordController;
use App\Http\Controllers\Auth\PasswordResetLinkController;
-// use App\http\Controllers\userController;
+
use Laravel\Fortify\Fortify;
@@ -51,23 +55,32 @@ public function boot(): void
return view('auth.verify-email');
});
- // Fortify::authenticateUsing(function (Request $request) {
- // return UserController::authenticateAndRedirect($request);
- // });
+ Fortify::authenticateUsing(function (Request $request) {
+ $email = $request->input('email');
-
+ // Verifica se "@" já está presente no e-mail. Se não, adiciona "@isptgroup.com" ao final.
+ if (!str_contains($email, '@')) {
+ $email .= '@isptgroup.com';
+ }
+
+ $password = $request->input('password');
+
+ $user = User::where('email', $email)->first();
+
+ if ($user && Hash::check($password, $user->password)) {
+ return $user;
+ }
+ });
Fortify::createUsersUsing(CreateNewUser::class);
-
Fortify::updateUserProfileInformationUsing(UpdateUserProfileInformation::class);
Fortify::updateUserPasswordsUsing(UpdateUserPassword::class);
-
RateLimiter::for('login', function (Request $request) {
$email = (string) $request->email;
- return Limit::perMinute(5)->by($email . $request->ip());
+ return Limit::perMinute(5)->by($email . $request->ip());
});
RateLimiter::for('two-factor', function (Request $request) {
diff --git a/public/StyleAdmin/css/styleProgressBar.css b/public/StyleAdmin/css/styleProgressBar.css
new file mode 100755
index 00000000..39114473
--- /dev/null
+++ b/public/StyleAdmin/css/styleProgressBar.css
@@ -0,0 +1,78 @@
+body{
+ overflow-x: hidden;
+}
+#employer-post-new-job .res-steps-container .res-steps {
+ width: 25%;
+ text-align: center;
+ float: left;
+ cursor: pointer
+}
+
+#employer-post-new-job .res-steps-container .res-steps .res-step-bar {
+ -webkit-border-radius: 50% !important;
+ -moz-border-radius: 50% !important;
+ -ms-border-radius: 50% !important;
+ border-radius: 50% !important;
+ background: #0aa7e1;
+ display: inline-block;
+ height: 40px;
+ width: 40px;
+ margin-top: 10px;
+ text-align: center;
+ color: #fff;
+ padding-top: 7px;
+ font-size: 20px
+}
+
+#employer-post-new-job .res-steps-container .res-steps .res-progress-title {
+ text-align: center;
+ font-size: 15px;
+ padding-top: 10px;
+ display: block
+}
+
+#employer-post-new-job .res-steps-container .res-steps .res-progress-bar {
+ height: 5px;
+ background: #0aa7e1;
+ width: 50%;
+ margin: -22px 0 0 50%;
+ float: left
+}
+
+#employer-post-new-job .res-steps-container .res-step-two .res-progress-bar, #employer-post-new-job .res-steps-container .res-step-three .res-progress-bar, #employer-post-new-job .res-steps-container .res-step-four .res-progress-bar {
+ width: 100%;
+ margin-left: 0%
+}
+
+#employer-post-new-job .res-steps-container .res-step-four .res-progress-bar {
+ width: 50%;
+ margin-right: 50%
+}
+
+#employer-post-new-job .res-step-form {
+ border: 1px solid #d2d2d2;
+ box-shadow: 0px 6px 4px -2px silver;
+ position: absolute
+}
+
+#employer-post-new-job .res-step-form h3 {
+ margin: 10px 0;
+ color: #0aa7e1;
+ font-size: 18px
+}
+
+#employer-post-new-job .res-step-form .form-horizontal label {
+ font-weight: normal
+}
+
+#employer-post-new-job .res-form-two, #employer-post-new-job .res-form-three, #employer-post-new-job .res-form-four .res-form-five{
+ left: 150%
+}
+
+#employer-post-new-job .active .res-step-bar {
+ background: #f19b20 !important
+}
+
+#employer-post-new-job .active .res-progress-title {
+ color: #0aa7e1
+}
\ No newline at end of file
diff --git a/resources/views/Admin/index.blade.php b/resources/views/Admin/index.blade.php
index 9d3e9ed7..f1b5984f 100644
--- a/resources/views/Admin/index.blade.php
+++ b/resources/views/Admin/index.blade.php
@@ -157,7 +157,7 @@ class="btn btn-tool">