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

Invert the file names between list and metric selector. Add the agency

in the list selector.
parent 3a8c6571
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
'Add trainee': 'Ajouter un stagiaire', 'Add trainee': 'Ajouter un stagiaire',
'administrators, team leader,...': 'administrators, team leader,...', 'administrators, team leader,...': 'administrators, team leader,...',
'Age': 'Age', 'Age': 'Age',
'Agence': 'Agence',
'Agencies': 'Agences', 'Agencies': 'Agences',
'agencies': 'agences', 'agencies': 'agences',
'Agency': 'Agence', 'Agency': 'Agence',
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" metric_selector """ list_selector
""" """
virtdb.define_table('metric_selector', virtdb.define_table('list_selector',
Field('year', 'integer', default=year), Field('year', 'integer', default=year),
Field('period_start', 'date'), Field('period_start', 'date'),
Field('period_end', 'date'), Field('period_end', 'date'),
Field('id_people', 'reference people', label=T('Person')),
Field('category', 'string'), Field('category', 'string'),
Field('id_people_categories', 'reference people_categories', label= T("Quality")), Field('id_people_categories', 'reference people_categories', label= T("Quality")),
Field('id_teams', 'reference teams', label=T('Team')), Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')), Field('id_projects', 'reference projects', label=T('Project')),
Field('metric', 'string', default='sum_fte')) Field('id_events', 'reference events', label=T('List')),
Field('id_fundings', 'reference fundinds', label=T('Agency')),
Field('format', 'string', default='html'))
virtdb.metric_selector.category.requires = IS_IN_SET(PEOPLE_CATEGORIES) virtdb.list_selector.category.requires = IS_IN_SET(PEOPLE_CATEGORIES)
virtdb.metric_selector.id_people_categories.requires = IS_IN_DB(db, 'people_categories.code') virtdb.list_selector.id_people_categories.requires = IS_IN_DB(db, 'people_categories.code')
virtdb.metric_selector.id_projects.requires = IS_IN_DB(db, 'projects.project') virtdb.list_selector.id_events.requires = IS_IN_DB(db, 'events.event')
virtdb.metric_selector.id_teams.requires = IS_IN_DB(db, 'teams.team') virtdb.list_selector.id_fundings.requires = IS_IN_DB(db, 'fundings.agency')
virtdb.list_selector.id_people.requires = IS_IN_DB(db, 'people.last_name')
virtdb.list_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.list_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
virtdb.metric_selector.metric.requires = IS_IN_SET(('avg_age', 'count', 'sum_fte')) virtdb.list_selector.format.requires = IS_IN_SET(FORMATS)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# #
# FIELDS CONFIGURATiON # FIELDS CONFIGURATiON
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('metric_selector') fieldsModifier = dbui.FieldsModifier('list_selector')
fieldsModifier.configure_field('period_start', flex=1) fieldsModifier.configure_field('period_start', flex=1)
fieldsModifier.configure_field('period_end', flex=1) fieldsModifier.configure_field('period_end', flex=1)
fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period')) fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period'))
...@@ -33,9 +39,11 @@ fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period') ...@@ -33,9 +39,11 @@ fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period')
mytype = 'xcomboboxuserreset' mytype = 'xcomboboxuserreset'
text = T('select...') text = T('select...')
fieldsModifier.configure_field('id_people', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_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_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype) fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_events', emptyText=text, xtype=mytype)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# #
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" list_selector """ metric_selector
""" """
virtdb.define_table('list_selector', virtdb.define_table('metric_selector',
Field('year', 'integer', default=year), Field('year', 'integer', default=year),
Field('period_start', 'date'), Field('period_start', 'date'),
Field('period_end', 'date'), Field('period_end', 'date'),
Field('id_people', 'reference people', label=T('Person')),
Field('category', 'string'), Field('category', 'string'),
Field('id_people_categories', 'reference people_categories', label= T("Quality")), Field('id_people_categories', 'reference people_categories', label= T("Quality")),
Field('id_teams', 'reference teams', label=T('Team')), Field('id_teams', 'reference teams', label=T('Team')),
Field('id_projects', 'reference projects', label=T('Project')), Field('id_projects', 'reference projects', label=T('Project')),
Field('id_events', 'reference events', label=T('List')), Field('metric', 'string', default='sum_fte'))
Field('format', 'string', default='html'))
virtdb.list_selector.category.requires = IS_IN_SET(PEOPLE_CATEGORIES) virtdb.metric_selector.category.requires = IS_IN_SET(PEOPLE_CATEGORIES)
virtdb.list_selector.id_people_categories.requires = IS_IN_DB(db, 'people_categories.code') virtdb.metric_selector.id_people_categories.requires = IS_IN_DB(db, 'people_categories.code')
virtdb.list_selector.id_events.requires = IS_IN_DB(db, 'events.event') virtdb.metric_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.list_selector.id_people.requires = IS_IN_DB(db, 'people.last_name') virtdb.metric_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
virtdb.list_selector.id_projects.requires = IS_IN_DB(db, 'projects.project')
virtdb.list_selector.id_teams.requires = IS_IN_DB(db, 'teams.team')
virtdb.list_selector.format.requires = IS_IN_SET(FORMATS) virtdb.metric_selector.metric.requires = IS_IN_SET(('avg_age', 'count', 'sum_fte'))
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# #
# FIELDS CONFIGURATiON # FIELDS CONFIGURATiON
# #
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
fieldsModifier = dbui.FieldsModifier('list_selector') fieldsModifier = dbui.FieldsModifier('metric_selector')
fieldsModifier.configure_field('period_start', flex=1) fieldsModifier.configure_field('period_start', flex=1)
fieldsModifier.configure_field('period_end', flex=1) fieldsModifier.configure_field('period_end', flex=1)
fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period')) fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period'))
...@@ -37,11 +33,9 @@ fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period') ...@@ -37,11 +33,9 @@ fieldsModifier.merge_fields('period_start', 'period_end', fieldLabel=T('Period')
mytype = 'xcomboboxuserreset' mytype = 'xcomboboxuserreset'
text = T('select...') text = T('select...')
fieldsModifier.configure_field('id_people', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_people_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_teams', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype) fieldsModifier.configure_field('id_projects', emptyText=text, xtype=mytype)
fieldsModifier.configure_field('id_events', emptyText=text, xtype=mytype)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# #
......
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