From d9b1a54e5589bf94c0577a48acedff86dba2eacf Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Tue, 7 Apr 2015 19:27:05 +0200 Subject: [PATCH] - fix : last user query is ok when relog (no more 'ast' language...), but still includes facet filters. - fix : advanced search, status-bit checkbox can be checked --- lib/Alchemy/Phrasea/ControllerProvider/Prod/Query.php | 2 +- templates/web/prod/index.html.twig | 4 +++- www/skins/prod/jquery.main-prod.js | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Query.php b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Query.php index feb5006c59..ee4bd34c19 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Prod/Query.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Prod/Query.php @@ -74,7 +74,7 @@ class Query implements ControllerProviderInterface $app['manipulator.user']->logQuery($app['authentication']->getUser(), $result->getQuery()); if ($app['settings']->getUserSetting($app['authentication']->getUser(), 'start_page') === 'LAST_QUERY') { - $app['manipulator.user']->setUserSetting($app['authentication']->getUser(), 'start_page_query', $result->getQuery()); + $app['manipulator.user']->setUserSetting($app['authentication']->getUser(), 'start_page_query', $query); } foreach ($options->getDataboxes() as $databox) { diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index 98a51f962c..73742ee0f6 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -428,7 +428,8 @@
{{ 'Status des documents a rechercher' | trans }} - {% for databox_id, flag in search_status %} + {% for status_key, flag in search_status %} + {% for databox_id in flag.sbas %} + {% endfor %} {% endfor %}
diff --git a/www/skins/prod/jquery.main-prod.js b/www/skins/prod/jquery.main-prod.js index 1389cedb48..ba29ffcb48 100644 --- a/www/skins/prod/jquery.main-prod.js +++ b/www/skins/prod/jquery.main-prod.js @@ -195,8 +195,8 @@ function checkFilters(save) { $('select option:selected:not(".default-selection")', container).removeAttr('selected').selected(false); $('select option.field_switch', container).addClass("hidden"); - $('input.field_switch:checked', container).removeAttr('checked'); + $('input.field_switch:checkbox', container).parent().hide(); filters.removeClass('danger'); @@ -209,7 +209,6 @@ function checkFilters(save) { search.bases[sbas_id] = new Array(); var bas_ckbox = $this.find('.checkbas'); - if (bas_ckbox.filter(':not(:checked)').length > 0) { danger = 'medium'; } @@ -444,10 +443,12 @@ function initAnswerForm() { var $this = $(this), method = $this.attr('method') ? $this.attr('method') : 'POST'; + var data = $this.serializeArray(); + answAjax = $.ajax({ type: method, url: $this.attr('action'), - data: $this.serialize(), + data: data, dataType: 'json', beforeSend: function (formData) { if (answAjaxrunning && answAjax.abort) @@ -3033,4 +3034,4 @@ $(document).ready(function () { } }); -}); \ No newline at end of file +});