fixed employess job roles navbar

This commit is contained in:
2026-06-05 10:45:34 +02:00
parent b1f2bb60e3
commit 6dd13e5d7d
4 changed files with 145 additions and 5 deletions
@@ -0,0 +1,95 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class CreateCompanyFunctionsTable extends AbstractMigration
{
public function up(): void
{
if (!$this->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();
}
}
}
+15 -1
View File
@@ -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;
}
</style>
</head>
@@ -1431,7 +1445,7 @@ $allSkills = $pdo->query($sqlSkills)->fetchAll(PDO::FETCH_ASSOC);
<!-- EMPLOYEE PPE MODAL -->
<div class="modal fade" id="employeePpeModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
<div class="modal-dialog modal-employee-ppe modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header" style="background-color:#cfe3ff;">
<div>
+10
View File
@@ -289,6 +289,16 @@
<i class='bx bx-radio-circle'></i>Dipendenti
</a>
</li>
<li>
<a href="job-roles.php">
<i class='bx bx-radio-circle'></i>Mansioni
</a>
</li>
<li>
<a href="ppe-items.php">
<i class='bx bx-radio-circle'></i>DPI
</a>
</li>
<?php endif; ?>
<?php if (userCan('hr.departments.view')) : ?>
+25 -4
View File
@@ -544,6 +544,17 @@ $subRolesByRoleJson = json_encode($subRolesByRole, $jsonFlags);
transition: all 0.2s ease-in-out;
}
.btn-sec-action {
background: #f8a407;
color: #000000;
border: 1px solid #ffc400;
border-radius: 10px;
font-weight: 700;
padding: 9px 16px;
box-shadow: 0 5px 14px rgba(37, 99, 235, 0.22);
transition: all 0.2s ease-in-out;
}
.btn-main-action:hover {
color: #ffffff;
background: #1d4ed8;
@@ -596,6 +607,12 @@ $subRolesByRoleJson = json_encode($subRolesByRole, $jsonFlags);
text-align: center;
}
#tabJobRoles th:nth-child(2),
#tabJobRoles td:nth-child(2) {
width: 240px;
max-width: 280px;
}
#tabJobRoles th:nth-child(3),
#tabJobRoles td:nth-child(3) {
width: 130px;
@@ -610,7 +627,7 @@ $subRolesByRoleJson = json_encode($subRolesByRole, $jsonFlags);
#tabJobRoles th:nth-child(5),
#tabJobRoles td:nth-child(5) {
width: 260px;
width: 230px;
text-align: center;
}
@@ -639,9 +656,9 @@ $subRolesByRoleJson = json_encode($subRolesByRole, $jsonFlags);
.role-description {
color: #64748b;
font-size: 0.86rem;
font-size: 0.82rem;
margin-top: 2px;
max-width: 850px;
max-width: 220px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -855,6 +872,10 @@ $subRolesByRoleJson = json_encode($subRolesByRole, $jsonFlags);
</div>
<div class="d-flex gap-2">
<button type="button" class="btn btn-sec-action" id="btnOpenPpeItems" onclick="location.href='ppe-items.php'">
Lista DPI
</button>
<button type="button" class="btn back-dashboard" onclick="history.back();">
↩️ Indietro
</button>
@@ -970,7 +991,7 @@ $subRolesByRoleJson = json_encode($subRolesByRole, $jsonFlags);
class="btn btn-sm btn-outline-success action-btn btnOpenCreateSubRole"
data-role-id="<?= $roleId; ?>"
data-role-name="<?= htmlspecialchars($role['name'], ENT_QUOTES, 'UTF-8'); ?>">
+ Sotto
+ SottoMansione
</button>
<button type="button"