mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 09:53:15 +00:00
Merge pull request #2923 from HRavalomanana/PHRAS-2430_Port_to_41-Advance_search_refacto_Restore_Query
PHRAS-2430 #comment Port to 4.1 - Advance search refacto , Restore Query, JYG refacto, HR transcript, Phraseanet-Production-Client need to be set to 0.34.8 in composer.json
This commit is contained in:
@@ -161,7 +161,33 @@ class QueryController extends Controller
|
||||
$result = $engine->query($query, $options);
|
||||
|
||||
if ($this->getSettings()->getUserSetting($user, 'start_page') === 'LAST_QUERY') {
|
||||
$userManipulator->setUserSetting($user, 'start_page_query', $query);
|
||||
// try to save the "fulltext" query which will be restored on next session
|
||||
try {
|
||||
// local code to find "FULLTEXT" value from jsonQuery
|
||||
$findFulltext = function($clause) use(&$findFulltext) {
|
||||
if(array_key_exists('_ux_zone', $clause) && $clause['_ux_zone']=='FULLTEXT') {
|
||||
return $clause['value'];
|
||||
}
|
||||
if($clause['type']=='CLAUSES') {
|
||||
foreach($clause['clauses'] as $c) {
|
||||
if(($r = $findFulltext($c)) !== null) {
|
||||
return $r;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
$userManipulator->setUserSetting($user, 'last_jsonquery', (string)$request->request->get('jsQuery'));
|
||||
|
||||
$jsQuery = @json_decode((string)$request->request->get('jsQuery'), true);
|
||||
if(($ft = $findFulltext($jsQuery['query'])) !== null) {
|
||||
$userManipulator->setUserSetting($user, 'start_page_query', $ft);
|
||||
}
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
// no-op
|
||||
}
|
||||
}
|
||||
|
||||
// log array of collectionIds (from $options) for each databox
|
||||
|
8986
package-lock.json
generated
8986
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -66,7 +66,7 @@
|
||||
"normalize-css": "^2.1.0",
|
||||
"npm": "^6.0.0",
|
||||
"npm-modernizr": "^2.8.3",
|
||||
"phraseanet-production-client": "0.33.84",
|
||||
"phraseanet-production-client": "0.34.7",
|
||||
"requirejs": "^2.3.5",
|
||||
"tinymce": "^4.0.28",
|
||||
"underscore": "^1.8.3",
|
||||
|
@@ -264,6 +264,12 @@
|
||||
<div class="PNB" id="rightFrame" style="left:auto; width:{{ w2 ~ '%' }}">
|
||||
<div id="headBlock" class="PNB">
|
||||
<div class="searchFormWrapper">
|
||||
|
||||
{% if app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page') == 'QUERY' %}
|
||||
<div id="FIRST_QUERY_CONTAINER" class="start-query" style="display: none" data-format="text">{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page_jsonquery') | raw}}</div>
|
||||
{% elseif app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page') == 'LAST_QUERY' %}
|
||||
<div id="FIRST_QUERY_CONTAINER" class="last-query" style="display: none" data-format="json">{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'last_jsonquery') | raw}}</div>
|
||||
{% endif %}
|
||||
<form id="searchForm" method="POST" action="{{ path('prod_query') }}" name="phrasea_query" class="phrasea_query">
|
||||
<input id="SENT_query" name="qry" type="hidden" value="{{app['settings'].getUserSetting(app.getAuthenticatedUser(), 'start_page_query')}}">
|
||||
<input type="hidden" name="pag" id="formAnswerPage" value="">
|
||||
@@ -404,27 +410,27 @@
|
||||
</label>
|
||||
|
||||
<div class="term_select">
|
||||
<div class="term_select_wrapper">
|
||||
<select class="term_select_field" style="vertical-align:middle; width:30%;">
|
||||
<div class="term_select_wrapper_template" style="display: none;">
|
||||
<select class="term_select_field" style="vertical-align:middle; width:30%;">
|
||||
<option value="">{{ 'Select a field' | trans }}</option>
|
||||
{% for field_id, field in search_datas['fields'] %}
|
||||
{% if field['type'] != 'date' %}
|
||||
<option class="dbx db_{{field['sbas']|join(' db_')}}" value="{{field_id}}">{{field['fieldname']}}</option>
|
||||
{% endif %}
|
||||
{# {% if field['type'] != 'date' %}#}
|
||||
<option class="dbx db_{{field['sbas']|join(' db_')}}" data-fieldtype="{{ field['type'] }}-FIELD" value="{{field_id}}">{{field['fieldname']}}</option>
|
||||
{#{% endif %}#}
|
||||
{% endfor %}
|
||||
</select>
|
||||
<select disabled style="vertical-align:middle; width: 23%;">
|
||||
<option value="contains">{{ 'Contains' | trans }}</option>
|
||||
<option value="equals">{{ 'Equals' | trans }}</option>
|
||||
<select class="term_select_op" disabled style="vertical-align:middle; width: 23%;">
|
||||
<option value=":">{{ 'Contains' | trans }}</option>
|
||||
<option value="=">{{ 'Equals' | trans }}</option>
|
||||
</select>
|
||||
<input disabled style="vertical-align:middle; width: 32%;" placeholder="{{ 'Ex : Paris, bleu, montagne' | trans }}">
|
||||
<input class="term_deleter" style="margin-bottom: 4px;" disabled>
|
||||
<input class="term_select_value" disabled style="vertical-align:middle; width: 32%;" placeholder="{{ 'Ex : Paris, bleu, montagne' | trans }}">
|
||||
<input class="term_deleter" style="margin-bottom: 4px;">
|
||||
</div>
|
||||
|
||||
<button class="add_new_term"><span>+</span> Add</button>
|
||||
</div>
|
||||
|
||||
<div style="display:none;">
|
||||
{# <div style="display:none;">
|
||||
<select class="term_select_multiple" size="8" multiple onchange="prodApp.appEvents.emit('search.doCheckFilters', true);" name="fields[]" style="vertical-align:middle; width:99%;">
|
||||
<option value="phraseanet--all--fields">{{ 'rechercher dans tous les champs' | trans }}</option>
|
||||
{% for field_id, field in search_datas['fields'] %}
|
||||
@@ -433,7 +439,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>#}
|
||||
</div>
|
||||
|
||||
<div id="ADVSRCH_DATE_ZONE">
|
||||
@@ -449,13 +455,15 @@
|
||||
</div>
|
||||
</label>
|
||||
<span>
|
||||
<select name="date_field" class="input-medium check-filters" data-save="true" style="width: 166px;">
|
||||
<select name="date_field" class="date-field input-medium check-filters" data-save="true" style="width: 166px;">
|
||||
<option selected="selected"
|
||||
value="">{{ 'Rechercher dans un champ date' | trans }}</option>
|
||||
{% for fieldname, date in search_datas['dates'] %}
|
||||
<option
|
||||
class="dbx db_{{date['sbas']|join(' db_')}}" value="{{ fieldname }}">{{ fieldname }}</option>
|
||||
{% endfor %}
|
||||
<option value="updated_on">{{ 'updated_on' | trans }}</option>
|
||||
<option value="created_on">{{ 'created_on' | trans }}</option>
|
||||
</select>
|
||||
</span>
|
||||
<span id="ADVSRCH_DATE_SELECTORS" style="display: inline-block;height: 26px;line-height: 26px;">
|
||||
@@ -498,13 +506,16 @@
|
||||
{% for status_bit, status in databox.status %}
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<label class="checkbox inline custom_checkbox_label">
|
||||
{% if status['img_off'] %}
|
||||
<img src="{{status['img_off']}}" title="{{status['labels_off_i18n'][app['locale']]}}" />
|
||||
{% endif %}
|
||||
<input class="field_switch field_{{databox_id}} check-filters" data-save="true"
|
||||
type="checkbox" value="0"
|
||||
n="{{status_bit}}" name="status[{{databox_id}}][{{status_bit}}]" />
|
||||
<input type="checkbox" class="field_switch field_{{databox_id}}"
|
||||
value="0"
|
||||
data-sbas_id="{{databox_id}}" data-sb="{{status_bit}}"
|
||||
name="status[{{databox_id}}][{{status_bit}}]"
|
||||
/>
|
||||
<span class="custom_checkbox"></span>
|
||||
{{status['labels_off_i18n'][app['locale']]}}
|
||||
</label>
|
||||
@@ -514,9 +525,11 @@
|
||||
{% if status['img_on'] %}
|
||||
<img src="{{status['img_on']}}" title="{{status['labels_on_i18n'][app['locale']]}}" />
|
||||
{% endif %}
|
||||
<input class="field_switch field_{{databox_id}} check-filters" data-save="true"
|
||||
type="checkbox" value="1"
|
||||
n="{{status_bit}}" name="status[{{databox_id}}][{{status_bit}}]"/>
|
||||
<input type="checkbox" class="field_switch field_{{databox_id}}"
|
||||
value="1"
|
||||
data-sbas_id="{{databox_id}}" data-sb="{{status_bit}}"
|
||||
name="status[{{databox_id}}][{{status_bit}}]"
|
||||
/>
|
||||
<span class="custom_checkbox"></span>
|
||||
{{status['labels_on_i18n'][app['locale']]}}
|
||||
</label>
|
||||
|
16
yarn.lock
16
yarn.lock
@@ -5741,14 +5741,10 @@ jquery-simplecolorpicker@^0.3.1:
|
||||
resolved "https://registry.yarnpkg.com/jquery-simplecolorpicker/-/jquery-simplecolorpicker-0.3.1.tgz#4f6befd380ab05470f585d5482e5180556e460eb"
|
||||
integrity sha1-T2vv04CrBUcPWF1UguUYBVbkYOs=
|
||||
|
||||
"jquery-treeview@git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e":
|
||||
version "1.4.2"
|
||||
resolved "git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e"
|
||||
|
||||
"jquery-treeview@https://github.com/alchemy-fr/jquery-treeview.git":
|
||||
"jquery-treeview@git+https://github.com/alchemy-fr/jquery-treeview.git", "jquery-treeview@git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e":
|
||||
version "1.4.2"
|
||||
uid "1e9e5a49d2875b878801e904cd08c2d25e85af1e"
|
||||
resolved "https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e"
|
||||
resolved "git+https://github.com/alchemy-fr/jquery-treeview.git#1e9e5a49d2875b878801e904cd08c2d25e85af1e"
|
||||
|
||||
jquery-ui-datepicker-with-i18n@^1.10.4:
|
||||
version "1.10.4"
|
||||
@@ -8263,10 +8259,10 @@ phraseanet-common@^0.4.1:
|
||||
js-cookie "^2.1.0"
|
||||
pym.js "^1.3.1"
|
||||
|
||||
phraseanet-production-client@0.33.84:
|
||||
version "0.33.84"
|
||||
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.33.84.tgz#6e5a6884ea14576bca293ae0fba4eed9b31a6be6"
|
||||
integrity sha512-2e4HX7PCNvEOKyj5IetrnTXc70heOviopde5suDYtIP3oZt+B7Ipth6MMxkShH39wOUyFVS8n/b8bEKrL+2kag==
|
||||
phraseanet-production-client@0.34.7:
|
||||
version "0.34.7"
|
||||
resolved "https://registry.yarnpkg.com/phraseanet-production-client/-/phraseanet-production-client-0.34.7.tgz#72a67ac4af52124be55c198e58883d52999b6da6"
|
||||
integrity sha512-YAbY10obCLVdE7guCBdCm/ohWawQ6mJ+SBSiZ/UG3UVNUIVjDqSN39x7VbjmJ+tRosQpkyR/YUfbQ+Ab3n58RQ==
|
||||
dependencies:
|
||||
"@mapbox/mapbox-gl-language" "^0.9.2"
|
||||
"@turf/turf" "^5.1.6"
|
||||
|
Reference in New Issue
Block a user