7 <& /util/import_javascript.mas, classes => ['CXGN.TrialTreeFolders'] &>
9 <div class="modal fade" id="create_transformation_project_dialog" name="create_transformation_project_dialog" tabindex="-1" role="dialog" aria-labelledby="createTransformationProjectDialog">
10 <div class="modal-dialog modal-xl" role="document">
11 <div class="modal-content ui-front">
12 <div class="modal-header">
13 <button type="reset" class="close" id="add_transformation_project_dismiss_button_1" name="add_transformation_project_dismiss_button" aria-label="Close"><span aria-hidden="true">×</span></button>
14 <center><h4 class="modal-title" id="createTransformationProjectDialog">Add New Transformation Project</h4></center>
16 <div class="modal-body">
17 <div class="container-fluid">
19 <&| /util/workflow.mas, id=> "add_transformation_project_workflow" &>
20 <&| /util/workflow.mas:step, title=> "Intro" &>
21 <& /page/page_title.mas, title=>"What are Transformation Projects?" &>
23 <p>You can use Transformation Projects to manage and organize your transformation experiemnts</p>
25 <li>Each transformation experiment is linked to a globally unique transformation ID.</li>
26 <li>Transformation ID captures information about plant material and vector construct used in that experiment.</li>
27 <li>You can use transformation details page to automatically add new transformant (accession) names to database by simply indicating the number of transformants generated.</li>
28 <li>Each auto-generated transformant (accession) name has transformation ID as basename and an incremental serial number. </li>
32 <button id="next_step_add_new_intro" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
36 <form class="form-horizontal" role="form" name="create_transformation_project_form" id="create_transformation_project_form">
37 <&| /util/workflow.mas:step, title=> "Add a transformation project" &>
38 <& /page/page_title.mas, title=>"Enter basic information about the transformation project" &>
40 <div class="form-group">
41 <label class="col-sm-3 control-lable">Project Name: </label>
42 <div class="col-sm-9">
43 <input class="form-control" type="text" id="transformation_project_name" name="transformation_project_name" />
46 <div class="form-group">
47 <label class="col-sm-3 control-label">Breeding Program: </label>
48 <div class="col-sm-9">
49 <select class="form-control" id="transformation_project_program" name="transformation_project_program">
50 <option value="">Select Breeding Program</option>
52 foreach my $program (@$programs) {
54 print "<option selected=\"selected\" value='".@$program[0]."'>".@$program[1]."</option>";
56 print "<option value='".@$program[0]."'>".@$program[1]."</option>";
63 <div class="form-group">
64 <label class="col-sm-3 control-label">Location: </label>
65 <div class="col-sm-9">
66 <select class="form-control" id="transformation_project_location" name="transformation_project_location">
67 <option value="">Select Location</option>
69 foreach my $location_hashref (@$locations) {
70 my $properties = $location_hashref->{'properties'};
71 my $program = $properties->{'Program'};
72 my $name = $properties->{'Name'};
73 print "<option value=\"$name\" data-program=\"$program\">".$name."</option>";
79 <div class="form-group">
80 <label class="col-sm-3 control-label">Year:</label>
81 <div class="col-sm-9">
82 <div id="transformation_project_year" name="transformation_project_year" ></div>
85 <div class="form-group">
86 <label class="col-sm-3 control-label">Description:</label>
87 <div class="col-sm-9">
88 <textarea class="form-control" id="transformation_project_description" name="transformation_project_description" ></textarea>
95 <button type="button" class="btn btn-primary" onclick="Workflow.complete(this, false);" name="create_transformation_project_submit" id="create_transformation_project_submit">Submit</button>
100 <&| /util/workflow.mas:complete, title=> "Complete" &>
101 <& /page/page_title.mas, title=>"Finished! Your transformation project is now in the database" &>
103 <li>Please click on 'Refresh' button to view your newly created project on the manage page.</li>
104 <li>You can use your transformation project page to create transformation IDs.</li>
105 <li><b>If your transformation project is automatically linked to the tracking tool, please set up a naming format for the autogenerated names of your transformation project before using the tracking tool.</b></li>
109 </&><!-- End of workflow -->
112 <div class="modal-footer">
113 <button id="add_transformation_project_dismiss_button_2" name="add_transformation_project_dismiss_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
121 jQuery(document).ready(function(){
123 var selectedProgram = jQuery('#transformation_project_program option:selected').text()
125 filter_options(selectedProgram, 'program', 'transformation_project_location');
127 jQuery('#transformation_project_program').change(function() {
128 filter_options(jQuery('#transformation_project_program option:selected').text(), 'program', 'transformation_project_location');
131 jQuery("[name='add_transformation_project_dismiss_button']").click(function() {
132 jQuery('#create_transformation_project_dialog').modal('hide');
133 jQuery('#transformation_project_name').val('');
134 jQuery('#transformation_project_program').val('');
135 jQuery('#transformation_project_location').val('');
136 jQuery('#transformation_project_year').val('');
137 jQuery('#transformation_project_description').val('');
140 jQuery('#create_transformation_project_submit').click(function() {
141 var transformation_project_name = jQuery("#transformation_project_name").val();
142 if (!transformation_project_name) {
143 alert("Project name is required");
147 var selectedProgram = jQuery("#transformation_project_program").val();
148 if (!selectedProgram) {
149 alert("Breeding program is required");
153 var transformation_project_location = jQuery("#transformation_project_location").val();
154 if (!transformation_project_location) {
155 alert ("Location is required");
159 var year = jQuery("#transformation_project_year_select").val();
161 alert ("Year is required");
165 var project_description = jQuery('textarea#transformation_project_description').val();
166 if (!project_description) {
167 alert ("Description is required");
172 url: '/ajax/transformation/add_transformation_project',
176 'project_name': transformation_project_name,
177 'project_program_id': selectedProgram,
178 'project_location': transformation_project_location,
180 'project_description': project_description,
182 beforeSend: function() {
183 jQuery("#working_modal").modal("show");
185 error: function(response) {
186 alert("An error occurred!" + JSON.stringify(response));
189 parseerror: function(response) {
190 alert("A parse error occurred!" + response);
193 success: function(response) {
194 jQuery('#working_modal').modal('hide');
195 if (response.error) {
196 alert(response.error);
198 if (response.success == 1) {
199 Workflow.focus("#add_transformation_project_workflow", -1); //Go to success page
200 Workflow.check_complete("#add_transformation_project_workflow");