Commit 0e134da4 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Add the class Limbra.grid.plugin.AffiliationRulesContextMenu.

parent 7780a863
......@@ -88,8 +88,7 @@ STORES = ['cds.cern.ch', 'inspirehep.net']
# COMMON CONFIGURATION FOR FORMS AND GRIDS
#
#-------------------------------------------------------------------------------
tables = ['affiliation_rules',
'application',
tables = ['application',
'auth_group',
'auth_membership',
'auth_user',
......
......@@ -27,8 +27,8 @@ gridModifier.append_filter(('v', 'contains', T('contains')))
gridModifier.configure_filters(plugins=['pFormToolTip'], width=300)
gridModifier.configure_gridWithFilter(selectorTitle=T('Filter'))
# gridModifier.configure(plugins=[{'ptype': 'pGridRowEditorAddWizard',
# 'wizard' :{'xtype': 'xwizardharvester'}}])
gridModifier.configure(plugins=['pGridRowEditor',
'pGridAffiliationRulesContextMenu'])
#-------------------------------------------------------------------------------
#
......
......@@ -25,6 +25,7 @@ Ext.require('Ext.direct.RemotingProvider');
Ext.require('Ext.EventManager');
Ext.require('Ext.tip.QuickTipManager');
Ext.require('Limbra.grid.plugin.AffiliationRulesContextMenu');
Ext.require('Limbra.wizard.Harvester');
Ext.onReady(function(){
......
/**
* The plugin instantiating the context menu for the Affiliation_rules grid.
*
* Display the context menu when the user right click on a row.
* The content of the menu allows to run the wizard "add from publication"
* and "add from institute database" as well as to delete an entry.
*
* @uses Dbui.grid.plugin.RowEditorBase
* @since 0.9.6
*
*/
Ext.define('Limbra.grid.plugin.AffiliationRulesContextMenu', {
extend: 'Dbui.grid.plugin.ContextMenu',
alias: 'plugin.pGridAffiliationRulesContextMenu',
// private properties for internationalization
textAddFromInstitute: 'Add rule(s) from the institute database',
textAddFromPublication: 'Add a rule from a publication',
textDestroy: 'Delete a rule',
/**
* Initialize the plugin.
*
* @param {Dbui.grid.Panel} grid
*/
init: function (grid) {
"use strict";
var me = this,
rowEditor = grid.getPlugin('rowEditor');
// protection
if (!rowEditor) {
throw new Error('no grid row editor !!!');
}
me.menu = {
items: [{
text: me.textAddFromInstitute,
iconCls: 'xaction-create',
handler: me.onAddFromInstitute,
scope: me
}, '-', {
text: me.textAddFromPublication,
iconCls: 'xaction-create',
handler: me.onAddFromPublication,
scope: me
}, '-', {
text: me.textDestroy,
iconCls: 'xaction-destroy',
handler: rowEditor.onDeleteRow,
scope: rowEditor
}]
};
// initialise the base class
me.callParent(arguments);
},
/**
* Add rule(s) from the institute database
*
*/
onAddFromInstitute: function () {
"use strict";
Ext.Msg.alert("Warning", "not yet implemented !!!");
},
/**
* Add rule from a given publication
*
*/
onAddFromPublication: function () {
"use strict";
Ext.Msg.alert("Warning", "not yet implemented");
}
});
\ 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