3963 |
20 May 16 |
olle |
var Istat = function() |
3963 |
20 May 16 |
olle |
2 |
{ |
3963 |
20 May 16 |
olle |
var istat = {}; |
3963 |
20 May 16 |
olle |
var debug = 0; |
3963 |
20 May 16 |
olle |
5 |
|
5287 |
08 Feb 19 |
nicklas |
var incaFileIsValid = false; |
5287 |
08 Feb 19 |
nicklas |
7 |
|
3980 |
27 May 16 |
olle |
var REPORT_TYPE_STATISTICS = 'statistics'; |
3980 |
27 May 16 |
olle |
var REPORT_TYPE_STATISTICS_CSV = 'statistics_csv'; |
3963 |
20 May 16 |
olle |
var incaFilesAreValid = false; |
3963 |
20 May 16 |
olle |
var incaFileStructuresAreValid = false; |
3963 |
20 May 16 |
olle |
var jsonIncaData = {}; |
3963 |
20 May 16 |
olle |
13 |
|
3963 |
20 May 16 |
olle |
istat.initPage = function() |
3963 |
20 May 16 |
olle |
15 |
{ |
3963 |
20 May 16 |
olle |
// Step 1 |
3963 |
20 May 16 |
olle |
Events.addEventHandler('step-1', 'wizard-validate', istat.validateStep1); |
5287 |
08 Feb 19 |
nicklas |
Events.addEventHandler('startDate', 'blur', Wizard.validateDate); |
5287 |
08 Feb 19 |
nicklas |
Events.addEventHandler('endDate', 'blur', Wizard.validateDate); |
3963 |
20 May 16 |
olle |
Events.addEventHandler('incafile', 'change', istat.incaFileOnChange); |
3963 |
20 May 16 |
olle |
21 |
|
5287 |
08 Feb 19 |
nicklas |
// Step 2 |
5287 |
08 Feb 19 |
nicklas |
Events.addEventHandler('step-2', 'wizard-initialize', istat.initializeStep2); |
5287 |
08 Feb 19 |
nicklas |
24 |
|
3963 |
20 May 16 |
olle |
// Navigation |
3963 |
20 May 16 |
olle |
Buttons.addClickHandler('gocancel', Wizard.cancelWizard); |
3963 |
20 May 16 |
olle |
Buttons.addClickHandler('gorestart', Wizard.restartWizard); |
5292 |
12 Feb 19 |
nicklas |
Buttons.addClickHandler('simplestatistics', istat.startCheck); |
5292 |
12 Feb 19 |
nicklas |
Buttons.addClickHandler('fullstatistics', istat.startCheck); |
3963 |
20 May 16 |
olle |
Buttons.addClickHandler('downloadreportfile', istat.downloadReportFile); |
5290 |
11 Feb 19 |
nicklas |
Buttons.addClickHandler('downloadoutputfile', istat.downloadReportFile); |
3963 |
20 May 16 |
olle |
32 |
|
3963 |
20 May 16 |
olle |
Doc.show('step-1'); |
5292 |
12 Feb 19 |
nicklas |
Doc.show('simplestatistics'); |
5292 |
12 Feb 19 |
nicklas |
Doc.show('fullstatistics'); |
5287 |
08 Feb 19 |
nicklas |
36 |
|
5287 |
08 Feb 19 |
nicklas |
Doc.element('statisticsDateVar').focus(); |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('incafile', 'invalid', 'Please select a file!'); |
5287 |
08 Feb 19 |
nicklas |
istat.incaFileOnChange(); |
3963 |
20 May 16 |
olle |
40 |
} |
3963 |
20 May 16 |
olle |
41 |
|
5287 |
08 Feb 19 |
nicklas |
istat.startCheck = function(event) |
5287 |
08 Feb 19 |
nicklas |
43 |
{ |
5287 |
08 Feb 19 |
nicklas |
checkType = event.currentTarget.id; |
5292 |
12 Feb 19 |
nicklas |
Doc.hide('stat-table'); |
5287 |
08 Feb 19 |
nicklas |
Doc.hide('downloadreportfile'); |
5287 |
08 Feb 19 |
nicklas |
Wizard.setCurrentStep(1); |
5287 |
08 Feb 19 |
nicklas |
Doc.addClass('step-2', 'disabled'); |
5287 |
08 Feb 19 |
nicklas |
Wizard.goNext(); |
5287 |
08 Feb 19 |
nicklas |
50 |
} |
5287 |
08 Feb 19 |
nicklas |
51 |
|
3963 |
20 May 16 |
olle |
istat.validateStep1 = function(event) |
3963 |
20 May 16 |
olle |
53 |
{ |
5287 |
08 Feb 19 |
nicklas |
var valid = incaFileIsValid; |
5287 |
08 Feb 19 |
nicklas |
valid &= Wizard.isValid('startDate'); |
5287 |
08 Feb 19 |
nicklas |
valid &= Wizard.isValid('endDate'); |
3963 |
20 May 16 |
olle |
if (!valid) event.preventDefault(); |
3963 |
20 May 16 |
olle |
58 |
} |
3963 |
20 May 16 |
olle |
59 |
|
3963 |
20 May 16 |
olle |
istat.incaFileOnChange = function() |
3963 |
20 May 16 |
olle |
61 |
{ |
5287 |
08 Feb 19 |
nicklas |
incaFileIsValid = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('incafile'); |
5287 |
08 Feb 19 |
nicklas |
64 |
|
3963 |
20 May 16 |
olle |
var frm = document.forms['reggie']; |
3963 |
20 May 16 |
olle |
var files = frm.incafile.files; |
3963 |
20 May 16 |
olle |
67 |
|
5287 |
08 Feb 19 |
nicklas |
if (files.length == 1) |
3963 |
20 May 16 |
olle |
69 |
{ |
5287 |
08 Feb 19 |
nicklas |
incaFileIsValid = true; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('incafile', 'valid'); |
3963 |
20 May 16 |
olle |
72 |
} |
3963 |
20 May 16 |
olle |
else |
3963 |
20 May 16 |
olle |
74 |
{ |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('incafile', 'invalid', 'A file must be selected.'); |
3963 |
20 May 16 |
olle |
76 |
} |
3963 |
20 May 16 |
olle |
77 |
} |
3963 |
20 May 16 |
olle |
78 |
|
3963 |
20 May 16 |
olle |
79 |
|
5287 |
08 Feb 19 |
nicklas |
istat.initializeStep2 = function() |
3963 |
20 May 16 |
olle |
81 |
{ |
5292 |
12 Feb 19 |
nicklas |
Doc.hide('explainFileCheck'); |
3963 |
20 May 16 |
olle |
var frm = document.forms['reggie']; |
3968 |
23 May 16 |
olle |
var statDateVar = frm.statisticsDateVar.value; |
3963 |
20 May 16 |
olle |
var startDate = frm.startDate.value; |
3963 |
20 May 16 |
olle |
var endDate = frm.endDate.value; |
3972 |
25 May 16 |
olle |
var cancerType = frm.cancerType.value; |
3963 |
20 May 16 |
olle |
88 |
|
3963 |
20 May 16 |
olle |
var formData = new FormData(); |
3963 |
20 May 16 |
olle |
var files = frm.incafile.files; |
3963 |
20 May 16 |
olle |
for (var i = 0; i < files.length; i++) |
3963 |
20 May 16 |
olle |
92 |
{ |
3963 |
20 May 16 |
olle |
var file = files[i]; |
3963 |
20 May 16 |
olle |
formData.append('incafiles[]', file, file.name); |
3963 |
20 May 16 |
olle |
95 |
} |
3963 |
20 May 16 |
olle |
96 |
|
3963 |
20 May 16 |
olle |
var url = '../Inca.servlet?ID='+App.getSessionId(); |
3963 |
20 May 16 |
olle |
url += '&cmd=IncaStatistics'; |
3968 |
23 May 16 |
olle |
url += '&statdatevar='+encodeURIComponent(statDateVar); |
3963 |
20 May 16 |
olle |
url += '&startdate='+encodeURIComponent(startDate); |
3963 |
20 May 16 |
olle |
url += '&enddate='+encodeURIComponent(endDate); |
3972 |
25 May 16 |
olle |
url += '&cancertype='+encodeURIComponent(cancerType); |
5287 |
08 Feb 19 |
nicklas |
url += '&checkType=' + checkType; |
3963 |
20 May 16 |
olle |
104 |
|
3963 |
20 May 16 |
olle |
// POST |
3963 |
20 May 16 |
olle |
Wizard.showLoadingAnimation('Checking INCA data...', 'inca-stat-progress'); |
5287 |
08 Feb 19 |
nicklas |
Wizard.asyncJsonRequest(url, istat.checkCompleted, 'POST', formData); |
3963 |
20 May 16 |
olle |
108 |
} |
3963 |
20 May 16 |
olle |
109 |
|
5287 |
08 Feb 19 |
nicklas |
istat.checkCompleted = function(response) |
3963 |
20 May 16 |
olle |
111 |
{ |
3963 |
20 May 16 |
olle |
var frm = document.forms['reggie']; |
3963 |
20 May 16 |
olle |
113 |
|
5287 |
08 Feb 19 |
nicklas |
var fileInfo = response.fileInfo; |
5287 |
08 Feb 19 |
nicklas |
var headers = fileInfo.headers; |
5287 |
08 Feb 19 |
nicklas |
var checkType = response.checkType; |
5287 |
08 Feb 19 |
nicklas |
var fileCanBeUsed = true; |
3963 |
20 May 16 |
olle |
118 |
|
5287 |
08 Feb 19 |
nicklas |
Doc.element('filename').innerHTML = Strings.encodeTags(fileInfo.filename); |
5287 |
08 Feb 19 |
nicklas |
Doc.element('isFollowUp').innerHTML = fileInfo.isFollowUp ? 'Yes' : 'No'; |
5287 |
08 Feb 19 |
nicklas |
if (fileInfo.isFollowUp) |
3963 |
20 May 16 |
olle |
122 |
{ |
5287 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('isFollowUp', 'invalid', 'A follow-up file can\'t be used for statistics.'); |
3963 |
20 May 16 |
olle |
125 |
} |
5287 |
08 Feb 19 |
nicklas |
Doc.element('headerCount').innerHTML = headers.count; |
5287 |
08 Feb 19 |
nicklas |
127 |
|
5287 |
08 Feb 19 |
nicklas |
Doc.element('headerMissing').innerHTML = headers.missing; |
5287 |
08 Feb 19 |
nicklas |
if (headers.missing > 0) |
5287 |
08 Feb 19 |
nicklas |
130 |
{ |
5287 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('headerMissing', 'invalid', 'One ore more required headers are missing: <b>' + Strings.encodeTags(headers.missingNames.join(', ')) + '</b>'); |
5287 |
08 Feb 19 |
nicklas |
133 |
} |
5287 |
08 Feb 19 |
nicklas |
else |
5287 |
08 Feb 19 |
nicklas |
135 |
{ |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('headerMissing', 'valid'); |
5287 |
08 Feb 19 |
nicklas |
137 |
} |
5288 |
08 Feb 19 |
nicklas |
138 |
|
5288 |
08 Feb 19 |
nicklas |
Doc.element('headerMissingAnnotationTypes').innerHTML = headers.missingAnnotationTypes; |
5288 |
08 Feb 19 |
nicklas |
if (headers.missingAnnotationTypes > 0) |
5288 |
08 Feb 19 |
nicklas |
141 |
{ |
5288 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5288 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('headerMissingAnnotationTypes', 'invalid', 'One ore more required INCA annotations are missing in BASE: <b>' + Strings.encodeTags(headers.missingAnnotationTypeNames.join(', ')) + '</b>'); |
5288 |
08 Feb 19 |
nicklas |
144 |
} |
5288 |
08 Feb 19 |
nicklas |
else |
5288 |
08 Feb 19 |
nicklas |
146 |
{ |
5288 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('headerMissingAnnotationTypes', 'valid'); |
5288 |
08 Feb 19 |
nicklas |
148 |
} |
5288 |
08 Feb 19 |
nicklas |
149 |
|
5287 |
08 Feb 19 |
nicklas |
Doc.element('headerDuplicates').innerHTML = headers.duplicates; |
5287 |
08 Feb 19 |
nicklas |
if (headers.duplicates > 0) |
5287 |
08 Feb 19 |
nicklas |
152 |
{ |
5287 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('headerDuplicates', 'invalid', 'Duplicate headers must be removed before the file can be imported: <b>' + Strings.encodeTags(headers.duplicateNames.join(', ')) + '</b>'); |
5287 |
08 Feb 19 |
nicklas |
155 |
} |
5287 |
08 Feb 19 |
nicklas |
else |
5287 |
08 Feb 19 |
nicklas |
157 |
{ |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('headerDuplicates', 'valid'); |
5287 |
08 Feb 19 |
nicklas |
159 |
} |
5287 |
08 Feb 19 |
nicklas |
160 |
|
5287 |
08 Feb 19 |
nicklas |
var statisticsLineCount = fileInfo.data.count - fileInfo.data.totalExcluded; |
5287 |
08 Feb 19 |
nicklas |
Doc.element('lineCount').innerHTML = fileInfo.data.count; |
5287 |
08 Feb 19 |
nicklas |
Doc.element('statisticsLineCount').innerHTML = statisticsLineCount; |
5287 |
08 Feb 19 |
nicklas |
Doc.element('totalExcluded').innerHTML = fileInfo.data.totalExcluded; |
5287 |
08 Feb 19 |
nicklas |
if (fileInfo.data.count == 0) |
5287 |
08 Feb 19 |
nicklas |
166 |
{ |
5287 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('lineCount', 'invalid', 'The file contains no data.'); |
5287 |
08 Feb 19 |
nicklas |
169 |
} |
5287 |
08 Feb 19 |
nicklas |
else if (statisticsLineCount == 0) |
5287 |
08 Feb 19 |
nicklas |
171 |
{ |
5287 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('statisticsLineCount', 'invalid', 'The file contains no data that can be used for statistics.'); |
5287 |
08 Feb 19 |
nicklas |
174 |
} |
5287 |
08 Feb 19 |
nicklas |
else |
5287 |
08 Feb 19 |
nicklas |
176 |
{ |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('statisticsLineCount', 'valid'); |
5287 |
08 Feb 19 |
nicklas |
178 |
} |
5287 |
08 Feb 19 |
nicklas |
179 |
|
5287 |
08 Feb 19 |
nicklas |
if (istat.setExcludedLines('tooManyColumns', fileInfo.data.TOO_MANY_COLUMNS) > 0) |
5287 |
08 Feb 19 |
nicklas |
181 |
{ |
5287 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('tooManyColumns', 'invalid', 'All data lines must have the same number of columns.'); |
5287 |
08 Feb 19 |
nicklas |
184 |
} |
5287 |
08 Feb 19 |
nicklas |
185 |
|
5287 |
08 Feb 19 |
nicklas |
if (istat.setExcludedLines('tooFewColumns', fileInfo.data.TOO_FEW_COLUMNS) > 0) |
5287 |
08 Feb 19 |
nicklas |
187 |
{ |
5287 |
08 Feb 19 |
nicklas |
fileCanBeUsed = false; |
5287 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('tooFewColumns', 'invalid', 'All data lines must have the same number of columns.'); |
5287 |
08 Feb 19 |
nicklas |
190 |
} |
5288 |
08 Feb 19 |
nicklas |
191 |
|
5288 |
08 Feb 19 |
nicklas |
if (istat.setExcludedLines('missingLaterality', fileInfo.data.MISSING_LATERALITY) > 0) |
5288 |
08 Feb 19 |
nicklas |
193 |
{ |
5288 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('missingLaterality', 'warning', 'Lines without laterality are skipped.'); |
5288 |
08 Feb 19 |
nicklas |
195 |
} |
5288 |
08 Feb 19 |
nicklas |
196 |
|
5288 |
08 Feb 19 |
nicklas |
if (istat.setExcludedLines('duplicateLaterality', fileInfo.data.DUPLICATE_LATERALITY) > 0) |
5288 |
08 Feb 19 |
nicklas |
198 |
{ |
5288 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('duplicateLaterality', 'warning', 'Lines with same personal number/id and laterality are skipped.'); |
5288 |
08 Feb 19 |
nicklas |
200 |
} |
3963 |
20 May 16 |
olle |
201 |
|
5288 |
08 Feb 19 |
nicklas |
if (istat.setExcludedLines('invalidDataValue', fileInfo.data.INVALID_DATA_VALUE) > 0) |
5288 |
08 Feb 19 |
nicklas |
203 |
{ |
5288 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('invalidDataValue', 'warning', 'Lines with invalid values are skipped.'); |
5288 |
08 Feb 19 |
nicklas |
205 |
} |
5288 |
08 Feb 19 |
nicklas |
206 |
|
5288 |
08 Feb 19 |
nicklas |
if (istat.setExcludedLines('filteredByDate', fileInfo.data.FILTERED_BY_DATE) > 0) |
5288 |
08 Feb 19 |
nicklas |
208 |
{ |
5288 |
08 Feb 19 |
nicklas |
var opt = frm.statisticsDateVar[frm.statisticsDateVar.selectedIndex]; |
5288 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('filteredByDate', 'valid', 'Only lines with <b>' + opt.text + '</b> between <b>' + Reggie.reformatDate(frm.startDate.value) + '</b> and <b>' + Reggie.reformatDate(frm.endDate.value) + '</b> are included.'); |
5288 |
08 Feb 19 |
nicklas |
211 |
} |
5288 |
08 Feb 19 |
nicklas |
212 |
|
5288 |
08 Feb 19 |
nicklas |
if (istat.setExcludedLines('filteredByCancerType', fileInfo.data.FILTERED_BY_CANCER_TYPE) > 0) |
5288 |
08 Feb 19 |
nicklas |
214 |
{ |
5288 |
08 Feb 19 |
nicklas |
var opt = frm.cancerType[frm.cancerType.selectedIndex]; |
5288 |
08 Feb 19 |
nicklas |
Wizard.setInputStatus('filteredByCancerType', 'valid', 'Only lines with <b>'+opt.text+'</b> are included.'); |
5288 |
08 Feb 19 |
nicklas |
217 |
} |
5291 |
11 Feb 19 |
nicklas |
218 |
|
5291 |
11 Feb 19 |
nicklas |
if (fileCanBeUsed) |
5291 |
11 Feb 19 |
nicklas |
220 |
{ |
5291 |
11 Feb 19 |
nicklas |
var statistics = fileInfo.statistics; |
5291 |
11 Feb 19 |
nicklas |
var statHtml = ''; |
5291 |
11 Feb 19 |
nicklas |
for (var i = 0; i < statistics.length; i++) |
5291 |
11 Feb 19 |
nicklas |
224 |
{ |
5291 |
11 Feb 19 |
nicklas |
var statVar = statistics[i]; |
5302 |
15 Feb 19 |
nicklas |
var notNa = statVar.notNa; |
5291 |
11 Feb 19 |
nicklas |
for (var g = 0; g < statVar.groups.length; g++) |
5291 |
11 Feb 19 |
nicklas |
228 |
{ |
5291 |
11 Feb 19 |
nicklas |
var grp = statVar.groups[g]; |
5302 |
15 Feb 19 |
nicklas |
var noPct = grp.isNa || !statVar.hasNaGroup; |
5292 |
12 Feb 19 |
nicklas |
231 |
|
5292 |
12 Feb 19 |
nicklas |
if (g == 0) |
5291 |
11 Feb 19 |
nicklas |
233 |
{ |
5292 |
12 Feb 19 |
nicklas |
statHtml += '<tr class="stat-var">'; |
5292 |
12 Feb 19 |
nicklas |
statHtml += '<td class="stat-var-name">'+Strings.encodeTags(statVar.name)+'</td>'; |
5291 |
11 Feb 19 |
nicklas |
236 |
} |
5292 |
12 Feb 19 |
nicklas |
else |
5292 |
12 Feb 19 |
nicklas |
238 |
{ |
5292 |
12 Feb 19 |
nicklas |
statHtml += '<tr>'; |
5292 |
12 Feb 19 |
nicklas |
if (g == 1 && statVar.unit) |
5292 |
12 Feb 19 |
nicklas |
241 |
{ |
5292 |
12 Feb 19 |
nicklas |
statHtml += '<td class="stat-var-unit">('+statVar.unit+')</td>'; |
5292 |
12 Feb 19 |
nicklas |
243 |
} |
5292 |
12 Feb 19 |
nicklas |
else |
5292 |
12 Feb 19 |
nicklas |
245 |
{ |
5292 |
12 Feb 19 |
nicklas |
statHtml += '<td></td>'; |
5292 |
12 Feb 19 |
nicklas |
247 |
} |
5292 |
12 Feb 19 |
nicklas |
248 |
} |
5292 |
12 Feb 19 |
nicklas |
statHtml += '<td class="stat-grp-name">'+Strings.encodeTags(grp.name)+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="count">'+grp.total+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="percentage">'+(noPct ? '' : Reggie.formatNumber(100*grp.total/notNa.total, '%', 1))+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="fullstatistics count">'+grp.accruedSpecimen+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="fullstatistics percentage">'+(noPct ? '' : Reggie.formatNumber(100*grp.accruedSpecimen/notNa.accruedSpecimen, '%', 1))+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="count">'+grp.accruedNoSpecimen+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="percentage">'+(noPct ? '' : Reggie.formatNumber(100*grp.accruedNoSpecimen/notNa.accruedNoSpecimen, '%', 1))+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="count">'+grp.notAccrued+'</td>'; |
5302 |
15 Feb 19 |
nicklas |
statHtml += '<td class="percentage">'+(noPct ? '' : Reggie.formatNumber(100*grp.notAccrued/notNa.notAccrued, '%', 1))+'</td>'; |
5291 |
11 Feb 19 |
nicklas |
statHtml += '</tr>'; |
5291 |
11 Feb 19 |
nicklas |
259 |
} |
5291 |
11 Feb 19 |
nicklas |
260 |
} |
5291 |
11 Feb 19 |
nicklas |
Doc.element('stat-data').innerHTML = statHtml; |
5292 |
12 Feb 19 |
nicklas |
Doc.show('stat-table', 'table'); |
5292 |
12 Feb 19 |
nicklas |
Data.set('stat-table', 'check-type', checkType); |
5291 |
11 Feb 19 |
nicklas |
264 |
} |
5291 |
11 Feb 19 |
nicklas |
265 |
|
3963 |
20 May 16 |
olle |
Wizard.setCurrentStep(2); |
5287 |
08 Feb 19 |
nicklas |
if (fileCanBeUsed) |
5287 |
08 Feb 19 |
nicklas |
268 |
{ |
5292 |
12 Feb 19 |
nicklas |
if (checkType == 'simplestatistics') |
5292 |
12 Feb 19 |
nicklas |
270 |
{ |
5292 |
12 Feb 19 |
nicklas |
Doc.show('fullstatistics'); |
5292 |
12 Feb 19 |
nicklas |
272 |
} |
5293 |
12 Feb 19 |
nicklas |
else |
5293 |
12 Feb 19 |
nicklas |
274 |
{ |
5293 |
12 Feb 19 |
nicklas |
Doc.show('downloadoutputfile'); |
5293 |
12 Feb 19 |
nicklas |
276 |
} |
5287 |
08 Feb 19 |
nicklas |
277 |
} |
5287 |
08 Feb 19 |
nicklas |
else |
5287 |
08 Feb 19 |
nicklas |
279 |
{ |
5287 |
08 Feb 19 |
nicklas |
Wizard.setWizardStatus('messagecontainer error', 'Statistics is not possible.'); |
5287 |
08 Feb 19 |
nicklas |
281 |
} |
5287 |
08 Feb 19 |
nicklas |
282 |
|
5292 |
12 Feb 19 |
nicklas |
Wizard.setNoConfirm(true); |
5292 |
12 Feb 19 |
nicklas |
Doc.show('gorestart'); |
5287 |
08 Feb 19 |
nicklas |
Doc.show('downloadreportfile'); |
3963 |
20 May 16 |
olle |
286 |
} |
3963 |
20 May 16 |
olle |
287 |
|
5287 |
08 Feb 19 |
nicklas |
288 |
/** |
5287 |
08 Feb 19 |
nicklas |
Set the value for an 'excluded line' variable. If the |
5287 |
08 Feb 19 |
nicklas |
number of excluded lines is 0 the entire row is hidden. |
5287 |
08 Feb 19 |
nicklas |
291 |
*/ |
5287 |
08 Feb 19 |
nicklas |
istat.setExcludedLines = function(elementId, numLines) |
5287 |
08 Feb 19 |
nicklas |
293 |
{ |
5287 |
08 Feb 19 |
nicklas |
Doc.element(elementId).innerHTML = numLines; |
5287 |
08 Feb 19 |
nicklas |
Doc.showHide(elementId+'.row', numLines > 0); |
5287 |
08 Feb 19 |
nicklas |
return numLines; |
5287 |
08 Feb 19 |
nicklas |
297 |
} |
5287 |
08 Feb 19 |
nicklas |
298 |
|
5290 |
11 Feb 19 |
nicklas |
istat.downloadReportFile = function(event) |
3963 |
20 May 16 |
olle |
300 |
{ |
3963 |
20 May 16 |
olle |
var frm = document.forms['reggie']; |
5290 |
11 Feb 19 |
nicklas |
var reportType = Data.get(event.currentTarget, 'report-type'); |
3963 |
20 May 16 |
olle |
303 |
|
3963 |
20 May 16 |
olle |
var url = '../Inca.servlet?ID='+App.getSessionId(); |
3963 |
20 May 16 |
olle |
url += '&cmd=DownloadIncaReportFile'; |
5290 |
11 Feb 19 |
nicklas |
url += '&reporttype='+encodeURIComponent(reportType); |
3963 |
20 May 16 |
olle |
window.open(url); |
3963 |
20 May 16 |
olle |
308 |
} |
3963 |
20 May 16 |
olle |
309 |
|
3963 |
20 May 16 |
olle |
return istat; |
3963 |
20 May 16 |
olle |
311 |
}(); |
3963 |
20 May 16 |
olle |
312 |
|
3963 |
20 May 16 |
olle |
Doc.onLoad(Istat.initPage); |
3963 |
20 May 16 |
olle |
314 |
|