forked from fa/breadcrumb-the-shire
feat(helpdesk): add Domains list page with BC OData contract type enrichment
Add a new "Domains" page to the helpdesk module that fetches domain data from the FS_Contract_Domains OData endpoint and enriches each domain with its contract type (PI_Header_Type) by joining with FS_Contract_Lines_Test where Type = 'Domain'. New files: - domains/index().php, index(default).phtml, filter-schema.php — list page - domains-data().php — data endpoint with PHP-side filtering/sorting - helpdesk-domains-index.js — Grid.js via initStandardListPage() Gateway additions: - listDomains() — fetch all contract domains - listDomainContractLines() — fetch domain-type contract lines for type lookup Sidebar restructured into three collapsible groups (Lookup, Monitoring, Administration) with per-group icons and color coding, matching the core admin panel pattern. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@ class BcODataGateway
|
||||
public const ENTITY_TICKET_LOG_LV = 'PBI_LV_SupportTicketLog';
|
||||
public const ENTITY_CONTRACT_LINES = 'FS_Contract_Lines_Test';
|
||||
public const ENTITY_MEETINGS = 'FS_Debitor_Meetings';
|
||||
public const ENTITY_CONTRACT_DOMAINS = 'FS_Contract_Domains';
|
||||
|
||||
private const CONNECT_TIMEOUT = 10;
|
||||
private const REQUEST_TIMEOUT = 30;
|
||||
@@ -825,6 +826,57 @@ class BcODataGateway
|
||||
return $this->extractODataValues($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all contract domains.
|
||||
*
|
||||
* Fetches all domains from the FS_Contract_Domains entity.
|
||||
* Filtering, sorting and pagination are handled PHP-side by the caller.
|
||||
*
|
||||
* @return array<int, array<string, mixed>>
|
||||
*/
|
||||
public function listDomains(): array
|
||||
{
|
||||
$select = 'No,Customer_No,Customer_Name,URL,State,Administration';
|
||||
$url = $this->settingsGateway->buildEntityUrl(self::ENTITY_CONTRACT_DOMAINS)
|
||||
. '?$top=5000'
|
||||
. '&$select=' . rawurlencode($select)
|
||||
. '&$orderby=' . rawurlencode('Customer_Name asc');
|
||||
|
||||
$response = $this->request('GET', $url);
|
||||
if ($response === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $this->extractODataValues($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all contract lines of type "Domain".
|
||||
*
|
||||
* Returns contract line metadata for domain-type lines,
|
||||
* keyed by DNS number (No field). Used to enrich the domain
|
||||
* list with contract type information (PI_Header_Type).
|
||||
*
|
||||
* @return array<int, array<string, mixed>>
|
||||
*/
|
||||
public function listDomainContractLines(): array
|
||||
{
|
||||
$filter = "Type eq 'Domain'";
|
||||
$select = 'No,Header_No,PI_Header_Type,PI_Header_Description,PI_Header_State,Line_State';
|
||||
$url = $this->settingsGateway->buildEntityUrl(self::ENTITY_CONTRACT_LINES)
|
||||
. '?$filter=' . rawurlencode($filter)
|
||||
. '&$top=5000'
|
||||
. '&$select=' . rawurlencode($select)
|
||||
. '&$orderby=' . rawurlencode('No asc');
|
||||
|
||||
$response = $this->request('GET', $url);
|
||||
if ($response === null) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $this->extractODataValues($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a single ticket by ticket number.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user