mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Replace getter and setter for user & user notif setting value
This commit is contained in:
@@ -97,8 +97,8 @@ class Root implements ControllerProviderInterface
|
||||
$app['EM']->persist($userQuery);
|
||||
$app['EM']->flush();
|
||||
|
||||
if ($app['authentication']->getUser()->getPrefs('start_page') === 'LAST_QUERY') {
|
||||
$app['authentication']->getUser()->setPrefs('start_page_query', $query);
|
||||
if ($app['authentication']->getUser()->getSettingValue('start_page') === 'LAST_QUERY') {
|
||||
$app['authentication']->getUser()->setSettingValue('start_page_query', $query);
|
||||
}
|
||||
|
||||
foreach ($options->getDataboxes() as $databox) {
|
||||
@@ -261,13 +261,13 @@ class Root implements ControllerProviderInterface
|
||||
'storage_access' => $this->getDocumentStorageAccess($app),
|
||||
'tabs_setup' => $this->getTabSetup($app),
|
||||
'module' => 'client',
|
||||
'menubar' => $app['twig']->render('common/menubar.html.twig', ['module' => 'client']),
|
||||
'menubar' => $app['twig']->render('common/menubar.html.twig', array('module' => 'client')),
|
||||
'css_file' => $this->getCssFile($app),
|
||||
'basket_status' => null !== $app['authentication']->getUser()->getPrefs('client_basket_status') ? $app['authentication']->getUser()->getPrefs('client_basket_status') : "1",
|
||||
'mod_pres' => null !== $app['authentication']->getUser()->getPrefs('client_view') ? $app['authentication']->getUser()->getPrefs('client_view') : '',
|
||||
'start_page' => $app['authentication']->getUser()->getPrefs('start_page'),
|
||||
'start_page_query' => null !== $app['authentication']->getUser()->getPrefs('start_page_query') ? $app['authentication']->getUser()->getPrefs('start_page_query') : ''
|
||||
]));
|
||||
'basket_status' => $app['authentication']->getUser()->getSettingValue('client_basket_status', '1'),
|
||||
'mod_pres' => $app['authentication']->getUser()->getSettingValue('client_view', '' ),
|
||||
'start_page' => $app['authentication']->getUser()->getSettingValue('start_page'),
|
||||
'start_page_query' => $app['authentication']->getUser()->getSettingValue('start_page_query', '')
|
||||
)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -349,8 +349,8 @@ class Root implements ControllerProviderInterface
|
||||
{
|
||||
$cssPath = __DIR__ . '/../../../../../www/skins/client/';
|
||||
|
||||
$css = [];
|
||||
$cssFile = $app['authentication']->getUser()->getPrefs('client_css');
|
||||
$css = array();
|
||||
$cssFile = $app['authentication']->getUser()->getSettingValue('client_css');
|
||||
|
||||
$finder = new Finder();
|
||||
|
||||
@@ -418,7 +418,7 @@ class Root implements ControllerProviderInterface
|
||||
*/
|
||||
private function getDefaultClientStartPage(Application $app)
|
||||
{
|
||||
$startPage = strtoupper($app['authentication']->getUser()->getPrefs('start_page'));
|
||||
$startPage = strtoupper($app['authentication']->getUser()->getSettingValue('start_page'));
|
||||
|
||||
if ($startPage === 'PUBLI') {
|
||||
return $this->getPublicationStartPage($app);
|
||||
@@ -441,7 +441,7 @@ class Root implements ControllerProviderInterface
|
||||
{
|
||||
$collections = $queryParameters = [];
|
||||
|
||||
$searchSet = json_decode($app['authentication']->getUser()->getPrefs('search'));
|
||||
$searchSet = json_decode($app['authentication']->getUser()->getSettingValue('search'));
|
||||
|
||||
if ($searchSet && isset($searchSet->bases)) {
|
||||
foreach ($searchSet->bases as $bases) {
|
||||
@@ -451,9 +451,9 @@ class Root implements ControllerProviderInterface
|
||||
$collections = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_base());
|
||||
}
|
||||
|
||||
$queryParameters["mod"] = $app['authentication']->getUser()->getPrefs('client_view') ?: '3X6';
|
||||
$queryParameters["mod"] = $app['authentication']->getUser()->getSettingValue('client_view', '3X6');
|
||||
$queryParameters["bas"] = $collections;
|
||||
$queryParameters["qry"] = $app['authentication']->getUser()->getPrefs('start_page_query') ?: 'all';
|
||||
$queryParameters["qry"] = $app['authentication']->getUser()->getSettingValue('start_page_query', 'all');
|
||||
$queryParameters["pag"] = 0;
|
||||
$queryParameters["search_type"] = SearchEngineOptions::RECORD_RECORD;
|
||||
$queryParameters["qryAdv"] = '';
|
||||
@@ -479,8 +479,8 @@ class Root implements ControllerProviderInterface
|
||||
{
|
||||
return $app['twig']->render('client/home_inter_pub_basket.html.twig', [
|
||||
'feeds' => Aggregate::createFromUser($app, $app['authentication']->getUser()),
|
||||
'image_size' => (int) $app['authentication']->getUser()->getPrefs('images_size')
|
||||
]);
|
||||
'image_size' => (int) $app['authentication']->getUser()->getSettingValue('images_size')
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -52,7 +52,7 @@ class Query implements ControllerProviderInterface
|
||||
{
|
||||
$query = (string) $request->request->get('qry');
|
||||
|
||||
$mod = $app['authentication']->getUser()->getPrefs('view');
|
||||
$mod = $app['authentication']->getUser()->getSettingValue('view');
|
||||
|
||||
$json = [];
|
||||
|
||||
@@ -60,7 +60,7 @@ class Query implements ControllerProviderInterface
|
||||
|
||||
$form = $options->serialize();
|
||||
|
||||
$perPage = (int) $app['authentication']->getUser()->getPrefs('images_per_page');
|
||||
$perPage = (int) $app['authentication']->getUser()->getSettingValue('images_per_page');
|
||||
|
||||
$page = (int) $request->request->get('pag');
|
||||
$firstPage = $page < 1;
|
||||
@@ -79,8 +79,8 @@ class Query implements ControllerProviderInterface
|
||||
$app['EM']->persist($userQuery);
|
||||
$app['EM']->flush();
|
||||
|
||||
if ($app['authentication']->getUser()->getPrefs('start_page') === 'LAST_QUERY') {
|
||||
$app['authentication']->getUser()->setPrefs('start_page_query', $result->getQuery());
|
||||
if ($app['authentication']->getUser()->getSettingValue('start_page') === 'LAST_QUERY') {
|
||||
$app['authentication']->getUser()->setSettingValue('start_page_query', $result->getQuery());
|
||||
}
|
||||
|
||||
foreach ($options->getDataboxes() as $databox) {
|
||||
|
||||
@@ -65,7 +65,7 @@ class Root implements ControllerProviderInterface
|
||||
$css[$baseName] = $baseName;
|
||||
}
|
||||
|
||||
$cssfile = $app['authentication']->getUser()->getPrefs('css');
|
||||
$cssfile = $app['authentication']->getUser()->getSettingValue('css');
|
||||
|
||||
if (!$cssfile && isset($css['000000'])) {
|
||||
$cssfile = '000000';
|
||||
|
||||
@@ -85,7 +85,7 @@ class Preferences implements ControllerProviderInterface
|
||||
|
||||
$success = false;
|
||||
if (null !== $prop && null !== $value) {
|
||||
$app['authentication']->getUser()->setPrefs($prop, $value);
|
||||
$app['authentication']->getUser()->setSettingValue($prop, $value);
|
||||
$success = true;
|
||||
$msg = $app->trans('Preference saved !');
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ class databox_cgu
|
||||
if ( ! $app['acl']->get($app['authentication']->getUser())->has_access_to_sbas($databox->get_sbas_id())) {
|
||||
continue;
|
||||
}
|
||||
$userValidation = ($app['authentication']->getUser()->getPrefs('terms_of_use_' . $databox->get_sbas_id()) !== $update && trim($value) !== '');
|
||||
$userValidation = ($app['authentication']->getUser()->getSettingValue('terms_of_use_' . $databox->get_sbas_id()) !== $update && trim($value) !== '');
|
||||
}
|
||||
|
||||
if ($userValidation)
|
||||
|
||||
@@ -35,9 +35,8 @@ abstract class eventsmanager_notifyAbstract extends eventsmanager_eventAbstract
|
||||
protected function get_prefs($class, $usr_id)
|
||||
{
|
||||
$user = $this->app['manipulator.user']->getRepository()->find($usr_id);
|
||||
$pref = $user->get_notifications_preference($this->app, $class);
|
||||
|
||||
return null !== $pref ? $pref : 1;
|
||||
return $user->getNotificationSettingValue($class);
|
||||
}
|
||||
|
||||
protected function shouldSendNotificationFor($usr_id)
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
{% for notification in nots %}
|
||||
<li>
|
||||
<label class="checkbox" for="notif_{{ notification["id"] }}">
|
||||
<input type="checkbox" id="notif_{{ notification["id"] }}" name="notifications[{{ notification["id"] }}]" {% if not app["authentication"].getUser().get_notifications_preference(app, notification["id"]) == "0" %}checked{% endif %} value="1"/>
|
||||
<input type="checkbox" id="notif_{{ notification["id"] }}" name="notifications[{{ notification["id"] }}]" {% if app["authentication"].getUser().getNotificationSettingValue(notification["id"]) %}checked{% endif %} value="1"/>
|
||||
{{ notification["description"] }}
|
||||
</label>
|
||||
<p class="form_alert help-block"></p>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% for value in record.get_caption().get_highlight_fields(highlight, null, searchEngine, includeBusiness, options) %}
|
||||
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{ value.label }}</b> : {{ value.value | thesaurus }}</div>
|
||||
{% endfor %}
|
||||
{% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('technical_display') == 'group' %}
|
||||
<hr/>
|
||||
{% include 'common/technical_datas.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% for value in record.get_caption().get_highlight_fields(highlight, null, searchEngine, includeBusiness, options) %}
|
||||
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{ value.label }}</b> : {{ value.value | thesaurus }}</div>
|
||||
{% endfor %}
|
||||
{% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('technical_display') == 'group' %}
|
||||
<hr/>
|
||||
{% include 'common/technical_datas.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% for value in record.get_caption().get_highlight_fields(highlight, null, searchEngine, includeBusiness, options) %}
|
||||
<div class="desc{% if loop.index is odd %}im{% endif %}pair"><b>{{ value.label }}</b> : {{ value.value | thesaurus }}</div>
|
||||
{% endfor %}
|
||||
{% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('technical_display') == 'group' %}
|
||||
<hr/>
|
||||
{% include 'common/technical_datas.html.twig' %}
|
||||
{% endif %}
|
||||
|
||||
@@ -276,10 +276,10 @@
|
||||
|
||||
{% macro element(wz_scope, container, contained, record, ord) %}
|
||||
{% set box_height = 110 %}
|
||||
{% if app['authentication'].getUser().getPrefs('basket_title_display') == '1' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('basket_title_display') == '1' %}
|
||||
{% set box_height = (box_height + 20) %}
|
||||
{% endif %}
|
||||
{% if app['authentication'].getUser().getPrefs('basket_status_display') == '1' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('basket_status_display') == '1' %}
|
||||
{% set box_height = (box_height + 20) %}
|
||||
{% endif %}
|
||||
|
||||
@@ -289,12 +289,12 @@
|
||||
class="CHIM diapo CHIM_{{record.get_serialize_key()}}" style="height:{{box_height}}px;"
|
||||
id="CHIM_{% if wz_scope == 'groupings' %}{{record.get_serialize_key()}}{% else %}{{ contained.getId() }}{% endif %}">
|
||||
<input type="hidden" name="id" value="{{ record.get_serialize_key() }}"/>
|
||||
{% if app['authentication'].getUser().getPrefs('basket_title_display') == '1' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('basket_title_display') == '1' %}
|
||||
<div class="title">
|
||||
{{record.get_title()}}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if app['authentication'].getUser().getPrefs('basket_status_display') == '1' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('basket_status_display') == '1' %}
|
||||
<div class="status" style="position:relative;height:20px;overflow-y:visible;z-index:15;">
|
||||
{{record.get_status_icons|raw}}
|
||||
</div>
|
||||
@@ -317,7 +317,7 @@
|
||||
class="WorkZoneElementRemover {{ wz_scope }}" title="{{ 'delete' | trans }}" >
|
||||
X
|
||||
</a>
|
||||
{% if app['authentication'].getUser().getPrefs('basket_caption_display') == '1' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('basket_caption_display') == '1' %}
|
||||
<div class="captionRolloverTips" tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'basket', 'number' : record.get_number() }) }}"></div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
{% set cont_width = 130 %}
|
||||
{% set cont_height = 140 %}
|
||||
{% else %}
|
||||
{% set cont_width = app['authentication'].getUser().getPrefs('editing_images_size') %}
|
||||
{% set cont_height = app['authentication'].getUser().getPrefs('editing_images_size') %}
|
||||
{% set cont_width = app['authentication'].getUser().getSettingValue('editing_images_size') %}
|
||||
{% set cont_height = app['authentication'].getUser().getSettingValue('editing_images_size') %}
|
||||
{% endif %}
|
||||
|
||||
{% set i = record.get_number() %}
|
||||
@@ -71,8 +71,8 @@
|
||||
{% trans %}prod::editing::fields: status{% endtrans %}
|
||||
</div>
|
||||
{% set cssfile = '000000' %}
|
||||
{% if app['authentication'].getUser().getPrefs('css') %}
|
||||
{% set cssfile = app['authentication'].getUser().getPrefs('css') %}
|
||||
{% if app['authentication'].getUser().getSettingValue('css') %}
|
||||
{% set cssfile = app['authentication'].getUser().getSettingValue('css') %}
|
||||
{% endif %}
|
||||
{% for field in fields %}
|
||||
{% set i = field.get_id() %}
|
||||
@@ -127,7 +127,7 @@
|
||||
<input style="font-size:2px; width:5px;" type="text" id="editFakefocus" />
|
||||
</form>
|
||||
</div>
|
||||
<div id="EDIT_TOP" style="height:{{app['authentication'].getUser().getPrefs('editing_top_box')}}%;">
|
||||
<div id="EDIT_TOP" style="height:{{app['authentication'].getUser().getSettingValue('editing_top_box')}};">
|
||||
<div id="EDIT_MENU">
|
||||
<div id="EDIT_ZOOMSLIDER" >
|
||||
</div>
|
||||
@@ -150,7 +150,7 @@
|
||||
|
||||
<div id='EDIT_MID'>
|
||||
<div id='EDIT_MID_L' class='ui-corner-all'>
|
||||
<div id="divS_wrapper" style="width:{{app['authentication'].getUser().getPrefs('editing_right_box')}}%">
|
||||
<div id="divS_wrapper" style="width:{{app['authentication'].getUser().getSettingValue('editing_right_box')}}">
|
||||
<div id="divS">
|
||||
{{_self.HTML_fieldlist(recordsRequest, fields)}}
|
||||
</div>
|
||||
@@ -230,7 +230,7 @@
|
||||
<div id="idExplain" class="PNB"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="EDIT_MID_R" style="width:{{app['authentication'].getUser().getPrefs('editing_left_box')}}%;">
|
||||
<div id="EDIT_MID_R" style="width:{{app['authentication'].getUser().getSettingValue('editing_left_box')}}">
|
||||
<div style='position:absolute; top:0; left:0; right:0; bottom:0;' class='tabs'>
|
||||
<ul>
|
||||
{% if thesaurus %}
|
||||
|
||||
@@ -96,12 +96,12 @@
|
||||
|
||||
<style title="color_selection" type="text/css">
|
||||
/* .diapo.ui-selecting,#reorder_box .diapo.selecting, #EDIT_ALL .diapo.selecting, .list.selecting, .list.selecting .diapo {
|
||||
color: #{% if app['authentication'].getUser().getPrefs('fontcolor-selection') != '' %}{{app['authentication'].getUser().getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %};
|
||||
background-color: #{% if app['authentication'].getUser().getPrefs('background-selection-disabled') != '' %}{{app['authentication'].getUser().getPrefs('background-selection-disabled')}}{% else %}333333{% endif %};
|
||||
color: #{{ app['authentication'].getUser().getSettingValue('fontcolor-selection', 'FFFFFF') }};
|
||||
background-color: #{{ app['authentication'].getUser().getSettingValue('background-selection-disabled', '333333')}}};
|
||||
}*/
|
||||
.diapo.selected,#reorder_box .diapo.selected, #EDIT_ALL .diapo.selected, .list.selected, .list.selected .diapo {
|
||||
color: #{% if app['authentication'].getUser().getPrefs('fontcolor-selection') != '' %}{{app['authentication'].getUser().getPrefs('fontcolor-selection')}}{% else %}FFFFFF{% endif %};
|
||||
background-color: #{% if app['authentication'].getUser().getPrefs('background-selection') != '' %}{{app['authentication'].getUser().getPrefs('background-selection')}}{% else %}404040{% endif %};
|
||||
color: #{{app['authentication'].getUser().getSettingValue('fontcolor-selection', 'FFFFFF')}};
|
||||
background-color: #{{app['authentication'].getUser().getSettingValue('background-selection', '404040')}};
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
@@ -123,7 +123,7 @@
|
||||
</div>
|
||||
|
||||
<div id="desktop" class="PNB" style="overflow:hidden;">
|
||||
{% set ratio = app['authentication'].getUser().getPrefs('search_window') %}
|
||||
{% set ratio = app['authentication'].getUser().getSettingValue('search_window') %}
|
||||
{% if ratio == 0 %}
|
||||
{% set ratio = '0.333' %}
|
||||
{% endif %}
|
||||
@@ -283,7 +283,7 @@
|
||||
<div style="margin: 15px auto; line-height: 30px; width: 580px;">
|
||||
<form id="searchForm" method="POST" action="{{ path('prod_query') }}" name="phrasea_query" class="phrasea_query">
|
||||
<div class="input-append">
|
||||
<input autocomplete="off" class="search query" id="EDIT_query" name="qry" type="text" name="qry" value="{{app['authentication'].getUser().getPrefs('start_page_query')}}">
|
||||
<input autocomplete="off" class="search query" id="EDIT_query" name="qry" type="text" name="qry" value="{{app['authentication'].getUser().getSettingValue('start_page_query')}}">
|
||||
<a href="#" class="btn btn-inverse adv_trigger adv_search_button">
|
||||
<img src="/skins/icons/settings.png" title="{{ 'Advanced Search' | trans }}"/>
|
||||
</a>
|
||||
@@ -680,11 +680,11 @@
|
||||
<div id="answers" class=" PNB10" style="top:48px; bottom:30px;">
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
{% if app['authentication'].getUser().getPrefs('start_page') == 'QUERY' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('start_page') == 'QUERY' %}
|
||||
$('form[name="phrasea_query"]').addClass('triggerAfterInit');
|
||||
{% elseif app['authentication'].getUser().getPrefs('start_page') == 'LAST_QUERY' %}
|
||||
{% elseif app['authentication'].getUser().getSettingValue('start_page') == 'LAST_QUERY' %}
|
||||
$('form[name="phrasea_query"]').addClass('triggerAfterInit');
|
||||
{% elseif app['authentication'].getUser().getPrefs('start_page') == 'PUBLI' %}
|
||||
{% elseif app['authentication'].getUser().getSettingValue('start_page') == 'PUBLI' %}
|
||||
getHome('PUBLI');
|
||||
{% endif %}
|
||||
});
|
||||
@@ -741,7 +741,7 @@
|
||||
<div id="MESSAGE-push"></div>
|
||||
<div id="MESSAGE-publi"></div>
|
||||
<div id="DIALOG"></div>
|
||||
<div id="keyboard-dialog" class="{% if app['authentication'].getUser().getPrefs('keyboard_infos') != '0' %}auto{% endif %}" style="display:none;" title="{{ 'raccourci :: a propos des raccourcis claviers' | trans }}">
|
||||
<div id="keyboard-dialog" class="{% if app['authentication'].getUser().getSettingValue('keyboard_infos') != '0' %}auto{% endif %}" style="display:none;" title="{{ 'raccourci :: a propos des raccourcis claviers' | trans }}">
|
||||
<div>
|
||||
<h1>{{ 'Raccourcis claviers en cours de recherche :' | trans }}</h1>
|
||||
<ul>
|
||||
@@ -813,6 +813,8 @@
|
||||
</div>
|
||||
<div class="box">
|
||||
<div class="" style="float:left; width:49%;">
|
||||
<h1>{{ 'Mode de presentation' | trans }}</h1>
|
||||
{% set mod = app['authentication'].getUser().getSettingValue('view') %}
|
||||
<h1>{{ 'Mode de presentation' | trans }}</h1>
|
||||
{% set mod = app['authentication'].getUser().getPrefs('view') %}
|
||||
<label class="radio inline" for="thumbs_view">
|
||||
@@ -833,7 +835,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="box">
|
||||
{% set rollover_thumbnail = app['authentication'].getUser().getPrefs('rollover_thumbnail') %}
|
||||
{% set rollover_thumbnail = app['authentication'].getUser().getSettingValue('rollover_thumbnail') %}
|
||||
<h1>{{ 'Presentation de vignettes' | trans }}</h1>
|
||||
<label class="radio" for="rollover_caption">
|
||||
<input onchange="setPref('rollover_thumbnail',$(this).val());" name="rollover_thumbnail" type="radio" class="radio" value="caption" id="rollover_caption" {% if rollover_thumbnail == 'caption' %}checked="checked" {% endif %}/>
|
||||
@@ -845,7 +847,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="box">
|
||||
{% set technical_display = app['authentication'].getUser().getPrefs('technical_display') %}
|
||||
{% set technical_display = app['authentication'].getUser().getSettingValue('technical_display') %}
|
||||
<h1>{{ 'Informations techniques' | trans }}</h1>
|
||||
<label class="radio" for="technical_show">
|
||||
<input onchange="setPref('technical_display',$(this).val());" name="technical_display" type="radio" class="radio" value="1" id="technical_show" {% if technical_display == '1' %}checked="checked"{% endif %}/>
|
||||
@@ -861,7 +863,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="box">
|
||||
{% set doctype_display = app['authentication'].getUser().getPrefs('doctype_display') %}
|
||||
{% set doctype_display = app['authentication'].getUser().getSettingValue('doctype_display') %}
|
||||
<h1>{{ 'Type de documents' | trans }}</h1>
|
||||
<label class="checkbox" for="doctype_display_show">
|
||||
<input onchange="setPref('doctype_display',($(this).attr('checked') ? '1' :'0'));" name="doctype_display" type="checkbox" class="checkbox" value="1" id="doctype_display_show" {% if doctype_display != '0' %}checked="checked"{% endif %}/>
|
||||
@@ -874,14 +876,14 @@
|
||||
<h1>{{ 'reponses:: images par pages :' | trans }}</h1>
|
||||
<div class="box">
|
||||
<div id="nperpage_slider" class="ui-corner-all" style="width:100px; display:inline-block;"></div>
|
||||
<input type="text" readonly style="width:35px;" value="{{app['authentication'].getUser().getPrefs('images_per_page')}}" id="nperpage_value"/>
|
||||
<input type="text" readonly style="width:35px;" value="{{app['authentication'].getUser().getSettingValue('images_per_page')}}" id="nperpage_value"/>
|
||||
</div>
|
||||
</div>
|
||||
<div style="float:right; width:49%;">
|
||||
<h1>{{ 'reponses:: taille des images :' | trans }}</h1>
|
||||
<div class="box">
|
||||
<div id="sizeAns_slider" class="ui-corner-all" style="width:100px;display:inline-block;"></div>
|
||||
<input type="hidden" value="{{app['authentication'].getUser().getPrefs('images_size')}}" id="sizeAns_value"/>
|
||||
<input type="hidden" value="{{app['authentication'].getUser().getSettingValue('images_size')}}" id="sizeAns_value"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -897,7 +899,7 @@
|
||||
<div class="box">
|
||||
<h1>{{ 'Affichage au demarrage' | trans }}</h1>
|
||||
<form class="form-inline">
|
||||
{% set start_page_pref = app['authentication'].getUser().getPrefs('start_page') %}
|
||||
{% set start_page_pref = app['authentication'].getUser().getSettingValue('start_page') %}
|
||||
<select class="span4" name="start_page" onchange="start_page_selector();">
|
||||
<option value="LAST_QUERY" {% if start_page_pref == 'LAST_QUERY' %}selected="selected"{% endif %} >
|
||||
{{ 'Ma derniere question' | trans }}
|
||||
@@ -912,7 +914,7 @@
|
||||
{{ 'Aide' | trans }}
|
||||
</option>
|
||||
</select>
|
||||
<input type="text" class="span4" name="start_page_value" value="{{app['authentication'].getUser().getPrefs('start_page_query')}}" style="display:{% if start_page_pref == 'QUERY' %}inline{% else %}none{% endif %}" />
|
||||
<input type="text" class="span4" name="start_page_value" value="{{app['authentication'].getUser().getSettingValue('start_page_query')}}" style="display:{% if start_page_pref == 'QUERY' %}inline{% else %}none{% endif %}" />
|
||||
<input type="button" class="btn btn-inverse" value="{{ 'boutton::valider' | trans }}" onclick="set_start_page();" />
|
||||
</form>
|
||||
</div>
|
||||
@@ -982,7 +984,7 @@
|
||||
<div class="box">
|
||||
<h1>{{ 'Presentation de vignettes de panier' | trans }}</h1>
|
||||
<div>
|
||||
{% set basket_status_display = app['authentication'].getUser().getPrefs('basket_status_display') %}
|
||||
{% set basket_status_display = app['authentication'].getUser().getSettingValue('basket_status_display') %}
|
||||
<label for="basket_status_display" class="checkbox">
|
||||
<input onchange="setPref('basket_status_display',($(this).attr('checked') ? '1' :'0'));"
|
||||
name="basket_status_display" type="checkbox" class="checkbox" value="1"
|
||||
@@ -991,7 +993,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
{% set basket_caption_display = app['authentication'].getUser().getPrefs('basket_caption_display') %}
|
||||
{% set basket_caption_display = app['authentication'].getUser().getSettingValue('basket_caption_display') %}
|
||||
<label for="basket_caption_display" class="checkbox">
|
||||
<input onchange="setPref('basket_caption_display',($(this).attr('checked') ? '1' :'0'));"
|
||||
name="basket_caption_display" type="checkbox" class="checkbox" value="1"
|
||||
@@ -1000,7 +1002,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
{% set basket_title_display = app['authentication'].getUser().getPrefs('basket_title_display') %}
|
||||
{% set basket_title_display = app['authentication'].getUser().getSettingValue('basket_title_display') %}
|
||||
<label for="basket_title_display" class="checkbox">
|
||||
<input onchange="setPref('basket_title_display',($(this).attr('checked') ? '1' :'0'));"
|
||||
name="basket_title_display" type="checkbox" class="checkbox" value="1"
|
||||
@@ -1022,7 +1024,7 @@
|
||||
<script type="text/javascript" src="{{ path('minifier', { 'g' : 'prod' }) }}"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
p4.reg_delete="{% if app['authentication'].getUser().getPrefs("warning_on_delete_story") %}true{% else %}false{% endif %}";
|
||||
p4.reg_delete="{% if app['authentication'].getUser().getSettingValue("warning_on_delete_story") %}true{% else %}false{% endif %}";
|
||||
});
|
||||
|
||||
function sessionactive(){
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{% trans with {'%link%' : link} %}Voulez-vous dire %link% ?{% endtrans %}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% set th_size = app['authentication'].getUser().getPrefs('images_size')%}
|
||||
{% set th_size = app['authentication'].getUser().getSettingValue('images_size')%}
|
||||
<div class="selectable" style="margin:10px 0; float:left;">
|
||||
{% block content %}{% endblock %}
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<div class="fixeddesc">
|
||||
{% set business = app['acl'].get(app['authentication'].getUser()).has_right_on_base(record.get_base_id(), 'canmodifrecord') %}
|
||||
{{caption.format_caption(record, highlight, searchEngine, searchOptions, business)}}
|
||||
{% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %}<hr/>{{record.get_technical_infos|raw}}{% endif %}
|
||||
{% if app['authentication'].getUser().getSettingValue('technical_display') == 'group' %}<hr/>{{record.get_technical_infos|raw}}{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% set th_size = app['authentication'].getUser().getPrefs('images_size')%}
|
||||
{% set th_size = app['authentication'].getUser().getSettingValue('images_size')%}
|
||||
|
||||
{% if app['locale'] == 'fr' %}
|
||||
<div class="client_help">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{% import 'common/thumbnail.html.twig' as thumbnail %}
|
||||
{% import 'common/doctype_icons.html.twig' as doctype_icons %}
|
||||
{% import 'common/drop_down_options.html.twig' as drop_down %}
|
||||
{% set th_size = app['authentication'].getUser().getPrefs('images_size')%}
|
||||
{% set th_size = app['authentication'].getUser().getSettingValue('images_size')%}
|
||||
{% set sbas_id = record.get_sbas_id %}
|
||||
{% if entry_id %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{sbas_id}}"
|
||||
@@ -31,8 +31,8 @@
|
||||
</div>
|
||||
{% set rollover_gif = record.get_rollover_thumbnail() %}
|
||||
|
||||
{% set user_technical_display = app['authentication'].getUser().getPrefs('technical_display') %}
|
||||
{% set user_rollover_thumbnail = app['authentication'].getUser().getPrefs('rollover_thumbnail') %}
|
||||
{% set user_technical_display = app['authentication'].getUser().getSettingValue('technical_display') %}
|
||||
{% set user_rollover_thumbnail = app['authentication'].getUser().getSettingValue('rollover_thumbnail') %}
|
||||
|
||||
{% set extraclass = '' %}
|
||||
{% if user_rollover_thumbnail == 'caption' and searchEngine is not null %}
|
||||
@@ -47,7 +47,7 @@
|
||||
{% endif %}
|
||||
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltipsrc}}" style="height:{{th_size}}px; z-index:90;">
|
||||
<div class="doc_infos">
|
||||
{% if app['authentication'].getUser().getPrefs('doctype_display') == '1' %}
|
||||
{% if app['authentication'].getUser().getSettingValue('doctype_display') == '1' %}
|
||||
{{doctype_icons.format(record)}}
|
||||
{% endif %}
|
||||
<span class="duration">
|
||||
|
||||
@@ -61,15 +61,15 @@ class RootTest extends \PhraseanetAuthenticatedWebTestCase
|
||||
*/
|
||||
public function testExecuteQuery()
|
||||
{
|
||||
$queryParameters = [];
|
||||
$queryParameters["mod"] = self::$DI['user']->getPrefs('client_view') ? : '3X6';
|
||||
$queryParameters = array();
|
||||
$queryParameters["mod"] = self::$DI['user']->getSettingValue('client_view', '3X6');
|
||||
$queryParameters["bas"] = array_keys(self::$DI['app']['acl']->get(self::$DI['user'])->get_granted_base());
|
||||
$queryParameters["qry"] = self::$DI['user']->getPrefs('start_page_query') ? : 'all';
|
||||
$queryParameters["qry"] = self::$DI['user']->getSettingValue('start_page_query', 'all');
|
||||
$queryParameters["pag"] = 0;
|
||||
$queryParameters["search_type"] = SearchEngineOptions::RECORD_RECORD;
|
||||
$queryParameters["qryAdv"] = '';
|
||||
$queryParameters["opAdv"] = [];
|
||||
$queryParameters["status"] = [];
|
||||
$queryParameters["opAdv"] = array();
|
||||
$queryParameters["status"] = array();
|
||||
$queryParameters["recordtype"] = SearchEngineOptions::TYPE_ALL;
|
||||
$queryParameters["sort"] = '';
|
||||
$queryParameters["infield"] = [];
|
||||
|
||||
@@ -12,12 +12,12 @@ class PreferencesTest extends \PhraseanetAuthenticatedWebTestCase
|
||||
public function testSaveUserPref()
|
||||
{
|
||||
self::$DI['app']['authentication']->setUser($this->getMockBuilder('Alchemy\Phrasea\Model\Entities\User')
|
||||
->setMethods(array('setPrefs'))
|
||||
->setMethods(array('setSettingValue'))
|
||||
->disableOriginalConstructor()
|
||||
->getMock());
|
||||
|
||||
self::$DI['app']['authentication']->getUser()->expects($this->once())
|
||||
->method('setPrefs')
|
||||
->method('setSettingValue')
|
||||
->with($this->equalTo('prop_test'), $this->equalTo('val_test'))
|
||||
->will($this->returnValue(true));
|
||||
|
||||
|
||||
@@ -73,9 +73,9 @@ class userTest extends \PhraseanetTestCase
|
||||
{
|
||||
$user = $this->get_user();
|
||||
|
||||
$this->assertNull($user->getPrefs('lalala'));
|
||||
$this->assertSame('popo', $user->getPrefs('lalala', 'popo'));
|
||||
$this->assertSame(User::$defaultUserSettings['editing_top_box'], $user->getPrefs('editing_top_box'));
|
||||
$this->assertNull($user->getSettingValue('lalala'));
|
||||
$this->assertSame('popo', $user->getSettingValue('lalala', 'popo'));
|
||||
$this->assertSame(User::$defaultUserSettings['editing_top_box'], $user->getSettingValue('editing_top_box'));
|
||||
}
|
||||
|
||||
public function testGetPrefWithACustomizedConf()
|
||||
@@ -109,26 +109,26 @@ class userTest extends \PhraseanetTestCase
|
||||
{
|
||||
$user = $this->get_user();
|
||||
|
||||
$user->setPrefs('prout', 'pooop');
|
||||
$this->assertSame('pooop', $user->getPrefs('prout'));
|
||||
$user->setSettingValue('prout', 'pooop');
|
||||
$this->assertSame('pooop', $user->getSettingValue('prout'));
|
||||
}
|
||||
|
||||
public function testGetNotificationPref()
|
||||
{
|
||||
$user = $this->get_user();
|
||||
|
||||
$this->assertSame('1', $user->get_notifications_preference(self::$DI['app'], 'eventsmanager_notify_push'));
|
||||
$this->assertSame('1', $user->getNotificationSettingValue('eventsmanager_notify_push'));
|
||||
}
|
||||
|
||||
public function testNotificationPref()
|
||||
{
|
||||
$user = $this->get_user();
|
||||
|
||||
$this->assertSame('1', $user->get_notifications_preference(self::$DI['app'], 'eventsmanager_notify_push'));
|
||||
$user->set_notification_preference(self::$DI['app'], 'eventsmanager_notify_push', false);
|
||||
$this->assertSame('0', $user->get_notifications_preference(self::$DI['app'], 'eventsmanager_notify_push'));
|
||||
$user->set_notification_preference(self::$DI['app'], 'eventsmanager_notify_push', true);
|
||||
$this->assertSame('1', $user->get_notifications_preference(self::$DI['app'], 'eventsmanager_notify_push'));
|
||||
$this->assertSame('1', $user->getNotificationSettingValue('eventsmanager_notify_push'));
|
||||
$user->setNotificationSettingValue('eventsmanager_notify_push', false);
|
||||
$this->assertSame('0', $user->getNotificationSettingValue('eventsmanager_notify_push'));
|
||||
$user->setNotificationSettingValue('eventsmanager_notify_push', true);
|
||||
$this->assertSame('1', $user->getNotificationSettingValue('eventsmanager_notify_push'));
|
||||
}
|
||||
|
||||
private function get_user()
|
||||
|
||||
Reference in New Issue
Block a user