Replace old team system with work teams (equipos de trabajo)

- New migration 003_teams.sql: teams, team_user, team_server tables
- New Team model with CRUD, members, and server assignment
- New TeamController with full team management
- New views: teams/index, teams/create, teams/show
- Server model: getUserRole and getAccessibleServerIds now include team-based access
- Sidebar: Teams link under Administration (admin+ only)
- Routes: old /team routes removed, new /teams routes added
- Removed old ServerController team methods and views
- Fixed sidebar empty accessible IDs returning all servers
- Fixed dashboard and API to show empty when no accessible servers
This commit is contained in:
2026-06-07 07:08:26 -04:00
parent 5f5de248c6
commit 5607a3e507
14 changed files with 941 additions and 418 deletions

36
views/teams/create.php Normal file
View File

@@ -0,0 +1,36 @@
<div class="page-header">
<div class="page-header-left">
<div class="back-link">
<a href="/teams"><i class="fas fa-arrow-left"></i> Back to Teams</a>
</div>
<h1 class="page-title">Create Team</h1>
<p class="page-subtitle">Create a work team to manage server access</p>
</div>
</div>
<div class="card">
<div class="card-body">
<form method="POST" action="/teams/create" class="form" style="max-width:600px">
<input type="hidden" name="_csrf_token" value="<?= $this->csrfToken() ?>">
<div class="form-group">
<label for="name">Team Name *</label>
<input type="text" id="name" name="name" class="form-input"
placeholder="e.g., DevOps, Developers, Support" required>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea id="description" name="description" class="form-input" rows="3"
placeholder="Optional description of the team"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">
<i class="fas fa-save"></i> Create Team
</button>
<a href="/teams" class="btn btn-secondary">Cancel</a>
</div>
</form>
</div>
</div>