BranchOfficersCell
extends Cell
in package
View cell for displaying branch officers with hierarchical office organization.
Provides officer assignment interface with permission-based management, deputy relationships, and organizational structure visualization.
Tags
Table of Contents
Properties
- $_validCellOptions : array<string, mixed>
- $pluginData : array<string|int, mixed>
- $validRoutes : array<string|int, mixed>
Methods
- display() : void
- Display branch officers with hierarchical office tree and assignment permissions.
- initialize() : void
- buildOfficeTree() : array<string|int, mixed>
- Build hierarchical office tree with permission-based filtering.
Properties
$_validCellOptions
protected
array<string, mixed>
$_validCellOptions
= []
$pluginData
protected
static array<string|int, mixed>
$pluginData
= ['type' => \App\Services\ViewCellRegistry::PLUGIN_TYPE_TAB, 'label' => 'Officers', 'id' => 'branch-officers', 'order' => 1, 'tabBtnBadge' => null, 'cell' => 'Officers.BranchOfficers']
$validRoutes
protected
static array<string|int, mixed>
$validRoutes
= [['controller' => 'Branches', 'action' => 'view', 'plugin' => null]]
Methods
display()
Display branch officers with hierarchical office tree and assignment permissions.
public
display(int $id) : void
Builds office hierarchy filtered by branch type, validates user assignment permissions, and generates email addresses from branch/department domains.
Parameters
- $id : int
-
Branch ID for officer display
Return values
void —Sets 'id', 'offices', 'newOfficer' for template
initialize()
public
initialize() : void
buildOfficeTree()
Build hierarchical office tree with permission-based filtering.
private
buildOfficeTree(array<string|int, mixed> $offices, object $branch, bool $hireAll, array<string|int, mixed> $myOffices, array<string|int, mixed> $canHireOffices[, int|null $office_id = null ]) : array<string|int, mixed>
Recursively constructs office hierarchy including deputy relationships, validates user permissions, and generates email addresses from domains.
Parameters
- $offices : array<string|int, mixed>
-
Array of office entities
- $branch : object
-
Branch entity for domain resolution
- $hireAll : bool
-
User has global assignment authority
- $myOffices : array<string|int, mixed>
-
User's current office IDs
- $canHireOffices : array<string|int, mixed>
-
Office IDs user can assign to
- $office_id : int|null = null
-
Parent office ID for recursion (null for root)
Return values
array<string|int, mixed> —Hierarchical office tree sorted alphabetically