Hide participant_role option on choosing 'Also Add' for Event's Schedule Reminder
authormonishdeb <monish.deb@webaccessglobal.com>
Tue, 17 Mar 2015 10:08:07 +0000 (15:38 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Tue, 17 Mar 2015 10:08:07 +0000 (15:38 +0530)
CRM/Admin/Page/AJAX.php
CRM/Core/BAO/ActionSchedule.php
templates/CRM/Admin/Form/ScheduleReminders.tpl

index 3528dbeb2c0ef6143587138659dbdb7dd0de4236..d58398177188fee8e2433ffe1da73a5b9a362678 100644 (file)
@@ -300,7 +300,7 @@ LIMIT $limit";
       CRM_Utils_JSON::output(array('status' => 'error', 'error_msg' => 'required params missing.'));
     }
 
-    $selectionOptions = CRM_Core_BAO_ActionSchedule::getSelection1($_GET['mappingID']);
+    $selectionOptions = CRM_Core_BAO_ActionSchedule::getSelection1($_GET['mappingID'], $_GET['isLimit']);
 
     $output = array(
       'sel4' => array(),
index a194c0ecdcbe7a2c26682ef4fd80bb35b94fca6a..4638e48035b2e1fd7ade317d4361abf0bfa7ac78 100755 (executable)
@@ -266,10 +266,11 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule {
 
   /**
    * @param int $id
+   * @param int $isLimit
    *
    * @return array
    */
-  public static function getSelection1($id = NULL) {
+  public static function getSelection1($id = NULL, $isLimit = NULL) {
     $mapping = self::getMapping($id);
     $sel4 = $sel5 = array();
     $options = array(
@@ -298,8 +299,11 @@ class CRM_Core_BAO_ActionSchedule extends CRM_Core_DAO_ActionSchedule {
           break;
 
         case 'event_contacts':
-          $eventContacts = CRM_Core_OptionGroup::values('event_contacts', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name');
-          $sel5[$id] = $eventContacts + $options;
+          //CRM-15536, don't provide participant_role option on choosing 'Also Include' for Event entity
+          if ($isLimit == 1) {
+            $options += CRM_Core_OptionGroup::values('event_contacts', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name');
+          }
+          $sel5[$id] = $options;
           $recipientMapping += CRM_Core_OptionGroup::values('event_contacts', FALSE, FALSE, FALSE, NULL, 'name', TRUE, FALSE, 'name');
           break;
 
index 868f167ab2a9f5b973b9462b522f8cd6db6bade4..68347d4ddb161cde3b4e8c18e1eba84d6639e2c0 100644 (file)
 
         function buildSelects() {
           var mappingID = $('#entity_0', $form).val();
+          var isLimit = $('#limit_to', $form).val();
 
-          $.getJSON(CRM.url('civicrm/ajax/mapping'), {mappingID: mappingID},
+          $.getJSON(CRM.url('civicrm/ajax/mapping'), {mappingID: mappingID, isLimit: isLimit},
             function (result) {
               CRM.utils.setOptions($('#start_action_date', $form), result.sel4);
               CRM.utils.setOptions($('#end_date', $form), result.sel4);