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

Lists can be produced for any kind of events.

parent da308dbd
......@@ -75,17 +75,14 @@ def people():
# instantiate the selector
selector = MySelector(virtdb.people_selector,
exclude_fields=('category',
'year',
'period_start',
'period_end'))
'period_end',
'year'))
iframe = selector.download()
if iframe:
return iframe
# add constraint to avoid event (diploma, distinction,...)
selector.append_query(db.history.id_events == undef_id)
# add constraints to select category of people
if selector.category:
selector.append_query(db.people_categories.category == selector.category)
......
......@@ -152,6 +152,9 @@
"Password fields don't match": "Password fields don't match",
'people': 'personnes',
'People': 'Personnes',
'People per category': 'Personnes par catégorie',
'People per quality': 'Personnes par qualité',
'People per team': 'Personnes par équipe',
'people_categories': 'catégories de personnel',
'Percentage': 'Pourcentage',
'Period': 'Période',
......
......@@ -42,10 +42,10 @@ virtdb.define_table('list_selector',
Field('period_start', 'date'),
Field('period_end', 'date'),
Field('id_people', 'reference people', label=T('Person')),
Field('category', 'string'),
Field('id_people_categories', 'reference people_categories', label= T("Quality")),
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('List')),
Field('format', 'string', default='html'))
......@@ -66,13 +66,15 @@ virtdb.define_table('people_selector',
Field('year', 'integer', default=year),
Field('period_start', 'date'),
Field('period_end', 'date'),
Field('category', 'string'),
Field('id_people_categories', 'reference people_categories', label= T("Quality")),
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('List')),
Field('format', 'string', default='html'))
virtdb.people_selector.category.requires = IS_IN_SET((el.category for el in 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')
......
......@@ -53,13 +53,13 @@ gridModifier.hide_columns('cdd_flag',
'trainee_university')
gridModifier.set_rownumbering()
gridModifier.append_filter(('start_date', '>=', T('greater or equal to')))
gridModifier.append_filter(('end_date', '<=', T('less or equal to')))
gridModifier.append_filter(('people.last_name', 'contains', T('contains')))
gridModifier.append_filter(('id_teams', '==', T('is equal to')))
gridModifier.append_filter(('id_projects', '==', T('is equal to')))
gridModifier.append_filter(('id_people_categories', '==', T('is equal to')))
gridModifier.append_filter(('id_events', '==', T('is equal to')))
gridModifier.append_filter(('start_date', '>=', T('greater or equal to')))
gridModifier.append_filter(('end_date', '<=', T('less or equal to')))
gridModifier.set_filters(plugins=['pFormToolTip'], width=300)
......
......@@ -65,9 +65,6 @@ class CountPeople(object):
fieldname = field.name
tablename = field._tablename
# add constraint to avoid event diploma, distinction,...
selector.append_query(db.history.id_events == UNDEF_ID)
# handle the category constraint
if selector.category:
selector.append_query(db.people_categories.category == selector.category)
......
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