diff --git a/app/resources/locales/en_US/field.po b/app/resources/locales/en_US/field.po index 0f88b28e3..cf47654fd 100644 --- a/app/resources/locales/en_US/field.po +++ b/app/resources/locales/en_US/field.po @@ -95,6 +95,9 @@ msgstr "Display Name" msgid "edupersonaffiliation" msgstr "eduPersonAffiliation" +msgid "ends_at" +msgstr "Ends at:" + msgid "extension" msgstr "Extension" @@ -198,6 +201,9 @@ msgstr "Search..." msgid "sponsor" msgstr "Sponsor" +msgid "starts_at" +msgstr "Starts at:" + msgid "state" msgstr "State" diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 5408b0e6e..ac931a4db 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -156,8 +156,8 @@ = $this->element('filter', $filterArgs); ?> diff --git a/app/templates/element/filter.php b/app/templates/element/filter.php index 88aedc239..c719fc2cb 100644 --- a/app/templates/element/filter.php +++ b/app/templates/element/filter.php @@ -32,6 +32,8 @@ $modelsName = $this->name; // $modelName = Model $modelName = Inflector::singularize($modelsName); +// $columns = the passed parameter $indexColumns as found in columns.inc; provides overrides for labels and sorting. +$columns = $indexColumns; // Get the query string and separate the search params from the non-search params $query = $this->request->getQueryParams(); @@ -115,13 +117,15 @@ (is_array($search_params[$key]) ? 'Range' : $search_params[$key]); ?> @@ -139,12 +143,12 @@ $field_booleans_columns = []; $field_datetime_columns = []; - if(!empty($columnKeys)) { + if(!empty($columns)) { // To make our filters consistently ordered with the index columns, sort the $vv_searchable_attributes - // by the columns.inc $indexColumns keys (passed in to this View element as "$columnKeys"). The fields found - // in columns.inc will be placed first in the resulting array. Throw out any fields from $columnKeys that didn't - // exist in the original $vv_searchable_attributes array. - $vv_searchable_attributes = array_intersect_key(array_replace(array_flip($columnKeys), $vv_searchable_attributes), $vv_searchable_attributes); + // by the keys of columns.inc $indexColumns (passed in to this View element as $indexColumns and referenced + // as "$columns"). The fields found in $columns will be placed first in the resulting array. + // The result should only include fields that exist in the original $vv_searchable_attributes array. + $vv_searchable_attributes = array_intersect_key(array_replace(array_flip(array_keys($columns)), $vv_searchable_attributes), $vv_searchable_attributes); } foreach($vv_searchable_attributes as $key => $options) { @@ -156,7 +160,7 @@ continue; } $formParams = [ - 'label' => $options['label'], + 'label' => !empty($columns[$key]['label']) ? $columns[$key]['label'] : $options['label'], // The default type is text, but we might convert to select below 'type' => 'text', 'value' => (!empty($query[$key]) ? $query[$key] : ''), @@ -184,7 +188,7 @@ $options): ?>