Commit 784e84ae authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Revert "Restore the metric reports using Ext.grid.Panel."

This reverts commit 90c87225.
parent 6ce601be
......@@ -23,7 +23,7 @@ def people_per_category():
# get the header and publish
header = '%s %s' % (T('People per category'), selector.header(db))
response.view = 'metric/metric.html'
response.view = BASE_VIEW % request.extension
return dict(field=field, footer='', header=header, rows=rows)
......@@ -45,7 +45,7 @@ def people_per_quality():
# get the header and publish
header = '%s %s' % (T('People per quality'), selector.header(db))
response.view = 'metric/metric.html'
response.view = BASE_VIEW % request.extension
return dict(field=field, footer='', header=header, rows=rows)
......@@ -67,6 +67,6 @@ def people_per_team():
# get the header and publish
header = '%s %s' % (T('People per team'), selector.header(db))
response.view = 'metric/metric.html'
response.view = BASE_VIEW % request.extension
return dict(field=field, footer='', header=header, rows=rows)
......@@ -9,13 +9,16 @@ virtdb.define_table('people_selector',
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('id_projects', 'reference projects', label=T('Project')),
Field('format', 'string', default='html'))
virtdb.people_selector.category.requires = IS_IN_SET(PEOPLE_CATEGORIES)
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
......
......@@ -118,13 +118,16 @@ traineeLeaf = PanelWithUrlSelector(virtdb.trainee_selector,
extField='format')
peopleCategoryLeaf = PanelWithUrlSelector(virtdb.people_selector,
baseUrl=URL('metric', 'people_per_category'))
baseUrl=URL('metric', 'people_per_category'),
extField='format')
peopleQualityLeaf = PanelWithUrlSelector(virtdb.people_selector,
baseUrl=URL('metric', 'people_per_quality'))
baseUrl=URL('metric', 'people_per_quality'),
extField='format')
peopleTeamLeaf = PanelWithUrlSelector(virtdb.people_selector,
baseUrl=URL('metric', 'people_per_team'))
baseUrl=URL('metric', 'people_per_team'),
extField='format')
reportNode = dbui.Node(T('Reports'))
reportNode.add_child(T('List'), listLeaf)
......
......@@ -2,7 +2,6 @@
HEAD
- Migrate to plugin_dbui 0.6.1.14 and Web2py 2.9.11.
- Restore the metric reports using Ext.grid.Panel.
1dec53b (Mar 14)
- Migrate to plugin_dbui 0.6.1.0 and Web2py 2.9.5.
......
{{=H3(header)}}
<br>
<br>
{{include '%s/%s.cfg' % (request.controller, request.function)}}
{{
import json
#
# Prepare the Ext.data.ArrayStore configuration
#
cfg = dict(fields=[], data=[])
for name in columns:
cfg['fields'].append({'name': name})
pass
for row in rows:
li = []
for name in columns:
li.append(row[name])
pass
cfg['data'].append(li)
pass
#
# unique identifier for the DIV block associated to the grid
#
divgrid = "grid-%s" % __builtins__['id'](cfg)
response.write(DIV(_id=divgrid))
#
# Export python variables to the javascript
#
jsvars = ["cfgStore = %s" % json.dumps(cfg),
"columns = %s" % json.dumps(columns),
"divgrid = '%s'" % divgrid,
"gridcolumns = []",
"headers = %s" % json.dumps(headers),
"i"]
jsvars = " var %s;" % ',\n'.join(jsvars)
response.write(SCRIPT(jsvars), escape=False)
}}
<script>
var align;
//
// columns configuration
//
for (i = 0; i < columns.length; i += 1) {
gridcolumns.push({
text: headers[columns[i]],
dataIndex: columns[i],
});
}
//
// instantiate the grid
//
Ext.create('Ext.grid.Panel', {
plugins: ['pGridExport'],
store: Ext.create('Ext.data.ArrayStore', cfgStore),
columns: gridcolumns,
forceFit: true,
hideHeaders: false,
padding: "10 40 20 60",
renderTo: divgrid,
width: 500
});
</script>
{{=footer}}
......@@ -14,6 +14,6 @@
headers[str(field)] = T(field.name.title())
# virtual fields to be displayed in the view
extracolumns = None
extracolumns = []
}}
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