From ed04ceeb4e6b41273da5da129bd7b2bde6693d99 Mon Sep 17 00:00:00 2001 From: Jitendra Purohit Date: Wed, 6 Dec 2017 16:14:28 +0530 Subject: [PATCH] js fix and naming modification --- CRM/Admin/Form/Preferences.php | 8 ++---- CRM/Admin/Form/Preferences/Display.php | 14 ++++------- settings/Core.setting.php | 21 +++++++--------- .../CRM/Admin/Form/Preferences/Display.tpl | 25 ++++++++----------- 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/CRM/Admin/Form/Preferences.php b/CRM/Admin/Form/Preferences.php index 1bd8a4dd011c..43d1455dd46d 100644 --- a/CRM/Admin/Form/Preferences.php +++ b/CRM/Admin/Form/Preferences.php @@ -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; @@ -276,7 +273,6 @@ public function postProcessCommon() { case 'text': case 'select': - case 'advmultiselect': case 'radio': case 'YesNo': case 'entity_reference': diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index caea94d95ce0..86b63f2fa79e 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -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, ), ), diff --git a/settings/Core.setting.php b/settings/Core.setting.php index 81158731e81a..a205b161fb4a 100644 --- a/settings/Core.setting.php +++ b/settings/Core.setting.php @@ -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', ), ); diff --git a/templates/CRM/Admin/Form/Preferences/Display.tpl b/templates/CRM/Admin/Form/Preferences/Display.tpl index 7591ca7e87c3..7efd5cfcf1be 100644 --- a/templates/CRM/Admin/Form/Preferences/Display.tpl +++ b/templates/CRM/Admin/Form/Preferences/Display.tpl @@ -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} - - - {$form.filter_activity_type_notification.label} - {$form.filter_activity_type_notification.html} + + {$form.do_not_notify_assignees_for.label} + {$form.do_not_notify_assignees_for.html} - +   - {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} - {$form.activity_assignee_notification_ics.html} {$form.activity_assignee_notification_ics.label} @@ -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}';