mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
taken account operator when searching in field
save last thesaurus operator choice in session
This commit is contained in:
@@ -22526,9 +22526,8 @@ var recordEditorService = function recordEditorService(services) {
|
||||
}
|
||||
}).on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', function (event) {
|
||||
var currentField = options.fieldCollection.getActiveField();
|
||||
var method = (0, _jquery2.default)(event.currentTarget).siblings('select.thesaurus-search-operator').val();
|
||||
|
||||
onUserInputComplete(event, $searchThesaurus.val(), currentField, method);
|
||||
onUserInputComplete(event, $searchThesaurus.val(), currentField);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -23887,9 +23886,9 @@ var recordEditorService = function recordEditorService(services) {
|
||||
* @param field
|
||||
*/
|
||||
var onUserInputComplete = function onUserInputComplete(event, value, field) {
|
||||
var method = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'begins';
|
||||
|
||||
if (value !== '') {
|
||||
var method = (0, _jquery2.default)('div#EDIT_MID').find('select.thesaurus-search-operator').val();
|
||||
|
||||
recordEditorEvents.emit('recordEditor.userInputValue', {
|
||||
event: event,
|
||||
value: value,
|
||||
|
@@ -22526,9 +22526,8 @@ var recordEditorService = function recordEditorService(services) {
|
||||
}
|
||||
}).on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', function (event) {
|
||||
var currentField = options.fieldCollection.getActiveField();
|
||||
var method = (0, _jquery2.default)(event.currentTarget).siblings('select.thesaurus-search-operator').val();
|
||||
|
||||
onUserInputComplete(event, $searchThesaurus.val(), currentField, method);
|
||||
onUserInputComplete(event, $searchThesaurus.val(), currentField);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -23887,9 +23886,9 @@ var recordEditorService = function recordEditorService(services) {
|
||||
* @param field
|
||||
*/
|
||||
var onUserInputComplete = function onUserInputComplete(event, value, field) {
|
||||
var method = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'begins';
|
||||
|
||||
if (value !== '') {
|
||||
var method = (0, _jquery2.default)('div#EDIT_MID').find('select.thesaurus-search-operator').val();
|
||||
|
||||
recordEditorEvents.emit('recordEditor.userInputValue', {
|
||||
event: event,
|
||||
value: value,
|
||||
|
@@ -219,9 +219,8 @@ const recordEditorService = services => {
|
||||
})
|
||||
.on('mouseup mousedown keyup keydown', '.editor-thesaurus-search', (event) => {
|
||||
let currentField = options.fieldCollection.getActiveField();
|
||||
let method = $(event.currentTarget).siblings('select.thesaurus-search-operator').val();
|
||||
|
||||
onUserInputComplete(event, $searchThesaurus.val(), currentField, method);
|
||||
onUserInputComplete(event, $searchThesaurus.val(), currentField);
|
||||
})
|
||||
;
|
||||
};
|
||||
@@ -1773,8 +1772,10 @@ const recordEditorService = services => {
|
||||
* @param value
|
||||
* @param field
|
||||
*/
|
||||
let onUserInputComplete = (event, value, field, method = 'begins') => {
|
||||
let onUserInputComplete = (event, value, field) => {
|
||||
if (value !== '') {
|
||||
let method = $('div#EDIT_MID').find('select.thesaurus-search-operator').val();
|
||||
|
||||
recordEditorEvents.emit('recordEditor.userInputValue', {
|
||||
event,
|
||||
value,
|
||||
|
@@ -880,6 +880,8 @@ class ThesaurusXmlHttpController extends Controller
|
||||
|
||||
public function openBranchesHtml(Request $request)
|
||||
{
|
||||
$this->app['session']->set('editor_thesaurus_operator', $request->get('method'));
|
||||
|
||||
if (null === $mod = $request->get('mod')) {
|
||||
$mod = 'TREE';
|
||||
}
|
||||
@@ -1458,6 +1460,8 @@ class ThesaurusXmlHttpController extends Controller
|
||||
return $this->app->json(['success' => false , 'message' => 'invalid form token'], 403);
|
||||
}
|
||||
|
||||
$this->app['session']->set('workzone_thesaurus_operator', $request->get('method'));
|
||||
|
||||
$lng = $request->get('lng');
|
||||
|
||||
$html = '';
|
||||
|
@@ -272,8 +272,16 @@
|
||||
{% if thesaurus %}
|
||||
<div id='TH_Ofull'>
|
||||
<select class="thesaurus-search-operator" tabindex="-1" aria-hidden="true" style="width: 106px; margin-left:10px; display: none;">
|
||||
<option value="begins">{{ 'begins with' | trans }}</option>
|
||||
<option value="contains">{{ 'contains' | trans }}</option>
|
||||
<option value="begins"
|
||||
{% if app['session'].has('editor_thesaurus_operator') and app['session'].get('editor_thesaurus_operator') == "begins" %}
|
||||
selected
|
||||
{% endif %}
|
||||
>{{ 'begins with' | trans }}</option>
|
||||
<option value="contains"
|
||||
{% if app['session'].has('editor_thesaurus_operator') and app['session'].get('editor_thesaurus_operator') == "contains" %}
|
||||
selected
|
||||
{% endif %}
|
||||
>{{ 'contains' | trans }}</option>
|
||||
</select>
|
||||
<input type="text" class="editor-thesaurus-search" style="margin-top: 10px; margin-left: 10px; display: none;">
|
||||
<div class='thesaurus edit-thesaurus-action'>
|
||||
|
@@ -21,8 +21,16 @@
|
||||
<form class="gform form-inline thesaurus-filter-submit-action">
|
||||
<div class="input-append">
|
||||
<select class="thesaurus-search-operator" tabindex="-1" aria-hidden="true" style="width: 25%; margin-left:10px; height:39px;">
|
||||
<option value="begins">{{ 'begins with' | trans }}</option>
|
||||
<option value="contains">{{ 'contains' | trans }}</option>
|
||||
<option value="begins"
|
||||
{% if app['session'].has('workzone_thesaurus_operator') and app['session'].get('workzone_thesaurus_operator') == "begins" %}
|
||||
selected
|
||||
{% endif %}
|
||||
>{{ 'begins with' | trans }}</option>
|
||||
<option value="contains"
|
||||
{% if app['session'].has('workzone_thesaurus_operator') and app['session'].get('workzone_thesaurus_operator') == "contains" %}
|
||||
selected
|
||||
{% endif %}
|
||||
>{{ 'contains' | trans }}</option>
|
||||
</select>
|
||||
<input type="text" name="search_value" class="input-medium thesaurus-filter-suggest-action" style="width: 55%; float:none;"/>
|
||||
<button type="submit" class="th_ok btn btn-inverse" style="width:12%; float:none;">
|
||||
|
Reference in New Issue
Block a user