~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to local/vn/dhis-web-hue-reporttool/src/main/webapp/dhis-web-reporttool/javascript/script.js

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
var request = null;
 
3
var tableIndex;
 
4
 
 
5
function removeReportElement( report, id, index )
 
6
{
 
7
        tableIndex = index;
 
8
        
 
9
        request = new XMLHttpRequest();
 
10
        
 
11
        var url = "removeReportElement.action?report=" + report + "&elementId=" + id;
 
12
        request.open( "GET", url, true );
 
13
        request.onreadystatechange = removeReportElementReceived;
 
14
        request.send( null );
 
15
}
 
16
        
 
17
function removeReportElementReceived()
 
18
{
 
19
        if ( request.readyState == 4 )
 
20
        {
 
21
                document.getElementById("elementTable").deleteRow( tableIndex );                
 
22
        }
 
23
}
 
24
 
 
25
function removeChartElement( report, id, index )
 
26
{
 
27
        tableIndex = index;
 
28
        
 
29
        request = new XMLHttpRequest();
 
30
        
 
31
        var url = "removeChartElement.action?report=" + report + "&elementId=" + id;
 
32
        request.open( "GET", url, true );
 
33
        request.onreadystatechange = removeChartElementReceived;
 
34
        request.send( null );
 
35
}
 
36
 
 
37
function removeChartElementReceived()
 
38
{
 
39
        if ( request.readyState == 4 )
 
40
        {
 
41
                document.getElementById("elementTable").deleteRow( tableIndex );                
 
42
        }
 
43
}
 
44
        
 
45
function viewReport()
 
46
{
 
47
        document.getElementById("reportForm").action = "loadReport.action";
 
48
        document.getElementById("reportForm").submit();
 
49
}
 
50
 
 
51
function addDataElementToReport()
 
52
{
 
53
        document.getElementById("reportForm").action = "addDataElementToReport.action";
 
54
        document.getElementById("reportForm").submit();
 
55
}
 
56
 
 
57
function addDataElementToChart()
 
58
{
 
59
        document.getElementById("reportForm").action = "addDataElementToChart.action";
 
60
        document.getElementById("reportForm").submit();
 
61
}
 
62
 
 
63
function addIndicatorToReport()
 
64
{
 
65
        document.getElementById("reportForm").action = "addIndicatorToReport.action";
 
66
        document.getElementById("reportForm").submit();
 
67
}
 
68
 
 
69
function addIndicatorToChart()
 
70
{
 
71
        document.getElementById("reportForm").action = "addIndicatorToChart.action";
 
72
        document.getElementById("reportForm").submit();
 
73
}
 
74
 
 
75
function setDesignTemplate( report, designTemplate )
 
76
{
 
77
        request = new XMLHttpRequest();
 
78
        
 
79
        var url = "setDesignTemplate.action?report=" + report + "&designTemplate=" + designTemplate;
 
80
        request.open( "GET", url, true );
 
81
        request.send( null );
 
82
}
 
83
 
 
84
function setChartTemplate( report, chartTemplate )
 
85
{
 
86
        request = new XMLHttpRequest();
 
87
        
 
88
        var url = "setChartTemplate.action?report=" + report + "&chartTemplate=" + chartTemplate;
 
89
        request.open( "GET", url, true );
 
90
        request.send( null );
 
91
}
 
92
 
 
93
function addReport()
 
94
{
 
95
        document.getElementById("reportForm").action = "addReport.action";
 
96
        document.getElementById("reportForm").submit();
 
97
}
 
98
 
 
99
function loadReport( id )
 
100
{
 
101
        document.getElementById("report").value = id;
 
102
        document.getElementById("reportForm").action = "loadReport.action";
 
103
        document.getElementById("reportForm").submit();
 
104
}
 
105
 
 
106
function unloadReport()
 
107
{
 
108
        document.getElementById("reportForm").action = "unloadReport.action";
 
109
        document.getElementById("reportForm").submit();
 
110
}
 
111
 
 
112
function deleteReport( id )
 
113
{
 
114
        var ok = confirm(confirm_to_delete_report);
 
115
        
 
116
        if ( ok )
 
117
        {
 
118
                document.getElementById("report").value = id;
 
119
                document.getElementById("reportForm").action = "deleteReport.action";
 
120
                document.getElementById("reportForm").submit();
 
121
        }
 
122
}
 
123
 
 
124
function listReports()
 
125
{
 
126
        document.getElementById("reportForm").action = "listReports.action";
 
127
        document.getElementById("reportForm").submit();
 
128
}
 
129
 
 
130
function moveUpReportElement( id )
 
131
{
 
132
        document.getElementById("elementId").value = id;
 
133
        document.getElementById("reportForm").action = "moveUpReportElement.action";
 
134
        document.getElementById("reportForm").submit();
 
135
}
 
136
 
 
137
function moveDownReportElement( id )
 
138
{
 
139
        document.getElementById("elementId").value = id;
 
140
        document.getElementById("reportForm").action = "moveDownReportElement.action";
 
141
        document.getElementById("reportForm").submit();
 
142
}
 
143
 
 
144
function generateDesign()
 
145
{
 
146
        document.getElementById("reportForm").action = "generateDesign.action";
 
147
        document.getElementById("reportForm").submit();
 
148
}
 
149
 
 
150
function listDesigns()
 
151
{
 
152
        document.getElementById("reportForm").action = "loadDesigns.action";
 
153
        document.getElementById("reportForm").submit();
 
154
}
 
155
 
 
156
function previewReport()
 
157
{
 
158
        document.getElementById("reportForm").action = "previewReport.action";
 
159
        document.getElementById("reportForm").submit();
 
160
}
 
161
 
 
162
function generateReport()
 
163
{
 
164
        document.getElementById("reportForm").action = "generateReport.action";
 
165
        document.getElementById("reportForm").submit();
 
166
}
 
167
 
 
168
 
 
169