2007-07-19 12:40:05 +02:00
|
|
|
SideReports = Class.extend('SidePanel');
|
|
|
|
SideReports.prototype = {
|
|
|
|
initialize: function() {
|
|
|
|
this.selector = $('ReportSelector');
|
|
|
|
if(this.selector) this.selector.holder = this;
|
|
|
|
this.SidePanel.initialize();
|
|
|
|
},
|
|
|
|
|
|
|
|
destroy: function() {
|
|
|
|
if(this.SidePanel) this.SidePanel.destroy();
|
|
|
|
this.SidePanel = null;
|
|
|
|
if(this.selector) this.selector.holder = null;
|
|
|
|
this.selector = null;
|
|
|
|
},
|
|
|
|
|
|
|
|
onshow: function() {
|
|
|
|
if(this.selector.value) this.showreport();
|
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieve a report via ajax
|
|
|
|
*/
|
|
|
|
showreport: function() {
|
|
|
|
if(this.selector.value) {
|
|
|
|
this.body.innerHTML = '<p>loading...</p>';
|
|
|
|
this.ajaxGetPanel(this.afterPanelLoaded);
|
|
|
|
} else {
|
|
|
|
this.body.innerHTML = "<p>choose a report in the dropdown.</p>";
|
|
|
|
}
|
|
|
|
},
|
|
|
|
afterPanelLoaded : function() {
|
|
|
|
SideReportRecord.applyTo('#' + this.id + ' a');
|
|
|
|
},
|
|
|
|
ajaxURL: function() {
|
2009-05-12 06:49:54 +02:00
|
|
|
var url = 'admin/sidereport/' + this.selector.value;
|
|
|
|
if($('LangSelector')) url += "?locale=" + $('LangSelector').value;
|
|
|
|
return url;
|
2007-07-19 12:40:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-09-15 03:15:08 +02:00
|
|
|
SideReportGo = Class.create();
|
|
|
|
SideReportGo.prototype = {
|
2007-07-19 12:40:05 +02:00
|
|
|
destroy: function() {
|
2007-09-15 03:15:08 +02:00
|
|
|
this.onclick = null;
|
2007-07-19 12:40:05 +02:00
|
|
|
this.holder = null;
|
|
|
|
},
|
2007-09-15 03:15:08 +02:00
|
|
|
onclick: function() {
|
|
|
|
$('reports_holder').showreport();
|
2007-07-19 12:40:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SideReportRecord = Class.create();
|
|
|
|
SideReportRecord.prototype = {
|
|
|
|
destroy: function() {
|
|
|
|
this.onclick = null;
|
|
|
|
},
|
|
|
|
|
|
|
|
onclick : function(event) {
|
|
|
|
Event.stop(event);
|
|
|
|
$('sitetree').loadingNode = $('sitetree').getTreeNodeByIdx( this.getID() );
|
|
|
|
$('Form_EditForm').getPageFromServer(this.getID());
|
|
|
|
},
|
|
|
|
getID : function() {
|
|
|
|
if(this.href.match(/\/([^\/]+)$/)) return parseInt(RegExp.$1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-09-15 03:15:08 +02:00
|
|
|
SideReportGo.applyTo('#report_select_go');
|
2007-07-19 12:40:05 +02:00
|
|
|
SideReportRecord.applyTo('#reports_holder a');
|
|
|
|
SideReports.applyTo('#reports_holder');
|