Skip to content

Commit

Permalink
js fix and naming modification
Browse files Browse the repository at this point in the history
  • Loading branch information
Jitendra Purohit committed Dec 6, 2017
1 parent 95a718e commit 45995c1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 42 deletions.
2 changes: 1 addition & 1 deletion CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,7 @@ protected function processActivity(&$params) {
$mailStatus = '';

if (Civi::settings()->get('activity_assignee_notification')
&& !in_array($activity->activity_type_id, Civi::settings()->get('filter_activity_type_notification'))) {
&& !in_array($activity->activity_type_id, Civi::settings()->get('do_not_notify_assignees_for'))) {
$activityIDs = array($activity->id);
if ($followupActivity) {
$activityIDs = array_merge($activityIDs, array($followupActivity->id));
Expand Down
8 changes: 2 additions & 6 deletions CRM/Admin/Form/Preferences.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,11 @@ public function buildQuickForm() {
$this->addElement('select',
$fieldName,
$fieldValue['title'],
$fieldValue['option_values']
$fieldValue['option_values'],
CRM_Utils_Array::value('attributes', $fieldValue)
);
break;

case 'advmultiselect':
$this->addElement('advmultiselect', $fieldName, $fieldValue['title'], $fieldValue['options'], $fieldValue['attributes']);
break;

case 'wysiwyg':
$this->add('wysiwyg', $fieldName, $fieldValue['title'], $fieldValue['attributes']);
break;
Expand Down Expand Up @@ -276,7 +273,6 @@ public function postProcessCommon() {

case 'text':
case 'select':
case 'advmultiselect':
case 'radio':
case 'YesNo':
case 'entity_reference':
Expand Down
14 changes: 5 additions & 9 deletions CRM/Admin/Form/Preferences/Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,11 @@ public function preProcess() {
'title' => ts('Enable Popup Forms'),
'weight' => 13,
),
'filter_activity_type_notification' => array(
'html_type' => 'advmultiselect',
'options' => $optionValues,
'attributes' => array(
'size' => 5,
'style' => 'width:150px',
'class' => 'advmultiselect',
),
'title' => ts('Blocked Activity Types.'),
'do_not_notify_assignees_for' => array(
'html_type' => 'select',
'option_values' => $optionValues,
'attributes' => array('multiple' => 1, "class" => "huge crm-select2"),
'title' => ts('Do not notify assignees for'),
'weight' => 14,
),
),
Expand Down
21 changes: 9 additions & 12 deletions settings/Core.setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -967,27 +967,24 @@
'description' => 'When enabled, any filter settings a user selects on the contact\'s Activity tab will be remembered as they visit other contacts',
'help_text' => NULL,
),
'filter_activity_type_notification' => array(
'group_name' => 'Filter Activity Type Notification',
'do_not_notify_assignees_for' => array(
'group_name' => 'CiviCRM Preferences',
'group' => 'core',
'name' => 'filter_activity_type_notification',
'name' => 'do_not_notify_assignees_for',
'type' => 'Array',
'add' => '4.7',
'is_domain' => 1,
'is_contact' => 0,
'default' => array(),
'description' => 'Select Activity types to disable assignee notifications.',
'title' => 'Filter Activity Type Notification',
'help_text' => '',
'html_type' => 'advmultiselect',
'title' => 'Do not notify assignees for',
'help_text' => 'These activity types will be excluded from automated email notifications to assignees.',
'html_type' => 'Select',
'html_attributes' => array(
'size' => 5,
'style' => 'width:150px',
'class' => 'advmultiselect',
'multiple' => 1,
'class' => 'huge crm-select2',
),
'pseudoconstant' => array(
'optionGroupName' => 'activity_type',
),
'quick_form_type' => 'Element',
'quick_form_type' => 'Select',
),
);
25 changes: 11 additions & 14 deletions templates/CRM/Admin/Form/Preferences/Display.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,16 @@
{ts}When enabled, contacts who are assigned activities will automatically receive an email notification with a copy of the activity.{/ts}
</td>
</tr>

<tr id="filter_activity_type_notification" class="crm-preferences-display-form-block-filter_activity_type_notification">
<td class="label">{$form.filter_activity_type_notification.label}</td>
<td>{$form.filter_activity_type_notification.html}</td>
<tr class="crm-preferences-display-form-activity_types">
<td class="label">{$form.do_not_notify_assignees_for.label}</td>
<td>{$form.do_not_notify_assignees_for.html}</td>
</tr>
<tr id="filter_activity_type_notification-desc" class="crm-preferences-display-form-block-description">
<tr class="crm-preferences-display-form-activity_types">
<td>&nbsp;</td>
<td class="description">
{ts}Selected activity types will not be included in notifying the assignees.{/ts}
{ts}These activity types will be excluded from automated email notifications to assignees.{/ts}
</td>
</tr>

<tr class="crm-preferences-display-form-block-activity_assignee_notification_ics">
<td class="label"></td>
<td>{$form.activity_assignee_notification_ics.html} {$form.activity_assignee_notification_ics.label}</td>
Expand Down Expand Up @@ -240,15 +238,14 @@
}

//show/hide activity types based on checkbox value
$('#filter_activity_type_notification').hide();
$('#filter_activity_type_notification-desc').hide();
if ($('#activity_assignee_notification').is(":checked")) {
$('#filter_activity_type_notification').show();
$('#filter_activity_type_notification-desc').show();
$('.crm-preferences-display-form-activity_types').show();
}
else {
$('.crm-preferences-display-form-activity_types').hide();
}
$('#activity_assignee_notification').change(function() {
$('#filter_activity_type_notification').toggle();
$('#filter_activity_type_notification-desc').toggle();
$('#activity_assignee_notification').click(function() {
$('.crm-preferences-display-form-activity_types').toggle($('#activity_assignee_notification').is(":checked"));
});

var invoicesKey = '{/literal}{$invoicesKey}{literal}';
Expand Down

0 comments on commit 45995c1

Please sign in to comment.