From 6c1363bbab477ca5e120d4e88bb93c3f0a6f7b2e Mon Sep 17 00:00:00 2001 From: kblairwhite Date: Tue, 24 Jun 2014 11:27:41 -0700 Subject: [PATCH] Changed Ground Cover to Foliar/Cover on Modals --- app/controllers/plotObservationsModal.js | 7 ++++++- app/controllers/plotObservationsModalDisclosureIcon.js | 8 ++++++-- app/views/plotObservationsModal.xml | 2 +- app/views/plotObservationsModalDisclosureIcon.xml | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/controllers/plotObservationsModal.js b/app/controllers/plotObservationsModal.js index 5ba9735..e7ef583 100644 --- a/app/controllers/plotObservationsModal.js +++ b/app/controllers/plotObservationsModal.js @@ -11,10 +11,15 @@ var title = args.title; //Query the database, assign returned ground cover to TextField try { var db = Ti.Database.open('ltemaDB'); - var resultRow = db.execute( 'SELECT ground_cover \ + var resultRow = db.execute( 'SELECT ground_cover, count \ FROM plot_observation \ WHERE observation_id = ?', observationID); var groundCover = resultRow.fieldByName('ground_cover'); + var count = resultRow.fieldByName('count'); + //Set the label depending on the oberservation type + if(count == 0){ + $.groundCoverLbl.text = " Cover:"; + } $.groundCover.value = groundCover; } catch (e) { var errorMessage = e.message; diff --git a/app/controllers/plotObservationsModalDisclosureIcon.js b/app/controllers/plotObservationsModalDisclosureIcon.js index 8076c2e..7a73a67 100644 --- a/app/controllers/plotObservationsModalDisclosureIcon.js +++ b/app/controllers/plotObservationsModalDisclosureIcon.js @@ -14,12 +14,16 @@ var siteID = args.siteID; //Query the database, assign returned ground cover to TextField try { var db = Ti.Database.open('ltemaDB'); - var resultRow = db.execute( 'SELECT ground_cover \ + var resultRow = db.execute( 'SELECT ground_cover, count \ FROM plot_observation \ WHERE observation_id = ?', observationID); var groundCover = resultRow.fieldByName('ground_cover'); + var count = resultRow.fieldByName('count'); //var mediaID = resultRow.fieldByName('media_id'); - + //Set the label depending on the oberservation type + if(count == 0){ + $.groundCoverLbl.text = "Cover:"; + } $.groundCover.value = groundCover; //if media does not exist diff --git a/app/views/plotObservationsModal.xml b/app/views/plotObservationsModal.xml index 23ca816..bf6078b 100644 --- a/app/views/plotObservationsModal.xml +++ b/app/views/plotObservationsModal.xml @@ -11,7 +11,7 @@ -