Commit b0431b71 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Modify selector to handle objects.

parent 3a277f19
......@@ -38,6 +38,8 @@
'Cannot be empty': 'Cannot be empty',
'careers': 'carrières',
'CAS': 'CAS',
'Cat. objet': 'Cat. objet',
'Cat. personne': 'Cat. personne',
'categories': 'catégories',
'Category': 'Catégorie',
'Catégorie': 'Catégorie',
......@@ -47,6 +49,7 @@
'Check to delete': 'Check to delete',
'Client IP': 'Client IP',
'Code': 'Code',
'Code objet': 'Code objet',
'Collections': 'Collections',
'Columns': 'Colonnes',
'Conditions': 'Conditions',
......@@ -127,6 +130,7 @@
'Filter projects': 'Filtrer les projets',
'Filter responsibilities': 'Filter les responsabilities',
'Filter teams': 'Filtrer les équipes',
'Financement': 'Financement',
'First name': 'First name',
'First Name': 'Prénom',
'For developpers': 'Pour les développeurs',
......@@ -243,7 +247,8 @@
'Note': 'Note',
'Notified': 'Notifié',
'Object': 'Objet',
'Object category': "Cat. objet",
'Object category': 'Cat. objet',
'Object code': 'Code objet',
'Object or table name': 'Object or table name',
'Open source': 'Code open source',
'Order by': 'Trié par',
......@@ -253,10 +258,11 @@
"Password fields don't match": "Password fields don't match",
'People': 'Personnes',
'people': 'personnes',
'People category': "Cat. personne",
'People category': 'Cat. personne',
'People per category': 'Personnes par catégorie',
'People per quality': 'Personnes par qualité',
'People per team': 'Personnes par équipe',
'People quality': 'Qualité personne',
'people_categories': 'catégories de personnel',
'Perc.': 'Perc.',
'Percentage': 'Pourcentage',
......@@ -285,6 +291,7 @@
'Python Code': 'Python Code',
'Quality': 'Qualité',
'Qualité': 'Qualité',
'Qualité personne': 'Qualité personne',
'Ratio': 'Ratio',
'Record ID': 'Record ID',
'Reference': 'Référence',
......
......@@ -11,14 +11,3 @@ db.define_table("people_categories",
db.people_categories._before_delete.append(INHIBIT_CASCADE_DELETE)
db.people_categories._before_delete.append(dbui.INHIBIT_DELETE_UNDEF)
db.people_categories._before_update.append(dbui.INHIBIT_UPDATE_UNDEF)
#------------------------------------------------------------------------------
#
# LIST of people categories to be used in selector
#
#------------------------------------------------------------------------------
rows = db().select(db.people_categories.category,
orderby=db.people_categories.category,
distinct=True)
PEOPLE_CATEGORIES = [el.category for el in rows]
\ No newline at end of file
# -*- coding: utf-8 -*-
""" alias_object_categories
alias tables for object_categories
"""
db.object_categories.with_alias('alias_object_categories')
# -*- coding: utf-8 -*-
""" categories
""" alias_people_categories
alias tables for people_categories
"""
db.people_categories.with_alias('categories')
db.people_categories.with_alias('alias_people_categories')
# -*- coding: utf-8 -*-
""" grid_selector
"""
virtdb.define_table('grid_selector',
Field('year_start', 'integer', default=year),
Field('year_end', 'integer'),
Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')),
Field('id_categories', 'reference categories', label= T("Category")),
Field('id_people_categories', 'reference people_categories', label= T("Quality")))
virtdb.grid_selector.id_categories.requires = \
IS_IN_DB(db, 'categories.category')
virtdb.grid_selector.id_people_categories.requires = \
IS_IN_DB(db, 'people_categories.code')
virtdb.grid_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.grid_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('grid_selector')
fieldsModifier.configure_field('year_start', flex=1)
fieldsModifier.configure_field('year_end', flex=1)
fieldsModifier.merge_fields('year_start', 'year_end', fieldLabel=T('Period'))
mytype = 'xcomboboxuserreset'
text = T('select...')
fieldsModifier.configure_field('id_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
""" people_selector
"""
virtdb.define_table('people_selector',
Field('year', 'integer', default=year),
Field('period_start', 'date'),
Field('period_end', 'date'),
Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')),
Field('category', 'string'),
Field('id_people_categories', 'reference people_categories', label= T("Quality")),
Field('id_events', 'reference events', label=T('Event')),
Field('format', 'string', default='html'))
virtdb.people_selector.category.requires = IS_IN_SET(PEOPLE_CATEGORIES)
virtdb.people_selector.id_events.requires = IS_IN_DB(db, 'events.event')
virtdb.people_selector.id_people_categories.requires = IS_IN_DB(db, 'people_categories.code')
virtdb.people_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.people_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
virtdb.people_selector.format.requires = IS_IN_SET(FORMATS)
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('people_selector')
fieldsModifier.configure_field('period_start', flex=1)
fieldsModifier.configure_field('period_end', flex=1)
fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period'))
mytype = 'xcomboboxuserreset'
text = T('select...')
fieldsModifier.configure_field('id_people_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
""" person_wizard
"""
virtdb.define_table('person_wizard',
Field("first_name", "string"),
Field("last_name", "string"),
Field("initials", "string"),
Field("birth_date", "date"),
Field("start_date", "date"),
Field("end_date", "date"),
Field("id_people_categories", 'reference people_categories', default=undef_id, label=T('Category')),
Field("id_teams", 'reference teams', label=T('Team')),
Field("id_projects", 'reference projects', default=undef_id, label=T('Project')))
virtdb.person_wizard.id_people_categories.requires = \
IS_IN_DB(db, 'people_categories.code')
virtdb.person_wizard.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.person_wizard.id_teams.requires = IS_IN_DB(db, 'teams.team')
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
#
# FORM CONFIGURATiON
#
#-------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
""" graph_selector
""" selector
"""
virtdb.define_table('graph_selector',
virtdb.define_table('selector',
Field('year_start', 'integer', default=year),
Field('year_end', 'integer'),
Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')),
Field('id_categories', 'reference categories', label= T("Category")),
Field('id_people_categories', 'reference people_categories', label= T("Quality")))
Field('id_fundings', 'reference fundings', label=T('Funding')),
Field('id_people_categories', 'reference alias_people_categories', label= T("People category")),
Field('id_people_code', 'reference people_categories', label= T("People quality")),
Field('id_object_categories', 'reference alias_object_categories', label= T("Object category")),
Field('id_object_code', 'reference object_categories', label= T("Object code")))
virtdb.graph_selector.id_categories.requires = \
IS_IN_DB(db, 'categories.category')
virtdb.graph_selector.id_people_categories.requires = \
virtdb.selector.id_object_categories.requires = \
IS_IN_DB(db, 'alias_object_categories.category')
virtdb.selector.id_object_code.requires = \
IS_IN_DB(db, 'object_categories.code')
virtdb.selector.id_people_categories.requires = \
IS_IN_DB(db, 'alias_people_categories.category')
virtdb.selector.id_people_code.requires = \
IS_IN_DB(db, 'people_categories.code')
virtdb.graph_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.graph_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
virtdb.selector.id_fundings.requires = IS_IN_DB(db, 'fundings.agency')
virtdb.selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
#-------------------------------------------------------------------------------
#
# FIELDS CONFIGURATiON
#
#-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('graph_selector')
fieldsModifier = dbui.FieldsModifier('selector')
fieldsModifier.configure_field('year_start', flex=1)
fieldsModifier.configure_field('year_end', flex=1)
fieldsModifier.merge_fields('year_start', 'year_end', fieldLabel=T('Period'))
......@@ -33,7 +44,11 @@ mytype = 'xcomboboxuserreset'
text = T('select...')
fieldsModifier.configure_field('id_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_fundings', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_object_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_object_code', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_categories', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_code', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
......
......@@ -103,7 +103,7 @@ listNode = Node(T('The lists'))
for row in db(db.lists.id > 0).select(orderby=db.lists.name):
leaf = PanelWithUrlSelector(virtdb.grid_selector,
leaf = PanelWithUrlSelector(virtdb.selector,
baseUrl=URL('report', 'grid'),
baseParams={'id_lists': row.id})
......@@ -118,7 +118,7 @@ metric1dNode = Node(T('The metrics 1d'))
for row in db(db.metrics1d.id > 0).select(orderby=db.metrics1d.name):
leaf = PanelWithUrlSelector(virtdb.grid_selector,
leaf = PanelWithUrlSelector(virtdb.selector,
baseUrl=URL('report', 'grid'),
baseParams={'id_metrics1d': row.id})
......@@ -135,7 +135,7 @@ metric2dNode = Node(T('The metrics 2d'))
for row in db(db.metrics2d.id > 0).select(orderby=db.metrics2d.name):
leaf = PanelWithUrlSelector(virtdb.grid_selector,
leaf = PanelWithUrlSelector(virtdb.selector,
baseUrl=URL('report', 'grid'),
baseParams={'id_metrics2d': row.id})
......@@ -153,7 +153,7 @@ graphNode = Node(T('The graphs'))
for row in db(db.graphs.id > 0).select(orderby=db.graphs.name):
leaf = PanelWithUrlSelector(virtdb.graph_selector,
leaf = PanelWithUrlSelector(virtdb.selector,
baseUrl=URL('report', 'graph_mpl'),
baseParams={'id_graphs': row.id})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment