dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16701
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6413: (patient) Don't save program-stage-data-elements when updating a program-stage.
------------------------------------------------------------
revno: 6413
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-03-28 16:46:30 +0700
message:
(patient) Don't save program-stage-data-elements when updating a program-stage.
modified:
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js
--
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-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-03-19 09:35:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updateProgramStageForm.js 2012-03-28 09:46:30 +0000
@@ -1,23 +1,56 @@
-jQuery(function() {
- jQuery("#availableList").dhisAjaxSelect({
- source: "../dhis-web-commons-ajax-json/getDataElements.action?domain=patient",
- iterator: "dataElements",
- connectedTo: 'selectedDataElementsValidator',
- handler: function(item) {
- var option = jQuery("<option />");
- option.text( item.name );
- option.attr( "value", item.id );
-
- var flag = false;
- jQuery("#selectedList").find("tr").each( function( k, selectedItem ){
- if(selectedItem.id == item.id )
- {
- flag = true;
- return;
- }
- });
-
- if(!flag) return option;
+jQuery( document ).ready( function()
+{validation( 'updateProgramStageForm', function( form ){
+ form.submit() ;
+ }, function(){
+ selectedDataElementsValidator = jQuery( "#selectedDataElementsValidator" );
+ selectedDataElementsValidator.empty();
+
+ compulsories = jQuery( "#compulsories" );
+ compulsories.empty();
+
+ showOnReport = jQuery( "#showOnReport" );
+ showOnReport.empty();
+
+ var hasDeShowReport = false;
+ jQuery("#selectedList").find("tr").each( function( i, item ){
+ selectedDataElementsValidator.append( "<option value='" + item.id + "' selected='true'>" + item.id + "</option>" );
+ var compulsory = jQuery( item ).find( "input[name='compulsory']:first");
+ var isShow = jQuery( item ).find( "input[name='isShow']:first");
+
+ var checked = compulsory.attr('checked') ? true : false;
+ compulsories.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+
+ checked = isShow.attr('checked') ? true : false;
+ showOnReport.append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
+ if( checked )
+ {
+ hasDeShowReport = true;
+ jQuery( "#checkShowOnReport" ).append( "<option value='" + checked + "' selected='true'>" + checked + "</option>" );
}
});
- });
\ No newline at end of file
+ });
+
+ checkValueIsExist( "name", "validateProgramStage.action", {id:getFieldValue('id')});
+
+ jQuery("#availableList").dhisAjaxSelect({
+ source: "../dhis-web-commons-ajax-json/getDataElements.action?domain=patient",
+ iterator: "dataElements",
+ connectedTo: 'selectedDataElementsValidator',
+ handler: function(item) {
+ var option = jQuery("<option />");
+ option.text( item.name );
+ option.attr( "value", item.id );
+
+ var flag = false;
+ jQuery("#selectedList").find("tr").each( function( k, selectedItem ){
+ if(selectedItem.id == item.id )
+ {
+ flag = true;
+ return;
+ }
+ });
+
+ if(!flag) return option;
+ }
+ });
+});
\ No newline at end of file