Preference.py 4.41 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
##############################################################################
#
# Copyright (c) 2005 Nexedi SARL and Contributors. All Rights Reserved.
#                    Jerome Perrin <jerome@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
##############################################################################

29
class Preference:
30 31
  """
    User Preference PropertySheet
Jean-Paul Smets's avatar
Jean-Paul Smets committed
32 33

    XXX: why is this here and not in ERP5Form ?
34 35 36
  """
  
  _properties = (
37 38 39 40 41 42
    { 'id'          : 'priority',
      'description' : 'Priority of the preference.',
      'type'        : 'int',
      'default'     : 3, # ( Priority.USER )
      'mode'        : 'w',
      'write_permission': 'View management screens', },
43 44 45 46 47 48
    { 'id'          : 'preferred_section_category',
      'description' : 'The section category for documents; '\
                         'usually something like group/nexedi.',
      'type'        : 'string',
      'preference'  : 1,
      'mode'        : 'w'},
49 50 51 52 53
    { 'id'          : 'preferred_section',
      'description' : 'The section Organisation for documents.',
      'type'        : 'string',
      'preference'  : 1,
      'mode'        : 'w'},
Yoshinori Okuji's avatar
Yoshinori Okuji committed
54 55 56 57 58
    { 'id'          : 'preferred_date_order',
      'description' : 'The order of year, month and day.',
      'type'        : 'string',
      'preference'  : 1,
      'mode'        : 'w'},
59 60 61 62 63
    { 'id'          : 'preferred_money_quantity_style',
      'description' : 'The style of money quantities.',
      'type'        : 'string',
      'preference'  : 1,
      'mode'        : 'w'},
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
    { 'id'          : 'preferred_text_editor',
      'description' : 'Preferred Text Editor',
      'type'        : 'selection',
      'select_variable' : 'getPreferredTextEditorSelectionList',
      'preference'  : 1,
      'mode'        : '' },
    { 'id'          : 'preferred_text_format',
      'description' : 'Preferred Text Format',
      'type'        : 'selection',
      'select_variable' : 'getPreferredTextFormatSelectionList',
      'preference'  : 1,
      'mode'        : '' },
    { 'id'              : 'preferred_text_editor_selection',
      'description'     : 'List of possible values for preferred_document_text_editor',
      'type'            : 'tokens',
      'default'         : ['text_area','fck_editor',],
      'mode'            : 'w'},
    { 'id'              : 'preferred_text_format_selection',
      'description'     : 'List of possible values for preferred_document_text_format',
      'type'            : 'tokens',
      'default'         : ['plain','html',],
      'mode'            : 'w'},
86 87 88 89
    { 'id'              : 'preferred_time_zone',
      'description'     : 'Preferred timezone',
      'type'            : 'string',
      'default'         : '',
90
      'preference'      : 1,
91
      'mode'            : 'w'},
92
    { 'id'              : 'preferred_max_user_inactivity_duration',
93 94 95
      'description'     : 'Maximum user\'s inactivity duration in seconds before user is automatically logged out',
      'type'            : 'float',
      'default'         : '',
96
      'preference'      : 1,
97
      'mode'            : 'w'},
98 99 100 101 102 103 104
    { 'id'              : 'preferred_criterion_property',
      'description'     : 'List of criterion properties used for predicate',
      'type'            : 'tokens',
      'default'         : ['quantity', 'price', 'portal_type',
                           'title', 'reference', 'language',],
      'preference'      : 1,
      'mode'            : 'w'},
105 106
  )