From: Coleman Watts Date: Tue, 26 Jul 2016 20:28:02 +0000 (-0400) Subject: CRM-18744 - Add prompt text when search term not found X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=04c17d0cc000d887f47af6fbe90d3ad6bc9eba71;p=civicrm-core.git CRM-18744 - Add prompt text when search term not found --- diff --git a/templates/CRM/common/navigation.js.tpl b/templates/CRM/common/navigation.js.tpl index 87a0a23a0e..4e09a025e7 100644 --- a/templates/CRM/common/navigation.js.tpl +++ b/templates/CRM/common/navigation.js.tpl @@ -110,7 +110,13 @@ $('#civicrm-menu').ready(function() { }); } else { $('#sort_name_navigation').autocomplete('widget').menu('option', 'disabled', true); - ret.push({value: '0', label: {/literal}'{ts escape='js'}None found.{/ts}'{literal}}); + var label = option.closest('label').text(); + var msg = {/literal}ts('{ts escape='js' 1=%1}%1 not found.{/ts}'{literal}, {1: label}); + // Remind user they are not searching by contact name (unless they enter a number) + if (params.field_name && !(/[\d].*/.test(params.name))) { + msg += {/literal}' {ts escape='js'}Did you mean to search by Name/Email instead?{/ts}'{literal}; + } + ret.push({value: '0', label: msg}); } response(ret); })