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

Merge branch 'master' into 'production'

Release 0.9.5.5

* Require `plugin_dbui 0.9.0` or higher.
* Change the javaScript namespaces from `App` to `Dbui` and `Trp` to `Limbra`.
* Add the `author` criteria in metrics and graphs selectors.


See merge request !71
parents a9234126 956e8dff
......@@ -2,6 +2,11 @@
HEAD
0.9.5.5 (Jun 2016)
- Require plugin_dbui 0.9.0 or higher.
- Change the javascript namespaces to Dbui and Limbra.
- Add the author criteria in metrics and graphs selectors.
0.9.5.4 (Jun 2016)
- Move to web2py 2.14.6, matplotlib 1.5.1 and pandas 0.18.1.
The last version of web2py 2.14.6 requires plugin_dbui 0.8.3 or higher.
......
0.9.5.4
\ No newline at end of file
0.9.5.5
\ No newline at end of file
This diff is collapsed.
......@@ -77,7 +77,7 @@ def index():
either as a linechart or as a stacked histograms.
"""
fields = ('cumulative','id_graphs', 'time', 'year_start','year_end')
fields = ('author', 'cumulative','id_graphs', 'time', 'year_start','year_end')
selector = Selector(virtdb.graph_selector, exclude_fields=fields)
# graph configuration
......
......@@ -15,13 +15,13 @@ def index():
"""Main Controller handling metrics.
"""
publications = db.publications
# get the user constraint.
# the selector fields year_start, year_end, id_lists are excluded
# from the selector query.
selector = Selector(virtdb.metric_selector,
exclude_fields=('year_start',
'year_end',
'id_metrics'))
tpl = ('author', 'year_start', 'year_end', 'id_metrics')
selector = Selector(virtdb.metric_selector, exclude_fields=tpl)
# protection
if not selector.id_metrics:
......@@ -46,19 +46,23 @@ def index():
# query directive to count publications including
# foreign key constraints and user requirements
# related to team, project and year
query = selector.query(db.publications)
query = selector.query(publications)
if metric.conditions:
q_conditions = smart_query(db.publications, metric.conditions)
query = (query) & (q_conditions)
q_conditions = smart_query(publications, metric.conditions)
query &= q_conditions
if selector.year_start and not selector.year_end:
query = (query) & (db.publications.year == selector.year_start)
query &= (publications.year == selector.year_start)
elif selector.year_start and selector.year_end:
q_start = db.publications.year >= selector.year_start
q_end = db.publications.year <= selector.year_end
query = (query) & ((q_start) & (q_end))
q_start = publications.year >= selector.year_start
q_end = publications.year <= selector.year_end
query &= ((q_start) & (q_end))
if selector.author:
q_author = publications.authors_institute.contains(selector.author)
query &= q_author
# get the label along the x and y axis
labels = {}
......@@ -89,7 +93,7 @@ def index():
# fill the data block of the Ext.data.Array.Store
# transform (x, y count) data point into a row of values
# sum the content of the row
count = db.publications.id.count()
count = publications.id.count()
rows = db(query).select(fields['vertical'],
fields['horizontal'],
count,
......
......@@ -13,6 +13,7 @@ virtdb.define_table('graph_selector',
Field('id_teams', 'reference teams', label='Team'),
Field('id_projects', 'reference projects', label='Project'),
Field('id_categories', 'reference categories', label='Category'),
Field('author', 'string'),
Field('id_authors_roles', 'reference authors_roles', label='Role'),
Field('id_graphs', 'reference graphs', label='Graph'),
Field('cumulative', 'boolean', default=True),
......
......@@ -13,6 +13,7 @@ virtdb.define_table('metric_selector',
Field('id_teams', 'reference teams', label='Team'),
Field('id_projects', 'reference projects', label='Project'),
Field('id_categories', 'reference categories', label='Category'),
Field('author', 'string'),
Field('id_authors_roles', 'reference authors_roles', label='Role'),
Field('id_metrics', 'reference metrics', label='Metric'))
......
......@@ -230,6 +230,10 @@ def do_query(publications, selector):
elif year_end and not year_start:
query &= publications.submitted[0:4] <= year_end
if selector.author:
q_author = publications.authors_institute.contains(selector.author)
query &= q_author
return query
......
......@@ -4,28 +4,28 @@
*/
// Activate the dynamic loading for Ext JS and application classes
if (App.debug) {
if (Dbui.debug) {
Ext.Loader.setConfig({
disableCaching: false,
enabled: true,
paths: {
'App': '/' + App.name + '/static/plugin_dbui/src',
'Ext': '/' + App.name + '/static/plugin_extjs/src',
'Trp': '/' + App.name + '/static/limbra/src'
'Dbui': '/' + Dbui.name + '/static/plugin_dbui/src',
'Ext': '/' + Dbui.name + '/static/plugin_extjs/src',
'Limbra': '/' + Dbui.name + '/static/limbra/src'
}
});
}
Ext.require('App.container.Viewport');
Ext.require('App.grid.plugin.RowEditorAddWizard');
Ext.require('App.plugin.MathJax');
Ext.require('Dbui.container.Viewport');
Ext.require('Dbui.grid.plugin.RowEditorAddWizard');
Ext.require('Dbui.plugin.MathJax');
Ext.require('Ext.direct.Manager');
Ext.require('Ext.direct.RemotingProvider');
Ext.require('Ext.EventManager');
Ext.require('Ext.tip.QuickTipManager');
Ext.require('Trp.wizard.Harvester');
Ext.require('Limbra.wizard.Harvester');
Ext.onReady(function(){
......@@ -36,17 +36,17 @@ Ext.onReady(function(){
Ext.QuickTips.init();
// Expose the remote methods
Ext.direct.Manager.addProvider(App.REMOTE_API);
Ext.direct.Manager.addProvider(Dbui.REMOTE_API);
// define the models
App.defineModels();
Dbui.defineModels();
// Close user session on the server.
// Action trigger when the page is refreshed or when the tab is closed.
// NOTE: It should work when the browser is closed to.
// Not working with FireFox 17.0.8, web2py 2.4.5 and Ext JS 3.4.0.
Ext.EventManager.on(window, 'beforeunload', App.closeUserSession);
Ext.EventManager.on(window, 'beforeunload', Dbui.closeUserSession);
// Instantiate the application
app = Ext.create('App.container.Viewport', App.config.viewport);
app = Ext.create('Dbui.container.Viewport', Dbui.config.viewport);
});
\ No newline at end of file
......@@ -2,8 +2,8 @@
* French translation
*
*/
Ext.define('Trp.local.frwizard.Harvester', {
override: 'Trp.wizard.Harvester',
Ext.define('Limbra.local.frwizard.Harvester', {
override: 'Limbra.wizard.Harvester',
textArticle: "article",
textNote: "note",
......
......@@ -4,12 +4,12 @@
* @since 0.9.3
*
*/
Ext.define('Trp.wizard.Harvester', {
Ext.define('Limbra.wizard.Harvester', {
extend: 'App.wizard.Wizard',
extend: 'Dbui.wizard.Wizard',
alias: 'widget.xwizardharvester',
uses: [
'App.form.field.ComboBox',
'Dbui.form.field.ComboBox',
'Ext.form.RadioGroup',
'Ext.form.field.Text'
],
......
......@@ -23,7 +23,7 @@
<script type="text/javascript">
// create the form and load values
form = Ext.create('App.form.Panel', cfg);
form = Ext.create('Dbui.form.Panel', cfg);
form.setAction('create');
form.getForm().setValues(values);
......
......@@ -216,7 +216,7 @@
//
Ext.create('Ext.Component', {
loader: {
url: '/' + App.name + '/harvest/edit_insert',
url: '/' + Dbui.name + '/harvest/edit_insert',
params: {
Edit_insert_selectorId_teams: harvester.id_teams,
Edit_insert_selectorId_projects: harvester.id_projects,
......
......@@ -101,7 +101,7 @@
// instantiate the grid with a summary row.
// data can be extracted via the plugin pGridExport
//
var grid = Ext.create('App.grid.Panel', {
var grid = Ext.create('Dbui.grid.Panel', {
plugins: [{
fileRoot: 'metrics',
ptype:'pGridExport'
......
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