Skip to content

Commit

Permalink
Merge pull request #26198 from larssandergreen/allow-deletion-of-prim…
Browse files Browse the repository at this point in the history
…ary-emails

dev/core#4284 Allow deletion of primary email inline on contact
  • Loading branch information
colemanw authored May 19, 2023
2 parents 54c4a16 + babf359 commit b70eae6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 1 addition & 6 deletions templates/CRM/Contact/Form/Inline/Email.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@
<td align="center">{$form.email.$blockId.on_hold.html}</td>
<td align="center" {if !$multipleBulk}class="crm-email-bulkmail"{/if}>{$form.email.$blockId.is_bulkmail.html}</td>
<td align="center" class="crm-email-is_primary">{$form.email.$blockId.is_primary.1.html}</td>
<td>
{if $blockId gt 1}
<a title="{ts}Delete Email{/ts}" class="crm-delete-inline crm-hover-button" href="#"><span
class="icon delete-icon"></span></a>
{/if}
</td>
<td><a title="{ts}Delete Email{/ts}" class="crm-delete-inline crm-hover-button" href="#"><span class="icon delete-icon"></span></a></td>
</tr>
{/section}
</table>
Expand Down
7 changes: 6 additions & 1 deletion templates/CRM/Contact/Page/View/Summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,14 @@
//unset and set first as primary
if ($('[class$=is_primary] input:checked', row).length > 0) {
$('[class$=is_primary] input', row).prop('checked', false);
$('[class$=is_primary] input:first', form).prop('checked', true );
$('[class$=is_primary] input:visible:first', form).prop('checked', true );
}
$('.add-more-inline', form).show();
if ($('[class$=is_primary] input:visible', form).length == 0) {
$('.add-more-inline', form).click();
$('[class$=is_primary] input:visible:first', form).prop('checked', true );
}

e.preventDefault();
})
// Delete an address
Expand Down

0 comments on commit b70eae6

Please sign in to comment.