if(!in_array($searchField, $list)) {
$list[] = $searchField;
}
- $request['params']['options']['return'] = $list;
+ $request['params']['return'] = $list;
$request['params']['options']['sort'] = 'sort_name';
// Contact api doesn't support array(LIKE => 'foo') syntax
$request['params'][$request['search_field']] = $request['input'];
'label' => $row[$request['label_field']],
);
$description = array();
- foreach ($request['params']['options']['return'] as $item) {
+ foreach ($request['params']['return'] as $item) {
if (!strpos($item, '_name') && !empty($row[$item])) {
$description[] = $row[$item];
}
if (!empty($request['description_field'])) {
$fieldsToReturn[] = $request['description_field'];
}
- $request['params']['options']['return'] = $fieldsToReturn;
+ $request['params']['return'] = $fieldsToReturn;
}
/**
.crm-container .select2-dropdown-open .select2-choice .select2-arrow b {
background-position: -18px 1px;
}
+/* Style autocomplete results */
+.select2-results table.crm-select2-row,
+.select2-results table.crm-select2-row tbody,
+.select2-results table.crm-select2-row tr,
+.select2-results table.crm-select2-row td {
+ border: 0 none;
+ padding: 0;
+ margin: 0;
+ border-collapse: collapse;
+}
+.select2-results table.crm-select2-row .crm-select2-row-label {
+ font-size: 1.1em;
+}
+.select2-results table.crm-select2-row .crm-select2-row-description {
+ font-size: 0.8em;
+ line-height: 1.5em;
+ color: #696969;
+}
+.select2-results .select2-highlighted table.crm-select2-row .crm-select2-row-description {
+ color: #f0f0f0;
+}
/* Special styling for specific form buttons */
#crm-container span.crm-button_qf_Main_upload input,
CRM.utils.formatSelect2Result = function(row) {
var markup = '<table class="crm-select2-row"><tr>';
if (row.image !== undefined) {
- markup += '<td class="crm-select2-row-image"><img src="' + row.image + '"/></td>';
+ markup += '<td class="crm-select2-image"><img src="' + row.image + '"/></td>';
}
- markup += '<td class="crm-select2-row-content"><div class="crm-select2-row-label">' + row.label + '</div>';
+ markup += '<td><div class="crm-select2-row-label">' + row.label + '</div>';
markup += '<div class="crm-select2-row-description">' + (row.description || '') + '</div>';
markup += '</td></tr></table>';
return markup;