7 <& /util/import_javascript.mas, classes => ['CXGN.TrialTreeFolders'] &>
9 <div class="modal fade" id="create_activity_project_dialog" name="create_activity_project_dialog" tabindex="-1" role="dialog" aria-labelledby="createActivityProjectDialog">
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_activity_project_dismiss_button_1" name="add_activity_project_dismiss_button" aria-label="Close"><span aria-hidden="true">×</span></button>
14 <center><h4 class="modal-title" id="creatActivityProjectDialog">Add New Tracking Activities Project</h4></center>
16 <div class="modal-body">
17 <div class="container-fluid">
19 <&| /util/workflow.mas, id=> "add_tracking_activity_project_workflow" &>
20 <&| /util/workflow.mas:step, title=> "Intro" &>
21 <& /page/page_title.mas, title=>"Tracking Activities Tool" &>
22 <p>You can use tracking tool to track and record activity information related to materials stored in the database (i.e. tracking tissue culture process of an accession). Data types of each process can be customized (please contact us).</p>
24 <li>Tracking identifier is a globally unique name assigned to each material for capturing tracking information.</li>
25 <li>Tracking identifiers are organized using Tracking Activities projects</li>
26 <li>You can generate tracking identifiers by using a link on the Tracking Activities project page</li>
27 <li>Record page allows you to record inputs of different data types. The link can be found on the project page. To record new information, you can retrieve any tracking identifier by scanning a barcode.</li>
28 <li>Each tracking identifier has its own details page. In addition to the record page, you can record data directly using this details page. Tracking Identifier details page displays details of each data entry including an input, operator and timestamp as well as a summary of multiple entries of the same data type</li>
29 <li>If you would like to track preparation process for requested items from ordering tool, ordering tool can be connected with tracking tool (please contact us).</li>
33 <button id="next_step_add_new_project" class="btn btn-primary" onclick="Workflow.complete(this);">Go to Next Step</button>
37 <form class="form-horizontal" role="form" name="create_activity_project_form" id="create_activity_project_form">
38 <&| /util/workflow.mas:step, title=> "Add project info" &>
39 <& /page/page_title.mas, title=>"Enter basic information about the project" &>
41 <div class="form-group">
42 <label class="col-sm-3 control-lable">Project Name: </label>
43 <div class="col-sm-9">
44 <input class="form-control" type="text" id="activity_project_name" name="activity_project_name" />
47 <div class="form-group">
48 <label class="col-sm-3 control-label">Activity Type: </label>
49 <div class="col-sm-9">
50 <select class="form-control" id="activity_type" name="activity_type">
51 <option value="">Select an activity type</option>
52 <option value="tissue_culture">Tissue Culture</option>
53 <option value="transformation">Transformation</option>
57 <div class="form-group">
58 <label class="col-sm-3 control-label">Breeding Program: </label>
59 <div class="col-sm-9">
60 <select class="form-control" id="activity_project_program" name="activity_project_program">
61 <option value="">Select Breeding Program</option>
63 foreach my $program (@$programs) {
65 print "<option selected=\"selected\" value='".@$program[0]."'>".@$program[1]."</option>";
67 print "<option value='".@$program[0]."'>".@$program[1]."</option>";
74 <div class="form-group">
75 <label class="col-sm-3 control-label">Location of this project: </label>
76 <div class="col-sm-9">
77 <select class="form-control" id="activity_project_location" name="activity_project_location">
78 <option value="">Select Location</option>
80 foreach my $location_hashref (@$locations) {
81 my $properties = $location_hashref->{'properties'};
82 my $program = $properties->{'Program'};
83 my $name = $properties->{'Name'};
84 print "<option value=\"$name\" data-program=\"$program\">".$name."</option>";
90 <div class="form-group">
91 <label class="col-sm-3 control-label">Year:</label>
92 <div class="col-sm-9">
93 <div id="activity_project_year" name="activity_project_year" ></div>
96 <div class="form-group">
97 <label class="col-sm-3 control-label">Description:</label>
98 <div class="col-sm-9">
99 <textarea class="form-control" id="activity_project_description" name="activity_project_description" ></textarea>
106 <button type="button" class="btn btn-primary" onclick="Workflow.complete(this, false);" name="create_activity_project_submit" id="create_activity_project_submit">Submit</button>
111 <&| /util/workflow.mas:complete, title=> "Complete" &>
112 <& /page/page_title.mas, title=>"Your project is now in the database" &>
114 <center><li>Please use "Generate Tracking Identifiers" link on your tracking activities project page to generate tracking identifiers for each project.</li></center>
118 </&><!-- End of workflow -->
121 <div class="modal-footer">
122 <button id="add_activity_project_dismiss_button_2" name="add_activity_project_dismiss_button" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
130 jQuery(document).ready(function(){
132 var selectedProgram = jQuery('#activity_project_program option:selected').text()
134 filter_options(selectedProgram, 'program', 'activity_project_location');
136 jQuery('#activity_project_program').change(function() {
137 filter_options(jQuery('#activity_project_program option:selected').text(), 'program', 'activity_project_location');
140 jQuery("[name='add_activity_project_dismiss_button']").click(function() {
141 jQuery('#create_activity_project_dialog').modal('hide');
142 jQuery('#activity_project_name').val('');
143 jQuery('#activity_project_program').val('');
144 jQuery('#activity_project_location').val('');
145 jQuery('#activity_project_project_year').val('');
146 jQuery('#activity_project_description').val('');
149 jQuery('#create_activity_project_submit').click(function() {
150 var project_name = jQuery("#activity_project_name").val();
152 alert("Project name is required");
156 var activity_type = jQuery("#activity_type").val();
157 if (!activity_type) {
158 alert("Activity type is required");
162 var breeding_program = jQuery("#activity_project_program").val();
163 if (!breeding_program) {
164 alert("Breeding program is required");
168 var project_location = jQuery("#activity_project_location").val();
169 if (!project_location) {
170 alert ("Location is required");
174 var year = jQuery("#activity_project_year_select").val();
176 alert ("Year is required");
180 var project_description = jQuery("#activity_project_description").val();
181 if (!project_description) {
182 alert ("Description is required");
187 url: '/ajax/tracking_activity/create_tracking_activity_project',
191 'project_name' : project_name,
192 'activity_type': activity_type,
193 'breeding_program': breeding_program,
194 'project_location': project_location,
196 'project_description': project_description
198 beforeSend: function(response){
199 jQuery('#working_modal').modal('show');
201 success: function(response) {
202 if (response.error) {
203 jQuery('#working_modal').modal('hide');
204 alert(response.error);
206 refreshActivityJsTree(0);
207 Workflow.focus("#add_tracking_activity_project_workflow", -1); //Go to success page
208 Workflow.check_complete("#add_tracking_activity_project_workflow");
209 jQuery('#working_modal').modal('hide');
212 error: function(response){
213 jQuery('#working_modal').modal('hide');
214 alert('An error occurred saving new tracking activities project');