-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.php
135 lines (118 loc) · 4.67 KB
/
tasks.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<?php
require 'includes/header_start.php';
require 'includes/header_end.php';
?>
<div class="col-md-12" id="main_display">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-12">
<div class="card-box">
<div class="col-md-12">
<table class="table table-bordered tablesorter" id="tasks_global_table">
<thead>
<tr>
<th>#</th>
<th>ASSIGNED TO</th>
<th>CREATED</th>
<th>SHORT DESC</th>
<th>PRIORITY</th>
<th>ETA</th>
<th>% COMPLETED</th>
<th>LAST UPDATED</th>
</tr>
</thead>
<tbody id="tasks_information_table">
<tr>
<td colspan="9">No tasks to display.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Task modal -->
<div id="modalTaskInfo" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modalTaskInfoLabel" aria-hidden="true">
<!-- Inserted via AJAX -->
</div>
<!-- /.modal -->
</div>
</div>
</div>
<!-- Add Customer modal -->
<div id="modalAddCustomer" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modalAddCustomerLabel" aria-hidden="true">
<!-- Inserted via AJAX -->
</div>
<!-- /.modal -->
<!-- Global Search loading, required for global search to work -->
<script src="/ondemand/js/global_search.js?random=<?php echo rand(0,1500); ?>"></script>
<!-- Adding SO to the system -->
<script src="/ondemand/js/add_so.js"></script>
<script>
$("#tasks_global_table").DataTable({
"ajax": "/ondemand/admin/tasks.php?action=get_task_list",
"createdRow": function(row,data,dataIndex) {
$(row).addClass("cursor-hand display-task-info");
},
"order": [1,'asc'],
"dom": 'rti',
"pageLength": 25
});
$(".js_loading").show();
$(function() {
$(".js_loading").hide();
});
$("body")
// -- Navigation --
.on("click", ".display-task-info", function() {
$.post("/ondemand/admin/tasks.php?action=get_task_info", {task_id: $(this).attr("id")}, function(data) {
$("#modalTaskInfo").html(data);
}).done(function() {
$("#modalTaskInfo").modal();
}).fail(function(data) { // if we're receiving a header error
$("body").append(data); // echo an error and log it
});
})
.on("click", "#update_task_btn", function() {
var form_info = $("#task_details").serialize();
var task_id = $(this).data("taskid");
var s_text_1 = $("#split-text-1").val();
var s_text_2 = $("#split-text-2").val();
$.post("/ondemand/admin/tasks.php?action=update_task&" + form_info, {task_id: task_id, s_text_1: s_text_1, s_text_2: s_text_2}, function(data) {
$("body").append(data);
$("#modalTaskInfo").modal('hide');
unsaved = false;
});
})
.on("click", "#split_task_btn", function() {
$(".task_hide").toggle(100);
$("#split_body").toggle(250);
setTimeout(function() {
if($("#split_body").is(":visible")) {
$("#split_task_enabled").val("1");
} else {
$("#split_task_enabled").val("0");
}
}, 250);
})
.on("click", "#create_op_btn", function() {
var form_info = $("#task_details").serialize();
var task_id = $(this).data("taskid");
$.post("/ondemand/admin/tasks.php?action=create_operation&" + form_info, {task_id: task_id}, function(data) {
$("body").append(data);
$("#modalTaskInfo").modal('hide');
unsaved = false;
});
})
;
setInterval(function() {
var time = new Date();
time = time.toLocaleTimeString();
$("#clock").html(time);
}, 1000);
</script>
<?php
require 'includes/footer_start.php';
require 'includes/footer_end.php';
?>