4 $trial_stock_type => undef
7 <& /page/page_title.mas, title=>"Manage Phenotyping for $trial_name" &>
8 <& /breeders_toolbox/trial/download_phenotypes_dialog.mas, trial_ids => $trial_id &>
10 <div class="well well-sm">
12 <div class="col-md-1 col-lg-1">
14 <div class="col-md-10 col-lg-10">
16 <form class="form-horizontal" role="form" action="/barcode/direct_trial_phenotyping">
17 <div class="form-group form-group-sm">
18 <label class="col-sm-4 control-label">Plot Name: </label>
19 <div class="col-sm-8" id="plot_name_1">
23 <div class="form-group form-group-sm">
24 <label id = "manage_phenotyping_stock_type" class="col-sm-4 control-label"></label>
25 <div class="col-sm-8" id="accession_name">
29 <div class="form-group form-group-sm">
30 <label class="col-sm-4 control-label">Plot No: </label>
31 <div class="col-sm-8" id="plot_no">
35 <div class="form-group form-group-sm">
36 <label class="col-sm-4 control-label">Block No: </label>
37 <div class="col-sm-8" id="block_no">
41 <div class="form-group form-group-sm">
42 <label class="col-sm-4 control-label">Rep No: </label>
43 <div class="col-sm-8" id="rep_no">
49 <div class="col-md-1 col-lg-1">
55 <div class="well well-sm">
57 <div class="col-md-1 col-lg-1">
59 <div class="col-md-10 col-lg-10">
61 <div class="form-group form-group-sm" id="all_traits">
62 <label class="col-sm-4 control-label" for="select_traits_for_trait_file">Select trait: </label>
63 <div class="col-sm-8">
64 <select class="form-control" id="select_traits_for_trait_file"></select>
68 <div class="form-group form-group-sm">
69 <label class="col-sm-4 control-label">Or Use Trait List: </label>
70 <div class="col-sm-8">
71 <input type="checkbox" id="use_trait_list" value="use_trait_list"/>
77 <div id="show_trait_textbox" style="display: none">
78 <div class="form-group form-group-sm" >
79 <label class="col-sm-4 control-label">Enter a List of Trait Names: </label>
80 <div class="col-sm-8" id="show_trait_selectbox">
87 <div id="show_trait_list_box" style="display: none">
88 <div class="form-group form-group-sm">
89 <label class="col-sm-4 control-label">Or Paste From a List: </label>
90 <div class="col-sm-8">
91 <div id="list_menu_traits"></div>
92 <script defer="defer">
93 jQuery(document).ready(function() {
94 pasteTraitListMenu('show_trait_selectbox', 'list_menu_traits', 'Paste Trait List');
96 function pasteTraitListMenu (div_name, menu_div, button_name) {
97 var list = new CXGN.List();
99 html = list.listSelect(div_name, ['traits'], undefined, undefined, undefined);
100 html = html + '<button class="btn btn-info btn-sm" type="button" id="paste_button_id" value="'+button_name+'" onclick="javascript:pasteTraitList(\''+div_name+'\')" >'+button_name+'</button>';
101 jQuery('#'+menu_div).html(html);
112 <div class="form-group form-group-sm">
113 <label class="col-sm-4 control-label">Enter trait value: </label>
114 <div class="col-sm-3">
115 <input type="number" class="form-control" id="select_pheno_value" name="select_pheno_value"></input>
120 <div class="col-md-1 col-lg-1">
126 <!--<div id="main" class="container">
127 <div id="virtualKeyboard"></div>
130 <&| /page/info_section.mas, id=> "trial_detail_traits_assayed", title => "Traits assayed", collapsible=>1, collapsed=>1, hide_if_empty=>1, subtitle=>"[<a id='trial_download_phenotypes_button'>Download Trial Data</a>]" &>
132 <& /breeders_toolbox/trial/phenotype_summary.mas, trial_id => $trial_id, trial_stock_type => $trial_stock_type &>
139 var trial_info_object = [];
141 jQuery(document).ready(function($) {
143 var trial_id = <% $trial_id %>;
147 url: '/ajax/breeders/trial_phenotyping_info',
150 'trial_id' : trial_id,
153 success: function(response) {
154 trial_info_object = response.trial_info;
156 alert("Error Retrieving Trial Information: "+response.error);
159 var trial_plot_name_html = "<select class='form-control' id='plot_name' >";
160 var trial_accession_html = "<select class='form-control' id='trial_accession_table' disabled>";
161 var trial_plot_number_html = "<select class='form-control' id='trial_plot_number_table'>";
162 var trial_block_number_html = "<select class='form-control' id='trial_block_number_table' disabled>";
163 var trial_rep_number_html = "<select class='form-control' id='trial_rep_number_table' disabled>";
165 for (n=0; n<response.trial_info.length; n++){
166 //console.log(response.trial_info[n]);
168 trial_plot_name_html = trial_plot_name_html + "<option value=" + response.trial_info[n].plot_name + ">" + response.trial_info[n].plot_name + "</option>";
169 trial_accession_html = trial_accession_html + "<option value=" + response.trial_info[n].accession_name + ">" + response.trial_info[n].accession_name + "</option>";
170 trial_plot_number_html = trial_plot_number_html + "<option value=" + response.trial_info[n].plot_number + ">" + response.trial_info[n].plot_number + "</option>";
171 trial_block_number_html = trial_block_number_html + "<option value=" + response.trial_info[n].block_number + ">" + response.trial_info[n].block_number + "</option>";
172 trial_rep_number_html = trial_rep_number_html + "<option value=" + response.trial_info[n].rep_number + ">" + response.trial_info[n].rep_number + "</option>";
175 trial_plot_name_html = trial_plot_name_html + "</select>";
176 jQuery('#plot_name_1').empty();
177 jQuery('#plot_name_1').html(trial_plot_name_html);
179 trial_accession_html = trial_accession_html + "</select>";
180 jQuery('#accession_name').empty();
181 jQuery('#accession_name').html(trial_accession_html);
183 trial_plot_number_html = trial_plot_number_html + "</select>";
184 jQuery('#plot_no').empty();
185 jQuery('#plot_no').html(trial_plot_number_html);
187 trial_block_number_html = trial_block_number_html + "</select>";
188 jQuery('#block_no').empty();
189 jQuery('#block_no').html(trial_block_number_html);
191 trial_rep_number_html = trial_rep_number_html + "</select>";
192 jQuery('#rep_no').empty();
193 jQuery('#rep_no').html(trial_rep_number_html);
197 alert('An error occurred retrieving trial information');
202 var null_trait_value = '';
204 $("#use_trait_list").click(function () {
205 if ($('#use_trait_list').is(':checked')) {
206 $('#all_traits').hide();
207 jQuery('#select_traits_for_trait_file').empty();
208 $('#show_trait_textbox').show();
209 $('#show_trait_list_box').show();
210 jQuery("#select_pheno_value").val(null_trait_value);
213 $('#all_traits').show();
214 $('#show_trait_textbox').hide();
215 $('#show_trait_list_box').hide();
216 jQuery('#select_traits_for_trait_file_2').empty();
217 jQuery("#select_pheno_value").val(null_trait_value);
218 jQuery('#select_pheno_value').empty();
219 get_select_box('traits', 'select_traits_for_trait_file', {
220 'name': 'html_select_traits_for_trait_file',
221 'id': 'html_select_traits_for_trait_file',
227 get_select_box('traits', 'select_traits_for_trait_file', {
228 'name': 'html_select_traits_for_trait_file',
229 'id': 'html_select_traits_for_trait_file',
235 var trait_list_option_focusin;
236 jQuery( "#select_pheno_value" ).focusin(function() {
237 plot_focusin = jQuery("#plot_name").val();
238 trait_focusin = jQuery("#select_traits_for_trait_file").val();
239 //var trait_list_option = '';
240 if (jQuery('#use_trait_list').is(':checked')) {
241 //trait_list_option = jQuery('#use_trait_list').val();
242 trait_list_option_focusin = jQuery('#use_trait_list').val();
244 if (trait_focusin === null){
245 trait_focusin = jQuery("#select_traits_for_trait_file_2").val();
247 console.log(plot_focusin +" and "+trait_focusin);
250 jQuery( "#select_pheno_value" ).focusout(function() {
251 //jQuery('input[name=select_pheno_value]').change(function() {
252 var trait_value = jQuery("#select_pheno_value").val();
253 var plot_name = plot_focusin;
254 var trait = trait_focusin;
255 var trait_list_option = trait_list_option_focusin;
259 url : '/ajax/phenotype/plot_phenotype_upload',
262 'plot_name' : plot_name,
264 'trait_value' : trait_value,
265 'trait_list_option' : trait_list_option,
268 success: function (response) {
270 alert("Error Saving Trait Value: "+response.error);
274 alert('An error occurred saving trait value');
281 function Retrieve_pheno(){
282 var plot_name = jQuery("#plot_name").val();
284 trait = jQuery("#select_traits_for_trait_file").val();
286 trait = jQuery("#select_traits_for_trait_file_2").val();
289 var trait_list_option = '';
290 if ($('#use_trait_list').is(':checked')) {
291 trait_list_option = jQuery('#use_trait_list').val();
296 url : '/ajax/phenotype/plot_phenotype_retrieve',
299 'plot_name' : plot_name,
301 'trait_list_option' : trait_list_option,
304 success: function (response) {
305 var value = response.trait_value;
306 var black = {'color': 'red'};
309 alert("Error Retrieving Trait Value: "+response.error);
312 jQuery("#select_pheno_value").css(black);
314 jQuery("#select_pheno_value").val(value);
318 alert('An error occurred retrieving trait value');
325 jQuery(document).on('change', '#select_traits_for_trait_file_2', function(){
326 jQuery("#select_traits_for_trait_file").empty();
330 jQuery("#select_traits_for_trait_file").on('change', function() {
331 jQuery("#select_traits_for_trait_file_2").empty();
335 jQuery(document).on('change', '#plot_name', function(){
336 var plot_infor = jQuery('#plot_name').val();
337 for (i=0; i<trial_info_object.length; i++){
338 if (trial_info_object[i].plot_name == plot_infor){
339 var plotNo = trial_info_object[i].plot_number;
340 var accessionName = trial_info_object[i].accession_name;
341 var blockNo = trial_info_object[i].block_number;
342 var repNo = trial_info_object[i].rep_number;
344 jQuery('#trial_accession_table').val(accessionName);
345 jQuery('#trial_plot_number_table').val(plotNo);
346 jQuery('#trial_block_number_table').val(blockNo);
347 jQuery('#trial_rep_number_table').val(repNo);
354 jQuery(document).on('change', '#trial_plot_number_table', function(){
355 var plot_infor = jQuery('#trial_plot_number_table').val();
356 for (i=0; i<trial_info_object.length; i++){
357 if (trial_info_object[i].plot_number == plot_infor){
358 var accessionName = trial_info_object[i].accession_name;
359 var plotName = trial_info_object[i].plot_name;
360 var blockNo = trial_info_object[i].block_number;
361 var repNo = trial_info_object[i].rep_number;
363 jQuery('#plot_name').val(plotName);
364 jQuery('#trial_accession_table').val(accessionName);
365 jQuery('#trial_block_number_table').val(blockNo);
366 jQuery('#trial_rep_number_table').val(repNo);
373 var trial_stock_type = "<% $trial_stock_type %>";
374 var manage_phenotyping_label = '';
376 if (trial_stock_type == 'family_name') {
377 manage_phenotyping_label = 'Family Name :';
378 } else if (trial_stock_type == 'cross') {
379 manage_phenotyping_label = 'Cross Unique ID :';
381 manage_phenotyping_label = 'Accession Name :';
384 jQuery('#manage_phenotyping_stock_type').text(manage_phenotyping_label);