7 <div class="modal fade" id="requester_re_open_order_dialog" name="requester_re_open_order_dialog" tabindex="-1" role="dialog" aria-labelledby="requesterReOpenOrderDialog">
8 <div class="modal-dialog modal-lg" role="document">
9 <div class="modal-content">
10 <div class="modal-header">
11 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
12 <h4 class="modal-title" id="requesterReOpenOrderDialog">Re-Open Order</h4>
14 <div class="modal-body">
15 <div class="container-fluid">
16 <div id="requester_re_open_order_div">
20 <div class="modal-footer">
21 <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
22 <button id="requester_re_open_order_submit" type="button" class="btn btn-primary" >Submit</button>
28 <div class="modal fade" id="re_open_saved_dialog" name="re_open_saved_dialog" tabindex="-1" role="dialog" aria-labelledby="reOpenSavedDialog">
29 <div class="modal-dialog" role="document">
30 <div class="modal-content">
31 <div class="modal-header">
32 <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
33 <h4 class="modal-title" id="reOpenSavedDialog">Success</h4>
35 <div class="modal-body">
36 <div class="container-fluid">
38 <span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span>
39 The order has been re-opened.
43 <div class="modal-footer">
44 <button id="dismiss_re_open_saved_dialog" type="button" class="btn btn-default" data-dismiss="modal">Close</button>
53 jQuery(document).ready( function() {
54 var order_id = "<% $order_id %>";
55 var order_to = "<% $order_to %>";
57 jQuery('#requester_re_open_link').click(function(){
58 requesterReOpen(order_id, order_to)
61 jQuery('#requester_re_open_order_submit').click( function() {
62 var order_id = jQuery('#requester_re_open_order_id').val();
63 var re_open_status = jQuery('#requester_re_open_status').val();
64 var requester_re_open_comments = jQuery('#requester_re_open_comments').val();
65 if (!requester_re_open_comments) {
66 alert ("Please add comments for re-opening the order");
71 url: '/ajax/order/update',
75 'order_id' : order_id,
76 'new_status': re_open_status,
77 'contact_person_comments': requester_re_open_comments
79 beforeSend: function(response){
80 jQuery('#working_modal').modal('show');
82 success: function(response) {
83 jQuery('#working_modal').modal('hide');
84 if (response.success == 1) {
85 jQuery('#re_open_saved_dialog').modal('show');
86 jQuery('#requester_re_open_order_dialog').modal('hide');
88 if (response.error_string) {
89 alert(response.error);
92 error: function(response){
93 jQuery('#working_modal').modal('hide');
94 alert('An error occurred re-opening the order');
99 jQuery("#dismiss_re_open_saved_dialog").click(function(){
106 function requesterReOpen(order_id, order_to){
107 var re_open = "re-opened"
109 html += '<form class="form-horizontal"><div class="form-group"><label class="col-sm-3 control-label">Order Number: </label><div class="col-sm-9" ><input class="form-control" id="requester_re_open_order_id" name="requester_re_open_order_id" value="'+order_id+'" disabled></div></div>';
110 html += '<div class="form-group"><label class="col-sm-3 control-label">Vendor: </label><div class="col-sm-9" ><input class="form-control" id="re_open_order_to" name="re_open_order_to" value="'+order_to+'" disabled></div></div>';
111 html += '<div class="form-group"><label class="col-sm-3 control-label">Status: </label><div class="col-sm-9" ><input class="form-control" id="requester_re_open_status" name="requester_re_open_status" value="'+re_open+'" disabled></div></div>';
112 html += '<div class="form-group"><label class="col-sm-3 control-label">Comments: </label><div class="col-sm-9" ><input class="form-control" id="requester_re_open_comments" placeholder="Required"></div></div></form>'
114 jQuery('#requester_re_open_order_div').html(html);
115 jQuery('#requester_re_open_order_dialog').modal('show');