From 1d624a27746eebb9087e282bd2d3eba0fc5c5bf9 Mon Sep 17 00:00:00 2001 From: Rory Drysdale Date: Sun, 22 Jun 2014 10:15:27 -0700 Subject: [PATCH] Export now excludes any observations that have 0% coverage. --- app/controllers/exportModal.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/exportModal.js b/app/controllers/exportModal.js index d13f03c..d4a7fc0 100644 --- a/app/controllers/exportModal.js +++ b/app/controllers/exportModal.js @@ -214,6 +214,12 @@ function makeCSV() { for (var observation in results[transect][plot]) { if (typeof results[transect][plot][observation] === 'object' && results[transect][plot][observation] != null) { + + // Skip the entry if the ground cover is 0 + if (results[transect][plot][observation].ground_cover == 0) { + continue; + } + // Convert utc to date and time var utc = parseInt(results[transect][plot].utc); var d = new Date(utc); @@ -257,6 +263,7 @@ function makeCSV() { generalSurveyTxt += dq + comments + dq + c; generalSurveyTxt += dq + results[transect][plot][observation].ground_cover + dq + c; + var observationPhoto = results[transect][plot][observation].observation_photo; if (observationPhoto != null) { generalSurveyTxt += dq + observationPhoto + dq + nl;