4 $default_plant_material_id
5 $default_plant_material_name
8 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery.dataTables' ] &>
9 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
11 <div class="modal fade" id="add_transformation_identifier_dialog" tabindex="-1" role="dialog" aria-labelledby="addTransformationIdentifierDialog">
12 <div class="modal-dialog modal-xl" role="document">
13 <div class="modal-content ui-front">
14 <div class="modal-header text-center">
15 <button type="reset" class="close" id="add_transformation_id_dismiss_button_1" name="add_transformation_id_dismiss_button" aria-label="Close"><span aria-hidden="true">×</span></button>
16 <h4 class="modal-title" id="addTransformationIdentifierDialog">Add New Transformation ID</h4>
18 <div class="modal-body" id="add_new_transformation_identifier_body">
19 <div class="container-fluid">
20 <form class="form-horizontal" role="form" method="post" enctype="multipart/form-data" encoding="multipart/form-data">
21 <div class="form-group">
22 <label class="col-sm-4 control-label" >Transformation ID: </label>
23 <div class="col-sm-7">
24 <input class="form-control" type="text" id="new_transformation_identifier_name" name="new_transformation_identifier_name" />
27 % if ($default_plant_material_name) {
28 <div class="form-group">
29 <label class="col-sm-4 control-label" >Plant Material (accession name): </label>
30 <div class="col-sm-7">
31 <input class="form-control" name="plant_material" id="plant_material" disabled value="<% $default_plant_material_name %>">
35 <div class="form-group">
36 <label class="col-sm-4 control-label" >Plant Material (accession name): </label>
37 <div class="col-sm-7">
38 <input class="form-control" type="text" id="plant_material" name="plant_material" />
42 <div class="form-group">
43 <label class="col-sm-4 control-label" >Vector Construct: </label>
44 <div class="col-sm-7">
45 <input class="form-control" type="text" id="vector_construct" name="vector_construct" />
48 <div class="form-group">
49 <label class="col-sm-4 control-label" >Notes: </label>
50 <div class="col-sm-7">
51 <div class="input-group">
52 <textarea class="form-control" id="transformation_notes" ></textarea>
59 <div class="modal-footer">
60 <button id="add_transformation_id_dismiss_button_2" name="add_transformation_id_dismiss_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
61 <button type="button" class="btn btn-primary" id="new_transformation_identifier_submit">Submit</button>
67 <div class="modal fade" id="transformation_id_saved_dialog_message" name="transformation_id_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="transformationIDSavedDialog">
68 <div class="modal-dialog" role="document">
69 <div class="modal-content">
70 <div class="modal-header">
71 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
72 <h4 class="modal-title" id="transformationIDSavedDialog">Success</h4>
74 <div class="modal-body">
75 <div class="container-fluid">
77 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
78 The transformation ID was saved successfully.
82 <div class="modal-footer">
83 <button id="dismiss_transformation_id_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close & Reload</button>
92 jQuery(document).ready(function(){
94 var transformation_project_id = "<%$trial_id%>";
95 var program_name = "<%$breeding_program_name%>";
96 var default_plant_material_name = "<%$default_plant_material_name%>";
98 jQuery("#plant_material").autocomplete({
99 source: '/ajax/stock/only_accession_autocomplete',
102 jQuery("#vector_construct").autocomplete({
103 source: '/ajax/stock/vector_construct_autocomplete',
106 jQuery('#new_transformation_identifier_submit').click(function() {
107 var transformation_identifier = jQuery("#new_transformation_identifier_name").val();
108 if (!transformation_identifier) {
109 alert("Transformation ID is required");
113 var plant_material = jQuery("#plant_material").val();
114 if (!plant_material) {
115 alert("Plant material is required");
119 var vector_construct = jQuery("#vector_construct").val();
120 if (!vector_construct) {
121 alert ("Vector construct is required");
125 var notes = jQuery("#transformation_notes").val();
128 url: '/ajax/transformation/add_transformation_identifier',
132 'transformation_identifier': transformation_identifier,
133 'plant_material': plant_material,
134 'vector_construct': vector_construct,
136 'transformation_project_id': transformation_project_id,
137 'program_name': program_name
139 beforeSend: function(response){
140 jQuery('#working_modal').modal('show');
142 success: function(response) {
143 jQuery('#working_modal').modal('hide');
144 if (response.success == 1) {
145 jQuery('#add_transformation_identifier_dialog').modal('hide');
146 jQuery('#transformation_id_saved_dialog_message').modal("show");
149 if (response.error) {
150 alert(response.error);
153 error: function(response){
154 jQuery('#working_modal').modal('hide');
155 alert('An error occurred creating transformation ID');
161 jQuery("[name='add_transformation_id_dismiss_button']").click(function() {
162 jQuery('#add_transformation_identifier_dialog').modal('hide');
163 jQuery('#new_transformation_identifier_name').val('');
165 if (!default_plant_material_name) {
166 jQuery('#plant_material').val('');
169 jQuery('#vector_construct').val('');
170 jQuery('#transformation_notes').val('');
173 jQuery("#dismiss_transformation_id_saved_dialog").click(function(){
174 jQuery('#new_transformation_identifier_name').val('');
176 if (!default_plant_material_name) {
177 jQuery('#plant_material').val('');
180 jQuery('#vector_construct').val('');
181 jQuery('#transformation_notes').val('');