diff --git a/lib/Alchemy/Phrasea/Controller/Client/Root.php b/lib/Alchemy/Phrasea/Controller/Client/Root.php index bce28a9a2d..7681f0ee6c 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Client/Root.php @@ -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') + )); } /** diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Query.php b/lib/Alchemy/Phrasea/Controller/Prod/Query.php index d3d7478413..5a083c4a83 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Query.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Query.php @@ -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) { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Root.php b/lib/Alchemy/Phrasea/Controller/Prod/Root.php index 19b780997e..c41b36e1c3 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Root.php @@ -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'; diff --git a/lib/Alchemy/Phrasea/Controller/User/Preferences.php b/lib/Alchemy/Phrasea/Controller/User/Preferences.php index 03311684b5..21342fbd54 100644 --- a/lib/Alchemy/Phrasea/Controller/User/Preferences.php +++ b/lib/Alchemy/Phrasea/Controller/User/Preferences.php @@ -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 !'); } diff --git a/lib/classes/databox/cgu.php b/lib/classes/databox/cgu.php index a6f12cca78..4574dad3b4 100644 --- a/lib/classes/databox/cgu.php +++ b/lib/classes/databox/cgu.php @@ -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) diff --git a/lib/classes/eventsmanager/notifyAbstract.php b/lib/classes/eventsmanager/notifyAbstract.php index 3fae9a2511..8ec559d554 100644 --- a/lib/classes/eventsmanager/notifyAbstract.php +++ b/lib/classes/eventsmanager/notifyAbstract.php @@ -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) diff --git a/templates/web/account/account.html.twig b/templates/web/account/account.html.twig index 7711e00911..2c250a8f22 100644 --- a/templates/web/account/account.html.twig +++ b/templates/web/account/account.html.twig @@ -154,7 +154,7 @@ {% for notification in nots %}
  • diff --git a/templates/web/common/caption_templates/answer.html.twig b/templates/web/common/caption_templates/answer.html.twig index ac7ed04d5e..8a03620a5b 100644 --- a/templates/web/common/caption_templates/answer.html.twig +++ b/templates/web/common/caption_templates/answer.html.twig @@ -2,7 +2,7 @@ {% for value in record.get_caption().get_highlight_fields(highlight, null, searchEngine, includeBusiness, options) %}
    {{ value.label }} : {{ value.value | thesaurus }}
    {% endfor %} - {% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %} + {% if app['authentication'].getUser().getSettingValue('technical_display') == 'group' %}
    {% include 'common/technical_datas.html.twig' %} {% endif %} diff --git a/templates/web/common/caption_templates/internal_publi.html.twig b/templates/web/common/caption_templates/internal_publi.html.twig index ac7ed04d5e..8a03620a5b 100644 --- a/templates/web/common/caption_templates/internal_publi.html.twig +++ b/templates/web/common/caption_templates/internal_publi.html.twig @@ -2,7 +2,7 @@ {% for value in record.get_caption().get_highlight_fields(highlight, null, searchEngine, includeBusiness, options) %}
    {{ value.label }} : {{ value.value | thesaurus }}
    {% endfor %} - {% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %} + {% if app['authentication'].getUser().getSettingValue('technical_display') == 'group' %}
    {% include 'common/technical_datas.html.twig' %} {% endif %} diff --git a/templates/web/common/caption_templates/lazaret.html.twig b/templates/web/common/caption_templates/lazaret.html.twig index ac7ed04d5e..8a03620a5b 100644 --- a/templates/web/common/caption_templates/lazaret.html.twig +++ b/templates/web/common/caption_templates/lazaret.html.twig @@ -2,7 +2,7 @@ {% for value in record.get_caption().get_highlight_fields(highlight, null, searchEngine, includeBusiness, options) %}
    {{ value.label }} : {{ value.value | thesaurus }}
    {% endfor %} - {% if app['authentication'].getUser().getPrefs('technical_display') == 'group' %} + {% if app['authentication'].getUser().getSettingValue('technical_display') == 'group' %}
    {% include 'common/technical_datas.html.twig' %} {% endif %} diff --git a/templates/web/prod/WorkZone/Macros.html.twig b/templates/web/prod/WorkZone/Macros.html.twig index 428e8bdc87..315bfa192e 100644 --- a/templates/web/prod/WorkZone/Macros.html.twig +++ b/templates/web/prod/WorkZone/Macros.html.twig @@ -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 %}"> - {% if app['authentication'].getUser().getPrefs('basket_title_display') == '1' %} + {% if app['authentication'].getUser().getSettingValue('basket_title_display') == '1' %}
    {{record.get_title()}}
    {% endif %} - {% if app['authentication'].getUser().getPrefs('basket_status_display') == '1' %} + {% if app['authentication'].getUser().getSettingValue('basket_status_display') == '1' %}
    {{record.get_status_icons|raw}}
    @@ -317,7 +317,7 @@ class="WorkZoneElementRemover {{ wz_scope }}" title="{{ 'delete' | trans }}" > X - {% if app['authentication'].getUser().getPrefs('basket_caption_display') == '1' %} + {% if app['authentication'].getUser().getSettingValue('basket_caption_display') == '1' %}
    {% endif %} diff --git a/templates/web/prod/actions/edit_default.html.twig b/templates/web/prod/actions/edit_default.html.twig index 981f7ce701..02f05f9d43 100644 --- a/templates/web/prod/actions/edit_default.html.twig +++ b/templates/web/prod/actions/edit_default.html.twig @@ -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 %} {% 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 @@ -
    +
    @@ -150,7 +150,7 @@
    -
    +
    {{_self.HTML_fieldlist(recordsRequest, fields)}}
    @@ -230,7 +230,7 @@
    -
    +
      {% if thesaurus %} diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index edfbd22a8f..db49536b1a 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -96,12 +96,12 @@ {% endblock %} @@ -123,7 +123,7 @@
    - {% 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 @@
    - + @@ -680,11 +680,11 @@