Merge branch '4.4' into master
[civicrm-core.git] / CRM / Admin / Form / ScheduleReminders.php
index f047fc26411c48ba20395420dcff939e17ac0f78..1c5cbb67d2247762aeae279466d594ff59fb4bce 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
  | Copyright (C) 2011 Marty Wright                                    |
  | Licensed to CiviCRM under the Academic Free License version 3.0.   |
@@ -29,7 +29,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
  * $Id$
  *
  */
@@ -212,13 +212,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
     $recipientListing->setMultiple(TRUE);
     $this->add('hidden', 'is_recipient_listing', empty($recipientListingOptions) ? FALSE : TRUE, array('id' => 'is_recipient_listing'));
 
-    //token input url
-    $tokenUrl = CRM_Utils_System::url('civicrm/ajax/checkemail',
-      'noemail=1',
-      FALSE, NULL, FALSE
-    );
-    $this->assign('tokenUrl', $tokenUrl);
-    $this->add('text', 'recipient_manual_id', ts('Manual Recipients'));
+    $this->addEntityRef('recipient_manual_id', ts('Manual Recipients'), array('multiple' => TRUE, 'create' => TRUE));
 
     $this->addElement(
       'select',
@@ -313,14 +307,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
       }
       elseif (!empty($defaults['recipient_manual'])) {
         $defaults['recipient'] = 'manual';
-        $recipients = array();
-        foreach (explode(',', $defaults['recipient_manual']) as $cid) {
-          $recipients[$cid] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact',
-            $cid,
-            'sort_name'
-          );
-        }
-        $this->assign('recipients', $recipients);
+        $defaults['recipient_manual_id'] = $defaults['recipient_manual'];
       }
     }