Hi Dave,
I, too, will have to poke around the code. I start with the knowledge that the control on the casual record form will be data_entry_helper::species_autocomplete().
I observe there is a template called 'autocomplete_javascript' for the javascript that drives the control. The declaration of the global array of $indicia_templates can be found at the start of helper_base.php.
This script (which can be more easily understood by inspecting the actual javascript in the browser) makes use of a jQuery autocomplete plugin which can be found in iform/media/js/jquery.autocomplete.js
By stepping through that code I see that, when a species is selected, the text box is populated with a the contents of a 'result' property.
Working back out again, that result property is populated by the autocomplete_javascript template with 'item.{captionField}'. 'item' is an object returned by the database query containing many fields including common name, scientific name, etc. {captionField} is a token which is replaced by the name of just one field.
The way to deal with this, then, is to either override the autocomplete_javascript template, as described at http://indicia-docs.readthedocs.io/en/l … lity.html, or improve the client_helpers code.
Overriding the template is problematic because the fields in item depend upon whether we are querying the cache tables or not. However, since all production sites should be using the cache you could do a job that would work well enough. The override could just be a concatenation of fields, making use of the following,
- item.original: the taxon that was entered
- item.language_iso: the language of the entered taxon (e.g. lat for latin, eng for english..)
- item.authority: the authority of the entered taxon
- item.preferred_taxon: the latin name of the taxon
- item.'preferred_authority: the authority of the preferred taxon name
- item.default_common_name: the common name of the taxon
- item.taxon_group: the taxon group
However, a better result will be obtained by something more dynamic like data_entry_helper::build_species_autocomplete_item_function() which takes in to account the language of the name entered by the recorder.
It's not the simplest of configuration. If you would prefer a better fix, you could add a feature request for this to the client_helpers issue queue on Github but there is no telling if/when it would be acted on.
Hope that helps,
Jim Bacon.