add username edit to users page

This commit is contained in:
mahdahar 2026-01-22 07:34:19 +07:00
parent 02762bb355
commit 7ee5332edf
4 changed files with 8 additions and 44 deletions

2
.gitignore vendored
View File

@ -125,4 +125,4 @@ _modules/*
/results/ /results/
/phpunit*.xml /phpunit*.xml
.roo/ .venv/

View File

@ -1,27 +1,15 @@
# Project Checklist: Glen RME & Lab Management System # Project Checklist: Glen RME & Lab Management System
**Last Updated:** January 19, 2026 **Last Updated:** January 21, 2026
**Source:** PROJECT_BACKLOG.md
--- ---
## P0 - Critical (Access Control & Security)
_Must be completed first to ensure basic process flow is correct._
- [ ] **T-002:** Hide/Disable 'Validation' button after 2nd validation - [ ] **T-002:** Hide/Disable 'Validation' button after 2nd validation
- Prevent redundant validation actions - Prevent redundant validation actions
- [ ] **T-003:** Restrict Print/Save-to-PDF to CS Role only - [ ] **T-003:** Restrict Print/Save-to-PDF to CS Role only
- Lab can only preview, CS can print/save - Lab can only preview, CS can print/save
- [X] **T-004:** Update User Role levels - [X] **T-004:** Update User Role levels
- Standardize roles: Superuser, Admin, Lab, Phlebo, CS - Standardize roles: Superuser, Admin, Lab, Phlebo, CS
---
## P1 - High (Dashboard & UI Improvements)
_Features that improve speed and correctness of lab operations._
- [X] **T-005:** Role-Based Dashboard Filtering - [X] **T-005:** Role-Based Dashboard Filtering
- Filter by patient_status or service_type (Klinik+Lab vs Lab Only) - Filter by patient_status or service_type (Klinik+Lab vs Lab Only)
- [ ] **T-006:** Create Clinical Patients Dashboard - [ ] **T-006:** Create Clinical Patients Dashboard
@ -38,13 +26,6 @@ _Features that improve speed and correctness of lab operations._
- Log unvalidation actions with timestamp, user ID, and reason - Log unvalidation actions with timestamp, user ID, and reason
- [ ] **T-013:** Enhanced Patient Detail Logging - [ ] **T-013:** Enhanced Patient Detail Logging
- Track: Sample Collection Time, Sample Received Time, Print History - Track: Sample Collection Time, Sample Received Time, Print History
---
## P2 - Medium (Maintenance & UX)
_UI improvements and backend optimizations._
- [ ] **T-014:** Add Dedicated Print Button - [ ] **T-014:** Add Dedicated Print Button
- Trigger browser/system print dialog - Trigger browser/system print dialog
- [ ] **T-015:** Add Error Handling for Preview Button - [ ] **T-015:** Add Error Handling for Preview Button
@ -57,30 +38,13 @@ _UI improvements and backend optimizations._
- Verify API integration: GDC_cmod, GDC_CS2, Report2 - Verify API integration: GDC_cmod, GDC_CS2, Report2
- [X] **T-018: Delayed** Dashboard Performance - [X] **T-018: Delayed** Dashboard Performance
- When getting data more than 100 rows, it load too slow. - When getting data more than 100 rows, it load too slow.
- Answer : Its Alpine Limitation, later will create pagination for dashboard.
---
## P3 - Onsite / Onprem Tasks
- [ ] **T-010:** Update PDF Report Metadata - [ ] **T-010:** Update PDF Report Metadata
- Replace 'Printed By' with validating user's name - Replace 'Printed By' with validating user's name
- Add 'Finish Validation' status per sample - Add 'Finish Validation' status per sample
---
## Quick Progress Summary
| Priority | Total | Completed |
|----------|-------|-----------|
| P0 - Critical | 4 | 0 |
| P1 - High | 9 | 0 |
| P2 - Medium | 4 | 0 |
| **Total** | **17** | **0** |
--- ---
## Legend ## Legend
- Tasks are ordered by priority (P0 → P1 → P2)
- Check items as you complete them - Check items as you complete them
- Refer to PROJECT_BACKLOG.md for detailed technical specifications - Refer to PROJECT_BACKLOG.md for detailed technical specifications

View File

@ -71,6 +71,7 @@ class UsersController extends BaseController
{ {
$input = $this->request->getJSON(true); $input = $this->request->getJSON(true);
$userid = $input['userid']; $userid = $input['userid'];
$username = $input['username'];
$userroleid = $input['userroleid']; $userroleid = $input['userroleid'];
$password = $input['password']; $password = $input['password'];
$password_2 = $input['password_2']; $password_2 = $input['password_2'];
@ -83,8 +84,7 @@ class UsersController extends BaseController
$hashedPassword = password_hash($password, PASSWORD_DEFAULT); $hashedPassword = password_hash($password, PASSWORD_DEFAULT);
$sqlUpdate = " $sqlUpdate = "
UPDATE gdc_cmod.dbo.USERS UPDATE gdc_cmod.dbo.USERS
SET USERROLEID = ?, SET USERROLEID = ?, PASSWORD = ?, USERNAME = ?
PASSWORD = ?
WHERE USERID = ? WHERE USERID = ?
"; ";
$fullUpdate = true; $fullUpdate = true;
@ -92,7 +92,7 @@ class UsersController extends BaseController
} else { } else {
$sqlUpdate = " $sqlUpdate = "
UPDATE gdc_cmod.dbo.USERS UPDATE gdc_cmod.dbo.USERS
SET USERROLEID = ? SET USERROLEID = ?, USERNAME = ?
WHERE USERID = ? WHERE USERID = ?
"; ";
$fullUpdate = false; $fullUpdate = false;
@ -102,9 +102,9 @@ class UsersController extends BaseController
try { try {
if ($fullUpdate) { if ($fullUpdate) {
$this->db->query($sqlUpdate, [$userroleid, $hashedPassword, $userid]); $this->db->query($sqlUpdate, [$userroleid, $hashedPassword, $username, $userid]);
} else { } else {
$this->db->query($sqlUpdate, [$userroleid, $userid]); $this->db->query($sqlUpdate, [$userroleid, $username, $userid]);
} }
$this->db->transCommit(); $this->db->transCommit();

View File

@ -129,7 +129,7 @@
<label class="label"> <label class="label">
<span class="label-text font-medium text-base-content/70">Username</span> <span class="label-text font-medium text-base-content/70">Username</span>
</label> </label>
<label class="input input-bordered flex items-center gap-2 focus-within:input-primary transition-all"> <label class="input input-bordered w-full flex items-center gap-2 focus-within:input-primary transition-all">
<i class="fa fa-user text-base-content/40"></i> <i class="fa fa-user text-base-content/40"></i>
<input type="text" class="grow font-mono" x-model="form.username" placeholder="e.g. john.doe" /> <input type="text" class="grow font-mono" x-model="form.username" placeholder="e.g. john.doe" />
</label> </label>