9 @phenotype_files => undef
10 @removed_phenotype_files => undef
14 <& /util/import_javascript.mas, classes => [ 'jquery', 'jqueryui', 'jquery.iframe-post-form','CXGN.List','CXGN.BreedersToolbox.FieldBook', 'CXGN.BreedersToolbox.HTMLSelect'] &>
16 <& /page/page_title.mas, title=>'Field Book Tools' &>
18 <div class="container-fluid">
20 <&| /page/explanation.mas, title=>'Field Layout Files', collapsible=>1, collapsed=>0, &>
22 <em><b>Field Book</b></em> is an app for collecting phenotypic data on field research plots using an android tablet computer.
24 <a href="https://play.google.com/store/apps/details?id=com.fieldbook.tracker"> Field Book Software</a>
26 To use Fieldbook you need a Field Layout File and a Trait File; both can be created on this page. <br/>Once you have created and downloaded your Field Layout and Trait files, move them onto your mobile device into the Fieldbook directories (generally /fieldbook/import_field/ for your Field Layout Files and /fieldbook/traits/ for your trait files.)
28 By using Fieldbook with the Field Layout and Trait Files created here, you can be sure that your traits are properly defined and your experimental units, whether they are plots or plants or tissue samples, are also properly defined.
32 <& /fieldbook/create_fieldbook_dialog.mas &>
34 <&| /page/info_section.mas, title=>'Field Layout Files', empty_message=>'', collapsible=>1, collapsed=>0, subtitle=>'[<a name="create_fieldbook_link">New</a>]' &>
36 #my @breeding_programs = @{$programs};
37 #foreach my $prog (@breeding_programs) {
38 # print @$prog[0].@$prog[1]."</br>";
40 foreach my $file (@file_metadata) {
41 my @trial_array = @{$file};
42 my $file_name = $trial_array[1];
43 my $trial_layout_download = '[<a href="/fieldbook/trial_download/'.$trial_array[2].'">Download File</a>] | [<a id="delete_fieldbook_layout_link" href="/fieldbook/delete_file/'.$trial_array[2].'">Delete File</a>]';
44 print $trial_array[1]."$trial_layout_download<br>";
45 #print $trial_array[2]."</br>";
50 <& /fieldbook/create_trait_file_dialog.mas &>
52 <&| /page/info_section.mas, title=>'Trait Files', empty_message=>'', collapsible=>1, collapsed=>0, subtitle=>'[<a id="create_new_trait_file_link">New</a>]' &>
54 foreach my $trait_ref (@trait_files) {
55 my @trait_array = @{$trait_ref};
56 my $trait_file_name = $trait_array[0];
57 my $trait_file_download = '[<a href="/fieldbook/trait_file_download/'.$trait_array[1].'">Download File</a>] | [<a id="delete_trait_file_link" href="/fieldbook/delete_file/'.$trait_array[1].'">Delete File</a>]';
58 print $trait_array[0]."$trait_file_download<br>";
59 #print $trial_array[4]."</br>";
64 <&| /page/info_section.mas, title=>'Uploaded Phenotype Files', collapsible=>1, collapsed=>0, subtitle=>'[<a id="upload_fieldbook_phenotypes_link">Upload</a>]' &>
66 if (scalar(@phenotype_files)>0) {
67 print qq { <br/><div class="well well-sm"><table class="table fieldbook_phenotype_datatables"><thead><tr><th>Filename</th><th>Delete</th></tr></thead><tbody> };
69 foreach my $phenotype_ref (@phenotype_files) {
70 my @phenotype_array = @{$phenotype_ref};
71 my $phenotype_file_name = $phenotype_array[0];
72 #my $phenotype_file_download = '[<a href="/fieldbook/trait_file_download/'.$trait_array[1].'">Download</a>]';
73 #print $phenotype_array[0]."$trait_file_download<br>";
74 print qq { <tr><td>$phenotype_array[0]</td><td><a href="javascript:remove_phenotype_data($phenotype_array[1])"><b>X</b></a></td></tr> };
77 print qq { </tbody></table></div> };
83 <& /fieldbook/upload_phenotype_fieldbook.mas &>
85 <&| /page/info_section.mas, title=>'Removed Phenotype Files', collapsible=>1, collapsed=>1 &>
87 foreach my $phenotype_ref (@removed_phenotype_files) {
88 my @phenotype_array = @{$phenotype_ref};
89 my $phenotype_file_name = $phenotype_array[0];
90 #my $phenotype_file_download = '[<a href="/fieldbook/trait_file_download/'.$trait_array[1].'">Download</a>]';
91 #print $phenotype_array[0]."$trait_file_download<br>";
92 print qq { $phenotype_array[0] <button disabled="1" id="re-upload" >re-upload</button><br /> };
102 jQuery(document).ready(function() {
103 jQuery('.fieldbook_phenotype_datatables').DataTable();
106 function remove_phenotype_data(file_id) {
107 var yes = confirm("Do you really want to remove all data associated with this file (id="+file_id+")");
109 beforeSend: function() { jQuery('#working_modal').modal("show"); },
110 url: '/breeders/trial/delete/file/'+file_id,
111 success: function(response) {
112 jQuery('#working_modal').modal("hide");
113 if (response.error) {
114 alert(response.error);
121 error: function(response) {
122 jQuery('#working_modal').modal("hide");
123 alert("An error occurred!");