Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
tev
plugin_event
Commits
16b62acf
Commit
16b62acf
authored
Oct 26, 2012
by
LE GAC Renaud
Browse files
Polish the reports.
parent
7e7c13a7
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
3 deletions
+39
-3
controllers/list.py
controllers/list.py
+3
-0
languages/fr-fr.py
languages/fr-fr.py
+2
-0
models/db.py
models/db.py
+1
-1
models/widgets_sqltable.py
models/widgets_sqltable.py
+30
-0
modules/reporting_tools.py
modules/reporting_tools.py
+3
-0
views/list/history.html
views/list/history.html
+0
-1
views/list/people.html
views/list/people.html
+0
-1
No files found.
controllers/list.py
View file @
16b62acf
...
...
@@ -56,6 +56,9 @@ def people():
# add constraint to avoid 'stagiaire' category
selector
.
append_query
(
db
.
categories
.
usual
!=
'stagiaire'
)
# add constraint to avoid event (phd, hdr, ...)
selector
.
append_query
(
db
.
history
.
id_events
==
undef_id
)
# define virtual field to compute time data
# to be added in the report via extra columns
tool
=
Person
(
selector
)
...
...
languages/fr-fr.py
View file @
16b62acf
...
...
@@ -101,6 +101,8 @@
'plugin not install'
:
'plugin not install'
,
'Project'
:
'Projet'
,
'projects'
:
'projets'
,
'Quality'
:
'Qualité'
,
'Qualité'
:
'Qualité'
,
'Ratio'
:
'Ratio'
,
'Reports'
:
'Rapports'
,
'responsibilities'
:
'responsabilités'
,
...
...
models/db.py
View file @
16b62acf
...
...
@@ -62,7 +62,7 @@ db.define_table("agencies",
migrate
=
"agencies.table"
)
db
.
define_table
(
"categories"
,
Field
(
"code"
,
"string"
,
notnull
=
True
,
label
=
T
(
"
Level
"
)),
Field
(
"code"
,
"string"
,
notnull
=
True
,
label
=
T
(
"
Quality
"
)),
Field
(
"usual"
,
"string"
,
label
=
T
(
"Category"
)),
Field
(
"definition"
,
"text"
),
migrate
=
"categories.table"
)
...
...
models/widgets_sqltable.py
View file @
16b62acf
...
...
@@ -2,10 +2,34 @@
""" widgets sqltable
"""
# sqltable accept lambda value, row: bla bla
# this form does not work when translating Rows into csv file ?
def
repr_category
(
value
,
row
):
if
value
==
undef
:
return
''
if
'history'
in
row
and
row
.
history
.
cdd_flag
:
value
=
"%s%s"
%
(
value
,
' - CDD'
)
return
value
repr_date
=
lambda
date
:
(
date
.
strftime
(
'%d %b %Y'
)
if
date
else
''
)
repr_flag
=
lambda
flag
:
(
CENTER
(
'x'
)
if
flag
else
''
)
repr_percentage
=
lambda
val
:
(
''
if
val
==
None
else
val
)
repr_undef
=
lambda
val
:
(
''
if
val
==
undef
else
val
)
#
# categories
#
db
.
categories
.
code
.
represent
=
repr_category
#
# events
#
db
.
events
.
event
.
represent
=
repr_undef
#
# hardware
#
...
...
@@ -18,6 +42,12 @@ db.hardware.end_date.represent = repr_date
db
.
history
.
cdd_flag
.
represent
=
repr_flag
db
.
history
.
start_date
.
represent
=
repr_date
db
.
history
.
end_date
.
represent
=
repr_date
db
.
history
.
percentage
.
represent
=
repr_percentage
#
# organization
#
db
.
organizations
.
organization
.
represent
=
repr_undef
#
# people
...
...
modules/reporting_tools.py
View file @
16b62acf
...
...
@@ -171,6 +171,9 @@ class Person(Base):
during the selected period.
"""
if
not
(
self
.
period_start
and
self
.
period_end
):
return
''
start
=
max
(
self
.
period_start
,
row
.
history
.
start_date
)
end
=
self
.
period_end
...
...
views/list/history.html
View file @
16b62acf
...
...
@@ -19,7 +19,6 @@
'teams.team',
'projects.project',
'categories.code',
'history.cdd_flag',
'events.event',
'history.start_date',
'history.percentage'],
...
...
views/list/people.html
View file @
16b62acf
...
...
@@ -22,7 +22,6 @@
columns=['categories.usual',
'people.last_name',
'categories.code',
'history.cdd_flag',
'history.percentage'],
headers='labels',
extracolumns=[time_coverage, age],
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment