3 $timestamp => localtime()
6 <div class="modal fade" id="discard_seedlots_using_list_dialog" name="discard_seedlots_using_list_dialog" tabindex="-1" role="dialog" aria-labelledby="discardSeedlotsDialog">
7 <div class="modal-dialog modal-lg" role="document">
8 <div class="modal-content">
9 <div class="modal-header">
10 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
11 <h4 class="modal-title" id="discardSeedlotsDialog">Mark Seedlots as Discarded </h4>
13 <div class="modal-body">
14 <div class="container-fluid">
15 <form class="form-horizontal" role="form" method="post" id="discard_seedlots_form" name="discard_seedlots_form">
16 <div class="form-group" id="seedlot_list_section" >
17 <label class="col-sm-4 control-label">List of Seedlots:</label>
18 <div class="col-sm-8" id="select_seedlot_list" name="select_seedlot_list"></div>
20 <div class="form-group">
21 <label class="col-sm-4 control-label">Reason for Discarding: </label>
22 <div class="col-sm-8" >
23 <textarea class="form-control" id="reason_for_discarding" name="reason_for_discarding" placeholder="Required"></textarea>
30 <div class="modal-footer">
31 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
32 <button type="button" class="btn btn-primary" name="discard_seedlots_submit" id="discard_seedlots_submit">Submit</button>
38 <div class="modal fade" id="discard_seedlot_saved_dialog_message" name="discard_seedlot_saved_dialog_message" tabindex="-1" role="dialog" aria-labelledby="discardSeedlotSavedDialog">
39 <div class="modal-dialog" role="document">
40 <div class="modal-content">
41 <div class="modal-header">
42 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
43 <h4 class="modal-title" id="discardSeedlotSavedDialog">Success</h4>
45 <div class="modal-body">
46 <div class="container-fluid">
48 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
49 The seedlots were marked as DISCARDED.
53 <div class="modal-footer">
54 <button id="dismiss_discard_seedlot_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close & Reload</button>
62 jQuery(document).ready(function(){
64 jQuery("#discard_seedlot_link").click( function() {
65 jQuery('#discard_seedlots_using_list_dialog').modal('show');
68 var list = new CXGN.List();
69 document.getElementById("select_seedlot_list").innerHTML = list.listSelect("select_seedlot_list", [ 'seedlots' ], 'Please select a list of seedlots to discard','', undefined);
71 jQuery('#discard_seedlots_submit').click(function(){
73 var seedlot_list_id = jQuery('#select_seedlot_list_list_select').val();
74 var discard_reason = jQuery('#reason_for_discarding').val();
76 if (seedlot_list_id === '') {
77 alert("Please select a list");
81 if (discard_reason === '') {
82 alert("Please provide reason for discarding these seedlots");
87 url: '/ajax/breeders/seedlot/discard',
90 'seedlot_list_id' : seedlot_list_id,
91 'discard_reason': discard_reason,
93 beforeSend: function(response){
94 jQuery('#working_modal').modal('show');
96 success: function(response) {
97 jQuery('#working_modal').modal('hide');
98 if (response.success == 1) {
99 jQuery('#discard_seedlots_using_list_dialog').modal('hide');
100 jQuery('#discard_seedlot_saved_dialog_message').modal("show");
102 if (response.error_string) {
103 alert(response.error_string);
106 error: function(response){
107 jQuery('#working_modal').modal('hide');
108 alert('An error occurred discarding seedlots');
113 jQuery("#dismiss_discard_seedlot_saved_dialog").click( function() {
114 jQuery('#discard_seedlot_saved_dialog_message').modal('hide');