CRM-18744 - Add prompt text when search term not found
authorColeman Watts <coleman@civicrm.org>
Tue, 26 Jul 2016 20:28:02 +0000 (16:28 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 26 Jul 2016 20:36:04 +0000 (16:36 -0400)
templates/CRM/common/navigation.js.tpl

index 87a0a23a0e87b6f6e2d76c26a7714a0a257956f4..4e09a025e7199bfeee0f265a4e8dd4ee0a883e85 100644 (file)
@@ -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);
         })