mirror of https://github.com/itflow-org/itflow
Merge pull request #444 from wrongecho/master
Small ticketing / client portal changes
This commit is contained in:
commit
fce20d1a74
|
|
@ -1,10 +1,12 @@
|
|||
<?php
|
||||
define('number_regex', '/[^0-9]/');
|
||||
|
||||
$name = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_name'])));
|
||||
$title = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_title'])));
|
||||
$department = intval($_POST['contact_department']);
|
||||
$phone = preg_replace("/[^0-9]/", '',$_POST['contact_phone']);
|
||||
$extension = preg_replace("/[^0-9]/", '',$_POST['contact_extension']);
|
||||
$mobile = preg_replace("/[^0-9]/", '',$_POST['contact_mobile']);
|
||||
$phone = preg_replace(number_regex, '', $_POST['contact_phone']);
|
||||
$extension = preg_replace(number_regex, '', $_POST['contact_extension']);
|
||||
$mobile = preg_replace(number_regex, '', $_POST['contact_mobile']);
|
||||
$email = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_email'])));
|
||||
$notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_notes'])));
|
||||
$auth_method = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['contact_auth_method'])));
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ $sql_tickets_stale = mysqli_query($mysqli,"SELECT * FROM tickets
|
|||
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo "$ticket_prefix$ticket_number"; ?></td>
|
||||
<td><a href="ticket.php?ticket_id=<?php echo $ticket_id?>"><?php echo "$ticket_prefix$ticket_number"; ?></a</td>
|
||||
<td><?php echo $ticket_subject; ?></td>
|
||||
<td class="text-danger"><?php echo $ticket_created_at; ?></td>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ $contact = mysqli_fetch_array($contact_sql);
|
|||
|
||||
$session_contact_name = $contact['contact_name'];
|
||||
$session_contact_initials = initials($session_contact_name);
|
||||
$session_contact_title = $contact['contact_title'];
|
||||
$session_contact_email = $contact['contact_email'];
|
||||
$session_contact_photo = $contact['contact_photo'];
|
||||
|
||||
|
|
|
|||
|
|
@ -56,9 +56,8 @@ $total_tickets = $row['total_tickets'];
|
|||
<br>
|
||||
|
||||
<?php } ?>
|
||||
<div class="text-dark"><?php echo $contact_name; ?></div>
|
||||
<div><?php echo $contact_title_display; ?></div>
|
||||
<div><?php echo $primary_contact_display; ?></div>
|
||||
<div class="text-dark"><?php echo $session_contact_name; ?></div>
|
||||
<div><?php echo $session_contact_title; ?></div>
|
||||
</th>
|
||||
<th>
|
||||
<div class="">
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ if(isset($_POST['add_ticket'])){
|
|||
$id = mysqli_insert_id($mysqli);
|
||||
|
||||
// Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Create', log_description = 'Client contact $session_contact_name created ticket $subject', log_created_at = NOW(), log_client_id = $client_id, company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Create', log_description = 'Client contact $session_contact_name created ticket $subject', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), log_client_id = $client_id, company_id = $session_company_id");
|
||||
|
||||
header("Location: ticket.php?id=" . $id);
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ if(isset($_GET['close_ticket'])){
|
|||
mysqli_query($mysqli,"INSERT INTO ticket_replies SET ticket_reply = 'Ticket closed by $session_contact_name.', ticket_reply_type = 'Client', ticket_reply_created_at = NOW(), ticket_reply_by = '$session_contact_id', ticket_reply_ticket_id = '$ticket_id', company_id = $session_company_id");
|
||||
|
||||
//Logging
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Closed', log_description = '$ticket_id Closed by client', log_created_at = NOW(), company_id = $session_company_id");
|
||||
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Ticket', log_action = 'Closed', log_description = '$ticket_id Closed by client', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_created_at = NOW(), company_id = $session_company_id");
|
||||
|
||||
header("Location: ticket.php?id=" . $ticket_id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ if(isset($_GET['id']) && intval($_GET['id'])) {
|
|||
|
||||
<span class="navbar-text">
|
||||
<?php
|
||||
if($ticket_status !== "Closed"){ ?>
|
||||
if($ticket['ticket_status'] !== "Closed"){ ?>
|
||||
<button class="btn btn-sm btn-outline-success my-2 my-sm-0 form-inline my-2 my-lg-0" type="submit"><a href="portal_post.php?close_ticket=<?php echo $ticket_id; ?>"><i class="fas fa-fw fa-check text-secondary text-success"></i> Close ticket</a></button>
|
||||
<?php } ?>
|
||||
</span>
|
||||
|
|
@ -94,7 +94,7 @@ if(isset($_GET['id']) && intval($_GET['id'])) {
|
|||
<?php
|
||||
$sql = mysqli_query($mysqli,"SELECT * FROM ticket_replies LEFT JOIN users ON ticket_reply_by = user_id LEFT JOIN contacts ON ticket_reply_by = contact_id WHERE ticket_reply_ticket_id = $ticket_id AND ticket_reply_archived_at IS NULL AND ticket_reply_type != 'Internal' ORDER BY ticket_reply_id DESC");
|
||||
|
||||
while($row = mysqli_fetch_array($sql)){;
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$ticket_reply_id = $row['ticket_reply_id'];
|
||||
$ticket_reply = $row['ticket_reply'];
|
||||
$ticket_reply_created_at = $row['ticket_reply_created_at'];
|
||||
|
|
|
|||
|
|
@ -1182,7 +1182,7 @@ if(isset($_POST['add_telemetry'])){
|
|||
<li>Upload is readable and writeable</li>
|
||||
<li>PHP 7+ Installed</li>
|
||||
</ul>
|
||||
<center><a href="?database" class="btn btn-lg btn-primary mb-5">Install</a></center>
|
||||
<div style="text-align: center;"><a href="?database" class="btn btn-lg btn-primary mb-5">Install</a></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -1519,7 +1519,9 @@ if(isset($_POST['add_telemetry'])){
|
|||
}
|
||||
?>
|
||||
<hr>
|
||||
<center><a href="?database" class="btn btn-primary">Begin Setup <i class="fa fa-fw fa-arrow-alt-circle-right"></i></a></center>
|
||||
<div style="text-align: center;">
|
||||
<a href="?database" class="btn btn-primary">Begin Setup <i class="fa fa-fw fa-arrow-alt-circle-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -560,7 +560,7 @@ if(isset($_GET['ticket_id'])){
|
|||
<option value="">Not Assigned</option>
|
||||
<?php
|
||||
|
||||
$sql_assign_to_select = mysqli_query($mysqli,"SELECT * FROM users, user_companies WHERE users.user_id = user_companies.user_id AND user_companies.company_id = $session_company_id ORDER BY user_name ASC");
|
||||
$sql_assign_to_select = mysqli_query($mysqli,"SELECT * FROM users, user_companies WHERE users.user_id = user_companies.user_id AND user_companies.company_id = $session_company_id AND user_archived_at IS NULL ORDER BY user_name ASC");
|
||||
while($row = mysqli_fetch_array($sql_assign_to_select)){
|
||||
$user_id = $row['user_id'];
|
||||
$user_name = $row['user_name'];
|
||||
|
|
|
|||
Loading…
Reference in New Issue