Skip to content

Commit

Permalink
Merge pull request #21003 from eileenmcnaughton/swapsies
Browse files Browse the repository at this point in the history
Use template variable to add or remove swap button.
  • Loading branch information
demeritcowboy authored Aug 4, 2021
2 parents 6750952 + 8eaec91 commit 51e58f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ public function setDefaultValues() {
$count = count(is_array($defaults['target_contact_id']) ? $defaults['target_contact_id'] : explode(',', $defaults['target_contact_id']));
if ($count > 50) {
$this->freeze(['target_contact_id']);
$this->assign('disable_swap_button', TRUE);
}
}

Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Activity/Form/Activity.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<td>
{$form.assignee_contact_id.html}
{if $action neq 4}
{if !$form.target_contact_id.frozen}
{if empty($disable_swap_button)}
<a href="#" class="crm-hover-button" id="swap_target_assignee" title="{ts}Swap Target and Assignee Contacts{/ts}" style="position:relative; bottom: 1em;">
<i class="crm-i fa-random" aria-hidden="true"></i>
</a>
Expand Down

0 comments on commit 51e58f8

Please sign in to comment.