← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22144: Approval, minor

 

------------------------------------------------------------
revno: 22144
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2016-03-04 14:19:41 +0100
message:
  Approval, minor
modified:
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.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-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2016-03-04 12:13:10 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/javascript/dataApproval.js	2016-03-04 13:19:41 +0000
@@ -127,13 +127,15 @@
 				var cocName = cocs[ap.id].displayName,
 					pm = ap.permissions;
 				
-				html += "<tr>";
-				html += "<td><input type='checkbox' class='itemCheckbox' id='coc-" + ap.id + "-" + ap.ou + "' data-coc='" + ap.id + "' data-ou='" + ap.ou + "' ";
-				html += "data-approve='" + pm.mayApprove + "' data-unapprove='" + pm.mayUnapprove + "' data-accept='" + pm.mayAccept + "' data-unaccept='" + pm.mayUnaccept + "'>";
-				html += "<label for='coc-" + ap.id + "-" + ap.ou + "'>" + cocName + "</label></td>";
-				html += "<td>" + ap.ouName + "</td>";
-				html += "<td>" + dhis2.appr.getPermissions( ap ) + "</td>";
-				html += "</tr>";
+				if ( cocName && pm ) {
+					html += "<tr>";
+					html += "<td><input type='checkbox' class='itemCheckbox' id='coc-" + ap.id + "-" + ap.ou + "' data-coc='" + ap.id + "' data-ou='" + ap.ou + "' ";
+					html += "data-approve='" + pm.mayApprove + "' data-unapprove='" + pm.mayUnapprove + "' data-accept='" + pm.mayAccept + "' data-unaccept='" + pm.mayUnaccept + "'>";
+					html += "<label for='coc-" + ap.id + "-" + ap.ou + "'>" + cocName + "</label></td>";
+					html += "<td>" + ap.ou + "</td>";
+					html += "<td>" + dhis2.appr.getPermissions( ap ) + "</td>";
+					html += "</tr>";
+				}
 			} );
 			
 			html += "</table>";