4 <div class="modal fade" id="add_new_observation_variable_dialog" name="add_new_observation_variable_dialog" tabindex="-1" role="dialog" aria-labelledby="addNewObservationVariableDialog">
5 <div class="modal-dialog modal-xl" role="document">
6 <div class="modal-content">
7 <div class="modal-header">
8 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
9 <h4 class="modal-title" id="addNewObservationVariableDialog">Add New Observation Variable</h4>
11 <div class="modal-body">
12 <div class="container-fluid">
14 <&| /util/workflow.mas, id=> "add_new_trait_workflow" &>
15 <&| /util/workflow.mas:step, title=> "Intro" &>
16 <& /page/page_title.mas, title=>"Need a new observation variable?" &>
18 <li>Please be sure the observation variable does not currently exist in the database using the trait search.</li>
19 <li>Having many observation variables that are in fact recording the same thing is dangerous and can cause the database data to become fragmented.</li>
20 <li>An observation variable is composed of a trait for the attribute being observed, a method describing how the attribute was measured, and a scale indicating the units of the observation.</li>
21 <li>Having descriptive observation variables is critical for downstream analysis.</li>
26 <button class="btn btn-primary" name="add_new_observation_variable_ontology_add_button">Need a new ontology? Click here first.</button>
31 <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
35 <&| /util/workflow.mas:step, title=> "Observation Variable" &>
36 <& /page/page_title.mas, title=>"Define your observation variable" &>
38 <p>An observation variable is composed of a trait for the attribute being observed, a method describing how the attribute was measured, and a scale indicating the units of the observation.</p>
42 <button class="btn btn-primary" name="add_new_observation_variable_ontology_add_button">Need a new ontology? Click here first.</button>
46 <form class="form-horizontal">
47 <div class="form-group">
48 <label class="col-sm-3 control-label">Observation Variable Ontology Name: </label>
49 <div class="col-sm-9">
50 <div id="add_new_observation_variable_ontology_select_div">
54 <div class="form-group">
55 <label class="col-sm-3 control-label">New Observation Variable Name: </label>
56 <div class="col-sm-9">
57 <input class="form-control" id="add_new_observation_variable_name" name="add_new_observation_variable_name" type="text" placeholder="e.g. total mass of fruit harvest from a plant using MachineX in kilograms"/>
60 <div class="form-group">
61 <label class="col-sm-3 control-label">New Observation Variable Definition: </label>
62 <div class="col-sm-9">
63 <input class="form-control" id="add_new_observation_variable_definition" name="add_new_observation_variable_definition" type="text" placeholder="e.g. total mass of fruit harvest from a plant using MachineX in kilograms"/>
70 <button class="btn btn-primary" id="add_new_trait_observation_variable_step">Go to Next Step</button>
74 <&| /util/workflow.mas:step, title=> "Trait" &>
75 <& /page/page_title.mas, title=>"Define your trait" &>
78 <li>A trait defines the attribute being measured. It is one component of an observation variable; the others are a method and a scale.</li>
79 <li>Here you can select a trait that already exists in an ontology in the database or you can add a new trait into an ontology.</li>
84 <button class="btn btn-primary" name="add_new_observation_variable_ontology_add_button">Need a new ontology? Click here first.</button>
88 <form class="form-horizontal">
89 <div class="form-group">
90 <label class="col-sm-3 control-label">Trait Ontology Name: </label>
91 <div class="col-sm-9">
92 <div id="add_new_trait_ontology_select_div">
96 <div class="form-group">
97 <label class="col-sm-3 control-label">Existing Traits in Selected Ontology: </label>
98 <div class="col-sm-9">
99 <div id="add_new_trait_existing_trait_select_div">
106 <h3>If the trait does not exist in the ontology you selected above, you can add a new trait into the ontology here.</h3>
109 <div class="form-group">
110 <label class="col-sm-3 control-label">New Trait Name: </label>
111 <div class="col-sm-9">
112 <input class="form-control" id="add_new_trait_name" name="add_new_trait_name" type="text" placeholder="e.g. harvested fruit mass per plant"/>
115 <div class="form-group">
116 <label class="col-sm-3 control-label">New Trait Definition: </label>
117 <div class="col-sm-9">
118 <input class="form-control" id="add_new_trait_definition" name="add_new_trait_definition" type="text" placeholder="e.g. the total mass of fruit harvested from a plant"/>
124 <button class="btn btn-primary" id="add_new_trait_trait_step">Go to Next Step</button>
128 <&| /util/workflow.mas:step, title=> "Method" &>
129 <p>A method defines the how it was measured measured. It is one component of an observation variable; the others are a trait and a scale.</p>
133 <button class="btn btn-primary" name="add_new_observation_variable_ontology_add_button">Need a new ontology? Click here first.</button>
137 <form class="form-horizontal">
138 <div class="form-group">
139 <label class="col-sm-3 control-label">Method Ontology Name: </label>
140 <div class="col-sm-9">
141 <div id="add_new_trait_method_ontology_select_div">
145 <div class="form-group">
146 <label class="col-sm-3 control-label">Existing Methods in Selected Ontology: </label>
147 <div class="col-sm-9">
148 <div id="add_new_trait_existing_method_select_div">
155 <h3>If the method does not exist in the ontology you selected above, you can add a new method into the ontology here.</h3>
158 <div class="form-group">
159 <label class="col-sm-3 control-label">New Method Name: </label>
160 <div class="col-sm-9">
161 <input class="form-control" id="add_new_trait_method_name" name="add_new_trait_method_name" type="text" placeholder="e.g. BrandA Mass Balance 0.001g Accuracy"/>
164 <div class="form-group">
165 <label class="col-sm-3 control-label">New Method Definition: </label>
166 <div class="col-sm-9">
167 <input class="form-control" id="add_new_trait_method_definition" name="add_new_trait_method_definition" type="text" placeholder="e.g. BrandA MachineX Mass Balance 0.001g Accuracy"/>
173 <button type="button" class="btn btn-primary" id="add_new_trait_method_step">Go to Next Step</button>
177 <&| /util/workflow.mas:step, title=> "Scale" &>
178 <& /page/page_title.mas, title=>"Define your scale" &>
181 <button class="btn btn-primary" name="add_new_observation_variable_ontology_add_button">Need a new ontology? Click here first.</button>
185 <form class="form-horizontal">
186 <div class="form-group">
187 <label class="col-sm-3 control-label">Scale Ontology Name: </label>
188 <div class="col-sm-9">
189 <div id="add_new_trait_scale_ontology_select_div">
193 <div class="form-group">
194 <label class="col-sm-3 control-label">Existing Scales in Selected Ontology: </label>
195 <div class="col-sm-9">
196 <div id="add_new_trait_existing_scale_select_div">
203 <h3>If the scale does not exist in the ontology you selected above, you can add a new scale into the ontology here.</h3>
206 <div class="form-group">
207 <label class="col-sm-3 control-label">New Scale Name: </label>
208 <div class="col-sm-9">
209 <input class="form-control" id="add_new_trait_scale_name" name="add_new_trait_scale_name" type="text" placeholder="e.g. mass in kilograms"/>
212 <div class="form-group">
213 <label class="col-sm-3 control-label">New Scale Definition: </label>
214 <div class="col-sm-9">
215 <input class="form-control" id="add_new_trait_scale_definition" name="add_new_trait_scale_definition" type="text" placeholder="e.g. the mass in kilograms"/>
218 <div class="form-group">
219 <label class="col-sm-3 control-label">New Scale Format: </label>
220 <div class="col-sm-9">
221 <select class="form-control" id="add_new_trait_scale_format" name="add_new_trait_scale_format" >
222 <option value="">Select One</option>
223 <option value="qualitative">qualitative</option>
224 <option value="quantitative">quantitative</option>
228 <div class="form-group">
229 <label class="col-sm-3 control-label">New Scale Minimum: </label>
230 <div class="col-sm-9">
231 <input class="form-control" id="add_new_trait_scale_minimum" name="add_new_trait_scale_minimum" type="text" placeholder="e.g. 1"/>
234 <div class="form-group">
235 <label class="col-sm-3 control-label">New Scale Maximum: </label>
236 <div class="col-sm-9">
237 <input class="form-control" id="add_new_trait_scale_maximum" name="add_new_trait_scale_maximum" type="text" placeholder="e.g. 10000"/>
240 <div class="form-group">
241 <label class="col-sm-3 control-label">New Scale Categories ('/' separated): </label>
242 <div class="col-sm-9">
243 <input class="form-control" id="add_new_trait_scale_categories" name="add_new_trait_scale_categories" type="text" placeholder="e.g. 1/3/5/7"/>
246 <div class="form-group">
247 <label class="col-sm-3 control-label">New Scale Default Value: </label>
248 <div class="col-sm-9">
249 <input class="form-control" id="add_new_trait_scale_default" name="add_new_trait_scale_default" type="text" placeholder="e.g. 5"/>
255 <button type="button" class="btn btn-primary" id="add_new_trait_scale_step">Go to Next Step</button>
259 <&| /util/workflow.mas:step, title=> "Confirm" &>
260 <& /page/page_title.mas, title=>"Confirm you are creating this observation variable in the database" &>
263 <button class="btn btn-primary" id="add_new_trait_submit_button">Submit</button>
266 <&| /util/workflow.mas:complete, title=> "Complete" &>
267 <& /page/page_title.mas, title=>"Finished! Your observation variable is now in the database" &>
269 <div id="add_new_trait_added_observation_variable_div">
273 </&><!-- End of workflow -->
277 <div class="modal-footer">
278 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
284 <div class="modal fade" id="add_new_observation_variable_ontology_dialog" name="add_new_observation_variable_ontology_dialog" tabindex="-1" role="dialog" aria-labelledby="addNewObservationVariableOntologyDialog">
285 <div class="modal-dialog modal-xl" role="document">
286 <div class="modal-content">
287 <div class="modal-header">
288 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
289 <h4 class="modal-title" id="addNewObservationVariableOntologyDialog">Add New Ontology</h4>
291 <div class="modal-body">
292 <div class="container-fluid">
294 <&| /util/workflow.mas, id=> "add_new_ontology_workflow" &>
295 <&| /util/workflow.mas:step, title=> "Intro" &>
296 <& /page/page_title.mas, title=>"Start a new ontology" &>
298 <li>In this workflow you can add a new ontology to the database. Once an ontology is added, you can add terms into it from the add observation variables workflow.</li>
299 <li>Ontologies are tagged as being either for traits, methods, or scales</li>
304 <button class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
308 <&| /util/workflow.mas:step, title=> "Ontology" &>
309 <& /page/page_title.mas, title=>"Define your ontology" &>
311 <form class="form-horizontal">
312 <div class="form-group">
313 <label class="col-sm-3 control-label">New Ontology Name: </label>
314 <div class="col-sm-9">
315 <input class="form-control" id="add_new_observation_variable_ontology_name" name="add_new_observation_variable_ontology_name" type="text" placeholder="e.g. MyBreedingProgram Grape Ontology"/>
318 <div class="form-group">
319 <label class="col-sm-3 control-label">New Ontology Definition: </label>
320 <div class="col-sm-9">
321 <input class="form-control" id="add_new_observation_variable_ontology_definition" name="add_new_observation_variable_ontology_definition" type="text" placeholder="e.g. description of the ontology"/>
324 <div class="form-group">
325 <label class="col-sm-3 control-label">New Ontology Database Identifier: </label>
326 <div class="col-sm-9">
327 <input class="form-control" id="add_new_observation_variable_ontology_db_name" name="add_new_observation_variable_ontology_db_name" type="text" placeholder="a unique identifier for the terms in the ontology e.g. CO322"/>
330 <div class="form-group">
331 <label class="col-sm-3 control-label">Ontology Type: </label>
332 <div class="col-sm-9">
333 <select class="form-control" id="add_new_observation_variable_ontology_type" name="add_new_observation_variable_ontology_type"/>
334 <option value="trait_ontology">Trait or Observation Variable</option>
335 <option value="method_ontology">Method</option>
336 <option value="unit_ontology">Scale</option>
344 <button class="btn btn-primary" id="add_new_trait_observation_variable_ontology_step">Store Ontology</button>
348 <&| /util/workflow.mas:complete, title=> "Complete" &>
349 <& /page/page_title.mas, title=>"Finished! Your ontology is now in the database. Add new terms into it from the add observation variable workflow." &>
352 </&><!-- End of workflow -->
356 <div class="modal-footer">
357 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
364 jQuery(document).ready(function() {
366 jQuery('button[name="add_new_observation_variable_ontology_add_button"]').click(function(){
367 jQuery('#add_new_observation_variable_ontology_dialog').modal('show');
370 jQuery('button[name="add_new_observation_variable_button"]').click(function(){
371 jQuery('#add_new_observation_variable_dialog').modal('show');
373 get_select_box('trait_variable_ontologies', 'add_new_observation_variable_ontology_select_div', { 'name':'add_new_observation_variable_ontology_select', 'id':'add_new_observation_variable_ontology_select', 'empty':1, 'cvprop_type_name':JSON.stringify(['trait_ontology','composed_trait_ontology','attribute_ontology']) });
374 get_select_box('trait_variable_ontologies', 'add_new_trait_ontology_select_div', { 'name':'add_new_trait_ontology_select', 'id':'add_new_trait_ontology_select', 'empty':1, 'cvprop_type_name':JSON.stringify(['trait_ontology','composed_trait_ontology','attribute_ontology']) });
375 get_select_box('trait_variable_ontologies', 'add_new_trait_method_ontology_select_div', { 'name':'add_new_trait_method_ontology_select', 'id':'add_new_trait_method_ontology_select', 'empty':1, 'cvprop_type_name':JSON.stringify(['method_ontology']) });
376 get_select_box('trait_variable_ontologies', 'add_new_trait_scale_ontology_select_div', { 'name':'add_new_trait_scale_ontology_select', 'id':'add_new_trait_scale_ontology_select', 'empty':1, 'cvprop_type_name':JSON.stringify(['unit_ontology']) });
380 var add_new_trait_new_observation_variable_db_id;
381 var add_new_trait_new_observation_variable_name;
382 var add_new_trait_new_observation_variable_definition;
383 jQuery('#add_new_trait_observation_variable_step').click(function() {
384 if (jQuery('#add_new_observation_variable_name').val() == '') {
385 alert('Please give a new observation variable name!');
388 if (jQuery('#add_new_observation_variable_definition').val() == '') {
389 alert('Please give a new observation variable definition!');
393 jQuery('input[name="add_new_observation_variable_ontology_select"]:checked').each(function(){
394 selected.push(jQuery(this).val());
396 if (selected.length < 1) {
397 alert('Please select one observation variable ontology!');
398 } else if (selected.length > 1) {
399 alert('Only select one observation variable ontology!');
401 add_new_trait_new_observation_variable_name = jQuery('#add_new_observation_variable_name').val();
402 add_new_trait_new_observation_variable_definition = jQuery('#add_new_observation_variable_definition').val();
403 add_new_trait_new_observation_variable_db_id = selected[0];
404 Workflow.complete('#add_new_trait_observation_variable_step');
405 Workflow.focus('#add_new_trait_workflow', 2);
410 var add_new_trait_new_trait_db_id;
411 jQuery(document).on('change', 'input[name="add_new_trait_ontology_select"]', function(){
413 jQuery('input[name="add_new_trait_ontology_select"]:checked').each(function(){
414 selected.push(jQuery(this).val());
416 if (selected.length > 1) {
417 alert('Only select one trait ontology!');
419 add_new_trait_new_trait_db_id = selected[0];
420 get_select_box('all_ontology_terms', 'add_new_trait_existing_trait_select_div', { 'selectbox_name':'add_new_trait_existing_trait_select', 'selectbox_id':'add_new_trait_existing_trait_select', 'empty':1, 'db_id':selected[0], 'exclude_top_term':1 });
424 var add_new_trait_new_method_db_id;
425 jQuery(document).on('change', 'input[name="add_new_trait_method_ontology_select"]', function(){
427 jQuery('input[name="add_new_trait_method_ontology_select"]:checked').each(function(){
428 selected.push(jQuery(this).val());
430 if (selected.length > 1) {
431 alert('Only select one method ontology!');
433 add_new_trait_new_method_db_id = selected[0];
434 get_select_box('all_ontology_terms', 'add_new_trait_existing_method_select_div', { 'selectbox_name':'add_new_trait_existing_method_select', 'selectbox_id':'add_new_trait_existing_method_select', 'empty':1, 'db_id':selected[0], 'exclude_top_term':1 });
438 var add_new_trait_new_scale_db_id;
439 jQuery(document).on('change', 'input[name="add_new_trait_scale_ontology_select"]', function(){
441 jQuery('input[name="add_new_trait_scale_ontology_select"]:checked').each(function(){
442 selected.push(jQuery(this).val());
444 if (selected.length > 1) {
445 alert('Only select one scale ontology!');
447 add_new_trait_new_scale_db_id = selected[0];
448 get_select_box('all_ontology_terms', 'add_new_trait_existing_scale_select_div', { 'selectbox_name':'add_new_trait_existing_scale_select', 'selectbox_id':'add_new_trait_existing_scale_select', 'empty':1, 'db_id':selected[0], 'exclude_top_term':1 });
452 var add_new_trait_selected_trait_cvterm_id;
453 var add_new_trait_new_trait_name;
454 var add_new_trait_new_trait_definition;
455 jQuery('#add_new_trait_trait_step').click(function() {
456 var add_new_trait_selected_trait_val = jQuery('#add_new_trait_existing_trait_select').val();
457 if (add_new_trait_selected_trait_val == '0') {
458 add_new_trait_selected_trait_val = '';
460 if (add_new_trait_selected_trait_val == '' && jQuery('#add_new_trait_name').val() == '') {
461 alert('Please select an existing trait or give a new trait name!');
464 if (add_new_trait_selected_trait_val != '' && jQuery('#add_new_trait_name').val() != '') {
465 alert('Please select an existing trait or give a new trait name, and not both!');
469 jQuery('input[name="add_new_trait_ontology_select"]:checked').each(function(){
470 selected.push(jQuery(this).val());
472 if (selected.length < 1) {
473 alert('Please select one trait ontology!');
474 } else if (selected.length > 1) {
475 alert('Only select one trait ontology!');
477 if (add_new_trait_selected_trait_val == '') {
478 if (jQuery('#add_new_trait_name').val() == ''){
479 alert('Please give a new trait name!');
481 else if (jQuery('#add_new_trait_definition').val() == ''){
482 alert('Please give a new trait definition!');
485 add_new_trait_new_trait_name = jQuery('#add_new_trait_name').val();
486 add_new_trait_new_trait_definition = jQuery('#add_new_trait_definition').val();
487 Workflow.complete('#add_new_trait_trait_step');
488 Workflow.focus('#add_new_trait_workflow', 3);
491 add_new_trait_selected_trait_cvterm_id = add_new_trait_selected_trait_val;
492 Workflow.complete('#add_new_trait_trait_step');
493 Workflow.focus('#add_new_trait_workflow', 3);
499 var add_new_trait_selected_method_cvterm_id;
500 var add_new_trait_new_method_name;
501 var add_new_trait_new_method_definition;
502 jQuery('#add_new_trait_method_step').click(function(){
503 var add_new_trait_selected_method_val = jQuery('#add_new_trait_existing_method_select').val();
504 if (add_new_trait_selected_method_val == '0') {
505 add_new_trait_selected_method_val = '';
507 if (add_new_trait_selected_method_val == '' && jQuery('#add_new_trait_method_name').val() == '') {
508 alert('Please select an existing method or give a new method name!');
511 if (add_new_trait_selected_method_val != '' && jQuery('#add_new_trait_method_name').val() != '') {
512 alert('Please select an existing method or give a new method name, and not both!');
516 jQuery('input[name="add_new_trait_method_ontology_select"]:checked').each(function(){
517 selected.push(jQuery(this).val());
519 if (selected.length < 1) {
520 alert('Please select one method ontology!');
521 } else if (selected.length > 1) {
522 alert('Only select one method ontology!');
524 if (add_new_trait_selected_method_val == '') {
525 if (jQuery('#add_new_trait_method_name').val() == ''){
526 alert('Please give a new method name!');
528 else if (jQuery('#add_new_trait_method_definition').val() == ''){
529 alert('Please give a new method definition!');
532 add_new_trait_new_method_name = jQuery('#add_new_trait_method_name').val();
533 add_new_trait_new_method_definition = jQuery('#add_new_trait_method_definition').val();
534 Workflow.complete('#add_new_trait_method_step');
535 Workflow.focus('#add_new_trait_workflow', 4);
538 add_new_trait_selected_method_cvterm_id = add_new_trait_selected_method_val;
539 Workflow.complete('#add_new_trait_method_step');
540 Workflow.focus('#add_new_trait_workflow', 4);
546 var add_new_trait_selected_scale_cvterm_id;
547 var add_new_trait_new_scale_name;
548 var add_new_trait_new_scale_definition;
549 var add_new_trait_new_scale_format;
550 var add_new_trait_new_scale_minimum;
551 var add_new_trait_new_scale_maximum;
552 var add_new_trait_new_scale_default;
553 var add_new_trait_new_scale_categories;
554 jQuery('#add_new_trait_scale_step').click(function(){
555 var add_new_trait_selected_scale_val = jQuery('#add_new_trait_existing_scale_select').val();
556 if (add_new_trait_selected_scale_val == '0') {
557 add_new_trait_selected_scale_val = '';
559 if (add_new_trait_selected_scale_val == '' && jQuery('#add_new_trait_scale_name').val() == '') {
560 alert('Please select an existing scale or give a new scale name!');
563 if (add_new_trait_selected_scale_val != '' && jQuery('#add_new_trait_scale_name').val() != '') {
564 alert('Please select an existing scale or give a new scale name, and not both!');
568 jQuery('input[name="add_new_trait_scale_ontology_select"]:checked').each(function(){
569 selected.push(jQuery(this).val());
571 if (selected.length < 1) {
572 alert('Please select one scale ontology!');
573 } else if (selected.length > 1) {
574 alert('Only select one scale ontology!');
576 if (add_new_trait_selected_scale_val == '') {
577 if (jQuery('#add_new_trait_scale_name').val() == ''){
578 alert('Please give a new scale name!');
580 else if (jQuery('#add_new_trait_scale_definition').val() == ''){
581 alert('Please give a new scale definition!');
583 else if (jQuery('#add_new_trait_scale_format').val() == ''){
584 alert('Please give a new scale format!');
586 else if (jQuery('#add_new_trait_scale_minimum').val() == ''){
587 alert('Please give a new scale minimum!');
589 else if (jQuery('#add_new_trait_scale_maximum').val() == ''){
590 alert('Please give a new scale maximum!');
593 add_new_trait_new_scale_name = jQuery('#add_new_trait_scale_name').val();
594 add_new_trait_new_scale_definition = jQuery('#add_new_trait_scale_definition').val();
595 add_new_trait_new_scale_format = jQuery('#add_new_trait_scale_format').val();
596 add_new_trait_new_scale_minimum = jQuery('#add_new_trait_scale_minimum').val();
597 add_new_trait_new_scale_maximum = jQuery('#add_new_trait_scale_maximum').val();
598 add_new_trait_new_scale_default = jQuery('#add_new_trait_scale_default').val();
599 add_new_trait_new_scale_categories = jQuery('#add_new_trait_scale_categories').val();
600 Workflow.complete('#add_new_trait_scale_step');
601 Workflow.focus('#add_new_trait_workflow', 5);
604 add_new_trait_selected_scale_cvterm_id = add_new_trait_selected_scale_val;
605 Workflow.complete('#add_new_trait_scale_step');
606 Workflow.focus('#add_new_trait_workflow', 5);
612 jQuery('#add_new_trait_submit_button').click(function(){
614 url: '/ajax/onto/store_trait_method_scale_observation_variable',
617 'selected_observation_variable_db_id':add_new_trait_new_observation_variable_db_id,
618 'new_observation_variable_name':add_new_trait_new_observation_variable_name,
619 'new_observation_variable_definition':add_new_trait_new_observation_variable_definition,
620 'selected_trait_db_id':add_new_trait_new_trait_db_id,
621 'selected_trait_cvterm_id':add_new_trait_selected_trait_cvterm_id,
622 'new_trait_name':add_new_trait_new_trait_name,
623 'new_trait_definition':add_new_trait_new_trait_definition,
624 'selected_method_db_id':add_new_trait_new_method_db_id,
625 'selected_method_cvterm_id':add_new_trait_selected_method_cvterm_id,
626 'new_method_name':add_new_trait_new_method_name,
627 'new_method_definition':add_new_trait_new_method_definition,
628 'selected_scale_db_id':add_new_trait_new_scale_db_id,
629 'selected_scale_cvterm_id':add_new_trait_selected_scale_cvterm_id,
630 'new_scale_name':add_new_trait_new_scale_name,
631 'new_scale_definition':add_new_trait_new_scale_definition,
632 'new_scale_format':add_new_trait_new_scale_format,
633 'new_scale_minimum':add_new_trait_new_scale_minimum,
634 'new_scale_maximum':add_new_trait_new_scale_maximum,
635 'new_scale_default':add_new_trait_new_scale_default,
636 'new_scale_categories':add_new_trait_new_scale_categories,
638 beforeSend: function() {
639 jQuery("#working_modal").modal("show");
641 success: function(response){
642 console.log(response);
643 jQuery("#working_modal").modal("hide");
644 //if (response.message){
645 // jQuery('#add_new_trait_added_observation_variable_div').html(response.message);
646 // Workflow.complete('#add_new_trait_submit_button');
647 // Workflow.focus("#add_new_trait_workflow", -1); //go to success page
649 if (response.success) {
650 alert(response.success);
652 if (response.error) {
653 alert(response.error);
657 error: function(response){
658 jQuery("#working_modal").modal("hide");
659 alert("Error saving observation variable.");
664 jQuery('#add_new_trait_observation_variable_ontology_step').click(function(){
666 url: '/ajax/onto/store_ontology_identifier',
669 'ontology_name':jQuery('#add_new_observation_variable_ontology_name').val(),
670 'ontology_description':jQuery('#add_new_observation_variable_ontology_definition').val(),
671 'ontology_identifier':jQuery('#add_new_observation_variable_ontology_db_name').val(),
672 'ontology_type':jQuery('#add_new_observation_variable_ontology_type').val()
674 beforeSend: function() {
675 jQuery("#working_modal").modal("show");
677 success: function(response){
678 console.log(response);
679 jQuery("#working_modal").modal("hide");
680 //if (response.message){
681 // Workflow.complete('#add_new_trait_observation_variable_ontology_step');
682 // Workflow.focus("#add_new_ontology_workflow", -1); //go to success page
684 if (response.success) {
685 alert(response.success);
687 if (response.error) {
688 alert(response.error);
692 error: function(response){
693 jQuery("#working_modal").modal("hide");
694 alert("Error saving ontology.");