if (_this.panel.active) {
this.footer.onClick('first');
}
+ },
+ rowdblclick : function (_self, rowIndex, e)
+ {
+ var rec = this.ds.getAt(rowIndex);
+ new Pman.Download({
+ url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',
+ method : 'GET',
+ params : {
+ _id : rec.data.report_id,
+ _download : 1
+ }
+ });
+ Roo.MessageBox.alert("Downloading",
+
+ "Report template is downloading - use " +
+ '<a target="_new" href="http://sourceforge.net/projects/openrpt/files/openrpt/">' +
+ "report writer to edit this" +
+ '</a>'
+ );
+
+
+
}
},
autoExpandColumn : 'report_descrip',
{
xtype: 'Button',
xns: Roo.Toolbar,
- text : "Add",
- cls : 'x-btn-text-icon',
- icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
listeners : {
- click : function()
+ click : function (_self, e)
{
- if (!_this.dialog) return;
- _this.dialog.show( { id : 0 } , function() {
- _this.grid.footer.onClick('first');
- });
+
+ var sel = _this.grid.selModel.getSelected();
+ if (!sel) {
+ Roo.MessageBox.alert("Error", "Select a report");
+ return;
+ }
+
+ Pman.Dialog.Image.show(
+ {
+ _url : baseURL+'/Xtuple/Import/Report',
+ onid : sel.data.report_id
+
+
+ },
+ function (data) {
+ Roo.MessageBox.alert("Notice", "Updated");
+ _this.grid.footer.onClick('refresh');
+ }
+ );
}
- }
+ },
+ text : "Upload New version"
}
]
},
},
rowdblclick : function (_self, rowIndex, e)
{
- if (!_this.dialog) return;
- _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
- _this.grid.footer.onClick('first');
- });
+ var rec = this.ds.getAt(rowIndex);
+ new Pman.Download({
+ url : baseURL + '/Roo/Report/' + rec.data.report_name +'-' + rec.data.report_id + '.rpt',
+ method : 'GET',
+ params : {
+ _id : rec.data.report_id,
+ _download : 1
+ }
+ });
+ Roo.MessageBox.alert("Downloading",
+
+ "Report template is downloading - use " +
+ '<a target="_new" href="http://sourceforge.net/projects/openrpt/files/openrpt/">' +
+ "report writer to edit this" +
+ '</a>'
+ );
+
+
+
}
},
- autoExpandColumn : 'report_name',
+ autoExpandColumn : 'Report loaddate',
loadMask : true,
dataSource : {
xtype: 'Store',
if (!_this.grid) {
return false;
}
- var sel = _this.grid.selModel.getSelected()
+ var sel = _this.grid.selModel.getSelected();
if (!sel) {
this.removeAll();
return false;
{
xtype: 'ColumnModel',
xns: Roo.grid,
- header : 'Report grade',
- width : 75,
dataIndex : 'report_grade',
+ header : 'Version',
+ width : 20,
renderer : function(v) { return String.format('{0}', v); }
},
{
xtype: 'ColumnModel',
xns: Roo.grid,
- header : 'Report loaddate',
- width : 75,
dataIndex : 'report_loaddate',
- renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
+ header : 'Created',
+ width : 200,
+ renderer : function(v,x,r) {
+ var vv = Date.parseDate(r.json.report_loaddate.split('.')[0], 'Y-m-d H:i:s').format('d/M/Y h:ia');
+ return String.format('{0}', vv);
+
+ }
}
]
}