Commit 119bd37e authored by colemanw's avatar colemanw
Browse files

GUI - dropdown select for permissions field

parent 6c02a06e
......@@ -222,6 +222,15 @@ function afform_gui_civicrm_buildAsset($asset, $params, &$mimeType, &$content) {
'danger' => ts('Danger'),
];
$data['permissions'] = [];
foreach (CRM_Core_Permission::basicPermissions(TRUE, TRUE) as $name => $perm) {
$data['permissions'][] = [
'id' => $name,
'text' => $perm[0],
'description' => $perm[1] ?? NULL,
];
}
$mimeType = 'text/javascript';
$content = "CRM.afformAdminData=" . json_encode($data, JSON_UNESCAPED_SLASHES) . ';';
}
......@@ -13,4 +13,4 @@
<label for="af_config_form_permission">
{{ ts('Permission:') }}
</label>
<input ng-model="afform.permission" class="form-control" id="af_config_form_permission" />
<input ng-model="afform.permission" class="form-control" id="af_config_form_permission" crm-ui-select="{data: editor.meta.permissions, placeholder: ts('Open access')}" />
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment