dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19973
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8946: Add Show-In-List property for programstage-dateelement; Load show-in-list dataelements in tabular...
------------------------------------------------------------
revno: 8946
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-11-08 11:13:48 +0700
message:
Add Show-In-List property for programstage-dateelement; Load show-in-list dataelements in tabular report/anonymous program entry form instead of compulsary date elements.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2012-06-04 10:03:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageDataElement.java 2012-11-08 04:13:48 +0000
@@ -62,6 +62,8 @@
private Boolean allowProvidedElsewhere;
private Integer sortOrder;
+
+ private Boolean displayInReports;
// -------------------------------------------------------------------------
// Constructors
@@ -137,6 +139,16 @@
this.sortOrder = sortOrder;
}
+ public Boolean getDisplayInReports()
+ {
+ return displayInReports;
+ }
+
+ public void setDisplayInReports( Boolean displayInReports )
+ {
+ this.displayInReports = displayInReports;
+ }
+
// -------------------------------------------------------------------------
// hashCode, equals and toString
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-10-26 07:32:43 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-11-08 04:13:48 +0000
@@ -145,6 +145,8 @@
executeSql( "ALTER TABLE period modify periodid int AUTO_INCREMENT");
executeSql( "CREATE SEQUENCE period_periodid_seq");
executeSql( "ALTER TABLE period ALTER COLUMN periodid SET DEFAULT NEXTVAL('period_periodid_seq')");
+
+ executeSql( "UPDATE program SET programstage_dataelements=false WHERE displayInReports is null" );
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml'
--- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml 2012-06-04 10:03:56 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/program/hibernate/ProgramStageDataElement.hbm.xml 2012-11-08 04:13:48 +0000
@@ -17,7 +17,9 @@
<property name="allowProvidedElsewhere" column="allowprovidedelsewhere" />
- <property name="sortOrder" column="sort_order" />
+ <property name="sortOrder" column="sort_order" />
+
+ <property name="displayInReports"/>
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2012-11-07 16:42:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2012-11-08 04:13:48 +0000
@@ -18,7 +18,7 @@
<input type='hidden' id='programStageId' name='programStageId' class='stage-object-selected'>
<input type='hidden' id='isShowEventList' name='isShowEventList'>
-<select multiple id='compulsoryDE' name='compulsoryDE' class='hidden'></select>
+<select multiple id='displayInReports' name='displayInReports' class='hidden'></select>
<div>
<div id='selectDiv'>
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-11-07 15:05:14 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-11-08 04:13:48 +0000
@@ -213,7 +213,7 @@
var array = [];
Ext.Array.each(selected, function(item) {
var data = a.store.findExact('id', item);
- array.push({id: item, name: a.store.getAt(data).data.name, compulsory: a.store.getAt(data).data.compulsory, valueType: a.store.getAt(data).data.valueType});
+ array.push({id: item, name: a.store.getAt(data).data.name, compulsory: a.store.getAt(data).data.compulsory, valueType: a.store.getAt(data).data.valueType, displayInReports:r.data.displayInReports});
});
s.store.add(array);
}
@@ -226,7 +226,7 @@
{
if( elements[i].style.display != 'none' )
{
- array.push({id: a.store.getAt(i).data.id, name: a.store.getAt(i).data.name, compulsory: a.store.getAt(i).data.compulsory, valueType: a.store.getAt(i).data.valueType});
+ array.push({id: a.store.getAt(i).data.id, name: a.store.getAt(i).data.name, compulsory: a.store.getAt(i).data.compulsory, valueType: a.store.getAt(i).data.valueType, displayInReports:r.data.displayInReports});
}
}
s.store.add(array);
@@ -594,7 +594,7 @@
}),
dataelement: {
available: Ext.create('Ext.data.Store', {
- fields: ['id', 'name', 'compulsory', 'valueType'],
+ fields: ['id', 'name', 'compulsory', 'valueType', 'displayInReports'],
proxy: {
type: 'ajax',
url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.dataelements_get,
@@ -608,6 +608,15 @@
listeners: {
load: function(s) {
this.isloaded = true;
+ // Get displayedInList-Data elements
+ var array = [];
+ TR.cmp.params.dataelement.available.store.each( function(r) {
+ if( r.data.displayInReports=="true" )
+ {
+ array.push({id: r.data.id, name: r.data.name, compulsory: r.data.compulsory, valueType: r.data.valueType, displayInReports:r.data.displayInReports });
+ }
+ });
+ TR.cmp.params.dataelement.selected.store.add(array);
TR.util.store.addToStorage(s);
TR.util.multiselect.filterAvailable(TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected);
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-11-07 16:42:07 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js 2012-11-08 04:13:48 +0000
@@ -8,7 +8,7 @@
function( json )
{
clearListById('searchObjectId');
- clearListById('compulsoryDE');
+ clearListById('displayInReports');
clearListById('programId');
jQuery( '#programId').append( '<option value="" psid="" reportDateDes="' + i18n_report_date + '">[' + i18n_please_select + ']</option>' );
@@ -79,14 +79,14 @@
jQuery('.stage-object-selected').attr('psid', jQuery('#programId option:selected').attr("psid"));
clearListById('searchObjectId');
- clearListById('compulsoryDE');
+ clearListById('displayInReports');
jQuery( '#searchObjectId').append( '<option value="" >[' + i18n_please_select + ']</option>' );
for ( i in json.programStageDataElements ) {
jQuery( '#searchObjectId').append( '<option value="' + json.programStageDataElements[i].id + '" type="' + json.programStageDataElements[i].type +'">' + json.programStageDataElements[i].name + '</option>' );
- if( json.programStageDataElements[i].compulsory=='true' ){
- jQuery( '#compulsoryDE').append( '<option value="' + json.programStageDataElements[i].id + '"></option>');
+ if( json.programStageDataElements[i].displayInReports=='true' ){
+ jQuery( '#displayInReports').append( '<option value="' + json.programStageDataElements[i].id + '"></option>');
}
}
@@ -194,7 +194,7 @@
params += '&endDate=' + getFieldValue('endDate');
if(listAll){
- jQuery( '#compulsoryDE option' ).each( function( i, item ){
+ jQuery( '#displayInReports option' ).each( function( i, item ){
var input = jQuery( item );
params += '&searchingValues=de_' + input.val() + '_false_';
});
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-11-07 15:43:51 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-11-08 04:13:48 +0000
@@ -605,7 +605,6 @@
$.ajax({
url: "getOptions.action?id=" + dataElementId + "&query=" + input.val(),
dataType: "json",
- cache: true,
success: function(data) {
response($.map(data.options, function(item) {
return {
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm 2012-06-25 02:11:55 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStageDataElements.vm 2012-11-08 04:13:48 +0000
@@ -3,14 +3,15 @@
#foreach( ${programStageDataElement} in $!{programStageDataElements} )
{
"id": "${programStageDataElement.dataElement.id}",
- "name": "$!encoder.jsonEncode( ${programStageDataElement.dataElement.name} )",
+ "name": "$!encoder.jsonEncode( ${programStageDataElement.dataElement.getFormNameFallback()} )",
"type":
#if( $!programStageDataElement.dataElement.optionSet )
"optionset",
#else
"${programStageDataElement.dataElement.type}",
#end
- "compulsory": "${programStageDataElement.compulsory}"
+ "compulsory": "${programStageDataElement.compulsory}",
+ "displayInReports": "${programStageDataElement.displayInReports}"
}#if( $velocityCount < $size ),#end
#end
]
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm 2012-06-12 03:38:24 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm 2012-11-08 04:13:48 +0000
@@ -3,8 +3,9 @@
#foreach( $psDataElement in $psDataElements )
{
"id": "de_$!{psDataElement.dataElement.id}",
- "name": "$encoder.xmlEncode(${psDataElement.dataElement.displayName} )",
+ "name": "$encoder.xmlEncode(${psDataElement.dataElement.getFormNameFallback()} )",
"compulsory": "${psDataElement.compulsory}",
+ "displayInReports": "$psDataElement.displayInReports",
"valueType": #if( $psDataElement.dataElement.optionSet )
"list"
#else
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2012-10-01 03:06:32 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/AddProgramStageAction.java 2012-11-08 04:13:48 +0000
@@ -184,6 +184,13 @@
this.autoGenerateEvent = autoGenerateEvent;
}
+ private List<Boolean> displayInReports = new ArrayList<Boolean>();
+
+ public void setDisplayInReports( List<Boolean> displayInReports )
+ {
+ this.displayInReports = displayInReports;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -194,7 +201,7 @@
minDaysFromStart = (minDaysFromStart == null) ? 0 : minDaysFromStart;
irregular = (irregular == null) ? false : irregular;
autoGenerateEvent = (autoGenerateEvent == null) ? false : autoGenerateEvent;
-
+
ProgramStage programStage = new ProgramStage();
Program program = programService.getProgram( id );
@@ -206,7 +213,7 @@
programStage.setIrregular( irregular );
programStage.setMinDaysFromStart( minDaysFromStart );
programStage.setAutoGenerateEvent( autoGenerateEvent );
-
+
Set<PatientReminder> patientReminders = new HashSet<PatientReminder>();
for ( int i = 0; i < daysAllowedSendMessages.size(); i++ )
{
@@ -221,10 +228,13 @@
for ( int i = 0; i < this.selectedDataElementsValidator.size(); i++ )
{
DataElement dataElement = dataElementService.getDataElement( selectedDataElementsValidator.get( i ) );
+ Boolean allowed = allowProvidedElsewhere.get( i ) == null ? false : allowProvidedElsewhere.get( i );
+ Boolean displayInReport = displayInReports.get( i ) == null ? false : displayInReports.get( i );
+
ProgramStageDataElement programStageDataElement = new ProgramStageDataElement( programStage, dataElement,
this.compulsories.get( i ), new Integer( i ) );
- Boolean allowed = allowProvidedElsewhere.get( i ) == null ? false : allowProvidedElsewhere.get( i );
programStageDataElement.setAllowProvidedElsewhere( allowed );
+ programStageDataElement.setDisplayInReports( displayInReport );
programStageDataElementService.addProgramStageDataElement( programStageDataElement );
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2012-09-25 03:50:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/programstage/UpdateProgramStageAction.java 2012-11-08 04:13:48 +0000
@@ -177,6 +177,13 @@
this.autoGenerateEvent = autoGenerateEvent;
}
+ private List<Boolean> displayInReports = new ArrayList<Boolean>();
+
+ public void setDisplayInReports( List<Boolean> displayInReports )
+ {
+ this.displayInReports = displayInReports;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -216,6 +223,7 @@
{
DataElement dataElement = dataElementService.getDataElement( selectedDataElementsValidator.get( i ) );
Boolean allowed = allowProvidedElsewhere.get( i ) == null ? false : allowProvidedElsewhere.get( i );
+ Boolean displayInReport = displayInReports.get( i ) == null ? false : displayInReports.get( i );
ProgramStageDataElement programStageDataElement = programStageDataElementService.get( programStage,
dataElement );
@@ -225,16 +233,15 @@
programStageDataElement = new ProgramStageDataElement( programStage, dataElement,
this.compulsories.get( i ), new Integer( i ) );
programStageDataElement.setAllowProvidedElsewhere( allowed );
+ programStageDataElement.setDisplayInReports( displayInReport );
programStageDataElementService.addProgramStageDataElement( programStageDataElement );
}
else
{
programStageDataElement.setCompulsory( this.compulsories.get( i ) );
-
programStageDataElement.setSortOrder( new Integer( i ) );
-
programStageDataElement.setAllowProvidedElsewhere( allowed );
-
+ programStageDataElement.setDisplayInReports( displayInReport );
programStageDataElementService.updateProgramStageDataElement( programStageDataElement );
programStageDataElements.remove( programStageDataElement );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2012-11-02 15:59:25 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2012-11-08 04:13:48 +0000
@@ -315,4 +315,5 @@
no_aggregation = No aggregation
age_at_visit_days_since_birth = Age at visit (days since birth)
formula = Formula
-schedule_automated_message_reminder_form = Schedule automated message reminder
\ No newline at end of file
+schedule_automated_message_reminder_form = Schedule automated message reminder
+display_in_reports = Display in reports
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2012-10-26 03:26:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addProgramStageForm.vm 2012-11-08 04:13:48 +0000
@@ -70,6 +70,7 @@
<select id="selectedDataElementsValidator" name='selectedDataElementsValidator' multiple="multiple" class="hidden" ></select>
<select id="compulsories" name='compulsories' multiple="multiple" class="hidden"></select>
<select id="allowProvidedElsewhere" name='allowProvidedElsewhere' multiple="multiple" class="hidden"></select>
+ <select id="displayInReports" name='displayInReports' multiple="multiple" class=""></select>
</th>
</tr>
</thead>
@@ -95,12 +96,14 @@
<col/>
<col style="width:20px;"/>
<col style="width:20px;"/>
+ <col style="width:20px;"/>
</colgroup>
<thead>
<tr>
<th>$i18n.getString( "dataelement" )</th>
<th>$i18n.getString( "compulsory" )</th>
<th>$i18n.getString( "allow_provided_elsewhere" )</th>
+ <th>$i18n.getString( "display_in_reports" )</th>
</thead>
<tbody id="selectedList"></tbody>
</table>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js 2012-10-09 07:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addProgramStageForm.js 2012-11-08 04:13:48 +0000
@@ -21,14 +21,20 @@
var selectedDataElementsValidator = jQuery( "#selectedDataElementsValidator" );
selectedDataElementsValidator.empty();
+
var compulsories = jQuery( "#compulsories" );
compulsories.empty();
+
+ var displayInReports = jQuery( "#displayInReports" );
+ displayInReports.empty();
+
var daysAllowedSendMessages = jQuery( "#daysAllowedSendMessages" );
daysAllowedSendMessages.empty();
+
var templateMessages = jQuery( "#templateMessages" );
templateMessages.empty();
- allowProvidedElsewhere = jQuery( "#allowProvidedElsewhere" );
+ var allowProvidedElsewhere = jQuery( "#allowProvidedElsewhere" );
allowProvidedElsewhere.empty();
jQuery("#selectedList").find("tr").each( function( i, item ){
@@ -42,6 +48,10 @@
var allowProvided = jQuery( item ).find( "input[name='allowProvided']:first");
checked = allowProvided.attr('checked') ? true : false;
allowProvidedElsewhere.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+
+ var displayInReport = jQuery( item ).find( "input[name='displayInReport']:first");
+ checked = displayInReport.attr('checked') ? true : false;
+ displayInReports.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
});
jQuery(".daysAllowedSendMessage").each( function( i, item ){
daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2012-10-10 02:23:29 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/programStage.js 2012-11-08 04:13:48 +0000
@@ -91,8 +91,9 @@
jQuery("#availableList").children().each(function(i, item){
if( item.selected ){
html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectDataElement( this )'><td onmousedown='select(event,this)'>" + item.text + "</td>";
- html += "<td align='center'><input type='checkbox' name='compulsory' value='" + item.value + "'></td>";
- html += "<td align='center'><input type='checkbox' name='allowProvided' value='" + item.value + "'></td>";
+ html += "<td align='center'><input type='checkbox' name='compulsory'></td>";
+ html += "<td align='center'><input type='checkbox' name='allowProvided'></td>";
+ html += "<td align='center'><input type='checkbox' name='displayInReport'></td>";
html += "</tr>";
selectedList.append( html );
jQuery( item ).remove();
@@ -106,8 +107,9 @@
var selectedList = jQuery("#selectedList");
jQuery("#availableList").children().each(function(i, item){
html = "<tr class='selected' id='" + item.value + "' ondblclick='unSelectDataElement( this )'><td onmousedown='select(this)'>" + item.text + "</td>";
- html += "<td align='center'><input type='checkbox' name='compulsory' value='" + item.value + "'></td>";
- html += "<td align='center'><input type='checkbox' name='allowProvided' value='" + item.value + "'></td>";
+ html += "<td align='center'><input type='checkbox' name='compulsory'></td>";
+ html += "<td align='center'><input type='checkbox' name='allowProvided'></td>";
+ html += "<td align='center'><input type='checkbox' name='displayInReport'></td>";
html += "</tr>";
selectedList.append( html );
jQuery( item ).remove();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js 2012-10-09 07:58:28 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js 2012-11-08 04:13:48 +0000
@@ -21,10 +21,16 @@
var selectedDataElementsValidator = jQuery( "#selectedDataElementsValidator" );
selectedDataElementsValidator.empty();
+
var compulsories = jQuery( "#compulsories" );
compulsories.empty();
+
+ var displayInReports = jQuery( "#displayInReports" );
+ displayInReports.empty();
+
var daysAllowedSendMessages = jQuery( "#daysAllowedSendMessages" );
daysAllowedSendMessages.empty();
+
var templateMessages = jQuery( "#templateMessages" );
templateMessages.empty();
@@ -39,10 +45,13 @@
var checked = compulsory.attr('checked') ? true : false;
compulsories.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
-
var allowProvided = jQuery( item ).find( "input[name='allowProvided']:first");
checked = allowProvided.attr('checked') ? true : false;
allowProvidedElsewhere.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+
+ var displayInReport = jQuery( item ).find( "input[name='displayInReport']:first");
+ checked = displayInReport.attr('checked') ? true : false;
+ displayInReports.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
});
jQuery(".daysAllowedSendMessage").each( function( i, item ){
daysAllowedSendMessages.append( "<option value='" + item.value + "' selected='true'>" + item.value +"</option>" );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2012-10-26 03:26:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updateProgramStageForm.vm 2012-11-08 04:13:48 +0000
@@ -73,6 +73,7 @@
<select id="selectedDataElementsValidator" name='selectedDataElementsValidator' multiple="multiple" class="hidden" > </select>
<select id="compulsories" name='compulsories' multiple="multiple" class="hidden"></select>
<select id="allowProvidedElsewhere" name='allowProvidedElsewhere' multiple="multiple" class="hidden"></select>
+ <select id="displayInReports" name='displayInReports' multiple="multiple" class="hidden"></select>
</th>
</tr>
</thead>
@@ -105,6 +106,7 @@
<th>$i18n.getString( "dataelement" )</th>
<th>$i18n.getString( "compulsory" )</th>
<th>$i18n.getString( "allow_provided_elsewhere" )</th>
+ <th>$i18n.getString( "display_in_reports" )</th>
</tr>
</thead>
<tbody id="selectedList">
@@ -113,6 +115,7 @@
<td onmousedown="select(event,this)">$encoder.htmlEncode( $programStageDataElement.dataElement.name )</td>
<td align="center"><input type="checkbox" name="compulsory" value="$programStageDataElement.dataElement.id" #if($programStageDataElement.compulsory == true ) checked #end /></td>
<td align="center"><input type="checkbox" name="allowProvided" value="$programStageDataElement.dataElement.id" #if($programStageDataElement.allowProvidedElsewhere == true ) checked #end /></td>
+ <td align="center"><input type="checkbox" name="displayInReport" value="$programStageDataElement.dataElement.id" #if($programStageDataElement.displayInReports == true ) checked #end /></td>
</tr>
#end
</tbody>