From a8fb0f1d0b139e88c548367b67d670fe4c98e3ff Mon Sep 17 00:00:00 2001 From: colemanw Date: Sat, 2 Sep 2023 20:52:19 -0400 Subject: [PATCH] CiviCampaign - Add SearchKit displays to replace Campaign dashboard --- CRM/Campaign/DAO/Survey.php | 13 +- .../ang/afsearchCampaignDashboard.aff.html | 25 ++ .../ang/afsearchCampaignDashboard.aff.php | 16 + .../ang/afsearchSurveyOptionGroup.aff.html | 3 + .../ang/afsearchSurveyOptionGroup.aff.php | 10 + ext/civi_campaign/info.xml | 1 + .../SavedSearch_Administer_Campaigns.mgd.php | 205 ++++++++++++ .../SavedSearch_Administer_Petitions.mgd.php | 218 +++++++++++++ ...edSearch_Administer_Survey_Options.mgd.php | 101 ++++++ .../SavedSearch_Administer_Surveys.mgd.php | 303 ++++++++++++++++++ xml/schema/Campaign/Survey.xml | 5 + 11 files changed, 899 insertions(+), 1 deletion(-) create mode 100644 ext/civi_campaign/ang/afsearchCampaignDashboard.aff.html create mode 100644 ext/civi_campaign/ang/afsearchCampaignDashboard.aff.php create mode 100644 ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.html create mode 100644 ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.php create mode 100644 ext/civi_campaign/managed/SavedSearch_Administer_Campaigns.mgd.php create mode 100644 ext/civi_campaign/managed/SavedSearch_Administer_Petitions.mgd.php create mode 100644 ext/civi_campaign/managed/SavedSearch_Administer_Survey_Options.mgd.php create mode 100644 ext/civi_campaign/managed/SavedSearch_Administer_Surveys.mgd.php diff --git a/CRM/Campaign/DAO/Survey.php b/CRM/Campaign/DAO/Survey.php index cbf590c943..8343227f38 100644 --- a/CRM/Campaign/DAO/Survey.php +++ b/CRM/Campaign/DAO/Survey.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Campaign/Survey.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:754f9a2e62e86ff340afea563b561dec) + * (GenCodeChecksum:b517a686715877b8cde6af69122dcc0d) */ /** @@ -45,6 +45,17 @@ class CRM_Campaign_DAO_Survey extends CRM_Core_DAO { */ public static $_log = FALSE; + /** + * Paths for accessing this entity in the UI. + * + * @var string[] + */ + protected static $_paths = [ + 'add' => 'civicrm/survey/add?reset=1', + 'update' => 'civicrm/survey/configure/main?reset=1&action=update&id=[id]', + 'delete' => 'civicrm/survey/delete?reset=1&id=[id]', + ]; + /** * Survey id. * diff --git a/ext/civi_campaign/ang/afsearchCampaignDashboard.aff.html b/ext/civi_campaign/ang/afsearchCampaignDashboard.aff.html new file mode 100644 index 0000000000..b429bdd539 --- /dev/null +++ b/ext/civi_campaign/ang/afsearchCampaignDashboard.aff.html @@ -0,0 +1,25 @@ +
+
+
+ + + +
+ +
+
+
+ + + +
+ +
+
+
+ + +
+ +
+
diff --git a/ext/civi_campaign/ang/afsearchCampaignDashboard.aff.php b/ext/civi_campaign/ang/afsearchCampaignDashboard.aff.php new file mode 100644 index 0000000000..2134c1f285 --- /dev/null +++ b/ext/civi_campaign/ang/afsearchCampaignDashboard.aff.php @@ -0,0 +1,16 @@ + 'search', + 'title' => E::ts('Campaign Dashboard'), + 'icon' => 'fa-table', + 'server_route' => 'civicrm/campaign', + 'permission' => ['administer CiviCampaign', 'manage campaign'], + 'permission_operator' => 'OR', + 'navigation' => [ + 'parent' => 'Campaigns', + 'label' => E::ts('Campaign Dashboard'), + 'weight' => -1, + ], +]; diff --git a/ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.html b/ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.html new file mode 100644 index 0000000000..999b0d2469 --- /dev/null +++ b/ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.html @@ -0,0 +1,3 @@ +
+ +
diff --git a/ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.php b/ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.php new file mode 100644 index 0000000000..7f5a56948f --- /dev/null +++ b/ext/civi_campaign/ang/afsearchSurveyOptionGroup.aff.php @@ -0,0 +1,10 @@ + 'search', + 'title' => '', + 'icon' => 'fa-list-alt', + 'server_route' => 'civicrm/survey/option-group', + 'permission' => ['access CiviCRM'], +]; diff --git a/ext/civi_campaign/info.xml b/ext/civi_campaign/info.xml index bdbdcaa6ed..0bb2e5872e 100644 --- a/ext/civi_campaign/info.xml +++ b/ext/civi_campaign/info.xml @@ -29,6 +29,7 @@ scan-classes@1.0.0 + mgd-php@1.0.0 CRM/Campaign diff --git a/ext/civi_campaign/managed/SavedSearch_Administer_Campaigns.mgd.php b/ext/civi_campaign/managed/SavedSearch_Administer_Campaigns.mgd.php new file mode 100644 index 0000000000..fa6f5fbe19 --- /dev/null +++ b/ext/civi_campaign/managed/SavedSearch_Administer_Campaigns.mgd.php @@ -0,0 +1,205 @@ + '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' => FALSE, + 'expose_limit' => TRUE, + 'hide_single' => TRUE, + ], + 'placeholder' => 5, + 'sort' => [ + ['is_active', 'DESC'], + ['title', 'ASC'], + ], + 'columns' => [ + [ + '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', + ], + ], + ], +]; diff --git a/ext/civi_campaign/managed/SavedSearch_Administer_Petitions.mgd.php b/ext/civi_campaign/managed/SavedSearch_Administer_Petitions.mgd.php new file mode 100644 index 0000000000..fa36a617cf --- /dev/null +++ b/ext/civi_campaign/managed/SavedSearch_Administer_Petitions.mgd.php @@ -0,0 +1,218 @@ + 'SavedSearch_Administer_Petitions', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Administer_Petitions', + 'label' => E::ts('Administer Petitions'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'Survey', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'title', + 'campaign_id:label', + 'is_active', + 'is_default', + ], + 'orderBy' => [], + 'where' => [ + ['activity_type_id:name', '=', 'Petition'], + ], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'SavedSearch_Administer_Petitions_SearchDisplay_Petitions_Table', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Petitions_Table', + 'label' => E::ts('Administer Petitions'), + 'saved_search_id.name' => 'Administer_Petitions', + 'type' => 'table', + 'settings' => [ + 'actions' => FALSE, + 'limit' => 50, + 'classes' => [ + 'table', + 'table-striped', + ], + 'pager' => [ + 'show_count' => FALSE, + 'expose_limit' => TRUE, + 'hide_single' => TRUE, + ], + 'placeholder' => 5, + 'sort' => [ + ['is_active', 'DESC'], + ['title', 'ASC'], + ], + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'title', + 'dataType' => 'String', + 'label' => E::ts('Title'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'campaign_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Survey'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'is_default', + 'dataType' => 'Boolean', + 'label' => E::ts('Default'), + 'sortable' => TRUE, + 'rewrite' => ' ', + 'icons' => [ + [ + 'icon' => 'fa-check-square-o', + 'side' => 'left', + 'if' => [ + 'is_default', + '=', + TRUE, + ], + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'is_active', + 'dataType' => 'Boolean', + 'label' => E::ts('Enabled'), + 'sortable' => TRUE, + ], + [ + 'size' => 'btn-xs', + 'type' => 'buttons', + 'alignment' => 'text-right', + 'links' => [ + [ + 'path' => 'civicrm/petition/add?reset=1&action=update&id=[id]', + 'icon' => 'fa-pencil', + 'text' => E::ts('Edit'), + 'style' => 'default', + 'condition' => [], + 'target' => 'crm-popup', + ], + [ + 'task' => 'enable', + 'entity' => 'Survey', + 'target' => 'crm-popup', + 'icon' => 'fa-toggle-on', + 'text' => E::ts('Enable'), + 'style' => 'default', + 'condition' => ['is_active', '=', FALSE], + ], + [ + 'task' => 'disable', + 'entity' => 'Survey', + 'target' => 'crm-popup', + 'icon' => 'fa-toggle-off', + 'text' => E::ts('Disable'), + 'style' => 'default', + 'condition' => ['is_active', '=', TRUE], + ], + [ + 'entity' => 'Survey', + 'action' => 'delete', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger small-popup', + 'path' => '', + 'condition' => [], + ], + ], + ], + [ + 'text' => E::ts('Signatures'), + 'style' => 'default', + 'size' => 'btn-xs', + 'icon' => 'fa-bars', + 'type' => 'menu', + 'alignment' => 'text-right', + 'links' => [ + [ + 'path' => 'civicrm/petition/sign?reset=1&sid=[id]', + 'icon' => 'fa-clipboard', + 'text' => E::ts('Sign'), + 'style' => 'default', + 'condition' => [], + 'target' => '_blank', + ], + [ + 'path' => 'civicrm/activity/search?force=1&survey=[id]', + 'icon' => 'fa-list-alt', + 'text' => E::ts('View Signatures'), + 'style' => 'default', + 'condition' => [], + 'target' => '_blank', + ], + ], + ], + ], + 'toolbar' => [ + [ + 'path' => 'civicrm/petition/add?reset=1', + 'text' => E::ts('Add Petition'), + 'target' => 'crm-popup', + 'icon' => 'fa-plus', + 'style' => 'primary', + 'condition' => [ + 'check user permission', + 'CONTAINS', + ['administer CiviCampaign', 'manage campaign'], + ], + ], + ], + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + 'acl_bypass' => FALSE, + ], + 'match' => [ + 'name', + 'saved_search_id', + ], + ], + ], +]; diff --git a/ext/civi_campaign/managed/SavedSearch_Administer_Survey_Options.mgd.php b/ext/civi_campaign/managed/SavedSearch_Administer_Survey_Options.mgd.php new file mode 100644 index 0000000000..6615e54374 --- /dev/null +++ b/ext/civi_campaign/managed/SavedSearch_Administer_Survey_Options.mgd.php @@ -0,0 +1,101 @@ + 'SavedSearch_Administer_Survey_Options', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Administer_Survey_Options', + 'label' => E::ts('Administer Survey Options'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'OptionValue', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'label', + 'value', + 'filter', + ], + 'orderBy' => [], + 'where' => [], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'SavedSearch_Administer_Survey_Options_SearchDisplay_Administer_Survey_Options_Table', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Administer_Survey_Options_Table', + 'label' => E::ts('Administer Survey Options'), + 'saved_search_id.name' => 'Administer_Survey_Options', + 'type' => 'table', + 'settings' => [ + 'description' => NULL, + 'sort' => [], + 'limit' => 50, + 'actions' => FALSE, + 'classes' => [ + 'table', + 'table-striped', + ], + 'draggable' => 'weight', + 'pager' => [ + 'hide_single' => TRUE, + ], + 'placeholder' => 5, + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'label', + 'dataType' => 'String', + 'label' => E::ts('Label'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'value', + 'dataType' => 'String', + 'label' => E::ts('Value'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'filter', + 'dataType' => 'Integer', + 'label' => E::ts('Recontact Interval'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + ], + ], + 'acl_bypass' => FALSE, + ], + 'match' => [ + 'name', + 'saved_search_id', + ], + ], + ], +]; diff --git a/ext/civi_campaign/managed/SavedSearch_Administer_Surveys.mgd.php b/ext/civi_campaign/managed/SavedSearch_Administer_Surveys.mgd.php new file mode 100644 index 0000000000..98eafea940 --- /dev/null +++ b/ext/civi_campaign/managed/SavedSearch_Administer_Surveys.mgd.php @@ -0,0 +1,303 @@ + 'SavedSearch_Administer_Surveys', + 'entity' => 'SavedSearch', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Administer_Surveys', + 'label' => E::ts('Administer Surveys'), + 'form_values' => NULL, + 'mapping_id' => NULL, + 'search_custom_id' => NULL, + 'api_entity' => 'Survey', + 'api_params' => [ + 'version' => 4, + 'select' => [ + 'id', + 'title', + 'campaign_id:label', + 'activity_type_id:label', + 'release_frequency', + 'default_number_of_contacts', + 'max_number_of_contacts', + 'is_active', + 'is_default', + 'result_id:label', + ], + 'orderBy' => [], + 'where' => [ + ['activity_type_id:name', '!=', 'Petition'], + ], + 'groupBy' => [], + 'join' => [], + 'having' => [], + ], + 'expires_date' => NULL, + 'description' => NULL, + ], + 'match' => [ + 'name', + ], + ], + ], + [ + 'name' => 'SavedSearch_Administer_Surveys_SearchDisplay_Surveys_Table', + 'entity' => 'SearchDisplay', + 'cleanup' => 'always', + 'update' => 'unmodified', + 'params' => [ + 'version' => 4, + 'values' => [ + 'name' => 'Surveys_Table', + 'label' => E::ts('Administer Surveys'), + 'saved_search_id.name' => 'Administer_Surveys', + 'type' => 'table', + 'settings' => [ + 'actions' => FALSE, + 'limit' => 50, + 'classes' => [ + 'table', + 'table-striped', + ], + 'pager' => [ + 'show_count' => FALSE, + 'expose_limit' => TRUE, + 'hide_single' => TRUE, + ], + 'placeholder' => 5, + 'sort' => [ + ['is_active', 'DESC'], + ['title', 'ASC'], + ], + 'columns' => [ + [ + 'type' => 'field', + 'key' => 'title', + 'dataType' => 'String', + 'label' => E::ts('Title'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'campaign_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Survey'), + 'sortable' => TRUE, + 'editable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'activity_type_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Type'), + 'sortable' => TRUE, + 'editable' => TRUE, + 'icons' => [ + [ + 'field' => 'activity_type_id:icon', + 'side' => 'left', + ], + ], + ], + [ + 'type' => 'field', + 'key' => 'release_frequency', + 'dataType' => 'Integer', + 'label' => E::ts('Release Frequency'), + 'sortable' => TRUE, + 'empty_value' => '', + 'rewrite' => '[release_frequency] Days', + ], + [ + 'type' => 'field', + 'key' => 'default_number_of_contacts', + 'dataType' => 'Integer', + 'label' => E::ts('Reserve Each Time'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'max_number_of_contacts', + 'dataType' => 'Integer', + 'label' => E::ts('Total Reserve'), + 'sortable' => TRUE, + ], + [ + 'type' => 'field', + 'key' => 'result_id:label', + 'dataType' => 'Integer', + 'label' => E::ts('Result Set'), + 'sortable' => TRUE, + 'link' => [ + 'path' => 'civicrm/survey/option-group#?option_group_id=[result_id]', + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => 'crm-popup', + ], + 'empty_value' => E::ts('Incomplete'), + 'cssRules' => [ + [ + 'bg-danger', + 'result_id:label', + 'IS EMPTY', + ], + ], + 'rewrite' => E::ts('View Options'), + 'icons' => [], + ], + [ + 'type' => 'field', + 'key' => 'is_default', + 'dataType' => 'Boolean', + 'label' => E::ts('Default'), + 'sortable' => TRUE, + 'rewrite' => ' ', + 'icons' => [ + [ + 'icon' => 'fa-check-square-o', + 'side' => 'left', + 'if' => [ + 'is_default', + '=', + 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' => 'Survey', + 'action' => 'update', + 'join' => '', + 'target' => '', + ], + [ + 'task' => 'enable', + 'entity' => 'Survey', + 'target' => 'crm-popup', + 'icon' => 'fa-toggle-on', + 'text' => E::ts('Enable'), + 'style' => 'default', + 'condition' => ['is_active', '=', FALSE], + ], + [ + 'task' => 'disable', + 'entity' => 'Survey', + 'target' => 'crm-popup', + 'icon' => 'fa-toggle-off', + 'text' => E::ts('Disable'), + 'style' => 'default', + 'condition' => ['is_active', '=', TRUE], + ], + [ + 'entity' => 'Survey', + 'action' => 'delete', + 'join' => '', + 'target' => 'crm-popup', + 'icon' => 'fa-trash', + 'text' => E::ts('Delete'), + 'style' => 'danger small-popup', + 'path' => '', + 'condition' => [], + ], + ], + 'type' => 'buttons', + 'alignment' => 'text-right', + ], + [ + 'text' => E::ts('Respondents'), + 'style' => 'default', + 'size' => 'btn-xs', + 'icon' => 'fa-bars', + 'type' => 'menu', + 'alignment' => 'text-right', + 'links' => [ + [ + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '_blank', + 'icon' => 'fa-user-plus', + 'text' => E::ts('Reserve'), + 'style' => 'default', + 'path' => 'civicrm/survey/search?sid=[id]&reset=1&op=reserve', + 'task' => '', + 'condition' => [], + ], + [ + 'path' => 'civicrm/survey/search?sid=[id]&reset=1&op=interview&force=1', + 'icon' => 'fa-clipboard', + 'text' => E::ts('Interview'), + 'style' => 'default', + 'condition' => [], + 'task' => '', + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '_blank', + ], + [ + 'path' => 'civicrm/survey/search?sid=[id]&reset=1&op=release&force=1', + 'icon' => 'fa-user-times', + 'text' => E::ts('Release'), + 'style' => 'default', + 'condition' => [], + 'task' => '', + 'entity' => '', + 'action' => '', + 'join' => '', + 'target' => '_blank', + ], + ], + ], + ], + 'toolbar' => [ + [ + 'entity' => 'Survey', + 'action' => 'add', + 'target' => 'crm-popup', + 'icon' => 'fa-plus', + 'text' => E::ts('Add Survey'), + 'style' => 'primary', + ], + ], + 'cssRules' => [ + [ + 'disabled', + 'is_active', + '=', + FALSE, + ], + ], + ], + 'acl_bypass' => FALSE, + ], + 'match' => [ + 'name', + 'saved_search_id', + ], + ], + ], +]; diff --git a/xml/schema/Campaign/Survey.xml b/xml/schema/Campaign/Survey.xml index 8a2fe3627c..5bbd296b44 100644 --- a/xml/schema/Campaign/Survey.xml +++ b/xml/schema/Campaign/Survey.xml @@ -8,6 +8,11 @@ fa-clipboard title CiviCampaign + + civicrm/survey/add?reset=1 + civicrm/survey/configure/main?reset=1&action=update&id=[id] + civicrm/survey/delete?reset=1&id=[id] + id Survey ID -- 2.25.1