feat(helpdesk): refactor multi-tenant BC settings and risk radar improvements

Restructure helpdesk tenant settings into per-connection config with
improved token handling. Update risk radar data endpoint and UI.
Clean up ImageUploadTrait and update architecture contract tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-06 22:22:17 +02:00
parent 1582844b01
commit cacd1fb6d1
20 changed files with 439 additions and 396 deletions

View File

@@ -200,8 +200,8 @@ $rows = array_slice($filtered, $offset, $limit);
// --- Row preparation ---
$stateVariantMap = [
'Offen' => 'primary',
'Open' => 'primary',
'Offen' => 'warning',
'Open' => 'warning',
'In Bearbeitung' => 'warning',
'In Progress' => 'warning',
'Erledigt' => 'success',

View File

@@ -53,7 +53,7 @@ if ($refreshRequested) {
$gateway = app(BcODataGateway::class);
try {
$ticketData = $gateway->getTicketsForRiskRadar();
$ticketData = $gateway->getTicketsForRiskRadar($periodDays);
} catch (\Throwable) {
Router::json(['ok' => false, 'error' => 'Failed to load ticket data']);

View File

@@ -25,7 +25,6 @@ $periodLabels = [
data-label-net-flow="<?php e(t('Net flow')); ?>"
data-label-open-pressure="<?php e(t('Open pressure')); ?>"
data-label-inactivity="<?php e(t('Inactivity')); ?>"
data-label-resolution="<?php e(t('Resolution time')); ?>"
data-label-trend="<?php e(t('Trend')); ?>"
data-label-why="<?php e(t('Why at risk')); ?>"
data-label-open="<?php e(t('open')); ?>"
@@ -66,6 +65,22 @@ $periodLabels = [
<label for="radar-period-<?php e($p); ?>"><?php e($periodLabels[$p]); ?></label>
<?php endforeach; ?>
</div>
<div class="helpdesk-risk-legend">
<ul class="helpdesk-risk-legend-list" aria-label="<?php e(t('Risk score')); ?>">
<li class="helpdesk-risk-legend-item">
<span class="helpdesk-risk-legend-dot helpdesk-risk-level-high" aria-hidden="true"></span>
<span><?php e(t('High risk (55-100)')); ?></span>
</li>
<li class="helpdesk-risk-legend-item">
<span class="helpdesk-risk-legend-dot helpdesk-risk-level-medium" aria-hidden="true"></span>
<span><?php e(t('Medium risk (25-54)')); ?></span>
</li>
<li class="helpdesk-risk-legend-item">
<span class="helpdesk-risk-legend-dot helpdesk-risk-level-low" aria-hidden="true"></span>
<span><?php e(t('Low risk (0-24)')); ?></span>
</li>
</ul>
</div>
</div>
<div id="radar-loading">

View File

@@ -65,12 +65,12 @@ if ($request->isMethod('POST')) {
if (!$errorBag->hasAny()) {
// Handle secrets — only update if new value provided
$tenantBasicPassword = trim((string) ($post['tenant_basic_password'] ?? ''));
if ($tenantBasicPassword !== '' && $tenantBasicPassword !== '********') {
if ($tenantBasicPassword !== '') {
$tenantData['basic_password'] = $tenantBasicPassword;
}
$tenantOauthSecret = trim((string) ($post['tenant_oauth_client_secret'] ?? ''));
if ($tenantOauthSecret !== '' && $tenantOauthSecret !== '********') {
if ($tenantOauthSecret !== '') {
$tenantData['oauth_client_secret'] = $tenantOauthSecret;
}
@@ -80,7 +80,7 @@ if ($request->isMethod('POST')) {
$saved = false;
}
if ($saved) {
$tokenRepository->deleteAll();
$tokenRepository->deleteByTenantId($currentTenantId);
Flash::success(t('Tenant settings saved'), 'helpdesk/settings', 'tenant_settings_saved');
} else {
Flash::error(t('Failed to save tenant settings'), 'helpdesk/settings', 'tenant_settings_error');
@@ -125,14 +125,13 @@ if ($request->isMethod('POST')) {
}
$settingsGateway->setBasicUser($basicUser !== '' ? $basicUser : null);
// Only update password if a new value was provided (not the placeholder)
if ($basicPassword !== '' && $basicPassword !== '********') {
if ($basicPassword !== '') {
$settingsGateway->setBasicPassword($basicPassword);
}
$settingsGateway->setOAuthTenantId($oauthTenantId !== '' ? $oauthTenantId : null);
$settingsGateway->setOAuthClientId($oauthClientId !== '' ? $oauthClientId : null);
if ($oauthClientSecret !== '' && $oauthClientSecret !== '********') {
if ($oauthClientSecret !== '') {
$settingsGateway->setOAuthClientSecret($oauthClientSecret);
}
if ($oauthTokenEndpoint !== '') {

View File

@@ -125,20 +125,26 @@ $tenantIsOAuth2 = $tenantAuthMode === HelpdeskSettingsGateway::AUTH_MODE_OAUTH2;
<?php Session::getCsrfInput(); ?>
<input type="hidden" name="save_target" value="global" id="helpdesk-settings-save-target">
<div class="app-tabs" data-tabs data-app-component="tabs" data-tabs-param="tab" data-tabs-storage-key="helpdesk-settings-tabs-v2">
<div class="app-tabs" data-tabs data-app-component="tabs" data-tabs-param="tab" data-tabs-storage-key="helpdesk-settings-tabs-v3">
<div class="app-tabs-nav">
<button type="button" data-tab="connection" data-tab-default><?php e(t('Connection')); ?></button>
<button type="button" data-tab="auth"><?php e(t('Authentication')); ?></button>
<button type="button" data-tab="automation"><?php e(t('Automation')); ?></button>
<button type="button" data-tab="global" data-tab-default><?php e(t('General connection')); ?></button>
<?php if ($currentTenantId > 0): ?>
<button type="button" data-tab="tenant"><?php e(t('Tenant override')); ?></button>
<button type="button" data-tab="tenant"><?php e(t('Tenant connection')); ?></button>
<?php endif; ?>
<button type="button" data-tab="automation"><?php e(t('Automation')); ?></button>
</div>
<div data-tab-panel="connection" class="helpdesk-settings-panel">
<details class="app-details-card" name="helpdesk-odata" data-details-key="helpdesk-settings-odata" open>
<!-- ═══════════════ GLOBAL TAB ═══════════════ -->
<div data-tab-panel="global" class="helpdesk-settings-panel">
<?php if ($currentTenantId > 0 && $tenantOverrideEnabled): ?>
<div class="notice" data-variant="info" role="status">
<p><?php e(t('The current tenant uses its own configuration. Changes here only affect tenants without a tenant-specific connection.')); ?></p>
</div>
<?php endif; ?>
<details class="app-details-card" name="helpdesk-global-connection" data-details-key="helpdesk-settings-global-connection" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('OData connection')); ?></span>
<span class="app-details-card-summary-title"><?php e(t('Connection')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="app-field" for="odata_base_url">
@@ -167,7 +173,62 @@ $tenantIsOAuth2 = $tenantAuthMode === HelpdeskSettingsGateway::AUTH_MODE_OAUTH2;
</div>
</details>
<details class="app-details-card" name="helpdesk-connection-test" data-details-key="helpdesk-settings-connection-test" open>
<details class="app-details-card" name="helpdesk-global-auth" data-details-key="helpdesk-settings-global-auth" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Authentication')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="app-field" for="auth_mode">
<span><?php e(t('Auth mode')); ?></span>
<select id="auth_mode" name="auth_mode">
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_BASIC); ?>" <?php if (!$isOAuth2): ?>selected<?php endif; ?>>
<?php e(t('Basic Auth')); ?>
</option>
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_OAUTH2); ?>" <?php if ($isOAuth2): ?>selected<?php endif; ?>>
<?php e(t('OAuth2 (client credentials)')); ?>
</option>
</select>
</label>
<div id="helpdesk-basic-auth-fields" class="helpdesk-settings-rule-grid" <?php if ($isOAuth2): ?>hidden<?php endif; ?>>
<label class="app-field" for="basic_user">
<span><?php e(t('Username')); ?></span>
<input type="text" id="basic_user" name="basic_user" value="<?php e($basicUser); ?>" autocomplete="off">
</label>
<label class="app-field" for="basic_password">
<span><?php e(t('Password')); ?></span>
<input type="password" id="basic_password" name="basic_password" value="" placeholder="<?php if ($hasBasicPassword): ?><?php e(t('Saved')); ?><?php endif; ?>" autocomplete="new-password">
<?php if ($hasBasicPassword): ?>
<small><?php e(t('Leave empty to keep current password')); ?></small>
<?php endif; ?>
</label>
</div>
<div id="helpdesk-oauth2-fields" class="helpdesk-settings-rule-grid" <?php if (!$isOAuth2): ?>hidden<?php endif; ?>>
<label class="app-field" for="oauth_tenant_id">
<span><?php e(t('Azure Tenant ID')); ?></span>
<input type="text" id="oauth_tenant_id" name="oauth_tenant_id" value="<?php e($oauthTenantId); ?>" autocomplete="off">
</label>
<label class="app-field" for="oauth_client_id">
<span><?php e(t('Client ID')); ?></span>
<input type="text" id="oauth_client_id" name="oauth_client_id" value="<?php e($oauthClientId); ?>" autocomplete="off">
</label>
<label class="app-field" for="oauth_client_secret">
<span><?php e(t('Client Secret')); ?></span>
<input type="password" id="oauth_client_secret" name="oauth_client_secret" value="" placeholder="<?php if ($hasOAuthClientSecret): ?><?php e(t('Saved')); ?><?php endif; ?>" autocomplete="new-password">
<?php if ($hasOAuthClientSecret): ?>
<small><?php e(t('Leave empty to keep current password')); ?></small>
<?php endif; ?>
</label>
<label class="app-field" for="oauth_token_endpoint">
<span><?php e(t('Token endpoint URL')); ?></span>
<input type="url" id="oauth_token_endpoint" name="oauth_token_endpoint" value="<?php e($oauthTokenEndpoint); ?>" placeholder="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token">
</label>
</div>
</div>
</details>
<details class="app-details-card" name="helpdesk-global-test" data-details-key="helpdesk-settings-global-test" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Connection test')); ?></span>
</summary>
@@ -186,113 +247,110 @@ $tenantIsOAuth2 = $tenantAuthMode === HelpdeskSettingsGateway::AUTH_MODE_OAUTH2;
</details>
</div>
<div data-tab-panel="auth" class="helpdesk-settings-panel">
<details class="app-details-card" name="helpdesk-auth-mode" data-details-key="helpdesk-settings-auth-mode" open>
<!-- ═══════════════ TENANT TAB ═══════════════ -->
<?php if ($currentTenantId > 0): ?>
<div data-tab-panel="tenant" class="helpdesk-settings-panel">
<details class="app-details-card" name="helpdesk-tenant-override" data-details-key="helpdesk-settings-tenant-override" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Authentication')); ?></span>
<span class="app-details-card-summary-title"><?php e(t('Configuration source')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="app-field" for="auth_mode">
<span><?php e(t('Auth mode')); ?></span>
<select id="auth_mode" name="auth_mode">
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_BASIC); ?>" <?php if ($authMode === HelpdeskSettingsGateway::AUTH_MODE_BASIC): ?>selected<?php endif; ?>>
<?php e(t('Basic Auth')); ?>
</option>
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_OAUTH2); ?>" <?php if ($authMode === HelpdeskSettingsGateway::AUTH_MODE_OAUTH2): ?>selected<?php endif; ?>>
<?php e(t('OAuth2 (client credentials)')); ?>
</option>
</select>
<label class="helpdesk-settings-rule">
<input
type="checkbox"
role="switch"
name="override_enabled"
id="helpdesk-override-toggle"
<?php if ($tenantOverrideEnabled): ?>checked<?php endif; ?>
>
<span class="helpdesk-settings-rule-label"><?php e(t('Use tenant-specific configuration')); ?></span>
<small><?php e(t('When enabled, this tenant uses its own BC connection instead of the global configuration.')); ?></small>
</label>
</div>
</details>
<details id="helpdesk-basic-auth-fields" class="app-details-card" name="helpdesk-basic-auth" data-details-key="helpdesk-settings-basic-auth" <?php if ($isOAuth2): ?>hidden<?php else: ?>open<?php endif; ?>>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Basic Auth credentials')); ?></span>
</summary>
<div class="app-details-card-container helpdesk-settings-rule-grid">
<label class="app-field" for="basic_user">
<span><?php e(t('Username')); ?></span>
<input
type="text"
id="basic_user"
name="basic_user"
value="<?php e($basicUser); ?>"
autocomplete="off"
>
</label>
<div id="helpdesk-tenant-fields" <?php if (!$tenantOverrideEnabled): ?>hidden<?php endif; ?>>
<details class="app-details-card" name="helpdesk-tenant-connection" data-details-key="helpdesk-settings-tenant-connection" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Connection')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="app-field" for="tenant_odata_base_url">
<span><?php e(t('OData Base URL')); ?></span>
<input type="url" id="tenant_odata_base_url" name="tenant_odata_base_url" value="<?php e(trim((string) ($tenantRow['odata_base_url'] ?? ''))); ?>" placeholder="https://bc.example.com:7048/BusinessCentral/ODataV4">
</label>
<label class="app-field" for="tenant_company_name">
<span><?php e(t('Company name')); ?></span>
<input type="text" id="tenant_company_name" name="tenant_company_name" value="<?php e(trim((string) ($tenantRow['company_name'] ?? ''))); ?>">
</label>
</div>
</details>
<label class="app-field" for="basic_password">
<span><?php e(t('Password')); ?></span>
<input
type="password"
id="basic_password"
name="basic_password"
value="<?php if ($hasBasicPassword): ?>********<?php endif; ?>"
autocomplete="new-password"
>
<?php if ($hasBasicPassword): ?>
<small><?php e(t('Leave unchanged to keep current password')); ?></small>
<?php endif; ?>
</label>
<details class="app-details-card" name="helpdesk-tenant-auth" data-details-key="helpdesk-settings-tenant-auth" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Authentication')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="app-field" for="tenant_auth_mode">
<span><?php e(t('Auth mode')); ?></span>
<select id="tenant_auth_mode" name="tenant_auth_mode">
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_BASIC); ?>" <?php if (!$tenantIsOAuth2): ?>selected<?php endif; ?>>
<?php e(t('Basic Auth')); ?>
</option>
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_OAUTH2); ?>" <?php if ($tenantIsOAuth2): ?>selected<?php endif; ?>>
<?php e(t('OAuth2 (client credentials)')); ?>
</option>
</select>
</label>
<div id="helpdesk-tenant-basic-auth-fields" class="helpdesk-settings-rule-grid" <?php if ($tenantIsOAuth2): ?>hidden<?php endif; ?>>
<label class="app-field" for="tenant_basic_user">
<span><?php e(t('Username')); ?></span>
<input type="text" id="tenant_basic_user" name="tenant_basic_user" value="<?php e(trim((string) ($tenantRow['basic_user'] ?? ''))); ?>" autocomplete="off">
</label>
<label class="app-field" for="tenant_basic_password">
<span><?php e(t('Password')); ?></span>
<input type="password" id="tenant_basic_password" name="tenant_basic_password" value="" placeholder="<?php if ($tenantHasBasicPassword): ?><?php e(t('Saved')); ?><?php endif; ?>" autocomplete="new-password">
<?php if ($tenantHasBasicPassword): ?>
<small><?php e(t('Leave empty to keep current password')); ?></small>
<?php endif; ?>
</label>
</div>
<div id="helpdesk-tenant-oauth2-fields" class="helpdesk-settings-rule-grid" <?php if (!$tenantIsOAuth2): ?>hidden<?php endif; ?>>
<label class="app-field" for="tenant_oauth_tenant_id">
<span><?php e(t('Azure Tenant ID')); ?></span>
<input type="text" id="tenant_oauth_tenant_id" name="tenant_oauth_tenant_id" value="<?php e(trim((string) ($tenantRow['oauth_tenant_id'] ?? ''))); ?>" autocomplete="off">
</label>
<label class="app-field" for="tenant_oauth_client_id">
<span><?php e(t('Client ID')); ?></span>
<input type="text" id="tenant_oauth_client_id" name="tenant_oauth_client_id" value="<?php e(trim((string) ($tenantRow['oauth_client_id'] ?? ''))); ?>" autocomplete="off">
</label>
<label class="app-field" for="tenant_oauth_client_secret">
<span><?php e(t('Client Secret')); ?></span>
<input type="password" id="tenant_oauth_client_secret" name="tenant_oauth_client_secret" value="" placeholder="<?php if ($tenantHasOAuthSecret): ?><?php e(t('Saved')); ?><?php endif; ?>" autocomplete="new-password">
<?php if ($tenantHasOAuthSecret): ?>
<small><?php e(t('Leave empty to keep current password')); ?></small>
<?php endif; ?>
</label>
<label class="app-field" for="tenant_oauth_token_endpoint">
<span><?php e(t('Token endpoint URL')); ?></span>
<input type="url" id="tenant_oauth_token_endpoint" name="tenant_oauth_token_endpoint" value="<?php e(trim((string) ($tenantRow['oauth_token_endpoint'] ?? ''))); ?>" placeholder="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token">
</label>
</div>
</div>
</details>
</div>
<?php if (!$tenantOverrideEnabled): ?>
<div class="notice" data-variant="info" role="status">
<p><?php e(t('This tenant inherits the global configuration. Enable the toggle above to use tenant-specific settings.')); ?></p>
</div>
</details>
<details id="helpdesk-oauth2-fields" class="app-details-card" name="helpdesk-oauth2-auth" data-details-key="helpdesk-settings-oauth2-auth" <?php if (!$isOAuth2): ?>hidden<?php else: ?>open<?php endif; ?>>
<summary>
<span class="app-details-card-summary-title"><?php e(t('OAuth2 credentials')); ?></span>
</summary>
<div class="app-details-card-container helpdesk-settings-rule-grid">
<label class="app-field" for="oauth_tenant_id">
<span><?php e(t('Azure Tenant ID')); ?></span>
<input
type="text"
id="oauth_tenant_id"
name="oauth_tenant_id"
value="<?php e($oauthTenantId); ?>"
autocomplete="off"
>
</label>
<label class="app-field" for="oauth_client_id">
<span><?php e(t('Client ID')); ?></span>
<input
type="text"
id="oauth_client_id"
name="oauth_client_id"
value="<?php e($oauthClientId); ?>"
autocomplete="off"
>
</label>
<label class="app-field" for="oauth_client_secret">
<span><?php e(t('Client Secret')); ?></span>
<input
type="password"
id="oauth_client_secret"
name="oauth_client_secret"
value="<?php if ($hasOAuthClientSecret): ?>********<?php endif; ?>"
autocomplete="new-password"
>
<?php if ($hasOAuthClientSecret): ?>
<small><?php e(t('Leave unchanged to keep current password')); ?></small>
<?php endif; ?>
</label>
<label class="app-field" for="oauth_token_endpoint">
<span><?php e(t('Token endpoint URL')); ?></span>
<input
type="url"
id="oauth_token_endpoint"
name="oauth_token_endpoint"
value="<?php e($oauthTokenEndpoint); ?>"
placeholder="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token"
>
</label>
</div>
</details>
<?php endif; ?>
</div>
<?php endif; ?>
<!-- ═══════════════ AUTOMATION TAB ═══════════════ -->
<div data-tab-panel="automation" class="helpdesk-settings-panel">
<details class="app-details-card" name="helpdesk-recommendations" data-details-key="helpdesk-settings-recommendations-v2" open>
<summary>
@@ -426,120 +484,6 @@ $tenantIsOAuth2 = $tenantAuthMode === HelpdeskSettingsGateway::AUTH_MODE_OAUTH2;
</div>
</details>
</div>
<?php if ($currentTenantId > 0): ?>
<div data-tab-panel="tenant" class="helpdesk-settings-panel">
<details class="app-details-card" name="helpdesk-tenant-config-source" data-details-key="helpdesk-settings-tenant-source" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Configuration source')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="helpdesk-settings-rule">
<input
type="checkbox"
role="switch"
name="override_enabled"
id="helpdesk-override-toggle"
<?php if ($tenantOverrideEnabled): ?>checked<?php endif; ?>
>
<span class="helpdesk-settings-rule-label"><?php e(t('Use tenant-specific configuration')); ?></span>
<small><?php e(t('When enabled, this tenant uses its own BC connection instead of the global configuration.')); ?></small>
</label>
</div>
</details>
<div id="helpdesk-tenant-fields" <?php if (!$tenantOverrideEnabled): ?>hidden<?php endif; ?>>
<details class="app-details-card" name="helpdesk-tenant-connection" data-details-key="helpdesk-settings-tenant-connection" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Tenant connection')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="app-field" for="tenant_odata_base_url">
<span><?php e(t('OData Base URL')); ?></span>
<input
type="url"
id="tenant_odata_base_url"
name="tenant_odata_base_url"
value="<?php e(trim((string) ($tenantRow['odata_base_url'] ?? ''))); ?>"
placeholder="https://bc.example.com:7048/BusinessCentral/ODataV4"
>
</label>
<label class="app-field" for="tenant_company_name">
<span><?php e(t('Company name')); ?></span>
<input
type="text"
id="tenant_company_name"
name="tenant_company_name"
value="<?php e(trim((string) ($tenantRow['company_name'] ?? ''))); ?>"
>
</label>
</div>
</details>
<details class="app-details-card" name="helpdesk-tenant-auth" data-details-key="helpdesk-settings-tenant-auth" open>
<summary>
<span class="app-details-card-summary-title"><?php e(t('Tenant authentication')); ?></span>
</summary>
<div class="app-details-card-container">
<label class="app-field" for="tenant_auth_mode">
<span><?php e(t('Auth mode')); ?></span>
<select id="tenant_auth_mode" name="tenant_auth_mode">
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_BASIC); ?>" <?php if (!$tenantIsOAuth2): ?>selected<?php endif; ?>>
<?php e(t('Basic Auth')); ?>
</option>
<option value="<?php e(HelpdeskSettingsGateway::AUTH_MODE_OAUTH2); ?>" <?php if ($tenantIsOAuth2): ?>selected<?php endif; ?>>
<?php e(t('OAuth2 (client credentials)')); ?>
</option>
</select>
</label>
<div id="helpdesk-tenant-basic-auth-fields" class="helpdesk-settings-rule-grid" <?php if ($tenantIsOAuth2): ?>hidden<?php endif; ?>>
<label class="app-field" for="tenant_basic_user">
<span><?php e(t('Username')); ?></span>
<input type="text" id="tenant_basic_user" name="tenant_basic_user" value="<?php e(trim((string) ($tenantRow['basic_user'] ?? ''))); ?>" autocomplete="off">
</label>
<label class="app-field" for="tenant_basic_password">
<span><?php e(t('Password')); ?></span>
<input type="password" id="tenant_basic_password" name="tenant_basic_password" value="<?php if ($tenantHasBasicPassword): ?>********<?php endif; ?>" autocomplete="new-password">
<?php if ($tenantHasBasicPassword): ?>
<small><?php e(t('Leave unchanged to keep current password')); ?></small>
<?php endif; ?>
</label>
</div>
<div id="helpdesk-tenant-oauth2-fields" class="helpdesk-settings-rule-grid" <?php if (!$tenantIsOAuth2): ?>hidden<?php endif; ?>>
<label class="app-field" for="tenant_oauth_tenant_id">
<span><?php e(t('Azure Tenant ID')); ?></span>
<input type="text" id="tenant_oauth_tenant_id" name="tenant_oauth_tenant_id" value="<?php e(trim((string) ($tenantRow['oauth_tenant_id'] ?? ''))); ?>" autocomplete="off">
</label>
<label class="app-field" for="tenant_oauth_client_id">
<span><?php e(t('Client ID')); ?></span>
<input type="text" id="tenant_oauth_client_id" name="tenant_oauth_client_id" value="<?php e(trim((string) ($tenantRow['oauth_client_id'] ?? ''))); ?>" autocomplete="off">
</label>
<label class="app-field" for="tenant_oauth_client_secret">
<span><?php e(t('Client Secret')); ?></span>
<input type="password" id="tenant_oauth_client_secret" name="tenant_oauth_client_secret" value="<?php if ($tenantHasOAuthSecret): ?>********<?php endif; ?>" autocomplete="new-password">
<?php if ($tenantHasOAuthSecret): ?>
<small><?php e(t('Leave unchanged to keep current password')); ?></small>
<?php endif; ?>
</label>
<label class="app-field" for="tenant_oauth_token_endpoint">
<span><?php e(t('Token endpoint URL')); ?></span>
<input type="url" id="tenant_oauth_token_endpoint" name="tenant_oauth_token_endpoint" value="<?php e(trim((string) ($tenantRow['oauth_token_endpoint'] ?? ''))); ?>" placeholder="https://login.microsoftonline.com/{tenant}/oauth2/v2.0/token">
</label>
</div>
</div>
</details>
</div>
<?php if (!$tenantOverrideEnabled): ?>
<div class="notice" data-variant="info" role="status">
<p><?php e(t('This tenant inherits the global configuration. Enable the toggle above to use tenant-specific settings.')); ?></p>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
</div>
</form>
</section>

View File

@@ -7,10 +7,10 @@ use MintyPHP\Support\Guard;
Guard::requireLogin();
Guard::requireAbilityOrForbidden(HelpdeskAuthorizationPolicy::ABILITY_TEAM_WORKLOAD);
Buffer::set('title', t('Team dashboard'));
Buffer::set('title', t('Team workload'));
Buffer::set('style_groups', json_encode(['helpdesk']));
$breadcrumbs = [
['label' => t('Home'), 'path' => 'admin'],
['label' => t('Helpdesk'), 'path' => 'helpdesk'],
['label' => t('Team dashboard')],
['label' => t('Team workload')],
];

View File

@@ -39,7 +39,7 @@ $periodLabels = [
<section>
<?php
$titlebar = [
'title' => t('Team dashboard'),
'title' => t('Team workload'),
'actions' => [
[
'label' => t('Refresh data'),