X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=ext%2Fafform%2Fcore%2FCivi%2FApi4%2FAfform.php;h=0f71813b78497a4ac8111e8bf5109917a8f23ec2;hb=a4934764e309b794d091a3a1448a36b6fe1367e8;hp=9ede4de2d606f8631d32a641ea865c7a6bbe0d7b;hpb=b983f321fb2caadd8e938fb3843f5bc5a50f5b40;p=civicrm-core.git diff --git a/ext/afform/core/Civi/Api4/Afform.php b/ext/afform/core/Civi/Api4/Afform.php index 9ede4de2d6..0f71813b78 100644 --- a/ext/afform/core/Civi/Api4/Afform.php +++ b/ext/afform/core/Civi/Api4/Afform.php @@ -123,8 +123,7 @@ class Afform extends Generic\AbstractEntity { ], [ 'name' => 'type', - 'options' => $self->pseudoconstantOptions('afform_type'), - 'suffixes' => ['id', 'name', 'label', 'icon'], + 'pseudoconstant' => ['optionGroupName' => 'afform_type'], ], [ 'name' => 'requires', @@ -165,6 +164,10 @@ class Afform extends Generic\AbstractEntity { 'tab' => ts('Contact Summary Tab'), ], ], + [ + 'name' => 'icon', + 'description' => 'Icon shown in the contact summary tab', + ], [ 'name' => 'server_route', ], @@ -178,6 +181,11 @@ class Afform extends Generic\AbstractEntity { 'name' => 'create_submission', 'data_type' => 'Boolean', ], + [ + 'name' => 'navigation', + 'data_type' => 'Array', + 'description' => 'Insert into navigation menu {parent: string, label: string, weight: int}', + ], [ 'name' => 'layout', 'data_type' => 'Array', @@ -216,7 +224,7 @@ class Afform extends Generic\AbstractEntity { 'data_type' => 'String', 'description' => 'Name of extension which provides this form', 'readonly' => TRUE, - 'options' => $self->getLoadOptions() ? \CRM_Core_PseudoConstant::getExtensions() : TRUE, + 'pseudoconstant' => ['callback' => ['CRM_Core_PseudoConstant', 'getExtensions']], ]; $fields[] = [ 'name' => 'search_displays', @@ -236,8 +244,8 @@ class Afform extends Generic\AbstractEntity { */ public static function permissions() { return [ - "meta" => ["access CiviCRM"], - "default" => ["administer CiviCRM"], + 'meta' => ['access CiviCRM'], + 'default' => [['administer CiviCRM', 'administer afform']], // These all check form-level permissions 'get' => [], 'getOptions' => [],