mirror of
https://github.com/itflow-org/itflow
synced 2026-03-01 03:14:52 +00:00
Added Ticket Priority, field ticket_priority added to ticket table, New DB Sructure Dump
This commit is contained in:
@@ -36,6 +36,20 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Priority <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="priority" required>
|
||||
<option>Low</option>
|
||||
<option>Medium</option>
|
||||
<option>High</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Subject <strong class="text-danger">*</strong></label>
|
||||
|
||||
@@ -42,7 +42,7 @@ if(isset($_GET['o'])){
|
||||
|
||||
$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM tickets
|
||||
WHERE client_id = $client_id
|
||||
AND (ticket_id LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_status LIKE '%$q%')
|
||||
AND (ticket_number LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_status LIKE '%$q%' OR ticket_priority LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
@@ -76,6 +76,7 @@ $total_pages = ceil($total_found_rows / 10);
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_subject&o=<?php echo $disp; ?>">Subject</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_created_at&o=<?php echo $disp; ?>">Date Opened</a></th>
|
||||
<th><a class="text-secondary" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_status&o=<?php echo $disp; ?>">Status</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_priority&o=<?php echo $disp; ?>">Priority</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -87,6 +88,7 @@ $total_pages = ceil($total_found_rows / 10);
|
||||
$ticket_number = $row['ticket_number'];
|
||||
$ticket_subject = $row['ticket_subject'];
|
||||
$ticket_details = $row['ticket_details'];
|
||||
$ticket_priority = $row['ticket_priority'];
|
||||
$ticket_status = $row['ticket_status'];
|
||||
$ticket_created_at = $row['ticket_created_at'];
|
||||
$ticket_updated_at = $row['ticket_updated_at'];
|
||||
@@ -113,6 +115,7 @@ $total_pages = ceil($total_found_rows / 10);
|
||||
<?php echo $ticket_status; ?>
|
||||
</span>
|
||||
</td>
|
||||
<td><?php echo $ticket_priority; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
|
||||
3
db.sql
3
db.sql
@@ -751,6 +751,7 @@ CREATE TABLE `tickets` (
|
||||
`ticket_category` varchar(200) DEFAULT NULL,
|
||||
`ticket_subject` varchar(200) NOT NULL,
|
||||
`ticket_details` text NOT NULL,
|
||||
`ticket_priority` varchar(200) DEFAULT NULL,
|
||||
`ticket_status` varchar(200) NOT NULL,
|
||||
`ticket_created_at` datetime NOT NULL,
|
||||
`ticket_updated_at` datetime DEFAULT NULL,
|
||||
@@ -882,4 +883,4 @@ CREATE TABLE `vendors` (
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2021-01-15 20:10:13
|
||||
-- Dump completed on 2021-01-22 18:05:30
|
||||
|
||||
@@ -11,6 +11,20 @@
|
||||
<input type="hidden" name="ticket_id" value="<?php echo $ticket_id; ?>">
|
||||
<div class="modal-body bg-white">
|
||||
|
||||
<div class="form-group">
|
||||
<label>Priority <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-thermometer-half"></i></span>
|
||||
</div>
|
||||
<select class="form-control select2" name="priority" required>
|
||||
<option <?php if($ticket_priority == 'Low'){ echo "selected"; } ?> >Low</option>
|
||||
<option <?php if($ticket_priority == 'Medium'){ echo "selected"; } ?> >Medium</option>
|
||||
<option <?php if($ticket_priority == 'High'){ echo "selected"; } ?> >High</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label>Subject <strong class="text-danger">*</strong></label>
|
||||
<div class="input-group">
|
||||
|
||||
6
post.php
6
post.php
@@ -741,6 +741,7 @@ if(isset($_POST['add_ticket'])){
|
||||
|
||||
$client_id = intval($_POST['client']);
|
||||
$subject = strip_tags(mysqli_real_escape_string($mysqli,$_POST['subject']));
|
||||
$priority = strip_tags(mysqli_real_escape_string($mysqli,$_POST['priority']));
|
||||
$details = mysqli_real_escape_string($mysqli,$_POST['details']);
|
||||
|
||||
//Get the next Ticket Number and add 1 for the new ticket number
|
||||
@@ -748,7 +749,7 @@ if(isset($_POST['add_ticket'])){
|
||||
$new_config_ticket_next_number = $config_ticket_next_number + 1;
|
||||
mysqli_query($mysqli,"UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = $session_company_id");
|
||||
|
||||
mysqli_query($mysqli,"INSERT INTO tickets SET ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_status = 'Open', ticket_created_at = NOW(), ticket_created_by = $session_user_id, client_id = $client_id, company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO tickets SET ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 'Open', ticket_created_at = NOW(), ticket_created_by = $session_user_id, client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Created', log_description = '$subject', log_created_at = NOW(), client_id = $client_id, company_id = $session_company_id, user_id = $session_user_id");
|
||||
@@ -763,9 +764,10 @@ if(isset($_POST['edit_ticket'])){
|
||||
|
||||
$ticket_id = intval($_POST['ticket_id']);
|
||||
$subject = strip_tags(mysqli_real_escape_string($mysqli,$_POST['subject']));
|
||||
$priority = strip_tags(mysqli_real_escape_string($mysqli,$_POST['priority']));
|
||||
$details = mysqli_real_escape_string($mysqli,$_POST['details']);
|
||||
|
||||
mysqli_query($mysqli,"UPDATE tickets SET ticket_subject = '$subject', ticket_details = '$details' ticket_updated_at = NOW() WHERE ticket_id = $ticket_id AND company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"UPDATE tickets SET ticket_subject = '$subject', ticket_priority = '$priority', ticket_details = '$details' ticket_updated_at = NOW() WHERE ticket_id = $ticket_id AND company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Modified', log_description = '$subject', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id");
|
||||
|
||||
@@ -38,6 +38,7 @@ if(isset($_GET['ticket_id'])){
|
||||
$ticket_category = $row['ticket_category'];
|
||||
$ticket_subject = $row['ticket_subject'];
|
||||
$ticket_details = $row['ticket_details'];
|
||||
$ticket_priority = $row['ticket_priority'];
|
||||
$ticket_status = $row['ticket_status'];
|
||||
$ticket_created_at = $row['ticket_created_at'];
|
||||
$ticket_updated_at = $row['ticket_updated_at'];
|
||||
@@ -83,8 +84,6 @@ if(isset($_GET['ticket_id'])){
|
||||
<i class="fas fa-fw fa-ellipsis-v"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="client_print.php?client_id=<?php echo $client_id; ?>">Print</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTicketModal<?php echo $ticket_id; ?>">Edit</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="post.php?delete_client=<?php echo $client_id; ?>">Delete</a>
|
||||
@@ -170,6 +169,7 @@ if(isset($_GET['ticket_id'])){
|
||||
|
||||
<div class="card card-body mb-3">
|
||||
<h4 class="text-secondary">Details</h4>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-thermometer-half text-secondary mr-2 mb-2"></i> <?php echo $ticket_priority; ?></div>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-user text-secondary mr-2 mb-2"></i> <?php echo $name; ?></div>
|
||||
<div class="ml-1"><i class="fa fa-fw fa-clock text-secondary mr-2 mb-2"></i> <?php echo $ticket_created_at; ?></div>
|
||||
</div>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
WHERE tickets.client_id = clients.client_id
|
||||
AND tickets.company_id = $session_company_id
|
||||
AND ticket_status LIKE '%$status%'
|
||||
AND (ticket_id LIKE '%$q%' OR client_name LIKE '%$q%' OR ticket_subject LIKE '%$q%')
|
||||
AND (ticket_number LIKE '%$q%' OR client_name LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_priority LIKE '%$q%')
|
||||
ORDER BY $sb $o LIMIT $record_from, $record_to");
|
||||
|
||||
$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
|
||||
@@ -97,6 +97,7 @@
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=client_name&o=<?php echo $disp; ?>">Client</a></th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_subject&o=<?php echo $disp; ?>">Subject</a></th>
|
||||
<th>Last Response</th>
|
||||
<th><a class="text-dark" href="?<?php echo $url_query_strings_sb; ?>&sb=ticket_priority&o=<?php echo $disp; ?>">Priority</a></th>
|
||||
<th class="text-center">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -107,6 +108,7 @@
|
||||
$ticket_id = $row['ticket_id'];
|
||||
$ticket_subject = $row['ticket_subject'];
|
||||
$ticket_details = $row['ticket_details'];
|
||||
$ticket_priority = $row['ticket_priority'];
|
||||
$ticket_status = $row['ticket_status'];
|
||||
$ticket_created_at = $row['ticket_created_at'];
|
||||
$ticket_updated_at = $row['ticket_updated_at'];
|
||||
@@ -137,8 +139,7 @@
|
||||
<td><a href="client.php?client_id=<?php echo $client_id; ?>&tab=tickets"><?php echo $client_name; ?></a></td>
|
||||
<td><?php echo $ticket_subject; ?></td>
|
||||
<td>Never</td>
|
||||
|
||||
|
||||
<td><?php echo $ticket_priority; ?></td>
|
||||
<td>
|
||||
<div class="dropdown dropleft text-center">
|
||||
<button class="btn btn-secondary btn-sm" type="button" data-toggle="dropdown">
|
||||
|
||||
Reference in New Issue
Block a user