$defaults['target_contact_id'] = $this->_contactIds;
}
+ // CRM-15472 - 50 is around the practial limit of how many items a select2 entityRef can handle
+ if (!empty($defaults['target_contact_id'])) {
+ $count = count(is_array($defaults['target_contact_id']) ? $defaults['target_contact_id'] : explode(',', $defaults['target_contact_id']));
+ if ($count > 50) {
+ $this->freeze(array('target_contact_id'));
+ }
+ }
+
if ($this->_action & (CRM_Core_Action::DELETE | CRM_Core_Action::RENEW)) {
$this->assign('delName', CRM_Utils_Array::value('subject', $defaults));
}
<td>
{$form.assignee_contact_id.html}
{if $action neq 4}
- <a href="#" class="crm-hover-button" id="swap_target_assignee" title="{ts}Swap Target and Assignee Contacts{/ts}" style="position:relative; bottom: 1em;">
- <span><div class="icon swap-icon"></div></span>
- </a>
+ {if !$form.target_contact_id.frozen}
+ <a href="#" class="crm-hover-button" id="swap_target_assignee" title="{ts}Swap Target and Assignee Contacts{/ts}" style="position:relative; bottom: 1em;">
+ <span class="icon ui-icon-shuffle"></span>
+ </a>
+ {/if}
{if $activityAssigneeNotification}
<br />
<span class="description"><span class="icon email-icon"></span>{ts}A copy of this activity will be emailed to each Assignee.{/ts}</span>