5 $breeding_program => undef
7 $identifier_prefix => ''
8 $type_select_options => undef
13 $updated_status_type => undef
14 $updated_status_string => undef
15 $status_display => undef
20 <& /util/import_javascript.mas, classes => [ 'jquery', 'jquery/dataTables', 'CXGN.BreedersToolbox.HTMLSelect.js', 'CXGN.List' ] &>
23 % my @column_headers = @$activity_headers;
24 % my @activity_types = @$type_select_options;
26 <& /page/page_title.mas, title => "Tracking Activities of '$identifier_name'" &>
28 <& /util/import_javascript.mas, classes => ['jquery','jquery.dataTables'] &>
29 <& /util/import_css.mas, paths => ['/documents/inc/datatables/jquery.dataTables.css'] &>
31 % if ($updated_status_type) {
32 <div class="modal-header" style="text-align: center">
33 <h4 class="modal-title" ><%$status_display%></h4>
34 <h4><%$updated_status_string%></h4>
38 <&| /page/info_section.mas, title => 'Record', collapsible => 1, collapsed => 0, subtitle => '' &>
40 <form class="form-horizontal" >
41 <div class="form-group">
42 <label class="col-sm-3 control-label">Material: </label>
43 <div class="col-sm-5">
44 <input class="form-control" id="material_info" name="material_info" type="text" disabled value="<%$material_name%>">
47 % if (!$updated_status_type) {
48 <div class="form-group">
49 <label class="col-sm-3 control-label">Type: </label>
50 <div class="col-sm-5">
51 % if ($type_select_options) {
52 <select id="type_select">
53 <option value="">Please select a type</option>
54 % foreach my $type(@$type_select_options){
55 <option value="<%$type->[0]%>"><%$type->[1]%></option>
61 <div class="form-group">
62 <label class="col-sm-3 control-label">Input: </label>
63 <div class="col-sm-5">
64 <input class="form-control" id="selected_type_input" name="selected_type_input" type="text" value="">
67 <div class="form-group">
68 <label class="col-sm-3 control-label">Notes:</label>
69 <div class="col-sm-5">
70 <textarea class="form-control" id="selected_type_notes" name="selected_type_notes" ></textarea>
73 <div class="form-group">
74 <label class="col-sm-3 control-label">Timestamp: </label>
75 <div class="col-sm-5">
76 <input class="form-control" id="record_timestamp" name="record_timestamp" type="text" disabled value="<%$timestamp%>">
80 <button id="activity_info_submit" name="activity_info_submit" class="btn btn-primary">Save</button>
87 <&| /page/info_section.mas, title => 'Summary', collapsible => 1, collapsed => 0, subtitle => '' &>
88 <div class = "well well-sm">
89 <div class = "panel panel-default">
90 <div class = "panel-body">
91 <div style="overflow:scroll">
92 <table id = "activity_summary_table" class="table table-hover table-striped">
95 % foreach my $header(@column_headers){
107 <&| /page/info_section.mas, title => 'Activity Details', collapsible => 1, collapsed => 0, subtitle => '' &>
108 <div class = "well well-sm">
109 <div class = "panel panel-default">
110 <div class = "panel-body">
111 <div style="overflow:scroll">
112 <table id = "activity_info_table" class="table table-hover table-striped">
115 % foreach my $header(@column_headers){
127 <div class="modal fade" id="info_saved_dialog_message" name="info_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="infoSavedDialog">
128 <div class="modal-dialog" role="document">
129 <div class="modal-content">
130 <div class="modal-header">
131 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
132 <h4 class="modal-title" id="infoSavedDialog">Success</h4>
134 <div class="modal-body">
135 <div class="container-fluid">
137 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
138 New information was saved.
142 <div class="modal-footer">
143 <button id="dismiss_info_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close & Reload</button>
149 <&| /page/info_section.mas, title=>"Update Status", collapsible => 1, collapsed=>1 &>
150 % if ($user_role eq "curator" ) {
151 <div class="well well-sm">
152 <div class="panel panel-default">
153 <div class="panel-body">
154 % if ($updated_status_type) {
155 <button class="btn btn-sm btn-default" style="margin:3px" id ="update_status_usage_link" name = "update_status_usage_link">Usage Help <span class="glyphicon glyphicon-question-sign"></span></button><button class="btn btn-sm btn-primary" style="margin:3px" id="reverse_status_link">Reverse Status</button>
157 <button class="btn btn-sm btn-default" style="margin:3px" id ="update_status_usage_link" name = "update_status_usage_link">Usage Help <span class="glyphicon glyphicon-question-sign"></span></button><button class="btn btn-sm btn-primary" style="margin:3px" id="update_status_link">Update Status</button>
163 You need to be logged in or you do not have sufficient privileges to update status of this tracking identifier.
168 <& /tracking_activities/update_status_dialog.mas, identifier_name => $identifier_name, identifier_id => $identifier_id, material_id => $material_id, updated_status_type => $updated_status_type, material_id => $material_id &>
172 jQuery(document).ready( function() {
174 var identifier_id = "<%$identifier_id%>";
176 jQuery('#activity_info_table').DataTable({
179 'ajax': '/ajax/tracking_activity/details/'+identifier_id,
182 jQuery('#activity_summary_table').DataTable({
189 'ajax': '/ajax/tracking_activity/summary/'+identifier_id,
192 jQuery('#activity_info_submit').click( function(e) {
194 var selected_type = jQuery('#type_select').val();
195 var input = jQuery('#selected_type_input').val();
196 var record_timestamp = jQuery('#record_timestamp').val();
197 var notes = jQuery('#selected_type_notes').val();
199 if (selected_type == '') {
200 alert("Please select a type");
204 alert("Please provide an input");
209 url: '/ajax/tracking_activity/save',
213 'tracking_identifier' : "<%$identifier_name%>",
214 'selected_type': selected_type,
216 'record_timestamp': record_timestamp,
219 beforeSend: function(response){
220 jQuery('#working_modal').modal('show');
222 success: function(response) {
223 jQuery('#working_modal').modal('hide');
224 if (response.success == 1) {
225 jQuery('#info_saved_dialog_message').modal("show");
227 if (response.error) {
228 alert(response.error);
231 error: function(response){
232 jQuery('#working_modal').modal('hide');
233 alert('An error occurred saving new information');
238 jQuery("#dismiss_info_saved_dialog").click(function(){
239 jQuery('#type_select').val('');
240 jQuery('#selected_type_input').val('');
241 jQuery('#selected_type_notes').val('');