9 <div class="modal fade" id="update_status_dialog" name="_dialog" tabindex="-1" role="dialog" aria-labelledby="updateStatusDialog">
10 <div class="modal-dialog modal-lg" role="document">
11 <div class="modal-content">
12 <div class="modal-header">
13 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
14 <h4 class="modal-title" id="updateStatusDialog">Mark this experiment as completed or terminated </h4>
16 <div class="modal-body">
17 <div class="container-fluid">
18 <form class="form-horizontal" role="form" method="post" id="update_status_form" name="update_status_form">
19 <div class="form-group">
20 <label class="col-sm-4 control-label">Tracking Identifier: </label>
21 <div class="col-sm-8" >
22 <input class="form-control" name="tracking_identifier_name" id="tracking_identifier_name" disabled value="<% $identifier_name %>">
25 <div class="form-group">
26 <label class="col-sm-4 control-label">Status Type: </label>
27 <div class="col-sm-8">
28 <select class="form-control" id="status_type">
29 <option value="">Select a status type</option>
30 <option value="completed">completed</option>
31 <option value="terminated">terminated</option>
35 <div class="form-group">
36 <label class="col-sm-4 control-label">Comments: </label>
37 <div class="col-sm-8" >
38 <textarea class="form-control" id="comments_for_updating" name="comments_for_updating" placeholder="Optional"></textarea>
44 <div class="modal-footer">
45 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
46 <button type="button" class="btn btn-primary" name="update_status_submit" id="update_status_submit">Submit</button>
52 <div class="modal fade" id="updated_saved_dialog_message" name="updated_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="updatedSavedDialog">
53 <div class="modal-dialog" role="document">
54 <div class="modal-content">
55 <div class="modal-header">
56 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
57 <h4 class="modal-title" id="updatedSavedDialog">Success</h4>
59 <div class="modal-body">
60 <div class="container-fluid">
62 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
63 The status of this experiment has been updated.
67 <div class="modal-footer">
68 <button id="dismiss_updated_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close & Reload</button>
74 <div class="modal fade" id="reverse_status_dialog_message" name="reverse_status_dialog_message" tabindex="-1" role="dialog" aria-labelledby="reverseStatusDialog">
75 <div class="modal-dialog" role="document">
76 <div class="modal-content">
77 <div class="modal-header">
78 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
79 <h4 class="modal-title" id="reverseStatusDialog">Success</h4>
81 <div class="modal-body">
82 <div class="container-fluid">
84 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
85 This experiment has been restored.
89 <div class="modal-footer">
90 <button id="dismiss_reverse_status_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close & Reload</button>
98 jQuery(document).ready(function(){
100 var identifier_id = "<% $identifier_id %>";
101 var material_id = "<% $material_id %>";
102 var program_name = "<% $program_name %>";
104 jQuery("#update_status_link").click( function() {
105 jQuery('#update_status_dialog').modal('show');
108 jQuery('#update_status_submit').click(function() {
110 var status_type = jQuery('#status_type').val();
111 var comments = jQuery('#comments_for_updating').val();
113 if (identifier_id === '') {
114 alert("Error retrieving identifier info");
118 if (status_type === '') {
119 alert("Please select a status type");
124 url: '/ajax/tracking_activity/update_status',
128 'identifier_id': identifier_id,
129 'status_type': status_type,
130 'material_id': material_id,
131 'comments': comments,
132 'program_name': program_name,
134 beforeSend: function(response){
135 jQuery('#working_modal').modal('show');
137 success: function(response) {
138 jQuery('#working_modal').modal('hide');
139 if (response.success == 1) {
140 jQuery('#update_status_dialog').modal('hide');
141 jQuery('#updated_saved_dialog_message').modal("show");
143 if (response.error_string) {
144 alert(response.error_string);
147 error: function(response){
148 jQuery('#working_modal').modal('hide');
149 alert('An error occurred updating status');
154 jQuery("#dismiss_updated_saved_dialog").click( function() {
155 jQuery('#updated_saved_dialog_message').modal('hide');
159 jQuery('#reverse_status_link').click(function() {
160 var updated_status_type = "<% $updated_status_type %>";
161 var confirmation = confirm("Are you sure you want to reverse status of this tracking identifier ?");
164 url: '/ajax/tracking_activity/reverse_status',
168 'identifier_id' : identifier_id,
169 'updated_status_type' : updated_status_type,
170 'material_id' : material_id,
171 'program_name' : program_name,
173 beforeSend: function(response){
174 jQuery('#working_modal').modal('show');
176 success: function(response) {
177 jQuery('#working_modal').modal('hide');
178 if (response.success == 1) {
179 jQuery('#reverse_status_dialog_message').modal("show");
181 if (response.error_string) {
182 alert(response.error_string);
185 error: function(response){
186 jQuery('#working_modal').modal('hide');
187 alert('An error occurred processing your request');
193 jQuery("#dismiss_reverse_status_dialog").click( function() {
194 jQuery('#reverse_status_dialog_message').modal('hide');