-
-
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.
CiviCampaign - Add SearchKit displays to replace Campaign dashboard
- Loading branch information
Showing
11 changed files
with
900 additions
and
1 deletion.
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
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,25 @@ | ||
<div crm-ui-tab-set> | ||
<div af-fieldset crm-ui-tab crm-title="ts('Campaigns')" id="tab-campaigns"> | ||
<fieldset class="af-container af-layout-inline"> | ||
<af-field name="title,description" defn="{label: false, data_type: 'String', input_type: 'Text', name: 'title', input_attrs: {placeholder: 'Filter by title/description'}}" /> | ||
<af-field name="campaign_type_id" defn="{input_attrs: {multiple: true, placeholder: 'Filter by type'}, label: false}" /> | ||
<af-field name="status_id" defn="{input_attrs: {multiple: true, placeholder: 'Filter by status'}, label: false}" /> | ||
</fieldset> | ||
<crm-search-display-table search-name="Administer_Campaigns" display-name="Campaigns_Table" total-count="$parent.count"></crm-search-display-table> | ||
</div> | ||
<div af-fieldset crm-ui-tab crm-title="ts('Surveys')" id="tab-surveys"> | ||
<fieldset class="af-container af-layout-inline"> | ||
<af-field name="title" defn="{label: false, input_attrs: {placeholder: 'Filter by title'}}" /> | ||
<af-field name="activity_type_id" defn="{input_attrs: {multiple: true, placeholder: 'Filter by type'}, label: false}" /> | ||
<af-field name="campaign_id" defn="{label: false, input_attrs: {placeholder: 'Filter by campaign', autoOpen: true}}" /> | ||
</fieldset> | ||
<crm-search-display-table search-name="Administer_Surveys" display-name="Surveys_Table" total-count="$parent.count"></crm-search-display-table> | ||
</div> | ||
<div af-fieldset crm-ui-tab crm-title="ts('Petitions')" id="tab-petitions"> | ||
<fieldset class="af-container af-layout-inline"> | ||
<af-field name="title" defn="{label: false, input_attrs: {placeholder: 'Filter by title'}}" /> | ||
<af-field name="campaign_id" defn="{label: false, input_attrs: {placeholder: 'Filter by campaign', autoOpen: true}}" /> | ||
</fieldset> | ||
<crm-search-display-table search-name="Administer_Petitions" display-name="Petitions_Table" total-count="$parent.count"></crm-search-display-table> | ||
</div> | ||
</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,13 @@ | ||
{ | ||
"type": "search", | ||
"title": "Campaign Dashboard", | ||
"icon": "fa-table", | ||
"server_route": "civicrm/campaign", | ||
"permission": ["administer CiviCampaign", "manage campaign"], | ||
"permission_operator": "OR", | ||
"navigation": { | ||
"parent": "Campaigns", | ||
"label": "Campaign Dashboard", | ||
"weight": -1 | ||
} | ||
} |
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 @@ | ||
<div af-fieldset=""> | ||
<crm-search-display-table search-name="Administer_Survey_Options" display-name="Administer_Survey_Options_Table" filters="{option_group_id: routeParams.option_group_id}"></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,7 @@ | ||
{ | ||
"type": "search", | ||
"title": "", | ||
"icon": "fa-list-alt", | ||
"server_route": "civicrm/survey/option-group", | ||
"permission": "access CiviCRM" | ||
} |
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
212 changes: 212 additions & 0 deletions
212
ext/civi_campaign/managed/SavedSearch_Administer_Campaigns.mgd.php
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,212 @@ | ||
<?php | ||
use CRM_Campaign_ExtensionUtil as E; | ||
|
||
return [ | ||
[ | ||
'name' => 'SavedSearch_Administer_Campaigns', | ||
'entity' => 'SavedSearch', | ||
'cleanup' => 'always', | ||
'update' => 'unmodified', | ||
'params' => [ | ||
'version' => 4, | ||
'values' => [ | ||
'name' => 'Administer_Campaigns', | ||
'label' => E::ts('Administer Campaigns'), | ||
'form_values' => NULL, | ||
'mapping_id' => NULL, | ||
'search_custom_id' => NULL, | ||
'api_entity' => 'Campaign', | ||
'api_params' => [ | ||
'version' => 4, | ||
'select' => [ | ||
'id', | ||
'title', | ||
'description', | ||
'is_active', | ||
'start_date', | ||
'end_date', | ||
'campaign_type_id:label', | ||
'status_id:label', | ||
], | ||
'orderBy' => [], | ||
'where' => [], | ||
'groupBy' => [], | ||
'join' => [], | ||
'having' => [], | ||
], | ||
'expires_date' => NULL, | ||
'description' => NULL, | ||
], | ||
'match' => [ | ||
'name', | ||
], | ||
], | ||
], | ||
[ | ||
'name' => 'SavedSearch_Administer_Campaigns_SearchDisplay_Campaigns_Table', | ||
'entity' => 'SearchDisplay', | ||
'cleanup' => 'always', | ||
'update' => 'unmodified', | ||
'params' => [ | ||
'version' => 4, | ||
'values' => [ | ||
'name' => 'Campaigns_Table', | ||
'label' => E::ts('Administer Campaigns'), | ||
'saved_search_id.name' => 'Administer_Campaigns', | ||
'type' => 'table', | ||
'settings' => [ | ||
'actions' => FALSE, | ||
'limit' => 50, | ||
'classes' => [ | ||
'table', | ||
'table-striped', | ||
], | ||
'pager' => [ | ||
'show_count' => TRUE, | ||
'expose_limit' => TRUE, | ||
'hide_single' => TRUE, | ||
], | ||
'placeholder' => 5, | ||
'sort' => [ | ||
['is_active', 'DESC'], | ||
['title', 'ASC'], | ||
], | ||
'columns' => [ | ||
[ | ||
'type' => 'field', | ||
'key' => 'id', | ||
'dataType' => 'String', | ||
'label' => E::ts('Id'), | ||
'sortable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'title', | ||
'dataType' => 'String', | ||
'label' => E::ts('Title'), | ||
'sortable' => TRUE, | ||
'editable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'description', | ||
'dataType' => 'String', | ||
'label' => E::ts('Description'), | ||
'sortable' => TRUE, | ||
'editable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'start_date', | ||
'dataType' => 'Date', | ||
'label' => E::ts('Start Date'), | ||
'sortable' => TRUE, | ||
'editable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'end_date', | ||
'dataType' => 'Date', | ||
'label' => E::ts('End Date'), | ||
'sortable' => TRUE, | ||
'editable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'campaign_type_id:label', | ||
'dataType' => 'String', | ||
'label' => E::ts('Type'), | ||
'sortable' => TRUE, | ||
'editable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'status_id:label', | ||
'dataType' => 'String', | ||
'label' => E::ts('Status'), | ||
'sortable' => TRUE, | ||
'editable' => TRUE, | ||
], | ||
[ | ||
'type' => 'field', | ||
'key' => 'is_active', | ||
'dataType' => 'Boolean', | ||
'label' => E::ts('Enabled'), | ||
'sortable' => TRUE, | ||
], | ||
[ | ||
'size' => 'btn-xs', | ||
'links' => [ | ||
[ | ||
'path' => '', | ||
'icon' => 'fa-pencil', | ||
'text' => E::ts('Edit'), | ||
'style' => 'default', | ||
'condition' => [], | ||
'entity' => 'Campaign', | ||
'action' => 'update', | ||
'join' => '', | ||
'target' => 'crm-popup', | ||
], | ||
[ | ||
'task' => 'enable', | ||
'entity' => 'Campaign', | ||
'target' => 'crm-popup', | ||
'icon' => 'fa-toggle-on', | ||
'text' => E::ts('Enable'), | ||
'style' => 'default', | ||
'condition' => ['is_active', '=', FALSE], | ||
], | ||
[ | ||
'task' => 'disable', | ||
'entity' => 'Campaign', | ||
'target' => 'crm-popup', | ||
'icon' => 'fa-toggle-off', | ||
'text' => E::ts('Disable'), | ||
'style' => 'default', | ||
'condition' => ['is_active', '=', TRUE], | ||
], | ||
[ | ||
'entity' => 'Campaign', | ||
'action' => 'delete', | ||
'join' => '', | ||
'target' => 'crm-popup', | ||
'icon' => 'fa-trash', | ||
'text' => E::ts('Delete'), | ||
'style' => 'danger small-popup', | ||
'path' => '', | ||
'condition' => [], | ||
], | ||
], | ||
'type' => 'buttons', | ||
'alignment' => 'text-right', | ||
], | ||
], | ||
'toolbar' => [ | ||
[ | ||
'entity' => 'Campaign', | ||
'action' => 'add', | ||
'target' => 'crm-popup', | ||
'icon' => 'fa-plus', | ||
'text' => E::ts('Add Campaign'), | ||
'style' => 'primary', | ||
], | ||
], | ||
'cssRules' => [ | ||
[ | ||
'disabled', | ||
'is_active', | ||
'=', | ||
FALSE, | ||
], | ||
], | ||
], | ||
'acl_bypass' => FALSE, | ||
], | ||
'match' => [ | ||
'name', | ||
'saved_search_id', | ||
], | ||
], | ||
], | ||
]; |
Oops, something went wrong.