From afc0cd72d586cb48a01bac5dcd9b069a5adb850b Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 19 Dec 2019 08:28:58 -0500 Subject: [PATCH] GUI - dropdown select for permissions field --- ext/afform/gui/afform_gui.php | 9 +++++++++ ext/afform/gui/ang/afGuiEditor/config-form.html | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ext/afform/gui/afform_gui.php b/ext/afform/gui/afform_gui.php index e55d0815e2..5abf1c18b1 100644 --- a/ext/afform/gui/afform_gui.php +++ b/ext/afform/gui/afform_gui.php @@ -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) . ';'; } diff --git a/ext/afform/gui/ang/afGuiEditor/config-form.html b/ext/afform/gui/ang/afGuiEditor/config-form.html index 60c43dab4b..8b602aee31 100644 --- a/ext/afform/gui/ang/afGuiEditor/config-form.html +++ b/ext/afform/gui/ang/afGuiEditor/config-form.html @@ -13,4 +13,4 @@ - + -- 2.25.1