=== modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2014-06-22 07:04:04 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js 2014-06-25 11:04:16 +0000 @@ -240,7 +240,7 @@ { return function() { return $.ajax( { - url: '../api/programs.json?filter=id:eq:' + id +'&fields=id,name,version,dateOfEnrollmentDescription,dateOfIncidentDescription,displayIncidentDate,ignoreOverdueEvents,organisationUnits[id,name],programStages[id,name]', + url: '../api/programs.json?filter=id:eq:' + id +'&fields=id,name,version,dateOfEnrollmentDescription,dateOfIncidentDescription,displayIncidentDate,ignoreOverdueEvents,organisationUnits[id,name],programStages[id,name,version]', type: 'GET' }).done( function( response ){ @@ -317,7 +317,7 @@ { return function() { return $.ajax( { - url: '../api/programStages.json?filter=id:eq:' + id +'&fields=id,name,description,reportDateDescription,captureCoordinates,dataEntryForm,minDaysFromStart,repeatable,programStageDataElements[displayInReports,allowProvidedElsewhere,allowDateInFuture,compulsory,dataElement[id,name,type,optionSet[id]]]', + url: '../api/programStages.json?filter=id:eq:' + id +'&fields=id,name,version,description,reportDateDescription,captureCoordinates,dataEntryForm,minDaysFromStart,repeatable,programStageDataElements[displayInReports,allowProvidedElsewhere,allowDateInFuture,compulsory,dataElement[id,name,type,optionSet[id]]]', type: 'GET' }).done( function( response ){ _.each( _.values( response.programStages ), function( programStage ) { === modified file 'dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js' --- dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js 2014-06-25 05:30:24 +0000 +++ dhis-2/dhis-web/dhis-web-event-capture/src/main/webapp/dhis-web-event-capture/scripts/services.js 2014-06-25 11:04:16 +0000 @@ -203,57 +203,65 @@ }); var inputRegex = //g, - styleRegex = /style="[^"]*"/, - idRegex = /id="[^"]*"/, match, inputFields = []; while (match = inputRegex.exec(htmlCode)) { inputFields.push(match[0]); } - - for(var i=0; i'; } if(programStageDataElements[deId].dataElement.type == "string"){ - newInputField = ''; } if(programStageDataElements[deId].dataElement.type == "bool"){ - newInputField = ''; } if(programStageDataElements[deId].dataElement.type == "trueOnly"){ - newInputField = ''; } @@ -264,7 +272,7 @@ //''; htmlCode = htmlCode.replace(inputField, newInputField); - } + } } return htmlCode; @@ -272,9 +280,20 @@ } return null; + }, + getAttributesAsString: function(attributes){ + if(attributes){ + var attributesAsString = ''; + for(var prop in attributes){ + if(prop != 'value'){ + attributesAsString += prop + '="' + attributes[prop] + '" '; + } + } + return attributesAsString; + } + return null; } - }; - + }; }) /* Modal service for user interaction */