Added entity ref to scheduled reminders manual recipient select and removed autocomplete
authorMaggie <maggie.epps@gmail.com>
Thu, 1 May 2014 23:37:46 +0000 (19:37 -0400)
committerMaggie <maggie.epps@gmail.com>
Thu, 1 May 2014 23:37:46 +0000 (19:37 -0400)
CRM/Event/Form/ManageEvent/ScheduleReminders.php
templates/CRM/Event/Form/ManageEvent/ScheduleReminders.tpl

index dfd7f669a70a91167cca74fefef0be6d6291e827..690bee73e507c77ccccaa9083c2acd088537e870 100755 (executable)
@@ -197,13 +197,7 @@ class CRM_Event_Form_ManageEvent_ScheduleReminders extends CRM_Event_Form_Manage
     );
     $recipientListing->setMultiple(TRUE);
 
-    //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));
 
     $this->add('select', 'group_id', ts('Group'),
       CRM_Core_PseudoConstant::staticGroup(), FALSE, array('class' => 'crm-select2 huge')
index 56512947c6529612cbf7ceb23935f947b3b8d29d..405774df9693f338a75568682110ec5ddeafea51 100755 (executable)
       {ts 1=$reminderName}WARNING: You are about to delete the Reminder titled <strong>%1</strong>.{/ts} {ts}Do you want to continue?{/ts}
     </div>
   {else}
-    {* added onload javascript for source contact*}
-    {literal}
-      <script type="text/javascript">
-      var recipient_manual = '';
-      var recipient_manual_id = null;
-      var toDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1&noemail=1' h=0 }{literal}"; {/literal}
-
-  {if $recipients}
-  {foreach from=$recipients key=id item=name}
-  {literal} recipient_manual += '{"name":"'+{/literal}"{$name}"{literal}+'","id":"'+{/literal}"{$id}"{literal}+'"},';{/literal}
-  {/foreach}
-  {literal} eval( 'recipient_manual = [' + recipient_manual + ']'); {/literal}
-  {/if}
-
-  {literal}
-  if ( recipient_manual_id ) {
-    eval( 'recipient_manual = ' + recipient_manual_id );
-  }
-
-    cj(document).ready( function( ) {
-    {/literal}
-    {literal}
-
-    eval( 'tokenClass = { tokenList: "token-input-list-facebook", token: "token-input-token-facebook", tokenDelete: "token-input-delete-token-facebook", selectedToken: "token-input-selected-token-facebook", highlightedToken: "token-input-highlighted-token-facebook", dropdown: "token-input-dropdown-facebook", dropdownItem: "token-input-dropdown-item-facebook", dropdownItem2: "token-input-dropdown-item2-facebook", selectedDropdownItem: "token-input-selected-dropdown-item-facebook", inputToken: "token-input-input-token-facebook" } ');
-
-  var tokenDataUrl  = "{/literal}{$tokenUrl}{literal}";
-  var hintText = "{/literal}{ts escape='js'}Type in a partial or complete name of an existing recipient.{/ts}{literal}";
-    cj( "#recipient_manual_id").tokenInput( tokenDataUrl, { prePopulate: recipient_manual, classes: tokenClass, hintText: hintText });
-    cj( 'ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).css( 'width', '450px' );
-    </script>
-  {/literal}
     <table class="form-layout-compressed">
       <tr class="crm-scheduleReminder-form-block-title">
         <td class="right">{$form.title.label}</td><td colspan="3">{$form.title.html}</td>
       </tr>
       <tr id="recipientManual" class="crm-scheduleReminder-form-block-recipient_manual_id">
         <td class="label">{$form.recipient_manual_id.label}</td>
-        <td>{$form.recipient_manual_id.html}{edit}<span class="description">{ts}You can manually send out the reminders to these recipients.{/ts}</span>{/edit}</td>
+        <td>{$form.recipient_manual_id.html}{edit}<div class="description">{ts}You can manually send out the reminders to these recipients.{/ts}</div>{/edit}</td>
       </tr>
       <tr id="recipientGroup" class="crm-scheduleReminder-form-block-recipient_group_id">
         <td class="label">{$form.group_id.label}</td>