Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21100 Hotfix to ensure that testGroup list is still the same as p… #10895

Merged
merged 1 commit into from
Aug 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CRM/Mailing/Info.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ public function getAngularModules() {
'options' => array('limit' => 0),
'sequential' => 1,
);

$groupNames = civicrm_api3('Group', 'get', $params + array(
'is_active' => 1,
'check_permissions' => TRUE,
'return' => array('title', 'visibility', 'group_type', 'is_hidden'),
));
$headerfooterList = civicrm_api3('MailingComponent', 'get', $params + array(
'is_active' => 1,
'return' => array('name', 'component_type', 'is_default', 'body_html', 'body_text'),
Expand Down Expand Up @@ -130,6 +134,8 @@ public function getAngularModules() {
'civiMails' => array(),
'campaignEnabled' => in_array('CiviCampaign', $config->enableComponents),
'groupNames' => array(),
// @todo see if we can remove this by dynamically generating the test group list
'testGroupNames' => $groupNames['values'],
'headerfooterList' => $headerfooterList['values'],
'mesTemplate' => $mesTemplate['values'],
'emailAdd' => $emailAdd['values'],
Expand Down
2 changes: 1 addition & 1 deletion ang/crmMailing/BlockPreview.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
ui-jq="crmSelect2"
ui-options="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Select Group')}"
ng-model="testGroup.gid"
ng-options="group.id as group.title for group in crmMailingConst.groupNames|orderBy:'title'"
ng-options="group.id as group.title for group in crmMailingConst.testGroupNames|orderBy:'title'"
class="crm-action-menu fa-envelope-o"
>
<option value=""></option>
Expand Down
2 changes: 1 addition & 1 deletion ang/crmMailing/BlockPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
scope.previewTestGroup = function(e) {
var $dialog = $(this);
$dialog.html('<div class="crm-loading-element"></div>').parent().find('button[data-op=yes]').prop('disabled', true);
$dialog.dialog('option', 'title', ts('Send to %1', {1: _.pluck(_.where(scope.crmMailingConst.groupNames, {id: scope.testGroup.gid}), 'title')[0]}));
$dialog.dialog('option', 'title', ts('Send to %1', {1: _.pluck(_.where(scope.crmMailingConst.testGroupNames, {id: scope.testGroup.gid}), 'title')[0]}));
CRM.api3('contact', 'get', {
group: scope.testGroup.gid,
options: {limit: 0},
Expand Down