chg: [auditlog] Smarter title

pull/7927/head
Jakub Onderka 2021-11-05 21:44:19 +01:00
parent f1fb476879
commit fb448b0f76
1 changed files with 8 additions and 6 deletions

View File

@ -131,15 +131,17 @@ class AuditLog extends AppModel
if (in_array($auditLog['model'], ['Attribute', 'Object', 'ShadowAttribute'], true)) {
$modelName = $auditLog['model'] === 'ShadowAttribute' ? 'Proposal' : $auditLog['model'];
$title = __('%s from Event #%s', $modelName, $auditLog['event_id']);
} else if ($auditLog['model'] === 'SystemSetting') {
$title = $auditLog['model'];
} else {
$title = "{$auditLog['model']} #{$auditLog['model_id']}";
}
if (isset($auditLog['model_title']) && $auditLog['model_title']) {
$title .= ": {$auditLog['model_title']}";
if (isset($title)) {
$title .= ": {$auditLog['model_title']}";
return $title;
} else {
return $auditLog['model_title'];
}
}
return $title;
return '';
}
/**