From: colemanw Date: Fri, 2 May 2014 01:25:28 +0000 (-0700) Subject: Merge pull request #3096 from mepps/remove-autocomplete-email X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b53d3b50892315022feddf9f9b84823584df6c88;p=civicrm-core.git Merge pull request #3096 from mepps/remove-autocomplete-email Removed autocomplete from send email activity --- b53d3b50892315022feddf9f9b84823584df6c88 diff --cc templates/CRM/Contact/Form/Task/Email.tpl index 74bfd05f87,d1f7823e13..5f5caaaebe --- a/templates/CRM/Contact/Form/Task/Email.tpl +++ b/templates/CRM/Contact/Form/Task/Email.tpl @@@ -104,13 -105,33 +105,32 @@@ CRM.$(function($) cj('tr#bcc ul li:not(:last)').remove();cj('#bcc').hide(); }); - var hintText = "{/literal}{ts escape='js'}Type in a partial or complete name or email address of an existing contact.{/ts}{literal}"; - var sourceDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1' h=0 }{literal}"; - var toDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1' h=0 }{literal}"; + var sourceDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' q='id=1' h=0 }{literal}"; + + function emailSelect(el, prepopulate){ + $(el).data('api-entity', 'contact').crmSelect2({ + minimumInputLength: 1, + multiple: true, + ajax: { + url: sourceDataUrl, + data: function(term) { + return { + name: term, + }; + }, + results: function(response) { + return { + results: response, + }; + } + } + }).select2('data', prepopulate); + } + emailSelect('#to', toContact); + emailSelect('#cc_id', ccContact); + emailSelect('#bcc_id', bccContact); + }); + - cj( "#to" ).tokenInput( toDataUrl, { prePopulate: toContact, theme: 'facebook', hintText: hintText }); - cj( "#cc_id" ).tokenInput( sourceDataUrl, { prePopulate: ccContact, theme: 'facebook', hintText: hintText }); - cj( "#bcc_id" ).tokenInput( sourceDataUrl, { prePopulate: bccContact, theme: 'facebook', hintText: hintText }); - cj( 'ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).css( 'width', '450px' ); {/literal} -{include file="CRM/common/formNavigate.tpl"} diff --cc templates/CRM/Contact/Form/Task/SMS.tpl index 858d913c04,95ce29b86f..f1fd590113 --- a/templates/CRM/Contact/Form/Task/SMS.tpl +++ b/templates/CRM/Contact/Form/Task/SMS.tpl @@@ -92,12 -92,25 +92,24 @@@ {/if} {literal} - - var hintText = "{/literal}{ts escape='js'}Type in a partial or complete name or email address of an existing contact.{/ts}{literal}"; - var sourceDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkphone' h=0 }{literal}"; - var toDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkphone' q='id=1' h=0 }{literal}"; - - cj( "#to" ).tokenInput( toDataUrl, { prePopulate: toContact, theme: 'facebook', hintText: hintText }); - cj( 'ul.token-input-list-facebook, div.token-input-dropdown-facebook' ).css( 'width', '450px' ); + CRM.$(function($){ + var sourceDataUrl = "{/literal}{crmURL p='civicrm/ajax/checkphone' h=0 }{literal}"; + function phoneSelect(el){ + $(el).data('api-entity', 'contact').crmSelect2({ + minimumInputLength: 1, + multiple: true, + ajax: { + url: sourceDataUrl, + data: function(term) { + return { name: term,}; + }, + results: function(response) { + return { results: response }; + } + } + }).select2('data', toContact); + } + phoneSelect('#to'); + }); {/literal} -{include file="CRM/common/formNavigate.tpl"}