From 6dd13e5d7de13213e722d0d432d7acb878354285 Mon Sep 17 00:00:00 2001 From: solocla Date: Fri, 5 Jun 2026 10:45:34 +0200 Subject: [PATCH] fixed employess job roles navbar --- ...5084429_create_company_functions_table.php | 95 +++++++++++++++++++ public/userarea/employees.php | 16 +++- public/userarea/include/navbar.php | 10 ++ public/userarea/job-roles.php | 29 +++++- 4 files changed, 145 insertions(+), 5 deletions(-) create mode 100644 db/migrations/20260605084429_create_company_functions_table.php diff --git a/db/migrations/20260605084429_create_company_functions_table.php b/db/migrations/20260605084429_create_company_functions_table.php new file mode 100644 index 0000000..877d4e1 --- /dev/null +++ b/db/migrations/20260605084429_create_company_functions_table.php @@ -0,0 +1,95 @@ +hasTable('company_functions')) { + $table = $this->table('company_functions', [ + 'id' => false, + 'primary_key' => ['id'], + 'signed' => false, + 'collation' => 'utf8mb4_general_ci', + 'encoding' => 'utf8mb4', + ]); + + $table + ->addColumn('id', 'integer', [ + 'identity' => true, + 'signed' => false, + ]) + ->addColumn('function_name', 'string', [ + 'limit' => 150, + 'null' => false, + 'comment' => 'Function name, for example RSPP, Medico del lavoro, RLS', + ]) + ->addColumn('person_full_name', 'string', [ + 'limit' => 200, + 'null' => false, + 'comment' => 'Full name and surname of the person assigned to the function', + ]) + ->addColumn('phone', 'string', [ + 'limit' => 80, + 'null' => true, + ]) + ->addColumn('email', 'string', [ + 'limit' => 190, + 'null' => true, + ]) + ->addColumn('notes', 'text', [ + 'null' => true, + ]) + ->addColumn('sort_order', 'integer', [ + 'signed' => false, + 'null' => false, + 'default' => 0, + ]) + ->addColumn('is_active', 'boolean', [ + 'null' => false, + 'default' => true, + ]) + ->addColumn('created_at', 'timestamp', [ + 'null' => true, + 'default' => 'CURRENT_TIMESTAMP', + ]) + ->addColumn('updated_at', 'timestamp', [ + 'null' => true, + 'default' => null, + 'update' => 'CURRENT_TIMESTAMP', + ]) + ->addIndex(['function_name'], [ + 'name' => 'idx_company_functions_function_name', + ]) + ->addIndex(['person_full_name'], [ + 'name' => 'idx_company_functions_person_full_name', + ]) + ->addIndex(['email'], [ + 'name' => 'idx_company_functions_email', + ]) + ->addIndex(['is_active', 'sort_order'], [ + 'name' => 'idx_company_functions_active_sort', + ]) + ->create(); + } + + $this->execute(" + INSERT INTO company_functions + (function_name, person_full_name, phone, email, notes, sort_order, is_active, created_at, updated_at) + VALUES + ('RSPP', '', NULL, NULL, NULL, 10, 1, NOW(), NOW()), + ('Medico del lavoro', '', NULL, NULL, NULL, 20, 1, NOW(), NOW()), + ('RLS', '', NULL, NULL, NULL, 30, 1, NOW(), NOW()) + "); + } + + public function down(): void + { + if ($this->hasTable('company_functions')) { + $this->table('company_functions')->drop()->save(); + } + } +} diff --git a/public/userarea/employees.php b/public/userarea/employees.php index 91ea512..4aa32c8 100644 --- a/public/userarea/employees.php +++ b/public/userarea/employees.php @@ -981,6 +981,20 @@ $allSkills = $pdo->query($sqlSkills)->fetchAll(PDO::FETCH_ASSOC); background: #dcfce7; color: #166534; } + + .modal-employee-ppe { + max-width: 95vw; + width: 95vw; + } + + #employeePpeModal .modal-body { + max-height: 78vh; + overflow-y: auto; + } + + #employeePpeModal .modal-content { + border-radius: 18px; + } @@ -1431,7 +1445,7 @@ $allSkills = $pdo->query($sqlSkills)->fetchAll(PDO::FETCH_ASSOC);