1
#set( $width = 40 * $dataElementHistory.historyLength )
2
#set( $lastIndex = $dataElementHistory.historyLength - 1 )
3
#set( $average = $dataElementHistory.historyPoints.get( $lastIndex ).average )
5
#if( $dataElementHistory.minLimit )
6
#set( $minLimit = $dataElementHistory.minLimit )
8
#set( $minLimit = $encoder.htmlEncode( $i18n.getString( "not_set" ) ) )
11
#if( $dataElementHistory.maxLimit )
12
#set( $maxLimit = $dataElementHistory.maxLimit )
14
#set( $maxLimit = $encoder.htmlEncode( $i18n.getString( "not_set" ) ) )
17
#if( $isHistoryValid )
18
<h2>$encoder.htmlEncode( $i18n.getString( "dataelement_history" ) )</h2>
19
<h4>$encoder.htmlEncode( $dataElementHistory.dataElement.shortName )</h4>
21
<h2>$encoder.htmlEncode( $i18n.getString( "dataelement_history" ) )</h2>
22
<h4>$encoder.htmlEncode( $i18n.getString( "history_not_valid" ) )</h4>
27
<td style="background-color:#ff0000"> </td>
28
<td>$encoder.htmlEncode( $i18n.getString( "max_limit" ) ) </td>
29
<td><input type="text" id="maxLimit" style="width:10em" value="$maxLimit"
30
#if( $auth.hasAccess( "dhis-web-dataentry", "saveMinMaxLimits" ) && $auth.hasAccess( "dhis-web-dataentry", "removeMinMaxLimits" ))
31
onchange="saveMaxLimit( $dataElementHistory.organisationUnit.id, $dataElementHistory.dataElement.id )"
32
#else disabled="disabled" #end onfocus="this.select()"></td>
35
<td style="background-color:#008000"> </td>
36
<td>$encoder.htmlEncode( $i18n.getString( "min_limit" ) ) </td>
37
<td><input type="text" id="minLimit" style="width:10em" value="$minLimit"
38
#if( $auth.hasAccess( "dhis-web-dataentry", "saveMinMaxLimits" ) && $auth.hasAccess( "dhis-web-dataentry", "removeMinMaxLimits" ))
39
onchange="saveMinLimit( $dataElementHistory.organisationUnit.id, $dataElementHistory.dataElement.id )"
40
#else disabled="disabled" #end onfocus="this.select()"></td>
43
<td style="background-color:#0080ff"> </td>
44
<td>$encoder.htmlEncode( $i18n.getString( "average" ) ) </td>
45
<td><script type="text/javascript">document.write( ${average}.toFixed(1) );</script></td>
49
<div id="canvas" style="position:relative;width:${width}px;height:300px;border:1px solid black;background-color:#dddddd;margin-top:1em"></div>
51
<p><input type="button" value="$encoder.htmlEncode( $i18n.getString( "close" ) )" onclick="window.opener.location.reload();window.close()"></p>
53
<script type="text/javascript">
55
var historyLength = $dataElementHistory.historyLength;
56
var maxValue = $dataElementHistory.maxValue;
57
var minLimit = #if( $dataElementHistory.minLimit ) $dataElementHistory.minLimit #else Number.NaN #end;
58
var maxLimit = #if( $dataElementHistory.maxLimit ) $dataElementHistory.maxLimit #else Number.NaN #end;
60
var historyPoints = new Array( $dataElementHistory.historyLength );
62
#foreach( $historyPoint in $dataElementHistory.historyPoints )
63
historyPoints[$i] = [#if( $historyPoint.period ) '$format.formatPeriod( $historyPoint.period )' #else '-' #end, #if( $historyPoint.value ) $historyPoint.value #else Number.NaN #end, $historyPoint.average];