Add staff visibility workstation enrollment registration vault and category task views
This commit is contained in:
@@ -513,7 +513,7 @@ def _safe_employee_return_url(value: str | None, fallback: str) -> str:
|
||||
|
||||
|
||||
@router.get("")
|
||||
def employees_list(request: Request, q: str = "", include_inactive: str | None = None, link_status: str = "all"):
|
||||
def employees_list(request: Request, q: str = "", include_inactive: str | None = None, link_status: str = "all", status: str | None = None):
|
||||
db = CommonSessionLocal()
|
||||
try:
|
||||
current_user = get_current_user(request, db=db)
|
||||
@@ -527,12 +527,19 @@ def employees_list(request: Request, q: str = "", include_inactive: str | None =
|
||||
branch_id = request.session.get("active_branch_id")
|
||||
scope = build_employee_scope(db, current_user, tenant_id=tenant_id, branch_id=branch_id)
|
||||
normalized_link_status = link_status if link_status in ("all", "linked", "unlinked") else "all"
|
||||
requested_status = (status or "").strip().lower()
|
||||
if requested_status not in {"all", "active", "inactive", "relieved"}:
|
||||
requested_status = "all" if (scope.is_firm_admin or scope.is_partner or scope.is_system_admin) else "active"
|
||||
# Keep the legacy include_inactive query string working for bookmarked URLs.
|
||||
if include_inactive and status is None:
|
||||
requested_status = "all"
|
||||
rows = list_employees(
|
||||
db,
|
||||
scope,
|
||||
q=q,
|
||||
include_inactive=bool(include_inactive),
|
||||
include_inactive=(requested_status == "all"),
|
||||
link_status=normalized_link_status,
|
||||
status_filter=requested_status,
|
||||
)
|
||||
link_summary = get_employee_user_link_summary(db, scope)
|
||||
return _render(
|
||||
@@ -543,7 +550,8 @@ def employees_list(request: Request, q: str = "", include_inactive: str | None =
|
||||
title="Employees",
|
||||
rows=rows,
|
||||
q=q,
|
||||
include_inactive=bool(include_inactive),
|
||||
include_inactive=(requested_status == "all"),
|
||||
selected_status=requested_status,
|
||||
link_status=normalized_link_status,
|
||||
link_summary=link_summary,
|
||||
scope=scope,
|
||||
|
||||
Reference in New Issue
Block a user