← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21958: event-capture: name -> displayName

 

------------------------------------------------------------
revno: 21958
committer: Abyot Asalefew Gizaw <abyot@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-02-12 16:42:21 +0100
message:
  event-capture: name -> displayName
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/services.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/column-modal.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/indicators.html
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.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-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2016-02-03 12:47:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/controllers.js	2016-02-12 15:42:21 +0000
@@ -183,10 +183,10 @@
                 $scope.filterTypes = {};                               
                 $scope.newDhis2Event = {};
 
-                $scope.eventGridColumns.push({name: 'form_id', id: 'uid', valueType: 'TEXT', compulsory: false, filterWithRange: false, showFilter: false, show: false});
+                $scope.eventGridColumns.push({displayName: 'form_id', id: 'uid', valueType: 'TEXT', compulsory: false, filterWithRange: false, showFilter: false, show: false});
                 $scope.filterTypes['uid'] = 'TEXT';                
 
-                $scope.eventGridColumns.push({name: $scope.selectedProgramStage.reportDateDescription ? $scope.selectedProgramStage.reportDateDescription : $translate.instant('incident_date'), id: 'eventDate', valueType: 'DATE', filterWithRange: true, compulsory: false, showFilter: false, show: true});
+                $scope.eventGridColumns.push({displayName: $scope.selectedProgramStage.reportDateDescription ? $scope.selectedProgramStage.reportDateDescription : $translate.instant('incident_date'), id: 'eventDate', valueType: 'DATE', filterWithRange: true, compulsory: false, showFilter: false, show: true});
                 $scope.filterTypes['eventDate'] = 'DATE';
                 $scope.filterText['eventDate']= {};
 
@@ -197,7 +197,7 @@
                     //generate grid headers using program stage data elements
                     //create a template for new event
                     //for date type dataelements, filtering is based on start and end dates
