mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge pull request #2629 from aynsix/PHRAS-1875-advancedsearch-updated-on
PHRAS-1875 port to 4.1 advanced search sort by updated_on
This commit is contained in:
@@ -139,6 +139,7 @@ class ElasticSearchEngine implements SearchEngineInterface
|
|||||||
return [
|
return [
|
||||||
SearchEngineOptions::SORT_RELEVANCE => $this->app->trans('pertinence'),
|
SearchEngineOptions::SORT_RELEVANCE => $this->app->trans('pertinence'),
|
||||||
SearchEngineOptions::SORT_CREATED_ON => $this->app->trans('date dajout'),
|
SearchEngineOptions::SORT_CREATED_ON => $this->app->trans('date dajout'),
|
||||||
|
SearchEngineOptions::SORT_UPDATED_ON => $this->app->trans('date de modification'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -368,6 +369,9 @@ class ElasticSearchEngine implements SearchEngineInterface
|
|||||||
elseif ($options->getSortBy() === SearchEngineOptions::SORT_CREATED_ON) {
|
elseif ($options->getSortBy() === SearchEngineOptions::SORT_CREATED_ON) {
|
||||||
$sort['created_on'] = $options->getSortOrder();
|
$sort['created_on'] = $options->getSortOrder();
|
||||||
}
|
}
|
||||||
|
elseif ($options->getSortBy() === SearchEngineOptions::SORT_UPDATED_ON) {
|
||||||
|
$sort['updated_on'] = $options->getSortOrder();
|
||||||
|
}
|
||||||
elseif ($options->getSortBy() === 'recordid') {
|
elseif ($options->getSortBy() === 'recordid') {
|
||||||
$sort['record_id'] = $options->getSortOrder();
|
$sort['record_id'] = $options->getSortOrder();
|
||||||
}
|
}
|
||||||
|
@@ -36,6 +36,7 @@ class SearchEngineOptions
|
|||||||
const TYPE_ALL = '';
|
const TYPE_ALL = '';
|
||||||
const SORT_RELEVANCE = 'relevance';
|
const SORT_RELEVANCE = 'relevance';
|
||||||
const SORT_CREATED_ON = 'created_on';
|
const SORT_CREATED_ON = 'created_on';
|
||||||
|
const SORT_UPDATED_ON = 'updated_on';
|
||||||
const SORT_RANDOM = 'random';
|
const SORT_RANDOM = 'random';
|
||||||
const SORT_MODE_ASC = 'asc';
|
const SORT_MODE_ASC = 'asc';
|
||||||
const SORT_MODE_DESC = 'desc';
|
const SORT_MODE_DESC = 'desc';
|
||||||
|
@@ -346,6 +346,9 @@
|
|||||||
{% set isSelected = (sortByPreference == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON')) %}
|
{% set isSelected = (sortByPreference == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON')) %}
|
||||||
{% set isDefault = (sortByDefault == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON')) %}
|
{% set isDefault = (sortByDefault == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON')) %}
|
||||||
<option value="{{ constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON') }}" {% if isSelected %}selected="selected"{% endif %}{% if isDefault %} class="default-selection"{% endif %}>{{ "Date Added"|trans }}</option>
|
<option value="{{ constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_CREATED_ON') }}" {% if isSelected %}selected="selected"{% endif %}{% if isDefault %} class="default-selection"{% endif %}>{{ "Date Added"|trans }}</option>
|
||||||
|
{% set isSelected = (sortByPreference == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_UPDATED_ON')) %}
|
||||||
|
{% set isDefault = (sortByDefault == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_UPDATED_ON')) %}
|
||||||
|
<option value="{{ constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_UPDATED_ON') }}" {% if isSelected %}selected="selected"{% endif %}{% if isDefault %} class="default-selection"{% endif %}>{{ "Date Updated"|trans }}</option>
|
||||||
{% set isSelected = (sortByPreference == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE')) %}
|
{% set isSelected = (sortByPreference == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE')) %}
|
||||||
{% set isDefault = (sortByDefault == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE')) %}
|
{% set isDefault = (sortByDefault == constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE')) %}
|
||||||
<option value="{{ constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE') }}" {% if isSelected %}selected="selected"{% endif %}{% if isDefault %} class="default-selection"{% endif %}>{{ "Relevance"|trans }}</option>
|
<option value="{{ constant('\\Alchemy\\Phrasea\\SearchEngine\\SearchEngineOptions::SORT_RELEVANCE') }}" {% if isSelected %}selected="selected"{% endif %}{% if isDefault %} class="default-selection"{% endif %}>{{ "Relevance"|trans }}</option>
|
||||||
|
Reference in New Issue
Block a user