mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Merge pull request #838 from romainneutron/fix-1605
[3.8] Fix #1605 : Add advanced search reset on production load.
This commit is contained in:
@@ -34,6 +34,7 @@ class Prod extends Helper
|
||||
}
|
||||
|
||||
$searchSet = json_decode($this->app['authentication']->getUser()->getPrefs('search'), true);
|
||||
$saveSettings = $this->app['authentication']->getUser()->getPrefs('advanced_search_reload');
|
||||
|
||||
foreach ($this->app['authentication']->getUser()->ACL()->get_granted_sbas() as $databox) {
|
||||
$sbas_id = $databox->get_sbas_id();
|
||||
@@ -46,8 +47,7 @@ class Prod extends Helper
|
||||
);
|
||||
|
||||
foreach ($this->app['authentication']->getUser()->ACL()->get_granted_base(array(), array($databox->get_sbas_id())) as $coll) {
|
||||
$selected = (isset($searchSet['bases']) &&
|
||||
isset($searchSet['bases'][$sbas_id])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbas_id])) : true;
|
||||
$selected = $saveSettings ? ((isset($searchSet['bases']) && isset($searchSet['bases'][$sbas_id])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbas_id])) : true) : true;
|
||||
$bases[$sbas_id]['collections'][] =
|
||||
array(
|
||||
'selected' => $selected,
|
||||
|
@@ -82,6 +82,7 @@ class User_Adapter implements User_Interface, cache_cacheableInterface
|
||||
'warning_on_delete_story' => 'true',
|
||||
'client_basket_status' => '1',
|
||||
'css' => '000000',
|
||||
'advanced_search_reload' => '1',
|
||||
'start_page_query' => 'last',
|
||||
'start_page' => 'QUERY',
|
||||
'rollover_thumbnail' => 'caption',
|
||||
|
@@ -798,6 +798,15 @@
|
||||
<li><a href="#look_box_settings">{% trans 'Configuration' %}</a></li>
|
||||
</ul>
|
||||
<div id="look_box_screen">
|
||||
<div class="box">
|
||||
<div class="" style="float:left; width:100%;margin-top:20px;">
|
||||
{% set mod = app['authentication'].getUser().getPrefs('advanced_search_reload') %}
|
||||
<label class="checkbox inline" for="user_settings_advanced_search_reload">
|
||||
<input onchange="setPref('advanced_search_reload',$(this).attr('checked')?'1' : '0');" name="advanced_search_reload" type="checkbox" style="margin: 3px 0 0 -18px;" class="checkbox" value="1" id="user_settings_advanced_search_reload" {% if mod == '1' %}checked="checked"{% endif %}/>
|
||||
{% trans 'Use latest search settings on Production loading' %}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="" style="float:left; width:49%;">
|
||||
<h1>{% trans 'Mode de presentation' %}</h1>
|
||||
|
Reference in New Issue
Block a user