diff --git a/app/controllers/collection.php b/app/controllers/collection.php index 7196f5d..5d38a55 100644 --- a/app/controllers/collection.php +++ b/app/controllers/collection.php @@ -163,6 +163,7 @@ public function doIndex() { if (!is_array($this->queryFields)) { $this->queryFields = array(); } + $this->nativeFields = array_unique(array_merge($this->nativeFields, $this->queryFields)); $this->indexFields = $db->selectCollection($this->collection)->getIndexInfo(); $this->recordsCount = $db->selectCollection($this->collection)->count(); @@ -1079,4 +1080,4 @@ public function doCollectionImport() { } } -?> \ No newline at end of file +?> diff --git a/js/collection.js b/js/collection.js index 8a600e5..90a08a1 100644 --- a/js/collection.js +++ b/js/collection.js @@ -1277,8 +1277,26 @@ function showMoreDocMenus(button, index) { }); } } + +/** + * Add a custom field to query + */ +function addCustomFieldToQuery() { + var obj = $('#add_custom_field'); + var field_name = obj.val(); + + if (field_name.length === 0) { + return; + } + + $('#query_fields_list ul').append('
'); + obj.val(''); + + return false; +} + $(function () { $(document).click(function () { $(".doc_menu").hide(); }); -}); \ No newline at end of file +}); diff --git a/themes/default/views/collection/index.php b/themes/default/views/collection/index.php index c9bc665..1c8487d 100644 --- a/themes/default/views/collection/index.php +++ b/themes/default/views/collection/index.php @@ -101,6 +101,7 @@ /> +