-                    $scope.eventGridColumns.push({name: prStDe.dataElement.formName ? prStDe.dataElement.formName : prStDe.dataElement.name, 
+                    $scope.eventGridColumns.push({displayName: prStDe.dataElement.formName ? prStDe.dataElement.formName : prStDe.dataElement.displayName, 
                                                   id: prStDe.dataElement.id, 
                                                   valueType: prStDe.dataElement.valueType, 
                                                   compulsory: prStDe.compulsory, 
@@ -335,11 +335,11 @@
 
                                 if($scope.prStDes[dataValue.dataElement].dataElement.valueType === 'FILE_RESOURCE'){
                                     FileService.get(val).then(function(response){
-                                        if(response && response.name){
+                                        if(response && response.displayName){
                                             if(!$scope.fileNames[event.event]){
                                                 $scope.fileNames[event.event] = [];
                                             } 
-                                            $scope.fileNames[event.event][dataValue.dataElement] = response.name;
+                                            $scope.fileNames[event.event][dataValue.dataElement] = response.displayName;
                                         }
                                     });
                                 }
@@ -362,11 +362,11 @@
                     $scope.dhis2Events = data.events; 
                     
                     if($scope.noteExists && !GridColumnService.columnExists($scope.eventGridColumns, 'comment')){
-                        $scope.eventGridColumns.push({name: 'comment', id: 'comment', type: 'TEXT', filterWithRange: false, compulsory: false, showFilter: false, show: true});
+                        $scope.eventGridColumns.push({displayName: 'comment', id: 'comment', type: 'TEXT', filterWithRange: false, compulsory: false, showFilter: false, show: true});
                     }
                     
                     if(!$scope.sortHeader.id){
-                        $scope.sortEventGrid({name: $scope.selectedProgramStage.reportDateDescription ? $scope.selectedProgramStage.reportDateDescription : 'incident_date', id: 'eventDate', type: 'DATE', compulsory: false, showFilter: false, show: true});
+                        $scope.sortEventGrid({displayName: $scope.selectedProgramStage.reportDateDescription ? $scope.selectedProgramStage.reportDateDescription : 'incident_date', id: 'eventDate', type: 'DATE', compulsory: false, showFilter: false, show: true});
                     }
                 }
                 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js	2015-12-23 08:56:16 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/event-capture.js	2016-02-12 15:42:21 +0000
@@ -286,20 +286,20 @@
         return $.ajax( {
             url: '../api/programs.json',
             type: 'GET',
-            data: 'fields=id,name,programType,version,dataEntryMethod,enrollmentDateLabel,incidentDateLabel,displayIncidentDate,ignoreOverdueEvents,categoryCombo[id,name,isDefault,categories[id,name,categoryOptions[id,name]]],organisationUnits[id,name],programStages[id,name,version,description,excecutionDateLabel,captureCoordinates,dataEntryForm[id,name,style,htmlCode,format],minDaysFromStart,repeatable,preGenerateUID,programStageSections[id,name,programStageDataElements[dataElement[id]]],programStageDataElements[displayInReports,sortOrder,allowProvidedElsewhere,allowFutureDate,compulsory,dataElement[id,name,valueType,optionSetValue,formName,optionSet[id]]]],userRoles[id,name]&paging=false&filter=id:in:' + ids
+            data: 'fields=id,displayName,programType,version,dataEntryMethod,enrollmentDateLabel,incidentDateLabel,displayIncidentDate,ignoreOverdueEvents,categoryCombo[id,displayName,isDefault,categories[id,displayName,categoryOptions[id,displayName]]],organisationUnits[id,displayName],programStages[id,displayName,version,description,excecutionDateLabel,captureCoordinates,dataEntryForm[id,displayName,style,htmlCode,format],minDaysFromStart,repeatable,preGenerateUID,programStageSections[id,displayName,programStageDataElements[dataElement[id]]],programStageDataElements[displayInReports,sortOrder,allowProvidedElsewhere,allowFutureDate,compulsory,dataElement[id,displayName,url,description,valueType,optionSetValue,formName,optionSet[id]]]],userRoles[id,displayName]&paging=false&filter=id:in:' + ids
         }).done( function( response ){
             
             if(response.programs){
                 _.each(_.values( response.programs), function(program){
                     var ou = {};
                     _.each(_.values( program.organisationUnits), function(o){
-                        ou[o.id] = o.name;
+                        ou[o.id] = o.displayName;
                     });
                     program.organisationUnits = ou;
 
                     var ur = {};
                     _.each(_.values( program.userRoles), function(u){
-                        ur[u.id] = u.name;
+                        ur[u.id] = u.displayName;
                     });
                     program.userRoles = ur;
 
@@ -358,7 +358,7 @@
                 var _optionSetsInPromise = optionSetsInPromise.toString();
                 _optionSetsInPromise = '[' + _optionSetsInPromise + ']';
                 
-                var filter = 'fields=id,name,version,options[id,name,code]';                
+                var filter = 'fields=id,displayName,version,options[id,displayName,code]';                
                 filter = filter + '&filter=id:in:' + _optionSetsInPromise + '&paging=false';
                 
                 var url = '../api/optionSets';
@@ -384,7 +384,7 @@
 
 function getProgramValidations( programValidations )
 {  
-    return dhis2.tracker.checkAndGetTrackerObjects( programValidations, 'programValidations', '../api/programValidations', 'fields=id,name,name,operator,rightSide[expression,description],leftSide[expression,description],program[id]', dhis2.ec.store);
+    return dhis2.tracker.checkAndGetTrackerObjects( programValidations, 'programValidations', '../api/programValidations', 'fields=id,displayName,operator,rightSide[expression,description],leftSide[expression,description],program[id]', dhis2.ec.store);
 }
 
 function getMetaProgramIndicators( programs )
@@ -394,7 +394,7 @@
 
 function getProgramIndicators( programIndicators )
 {
-    return dhis2.tracker.checkAndGetTrackerObjects( programIndicators, 'programIndicators', '../api/programIndicators', 'fields=id,name,code,shortName,displayInForm,expression,displayDescription,rootDate,description,valueType,name,filter,program[id]', dhis2.ec.store);
+    return dhis2.tracker.checkAndGetTrackerObjects( programIndicators, 'programIndicators', '../api/programIndicators', 'fields=id,displayName,code,shortName,displayInForm,expression,displayDescription,rootDate,description,valueType,filter,program[id]', dhis2.ec.store);
 }
 
 function getMetaProgramRules( programs )
@@ -404,7 +404,7 @@
 
 function getProgramRules( programRules )
 {
-    return dhis2.tracker.checkAndGetTrackerObjects( programRules, 'programRules', '../api/programRules', 'fields=id,name,condition,description,program[id],programStage[id],priority,programRuleActions[id,content,location,data,programRuleActionType,programStageSection[id],dataElement[id],trackedEntityAttribute[id],programIndicator[id],programStage[id]]', dhis2.ec.store);
+    return dhis2.tracker.checkAndGetTrackerObjects( programRules, 'programRules', '../api/programRules', 'fields=id,displayName,condition,description,program[id],programStage[id],priority,programRuleActions[id,content,location,data,programRuleActionType,programStageSection[id],dataElement[id],trackedEntityAttribute[id],programIndicator[id],programStage[id]]', dhis2.ec.store);
 }
 
 function getMetaProgramRuleVariables( programs )
@@ -414,7 +414,7 @@
 
 function getProgramRuleVariables( programRuleVariables )
 {
-    return dhis2.tracker.checkAndGetTrackerObjects( programRuleVariables, 'programRuleVariables', '../api/programRuleVariables', 'fields=id,name,name,programRuleVariableSourceType,program[id],programStage[id],dataElement[id]', dhis2.ec.store);
+    return dhis2.tracker.checkAndGetTrackerObjects( programRuleVariables, 'programRuleVariables', '../api/programRuleVariables', 'fields=id,displayName,programRuleVariableSourceType,program[id],programStage[id],dataElement[id]', dhis2.ec.store);
 }
 
 function uploadLocalData()

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/services.js	2016-01-27 14:25:46 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/scripts/services.js	2016-02-12 15:42:21 +0000
@@ -66,7 +66,7 @@
         getCode: function(options, key){
             if(options){
                 for(var i=0; i<options.length; i++){
-                    if( key === options[i].name){
+                    if( key === options[i].displayName){
                         return options[i].code;
                     }
                 }
@@ -77,8 +77,7 @@
             if(options){
                 for(var i=0; i<options.length; i++){                    
                     if( key === options[i].code){
-                        return options[i].name;
-                        //return options[i];
+                        return options[i].displayName;
                     }
                 }
             }            
@@ -348,13 +347,13 @@
                         if(pi.displayInForm){
                             var newAction = {
                                     id:pi.id,
-                                    content:pi.displayDescription ? pi.displayDescription : pi.name,
+                                    content:pi.displayDescription ? pi.displayDescription : pi.displayName,
                                     data:pi.expression,
                                     programRuleActionType:'DISPLAYKEYVALUEPAIR',
                                     location:'indicators'
                                 };
                             var newRule = {
-                                    name:pi.name,
+                                    displayName:pi.displayName,
                                     id: pi.id,
                                     shortname:pi.shortname,
                                     code:pi.code,
@@ -383,7 +382,7 @@
                                 if(variableNameParts.length === 2) {
                                     //this is a programstage and dataelement specification. translate to program variable:
                                     newVariableObject = {
-                                        name:variableName,
+                                        displayName:variableName,
                                         programRuleVariableSourceType:'DATAELEMENT_NEWEST_EVENT_PROGRAM_STAGE',
                                         dataElement:variableNameParts[1],
                                         programStage:variableNameParts[0],
@@ -394,7 +393,7 @@
                                 {
                                     //This is an attribute - let us translate to program variable:
                                     newVariableObject = {
-                                        name:variableName,
+                                        displayName:variableName,
                                         programRuleVariableSourceType:'TEI_ATTRIBUTE',
                                         trackedEntityAttribute:variableNameParts[0],
                                         program:programUid
@@ -425,12 +424,12 @@
                                 angular.forEach(variableObjectsCurrentExpression, function(variableCurrentRule) {
                                    if(valueCountText) {
                                        //This is not the first value in the value count part of the expression. 
-                                       valueCountText +=  ' + d2:count(\'' + variableCurrentRule.name + '\')';
+                                       valueCountText +=  ' + d2:count(\'' + variableCurrentRule.displayName + '\')';
                                    }
                                    else
                                    {
                                        //This is the first part value in the value count expression:
-                                       valueCountText = '(d2:count(\'' + variableCurrentRule.name + '\')';
+                                       valueCountText = '(d2:count(\'' + variableCurrentRule.displayName + '\')';
                                    }
                                 });
                                 //To finish the value count expression we need to close the paranthesis:
@@ -445,12 +444,12 @@
                                 angular.forEach(variableObjectsCurrentExpression, function(variableCurrentRule) {
                                    if(zeroPosValueCountText) {
                                        //This is not the first value in the value count part of the expression. 
-                                       zeroPosValueCountText +=  '+ d2:countifzeropos(\'' + variableCurrentRule.name + '\')';
+                                       zeroPosValueCountText +=  '+ d2:countifzeropos(\'' + variableCurrentRule.displayName + '\')';
                                    }
                                    else
                                    {
                                        //This is the first part value in the value count expression:
-                                       zeroPosValueCountText = '(d2:countifzeropos(\'' + variableCurrentRule.name + '\')';
+                                       zeroPosValueCountText = '(d2:countifzeropos(\'' + variableCurrentRule.displayName + '\')';
                                    }
                                 });
                                 //To finish the value count expression we need to close the paranthesis:

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css	2016-02-08 15:14:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/styles/style.css	2016-02-12 15:42:21 +0000
@@ -475,6 +475,10 @@
     display: none;
 }
 
+.fa-stack {
+    cursor: pointer;
+}
+
 .fa-stack > .fa.fa-stack-1x.fa-circle.radio-save-success {
     color: #b9ffb9 !important;
 }
@@ -512,8 +516,28 @@
     margin-left: -5px;
 }
 
-.custom-radio-error{
+.custom-radio-error {
     margin-left: 5px;
     width:100px;
     text-align: center;
+}
+
+.fa-stack-custom-large {
+    font-size: 20px;
+}
+
+.fa-stack-custom-small {
+    font-size: 10px;
+}
+
+.wrap-text {
+    word-wrap: break-word;
+}
+
+.cursor-pointer {
+    cursor: pointer;
+}
+
+.fa-icon-width {
+    width: 15px;
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/column-modal.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/column-modal.html	2015-09-08 09:15:23 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/column-modal.html	2016-02-12 15:42:21 +0000
@@ -6,8 +6,8 @@
     <table class="listTable dhis2-table-striped-border">
         <tr ng-repeat="eventGridColumn in gridColumns">
             <td ng-click="eventGridColumn.show = !eventGridColumn.show">
-                <span ng-if="eventGridColumn.id !== 'comment' && eventGridColumn.id !== 'uid'">{{eventGridColumn.name}}</span>
-                <span ng-if="eventGridColumn.id === 'comment' || eventGridColumn.id === 'uid'">{{eventGridColumn.name | translate}}</span>
+                <span ng-if="eventGridColumn.id !== 'comment' && eventGridColumn.id !== 'uid'">{{eventGridColumn.displayName}}</span>
+                <span ng-if="eventGridColumn.id === 'comment' || eventGridColumn.id === 'uid'">{{eventGridColumn.displayName | translate}}</span>
             </td>
             <td>
                 <input type="checkbox" ng-model="eventGridColumn.show" ng-change="showHideColumns(eventGridColumn)">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2016-02-03 15:55:33 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/defaultForm.html	2016-02-12 15:42:21 +0000
@@ -16,7 +16,7 @@
         <tbody>
             <tr ng-repeat="eventGridColumn in eventGridColumns" ng-if="eventGridColumn.id !== 'comment' && eventGridColumn.id !== 'uid' && eventGridColumn.id !== 'eventDate' && !hiddenFields[eventGridColumn.id]">
                 <td >
-                    {{eventGridColumn.name}}
+                    {{eventGridColumn.displayName}}
                     <span ng-if="eventGridColumn.compulsory" class="required">*</span>                    
                 </td>
                 <td >
@@ -31,9 +31,9 @@
                                            ng-disabled="assignedFields[eventGridColumn.id]"
                                            on-select="saveDatavalue()"
                                            style="width:100%;">
-                                    <ui-select-match allow-clear="true" class="form-control-ui-select" placeholder="{{'select_or_search' | translate}}">{{$select.selected.name  || $select.selected}}</ui-select-match>
-                                    <ui-select-choices  repeat="option.name as option in optionSets[prStDes[eventGridColumn.id].dataElement.optionSet.id].options | filter: $select.search | limitTo:maxOptionSize">
-                                        <span ng-bind-html="option.name | highlight: $select.search"></span>
+                                    <ui-select-match allow-clear="true" class="form-control-ui-select" placeholder="{{'select_or_search' | translate}}">{{$select.selected.displayName  || $select.selected}}</ui-select-match>
+                                    <ui-select-choices  repeat="option.displayName as option in optionSets[prStDes[eventGridColumn.id].dataElement.optionSet.id].options | filter: $select.search | limitTo:maxOptionSize">
+                                        <span ng-bind-html="option.displayName | highlight: $select.search"></span>
                                     </ui-select-choices>
                                 </ui-select>
                             </div>
@@ -57,7 +57,7 @@
                                            ng-required={{eventGridColumn.compulsory}}
                                            ng-disabled="assignedFields[eventGridColumn.id]"
                                            ng-model="currentEvent[eventGridColumn.id]"
-                                           value={{option.name}}> {{option.name}}<br>
+                                           value={{option.displayName}}> {{option.displayName}}<br>
                                 </label>
                             </div>
                         </div>
@@ -238,7 +238,7 @@
                     </ng-form>
                 </td>
                 <td ng-if="currentEvent.event && currentEvent.event !== 'SINGLE_EVENT'">
-                    <d2-audit dataelement-id="{{prStDes[eventGridColumn.id].dataElement.id}}" dataelement-name="{{prStDes[eventGridColumn.id].dataElement.name}}"  current-event="{{currentEvent.event}}"></d2-audit>
+                    <d2-audit dataelement-id="{{prStDes[eventGridColumn.id].dataElement.id}}" dataelement-name="{{prStDes[eventGridColumn.id].dataElement.displayName}}"  current-event="{{currentEvent.event}}"></d2-audit>
                 </td>
             </tr>        
         </tbody>
@@ -250,11 +250,11 @@
     <div ng-include="'views/event-details.html'"></div>
     <div ng-repeat='section in selectedProgramStage.programStageSections' ng-if="section.id === selectedSection.id || selectedSection.id === 'ALL' && !hiddenSections[section.id] ">
         <div class="vertical-spacing section-label">
-           {{section.name}}
+           {{section.displayName}}
         </div>
         
         <div class="vertical-spacing" ng-if="!section.programStageDataElements || section.programStageDataElements.length === 0">
-            <div class="alert alert-warning">{{'section'| translate}} {{section.name}} {{'has_no_dataelements'| translate}}</div>
+            <div class="alert alert-warning">{{'section'| translate}} {{section.displayName}} {{'has_no_dataelements'| translate}}</div>
         </div>  
         <table class="dhis2-list-table-striped">
             <thead>                        
@@ -272,7 +272,7 @@
             <tbody>       
                 <tr ng-repeat="de in section.programStageDataElements" ng-if="!hiddenFields[de.dataElement.id]">
                     <td >
-                        {{prStDes[de.dataElement.id].dataElement.formName ? prStDes[de.dataElement.id].dataElement.formName : prStDes[de.dataElement.id].dataElement.name}}                         
+                        {{prStDes[de.dataElement.id].dataElement.formName ? prStDes[de.dataElement.id].dataElement.formName : prStDes[de.dataElement.id].dataElement.displayName}}                         
                         <span ng-if="prStDes[de.dataElement.id].compulsory" class="required">*</span>                        
                     </td>
                     <td>
@@ -288,9 +288,9 @@
                                                input-field-id={{de.dataElement.id}} 
                                                on-select="saveDatavalue()"
                                                style="width:100%;">
-                                            <ui-select-match allow-clear="true" class="form-control-ui-select" placeholder="{{'select_or_search' | translate}}">{{$select.selected.name || $select.selected}}</ui-select-match>
-                                            <ui-select-choices  repeat="option.name as option in optionSets[prStDes[de.dataElement.id].dataElement.optionSet.id].options | filter: $select.search | limitTo:maxOptionSize">
-                                                <span ng-bind-html="option.name | highlight: $select.search"></span>
+                                            <ui-select-match allow-clear="true" class="form-control-ui-select" placeholder="{{'select_or_search' | translate}}">{{$select.selected.displayName || $select.selected}}</ui-select-match>
+                                            <ui-select-choices  repeat="option.displayName as option in optionSets[prStDes[de.dataElement.id].dataElement.optionSet.id].options | filter: $select.search | limitTo:maxOptionSize">
+                                                <span ng-bind-html="option.displayName | highlight: $select.search"></span>
                                             </ui-select-choices>
                                         </ui-select>
                                     </span>
@@ -316,7 +316,7 @@
                                                    ng-required={{prStDes[de.dataElement.id].compulsory}}
                                                    ng-disabled="assignedFields[de.dataElement.id]"
                                                    ng-model="currentEvent[de.dataElement.id]"
-                                                   value={{option.name}}> {{option.name}}
+                                                   value={{option.displayName}}> {{option.displayName}}
                                                 <br>
                                         </label><br>
                                     </span>                                    
@@ -501,11 +501,11 @@
                             </div>
                         </ng-form>
                         <!--<span class="hideInPrint audit-icon" ng-if="currentEvent.event && currentEvent.event !== 'SINGLE_EVENT'">
-                            <d2-audit dataelement-id="{{de.dataElement.id}}" dataelement-name="{{prStDes[de.dataElement.id].dataElement.name}}"  current-event="{{currentEvent.event}}"></d2-audit>
+                            <d2-audit dataelement-id="{{de.dataElement.id}}" dataelement-name="{{prStDes[de.dataElement.id].dataElement.displayName}}"  current-event="{{currentEvent.event}}"></d2-audit>
                         </span>-->
                     </td>
                     <td ng-if="currentEvent.event && currentEvent.event !== 'SINGLE_EVENT'">
-                        <d2-audit dataelement-id="{{de.dataElement.id}}" dataelement-name="{{prStDes[de.dataElement.id].dataElement.name}}"  current-event="{{currentEvent.event}}"></d2-audit>
+                        <d2-audit dataelement-id="{{de.dataElement.id}}" dataelement-name="{{prStDes[de.dataElement.id].dataElement.displayName}}"  current-event="{{currentEvent.event}}"></d2-audit>
                     </td>
                 </tr>
             </tbody>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html	2016-02-03 12:47:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/eventList.html	2016-02-12 15:42:21 +0000
@@ -59,8 +59,8 @@
                                 <!-- sort icon begins -->                                
                                 <span ng-hide="eventGridColumn.showFilter" class="bold" ng-click="sortEventGrid(eventGridColumn)">
                                     <span ng-class="{true: 'red'} [sortHeader.id == eventGridColumn.id]"><i class="fa fa-sort"></i></span>
-                                    <span ng-if="eventGridColumn.id !== 'uid'">{{eventGridColumn.name}}</span>
-                                    <span ng-if="eventGridColumn.id == 'uid'">{{eventGridColumn.name | translate}}</span>
+                                    <span ng-if="eventGridColumn.id !== 'uid'">{{eventGridColumn.displayName}}</span>
+                                    <span ng-if="eventGridColumn.id == 'uid'">{{eventGridColumn.displayName | translate}}</span>
                                 </span>
                                 <!-- sort icon ends -->
 
@@ -175,10 +175,10 @@
                                                                          class="form-control-ui-select" 
                                                                          ng-class="getInputNotifcationClass(eventGridColumn.id, true)" 
                                                                          placeholder="{{'select_or_search' | translate}}">
-                                                            {{$select.selected.name || $select.selected}}
+                                                            {{$select.selected.displayName || $select.selected}}
                                                         </ui-select-match>
-                                                        <ui-select-choices  repeat="option.name as option in optionSets[prStDes[eventGridColumn.id].dataElement.optionSet.id].options | filter: $select.search | limitTo:maxOptionSize">
-                                                            <span ng-bind-html="option.name | highlight: $select.search"></span>
+                                                        <ui-select-choices  repeat="option.displayName as option in optionSets[prStDes[eventGridColumn.id].dataElement.optionSet.id].options | filter: $select.search | limitTo:maxOptionSize">
+                                                            <span ng-bind-html="option.displayName | highlight: $select.search"></span>
                                                         </ui-select-choices>
                                                     </ui-select>
                                                 </span>
@@ -201,7 +201,7 @@
                                                                ng-model="currentEvent[eventGridColumn.id]" 
                                                                ng-change="updateEventDataValue(dhis2Event, eventGridColumn.id)"
                                                                ng-class="getInputNotifcationClass(eventGridColumn.id,false)"
-                                                               value={{option.name}}> {{option.name}}<br>                                    
+                                                               value={{option.displayName}}> {{option.displayName}}<br>                                    
                                                     </label>
                                                 </span> 
                                             </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html	2016-02-10 11:02:18 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/home.html	2016-02-12 15:42:21 +0000
@@ -41,8 +41,8 @@
                         {{registeringUnitLabel}}
                     </div>
                     <div class="col-sm-8">
-                        <input type="text" class="form-control" selected-org-unit ng-model="selectedOrgUnit.name"
-                               value="{{selectedOrgUnit.name|| pleaseSelectLabel}}" disabled="">
+                        <input type="text" class="form-control" selected-org-unit ng-model="selectedOrgUnit.displayName"
+                               value="{{selectedOrgUnit.displayName|| pleaseSelectLabel}}" disabled="">
                     </div>
                 </div>
                 <div class="row small-vertical-spacing">
@@ -54,7 +54,7 @@
                                 class="form-control"
                                 name="programId" 
                                 ng-model="selectedProgram" 
-                                ng-options="program as program.name for program in programs | orderBy: 'name'" 
+                                ng-options="program as program.displayName for program in programs | orderBy: 'name'" 
                                 ng-change="getProgramDetails()"
                                 ng-disabled="eventRegistration || editingEventInFull || editingEventInGrid">
                             <option value="">{{pleaseSelectLabel}}</option>
@@ -63,13 +63,13 @@
                 </div>
                 <div class="row small-vertical-spacing" ng-if="selectedProgram" ng-repeat="category in selectedCategories">
                     <div class="col-sm-4">
-                        {{category.name}}
+                        {{category.displayName}}
                     </div>
                     <div class="col-sm-8">
                         <select class="form-control"
                                 name="option"                             
                                 ng-model="category.selectedOption"
-                                ng-options="option as option.name for option in category.categoryOptions"
+                                ng-options="option as option.displayName for option in category.categoryOptions"
                                 ng-change="getCategoryOptions()">
                             <option value="">{{pleaseSelectLabel}}</option>
                         </select>
@@ -84,7 +84,7 @@
                                 name="section"                             
                                 ng-model="selectedSection.id">
                             <option value="ALL">{{'show_all'| translate}}</option>
-                            <option ng-if="!hiddenSections[section.id]" ng-repeat="section in selectedProgramStage.programStageSections" value={{section.id}}>{{section.name}}</option>
+                            <option ng-if="!hiddenSections[section.id]" ng-repeat="section in selectedProgramStage.programStageSections" value={{section.id}}>{{section.displayName}}</option>
                         </select>
                     </div>
                 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/indicators.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/indicators.html	2015-09-21 15:01:55 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-event-capture/views/indicators.html	2016-02-12 15:42:21 +0000
@@ -6,7 +6,7 @@
         <table class="dhis2-list-table-striped">
             <tr ng-repeat="pid in allProgramRules.programIndicators.rules">
                 <td>
-                    {{pid.name}}
+                    {{pid.displayName}}
                 </td>
                 <td>
                     <input type="text" class="form-control" value={{formatNumberResult(ruleeffects[currentEvent.event][pid.id].data)}} ng-disabled="true">

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js	2016-02-04 10:43:43 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.directives.js	2016-02-12 15:42:21 +0000
@@ -34,7 +34,7 @@
             //listen to user selection, and inform angular         
             selection.setListenerFunction(setSelectedOu, true);
             function setSelectedOu(ids, names) {
-                var ou = {id: ids[0], name: names[0]};
+                var ou = {id: ids[0], displayName: names[0]};
                 $timeout(function () {
                     scope.selectedOrgUnit = ou;
                     scope.$apply();

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2016-02-11 15:31:13 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2016-02-12 15:42:21 +0000
@@ -241,7 +241,7 @@
             getCode: function(options, key){
                 if(options){
                     for(var i=0; i<options.length; i++){
-                        if( key === options[i].name){
+                        if( key === options[i].displayName){
                             return options[i].code;
                         }
                     }
@@ -252,7 +252,7 @@
                 if(options){
                     for(var i=0; i<options.length; i++){
                         if( key === options[i].code){
-                            return options[i].name;
+                            return options[i].displayName;
                         }
                     }
                 }
@@ -405,15 +405,15 @@
                                         ' ng-disabled="isHidden(prStDes.' + fieldId + '.dataElement.id) || selectedEnrollment.status===\'CANCELLED\' || selectedEnrollment.status===\'COMPLETED\' || currentEvent[uid]==\'uid\' || currentEvent.editingNotAllowed"' +
                                         ' ng-required="{{prStDes.' + fieldId + '.compulsory}}" ';
 
-                                    var auditField = '<d2-audit is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="{{prStDes.' + fieldId + '.dataElement.id}}" dataelement-name="{{prStDes[prStDes.' + fieldId + '.dataElement.id].dataElement.name}}" current-event="{{currentEvent.event}}"></d2-audit>';
+                                    var auditField = '<d2-audit is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="{{prStDes.' + fieldId + '.dataElement.id}}" dataelement-name="{{prStDes[prStDes.' + fieldId + '.dataElement.id].dataElement.displayName}}" current-event="{{currentEvent.event}}"></d2-audit>';
                                     //check if dataelement has optionset
                                     if (prStDe.dataElement.optionSetValue) {
                                         var optionSetId = prStDe.dataElement.optionSet.id;
                                         newInputField = '<span class="hideInPrint"><ui-select style="width: 90%;" theme="select2" ' + commonInputFieldProperty + ' on-select="saveDatavalue(prStDes.' + fieldId + ', outerForm.' + fieldId + ')" >' +
-                                            '<ui-select-match ng-class="getInputNotifcationClass(prStDes.' + fieldId + '.dataElement.id, true)" allow-clear="true" placeholder="' + $translate.instant('select_or_search') + '">{{$select.selected.name || $select.selected}}</ui-select-match>' +
+                                            '<ui-select-match ng-class="getInputNotifcationClass(prStDes.' + fieldId + '.dataElement.id, true)" allow-clear="true" placeholder="' + $translate.instant('select_or_search') + '">{{$select.selected.displayName || $select.selected}}</ui-select-match>' +
                                             '<ui-select-choices ' +
-                                            ' repeat="option.name as option in optionSets.' + optionSetId + '.options | filter: $select.search | limitTo:maxOptionSize">' +
-                                            '<span ng-bind-html="option.name | highlight: $select.search">' +
+                                            ' repeat="option.displayName as option in optionSets.' + optionSetId + '.options | filter: $select.search | limitTo:maxOptionSize">' +
+                                            '<span ng-bind-html="option.displayName | highlight: $select.search">' +
                                             '</span>' +
                                             '</ui-select-choices>' +
                                             '</ui-select></span><span class="not-for-screen"><input type="text" value={{currentEvent.' + fieldId + '}}></span>';
@@ -573,12 +573,12 @@
                                 if (att.optionSetValue) {
                                     var optionSetId = att.optionSet.id;
                                     newInputField = '<span ng-controller="InputController"><ui-select theme="select2" ' + commonInputFieldProperty + '  on-select="teiValueUpdated(selectedTei,\'' + attId + '\')" >' +
-                                        '<ui-select-match style="width:100%;" allow-clear="true" placeholder="' + $translate.instant('select_or_search') + '">{{$select.selected.name || $select.selected}}</ui-select-match>' +
+                                        '<ui-select-match style="width:100%;" allow-clear="true" placeholder="' + $translate.instant('select_or_search') + '">{{$select.selected.displayName || $select.selected}}</ui-select-match>' +
                                         '<ui-select-choices ' +
-                                        'repeat="option.name as option in optionSets.' + optionSetId + '.options | filter: $select.search | limitTo:maxOptionSize">' +
-                                        '<span ng-bind-html="option.name | highlight: $select.search"></span>' +
+                                        'repeat="option.displayName as option in optionSets.' + optionSetId + '.options | filter: $select.search | limitTo:maxOptionSize">' +
+                                        '<span ng-bind-html="option.displayName | highlight: $select.search"></span>' +
                                         '</ui-select-choices>' +
-                                        '</ui-select><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}}></d2-audit></span>';
+                                        '</ui-select><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}}></d2-audit></span>';
                                 }
                                 else {
                                     //check attribute type and generate corresponding angular input field
@@ -588,7 +588,7 @@
                                             ' number-type="' + att.valueType + '" ' +
                                             ' ng-blur="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
                                             commonInputFieldProperty + ' >' +
-                                            '<d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}}></d2-audit>' +
+                                            '<d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}}></d2-audit>' +
                                             '</span>';
                                     }
                                     else if (att.valueType === "BOOLEAN") {
@@ -609,39 +609,39 @@
                                             ' d2-date' +
                                             ' blur-or-change="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
                                             commonInputFieldProperty + ' >'+
-                                            '<d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit>'+
+                                            '<d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit>'+
                                             '</span>';
                                     }
                                     else if (att.valueType === "TRUE_ONLY") {
                                         newInputField = '<span><input type="checkbox" ' +
                                             ' ng-change="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
-                                            commonInputFieldProperty + ' ><d2-audit class="hideInPrint" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
+                                            commonInputFieldProperty + ' ><d2-audit class="hideInPrint" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
                                     }
                                     else if (att.valueType === "EMAIL") {
                                         newInputField = '<span ng-controller="InputController"><input type="email" ng-class="{\'input-with-audit\':inputObj.isAuditIconPresent}"' +
                                             ' ng-blur="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
-                                            commonInputFieldProperty + ' ><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
+                                            commonInputFieldProperty + ' ><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
                                     }
                                     else if (att.valueType === "TRACKER_ASSOCIATE") {
                                         newInputField = '<span ng-controller="InputController"><input type="text" ng-class="{\'input-with-audit\':inputObj.isAuditIconPresent}"' +
                                             ' ng-blur="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
-                                            commonInputFieldProperty + ' ><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>' +
-                                            '<span class="hideInPrint"><a href ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="getTrackerAssociate(attributesById.' + attId + ', selectedTei.' + attId + ')" title="{{\'add\' | translate}} {{attributesById.' + attId + '.name}}" ' +
+                                            commonInputFieldProperty + ' ><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>' +
+                                            '<span class="hideInPrint"><a href ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="getTrackerAssociate(attributesById.' + attId + ', selectedTei.' + attId + ')" title="{{\'add\' | translate}} {{attributesById.' + attId + '.displayName}}" ' +
                                             '<i class="fa fa-external-link fa-2x vertical-center"></i> ' +
                                             '</a> ' +
-                                            '<a href ng-if="selectedTei.' + attId + '" ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="selectedTei.' + attId + ' = null" title="{{\'remove\' | translate}} {{attributesById.' + attId + '.name}}" ' +
+                                            '<a href ng-if="selectedTei.' + attId + '" ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="selectedTei.' + attId + ' = null" title="{{\'remove\' | translate}} {{attributesById.' + attId + '.displayName}}" ' +
                                             '<i class="fa fa-trash-o fa-2x vertical-center"></i> ' +
                                             '</a></span>';
                                     }
                                     else if (att.valueType === "LONG_TEXT") {
                                         newInputField = '<span><textarea row ="3" ' +
                                             ' ng-blur="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
-                                            commonInputFieldProperty + ' ></textarea><d2-audit class="hideInPrint" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
+                                            commonInputFieldProperty + ' ></textarea><d2-audit class="hideInPrint" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
                                     }
                                     else {
                                         newInputField = '<span ng-controller="InputController"><input type="text" ' +
                                             ' ng-blur="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
-                                            commonInputFieldProperty + '><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
+                                            commonInputFieldProperty + '><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
                                     }
                                 }
                             }
@@ -671,7 +671,7 @@
                                     ' ng-disabled="\'' + target + '\' === \'PROFILE\'"' +
                                     ' d2-date' +
                                     ' max-date="' + enMaxDate + '"' +
-                                    ' ng-required="true"><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
+                                    ' ng-required="true"><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
                             }
                             if (programId === 'dateOfIncident' && trackedEntityForm.displayIncidentDate) {
                                 fieldName = 'dateOfIncident';
@@ -685,7 +685,7 @@
                                     ' ng-model="selectedEnrollment.dateOfIncident" ' +
                                     ' ng-disabled="\'' + target + '\' === \'PROFILE\'"' +
                                     ' d2-date ' +
-                                    ' max-date="' + inMaxDate + '"><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
+                                    ' max-date="' + inMaxDate + '"><d2-audit class="hideInPrint" is-audit-icon-present="inputObj.isAuditIconPresent" dataelement-id="'+att.id+'" dataelement-name="'+att.displayName+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit></span>';
                             }
                         }
 
@@ -1041,12 +1041,12 @@
                                             && event[dataElementId] !== ""){
                                         allValues.push(event[dataElementId]);
                                         valueFound = true;
-                                        variables = pushVariable(variables, programVariable.name, event[dataElementId],allValues, allDes[dataElementId].dataElement.valueType, valueFound, '#', event.eventDate);
+                                        variables = pushVariable(variables, programVariable.displayName, event[dataElementId],allValues, allDes[dataElementId].dataElement.valueType, valueFound, '#', event.eventDate);
                                     }
                                 }
                             });
                         } else {
-                            $log.warn("Variable id:'" + programVariable.id + "' name:'" + programVariable.name
+                            $log.warn("Variable id:'" + programVariable.id + "' name:'" + programVariable.displayName
                                 + "' does not have a programstage defined,"
                                 + " despite that the variable has sourcetype DATAELEMENT_NEWEST_EVENT_PROGRAM_STAGE" );
                         }
@@ -1059,7 +1059,7 @@
                                 && event[dataElementId] !== ""){
                                 allValues.push(event[dataElementId]);
                                 valueFound = true;
-                                variables = pushVariable(variables, programVariable.name, event[dataElementId], allValues, allDes[dataElementId].dataElement.valueType, valueFound, '#', event.eventDate);
+                                variables = pushVariable(variables, programVariable.displayName, event[dataElementId], allValues, allDes[dataElementId].dataElement.valueType, valueFound, '#', event.eventDate);
                             }
                         });
                     }
@@ -1068,7 +1068,7 @@
                             && executingEvent[dataElementId] !== null 
                             && executingEvent[dataElementId] !== ""){
                             valueFound = true;
-                            variables = pushVariable(variables, programVariable.name, executingEvent[dataElementId], null, allDes[dataElementId].dataElement.valueType, valueFound, '#', executingEvent.eventDate );
+                            variables = pushVariable(variables, programVariable.displayName, executingEvent[dataElementId], null, allDes[dataElementId].dataElement.valueType, valueFound, '#', executingEvent.eventDate );
                         }
                     }
                     else if(programVariable.programRuleVariableSourceType === "DATAELEMENT_PREVIOUS_EVENT" && evs){
@@ -1092,7 +1092,7 @@
                                 else if(evs.all[i] === executingEvent) {
                                     //We have iterated to the newest event - store the last collected variable value - if any is found:
                                     if(valueFound) {
-                                        variables = pushVariable(variables, programVariable.name, previousvalue, allValues, allDes[dataElementId].dataElement.valueType, valueFound, '#', previousEventDate);
+                                        variables = pushVariable(variables, programVariable.displayName, previousvalue, allValues, allDes[dataElementId].dataElement.valueType, valueFound, '#', previousEventDate);
                                     }
                                     //Set currentEventPassed, ending the iteration:
                                     currentEventPassed = true;
@@ -1109,7 +1109,7 @@
                                     valueFound = true;
                                     //In registration, the attribute type is found in .type, while in data entry the same data is found in .valueType.
                                     //Handling here, but planning refactor in registration so it will always be .valueType
-                                    variables = pushVariable(variables, programVariable.name, attribute.value, null, attribute.type ? attribute.type : attribute.valueType, valueFound, 'A', '' );
+                                    variables = pushVariable(variables, programVariable.displayName, attribute.value, null, attribute.type ? attribute.type : attribute.valueType, valueFound, 'A', '' );
                                 }
                             }
                         });
@@ -1132,20 +1132,20 @@
                         if(dataElementId && allDes) {
                             var dataElement = allDes[dataElementId];
                             if( dataElement ) {
-                                variables = pushVariable(variables, programVariable.name, "", null, dataElement.dataElement.valueType, false, '#', '' );
+                                variables = pushVariable(variables, programVariable.displayName, "", null, dataElement.dataElement.valueType, false, '#', '' );
                             }
                             else {
-                                $log.warn("Variable #{" + programVariable.name + "} is linked to a dataelement that is not part of the program");
-                                variables = pushVariable(variables, programVariable.name, "", null, "TEXT",false, '#', '' );
+                                $log.warn("Variable #{" + programVariable.displayName + "} is linked to a dataelement that is not part of the program");
+                                variables = pushVariable(variables, programVariable.displayName, "", null, "TEXT",false, '#', '' );
                             }
                         }
                         else if (programVariable.trackedEntityAttribute) {
                             //The variable is an attribute, set correct prefix and a blank value
-                            variables = pushVariable(variables, programVariable.name, "", null, "TEXT",false, 'A', '' );
+                            variables = pushVariable(variables, programVariable.displayName, "", null, "TEXT",false, 'A', '' );
                         }
                         else {
                             //Fallback for calculated(assigned) values:
-                            variables = pushVariable(variables, programVariable.name, "", null, "TEXT",false, '#', '' );
+                            variables = pushVariable(variables, programVariable.displayName, "", null, "TEXT",false, '#', '' );
                         }
                     }
                 });