Commit 975fa8b9 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Migrate to plugin_dbui 0.6.1.5.

Reset fields status and origin when duplicating publication.
Publication field origin is readonly in the publication form.
New application scrip to run the application in debug mode.
parent c0d8e492
......@@ -24,8 +24,8 @@ plugins = PluginManager()
plugins.dbui.app_css = 'static/my.css'
#plugins.dbui.app_js_dir = None
#plugins.dbui.app_libmin = None
#plugins.dbui.app_script = None
plugins.dbui.app_script_dir = 'static/scripts'
plugins.dbui.app_script = 'static/app.js'
#plugins.dbui.app_script_dir = None
#-------------------------------------------------------------------------------
#
......
......@@ -91,7 +91,7 @@ db.define_table("publications",
Field("id_projects", "reference projects", label='Project', notnull=True),
Field("id_categories", "reference categories", default=undef_id, label='Category'),
Field("id_status", "reference status", default=undef_id, label="Status"),
Field("origin", "string", length=255, comment=tp_origin),
Field("origin", "string", length=255, comment=tp_origin, writable=False),
migrate="publications.table")
db.publications._before_delete.append(INHIBIT_PUBLICATION_DELETE_ON_OK)
......
......@@ -116,7 +116,10 @@ tpl = ['<b>{PublicationsTitle}</b><br>',
'<tpl if="PublicationsDefense">, {PublicationsDefense}</tpl>']
gridModifier = dbui.GridModifier('publications')
gridModifier.configure(plugins=['pGridPaging', 'pMathJax'])
gridModifier.configure(plugins=['pGridPaging',
'pMathJax',
{'ptype': 'pGridRowEditorConfirmDelete',
'resetFields': ['PublicationsId_status', 'PublicationsOrigin']}])
gridModifier.merge_columns('title',
'first_author',
'id_collaborations',
......
......@@ -225,7 +225,7 @@ def duplicate_article(publication):
qmain = ((qmain) & (db.publications.id_teams == publication['id_teams']))
qmain = ((qmain) & (db.publications.id_publishers == publication['id_publishers']))
if 'id' in publication:
if 'id' in publication and publication['id']:
qmain = ((qmain) & (db.publications.id != publication['id']))
# title, publishers, volume and pages
......@@ -274,7 +274,7 @@ def duplicate_conference(publication):
qmain = ((qmain) & (db.publications.id_teams == publication['id_teams']))
qmain = ((qmain) & (db.publications.title == publication['title']))
if 'id' in publication:
if 'id' in publication and publication['id']:
qmain = ((qmain) & (db.publications.id != publication['id']))
# title, conference title, conference date and conference town
......@@ -349,7 +349,7 @@ def duplicate_report(publication):
qmain = ((qmain) & (db.publications.id_teams == publication['id_teams']))
qmain = ((qmain) & (db.publications.title == publication['title']))
if 'id' in publication:
if 'id' in publication and publication['id']:
qmain = ((qmain) & (db.publications.id != publication['id']))
extend_ids(db, qmain, ids)
......
--------------------------------- CHANGELOG ----------------------------------
HEAD
- Add rules to Check & Validate. Teams and projects have to be defined.
- Migrate to plugin_dbui 0.6.1.5
- Deploy the new functionality resetFields when duplicating publication.
The field status and origin are reset to their default value.
- The field origin is read only in the publication form.
- Add rules to Check & Validate: the teams and projects have to be defined.
- New application script static/app.js allowing to run the application
in debug mode using the dynamic loading of Ext JS. It is activated
using the URL /track_publications/admin?debug
0.8.6 (Jun 2014)
- Bugs fixed.
......
/**
* Default script to configure and launch the web application
*
*/
// Activate the dynamic loading for Ext JS and application classes
if (App.debug) {
Ext.Loader.setConfig({
disableCaching: false,
enabled: true,
paths: {
'App': '/' + App.name + '/static/plugin_dbui/src',
'Ext': '/' + App.name + '/static/plugin_extjs/src'
}
});
}
Ext.require('App.container.Viewport');
Ext.require('App.plugin.MathJax');
Ext.require('Ext.direct.Manager');
Ext.require('Ext.direct.RemotingProvider');
Ext.require('Ext.EventManager');
Ext.require('Ext.tip.QuickTipManager');
Ext.onReady(function(){
"use strict";
var app;
Ext.QuickTips.init();
// Expose the remote methods
Ext.direct.Manager.addProvider(App.REMOTE_API);
// define the models
App.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);
// Instantiate the application
app = Ext.create('App.container.Viewport', App.config.viewport);
});
\ No newline at end of file
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