namespace Civi\Api4\Action\Entity;
use Civi\Api4\CustomGroup;
+use Civi\Api4\Service\Schema\Joinable\CustomGroupJoinable;
/**
* Get the names & docblocks of all APIv4 entities.
->execute();
foreach ($customEntities as $customEntity) {
$fieldName = 'Custom_' . $customEntity['name'];
+ $baseEntity = '\Civi\Api4\\' . CustomGroupJoinable::getEntityFromExtends($customEntity['extends']);
$entities[$fieldName] = [
'name' => $fieldName,
'title' => $customEntity['title'],
- 'description' => 'Custom group - extends ' . $customEntity['extends'],
+ 'titlePlural' => $customEntity['title'],
+ 'description' => ts('Custom group for %1', [1 => $baseEntity::getInfo()['titlePlural']]),
'see' => [
'https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields/#multiple-record-fieldsets',
'\\Civi\\Api4\\CustomGroup',
if ($loadOptions) {
$entity['optionsLoaded'] = TRUE;
}
- // Because multivalue custom pseudo-entities don't have titlePlural
- $entity['titlePlural'] = $entity['titlePlural'] ?? $entity['title'];
$entity['fields'] = civicrm_api4($entity['name'], 'getFields', [
'select' => $getFields,
'where' => [['permission', 'IS NULL']],
<hr />
<div class="buttons pull-right">
<button type="button" ng-click="$ctrl.cancel()" class="btn btn-danger">{{:: ts('Cancel') }}</button>
- <button ng-click="$ctrl.save()" class="btn btn-primary" ng-disabled="!$ctrl.values.length">{{:: ts('Update %1 %2', {1: model.ids.length, 2: $ctrl.entity.title}) }}</button>
+ <button ng-click="$ctrl.save()" class="btn btn-primary" ng-disabled="!$ctrl.values.length">{{:: ts('Update %1 %2', {1: model.ids.length, 2: (model.ids.length === 1 ? $ctrl.entity.title : $ctrl.entity.titlePlural)}) }}</button>
</div>
</div>
</div>