-
-
Notifications
You must be signed in to change notification settings - Fork 825
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So far this extension replaces 2 screns with SearchDisplay Afforms: - Custom field groups - Custom fields
- Loading branch information
Showing
12 changed files
with
1,275 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# civicrm_admin_ui | ||
|
||
Enable this extension for some screens under "Administer CiviCRM" to be configurable SearchKit displays. |
15 changes: 15 additions & 0 deletions
15
ext/civicrm_admin_ui/ang/afsearchAdminCustomFields.aff.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div af-fieldset=""> | ||
<div class="af-markup"> | ||
<div class="form-inline"> | ||
<a class="btn btn-primary" target="crm-popup" ng-href="{{ crmUrl('civicrm/admin/custom/group/field/add', {gid: routeParams.gid, reset: 1}) }}"> | ||
<i class="crm-i fa-plus-circle"></i> | ||
{{:: ts('Add Field') }} | ||
</a> | ||
<a class="btn btn-secondary" ng-href="{{ crmUrl('civicrm/admin/custom/group') }}"> | ||
<i class="crm-i fa-times"></i> | ||
{{:: ts('Done') }} | ||
</a> | ||
</div> | ||
</div> | ||
<crm-search-display-table search-name="Administer_Custom_Fields" display-name="Table" filters="{custom_group_id: routeParams.gid}"></crm-search-display-table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "search", | ||
"requires": [], | ||
"title": "Fields", | ||
"description": "Administer custom fields list", | ||
"server_route": "civicrm/admin/custom/group/fields", | ||
"permission": "administer CiviCRM data" | ||
} |
15 changes: 15 additions & 0 deletions
15
ext/civicrm_admin_ui/ang/afsearchAdminCustomGroups.aff.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div af-fieldset=""> | ||
<div class="af-markup"> | ||
<div class="help"> | ||
{{:: ts('Custom data is stored in custom fields. Custom fields are organized into logically related custom data sets (e.g. Volunteer Info). Use custom fields to collect and store custom data which are not included in the standard CiviCRM forms. You can create one or many sets of custom fields.') }} | ||
<a href="https://docs.civicrm.org/user/en/latest/organising-your-data/creating-custom-fields" target="_blank" class="crm-doc-link no-popup">{{:: ts('Learn more...') }}</a> | ||
</div> | ||
<div> | ||
<a class="btn btn-primary" ng-href="{{:: crmUrl('civicrm/admin/custom/group/edit', {reset: 1}) }}"> | ||
<i class="crm-i fa-plus-circle"></i> | ||
{{:: ts('Add Set of Custom Fields') }} | ||
</a> | ||
</div> | ||
</div> | ||
<crm-search-display-table search-name="Administer_Custom_Groups" display-name="Table"></crm-search-display-table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "search", | ||
"requires": [], | ||
"title": "Custom Field Groups", | ||
"description": "Administer custom field groups list", | ||
"server_route": "civicrm/admin/custom/group", | ||
"permission": "administer CiviCRM data" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<?php | ||
|
||
// AUTO-GENERATED FILE -- Civix may overwrite any changes made to this file | ||
|
||
/** | ||
* The ExtensionUtil class provides small stubs for accessing resources of this | ||
* extension. | ||
*/ | ||
class CRM_CivicrmAdminUi_ExtensionUtil { | ||
const SHORT_NAME = 'civicrm_admin_ui'; | ||
const LONG_NAME = 'civicrm_admin_ui'; | ||
const CLASS_PREFIX = 'CRM_CivicrmAdminUi'; | ||
|
||
/** | ||
* Translate a string using the extension's domain. | ||
* | ||
* If the extension doesn't have a specific translation | ||
* for the string, fallback to the default translations. | ||
* | ||
* @param string $text | ||
* Canonical message text (generally en_US). | ||
* @param array $params | ||
* @return string | ||
* Translated text. | ||
* @see ts | ||
*/ | ||
public static function ts($text, $params = []) { | ||
if (!array_key_exists('domain', $params)) { | ||
$params['domain'] = [self::LONG_NAME, NULL]; | ||
} | ||
return ts($text, $params); | ||
} | ||
|
||
/** | ||
* Get the URL of a resource file (in this extension). | ||
* | ||
* @param string|NULL $file | ||
* Ex: NULL. | ||
* Ex: 'css/foo.css'. | ||
* @return string | ||
* Ex: 'http://example.org/sites/default/ext/org.example.foo'. | ||
* Ex: 'http://example.org/sites/default/ext/org.example.foo/css/foo.css'. | ||
*/ | ||
public static function url($file = NULL) { | ||
if ($file === NULL) { | ||
return rtrim(CRM_Core_Resources::singleton()->getUrl(self::LONG_NAME), '/'); | ||
} | ||
return CRM_Core_Resources::singleton()->getUrl(self::LONG_NAME, $file); | ||
} | ||
|
||
/** | ||
* Get the path of a resource file (in this extension). | ||
* | ||
* @param string|NULL $file | ||
* Ex: NULL. | ||
* Ex: 'css/foo.css'. | ||
* @return string | ||
* Ex: '/var/www/example.org/sites/default/ext/org.example.foo'. | ||
* Ex: '/var/www/example.org/sites/default/ext/org.example.foo/css/foo.css'. | ||
*/ | ||
public static function path($file = NULL) { | ||
// return CRM_Core_Resources::singleton()->getPath(self::LONG_NAME, $file); | ||
return __DIR__ . ($file === NULL ? '' : (DIRECTORY_SEPARATOR . $file)); | ||
} | ||
|
||
/** | ||
* Get the name of a class within this extension. | ||
* | ||
* @param string $suffix | ||
* Ex: 'Page_HelloWorld' or 'Page\\HelloWorld'. | ||
* @return string | ||
* Ex: 'CRM_Foo_Page_HelloWorld'. | ||
*/ | ||
public static function findClass($suffix) { | ||
return self::CLASS_PREFIX . '_' . str_replace('\\', '_', $suffix); | ||
} | ||
|
||
} | ||
|
||
use CRM_CivicrmAdminUi_ExtensionUtil as E; | ||
|
||
/** | ||
* (Delegated) Implements hook_civicrm_config(). | ||
* | ||
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config | ||
*/ | ||
function _civicrm_admin_ui_civix_civicrm_config(&$config = NULL) { | ||
static $configured = FALSE; | ||
if ($configured) { | ||
return; | ||
} | ||
$configured = TRUE; | ||
|
||
$template =& CRM_Core_Smarty::singleton(); | ||
|
||
$extRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR; | ||
$extDir = $extRoot . 'templates'; | ||
|
||
if (is_array($template->template_dir)) { | ||
array_unshift($template->template_dir, $extDir); | ||
} | ||
else { | ||
$template->template_dir = [$extDir, $template->template_dir]; | ||
} | ||
|
||
$include_path = $extRoot . PATH_SEPARATOR . get_include_path(); | ||
set_include_path($include_path); | ||
} | ||
|
||
/** | ||
* (Delegated) Implements hook_civicrm_entityTypes(). | ||
* | ||
* Find any *.entityType.php files, merge their content, and return. | ||
* | ||
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes | ||
*/ | ||
function _civicrm_admin_ui_civix_civicrm_entityTypes(&$entityTypes) { | ||
$entityTypes = array_merge($entityTypes, []); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
require_once 'civicrm_admin_ui.civix.php'; | ||
// phpcs:disable | ||
use CRM_CivicrmAdminUi_ExtensionUtil as E; | ||
// phpcs:enable | ||
|
||
/** | ||
* Implements hook_civicrm_config(). | ||
* | ||
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_config/ | ||
*/ | ||
function civicrm_admin_ui_civicrm_config(&$config) { | ||
_civicrm_admin_ui_civix_civicrm_config($config); | ||
} | ||
|
||
/** | ||
* Implements hook_civicrm_entityTypes(). | ||
* | ||
* Declare entity types provided by this module. | ||
* | ||
* @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_entityTypes | ||
*/ | ||
function civicrm_admin_ui_civicrm_entityTypes(&$entityTypes) { | ||
_civicrm_admin_ui_civix_civicrm_entityTypes($entityTypes); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0"?> | ||
<extension key="civicrm_admin_ui" type="module"> | ||
<file>civicrm_admin_ui</file> | ||
<name>CiviCRM Administration UI</name> | ||
<description>Administration screens for managing CiviCRM settings, options, custom data, etc.</description> | ||
<license>AGPL-3.0</license> | ||
<maintainer> | ||
<author>Coleman Watts</author> | ||
<email>[email protected]</email> | ||
</maintainer> | ||
<urls> | ||
<url desc="Main Extension Page">http://FIXME</url> | ||
<url desc="Documentation">http://FIXME</url> | ||
<url desc="Support">http://FIXME</url> | ||
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url> | ||
</urls> | ||
<releaseDate>2022-01-02</releaseDate> | ||
<version>1.0</version> | ||
<develStage>alpha</develStage> | ||
<compatibility> | ||
<ver>5.47</ver> | ||
</compatibility> | ||
<requires> | ||
<ext>org.civicrm.search_kit</ext> | ||
<ext>org.civicrm.afform</ext> | ||
</requires> | ||
<comments>Replaces legacy pages with configurable Search Display Forms.</comments> | ||
<classloader> | ||
<psr4 prefix="Civi\" path="Civi"/> | ||
</classloader> | ||
<civix> | ||
<namespace>CRM/CivicrmAdminUi</namespace> | ||
<angularModule>crmCivicrmAdminUi</angularModule> | ||
</civix> | ||
<mixins> | ||
<mixin>[email protected]</mixin> | ||
</mixins> | ||
</extension> |
Oops, something went wrong.