Skip to content

Commit

Permalink
Changed Ground Cover to Foliar/Cover on Modals
Browse files Browse the repository at this point in the history
  • Loading branch information
kblairwhite committed Jun 24, 2014
1 parent 39c593f commit 6c1363b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion app/controllers/plotObservationsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions app/controllers/plotObservationsModalDisclosureIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/plotObservationsModal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</RightNavButton>

<ScrollView>
<Label id="groundCoverLbl" text="Ground Cover:" />
<Label id="groundCoverLbl" text="Foliar Cover:" />
<TextField id="groundCover" />
<Label id="percentSymbolLabel" />
<Label id="groundCoverError" class="error" visible="false" />
Expand Down
2 changes: 1 addition & 1 deletion app/views/plotObservationsModalDisclosureIcon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</RightNavButton>

<ScrollView>
<Label id="groundCoverLbl" text="Ground Cover:" />
<Label id="groundCoverLbl" text="Foliar Cover:" />
<Label id="groundCover" />

<Label id="commentsLbl" text="Comments:" />
Expand Down

0 comments on commit 6c1363b

Please sign in to comment.